I have a nice little save icon that i would like to use and insert into the toolbar and get rid of the save button at the bottom.
how do i edit the .js files to accomodate this. and what save function do i use.
how do i edit the .js files to accomodate this. and what save function do i use.
RE: Custome SAVE button
function dialogSave()
{
var html = FCKShowDialog("www.nuvo.biz", window, 400, 380);
// The response is the IMG tag HTML
if (html) insertHtml(html) ;
objContent.focus() ;
}
how do i do that.
cheers aron.
RE: Custome SAVE button
thanks
scott
sctsharpe@yahoo.co.uk
RE: Custome SAVE button
You will neet to create a Save button and put it in /images/toolbar/button.save.gif. I can provide mine upon request.
Modify your toolbar to have 'Save', here's mine:
//fckeditor.custom.js
config.ToolbarSets["Default"] = [
['Open','Save','Preview','Email','-','MergeTag','-','EditSource'] ,
['Cut','Copy','Paste','PasteText','PasteWord','-','Find','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Link','RemoveLink','-','Image','Table','Rule','SpecialChar','Smiley','-','About'] ,
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','InsertOrderedList','InsertUnorderedList','-','Outdent','Indent','-','ShowTableBorders','ShowDetails'] ,
['FontStyle','-','FontFormat','-','Font','-','FontSize','-','TextColor','BGColor']
] ;
Add something like:
//fckeditor.custom.js
TBI.prototype.Save = new TBButton("Save", "Save", "doSave()", TBCMD_CUSTOM) ;
this will modify the TBI object to handle the new button.
Add some code like, function name has to match the one above:
//fckeditor.custom.js
function doSave() {
var html = FCKShowDialog("dialog/p_save.php", window, 600, 400) ;
objContent.focus() ;
}
As for actually saving the content I only know PHP. But to outline what I do:
-dialog retrieves editor content using JS, in the <head> section
// Gets the document DOM
var oDOM = dialogArguments.objContent.DOM;
// Gets the content.
var content = oDOM.body.innerHTML ;
-the user specifies a name for saving and clicks a save "button" (not "submit" button). The onclick does this:
function saveFile() {
frmSave.emailContent.value = content;
var oWindow = openNewWindow("", "StatusWindow", 400, 300) ;
frmSave.submit();
}
You will need a hidden field named "emailContent", this will simply POST the data to the server and you can write whatever script ASP/PHP you need to save the content.
HTH,
Marcus
bsides2 at hotmail dot com
RE: Custome SAVE button
cheers aron.
RE: Custome SAVE button
To achieve what you are saying using PHP (I assume ASP wouldn't be too much different) I would still use JS to put the editor content into a hidden input to allow the content to be POSTed to the server when submitting the form (<form><input=hidden></form>). You could modify what I suggested previously to achieve this.
You could have a FORM whose ACTION=master.asp, this master script could first check if it needs to perform the save before proceeding. This method becomes difficult if the save doesn't succeed and you want to return to your content, whereas a popup leaves the original content intact.
Everyone's save routine is going to be different. Some will use popups, others will not, some to database others to files. I don't know how much what I have suggested will help, it's really just another example.
RE: Custome SAVE button
thanks to your help in the forum i am able to show the content of the editor in the 'save.php' popup-window. but i only get the editor content, not the rest of my form. following is an extract of my form-config:
<form name="form1" action="save.php" method="post">
$oFCKeditor = new FCKeditor ;
$oFCKeditor->Value = $html_text ;
$oFCKeditor->CreateFCKeditor 'EditorDefault','100%','95%') ;
<input type="text" name="link" value="<?=$link?>" size="30">
<input type="text" name="catagory" value="<?=$catagory?>" size="30">
<input type="text" name="author" value="<?=$author?>" size="30"> erstellt am : <?=$datum?> Datum eingeben ändern : <input type="text" name="date" value="<?=$date?>" size="8" style="text-align:center">
</form>
since the editor is within the <form> as well as the <input> fields, it should be possible to send the fileds-content together with the editor-content to my 'save.php' popup-window.
how do i get the content of the <input> fields to
the 'save.php' popup-window, together with my editor content ??
i am not that familiar with JS and consequently i don't unterstand some of your code.
- is there some microsoft JS special scripting included ?
- if yes, where can i get/download a reference ?
hope you or somebody else can/will help me.
RE: Custome SAVE button