Changeset 609
- Timestamp:
- 11/22/06 10:48:13 (7 years ago)
- Location:
- trunk/plugins/SaveSubmit
- Files:
-
- 1 added
- 1 modified
-
README.txt (added)
-
save-submit.js (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/SaveSubmit/save-submit.js
r562 r609 3 3 ____________________ 4 4 5 Registers a button for submiting the Xinha form using asynchronous 6 postback for sending the data to the server 7 8 Usage: This should be a drop-in replacement for a normal submit button. 9 While saving a message is displayed to inform the user what's going on. 10 On successful transmission the output of the target script is shown, so it should print some information 11 about the success of saving. 5 See README.txt for information 12 6 13 7 \*------------------------------------------*/ … … 33 27 }); 34 28 cfg.addToolbarElement("savesubmit", "popupeditor", -1); 35 } ;29 } 36 30 37 31 SaveSubmit.prototype._lc = function(string) { 38 32 return HTMLArea._lc(string, 'SaveSubmit'); 39 } ;33 } 40 34 41 35 SaveSubmit._pluginInfo = { … … 48 42 sponsor_url : "", 49 43 license : "htmlArea" 50 } ;44 } 51 45 52 46 SaveSubmit.prototype.onGenerate = function() { … … 57 51 return self.onEvent(HTMLArea.is_ie ? self.editor._iframe.contentWindow.event : event); 58 52 }); 59 } ;53 } 60 54 61 55 SaveSubmit.prototype.onEvent = function(ev) { … … 69 63 if (!this.changed) { 70 64 if (this.getChanged()) this.setChanged(); 71 } ;72 } ;73 } ;65 } 66 } 67 } 74 68 75 69 SaveSubmit.prototype.getChanged = function() { … … 88 82 if (btn.name == 'savesubmit') { 89 83 btn.swapImage(this.imgage_changed); 90 } ;91 } ;84 } 85 } 92 86 this.editor.updateToolbar(); 93 } ;87 } 94 88 SaveSubmit.prototype.changedReset = function() { 95 89 this.changed = false; … … 100 94 if (btn.name == 'savesubmit') { 101 95 btn.swapImage(this.imgage_unchanged); 102 } ;103 } ;104 } ;96 } 97 } 98 } 105 99 106 100 SaveSubmit.prototype.save = function(editor) { … … 123 117 //self.setMessage(self._lc("Ready")); 124 118 self.changedReset(); 125 } ;119 } 126 120 removeMessage = function() { self.removeMessage()} ; 127 121 window.setTimeout("removeMessage()",1000); 128 122 129 123 }); 130 } ;124 } 131 125 132 126 SaveSubmit.prototype.setMessage = function(string) { … … 135 129 var elt = document.getElementById("message_sub_" + textarea.name); 136 130 elt.innerHTML = HTMLArea._lc(string, 'SaveSubmit'); 137 } ;131 } 138 132 139 133 SaveSubmit.prototype.removeMessage = function() { … … 141 135 if (!document.getElementById("message_" + textarea.name)) { return ; } 142 136 document.body.removeChild(document.getElementById("message_" + textarea.name)); 143 } ;137 } 144 138 145 139 //ripped mokhet's loading message function … … 168 162 loading_message.appendChild(loading_sub); 169 163 document.body.appendChild(loading_message); 170 } ;164 }
