What I'm trying to do
I'm writing an extension to the sitecore rich text editor that works in the following manner.
- The User clicks a button on the rich text editor toolbar that was added by the extension.
- The extension javascript builds a url that includes the Item ID, Language, Version and database. This URL is used to open a rich editor dialog.
- The dialog shows options that are relevant to the current item
The Problem
I can't find anyway of detecting the following important information about the item that is currently being edited. Can someone tell me how to get this information in javascript:
- The Version number of the item that is being edited.
- The database in which the item resides
Example
RadEditorCommandList["MyCommand"] = function (commandName, editor, tool) {
var dialogUrl = "/sitecore%20modules/MyPluginModule/RichEditorDialog.aspx?";
dialogUrl+= "Id=" + scItemID ;
dialogUrl+= "&language=" + scLanguage;
//////////////////////////////////////////////////////////
// UNKNOWN -- where do I get this information from?
//////////////////////////////////////////////////////////
dialogUrl+= "&database=UNKNOWN";
dialogUrl+= "&version=UNKNOWN";
editor.showExternalDialog(
dialogUrl,
null,
500, // width
200, // height
function(sender, data) {
updateRichTextEditorWithSelectedData(editor, data);
},
null, // callback args
"Dialog Title",
true, // modal
Telerik.Web.UI.WindowBehaviors.Default,
false, // showStatusBar
true // showTitleBar
);
};