Hi,
I've made a plugin, inserting a string into the editor at cursor position:
var FCKinserthtml = function(name) {
this.Name = name;
}
FCKinserthtml.prototype.Execute = function() {
var oEditor = FCKeditorAPI.GetInstance( instanceName ) ;
var currContent = oEditor.GetXHTML( true ) ;
oEditor.setHTML( currContent + '<p>[HTML]<br><br>[/HTML]</p>' ) ;
}
FCKinserthtml.prototype.GetState = function() {
return FCK_TRISTATE_OFF;
}
FCKCommands.RegisterCommand( 'inserthtml', new FCKinserthtml('inserthtml'));
var oinserthtmlItem = new FCKToolbarButton( 'inserthtml', FCKLang.inserthtmlBtn, null, null, false, true) ;
oinserthtmlItem.IconPath = FCKPlugins.Items['inserthtml'].Path + 'inserthtml.gif' ;
FCKToolbarItems.RegisterItem( 'inserthtml', oinserthtmlItem );
The insert action works just fine but after inserting the string the cursor jumps to the first position in the editor window.
All I want is, that the cursor jumps between the two <br> after instering the string:
<p>[HTML]<br>cursor should jump here after inserting<br>[/HTML]</p>
And another issue:
How do I get the instanceName dynamically?
Please help.
Thx in advance
Greetings
Hurga
I've made a plugin, inserting a string into the editor at cursor position:
var FCKinserthtml = function(name) {
this.Name = name;
}
FCKinserthtml.prototype.Execute = function() {
var oEditor = FCKeditorAPI.GetInstance( instanceName ) ;
var currContent = oEditor.GetXHTML( true ) ;
oEditor.setHTML( currContent + '<p>[HTML]<br><br>[/HTML]</p>' ) ;
}
FCKinserthtml.prototype.GetState = function() {
return FCK_TRISTATE_OFF;
}
FCKCommands.RegisterCommand( 'inserthtml', new FCKinserthtml('inserthtml'));
var oinserthtmlItem = new FCKToolbarButton( 'inserthtml', FCKLang.inserthtmlBtn, null, null, false, true) ;
oinserthtmlItem.IconPath = FCKPlugins.Items['inserthtml'].Path + 'inserthtml.gif' ;
FCKToolbarItems.RegisterItem( 'inserthtml', oinserthtmlItem );
The insert action works just fine but after inserting the string the cursor jumps to the first position in the editor window.
All I want is, that the cursor jumps between the two <br> after instering the string:
<p>[HTML]<br>cursor should jump here after inserting<br>[/HTML]</p>
And another issue:
How do I get the instanceName dynamically?
Please help.
Thx in advance
Greetings
Hurga