Просмотр исходного кода

[平台配置]增加平台配置

st 5 лет назад
Родитель
Сommit
08c2556fad
27 измененных файлов с 1584 добавлено и 0 удалено
  1. BIN
      o2web/source/x_component_ConfigDesigner/$Main/appicon.png
  2. 232 0
      o2web/source/x_component_ConfigDesigner/$Main/default/css.wcss
  3. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/icon.png
  4. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/script.png
  5. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/formExplode.gif
  6. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/formExplode_gray.gif
  7. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/formImplode.gif
  8. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/formImplode_gray.gif
  9. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/help.png
  10. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/preview.png
  11. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/print.gif
  12. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/print_gray.gif
  13. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/save.gif
  14. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/saveNew.gif
  15. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/saveNew_gray.gif
  16. BIN
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/save_gray.gif
  17. 88 0
      o2web/source/x_component_ConfigDesigner/$Main/default/toolbars.html
  18. 120 0
      o2web/source/x_component_ConfigDesigner/$Main/default/tools.json
  19. 54 0
      o2web/source/x_component_ConfigDesigner/$Script/default/css.wcss
  20. BIN
      o2web/source/x_component_ConfigDesigner/$Script/default/icon/add.png
  21. BIN
      o2web/source/x_component_ConfigDesigner/$Script/default/icon/col.png
  22. BIN
      o2web/source/x_component_ConfigDesigner/$Script/default/icon/del.png
  23. BIN
      o2web/source/x_component_ConfigDesigner/$Script/default/icon/exp.png
  24. BIN
      o2web/source/x_component_ConfigDesigner/$Script/default/icon/sel.png
  25. 759 0
      o2web/source/x_component_ConfigDesigner/Main.js
  26. 300 0
      o2web/source/x_component_ConfigDesigner/Script.js
  27. 31 0
      o2web/source/x_component_ConfigDesigner/lp/zh-cn.js

BIN
o2web/source/x_component_ConfigDesigner/$Main/appicon.png


+ 232 - 0
o2web/source/x_component_ConfigDesigner/$Main/default/css.wcss

@@ -0,0 +1,232 @@
+{
+	"propertyNode": {
+		"width": "300px",
+		"overflow": "hidden",
+		"float": "right",
+		"-webkit-user-select": "text",
+		"-moz-user-select": "text" 
+	},
+	"scriptListNode": {
+        "width": "260px",
+        "overflow": "hidden",
+        "border": "1px solid #505050",
+        "height": "100%",
+        "float": "left",
+        "background-color": "#EEE"
+	},
+
+	"contentNode": {
+		"margin-right": "301px",
+		"border-right": "1px solid #505050",
+		"border-left": "1px solid #505050",
+		"background-color": "#FFF",
+		"-webkit-user-select": "none",
+		"-moz-user-select": "none" 
+	},
+
+    "scriptListResizeNode": {
+        "width": "3px",
+        "float": "right",
+        "background-color": "#505050",
+        "margin-right": "2px",
+        "cursor": "col-resize"
+    },
+    "scriptListAreaSccrollNode": {
+        "margin": "4px",
+        "margin-right": "8px",
+        "overflow": "hidden",
+        "background-color": "#FFF",
+        "border-top": "1px solid #999",
+        "border-left": "1px solid #999",
+        "border-bottom": "1px solid #DDD",
+        "border-right": "1px solid #DDD"
+    },
+    "scriptListAreaNode": {
+        "overflow": "hidden"
+    },
+
+
+    "scriptListTitleNode": {
+        "height": "26px",
+        "background-color": "#505050",
+        "border-radius": "0px",
+        "margin": "2px",
+        "color": "#FFF",
+        "line-height": "26px",
+        "font-size": "12px",
+        "font-weight": "bold",
+        "padding-left": "10px",
+        "clear": "both"
+    },
+
+    "listScriptItem": {
+        "height": "24px",
+        "line-height": "24px",
+        "margin": "3px 10px 0px 10px",
+        "cursor": "pointer",
+        "background": "#FFF",
+        "color": "#333"
+    },
+    "listScriptItem_over": {
+        "background": "#e8eef7"
+    },
+    "listScriptItem_current": {
+        "background": "#48638f",
+        "color": "#FFF"
+    },
+    "listScriptItemIcon": {
+        "height": "24px",
+        "width": "26px",
+        "background": "url("+"../x_component_process_ScriptDesigner/$Main/default/script.png) no-repeat center center",
+        "float": "left"
+    },
+    "listScriptItemText": {
+        "height": "24px",
+        "margin-left": "28px",
+        "white-space": "nowrap"
+    },
+
+    "includeTitleNode": {
+        "height": "24px",
+        "background-color": "#EEE",
+        "border-bottom": "#999",
+        "line-height": "24px"
+    },
+    "includeTitleActionNode": {
+        "height": "24px",
+        "width": "30px",
+        "background": "url("+"../x_component_process_ScriptDesigner/$Script/default/icon/add.png) no-repeat center center",
+        "float": "right",
+        "cursor": "pointer"
+    },
+    "includeTitleTextNode": {
+        "margin": "0px 35px 0px 5px",
+        "height": "24px"
+    },
+    "includeScriptItem": {
+        "height": "26px",
+        "line-height": "26px",
+        "border-bottom": "1px solid #999",
+        "padding": "0px 0px 0px 10px",
+        "cursor": "pointer"
+    },
+    "includeScriptItemAction": {
+        "height": "26px",
+        "width": "30px",
+        "background": "url("+"../x_component_process_ScriptDesigner/$Script/default/icon/del.png) no-repeat center center",
+        "float": "right",
+        "cursor": "pointer"
+    },
+    "includeScriptItemText": {
+        "height": "26px",
+        "margin-right": "30px"
+    },
+
+    "propertyItemTitleNode": {
+        "height": "24px",
+        "line-height": "24px",
+        "font-size": "12px",
+        "font-weight": "bold",
+        "margin": "10px 10px 0px 10px"
+    },
+    "propertyTextNode": {
+        "height": "24px",
+        "line-height": "24px",
+        "font-size": "12px",
+        "margin": "0px 10px",
+        "color": "#666"
+    },
+    "propertyInputNode": {
+        "display": "block",
+        "width": "90%",
+        "margin": "0px 10px",
+        "border": "1px solid #999",
+        "height": "20px",
+        "line-height": "20px"
+    },
+    "propertyInputAreaNode": {
+        "display": "block",
+        "width": "90%",
+        "margin": "0px 10px",
+        "border": "1px solid #999",
+        "height": "60px",
+        "overflow": "auto"
+    },
+
+
+
+	"contentToolbarNode": {
+		"height": "30px"
+	},
+	"editContentNode": {
+		"overflow": "hidden",
+		"background": "#CCC",
+		"-webkit-user-select": "none",
+		"-moz-user-select": "none" 
+	},
+	"designFrame": {
+		"width": "100%",
+		"height": "100%",
+		"border": "0px"
+	},
+	"designBody": {
+		"margin": "0px"
+	},
+	"designNode": {
+		//"height": "100%",
+		"width": "auto",
+		"margin": "15px",
+		"box-shadow": "0px 0px 20px #606060", 
+		"background": "#FFF",
+		"-webkit-user-select": "none",
+		"overflow": "hidden",
+		"-moz-user-select": "none" 
+	},
+	"propertyTitleNode": {
+		"height": "26px",
+		"background-color": "#505050",
+		"border-radius": "0px",
+		"margin": "2px",
+		"color": "#FFF",
+		"line-height": "26px",
+		"font-size": "12px",
+		"font-weight": "bold",
+		"padding-left": "10px",
+		"clear": "both"
+	},
+	"propertyResizeBar": {
+		"width": "3px",
+		"float": "left",
+		"background-color": "#505050",
+		"margin-left": "2px",
+		"cursor": "col-resize"
+	},
+	"propertyContentNode": {
+		"background-color": "#EEE",
+		"border-radius": "0px",
+		"margin": "2px",
+		"margin-left": "7px",
+		"padding-right": "0px",
+		"overflow": "hidden"
+	},
+	"propertyContentResizeNode": {
+		"height": "3px",
+		"background-color": "#505050",
+		"cursor": "row-resize"
+	},
+	"propertyDomArea": {
+		"overflow": "hidden",
+		"background": "#FFF",
+		"margin": "2px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"border-top": "1px solid #999",
+		"border-left": "1px solid #999",
+		"border-bottom": "1px solid #DDD",
+		"border-right": "1px solid #DDD"
+	},
+	"propertyContentArea": {
+		"overflow": "hidden",
+		"background": "#FFF",
+		"margin-bottom": "2px"
+	}
+}

