Hai all,
I have a requirement.I need to place some DOM elements like combo box,... and i want to add some events on that like onselectionchange event. for this i added a plugin,if i click that plugin a combo box will be added to fck editor.The code for this is
var saveCommand = function() { this.Name = 'Save'; }
saveCommand.prototype.GetState = function() { return FCK_TRISTATE_OFF; }
saveCommand.prototype.Execute = function()
{
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
oDom=oEditor.EditorDocument.body;
addselect(oDom);
}
function addselect(oDom)
{
var boldtype = document.createElement('Select');
boldtype.setAttribute('name', 'selectheader');
oDom.appendChild(boldtype);
boldtype.options[0] = new Option('Select Header','Select Header');
boldtype.options[1] = new Option('Header1','Header1');
boldtype.options[2] = new Option('Header2','Header2');
boldtype.options[3] = new Option('Header3','Header3');
}
FCKCommands.RegisterCommand( 'Header', new saveCommand() ) ;
// Create the "Header" toolbar button.
var oFindItem = new FCKToolbarButton( 'Header', FCKLang['DlgDHTitle'] ) ;
oFindItem.IconPath = FCKConfig.PluginsPath + 'Header/HeaderImg.jpg' ;
FCKToolbarItems.RegisterItem( 'Header', oFindItem ) ; // 'Header' is the name used in the Toolbar config.
.......
It is added to fck editor but how can i handle the events on that combo box
I have a requirement.I need to place some DOM elements like combo box,... and i want to add some events on that like onselectionchange event. for this i added a plugin,if i click that plugin a combo box will be added to fck editor.The code for this is
var saveCommand = function() { this.Name = 'Save'; }
saveCommand.prototype.GetState = function() { return FCK_TRISTATE_OFF; }
saveCommand.prototype.Execute = function()
{
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
oDom=oEditor.EditorDocument.body;
addselect(oDom);
}
function addselect(oDom)
{
var boldtype = document.createElement('Select');
boldtype.setAttribute('name', 'selectheader');
oDom.appendChild(boldtype);
boldtype.options[0] = new Option('Select Header','Select Header');
boldtype.options[1] = new Option('Header1','Header1');
boldtype.options[2] = new Option('Header2','Header2');
boldtype.options[3] = new Option('Header3','Header3');
}
FCKCommands.RegisterCommand( 'Header', new saveCommand() ) ;
// Create the "Header" toolbar button.
var oFindItem = new FCKToolbarButton( 'Header', FCKLang['DlgDHTitle'] ) ;
oFindItem.IconPath = FCKConfig.PluginsPath + 'Header/HeaderImg.jpg' ;
FCKToolbarItems.RegisterItem( 'Header', oFindItem ) ; // 'Header' is the name used in the Toolbar config.
.......
It is added to fck editor but how can i handle the events on that combo box