javascript-console-share/src/main/amp/web/fme/components/jsconsole/javascript-console.js
/**
         * Fired when the user selects a script from the save scripts drop down
         * menu. Calls a repository webscript to store the script contents.
         *
         * @method onLoadScriptClick
         */
Fired when the user selects a script from the save scripts drop down
menu. Calls a repository webscript to store the script contents.


Fired when the user selects a script from the save scripts drop down menu . Calls a repository webscript to store the script contents .
function ACJC_onSaveScriptClick(p_sType, p_aArgs, self) {
          self.widgets.codeMirrorScript.save();
          var menuItem = p_aArgs[1];
          var filename = menuItem.cfg.getProperty("text");
          var nodeRef = menuItem.value;
          if (nodeRef == "NEW") {
              Alfresco.util.PopupManager.getUserInput(
              {
                  title: self.msg("title.save.choose.filename"),
                  text: self.msg("message.save.choose.filename"),
                  input: "text",
                  callback: {
                      fn: self.saveAsNewScript,
                      obj: [ ],
                      scope: self
                  }
              });
          } else {
              Alfresco.util.PopupManager.displayPrompt
              ({
                 title: self.msg("title.confirm.save"),
                 text: self.msg("message.confirm.save", filename),
                 buttons: [
                 {
                     text: self.msg("button.save"),
                     handler: function ACJC_onSaveScriptClick_save()
                     {
                         this.destroy();
                         self.saveAsExistingScript(filename, nodeRef);
                     }
                 },
                 {
                     text: self.msg("button.cancel"),
                     handler: function ACJC_onSaveScriptClick_cancel()
                     {
                         this.destroy();
                     },
                     isDefault: true
                 }]
              });
          }
       }
function ACJC_onSaveScriptClick ( p_sType , p_aArgs , self ) { self . widgets . codeMirrorScript . save ( ) ; var menuItem = p_aArgs [ 1 ] ; var filename = menuItem . cfg . getProperty ( "text" ) ; var nodeRef = menuItem . value ; if ( nodeRef == "NEW" ) { Alfresco . util . PopupManager . getUserInput ( { title : self . msg ( "title.save.choose.filename" ) , text : self . msg ( "message.save.choose.filename" ) , input : "text" , callback : { fn : self . saveAsNewScript , obj : [ ] , scope : self } } ) ; } else { Alfresco . util . PopupManager . displayPrompt ( { title : self . msg ( "title.confirm.save" ) , text : self . msg ( "message.confirm.save" , filename ) , buttons : [ { text : self . msg ( "button.save" ) , handler : function ACJC_onSaveScriptClick_save ( ) { this . destroy ( ) ; self . saveAsExistingScript ( filename , nodeRef ) ; } } , { text : self . msg ( "button.cancel" ) , handler : function ACJC_onSaveScriptClick_cancel ( ) { this . destroy ( ) ; } , isDefault : true } ] } ) ; } }
Fired when the user selects a script from the save scripts drop down
 menu.
Fired when the user selects a script from the save scripts drop down menu .