BIN
o2web/source/x_component_ConfigDesigner/$Main/default/icon.png


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/script.png


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/formExplode.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/formExplode_gray.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/formImplode.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/formImplode_gray.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/help.png


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/preview.png


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/print.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/print_gray.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/save.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/saveNew.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/saveNew_gray.gif


BIN
o2web/source/x_component_ConfigDesigner/$Main/default/toolbar/save_gray.gif


+ 88 - 0
o2web/source/x_component_ConfigDesigner/$Main/default/toolbars.html

@@ -0,0 +1,88 @@
+<div id="MWFFormToolbar">
+	<span MWFnodetype="MWFToolBarSeparator"></span>
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="save.gif" title="保存脚本" MWFButtonAction="saveScript" MWFButtonText=""></span>
+<!--	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="saveNew.gif" title="数据字典另存为" MWFButtonAction="saveScriptAs" MWFButtonText=""></span>-->
+<!--	-->
+<!--	<span MWFnodetype="MWFToolBarSeparator"></span>-->
+<!--	-->
+<!--	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formExplode.gif" title="数据字典导出" MWFButtonAction="scriptExplode" MWFButtonText=""></span>-->
+<!--	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formImplode.gif" title="数据字典导入" MWFButtonAction="scriptImplode" MWFButtonText=""></span>-->
+
+<!--    <span MWFnodetype="MWFToolBarSeparator"></span>-->
+<!--	-->
+<!--	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="help.png" title="帮助" MWFButtonAction="scriptHelp" MWFButtonText="" id="MWFScriptAutoCode"></span>-->
+
+    <span MWFnodetype="MWFToolBarSeparator"></span>
+    <input type="checkbox" value="autoSave" id="MWFScriptAutoSaveCheck">自动保存
+
+
+
+    <div style="float: right; margin-right: 20px">字体大小:<select MWFnodetype="fontSize">
+        <option value="12px">12px</option>
+        <option value="13px">13px</option>
+        <option value="14px">14px</option>
+        <option value="15px">15px</option>
+        <option value="16px">16px</option>
+        <option value="17px">17px</option>
+        <option value="18px">18px</option>
+        <option value="20px">20px</option>
+        <option value="22px">22px</option>
+        <option value="24px">24px</option>
+        <option value="26px">26px</option>
+        <option value="28px">28px</option>
+        <option value="30px">30px</option>
+        <option value="32px">32px</option>
+        <option value="34px">34px</option>
+        <option value="36px">36px</option>
+    </select></div>
+
+    <div style="float: right; margin-right: 20px">样式:<select MWFnodetype="theme">
+        <option value="ambiance">ambiance</option>
+        <option value="chaos">chaos</option>
+        <option value="chrome">chrome</option>
+        <option value="clouds">clouds</option>
+        <option value="clouds_midnight">clouds_midnight</option>
+        <option value="cobalt">cobalt</option>
+        <option value="crimson_editor">crimson_editor</option>
+        <option value="dawn">dawn</option>
+        <option value="dreamweaver">dreamweaver</option>
+        <option value="eclipse">eclipse</option>
+        <option value="github">github</option>
+        <option value="idle_fingers">idle_fingers</option>
+        <option value="iplastic">iplastic</option>
+        <option value="katzenmilch">katzenmilch</option>
+        <option value="kr_theme">kr_theme</option>
+        <option value="kuroir">kuroir</option>
+        <option value="merbivore">merbivore</option>
+        <option value="merbivore_soft">merbivore_soft</option>
+        <option value="mono_industrial">mono_industrial</option>
+        <option value="monokai">monokai</option>
+        <option value="pastel_on_dark">pastel_on_dark</option>
+        <option value="solarized_dark">solarized_dark</option>
+        <option value="solarized_light">solarized_light</option>
+        <option value="sqlserver">sqlserver</option>
+        <option value="terminal">terminal</option>
+        <option value="textmate">textmate</option>
+        <option selected value="tomorrow">tomorrow</option>
+        <option value="tomorrow_night">tomorrow_night</option>
+        <option value="tomorrow_night_blue">tomorrow_night_blue</option>
+        <option value="tomorrow_night_bright">tomorrow_night_bright</option>
+        <option value="tomorrow_night_eighties">tomorrow_night_eighties</option>
+        <option value="twilight">twilight</option>
+        <option value="vibrant_ink">vibrant_ink</option>
+        <option value="xcode">xcode</option>
+    </select></div>
+    <div style="float: right; margin-right: 20px">样式:<select MWFnodetype="monaco-theme">
+        <option value="vs">Visual Studio</option>
+        <option value="vs-dark">Visual Studio Dark</option>
+        <option value="hc-black">High Contrast Dark</option>
+    </select></div>
+
+    <div style="float: right; margin-right: 20px">脚本编辑器:<select MWFnodetype="editor">
+        <option selected value="ace">ace</option>
+        <option value="monaco">monaco</option>
+    </select></div>
+
+
+
+</div>

+ 120 - 0
o2web/source/x_component_ConfigDesigner/$Main/default/tools.json

