Ignore:
Timestamp:
11/11/08 00:24:51 (11 years ago)
Author:
ray
Message:
  • #326 make it possible to choose from different icon sets
  • #1323 allow skins to have meta information (author, etc.)
  • #1322 [SaveSubmit?] error when form action is empty
  • #1321 [SaveSubmit?] icon is in "changed" state initially
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/SaveSubmit/SaveSubmit.js

    r1067 r1113  
    1414        this.textarea = this.editor._textArea; 
    1515 
    16         this.image_changed = Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_red.gif"; 
    17         this.image_unchanged = Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_green.gif"; 
     16        cfg.registerIcon('savesubmitchanged', Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_red.gif"); 
     17        cfg.registerIcon('savesubmitunchanged', Xinha.getPluginDir("SaveSubmit")+"/img/ed_save_green.gif"); 
     18 
    1819        cfg.registerButton({ 
    1920        id       : "savesubmit", 
    2021        tooltip  : self._lc("Save"), 
    21         image    : this.image_unchanged, 
     22        image    : cfg.iconList.savesubmitunchanged, 
    2223        textMode : false, 
    2324        action   :  function() { 
     
    4344} 
    4445 
    45 SaveSubmit.prototype.onGenerateOnce = function() { 
    46         this.initial_html = this.editor.getInnerHTML(); 
    47 } 
    48  
    4946SaveSubmit.prototype.onKeyPress = function(ev) { 
    5047        if ( ev.ctrlKey && this.editor.getKey(ev) == 's') { 
     
    6764} 
    6865SaveSubmit.prototype.onUpdateToolbar = function () { 
     66  if (!this.initial_html) this.initial_html = this.editor.getInnerHTML(); 
    6967        if (!this.changed) { 
    7068                if (this.getChanged()) this.setChanged(); 
     
    8179} 
    8280SaveSubmit.prototype.setChanged = function() { 
    83         this.editor._toolbarObjects.savesubmit.swapImage(this.image_changed); 
     81        this.editor._toolbarObjects.savesubmit.swapImage(this.editor.config.iconList.savesubmitchanged); 
    8482        this.editor.updateToolbar(); 
    8583} 
    8684SaveSubmit.prototype.setUnChanged = function() { 
    8785        this.changed = false; 
    88         this.editor._toolbarObjects.savesubmit.swapImage(this.image_unchanged); 
     86        this.editor._toolbarObjects.savesubmit.swapImage(this.editor.config.iconList.savesubmitunchanged); 
    8987} 
    9088SaveSubmit.prototype.changedReset = function() { 
     
    108106                content += ((i>0) ? '&' : '') + form.elements[i].name + '=' + encodeURIComponent(form.elements[i].value); 
    109107        } 
    110  
    111         Xinha._postback(editor._textArea.form.action, content, function(getback) { 
     108        var url = editor._textArea.form.action || window.location.href; 
     109        Xinha._postback(url, content, function(getback) { 
    112110 
    113111                if (getback) { 
Note: See TracChangeset for help on using the changeset viewer.