1 /* Import plugin specific language pack */
2 tinyMCE.importPluginLanguagePack('save', 'en,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,he');
4 function TinyMCE_save_getInfo() {
7 author : 'Moxiecode Systems',
8 authorurl : 'http://tinymce.moxiecode.com',
9 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_save.html',
10 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
15 * Returns the HTML contents of the save control.
17 function TinyMCE_save_getControlHTML(control_name) {
18 switch (control_name) {
20 return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSave\');" onmousedown="return false;"><img id="{$editor_id}_save" src="{$pluginurl}/images/save.gif" title="{$lang_save_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.switchClass(this,\'mceButtonNormal\');" onmousedown="tinyMCE.switchClass(this,\'mceButtonDown\');" /></a>';
27 * Executes the save command.
29 function TinyMCE_save_execCommand(editor_id, element, command, user_interface, value) {
33 var formObj = tinyMCE.selectedInstance.formElement.form;
36 tinyMCE.triggerSave();
38 // Disable all UI form elements that TinyMCE created
39 for (var i=0; i<formObj.elements.length; i++) {
40 var elementId = formObj.elements[i].name ? formObj.elements[i].name : formObj.elements[i].id;
42 if (elementId.indexOf('mce_editor_') == 0)
43 formObj.elements[i].disabled = true;
46 tinyMCE.isNotDirty = true;
47 tinyMCE.selectedInstance.formElement.form.submit();
49 alert("Error: No form element found.");
53 // Pass to next handler in chain