@@ -0,0 +1,120 @@
+{
+  "label": {
+    "icon": "label.png",
+    "text": "文本",
+    "className": "Label"
+  },
+  "textfield": {
+    "icon": "textfield.png",
+    "text": "域",
+    "className": "Textfield"
+  },
+  "personfield": {
+    "icon": "personfield.png",
+    "text": "人员",
+    "className": "Personfield"
+  },
+  "calendar": {
+    "icon": "calendar.png",
+    "text": "日期选择",
+    "className": "Calendar"
+  },
+  "textarea": {
+    "icon": "textarea.png",
+    "text": "多行文本",
+    "className": "Textarea"
+  },
+  "select": {
+    "icon": "select.png",
+    "text": "下拉框",
+    "className": "Select"
+  },
+  "radio": {
+    "icon": "radio.png",
+    "text": "单选框",
+    "className": "Radio"
+  },
+  "checkbox": {
+    "icon": "checkbox.png",
+    "text": "多选框",
+    "className": "Checkbox"
+  },
+  "button": {
+    "icon": "button.png",
+    "text": "按钮",
+    "className": "Button"
+  },
+
+  "Actionbar": {
+    "icon": "actionbar.png",
+    "text": "操作条",
+    "className": "Actionbar"
+  },
+
+  "image": {
+    "icon": "image.png",
+    "text": "图片",
+    "className": "Image"
+  },
+  "image": {
+    "icon": "attachment.png",
+    "text": "附件",
+    "className": "Attachment"
+  },
+  "div": {
+    "icon": "div.png",
+    "text": "容器",
+    "className": "Div"
+  },
+  "table": {
+    "icon": "table.png",
+    "text": "表格",
+    "className": "Table"
+  },
+  "datagrid": {
+    "icon": "datagrid.png",
+    "text": "数据网格",
+    "className": "Datagrid"
+  },
+  "html": {
+    "icon": "html.png",
+    "text": "HTML",
+    "className": "Html"
+  },
+
+  "tab": {
+    "icon": "tabs.png",
+    "text": "分页",
+    "className": "Tab"
+  },
+  "tree": {
+    "icon": "tree.png",
+    "text": "树",
+    "className": "Tree"
+  },
+  "log": {
+    "icon": "log.png",
+    "text": "流程记录",
+    "className": "Log"
+  },
+  "monitor": {
+    "icon": "monitor.png",
+    "text": "流程监控",
+    "className": "Monitor"
+  },
+  "iframe": {
+    "icon": "iframe.png",
+    "text": "Iframe",
+    "className": "Iframe"
+  },
+  "htmledit": {
+    "icon": "htmleditor.png",
+    "text": "HTML编辑器",
+    "className": "Htmleditor"
+  },
+  "office": {
+    "icon": "office.png",
+    "text": "Office控件",
+    "className": "Office"
+  }
+}

+ 54 - 0
o2web/source/x_component_ConfigDesigner/$Script/default/css.wcss

@@ -0,0 +1,54 @@
+{
+    "scriptPropertyNode": {
+        "overflow": "hidden",
+        "background": "#FFF",
+        "height": "100%"
+    },
+    "propertyTitleNode": {
+        "height": "24px",
+        "line-height": "24px",
+        "font-size": "12px",
+        "font-weight": "bold",
+        "margin": "10px 10px 0px 10px"
+    },
+    "propertyTextNode": {
+        "height": "24px",
+        "line-height": "24px",
+        "font-size": "12px",
+        "margin": "0px 10px",
+        "color": "#666"
+    },
+    "propertyInputNode": {
+        "display": "block",
+        "width": "90%",
+        "margin": "0px 10px",
+        "border": "1px solid #999",
+        "height": "20px",
+        "line-height": "20px"
+    },
+    "propertyInputAreaNode": {
+        "display": "block",
+        "width": "90%",
+        "margin": "0px 10px",
+        "border": "1px solid #999",
+        "height": "60px",
+        "overflow": "auto"
+    },
+    "includeTitleNode": {
+        "height": "24px",
+        "background-color": "#EEE",
+        "border-bottom": "#999",
+        "line-height": "24px"
+    },
+    "includeTitleActionNode": {
+        "height": "24px",
+        "width": "30px",
+        "background": "url("+"../x_component_process_ScriptDesigner/$Script/default/icon/add.png) no-repeat center center",
+        "float": "right",
+        "cursor": "pointer"
+    },
+    "includeTitleTextNode": {
+        "margin": "0px 35px 0px 5px",
+        "height": "24px"
+    }
+}

BIN
o2web/source/x_component_ConfigDesigner/$Script/default/icon/add.png


BIN
o2web/source/x_component_ConfigDesigner/$Script/default/icon/col.png


BIN
o2web/source/x_component_ConfigDesigner/$Script/default/icon/del.png


BIN
o2web/source/x_component_ConfigDesigner/$Script/default/icon/exp.png


BIN
o2web/source/x_component_ConfigDesigner/$Script/default/icon/sel.png


+ 759 - 0
o2web/source/x_component_ConfigDesigner/Main.js

