I've read the other messages on how to add a custom toolbar, but couldn't find one that dealt with adding an image to the toolbar that performs a specific function.
I've added this line to the toolbaritems.js file:
TBI.prototype.Preview = new TBButton("Preview", "Preview Your Work", "doPreview()", TBCMD_CUSTOM) ;
And added this to the default toolbar (config.js):
['EditSource','Preview','-', etc...
The button shows (added the image to the images folder), but the function does not do anything (added to the actions.js file)
function doPreview(){
temp = idContent.document.body.innerHTML;
preWindow= open('', 'previewWindow', 'width=600,height=350,status=yes,scrollbars=yes,resizable=yes,toolbar=no,menubar=yes');
preWindow.document.open();
preWindow.document.write(temp);
preWindow.document.close();
}
The idContent is the ID I gave to the IFRAME.
I think I'm missing something quite basic here, but can't seem to put my finger on it.
Thank You
I've added this line to the toolbaritems.js file:
TBI.prototype.Preview = new TBButton("Preview", "Preview Your Work", "doPreview()", TBCMD_CUSTOM) ;
And added this to the default toolbar (config.js):
['EditSource','Preview','-', etc...
The button shows (added the image to the images folder), but the function does not do anything (added to the actions.js file)
function doPreview(){
temp = idContent.document.body.innerHTML;
preWindow= open('', 'previewWindow', 'width=600,height=350,status=yes,scrollbars=yes,resizable=yes,toolbar=no,menubar=yes');
preWindow.document.open();
preWindow.document.write(temp);
preWindow.document.close();
}
The idContent is the ID I gave to the IFRAME.
I think I'm missing something quite basic here, but can't seem to put my finger on it.
Thank You
RE: Adding custom toolbar functions
Just change the line:
temp = idContent.document.body.innerHTML;
to
temp = objContent.DOM.body.innerHTML;
RE: Adding custom toolbar functions
I have 2 or 3 other additions that provide functionality like this - will post them as I go.
A quick followup - right now, the preview icon appears grayed out; similar to the link icons when nothing is highlighted. How would I show the icon as 'active'?
Thank You.
Customising FCK EDITOR SAVE ICON
Could any one please let me know which function is exaclty getting called on click of save button and where it is existing(I mean in which file). And is there anyway to customize that save function. Please let me know as soon as possible..
Thanks & Regards,
Ravi.