Hi,
I've written a plugin for inserting custom links, and it works perfectly, as does the entire editor. However for some reason its throwing out a JS error, which although obviously dosent stop it from working, is really annoying. This is it:
Error: FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetState is not a function
Source File: http://localhost/testing/fckeditor/fcke ... e_gecko.js
Line: 60
These are the lines that create the toolbar button:
// Create CMSInternalLink toolbar buttons
var oCMSInternalLink = new FCKToolbarButton('CMSInternalLink', 'Internal Link');
oCMSInternalLink.IconPath = FCKPlugins.Items['CMSCommands'].Path + 'internal.gif';
FCKToolbarItems.RegisterItem('CMSInternalLink', oCMSInternalLink);
Anyone got any ideas? Would be much appreciated.
Thanks,
Jack
Fri, 08/04/2006 - 06:07
#1
RE: FCKeditor works, but is producing a JS error
RE: FCKeditor works, but is producing a JS er
RE: FCKeditor works, but is producing a JS er
RE: FCKeditor works, but is producing a JS error
RE: FCKeditor works, but is producing a JS er
The PHP class doesn’t have an equivalent of ShowErrors, I am assuming because its server side and the errors wouldn’t be relevant. Anyway, the only errors that would be hidden with ShowErrors turned off would be errors that occurred while generating the initial HTML which then loads the editor.
The error I am getting happens when it loads up the toolbars and is related to the custom toolbar button that my plug-in adds.
Thanks so far.
Jack
RE: FCKeditor works, but is producing a JS error
Humour me - just try the comment idea - then I'll shut up, honest LOL
RE: FCKeditor works, but is producing a JS er
Yeah it is pretty much, but everything in the <?php ?> tags is interpreted by PHP on the server, rather than being sent to the browser. Doesn’t have any affect this problem though.
Anyone else got any ideas?
RE: FCKeditor works, but is producing a JS er
// manage the plugins' button behavior
oGrabar.prototype.GetState = function()
{
return FCK_TRISTATE_OFF;
// default behavior, sometimes you wish to have some kind of if statement here
}
RE: FCKeditor works, but is producing a JS er
Thanks! I had no idea you had to add that in. The documentation for the whole plugin creation and custom comand object creation dosent seem to go into as much detail as it could.

All working perfectly now, cheers
RE: FCKeditor works, but is producing a JS er