@@ -0,0 +1,759 @@
+o2.xApplication.ConfigDesigner.options = {
+	"multitask": true,
+	"executable": false
+};
+o2.xDesktop.requireApp("ConfigDesigner", "Script", null, false);
+o2.require("o2.xDesktop.UserData", null, false);
+o2.xApplication.ConfigDesigner.Main = new Class({
+	Extends: o2.xApplication.Common.Main,
+	Implements: [Options, Events],
+	options: {
+		"style": "default",
+		"name": "ConfigDesigner",
+		"icon": "icon.png",
+		"title": o2.xApplication.ConfigDesigner.LP.title,
+		"appTitle": o2.xApplication.ConfigDesigner.LP.title,
+		"id": "node_127.0.0.1.json",
+		"actions": null,
+		"category": null,
+		"portalData": null
+	},
+	onQueryLoad: function(){
+
+        this.actions = o2.Actions.load("x_program_center");
+		
+		this.lp = o2.xApplication.ConfigDesigner.LP;
+
+        this.addEvent("queryClose", function(e){
+            if (this.explorer){
+                this.explorer.reload();
+            }
+        }.bind(this));
+	},
+	
+	loadApplication: function(callback){
+		this.createNode();
+		if (!this.options.isRefresh){
+			this.maxSize(function(){
+				this.openScript();
+			}.bind(this));
+		}else{
+			this.openScript();
+		}
+		if (callback) callback();
+	},
+	createNode: function(){
+		this.content.setStyle("overflow", "hidden");
+		this.node = new Element("div", {
+			"styles": {"width": "100%", "height": "100%", "overflow": "hidden"}
+		}).inject(this.content);
+	},
+    getApplication:function(callback){
+        if (callback) callback();
+    },
+	openScript: function(){
+        this.getApplication(function(){
+            this.loadNodes();
+            this.loadScriptListNodes();
+            this.loadContentNode(function(){
+
+                this.loadProperty();
+                //	this.loadTools();
+                this.resizeNode();
+                this.addEvent("resize", this.resizeNode.bind(this));
+                this.loadScript();
+
+                if (this.toolbarContentNode){
+                    this.setScrollBar(this.toolbarContentNode, null, {
+                        "V": {"x": 0, "y": 0},
+                        "H": {"x": 0, "y": 0}
+                    });
+                    this.setScrollBar(this.propertyDomArea, null, {
+                        "V": {"x": 0, "y": 0},
+                        "H": {"x": 0, "y": 0}
+                    });
+                }
+
+            }.bind(this));
+
+        }.bind(this));
+	},
+	loadNodes: function(){
+        this.scriptListNode = new Element("div", {
+            "styles": this.css.scriptListNode
+        }).inject(this.node);
+
+		this.propertyNode = new Element("div", {
+			"styles": this.css.propertyNode
+		}).inject(this.node);
+
+		this.contentNode = new Element("div", {
+			"styles": this.css.contentNode
+		}).inject(this.node);
+	},
+    //loadScriptList-------------------------------
+    loadScriptListNodes: function(){
+        this.scriptListTitleNode = new Element("div", {
+            "styles": this.css.scriptListTitleNode,
+            "text": o2.xApplication.ConfigDesigner.LP.scriptLibrary
+        }).inject(this.scriptListNode);
+
+        this.scriptListResizeNode = new Element("div", {"styles": this.css.scriptListResizeNode}).inject(this.scriptListNode);
+        this.scriptListAreaSccrollNode = new Element("div", {"styles": this.css.scriptListAreaSccrollNode}).inject(this.scriptListNode);
+        this.scriptListAreaNode = new Element("div", {"styles": this.css.scriptListAreaNode}).inject(this.scriptListAreaSccrollNode);
+
+        this.loadScriptListResize();
+
+        this.loadScriptList();
+    },
+    setScroll: function(){
+        o2.require("o2.widget.ScrollBar", function(){
+            this.listScrollBar = new o2.widget.ScrollBar(this.scriptListAreaSccrollNode, {
+                "style":"xDesktop_Message", "where": "before", "indent": false, "distance": 100, "friction": 6,	"axis": {"x": false, "y": true}
+            });
+        }.bind(this));
+    },
+    loadScriptListResize: function(){
+//		var size = this.propertyNode.getSize();
+//		var position = this.propertyResizeBar.getPosition();
+        this.scriptListResize = new Drag(this.scriptListResizeNode,{
+            "snap": 1,
+            "onStart": function(el, e){
+                var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+                var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+                el.store("position", {"x": x, "y": y});
+
+                var size = this.scriptListAreaSccrollNode.getSize();
+                el.store("initialWidth", size.x);
+            }.bind(this),
+            "onDrag": function(el, e){
+                var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+//				var y = e.event.y;
+                var bodySize = this.content.getSize();
+                var position = el.retrieve("position");
+                var initialWidth = el.retrieve("initialWidth").toFloat();
+                var dx = x.toFloat() - position.x.toFloat();
+
+                var width = initialWidth+dx;
+                if (width> bodySize.x/2) width =  bodySize.x/2;
+                if (width<40) width = 40;
+                this.contentNode.setStyle("margin-left", width+1);
+                this.scriptListNode.setStyle("width", width);
+            }.bind(this)
+        });
+    },
+
+    loadScriptList: function() {
+        this.actions.EditConfigAction.getList(function( json ){
+            data = json.data;
+            var config = JSON.parse(data.config);
+            this.config = config;
+            for (var key in config) {
+                this.createListScriptItem(key,config[key]);
+            }
+            this.setScroll();
+        }.bind(this), null, false);
+    },
+    createListScriptItem: function(id, name){
+
+        var _self = this;
+        var listScriptItem = new Element("div", {"styles": this.css.listScriptItem}).inject(this.scriptListAreaNode, "bottom");
+        var listScriptItemIcon = new Element("div", {"styles": this.css.listScriptItemIcon}).inject(listScriptItem);
+        var listScriptItemText = new Element("div", {"styles": this.css.listScriptItemText, "text":id.replace(".json","")+" ("+name+")" }).inject(listScriptItem);
+
+        listScriptItem.store("script", {id:id,name:name});
+        listScriptItem.addEvents({
+            "dblclick": function(e){_self.loadScriptByData(this, e);},
+            "mouseover": function(){if (_self.currentListScriptItem!=this) this.setStyles(_self.css.listScriptItem_over);},
+            "mouseout": function(){if (_self.currentListScriptItem!=this) this.setStyles(_self.css.listScriptItem);}
+        });
+
+        this.listScriptItemMove(listScriptItem);
+
+    },
+    createScriptListCopy: function(node){
+        var copyNode = node.clone().inject(this.node);
+        copyNode.position({
+            "relativeTo": node,
+            "position": "upperLeft",
+            "edge": "upperLeft"
+        });
+        var size = copyNode.getSize();
+        copyNode.setStyles({
+            "width": ""+size.x+"px",
+            "height": ""+size.y+"px",
+            "z-index": 50001,
+        });
+        return copyNode;
+    },
+    listDragEnter: function(dragging, inObj){
+        var markNode = inObj.retrieve("markNode");
+        if (!markNode){
+            var size = inObj.getSize();
+            markNode = new Element("div", {"styles": this.css.dragListItemMark}).inject(this.node);
+            markNode.setStyles({
+                "width": ""+size.x+"px",
+                "height": ""+size.y+"px",
+                "position": "absolute",
+                "background-color": "#666",
+                "z-index": 50000,
+                "opacity": 0.3
+             //   "border": "2px solid #ffba00"
+            });
+            markNode.position({
+                "relativeTo": inObj,
+                "position": "upperLeft",
+                "edge": "upperLeft"
+            });
+            var y = markNode.getStyle("top").toFloat()-1;
+            var x = markNode.getStyle("left").toFloat()-2;
+            markNode.setStyles({
+                "left": ""+x+"px",
+                "top": ""+y+"px",
+            });
+            inObj.store("markNode", markNode);
+        }
+    },
+    listDragLeave: function(dragging, inObj){
+        var markNode = inObj.retrieve("markNode");
+        if (markNode) markNode.destroy();
+        inObj.eliminate("markNode");
+    },
+    listScriptItemMove: function(node){
+        var iconNode = node.getFirst();
+        iconNode.addEvent("mousedown", function(e){
+            var script = node.retrieve("script");
+            if (script.id!=this.scriptTab.showPage.script.data.id){
+                var copyNode = this.createScriptListCopy(node);
+
+                var droppables = [this.designNode, this.propertyDomArea];
+                var listItemDrag = new Drag.Move(copyNode, {
+                    "droppables": droppables,
+                    "onEnter": function(dragging, inObj){
+                        this.listDragEnter(dragging, inObj);
+                    }.bind(this),
+                    "onLeave": function(dragging, inObj){
+                        this.listDragLeave(dragging, inObj);
+                    }.bind(this),
+                    "onDrag": function(e){
+                        //nothing
+                    }.bind(this),
+                    "onDrop": function(dragging, inObj){
+                        if (inObj){
+                            this.addIncludeScript(script);
+                            this.listDragLeave(dragging, inObj);
+                            copyNode.destroy();
+                        }else{
+                            copyNode.destroy();
+                        }
+                    }.bind(this),
+                    "onCancel": function(dragging){
+                        copyNode.destroy();
+                    }.bind(this)
+                });
+                listItemDrag.start(e);
+            }
+        }.bind(this));
+    },
+    addIncludeScript: function(script){
+        var currentScript = this.scriptTab.showPage.script;
+        if (currentScript.data.dependScriptList.indexOf(script.name)==-1){
+            currentScript.data.dependScriptList.push(script.name);
+            this.addIncludeToList(script.name);
+        }
+    },
+    addIncludeToList: function(name){
+        this.actions.getScriptByName(name, this.application.id, 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 scriptName = script.name;
+        var openNew = true;
+        for (var i = 0; i<this.scriptTab.pages.length; i++){
+            if (script.id==this.scriptTab.pages[i].script.data.id){
+                this.scriptTab.pages[i].showTabIm();
+                openNew = false;
+                break;
+            }
+        }
+        if (openNew){
+            this.loadScriptData(script.id, function(data){
+                data.name = scriptName;
+                var script = new o2.xApplication.ConfigDesigner.Script(this, data);
+                script.load();
+            }.bind(this), true);
+        }
+    },
+	
+	//loadContentNode------------------------------
+    loadContentNode: function(toolbarCallback, contentCallback){
+		this.contentToolbarNode = new Element("div#contentToolbarNode", {
+			"styles": this.css.contentToolbarNode
+		}).inject(this.contentNode);
+		this.loadContentToolbar(toolbarCallback);
+		
+		this.editContentNode = new Element("div", {
+			"styles": this.css.editContentNode
+		}).inject(this.contentNode);
+
+		this.loadEditContent(function(){
+		//	if (this.designDcoument) this.designDcoument.body.setStyles(this.css.designBody);
+			if (this.designNode) this.designNode.setStyles(this.css.designNode);
+            if (contentCallback) contentCallback();
+		}.bind(this));
+	},
+    loadContentToolbar: function(callback){
+		this.getFormToolbarHTML(function(toolbarNode){
+			var spans = toolbarNode.getElements("span");
+			spans.each(function(item, idx){
+				var img = item.get("MWFButtonImage");
+				if (img){
+					item.set("MWFButtonImage", this.path+""+this.options.style+"/toolbar/"+img);
+				}
+			}.bind(this));
+
+			$(toolbarNode).inject(this.contentToolbarNode);
+			o2.require("o2.widget.Toolbar", function(){
+				this.toolbar = new o2.widget.Toolbar(toolbarNode, {"style": "ProcessCategory"}, this);
+				this.toolbar.load();
+                var _self = this;
+                //this.styleSelectNode = toolbarNode.getElement("select");
+                //this.styleSelectNode.addEvent("change", function(){
+                //    _self.changeEditorStyle(this);
+                //});
+                this.styleSelectNode = toolbarNode.getElement("select[MWFnodetype='theme']");
+                this.styleSelectNode.addEvent("change", function(){
+                    _self.changeEditorStyle(this);
+                });
+
+                this.fontsizeSelectNode = toolbarNode.getElement("select[MWFnodetype='fontSize']");
+                this.fontsizeSelectNode.addEvent("change", function(){
+                    _self.changeFontSize(this);
+                });
+
+                this.editorSelectNode = toolbarNode.getElement("select[MWFnodetype='editor']");
+                this.editorSelectNode.addEvent("change", function(){
+                    _self.changeEditor(this);
+                });
+
+                this.monacoStyleSelectNode = toolbarNode.getElement("select[MWFnodetype='monaco-theme']");
+                this.monacoStyleSelectNode.addEvent("change", function(){
+                    _self.changeEditorStyle(this);
+                });
+
+				if (callback) callback();
+			}.bind(this));
+		}.bind(this));
+	},
+    changeEditor: function(node){
+        var idx = node.selectedIndex;
+        var value = node.options[idx].value;
+
+        if (!o2.editorData){
+            o2.editorData = {
+                "javascriptEditor": {
+                    "monaco_theme": "vs",
+                    "theme": "tomorrow",
+                    "fontSize" : "12px"
+                }
+            };
+        }
+        o2.editorData.javascriptEditor["editor"] = value;
+        o2.UD.putData("editor", o2.editorData);
+
+        this.scriptTab.pages.each(function(page){
+            var editor = page.script.editor;
+            if (editor) editor.changeEditor(value);
+        }.bind(this));
+
+        if (value=="ace"){
+            this.monacoStyleSelectNode.hide();
+            this.styleSelectNode.show();
+        }else{
+            this.monacoStyleSelectNode.show();
+            this.styleSelectNode.hide();
+        }
+
+    },
+    changeFontSize: function(node){
+        var idx = node.selectedIndex;
+        var value = node.options[idx].value;
+        //var editorData = null;
+        this.scriptTab.pages.each(function(page){
+            //if (!editorData) editorData = page.invoke.editor.editorData;
+            var editor = page.script.editor;
+            if (editor) editor.setFontSize(value);
+        }.bind(this));
+        //if (!editorData) editorData = o2.editorData;
+        //editorData.javainvokeEditor.theme = value;
+        if (!o2.editorData){
+            o2.editorData = {
+                "javascriptEditor": {
+                    "monaco_theme": "vs",
+                    "theme": "tomorrow",
+                    "fontSize" : "12px"
+                }
+            };
+        }
+        o2.editorData.javascriptEditor["fontSize"] = value;
+
+        o2.UD.putData("editor", o2.editorData);
+
+    },
+    changeEditorStyle: function(node){
+        var idx = node.selectedIndex;
+        var value = node.options[idx].value;
+        //var editorData = null;
+        this.scriptTab.pages.each(function(page){
+            //if (!editorData) editorData = page.script.editor.editorData;
+            var editor = page.script.editor;
+            if (editor) editor.setTheme(value);
+        }.bind(this));
+        //if (!editorData) editorData = o2.editorData;
+        //editorData.javascriptEditor.theme = value;
+        if (!o2.editorData){
+            o2.editorData = {
+                "javascriptEditor": {
+                    "monaco_theme": "vs",
+                    "theme": "tomorrow",
+                    "fontSize" : "12px"
+                }
+            };
+        }
+
+        if (o2.editorData.javascriptEditor.editor === "monaco"){
+            o2.editorData.javascriptEditor.monaco_theme = value;
+        }else{
+            o2.editorData.javascriptEditor.theme = value;
+        }
+
+        o2.UD.putData("editor", o2.editorData);
+    },
+	getFormToolbarHTML: function(callback){
+		var toolbarUrl = this.path+this.options.style+"/toolbars.html";
+		var r = new Request.HTML({
+			url: toolbarUrl,
+			method: "get",
+			onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript){
+				var toolbarNode = responseTree[0];
+				if (callback) callback(toolbarNode);
+			}.bind(this),
+			onFailure: function(xhr){
+				this.notice("request portalToolbars error: "+xhr.responseText, "error");
+			}.bind(this)
+		});
+		r.send();
+	},
+    maxOrReturnEditor: function(){
+        if (!this.isMax){
+            this.designNode.inject(this.node);
+            this.designNode.setStyles({
+                "position": "absolute",
+                "width": "100%",
+                "height": "100%",
+                "top": "0px",
+                "margin": "0px",
+                "left": "0px"
+            });
+            this.scriptTab.pages.each(function(page){
+                page.script.setAreaNodeSize();
+            });
+            this.isMax = true;
+        }else{
+            this.isMax = false;
+            this.designNode.inject(this.editContentNode);
+            this.designNode.setStyles(this.css.designNode);
+            this.designNode.setStyles({
+                "position": "static"
+            });
+            this.resizeNode();
+            this.scriptTab.pages.each(function(page){
+                page.script.setAreaNodeSize();
+            });
+        }
+
+    },
+    loadEditContent: function(callback){
+        this.designNode = new Element("div", {
+            "styles": this.css.designNode
+        }).inject(this.editContentNode);
+
+        o2.require("o2.widget.Tab", function(){
+            this.scriptTab = new o2.widget.Tab(this.designNode, {"style": "script"});
+            this.scriptTab.load();
+        }.bind(this), false);
+
+
+        //o2.require("o2.widget.ScrollBar", function(){
+            //    new o2.widget.ScrollBar(this.designNode, {"distance": 100});
+            //}.bind(this));
+	},
+	
+	//loadProperty------------------------
+	loadProperty: function(){
+		this.propertyTitleNode = new Element("div", {
+			"styles": this.css.propertyTitleNode,
+			"text": o2.xApplication.ConfigDesigner.LP.property
+		}).inject(this.propertyNode);
+		
+		this.propertyResizeBar = new Element("div", {
+			"styles": this.css.propertyResizeBar
+		}).inject(this.propertyNode);
+		this.loadPropertyResize();
+		
+		this.propertyContentNode = new Element("div", {
+			"styles": this.css.propertyContentNode
+		}).inject(this.propertyNode);
+		
+		this.propertyDomArea = new Element("div", {
+			"styles": this.css.propertyDomArea
+		}).inject(this.propertyContentNode);
+		
+		this.propertyDomPercent = 0.3;
+		this.propertyContentResizeNode = new Element("div", {
+			"styles": this.css.propertyContentResizeNode
+		}).inject(this.propertyContentNode);
+		
+		this.propertyContentArea = new Element("div", {
+			"styles": this.css.propertyContentArea
+		}).inject(this.propertyContentNode);
+		
+		this.loadPropertyContentResize();
+
+        this.setPropertyContent();
+        this.setIncludeNode();
+	},
+    setIncludeNode: function(){
+        this.includeTitleNode = new Element("div", {"styles": this.css.includeTitleNode}).inject(this.propertyDomArea);
+        this.includeTitleActionNode = new Element("div", {"styles": this.css.includeTitleActionNode}).inject(this.includeTitleNode);
+        this.includeTitleTextNode = new Element("div", {"styles": this.css.includeTitleTextNode, "text": this.lp.include}).inject(this.includeTitleNode);
+        this.includeTitleActionNode.addEvent("click", function(){
+            this.addInclude();
+        }.bind(this));
+
+        this.propertyIncludeListArea = new Element("div", {
+            "styles": {"overflow": "hidden"}
+        }).inject(this.propertyDomArea);
+    },
+    addInclude: function(){
+
+
+
+    },
+    setPropertyContent: function(){
+        var node = new Element("div", {"styles": this.css.propertyItemTitleNode, "text": this.lp.id+":"}).inject(this.propertyContentArea);
+        this.propertyIdNode = new Element("div", {"styles": this.css.propertyTextNode, "text": ""}).inject(this.propertyContentArea);
+
+        node = new Element("div", {"styles": this.css.propertyItemTitleNode, "text": this.lp.name+":"}).inject(this.propertyContentArea);
+        this.propertyNameNode = new Element("div", {"styles": this.css.propertyTextNode, "text": ""}).inject(this.propertyContentArea);
+
+        node = new Element("div", {"styles": this.css.propertyItemTitleNode, "text": this.lp.node+":"}).inject(this.propertyContentArea);
+        this.propertyServerNode = new Element("select", {"styles": this.css.propertyTextNode}).inject(this.propertyContentArea);
+        o2.Actions.load("x_program_center").CommandAction.getNodeInfoList(
+            function( json ){
+                var nodeList = json.data.nodeList;
+                if(nodeList.length>1){
+                    new Element("option", {"value": "*", "text": "*"}).inject(this.nodeSelect);
+                }
+                nodeList.each(function (node) {
+                    new Element("option", {
+                        "value": node.node.nodeAgentPort,
+                        "text": node.nodeAddress
+                    }).inject(this.propertyServerNode);
+                }.bind(this));
+            }.bind(this),null, false
+        );
+        node = new Element("div", {"styles": this.css.propertyItemTitleNode, "text": this.lp.description+":"}).inject(this.propertyContentArea);
+        this.propertyDescriptionNode = new Element("div", {"styles": this.css.propertyTextNode, "text": ""}).inject(this.propertyContentArea);
+    },
+	loadPropertyResize: function(){
+//		var size = this.propertyNode.getSize();
+//		var position = this.propertyResizeBar.getPosition();
+		this.propertyResize = new Drag(this.propertyResizeBar,{
+			"snap": 1,
+			"onStart": function(el, e){
+				var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+				var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+				el.store("position", {"x": x, "y": y});
+				
+				var size = this.propertyNode.getSize();
+				el.store("initialWidth", size.x);
+			}.bind(this),
+			"onDrag": function(el, e){
+				var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+//				var y = e.event.y;
+				var bodySize = this.content.getSize();
+				var position = el.retrieve("position");
+				var initialWidth = el.retrieve("initialWidth").toFloat();
+				var dx = position.x.toFloat()-x.toFloat();
+				
+				var width = initialWidth+dx;
+				if (width> bodySize.x/2) width =  bodySize.x/2;
+				if (width<40) width = 40;
+				this.contentNode.setStyle("margin-right", width+1);
+				this.propertyNode.setStyle("width", width);
+			}.bind(this)
+		});
+	},
+	loadPropertyContentResize: function(){
+		this.propertyContentResize = new Drag(this.propertyContentResizeNode, {
+			"snap": 1,
+			"onStart": function(el, e){
+				var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+				var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+				el.store("position", {"x": x, "y": y});
+
+				var size = this.propertyDomArea.getSize();
+				el.store("initialHeight", size.y);
+			}.bind(this),
+			"onDrag": function(el, e){
+				var size = this.propertyContentNode.getSize();
+
+	//			var x = e.event.x;
+				var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+				var position = el.retrieve("position");
+				var dy = y.toFloat()-position.y.toFloat();
+
+				var initialHeight = el.retrieve("initialHeight").toFloat();
+				var height = initialHeight+dy;
+				if (height<40) height = 40;
+				if (height> size.y-40) height = size.y-40;
+
+				this.propertyDomPercent = height/size.y;
+
+				this.setPropertyContentResize();
+
+			}.bind(this)
+		});
+	},
+	setPropertyContentResize: function(){
+		var size = this.propertyContentNode.getSize();
+		var resizeNodeSize = this.propertyContentResizeNode.getSize();
+		var height = size.y-resizeNodeSize.y;
+		
+		var domHeight = this.propertyDomPercent*height;
+		var contentHeight = height-domHeight;
+		
+		this.propertyDomArea.setStyle("height", ""+domHeight+"px");
+		this.propertyContentArea.setStyle("height", ""+contentHeight+"px");
+	},
+	
+
+	
+	//resizeNode------------------------------------------------
+	resizeNode: function(){
+        if (!this.isMax){
+            var nodeSize = this.node.getSize();
+            this.contentNode.setStyle("height", ""+nodeSize.y+"px");
+            this.propertyNode.setStyle("height", ""+nodeSize.y+"px");
+
+            var contentToolbarMarginTop = this.contentToolbarNode.getStyle("margin-top").toFloat();
+            var contentToolbarMarginBottom = this.contentToolbarNode.getStyle("margin-bottom").toFloat();
+            var allContentToolberSize = this.contentToolbarNode.getComputedSize();
+            var y = nodeSize.y - allContentToolberSize.totalHeight - contentToolbarMarginTop - contentToolbarMarginBottom;
+            this.editContentNode.setStyle("height", ""+y+"px");
+
+            if (this.designNode){
+                var designMarginTop = this.designNode.getStyle("margin-top").toFloat();
+                var designMarginBottom = this.designNode.getStyle("margin-bottom").toFloat();
+                y = nodeSize.y - allContentToolberSize.totalHeight - contentToolbarMarginTop - contentToolbarMarginBottom - designMarginTop - designMarginBottom;
+                this.designNode.setStyle("height", ""+y+"px");
+            }
+
+
+            titleSize = this.propertyTitleNode.getSize();
+            titleMarginTop = this.propertyTitleNode.getStyle("margin-top").toFloat();
+            titleMarginBottom = this.propertyTitleNode.getStyle("margin-bottom").toFloat();
+            titlePaddingTop = this.propertyTitleNode.getStyle("padding-top").toFloat();
+            titlePaddingBottom = this.propertyTitleNode.getStyle("padding-bottom").toFloat();
+
+            y = titleSize.y+titleMarginTop+titleMarginBottom+titlePaddingTop+titlePaddingBottom;
+            y = nodeSize.y-y;
+            this.propertyContentNode.setStyle("height", ""+y+"px");
+            this.propertyResizeBar.setStyle("height", ""+y+"px");
+
+            this.setPropertyContentResize();
+
+            titleSize = this.scriptListTitleNode.getSize();
+            titleMarginTop = this.scriptListTitleNode.getStyle("margin-top").toFloat();
+            titleMarginBottom = this.scriptListTitleNode.getStyle("margin-bottom").toFloat();
+            titlePaddingTop = this.scriptListTitleNode.getStyle("padding-top").toFloat();
+            titlePaddingBottom = this.scriptListTitleNode.getStyle("padding-bottom").toFloat();
+            nodeMarginTop = this.scriptListAreaSccrollNode.getStyle("margin-top").toFloat();
+            nodeMarginBottom = this.scriptListAreaSccrollNode.getStyle("margin-bottom").toFloat();
+
+            y = titleSize.y+titleMarginTop+titleMarginBottom+titlePaddingTop+titlePaddingBottom+nodeMarginTop+nodeMarginBottom;
+            y = nodeSize.y-y;
+            this.scriptListAreaSccrollNode.setStyle("height", ""+y+"px");
+            this.scriptListResizeNode.setStyle("height", ""+y+"px");
+        }
+	},
+	
+	//loadForm------------------------------------------
+    loadScript: function(){
+        //this.scriptTab.addTab(node, title);
+		this.getScriptData(this.options.id, function(data){
+		    data.name = this.config[this.options.id];
+			this.script = new o2.xApplication.ConfigDesigner.Script(this, data);
+			this.script.load();
+		}.bind(this));
+	},
+
+    getScriptData: function(id, callback){
+        this.loadScriptData(id, callback);
+	},
+    loadScriptData: function(id, callback, notSetTile){
+		this.actions.EditConfigAction.open({fileName:id}, function(json){
+			if (json){
+				var data = json.data;
+				data.id = id;
+				data.text = data.fileContent;
+                if (callback) callback(data);
+			}
+		}.bind(this));
+	},
+
+    saveScript: function(){
+        if (this.scriptTab.showPage){
+            var script = this.scriptTab.showPage.script;
+            script.save(function(){
+                if (script==this.script){
+                    var name = script.data.name;
+                    this.setTitle(o2.xApplication.ConfigDesigner.LP.title + "-"+name);
+                    this.options.desktopReload = true;
+                    this.options.id = script.data.id;
+                }
+            }.bind(this));
+        }
+	},
+    saveDictionaryAs: function(){
+        this.dictionary.saveAs();
+	},
+    dictionaryExplode: function(){
+        this.dictionary.explode();
+    },
+    dictionaryImplode: function(){
+        this.dictionary.implode();
+    }
+});

