MWF.xApplication.process = MWF.xApplication.process || {}; MWF.xApplication.process.ScriptDesigner = MWF.xApplication.process.ScriptDesigner || {}; MWF.xDesktop.requireApp("process.ScriptDesigner", "Main", null, false); MWF.xApplication.service.ScriptDesigner.options = { "multitask": true, "executable": false }; MWF.xDesktop.requireApp("service.ScriptDesigner", "Script", null, false); MWF.xApplication.service.ScriptDesigner.Main = new Class({ Extends: MWF.xApplication.process.ScriptDesigner.Main, Implements: [Options, Events], options: { "style": "default", "name": "service.ScriptDesigner", "icon": "icon.png", "title": MWF.APPSD.LP.title, "appTitle": MWF.APPSD.LP.title, "id": "", "actions": null, "category": null }, onQueryLoad: function(){ if (this.status){ this.options.id = this.status.id; } if (!this.options.id){ this.options.desktopReload = false; this.options.title = this.options.title + "-"+MWF.APPSD.LP.newScript; } this.actions = MWF.Actions.get("x_program_center"); this.lp = MWF.xApplication.process.ScriptDesigner.LP; this.addEvent("queryClose", function(e){ if (this.explorer && this.explorer.app && this.explorer.app.window){ this.explorer.reload(); } }.bind(this)); }, getApplication:function(callback){ if (callback) callback(); }, loadScriptList: function() { this.actions.listScript(function (json) { json.data.each(function(script){ this.createListScriptItem(script); }.bind(this)); }.bind(this), null, false); }, addIncludeToList: function(name){ this.actions.getScriptByName(name, function(json){ var script = json.data; var includeScriptItem = new Element("div", {"styles": this.css.includeScriptItem}).inject(this.propertyIncludeListArea); var includeScriptItemAction = new Element("div", {"styles": this.css.includeScriptItemAction}).inject(includeScriptItem); var includeScriptItemText = new Element("div", {"styles": this.css.includeScriptItemText}).inject(includeScriptItem); includeScriptItemText.set("text", script.name+" ("+script.alias+")"); includeScriptItem.store("script", script); var _self = this; includeScriptItemAction.addEvent("click", function(){ var node = this.getParent(); var script = node.retrieve("script"); if (script){ _self.scriptTab.showPage.script.data.dependScriptList.erase(script.name); } node.destroy(); }); }.bind(this), function(){ this.scriptTab.showPage.script.data.dependScriptList.erase(name); }.bind(this)); }, loadScriptByData: function(node, e){ var script = node.retrieve("script"); var openNew = true; for (var i = 0; i