+ 300 - 0
o2web/source/x_component_ConfigDesigner/Script.js

@@ -0,0 +1,300 @@
+MWF.xApplication = MWF.xApplication || {};
+MWF.xApplication.portal = MWF.xApplication.portal || {};
+MWF.xApplication.ConfigDesigner = MWF.xApplication.ConfigDesigner || {};
+MWF.require("MWF.widget.Common", null, false);
+MWF.xDesktop.requireApp("ConfigDesigner", "lp."+MWF.language, null, false);
+MWF.require("MWF.widget.JavascriptEditor", null, false);
+MWF.xApplication.ConfigDesigner.Script = new Class({
+    Extends: MWF.widget.Common,
+    Implements: [Options, Events],
+    options: {
+        "style": "default",
+        "showTab": true
+    },
+
+    initialize: function(designer, data, options){
+        this.setOptions(options);
+
+        this.path = "../x_component_portal_ScriptDesigner/$Script/";
+        this.cssPath = "../x_component_portal_ScriptDesigner/$Script/"+this.options.style+"/css.wcss";
+
+        this._loadCss();
+
+        this.isChanged = false;
+
+        this.designer = designer;
+        this.data = data;
+        if (!this.data.text) this.data.text = "";
+        this.node = this.designer.designNode;
+        this.tab = this.designer.scriptTab;
+
+        this.areaNode = new Element("div", {"styles": {"overflow": "hidden", "height": "700px"}});
+        this.propertyIncludeNode = this.designer.propertyDomArea;
+        this.propertyNode = this.designer.propertyContentArea
+
+        if(this.designer.application) this.data.applicationName = this.designer.application.name;
+        if(this.designer.application) this.data.application = this.designer.application.id;
+
+        this.isNewScript = (this.data.id) ? false : true;
+    //    this.createProperty();
+
+        this.autoSave();
+        this.designer.addEvent("queryClose", function(){
+            if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID);
+        }.bind(this));
+    },
+    autoSave: function(){
+        this.autoSaveTimerID = window.setInterval(function(){
+            if (!this.autoSaveCheckNode) this.autoSaveCheckNode = this.designer.contentToolbarNode.getElement("#MWFScriptAutoSaveCheck");
+            if (this.autoSaveCheckNode){
+                if (this.autoSaveCheckNode.get("checked")){
+                    if (this.isChanged) this.saveSilence();
+                }
+            }
+        }.bind(this), 60000);
+
+    },
+
+    //createProperty: function(){
+    //    this.scriptPropertyNode = new Element("div", {"styles": this.css.scriptPropertyNode}).inject(this.propertyNode);
+    //},
+
+    load : function(){
+        this.setAreaNodeSize();
+        this.designer.addEvent("resize", this.setAreaNodeSize.bind(this));
+
+        this.page = this.tab.addTab(this.areaNode, this.data.name || this.designer.lp.newScript, (!this.data.isNewScript && this.data.id!=this.designer.options.id));
+        this.page.script = this;
+        this.page.addEvent("show", function(){
+            this.designer.scriptListAreaNode.getChildren().each(function(node){
+                var scrtip = node.retrieve("script");
+                if (scrtip.id==this.data.id){
+                    if (this.designer.currentListScriptItem){
+                        this.designer.currentListScriptItem.setStyles(this.designer.css.listScriptItem);
+                    }
+                    node.setStyles(this.designer.css.listScriptItem_current);
+                    this.designer.currentListScriptItem = node;
+                    this.lisNode = node;
+                }
+            }.bind(this));
+
+            this.designer.currentScript = this;
+
+            this.setPropertyContent();
+            // this.setIncludeNode();
+
+            if (this.editor){
+                this.editor.focus();
+                //this.editor.editor.navigateFileStart();
+            }
+        }.bind(this));
+        this.page.addEvent("queryClose", function(){
+            if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID);
+            //if (this.isChanged) this.saveSilence();
+            if (this.lisNode) this.lisNode.setStyles(this.designer.css.listScriptItem);
+        }.bind(this));
+        this.page.tabNode.addEvent("dblclick", this.designer.maxOrReturnEditor.bind(this.designer));
+
+
+
+        this.editor = new MWF.widget.JavascriptEditor(this.areaNode);
+        this.editor.load(function(){
+            if (this.data.text){
+                this.editor.setValue(this.data.text);
+            }
+            this.editor.addEditorEvent("change", function(){
+                if (!this.isChanged){
+                    this.isChanged = true;
+                    this.page.textNode.set("text", " * "+this.page.textNode.get("text"));
+                }
+            }.bind(this));
+            // this.editor.editor.on("change", function(e){
+            //     if (!this.isChanged){
+            //         this.isChanged = true;
+            //         this.page.textNode.set("text", " * "+this.page.textNode.get("text"));
+            //     }
+            // }.bind(this));
+            this.editor.addEvent("save", function(){
+                this.save();
+            }.bind(this));
+            // this.editor.addEvent("reference", function(editor, e, e1){
+            //     if (!this.scriptReferenceMenu){
+            //         MWF.require("MWF.widget.ScriptHelp", function(){
+            //             this.scriptReferenceMenu = new MWF.widget.ScriptHelp(null, this.editor.editor, {
+            //                 "onPostLoad": function(){
+            //                     this.showReferenceMenu();
+            //                 }.bind(this)
+            //             });
+            //             this.scriptReferenceMenu.getEditor = function(){return this.editor.editor;}.bind(this)
+            //         }.bind(this));
+            //     }else{
+            //         this.showReferenceMenu();
+            //     }
+            // }.bind(this));
+
+            var options = this.designer.styleSelectNode.options;
+            for (var i=0; i<options.length; i++){
+                    var option = options[i];
+                if (option.value==this.editor.theme){
+                    option.set("selected", true);
+                    break;
+                }
+            }
+
+            options = this.designer.fontsizeSelectNode.options;
+            for (var i=0; i<options.length; i++){
+                var option = options[i];
+                if (option.value==this.editor.fontSize){
+                    option.set("selected", true);
+                    break;
+                }
+            }
+            options = this.designer.editorSelectNode.options;
+            for (var i=0; i<options.length; i++){
+                var option = options[i];
+                if (option.value==this.editor.options.type){
+                    option.set("selected", true);
+                    break;
+                }
+            }
+
+            options = this.designer.monacoStyleSelectNode.options;
+            for (var i=0; i<options.length; i++){
+                var option = options[i];
+                if (option.value==this.editor.theme){
+                    option.set("selected", true);
+                    break;
+                }
+            }
+
+            if (this.editor.options.type=="ace"){
+                this.designer.monacoStyleSelectNode.hide();
+                this.designer.styleSelectNode.show();
+            }else{
+                this.designer.monacoStyleSelectNode.show();
+                this.designer.styleSelectNode.hide();
+            }
+        }.bind(this));
+
+        if (this.options.showTab) this.page.showTabIm();
+    },
+    showReferenceMenu: function(){
+        var pos = this.editor.getCursorPixelPosition();
+        var e = {"page": {}};
+        e.page.x = pos.left;
+        e.page.y = pos.top;
+        this.scriptReferenceMenu.menu.showIm(e);
+    },
+    setIncludeNode: function(){
+        this.designer.propertyIncludeListArea.empty();
+        this.data.dependScriptList.each(function(name){
+            this.designer.addIncludeToList(name);
+        }.bind(this));
+    },
+    setPropertyContent: function(){
+        this.designer.propertyIdNode.set("text", this.data.id || "");
+        this.designer.propertyNameNode.set("text", this.data.name || "");
+        this.designer.propertyDescriptionNode.set("text", this.data.description || "");
+    },
+    setAreaNodeSize: function(){
+        var size = this.node.getSize();
+        var tabSize = this.tab.tabNodeContainer.getSize();
+        var y = size.y - tabSize.y;
+        this.areaNode.setStyle("height", ""+y+"px");
+        if (this.editor) this.editor.resize();
+    },
+
+    addInclude: function(){
+
+    },
+
+
+    save: function(callback){
+        if (!this.isSave){
+            var validated = this.editor.validated();
+            this.data.fileName = this.data.id;
+            this.data.text = this.editor.getValue();
+            this.data.fileContent = this.editor.getValue();
+            this.data.nodeName = this.designer.propertyServerNode.getElement("option:selected").get("text");
+            this.data.nodePort = this.designer.propertyServerNode.getElement("option:selected").get("value");
+
+            this.isSave = true;
+            this.designer.actions.EditConfigAction.save(this.data, function(json){
+                this.isSave = false;
+                this.data.isNewScript = false;
+                this.isChanged = false;
+                this.page.textNode.set("text", this.data.name);
+                if (this.lisNode) {
+                    this.lisNode.getLast().set("text", this.data.name);
+                }
+                this.designer.notice(this.designer.lp.notice.save_success, "success", this.node, {"x": "left", "y": "bottom"});
+                this.data.id = json.data.id;
+                if (callback) callback();
+            }.bind(this), function(xhr, text, error){
+                this.isSave = false;
+
+                var errorText = error+":"+text;
+                if (xhr) errorText = xhr.responseText;
+                MWF.xDesktop.notice("error", {x: "right", y:"top"}, "request json error: "+errorText);
+            }.bind(this));
+        }else{
+            MWF.xDesktop.notice("info", {x: "right", y:"top"}, this.designer.lp.isSave);
+        }
+
+    },
+    saveSilence: function(callback){
+        if (!this.isSave){
+            // var session = this.editor.editor.getSession();
+            // var annotations = session.getAnnotations();
+            // var validated = true;
+            // for (var i=0; i<annotations.length; i++){
+            //     if (annotations[i].type=="error"){
+            //         validated = false;
+            //         break;
+            //     }
+            // }
+
+            var validated = this.editor.validated();
+            if( this.designer.currentScript == this ){
+                var name = this.designer.propertyNameNode.get("value");
+                var alias = this.designer.propertyAliasNode.get("value");
+                var description = this.designer.propertyDescriptionNode.get("value");
+                if (!name){
+                    this.designer.notice(this.designer.lp.notice.inputName, "error");
+                    return false;
+                }
+                this.data.name = name;
+                this.data.alias = alias;
+                this.data.description = description;
+                this.data.validated = validated;
+            }
+            this.data.text = this.editor.getValue();
+
+            this.isSave = true;
+            this.designer.actions.saveScript(this.data, function(json){
+                this.isSave = false;
+                this.data.isNewScript = false;
+                this.isChanged = false;
+                this.page.textNode.set("text", this.data.name);
+                if (this.lisNode) {
+                    this.lisNode.getLast().set("text", this.data.name);
+                }
+                this.data.id = json.data.id;
+                if (callback) callback();
+            }.bind(this), function(xhr, text, error){
+                this.isSave = false;
+                //
+                //var errorText = error+":"+text;
+                //if (xhr) errorText = xhr.responseText;
+                //MWF.xDesktop.notice("error", {x: "right", y:"top"}, "request json error: "+errorText);
+            }.bind(this));
+        }else{
+            MWF.xDesktop.notice("info", {x: "right", y:"top"}, this.designer.lp.isSave);
+        }
+    },
+
+    saveAs: function(){},
+    explode: function(){},
+    implode: function(){}
+
+});

+ 31 - 0
o2web/source/x_component_ConfigDesigner/lp/zh-cn.js

@@ -0,0 +1,31 @@
+MWF.xApplication.ConfigDesigner.LP = {
+		"title": "平台配置",
+		"newScript": "新建配置",
+        "scriptLibrary": "配置列表",
+        "property": "属性",
+        "include": "引用",
+
+        "id": "标识",
+        "name": "名称",
+        "node" : "节点",
+        "alias": "别名",
+        "description": "描述",
+
+		"notice": {
+			"save_success": "配置保存成功!",
+			
+			"deleteDataTitle": "删除数据确认",
+			"deleteData": "是否确定删除当前数据,及其子数据吗?",
+
+            "changeTypeTitle": "改变数据类型确认",
+            "changeTypeDeleteChildren": "改变数据类型将删除所有子数据,是否确定要执行?",
+            "changeType": "改变数据类型将改变数据的值,是否确定要执行?",
+
+            "inputTypeError": "您输入的数据类型有误,请重新输入",
+            "sameKey": "您输入的项目名称在对象中已存在,请重新输入",
+            "emptyKey": "项目名称不能为空,请重新输入",
+            "numberKey": "项目名称不能为数字,请重新输入",
+
+            "inputName": "请输入配置名称"
+		}
+};