hq_1980@hotmail.com 6 ani în urmă
părinte
comite
f250cdd94f
100 a modificat fișierele cu 3273 adăugiri și 1470 ștergeri
  1. 213 85
      o2web/source/o2_core/o2.js
  2. 2 0
      o2web/source/o2_core/o2/lp/zh-cn.js
  3. 14 1
      o2web/source/o2_core/o2/o2.more.js
  4. 6 2
      o2web/source/o2_core/o2/widget/$Dialog/work/css.wcss
  5. 1 1
      o2web/source/o2_core/o2/widget/$Dialog/work/dialog.html
  6. 1 1
      o2web/source/o2_core/o2/widget/$Toolbar/xform_blue_simple/css.wcss
  7. 1 1
      o2web/source/o2_core/o2/widget/$Toolbar/xform_red_simple/css.wcss
  8. 4 2
      o2web/source/o2_core/o2/widget/AttachmentController.js
  9. 14 7
      o2web/source/o2_core/o2/widget/Dialog.js
  10. 1 1
      o2web/source/o2_core/o2/widget/O2Identity.js
  11. 10 10
      o2web/source/o2_core/o2/widget/ScriptArea.js
  12. 1 1
      o2web/source/o2_core/o2/widget/ScriptHelp.js
  13. 7 7
      o2web/source/o2_core/o2/widget/Toolbar.js
  14. 8 1
      o2web/source/o2_core/o2/widget/Upload.js
  15. 13 0
      o2web/source/o2_core/o2/xAction/services/x_cms_assemble_control.js
  16. 19 0
      o2web/source/o2_core/o2/xAction/services/x_cms_assemble_control.json
  17. 4 1
      o2web/source/o2_core/o2/xAction/services/x_organization_assemble_control.json
  18. 8 0
      o2web/source/o2_core/o2/xAction/services/x_organization_assemble_personal.json
  19. 9 0
      o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.js
  20. 5 2
      o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json
  21. 14 1
      o2web/source/o2_core/o2/xAction/services/x_query_assemble_surface.json
  22. 1 1
      o2web/source/o2_core/o2/xDesktop/$Layout/components.json
  23. 4 0
      o2web/source/o2_core/o2/xDesktop/$Layout/styles.json
  24. 13 0
      o2web/source/o2_core/o2/xDesktop/Access.js
  25. 32 18
      o2web/source/o2_core/o2/xDesktop/Authentication.js
  26. 21 7
      o2web/source/o2_core/o2/xDesktop/Lnk.js
  27. 1 1
      o2web/source/o2_core/o2/xDesktop/MessageMobile.js
  28. 1 1
      o2web/source/o2_core/o2/xDesktop/UserData.js
  29. 1 1
      o2web/source/o2_core/o2/xDesktop/Window.js
  30. 1 0
      o2web/source/o2_lib/htmleditor/ckeditor451/ckeditor.js
  31. 1 1
      o2web/source/o2_lib/htmleditor/ckeditor462/ckeditor.js
  32. 721 41
      o2web/source/o2_lib/htmleditor/ckeditor462/plugins/image/dialogs/image.js
  33. 2 1
      o2web/source/x_component_AppCenter/$Main/default/css.wcss
  34. 30 10
      o2web/source/x_component_Common/Main.js
  35. 8 9
      o2web/source/x_component_ControlPanel/$Main/applications.json
  36. 2 2
      o2web/source/x_component_ControlPanel/$Main/default/css.wcss
  37. 2 1
      o2web/source/x_component_ControlPanel/Main.js
  38. 1 0
      o2web/source/x_component_Forum/lp/zh-cn.js
  39. 7 7
      o2web/source/x_component_ForumDocument/Main.js
  40. 11 4
      o2web/source/x_component_Minder/Common.js
  41. 249 249
      o2web/source/x_component_MinderEditor/Dialog.js
  42. 4 4
      o2web/source/x_component_MinderEditor/WidgetInEditMode.js
  43. 19 4
      o2web/source/x_component_OnlineMeeting/Actions/RestActions.js
  44. 23 6
      o2web/source/x_component_OnlineMeeting/Main.js
  45. 92 24
      o2web/source/x_component_Org/UnitExplorer.js
  46. 1 0
      o2web/source/x_component_Org/lp/zh-cn.js
  47. 209 437
      o2web/source/x_component_Profile/Main.js
  48. 14 9
      o2web/source/x_component_Report/Setting.js
  49. 15 4
      o2web/source/x_component_Selector/IdentityWidthDuty.js
  50. 6 1
      o2web/source/x_component_Selector/Person.js
  51. 2 2
      o2web/source/x_component_Selector/Process.js
  52. 58 1
      o2web/source/x_component_Selector/package.js
  53. 8 0
      o2web/source/x_component_Setting/$SettingModuleUI/default/css.wcss
  54. 1 1
      o2web/source/x_component_Setting/SettingMobile.js
  55. 0 21
      o2web/source/x_component_Setting/components.json
  56. BIN
      o2web/source/x_component_Strategy/$Main/default/icon/navi/icon_nianbushu.png
  57. BIN
      o2web/source/x_component_Strategy/$Main/default/icon/navi/icon_nianbushu__click.png
  58. 1 1
      o2web/source/x_component_Strategy/PriorityList.js
  59. 0 159
      o2web/source/x_component_Template/StatJson.js
  60. 0 0
      o2web/source/x_component_Template/test.xml
  61. 146 0
      o2web/source/x_component_cms_ColumnManager/$Explorer/default/css.wcss
  62. 146 0
      o2web/source/x_component_cms_ColumnManager/$Explorer/full/css.wcss
  63. 12 1
      o2web/source/x_component_cms_ColumnManager/$Main/startMenu.json
  64. 113 76
      o2web/source/x_component_cms_ColumnManager/Main.js
  65. 23 1
      o2web/source/x_component_cms_ColumnManager/lp/zh-cn.js
  66. 0 72
      o2web/source/x_component_cms_ColumnManager/lp/zh-cn.js.bak
  67. 1 1
      o2web/source/x_component_cms_ColumnManager/widget/PermissionSetting.js
  68. 5 2
      o2web/source/x_component_cms_FormDesigner/$Main/bottom/formToolbars.html
  69. 5 1
      o2web/source/x_component_cms_FormDesigner/$Main/bottom/tools.json
  70. 19 2
      o2web/source/x_component_cms_FormDesigner/$Main/default/css.wcss
  71. 9 3
      o2web/source/x_component_cms_FormDesigner/$Main/default/formToolbars.html
  72. 5 1
      o2web/source/x_component_cms_FormDesigner/$Main/default/tools.json
  73. 305 6
      o2web/source/x_component_cms_FormDesigner/Main.js
  74. 113 2
      o2web/source/x_component_cms_FormDesigner/Module/Form.js
  75. 1 1
      o2web/source/x_component_cms_FormDesigner/Module/Form/form.html
  76. 3 4
      o2web/source/x_component_cms_FormDesigner/Module/Form/template/form_publish_edit.json
  77. 3 4
      o2web/source/x_component_cms_FormDesigner/Module/Form/template/form_publish_read.json
  78. 39 1
      o2web/source/x_component_cms_FormDesigner/Module/Htmleditor.js
  79. 1 0
      o2web/source/x_component_cms_FormDesigner/Module/Package.js
  80. 40 16
      o2web/source/x_component_cms_Index/Starter.js
  81. BIN
      o2web/source/x_component_cms_Module/$ExcelForm/Excel导入合法性说明.xls
  82. BIN
      o2web/source/x_component_cms_Module/$ExcelForm/Excel模板下载.xls
  83. 1 1
      o2web/source/x_component_cms_Module/$ListExplorer/default/css.wcss
  84. 45 0
      o2web/source/x_component_cms_Module/$Main/default/css.wcss
  85. 1 1
      o2web/source/x_component_cms_Module/ListExplorer.js
  86. 114 36
      o2web/source/x_component_cms_Module/Main.js
  87. 3 0
      o2web/source/x_component_cms_Module/lp/zh-cn.js
  88. 1 0
      o2web/source/x_component_cms_Xform/Htmleditor.js
  89. 55 2
      o2web/source/x_component_cms_Xform/Package.js
  90. 19 12
      o2web/source/x_component_portal_PageDesigner/Module/Tab/tab.html
  91. 1 0
      o2web/source/x_component_portal_PortalExplorer/Main.js
  92. 34 16
      o2web/source/x_component_portal_PortalManager/FileExplorer.js
  93. 1 0
      o2web/source/x_component_portal_PortalManager/PageExplorer.js
  94. 1 0
      o2web/source/x_component_portal_PortalManager/ScriptExplorer.js
  95. 1 0
      o2web/source/x_component_process_Application/$WorkExplorer/default/css.wcss
  96. 11 8
      o2web/source/x_component_process_Application/WorkExplorer.js
  97. 42 19
      o2web/source/x_component_process_ApplicationExplorer/Main.js
  98. 3 19
      o2web/source/x_component_process_FormDesigner/Module/Actionbar.js
  99. 3 0
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/actionbar.html
  100. 31 10
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/toolbars.json

+ 213 - 85
o2web/source/o2_core/o2.js

@@ -135,6 +135,8 @@
     var _rand = function(max) {
         return Math.floor(Math.random() * (max + 1));
     };
+    this.o2.addListener = _addListener;
+    this.o2.removeListener = _removeListener;
 
     //uuid
     var _uuid = function(){
@@ -181,7 +183,7 @@
             "doc": doc,
             "dom": (options && options.dom) || document.body,
             "bind": (options && options.bind) || null,
-            "position": "beforeend" //'beforebegin' 'afterbegin' 'beforeend' 'afterend'
+            "position": (options && options.position) || "beforeend" //'beforebegin' 'afterbegin' 'beforeend' 'afterend'
         }
     };
     var _getCssOptions = function(options){
@@ -215,7 +217,7 @@
             "doc": doc,
             "dom": (options && options.dom) || null,
             "bind": (options && options.bind) || null,
-            "position": "beforeend" //'beforebegin' 'afterbegin' 'beforeend' 'afterend'
+            "position": (options && options.position) || "beforeend" //'beforebegin' 'afterbegin' 'beforeend' 'afterend'
         }
     };
     var _xhr_get = function(url, success, failure, completed){
@@ -284,7 +286,7 @@
         "ie_adapter": ["/o2_lib/o2/ie_adapter.js"],
         "jquery": ["/o2_lib/jquery/jquery.min.js"],
         "mootools": ["/o2_lib/mootools/mootools-1.6.0_all.js"],
-        "ckeditor": ["/o2_lib/htmleditor/ckeditor/ckeditor.js"],
+        "ckeditor": ["/o2_lib/htmleditor/ckeditor462/ckeditor.js"],
         "raphael": ["/o2_lib/raphael/raphael.js"],
         "d3": ["/o2_lib/d3/d3.min.js"],
         "ace": ["/o2_lib/ace/src-noconflict/ace.js","/o2_lib/ace/src-noconflict/ext-language_tools.js"],
@@ -328,7 +330,7 @@
                         if (s) head.removeChild(s);
                         if (callback)callback();
                     }else{
-                        head.removeChild(s);
+                        //head.removeChild(s);
                         if (callback)callback(scriptObj);
                     }
                 }
@@ -480,22 +482,27 @@
             _loadDisarray(ms, cb, op, thisLoaded, _loadSingleCss, uuid);
         }
     };
-    var _removeCss = function(module, doc){
+    var _removeCss = function(modules, doc){
         var thisDoc = doc || document;
-        var k = encodeURIComponent(module+(thisDoc.unid||""));
-        var removeCss = _loadedCss[k];
-        if (!removeCss) for (key in _loadedCss){
-            if (_loadedCss[key].id==module){
-                removeCss = _loadedCss[key];
-                k = key;
-                break;
+        var ms = (_typeOf(modules)==="array") ? modules : [modules];
+        for (var i=0; i<ms.length; i++){
+            var module = modules[i];
+
+            var k = encodeURIComponent(module+(thisDoc.unid||""));
+            var removeCss = _loadedCss[k];
+            if (!removeCss) for (key in _loadedCss){
+                if (_loadedCss[key].id==module){
+                    removeCss = _loadedCss[key];
+                    k = key;
+                    break;
+                }
+            }
+            if (removeCss){
+                delete _loadedCss[k];
+                var styleNode = removeCss.doc.getElementById(removeCss.id);
+                if (styleNode) styleNode.parentNode.removeChild(styleNode);
+                removeCss = null;
             }
-        }
-        if (removeCss){
-            delete _loadedCss[k];
-            var styleNode = removeCss.doc.getElementById(removeCss.id);
-            if (styleNode) styleNode.parentNode.removeChild(styleNode);
-            removeCss = null;
         }
     };
     this.o2.loadCss = _loadCss;
@@ -593,85 +600,206 @@
     };
 
     //json template
-    _parseText = function(html, json){
-        var _ht = html;
-        var regexp = /(text\{).+?\}/g;
-        var r = _ht.match(regexp);
-        if(r) if (r.length){
-            for (var i=0; i<r.length; i++){
-                var text = r[i].substr(0,r[i].lastIndexOf("}"));
-                text = text.substr(text.indexOf("{")+1,text.length);
-                var value = _jsonText(json ,text);
-                _ht = _ht.replace(/(text\{).+?\}/,value);
+    // _parseText = function(html, json){
+    //     var _ht = html;
+    //     var regexp = /(text\{).+?\}/g;
+    //     var r = _ht.match(regexp);
+    //     if(r) if (r.length){
+    //         for (var i=0; i<r.length; i++){
+    //             var text = r[i].substr(0,r[i].lastIndexOf("}"));
+    //             text = text.substr(text.indexOf("{")+1,text.length);
+    //             var value = _jsonText(json ,text);
+    //             _ht = _ht.replace(/(text\{).+?\}/,value);
+    //         }
+    //     }
+    //     return _ht;
+    // };
+    // _parseEach = function(html, json){
+    //     var _ht = html;
+    //     var regexp = /(\{each\([\s\S]+\)\})[\s\S]+?(\{endEach\})/g;
+    //     var r = _ht.match(regexp);
+    //     if(r){
+    //         if (r.length){
+    //             for (var i=0; i<r.length; i++){
+    //                 var eachItemsStr = r[i].substr(0,r[i].indexOf(")"));
+    //                 eachItemsStr = eachItemsStr.substr(eachItemsStr.indexOf("(")+1,eachItemsStr.length);
+    //                 var pars = eachItemsStr.split(/,[\s]*/g);
+    //                 eachItemsPar = pars[0];
+    //                 eachItemsCount = pars[1].toInt();
+    //
+    //                 var eachItems = _jsonText(json ,eachItemsPar);
+    //                 if (eachItems) if (eachItemsCount==0) eachItemsCount = eachItems.length;
+    //
+    //                 var eachContentStr = r[i].substr(0,r[i].lastIndexOf("{endEach}"));
+    //                 eachContentStr = eachContentStr.substr(eachContentStr.indexOf("}")+1,eachContentStr.length);
+    //
+    //                 var eachContent = [];
+    //                 if (eachItems){
+    //                     for (var n=0; n<Math.min(eachItems.length, eachItemsCount); n++){
+    //                         var item = eachItems[n];
+    //                         if (item){
+    //                             var tmpEachContentStr = eachContentStr;
+    //                             var textReg = /(eachText\{).+?\}/g;
+    //                             texts = tmpEachContentStr.match(textReg);
+    //                             if (texts){
+    //                                 if (texts.length){
+    //                                     for (var j=0; j<texts.length; j++){
+    //                                         var text = texts[j].substr(0,texts[j].lastIndexOf("}"));
+    //                                         text = text.substr(text.indexOf("{")+1,text.length);
+    //
+    //                                         var value = _jsonText(item ,text);
+    //                                         tmpEachContentStr = tmpEachContentStr.replace(/(eachText\{).+?\}/,value);
+    //                                     }
+    //                                 }
+    //                             }
+    //                             eachContent.push(tmpEachContentStr);
+    //                         }
+    //                     }
+    //                 }
+    //                 _ht = _ht.replace(/(\{each\([\s\S]+\)\})[\s\S]+?(\{endEach\})/,eachContent.join(""));
+    //             }
+    //         }
+    //     }
+    //     return _ht;
+    // };
+    // _jsonText = function(json, text){
+    //     var $ = json;
+    //     var f = eval("(x = function($){\n return "+text+";\n})");
+    //     returnValue = f.apply(json, [$]);
+    //     if (returnValue===undefined) returnValue="";
+    //     returnValue = returnValue.toString();
+    //     return returnValue || "";
+    // };
+    // var _bindJson = function(str, json){
+    //     return _parseEach(_parseText(str, json), json);
+    // };
+    // o2.bindJson = _bindJson;
+    // String.prototype.bindJson = function(json){
+    //     return _parseEach(_parseText(this, json), json);
+    // };
+
+    var _getIfBlockEnd = function(v){
+        var rex = /(\{\{if\s+)|(\{\{\s*end if\s*\}\})/gmi;
+        var rexEnd = /\{\{\s*end if\s*\}\}/gmi;
+        var subs = 1;
+        while ((match = rex.exec(v)) !== null) {
+            var fullMatch = match[0];
+            if (fullMatch.search(rexEnd)!==-1){
+                subs--;
+                if (subs==0) break;
+            }else{
+                subs++
             }
         }
-        return _ht;
-    };
-    _parseEach = function(html, json){
-        var _ht = html;
-        var regexp = /(\{each\([\s\S]+\)\})[\s\S]+?(\{endEach\})/g;
-        var r = _ht.match(regexp);
-        if(r){
-            if (r.length){
-                for (var i=0; i<r.length; i++){
-                    var eachItemsStr = r[i].substr(0,r[i].indexOf(")"));
-                    eachItemsStr = eachItemsStr.substr(eachItemsStr.indexOf("(")+1,eachItemsStr.length);
-                    var pars = eachItemsStr.split(/,[\s]*/g);
-                    eachItemsPar = pars[0];
-                    eachItemsCount = pars[1].toInt();
-
-                    var eachItems = _jsonText(json ,eachItemsPar);
-                    if (eachItems) if (eachItemsCount==0) eachItemsCount = eachItems.length;
-
-                    var eachContentStr = r[i].substr(0,r[i].lastIndexOf("{endEach}"));
-                    eachContentStr = eachContentStr.substr(eachContentStr.indexOf("}")+1,eachContentStr.length);
-
-                    var eachContent = [];
-                    if (eachItems){
-                        for (var n=0; n<Math.min(eachItems.length, eachItemsCount); n++){
-                            var item = eachItems[n];
-                            if (item){
-                                var tmpEachContentStr = eachContentStr;
-                                var textReg = /(eachText\{).+?\}/g;
-                                texts = tmpEachContentStr.match(textReg);
-                                if (texts){
-                                    if (texts.length){
-                                        for (var j=0; j<texts.length; j++){
-                                            var text = texts[j].substr(0,texts[j].lastIndexOf("}"));
-                                            text = text.substr(text.indexOf("{")+1,text.length);
-
-                                            var value = _jsonText(item ,text);
-                                            tmpEachContentStr = tmpEachContentStr.replace(/(eachText\{).+?\}/,value);
-                                        }
-                                    }
-                                }
-                                eachContent.push(tmpEachContentStr);
-                            }
-                        }
+        if (match) return {"codeIndex": match.index, "lastIndex": rex.lastIndex};
+        return {"codeIndex": v.length-1, "lastIndex": v.length-1};
+    }
+    var _getEachBlockEnd = function(v){
+        var rex = /(\{\{each\s+)|(\{\{\s*end each\s*\}\})/gmi;
+        var rexEnd = /\{\{\s*end each\s*\}\}/gmi;
+        var subs = 1;
+        while ((match = rex.exec(v)) !== null) {
+            var fullMatch = match[0];
+            if (fullMatch.search(rexEnd)!==-1){
+                subs--;
+                if (subs==0) break;
+            }else{
+                subs++;
+            }
+        }
+        if (match) return {"codeIndex": match.index, "lastIndex": rex.lastIndex};
+        return {"codeIndex": v.length-1, "lastIndex": v.length-1};
+    }
+
+    var _parseHtml = function(str, json){
+        var v = str;
+        var rex = /(\{\{\s*)[\s\S]*?(\s*\}\})/gmi;
+
+        var match;
+        while ((match = rex.exec(v)) !== null) {
+            var fullMatch = match[0];
+            var offset = 0;
+
+            //if statement begin
+            if (fullMatch.search(/\{\{if\s+/i)!==-1){
+                //找到对应的end if
+                var condition = fullMatch.replace(/^\{\{if\s*/i, "");
+                condition = condition.replace(/\s*\}\}$/i, "");
+                var flag = _jsonText(json, condition, "boolean");
+
+                var tmpStr = v.substring(rex.lastIndex, v.length);
+                var endIfIndex = _getIfBlockEnd(tmpStr);
+                if (flag){ //if 为 true
+                    var parseStr = _parseHtml(tmpStr.substring(0, endIfIndex.codeIndex), json);
+                    var vLeft = v.substring(0, match.index);
+                    var vRight = v.substring(rex.lastIndex+endIfIndex.lastIndex, v.length);
+                    v = vLeft + parseStr + vRight;
+                    offset = parseStr.length - fullMatch.length;
+                }else{
+                    v = v.substring(0, match.index) + v.substring(rex.lastIndex+endIfIndex.lastIndex, v.length);
+                    offset = 0-fullMatch.length;
+                }
+            }else  if (fullMatch.search(/\{\{each\s+/)!==-1) { //each statement
+                var itemString = fullMatch.replace(/^\{\{each\s*/, "");
+                itemString = itemString.replace(/\s*\}\}$/, "");
+                var eachValue = _jsonText(json, itemString, "object");
+
+                var tmpEachStr = v.substring(rex.lastIndex, v.length);
+                var endEachIndex = _getEachBlockEnd(tmpEachStr);
+
+                var parseEachStr = tmpEachStr.substring(0, endEachIndex.codeIndex);
+                var eachResult = "";
+                if (eachValue && _typeOf(eachValue)==="array"){
+                    for (var i=0; i<eachValue.length; i++){
+                        eachValue[i]._ = json;
+                        eachResult += _parseHtml(parseEachStr, eachValue[i]);
                     }
-                    _ht = _ht.replace(/(\{each\([\s\S]+\)\})[\s\S]+?(\{endEach\})/,eachContent.join(""));
+                    var eLeft = v.substring(0, match.index);
+                    var eRight = v.substring(rex.lastIndex+endEachIndex.lastIndex, v.length);
+                    v = eLeft + eachResult + eRight;
+                    offset = eachResult.length - fullMatch.length;
+                }else{
+                    v = v.substring(0, match.index) + v.substring(rex.lastIndex+endEachIndex.lastIndex, v.length);
+                    offset = 0-fullMatch.length;
                 }
+
+            }else{ //text statement
+                var text = fullMatch.replace(/^\{\{\s*/, "");
+                text = text.replace(/\}\}\s*$/, "");
+                var value = _jsonText(json, text);
+                offset = value.length-fullMatch.length;
+                v = v.substring(0, match.index) + value + v.substring(rex.lastIndex, v.length);
             }
+            rex.lastIndex = rex.lastIndex + offset;
+        }
+        return v;
+    };
+    var _jsonText = function(json, text, type){
+        try {
+            var $ = json;
+            var f = eval("(function($){\n return "+text+";\n})");
+            returnValue = f.apply(json, [$]);
+            if (returnValue===undefined) returnValue="";
+            if (type==="boolean") return (!!returnValue);
+            if (type==="object") return returnValue;
+            returnValue = returnValue.toString();
+            return returnValue || "";
+        }catch(e){
+            if (type==="boolean") return false;
+            if (type==="object") return null;
+            return "";
         }
-        return _ht;
-    };
-    _jsonText = function(json, text){
-        var $ = json;
-        var f = eval("(x = function($){\n return "+text+";\n})");
-        returnValue = f.apply(json, [$]);
-        if (returnValue===undefined) returnValue="";
-        returnValue = returnValue.toString();
-        return returnValue || "";
     };
 
-    _bindJson = function(str, json){
-        return _parseEach(_parseText(str, json), json);
+    o2.bindJson = function(str, json){
+        return _parseHtml(str, json);
     };
-    o2.bindJson = _bindJson;
     String.prototype.bindJson = function(json){
-        return _parseEach(_parseText(this, json), json);
+        return _parseHtml(this, json);
     };
 
+
+
     //dom ready
     var _dom = {
         ready: false,

+ 2 - 0
o2web/source/o2_core/o2/lp/zh-cn.js

@@ -293,6 +293,8 @@ o2.LP.widget = {
     "clearImg_confirm": "您确定要清除图片吗?",
     "office": "在文档控件中打开",
     "closeOffice": "关闭附件",
+    "configAttachment": "设置附件权限",
+    "checkOcrText": "纠正自动识别的图片中的文字",
 
     "record": "录音",
     "stop": "停止",

+ 14 - 1
o2web/source/o2_core/o2/o2.more.js

@@ -211,7 +211,7 @@
             this.each(function(v){
                 if (v) arr.push(v);
             });
-            return v;
+            return arr;
         },
         "isIntersect": function(arr){
             return this.some(function(item){ return (arr.indexOf(item)!==-1); })
@@ -461,6 +461,19 @@
                 }
             }
             return properties;
+        },
+        "getZIndex": function(){
+            var n = this;
+            var i=0;
+            while (n){
+                if (n.getStyle("position")==="absolute"){
+                    var idx = n.getStyle("z-index");
+                    i = (idx && idx.toFloat()>i) ? idx.toFloat()+1 : 0;
+                    break;
+                }
+                n = n.getParent();
+            }
+            return i;
         }
     });
     Object.copy = function(from, to){

+ 6 - 2
o2web/source/o2_core/o2/widget/$Dialog/work/css.wcss

@@ -50,7 +50,11 @@
 	},
 	"button": {
 		"border": "1px solid #999",
-		"color": "#333",
-		"margin": "0px 5px"
+        "background-color": "#3C76B7",
+        "color": "#fff",
+        "height": "26px",
+        "border-radius": "5px",
+        "min-width": "80px",
+        "margin": "10px 5px"
 	}
 }

+ 1 - 1
o2web/source/o2_core/o2/widget/$Dialog/work/dialog.html

@@ -5,7 +5,7 @@
     <div style="margin-top: 3px; overflow:hidden">
         <div class="MWF_dialod_content" style="text-align: left; padding: 12px; padding-left: 15px; line-height:20px;"></div>
     </div>
-	<div style="height:22px; text-align: right;padding-right:10px;" class="MWF_dialod_button">
+	<div style="height:36px; text-align: right;padding-right:10px;" class="MWF_dialod_button">
         
     </div>
     <div class="MWF_dialod_bottom" style="; margin-bottom: 3px;">

+ 1 - 1
o2web/source/o2_core/o2/widget/$Toolbar/xform_blue_simple/css.wcss

@@ -9,7 +9,7 @@
 		"word-break" : "keep-all",
 		"cursor": "pointer",
 		"overflow": "hidden",
-		"height": "36px",
+		"height": "auto",
 		"display":"block",
 		"font-size": "14px",
 		"border-top": "2px solid #3c76b7"

+ 1 - 1
o2web/source/o2_core/o2/widget/$Toolbar/xform_red_simple/css.wcss

@@ -9,7 +9,7 @@
 		"word-break" : "keep-all",
 		"cursor": "pointer",
 		"overflow": "hidden",
-		"height": "36px",
+		"height": "auto",
 		"display":"block",
 		"font-size": "14px",
 		"border-top": "2px solid #cc3d3d"

+ 4 - 2
o2web/source/o2_core/o2/widget/AttachmentController.js

@@ -195,6 +195,8 @@ o2.widget.AttachmentController = o2.widget.ATTER  = new Class({
         this.createReadGroupActions();
         this.createListGroupActions();
         this.createViewGroupActions();
+
+        //this.createConfigGroupActions();
     },
 
     createEditGroupActions: function(){
@@ -924,7 +926,7 @@ o2.widget.AttachmentController.Attachment = new Class({
         this.textSizeNode.set("text", size);
 
         this.textUploaderNode = new Element("div", {"styles": this.css.attachmentTextUploaderNode_list}).inject(this.textNode);
-        this.textUploaderNode.set("text", this.data.person);
+        this.textUploaderNode.set("text", o2.name.cn(this.data.person));
 
         this.textTimeNode = new Element("div", {"styles": this.css.attachmentTextTimeNode_list}).inject(this.textNode);
         this.textTimeNode.set("text", this.data.lastUpdateTime);
@@ -964,7 +966,7 @@ o2.widget.AttachmentController.Attachment = new Class({
         this.textSizeNode.set("text", size);
 
         this.textUploaderNode = new Element("div", {"styles": this.css.attachmentTextUploaderNode_list}).inject(this.textNode);
-        this.textUploaderNode.set("text", this.data.person);
+        this.textUploaderNode.set("text", o2.name.cn(this.data.person));
 
         this.textTimeNode = new Element("div", {"styles": this.css.attachmentTextTimeNode_list}).inject(this.textNode);
         this.textTimeNode.set("text", this.data.lastUpdateTime);

+ 14 - 7
o2web/source/o2_core/o2/widget/Dialog.js

@@ -159,15 +159,21 @@ o2.widget.Dialog = o2.DL = new Class({
     },
 	setTitleEvent: function(){
 		this.title.addEvent("mousedown", function(){
+            var content;
+            if (layout.app) content = layout.app.content;
+            if (layout.desktop.currentApp) content = layout.desktop.currentApp.content;
 			this.containerDrag = new Drag.Move(this.node, {
-                "container": (layout) ? layout.desktop.currentApp.content: null
+                "container": content
             });
 		}.bind(this));
 		this.title.addEvent("mouseup", function(){
 			this.node.removeEvents("mousedown");
 			this.title.addEvent("mousedown", function(){
-				this.containerDrag = new Drag.Move(this.node, {
-                    "container": (layout) ? layout.desktop.currentApp.content: null
+				var content;
+				if (layout.app) content = layout.app.content;
+				if (layout.desktop.currentApp) content = layout.desktop.currentApp.content;
+                this.containerDrag = new Drag.Move(this.node, {
+                    "container": content
                 });
 			}.bind(this));
 		}.bind(this));
@@ -183,11 +189,12 @@ o2.widget.Dialog = o2.DL = new Class({
                     "limit": {x:[200, null], y:[150, null]},
                     "onDrag": function(){
                         var size = this.node.getComputedSize();
+                        // this.css.to.width = size.totalWidth;
+                        // this.css.to.height = size.totalHeight;
+                        this.css.to.width = size.width;
+                        this.css.to.height = size.height;
 
-                        this.css.to.width = size.totalWidth;
-                        this.css.to.height = size.totalHeight;
-
-                        this.setContentSize(size.totalHeight, size.totalWidth);
+                        this.setContentSize(size.height, size.width);
 
                         this.fireEvent("resize");
                     }.bind(this),

+ 1 - 1
o2web/source/o2_core/o2/widget/O2Identity.js

@@ -331,7 +331,7 @@ o2.widget.O2Process = new Class({
         });
         var nameNode = new Element("div", {
             "styles": this.style.identityInforNameNode,
-            "text": this.data.applicationName || this.data.appName
+            "text": this.data.name || this.data.applicationName || this.data.appName
         }).inject(this.inforNode);
         this.tooltip = new mBox.Tooltip({
             content: this.inforNode,

+ 10 - 10
o2web/source/o2_core/o2/widget/ScriptArea.js

@@ -209,16 +209,16 @@ o2.widget.ScriptArea = new Class({
         this.jsEditor.load();
         if (this.options.isbind) this.bind(content);
 
-        this.createScriptReferenceMenu();
-
-
-        this.jsEditor.addEvent("reference", function(editor, e, e1){
-            if (!this.scriptReferenceMenu){
-                this.createScriptReferenceMenu(this.showReferenceMenu.bind(this));
-            }else{
-                this.showReferenceMenu();
-            }
-        }.bind(this));
+        // this.createScriptReferenceMenu();
+        //
+        //
+        // this.jsEditor.addEvent("reference", function(editor, e, e1){
+        //     if (!this.scriptReferenceMenu){
+        //         this.createScriptReferenceMenu(this.showReferenceMenu.bind(this));
+        //     }else{
+        //         this.showReferenceMenu();
+        //     }
+        // }.bind(this));
         this.referenceNode.setStyle("background", "url("+o2.session.path+"/widget/$ScriptArea/"+this.options.style+"/icon/reference.png) center center no-repeat")
     },
 

+ 1 - 1
o2web/source/o2_core/o2/widget/ScriptHelp.js

@@ -56,7 +56,7 @@ o2.widget.ScriptHelp = new Class({
                         }
                     }.bind(this));
                 }else{
-                    var subMenu = new o2.widget.ScriptHelp.Menu(null, {"style": "script"});
+                    var subMenu = new o2.widget.ScriptHelp.Menu(this.node, {"style": "script"});
                     subMenu.load();
                     this.loadMenuItems(code.value, subMenu);
                     menu.addMenuMenu(code.name, "", subMenu);

+ 7 - 7
o2web/source/o2_core/o2/widget/Toolbar.js

@@ -25,15 +25,15 @@ o2.widget.Toolbar = new Class({
 
 	},
 	load: function(){
-		if (this.fireEvent("queryLoad")){
+        if (this.fireEvent("queryLoad")){
 
-			this.node.set("styles", this.css.container);
+            this.node.set("styles", this.css.container);
 
-			this._loadToolbarItemNode();
-			this._loadToolbarItems();
-			this.fireEvent("postLoad");
-		}
-	},
+            this._loadToolbarItemNode();
+            this._loadToolbarItems();
+            this.fireEvent("postLoad");
+        }
+    },
 	_loadToolbarItemNode: function(){
 		var subNodes = this.node.getChildren();
 		subNodes.each(function(node, idx){

+ 8 - 1
o2web/source/o2_core/o2/widget/Upload.js

@@ -27,6 +27,14 @@ o2.widget.Upload = new Class({
             this.doUpload_FormData();
         }
     },
+    upload:function(){
+        if (FormData.expiredIE){
+            this.doUpload_InputFile();
+        }else{
+            if (!this.fileUploadNode) this.formData_CreateUploadArea();
+            this.fileUploadNode.click();
+        }
+    } ,
     doUpload_FormData: function(){
         this.formData_CreateUploadArea();
         this.fileUploadNode.click();
@@ -42,7 +50,6 @@ o2.widget.Upload = new Class({
         }
     },
     formData_Upload: function(){
-        debugger;
         var files = this.fileUploadNode.files;
         if (files.length){
             var count = files.length;

+ 13 - 0
o2web/source/o2_core/o2/xAction/services/x_cms_assemble_control.js

@@ -77,6 +77,19 @@ MWF.xAction.RestActions.Action["x_cms_assemble_control"] = new Class({
             json.data = [];
         }
     },
+
+    saveFile: function(data, success, failure, async){
+        if (data.id){
+            this.updataFile(data.id, data, success, failure, async);
+        }else{
+            this.getUUID(function(id){
+                data.id = id;
+                this.addFile(data, success, failure, async);
+            }.bind(this), false);
+
+        }
+    },
+
     saveForm: function(formData, mobileData, fieldList, success, failure){
         if (!formData.isNewForm){
             this.updateForm(formData, mobileData, fieldList, success, failure);

+ 19 - 0
o2web/source/o2_core/o2/xAction/services/x_cms_assemble_control.json

@@ -151,6 +151,7 @@
   "addData": {"uri": "/jaxrs/data/document/{id}", "method": "POST"},
   "updateData": {"uri": "/jaxrs/data/document/{id}", "method": "PUT"},
 
+  //attachment为文档中的附件
   "listAttachment" : {"uri":"/jaxrs/fileinfo/list/document/{documentid}"},
   "getAttachment": {"uri": "/jaxrs/fileinfo/{id}/document/{documentid}"},
   "deleteAttachment": {"uri": "/jaxrs/fileinfo/{id}", "method": "DELETE"},
@@ -172,6 +173,24 @@
   //将用户已经上传的图片附件直接转换为一个base64编码[Jaxrs]
   "getSubjectAttachmentBase64" : {"uri":"/jaxrs/fileinfo/{id}/binary/base64/{size}"},
 
+  //file为CMS平台的附件
+  "listFile" : {"uri":"/jaxrs/file/list/appInfo/{applicationFlag}"},
+  "getFile": {"uri": "/jaxrs/file/{id}"},
+  "addFile": {"uri": "/jaxrs/file", "method": "POST"},
+  "removeFile": {"uri": "/jaxrs/file/{id}", "method": "DELETE"},
+  "deleteFile": {"uri": "/jaxrs/file/{id}", "method": "DELETE"},
+  "updataFile": {"uri": "/jaxrs/file/{id}", "method": "PUT"},
+  "getFileByName": {"uri": "/jaxrs/file/appInfo/{applicationId}/name/{name}"},
+  "downloadFile": {"uri": "/jaxrs/file/{id}/download"},
+  "downloadWithApp": {"uri": "/jaxrs/file/{flag}/appInfo/{applicationFlag}/download"},
+  "readFileById": {"uri": "/jaxrs/file/{id}/content"},
+  "uploadFile": {"uri": "/jaxrs/file/{id}/upload", "method": "POST", "enctype": "formData"},
+  "copyFile": {"uri": "/jaxrs/file/{flag}/appInfo/{appInfoFlag}"},
+
+  "readFile": {"uri": "/jaxrs/file/{flag}/appInfo/{applicationFlag}/content"},
+//  "listFile": {"uri": "/jaxrs/file/list/application/{applicationFlag}"},
+
+
   //id                   -- ID
   //  documentId           --文档ID
   //  description          --信息说明(size:255)

+ 4 - 1
o2web/source/o2_core/o2/xAction/services/x_organization_assemble_control.json

@@ -164,8 +164,11 @@
   //列出指定组织的上级和下级组织(直接 和 所有)
   "listSubUnitDirect": {"uri": "/jaxrs/unit/list/{id}/sub/direct"},
   "listSubUnitNested": {"uri": "/jaxrs/unit/list/{id}/sub/nested"},
-  "listSupUnitDirect": {"uri": "/jaxrs/unit/list/{id}/sup/direct"},
+  "listSubUnitNestedByType": {"uri": "/jaxrs/unit/list/{flag}/sub/direct/type/{type}"},
+
+  "getSupUnitDirect": {"uri": "/jaxrs/unit/{id}/sup/direct"},
   "listSupUnitNested": {"uri": "/jaxrs/unit/list/{id}/sup/nested"},
+  "listSupUnitNestedByType": {"uri": "/jaxrs/unit/list/{flag}/sup/nested/type/{type}"},
 
   "getUnitWithIdentityWithLevel": {"uri": "/jaxrs/unit/identity/{id}/level/{level}"},
   "getUnitWithIdentityWithType": {"uri": "/jaxrs/unit/identity/{id}/type/{type}"},

+ 8 - 0
o2web/source/o2_core/o2/xAction/services/x_organization_assemble_personal.json

@@ -23,5 +23,13 @@
   "createCodeOnResetPassword" :  {"uri":"/jaxrs/reset/code/credential/{credential}"},
 
 
+  "getUserData": {"uri": "/jaxrs/custom/{name}"},
+  "putUserData": {"uri": "/jaxrs/custom/{name}", "method": "PUT"},
+  "deleteUserData": {"uri": "/jaxrs/custom/{name}", "method": "DELETE"},
+
+  "getPublicUserData": {"uri": "/jaxrs/definition/{name}"},
+  "putPublicUserData": {"uri": "/jaxrs/definition/{name}", "method": "PUT"},
+  "deletePublicUserData": {"uri": "/jaxrs/definition/{name}", "method": "DELETE"},
+
   "clazz": "x_organization_assemble_personal"
 }

+ 9 - 0
o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.js

@@ -83,5 +83,14 @@ MWF.xAction.RestActions.Action["x_processplatform_assemble_surface"] = new Class
             url = url.replace("{workCompletedId}", encodeURIComponent(workid));
             if (callback) callback(this.action.address+url);
         }.bind(this));
+    },
+    getWorkDataByPath: function(id, path, success, failure, async){
+        var p = path.replace(/\./g, "/");
+        if (id.workCompleted){
+            this.action.invoke({"name": "getWorkcompletedDataByPath","async": async, "parameter": {"id": id.workCompleted, "path": p},	"success": success,	"failure": failure, "urlEncode":false});
+        }else{
+            this.action.invoke({"name": "getWorkDataByPath","async": async, "parameter": {"id": id.work, "path": p},	"success": success,	"failure": failure, "urlEncode":false});
+        }
+
     }
 });

+ 5 - 2
o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json

@@ -183,6 +183,9 @@
 
 
   "getWorkData": {"uri": "/jaxrs/data/work/{id}", "method": "GET"},
+  "getWorkDataByPath": {"uri": "/jaxrs/data/work/{id}/{path}", "method": "GET"},
+  "getWorkcompletedDataByPath": {"uri": "/jaxrs/data/workcompleted/{id}/{path}", "method": "GET"},
+
   "getWorkcompletedData": {"uri": "/jaxrs/data/workcompleted/{id}", "method": "GET"},
 
   "saveData": {"uri": "/jaxrs/data/work/{id}", "method": "PUT"},
@@ -207,7 +210,8 @@
   "getAttachmentOCR": {"uri": "/jaxrs/attachment/{id}/work/{workId}/text"},
   "setAttachmentOCR": {"uri": "/jaxrs/attachment/edit/{id}/work/{workId}/text", "method": "PUT"},
 
-
+  "listWorkAttachments": {"uri": "/jaxrs/attachment/list/work/{workId}"},
+  "listWorkCompletedAttachments": {"uri": "/jaxrs/attachment/list/workcompleted/{workCompletedId}"},
 
   "retractWork": {"uri": "/jaxrs/work/{id}/retract", "method": "PUT"},
   "resetWork": {"uri": "/jaxrs/task/{id}/reset", "method": "PUT"},
@@ -224,7 +228,6 @@
   //"getForm": {"uri": "/jaxrs/form/{id}"},
   "getForm": {"uri": "/jaxrs/form/{id}/application/{applicationFlag}"},
   "getScript": {"uri": "/jaxrs/script/{flag}/application/{applicationFlag}"},
-gulp
 
   "sendReaderByWork" : {"uri":"/jaxrs/read/work/{workId}", "method": "POST"},
   "sendReaderByWorkCompleted" : {"uri":"/jaxrs/read/workcompleted/{workCompletedId}", "method": "POST"},

+ 14 - 1
o2web/source/o2_core/o2/xAction/services/x_query_assemble_surface.json

@@ -19,6 +19,19 @@
   "exportView": {"uri": "/jaxrs/view/{id}/excel", "method": "PUT"},
   "getViewExcel": {"uri": "/jaxrs/view/excel/result/{flag}"},
 
-  "search": {"uri": "/jaxrs/segment/key/{key}"}
+  "search": {"uri": "/jaxrs/segment/key/{key}"},
 
+  "executeStatement" : { "uri": "/jaxrs/statement/{flag}/execute", "method": "POST" },
+
+  "listRowNext" : { "uri" : "/jaxrs/table/list/{tableFlag}/row/{id}/next/{count}" },
+  "listRowPrev" : { "uri" : "/jaxrs/table/list/{tableFlag}/row/{id}/prev/{count}" },
+  "listRowSelectWhere" : { "uri" : "/jaxrs/table/list/{tableFlag}/row/select/where/{where}" }, //通过where 获取表中的数据,格式为jpql语法,o.name='zhangsan'
+  "getRow" : { "uri": "/jaxrs/table/{tableFlag}/row/{id}" }, //获取表中某一行数据
+  "updateRow":{ "uri": "/jaxrs/table/{tableFlag}/row/{id}", "method": "PUT" }, //更新指定表中指定行数据.
+  "insertRow":{ "uri": "/jaxrs/table/{tableFlag}/row", "method": "POST" },//插入一行
+  "countRowWhere" : { "uri": "/jaxrs/table/{tableFlag}/row/count/where/{where}"},//通过where 统计数量
+  "deleteRow" : { "uri": "/jaxrs/table/{tableFlag}/row/{id}", "method": "DELETE" }, //更新指定表中指定行数据.
+  "deleteAllRow" : { "uri": "/jaxrs/table/{tableFlag}/row/delete/all", "method": "DELETE"}, //通过where 统计数量
+
+  "calculateNeural": {"uri": "/jaxrs/neural/list/calculate/model/{modelFlag}/work/{workId}"}
 }

+ 1 - 1
o2web/source/o2_core/o2/xDesktop/$Layout/components.json

@@ -18,7 +18,7 @@
     "path": "process.TaskCenter",
     "title": "办公中心",
     "iconPath": "appicon.png",
-    "visible": true,
+    "visible": true
   },
   {
     "name": "cms",

+ 4 - 0
o2web/source/o2_core/o2/xDesktop/$Layout/styles.json

@@ -1,4 +1,8 @@
 [
+  {
+    "title": "新年快乐",
+    "style": "newyear"
+  },
   {
     "title": "O2",
     "style": "o2"

+ 13 - 0
o2web/source/o2_core/o2/xDesktop/Access.js

@@ -23,6 +23,11 @@ MWF.xDesktop.Access = MWF.AC = {
         this.getRoleList();
         return this.isAdministrator() || (this.roleList.indexOf("processplatformmanager")!==-1);
     },
+    isQueryManager: function(){
+        if (!layout.desktop.session.user.roleList) return false;
+        this.getRoleList();
+        return this.isAdministrator() || (this.roleList.indexOf("querymanager")!==-1);
+    },
     isOrganizationManager: function(){
         if (!layout.desktop.session.user.roleList) return false;
         this.getRoleList();
@@ -64,10 +69,18 @@ MWF.xDesktop.Access = MWF.AC = {
     },
     isProcessPlatformCreator: function(){
         if (this.isAdministrator()) return true;
+        if (this.isProcessManager()) return true;
         if (!layout.desktop.session.user.roleList) return false;
         this.getRoleList();
         return (this.roleList.indexOf("processplatformcreator")!==-1);
     },
+    isQueryPlatformCreator: function(){
+        if (this.isAdministrator()) return true;
+        if (this.isQueryManager()) return true;
+        if (!layout.desktop.session.user.roleList) return false;
+        this.getRoleList();
+        return (this.roleList.indexOf("querycreator")!==-1);
+    },
     isApplicationManager: function(option){
         if (this.isAdministrator()) {
             if (option.yes) option.yes();

+ 32 - 18
o2web/source/o2_core/o2/xDesktop/Authentication.js

@@ -123,7 +123,7 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         "style": "default",
         "popupStyle" : "o2platform",
         "width": "650",
-        "height": "460",
+        "height": "480",
         "hasTop": true,
         "hasIcon": false,
         "hasTopIcon" : true,
@@ -437,9 +437,11 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         this.loginType = "captcha";
         this.codeLogin=false;
         this.bindLogin=false;
+        this.captchaLogin = true;
         this.actions.getLoginMode(function( json ){
             this.codeLogin = json.data.codeLogin;
             this.bindLogin = json.data.bindLogin;
+            this.captchaLogin = json.data.captchaLogin;
         }.bind(this), null, false);
 
         MWF.Actions.get("x_organization_assemble_personal").getRegisterMode(function(json){
@@ -470,10 +472,12 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
 
         html+="<table width='100%' bordr='0' cellpadding='0' cellspacing='0' styles='formTable'>" +
             "<tr item='credentialTr'><td styles='formTableValueTop20' item='credential'></td></tr>" +
-            "<tr item='passwordTr'><td styles='formTableValueTop20' item='password'></td></tr>" +
-            "<tr item='captchaTr'><td styles='formTableValueTop20'>"+
-            "<div item='captchaAnswer' style='float:left;'></div><div item='captchaPic' style='float:left;'></div><div item='changeCaptchaAction' style='float:left;'></div>"+
-            "</td></tr>";
+            "<tr item='passwordTr'><td styles='formTableValueTop20' item='password'></td></tr>";
+        if( this.captchaLogin ){
+            html += "<tr item='captchaTr'><td styles='formTableValueTop20'>"+
+                "<div item='captchaAnswer' style='float:left;'></div><div item='captchaPic' style='float:left;'></div><div item='changeCaptchaAction' style='float:left;'></div>"+
+                "</td></tr>";
+        }
         if( this.codeLogin ){
             html += "<tr item='codeTr' style='display: none'><td styles='formTableValueTop20'>"+
                 "   <div item='codeAnswer' style='float:left;'></div>"+
@@ -504,7 +508,7 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         }).inject(this.formTableArea, "after");
 
 
-        this.setCaptchaPic();
+        if( this.captchaLogin )this.setCaptchaPic();
         this.errorArea = this.formTableArea.getElement("[item=errorArea]");
 
         this.oauthArea = this.formTableArea.getElement("[item=oauthArea]");
@@ -764,6 +768,9 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
             this.options.height = parseInt(this.options.height) + this.oauthArea.getSize().y ;
             this.isPlusOauthSize = true;
         }
+        if( !this.captchaLogin ){
+            this.options.height = this.options.height - 60;
+        }
     },
     loadOauthContent : function(){
         this.actions.listOauthServer(function( json ){
@@ -842,7 +849,8 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         this.form.getItem("passwordAction").setStyles(this.css.titleNode_active);
         this.form.getItem("codeAction").setStyles(this.css.titleNode_normal);
         this.formTableArea.getElement("[item='passwordTr']").setStyle("display","");
-        this.formTableArea.getElement("[item='captchaTr']").setStyle("display","");
+        var captchaTr = this.formTableArea.getElement("[item='captchaTr']");
+        if(captchaTr)captchaTr.setStyle("display","");
         this.formTableArea.getElement("[item='codeTr']").setStyle("display","none");
     },
     showCodeLogin: function(){
@@ -851,7 +859,8 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         this.form.getItem("passwordAction").setStyles(this.css.titleNode_normal);
         this.form.getItem("codeAction").setStyles(this.css.titleNode_active);
         this.formTableArea.getElement("[item='passwordTr']").setStyle("display","none");
-        this.formTableArea.getElement("[item='captchaTr']").setStyle("display","none");
+        var captchaTr = this.formTableArea.getElement("[item='captchaTr']");
+        if(captchaTr)captchaTr.setStyle("display","none");
         this.formTableArea.getElement("[item='codeTr']").setStyle("display","");
 
     },
@@ -885,6 +894,7 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         }.bind(this))
     },
     setCaptchaPic: function(){
+        if( !this.captchaLogin )return;
         var captchaPic = this.formTableArea.getElement("[item='captchaPic']");
         captchaPic.empty();
         this.actions.getLoginCaptcha(120, 50, function( json ){
@@ -991,17 +1001,19 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         if( this.loginType === "captcha" ){
             this.form.getItem("password").options.notEmpty = true;
 
-            captchaItem = this.form.getItem("captchaAnswer");
-            if( captchaItem )captchaItem.options.notEmpty = true;
+            if( this.captchaLogin ){
+                captchaItem = this.form.getItem("captchaAnswer");
+                if( captchaItem )captchaItem.options.notEmpty = true;
+            }
 
             codeItem = this.form.getItem("codeAnswer");
             if(codeItem)codeItem.options.notEmpty = false;
         }else if( this.loginType === "code" ){
             this.form.getItem("password").options.notEmpty = false;
-
-            captchaItem = this.form.getItem("captchaAnswer");
-            if( captchaItem )captchaItem.options.notEmpty = false;
-
+            if( this.captchaLogin ){
+                captchaItem = this.form.getItem("captchaAnswer");
+                if( captchaItem )captchaItem.options.notEmpty = false;
+            }
             codeItem = this.form.getItem("codeAnswer");
             if(codeItem)codeItem.options.notEmpty = true;
         }
@@ -1033,10 +1045,12 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
         if( this.loginType === "captcha" ){
             d = {
                 credential : data.credential,
-                password : data.password,
-                captchaAnswer : data.captchaAnswer,
-                captcha : this.captcha
+                password : data.password
             };
+            if( this.captchaLogin ){
+                d.captchaAnswer = data.captchaAnswer;
+                d.captcha = this.captcha;
+            }
             this.actions.loginByCaptcha( d, function( json ){
                 if( callback )callback( json );
                 //this.fireEvent("postOk")
@@ -1044,7 +1058,7 @@ MWF.xDesktop.Authentication.LoginForm = new Class({
                 var error = JSON.parse( errorObj.responseText );
                 this.setWarning( error.message );
                 this.setCaptchaPic();
-                this.form.getItem( "captchaAnswer").setValue("");
+                if(this.form.getItem( "captchaAnswer"))this.form.getItem( "captchaAnswer").setValue("");
             }.bind(this));
         }else if( this.loginType === "code" ){
             d = {

+ 21 - 7
o2web/source/o2_core/o2/xDesktop/Lnk.js

@@ -233,12 +233,12 @@ MWF.xDesktop.LnkMove = new Class({
 			"mousedown": function(e){
 				if (!e.rightClick){
 					this.isReadyDrag = true;
-					this.isReadySwing = true;
+					//this.isReadySwing = true;
 					this.readyDragPosition = {"x": e.page.x, "y": e.page.y};
 					this.readySwingTime = new Date().getTime();
-					this.swingTimer = window.setTimeout(function(){
-						this.beginNodeSwing(e);
-					}.bind(this), 1000);
+					// this.swingTimer = window.setTimeout(function(){
+					// 	this.beginNodeSwing(e);
+					// }.bind(this), 1000);
 					
 					this.node.addEvent("mousemove", function(event){
 						if (this.isReadyDrag){
@@ -355,10 +355,24 @@ MWF.xDesktop.Lnk = new Class({
 			"styles": this.desktop.css.desktopLnkIconNode
 		}).inject(this.node);
 
+		var img = new Element("img").inject(this.iconNode);
+		var s = this.iconNode.getSize();
+        if (!s.x) s.x = this.iconNode.getStyle("width").toFloat();
+        if (!s.y) s.y = this.iconNode.getStyle("height").toFloat();
+		var w = s.x-10;
+        var h = s.y-10;
+        img.setStyles({
+			"margin": "5px",
+			"max-width": ""+w+"px",
+            "max-height": ""+h+"px"
+		});
+
         if (this.icon.substr(0,3).toLowerCase()=="url"){
-            this.iconNode.setStyle("background-image", this.icon);
+            img.set("src", this.icon.substring(4, this.icon.length-1));
+            //this.iconNode.setStyle("background-image", this.icon);
         }else{
-            this.iconNode.setStyle("background-image", "url("+this.icon+")");
+            img.set("src", this.icon);
+            //this.iconNode.setStyle("background-image", "url("+this.icon+")");
         }
 		//this.iconNode.setStyle("background-image", "url("+this.icon+")");
 		
@@ -395,7 +409,7 @@ MWF.xDesktop.Lnk = new Class({
 		this.node.inject(node, where);
 	},
 	open: function(e){
-		debugger;
+
 		if (!this.isSwing){
             var parList = this.par.split("#");
             var appName = parList[0];

+ 1 - 1
o2web/source/o2_core/o2/xDesktop/MessageMobile.js

@@ -123,7 +123,7 @@ MWF.xDesktop.MessageMobile = new Class({
 		var item = new MWF.xDesktop.MessageMobile.Item(this,msg);
         if (!this.isShow){
             this.setPosition();
-            this.show();
+            //this.show();
         }
 		return item;
 	},

+ 1 - 1
o2web/source/o2_core/o2/xDesktop/UserData.js

@@ -4,7 +4,7 @@ MWF.require("MWF.xDesktop.Actions.RestActions", null, false);
 
 MWF.xDesktop.UserData = MWF.UD = {
     getAction: function(){
-        this.action = new MWF.xDesktop.Actions.RestActions("/xDesktop/Actions/action.json", "x_organization_assemble_custom");
+        this.action = new MWF.xDesktop.Actions.RestActions("/xDesktop/Actions/action.json", "x_organization_assemble_personal");
     },
     getData: function(name, callback, async){
         if (!this.action) this.getAction();

+ 1 - 1
o2web/source/o2_core/o2/xDesktop/Window.js

@@ -512,7 +512,7 @@ MWF.xDesktop.Window = new Class({
 			this.morph = new Fx.Morph(this.node, {duration: 100, link: "chain"});
 		}
 		this.morph.setOptions({duration: 50});
-		debugger;
+
 		this.getSpacer();
 		if (!this.spacerMorph){
 			this.spacerMorph = new Fx.Morph(this.spacer, {duration: 100, link: "chain"});

+ 1 - 0
o2web/source/o2_lib/htmleditor/ckeditor451/ckeditor.js

@@ -1,6 +1,7 @@
 /*
 Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.md or http://ckeditor.com/license
+
 */
 (function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,d={timestamp:"F62B",version:"4.5.1",revision:"a513a92",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var i=c[d].src.match(a);if(i){b=i[1];break}}-1==b.indexOf(":/")&&"//"!=b.slice(0,2)&&(b=0===b.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+
 b:location.href.match(/^[^\?]*\/(?:)/)[0]+b);if(!b)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return b}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&("/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a))&&(a+=(0<=a.indexOf("?")?"&":"?")+"t="+this.timestamp);return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",

+ 1 - 1
o2web/source/o2_lib/htmleditor/ckeditor462/ckeditor.js

@@ -889,7 +889,7 @@ c='\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"'+(CKEDITOR.env.ie?'
 h&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,c);this.clearCustomData();this.clearListeners();b.fire("contentDomUnload");var k=this.getDocument();try{k.write(a)}catch(l){setTimeout(function(){k.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var f=a.config,b=f.fullPage,c=b&&a.docType,d=b&&a.xmlDeclaration,
 e=this.getDocument(),b=b?e.getDocumentElement().getOuterHtml():e.getBody().getHtml();CKEDITOR.env.gecko&&f.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/<br>(?=\s*(:?$|<\/body>))/,""));b=a.dataProcessor.toDataFormat(b);d&&(b=d+"\n"+b);c&&(b=c+"\n"+b);return b},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:l.baseProto.focus.call(this)},detach:function(){var a=this.editor,f=a.document,b;try{b=a.window.getFrame()}catch(c){}l.baseProto.detach.call(this);this.clearCustomData();f.getDocumentElement().clearCustomData();
 CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);b&&b.getParent()?(b.clearCustomData(),(a=b.removeCustomData("onResize"))&&a.removeListener(),b.remove()):CKEDITOR.warn("editor-destroy-iframe")}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;(function(){function e(b,a){a||(a=b.getSelection().getSelectedElement());if(a&&a.is("img")&&!a.data("cke-realelement")&&!a.isReadOnly())return a}function f(b){var a=b.getStyle("float");if("inherit"==a||"none"==a)a=0;a||(a=b.getAttribute("align"));return a}CKEDITOR.plugins.add("image",{requires:"dialog",init:function(b){if(!b.plugins.image2){CKEDITOR.dialog.add("image",this.path+"dialogs/image.js");var a="img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
-CKEDITOR.dialog.isTabEnabled(b,"image","advanced")&&(a="img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");b.addCommand("image",new CKEDITOR.dialogCommand("image",{allowedContent:a,requiredContent:"img[alt,src]",contentTransformations:[["img{width}: sizeToStyle","img[width]: sizeToAttribute"],["img{float}: alignmentToStyle","img[align]: alignmentToAttribute"]]}));b.ui.addButton&&b.ui.addButton("Image",{label:b.lang.common.image,command:"image",toolbar:"insert,10"});b.on("doubleclick",function(b){var a=
+CKEDITOR.dialog.isTabEnabled(b,"image","advanced")&&(a="img[onerror,data-id,alt,dir,id,lang,longdesc,!src,title]{*}(*)");b.addCommand("image",new CKEDITOR.dialogCommand("image",{allowedContent:a,requiredContent:"img[alt,src]",contentTransformations:[["img{width}: sizeToStyle","img[width]: sizeToAttribute"],["img{float}: alignmentToStyle","img[align]: alignmentToAttribute"]]}));b.ui.addButton&&b.ui.addButton("Image",{label:b.lang.common.image,command:"image",toolbar:"insert,10"});b.on("doubleclick",function(b){var a=
 b.data.element;!a.is("img")||a.data("cke-realelement")||a.isReadOnly()||(b.data.dialog="image")});b.addMenuItems&&b.addMenuItems({image:{label:b.lang.image.menu,command:"image",group:"image"}});b.contextMenu&&b.contextMenu.addListener(function(a){if(e(b,a))return{image:CKEDITOR.TRISTATE_OFF}})}},afterInit:function(b){function a(a){var d=b.getCommand("justify"+a);if(d){if("left"==a||"right"==a)d.on("exec",function(d){var c=e(b),g;c&&(g=f(c),g==a?(c.removeStyle("float"),a==f(c)&&c.removeAttribute("align")):
 c.setStyle("float",a),d.cancel())});d.on("refresh",function(d){var c=e(b);c&&(c=f(c),this.setState(c==a?CKEDITOR.TRISTATE_ON:"right"==a||"left"==a?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),d.cancel())})}}b.plugins.image2||(a("left"),a("right"),a("center"),a("block"))}})})();CKEDITOR.config.image_removeLinkByEmptyURL=!0;(function(){function m(a,b){var e,f;b.on("refresh",function(a){var b=[k],c;for(c in a.data.states)b.push(a.data.states[c]);this.setState(CKEDITOR.tools.search(b,p)?p:k)},b,null,100);b.on("exec",function(b){e=a.getSelection();f=e.createBookmarks(1);b.data||(b.data={});b.data.done=!1},b,null,0);b.on("exec",function(){a.forceNextSelectionCheck();e.selectBookmarks(f)},b,null,100)}var k=CKEDITOR.TRISTATE_DISABLED,p=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(a){var b=CKEDITOR.plugins.indent.genericDefinition;
 m(a,a.addCommand("indent",new b(!0)));m(a,a.addCommand("outdent",new b));a.ui.addButton&&(a.ui.addButton("Indent",{label:a.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),a.ui.addButton("Outdent",{label:a.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"}));a.on("dirChanged",function(b){var f=a.createRange(),l=b.data.node;f.setStartBefore(l);f.setEndAfter(l);for(var n=new CKEDITOR.dom.walker(f),c;c=n.next();)if(c.type==CKEDITOR.NODE_ELEMENT)if(!c.equals(l)&&

+ 721 - 41
o2web/source/o2_lib/htmleditor/ckeditor462/plugins/image/dialogs/image.js

@@ -1,44 +1,724 @@
 /*
  Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  For licensing, see LICENSE.md or http://ckeditor.com/license
-*/
-(function(){var v=function(d,l){function v(){var a=arguments,b=this.getContentElement("advanced","txtdlgGenStyle");b&&b.commit.apply(b,a);this.foreach(function(b){b.commit&&"txtdlgGenStyle"!=b.id&&b.commit.apply(b,a)})}function k(a){if(!w){w=1;var b=this.getDialog(),c=b.imageElement;if(c){this.commit(1,c);a=[].concat(a);for(var d=a.length,f,g=0;g<d;g++)(f=b.getContentElement.apply(b,a[g].split(":")))&&f.setup(1,c)}w=0}}var m=/^\s*(\d+)((px)|\%)?\s*$/i,z=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,r=/^\d+px$/,
-A=function(){var a=this.getValue(),b=this.getDialog(),c=a.match(m);c&&("%"==c[2]&&n(b,!1),a=c[1]);b.lockRatio&&(c=b.originalElement,"true"==c.getCustomData("isReady")&&("txtHeight"==this.id?(a&&"0"!=a&&(a=Math.round(a/c.$.height*c.$.width)),isNaN(a)||b.setValueOf("info","txtWidth",a)):(a&&"0"!=a&&(a=Math.round(a/c.$.width*c.$.height)),isNaN(a)||b.setValueOf("info","txtHeight",a))));e(b)},e=function(a){if(!a.originalElement||!a.preview)return 1;a.commitContent(4,a.preview);return 0},w,n=function(a,
-b){if(!a.getContentElement("info","ratioLock"))return null;var c=a.originalElement;if(!c)return null;if("check"==b){if(!a.userlockRatio&&"true"==c.getCustomData("isReady")){var d=a.getValueOf("info","txtWidth"),f=a.getValueOf("info","txtHeight"),c=1E3*c.$.width/c.$.height,g=1E3*d/f;a.lockRatio=!1;d||f?isNaN(c)||isNaN(g)||Math.round(c)!=Math.round(g)||(a.lockRatio=!0):a.lockRatio=!0}}else void 0!==b?a.lockRatio=b:(a.userlockRatio=1,a.lockRatio=!a.lockRatio);d=CKEDITOR.document.getById(t);a.lockRatio?
-d.removeClass("cke_btn_unlocked"):d.addClass("cke_btn_unlocked");d.setAttribute("aria-checked",a.lockRatio);CKEDITOR.env.hc&&d.getChild(0).setHtml(a.lockRatio?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢");return a.lockRatio},B=function(a,b){var c=a.originalElement;if("true"==c.getCustomData("isReady")){var d=a.getContentElement("info","txtWidth"),f=a.getContentElement("info","txtHeight"),g;b?c=g=0:(g=c.$.width,c=c.$.height);d&&d.setValue(g);f&&f.setValue(c)}e(a)},C=function(a,b){function c(a,b){var c=
-a.match(m);return c?("%"==c[2]&&(c[1]+="%",n(d,!1)),c[1]):b}if(1==a){var d=this.getDialog(),f="",g="txtWidth"==this.id?"width":"height",e=b.getAttribute(g);e&&(f=c(e,f));f=c(b.getStyle(g),f);this.setValue(f)}},x,u=function(){var a=this.originalElement,b=CKEDITOR.document.getById(p);a.setCustomData("isReady","true");a.removeListener("load",u);a.removeListener("error",h);a.removeListener("abort",h);b&&b.setStyle("display","none");this.dontResetSize||B(this,!1===d.config.image_prefillDimensions);this.firstLoad&&
-CKEDITOR.tools.setTimeout(function(){n(this,"check")},0,this);this.dontResetSize=this.firstLoad=!1;e(this)},h=function(){var a=this.originalElement,b=CKEDITOR.document.getById(p);a.removeListener("load",u);a.removeListener("error",h);a.removeListener("abort",h);a=CKEDITOR.getUrl(CKEDITOR.plugins.get("image").path+"images/noimage.png");this.preview&&this.preview.setAttribute("src",a);b&&b.setStyle("display","none");n(this,!1)},q=function(a){return CKEDITOR.tools.getNextId()+"_"+a},t=q("btnLockSizes"),
-y=q("btnResetSize"),p=q("ImagePreviewLoader"),E=q("previewLink"),D=q("previewImage");return{title:d.lang.image["image"==l?"title":"titleButton"],minWidth:"moono-lisa"==(CKEDITOR.skinName||d.config.skin)?500:420,minHeight:360,onShow:function(){this.linkEditMode=this.imageEditMode=this.linkElement=this.imageElement=!1;this.lockRatio=!0;this.userlockRatio=0;this.dontResetSize=!1;this.firstLoad=!0;this.addLink=!1;var a=this.getParentEditor(),b=a.getSelection(),c=(b=b&&b.getSelectedElement())&&a.elementPath(b).contains("a",
-1),d=CKEDITOR.document.getById(p);d&&d.setStyle("display","none");x=new CKEDITOR.dom.element("img",a.document);this.preview=CKEDITOR.document.getById(D);this.originalElement=a.document.createElement("img");this.originalElement.setAttribute("alt","");this.originalElement.setCustomData("isReady","false");c&&(this.linkElement=c,this.addLink=this.linkEditMode=!0,a=c.getChildren(),1==a.count()&&(d=a.getItem(0),d.type==CKEDITOR.NODE_ELEMENT&&(d.is("img")||d.is("input"))&&(this.imageElement=a.getItem(0),
-this.imageElement.is("img")?this.imageEditMode="img":this.imageElement.is("input")&&(this.imageEditMode="input"))),"image"==l&&this.setupContent(2,c));if(this.customImageElement)this.imageEditMode="img",this.imageElement=this.customImageElement,delete this.customImageElement;else if(b&&"img"==b.getName()&&!b.data("cke-realelement")||b&&"input"==b.getName()&&"image"==b.getAttribute("type"))this.imageEditMode=b.getName(),this.imageElement=b;this.imageEditMode&&(this.cleanImageElement=this.imageElement,
-this.imageElement=this.cleanImageElement.clone(!0,!0),this.setupContent(1,this.imageElement));n(this,!0);CKEDITOR.tools.trim(this.getValueOf("info","txtUrl"))||(this.preview.removeAttribute("src"),this.preview.setStyle("display","none"))},onOk:function(){if(this.imageEditMode){var a=this.imageEditMode;"image"==l&&"input"==a&&confirm(d.lang.image.button2Img)?(this.imageElement=d.document.createElement("img"),this.imageElement.setAttribute("alt",""),d.insertElement(this.imageElement)):"image"!=l&&"img"==
-a&&confirm(d.lang.image.img2Button)?(this.imageElement=d.document.createElement("input"),this.imageElement.setAttributes({type:"image",alt:""}),d.insertElement(this.imageElement)):(this.imageElement=this.cleanImageElement,delete this.cleanImageElement)}else"image"==l?this.imageElement=d.document.createElement("img"):(this.imageElement=d.document.createElement("input"),this.imageElement.setAttribute("type","image")),this.imageElement.setAttribute("alt","");this.linkEditMode||(this.linkElement=d.document.createElement("a"));
-this.commitContent(1,this.imageElement);this.commitContent(2,this.linkElement);this.imageElement.getAttribute("style")||this.imageElement.removeAttribute("style");this.imageEditMode?!this.linkEditMode&&this.addLink?(d.insertElement(this.linkElement),this.imageElement.appendTo(this.linkElement)):this.linkEditMode&&!this.addLink&&(d.getSelection().selectElement(this.linkElement),d.insertElement(this.imageElement)):this.addLink?this.linkEditMode?this.linkElement.equals(d.getSelection().getSelectedElement())?
-(this.linkElement.setHtml(""),this.linkElement.append(this.imageElement,!1)):d.insertElement(this.imageElement):(d.insertElement(this.linkElement),this.linkElement.append(this.imageElement,!1)):d.insertElement(this.imageElement)},onLoad:function(){"image"!=l&&this.hidePage("Link");var a=this._.element.getDocument();this.getContentElement("info","ratioLock")&&(this.addFocusable(a.getById(y),5),this.addFocusable(a.getById(t),5));this.commitContent=v},onHide:function(){this.preview&&this.commitContent(8,
-this.preview);this.originalElement&&(this.originalElement.removeListener("load",u),this.originalElement.removeListener("error",h),this.originalElement.removeListener("abort",h),this.originalElement.remove(),this.originalElement=!1);delete this.imageElement},contents:[{id:"info",label:d.lang.image.infoTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",className:"cke_dialog_image_url",children:[{id:"txtUrl",type:"text",label:d.lang.common.url,
-required:!0,onChange:function(){var a=this.getDialog(),b=this.getValue();if(0<b.length){var a=this.getDialog(),c=a.originalElement;a.preview&&a.preview.removeStyle("display");c.setCustomData("isReady","false");var d=CKEDITOR.document.getById(p);d&&d.setStyle("display","");c.on("load",u,a);c.on("error",h,a);c.on("abort",h,a);c.setAttribute("src",b);a.preview&&(x.setAttribute("src",b),a.preview.setAttribute("src",x.$.src),e(a))}else a.preview&&(a.preview.removeAttribute("src"),a.preview.setStyle("display",
-"none"))},setup:function(a,b){if(1==a){var c=b.data("cke-saved-src")||b.getAttribute("src");this.getDialog().dontResetSize=!0;this.setValue(c);this.setInitValue()}},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())?(b.data("cke-saved-src",this.getValue()),b.setAttribute("src",this.getValue())):8==a&&(b.setAttribute("src",""),b.removeAttribute("src"))},validate:CKEDITOR.dialog.validate.notEmpty(d.lang.image.urlMissing)},{type:"button",id:"browse",style:"display:inline-block;margin-top:14px;",
-align:"center",label:d.lang.common.browseServer,hidden:!0,filebrowser:"info:txtUrl"}]}]},{id:"txtAlt",type:"text",label:d.lang.image.alt,accessKey:"T","default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("alt"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("alt",this.getValue()):4==a?b.setAttribute("alt",this.getValue()):8==a&&b.removeAttribute("alt")}},{type:"hbox",children:[{id:"basic",type:"vbox",children:[{type:"hbox",
-requiredContent:"img{width,height}",widths:["50%","50%"],children:[{type:"vbox",padding:1,children:[{type:"text",width:"45px",id:"txtWidth",label:d.lang.common.width,onKeyUp:A,onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(z);(a=!(!a||0===parseInt(a[1],10)))||alert(d.lang.common.invalidWidth);return a},setup:C,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("width",CKEDITOR.tools.cssLength(c)):
-b.removeStyle("width"),b.removeAttribute("width")):4==a?c.match(m)?b.setStyle("width",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("width",c.$.width+"px")):8==a&&(b.removeAttribute("width"),b.removeStyle("width"))}},{type:"text",id:"txtHeight",width:"45px",label:d.lang.common.height,onKeyUp:A,onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(z);(a=!(!a||0===parseInt(a[1],10)))||
-alert(d.lang.common.invalidHeight);return a},setup:C,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("height",CKEDITOR.tools.cssLength(c)):b.removeStyle("height"),b.removeAttribute("height")):4==a?c.match(m)?b.setStyle("height",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("height",c.$.height+"px")):8==a&&(b.removeAttribute("height"),b.removeStyle("height"))}}]},{id:"ratioLock",
-type:"html",className:"cke_dialog_image_ratiolock",style:"margin-top:30px;width:40px;height:40px;",onLoad:function(){var a=CKEDITOR.document.getById(y),b=CKEDITOR.document.getById(t);a&&(a.on("click",function(a){B(this);a.data&&a.data.preventDefault()},this.getDialog()),a.on("mouseover",function(){this.addClass("cke_btn_over")},a),a.on("mouseout",function(){this.removeClass("cke_btn_over")},a));b&&(b.on("click",function(a){n(this);var b=this.originalElement,d=this.getValueOf("info","txtWidth");"true"==
-b.getCustomData("isReady")&&d&&(b=b.$.height/b.$.width*d,isNaN(b)||(this.setValueOf("info","txtHeight",Math.round(b)),e(this)));a.data&&a.data.preventDefault()},this.getDialog()),b.on("mouseover",function(){this.addClass("cke_btn_over")},b),b.on("mouseout",function(){this.removeClass("cke_btn_over")},b))},html:'\x3cdiv\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.lockRatio+'" class\x3d"cke_btn_locked" id\x3d"'+t+'" role\x3d"checkbox"\x3e\x3cspan class\x3d"cke_icon"\x3e\x3c/span\x3e\x3cspan class\x3d"cke_label"\x3e'+
-d.lang.image.lockRatio+'\x3c/span\x3e\x3c/a\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.resetSize+'" class\x3d"cke_btn_reset" id\x3d"'+y+'" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3e'+d.lang.image.resetSize+"\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e"}]},{type:"vbox",padding:1,children:[{type:"text",id:"txtBorder",requiredContent:"img{border-width}",width:"60px",label:d.lang.image.border,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,
-"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateBorder),setup:function(a,b){if(1==a){var c;c=(c=(c=b.getStyle("border-width"))&&c.match(/^(\d+px)(?: \1 \1 \1)?$/))&&parseInt(c[1],10);isNaN(parseInt(c,10))&&(c=b.getAttribute("border"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&b.removeStyle("border"):(b.setStyle("border-width",CKEDITOR.tools.cssLength(c)),b.setStyle("border-style",
-"solid")),1==a&&b.removeAttribute("border")):8==a&&(b.removeAttribute("border"),b.removeStyle("border-width"),b.removeStyle("border-style"),b.removeStyle("border-color"))}},{type:"text",id:"txtHSpace",requiredContent:"img{margin-left,margin-right}",width:"60px",label:d.lang.image.hSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateHSpace),setup:function(a,b){if(1==a){var c,
-d;c=b.getStyle("margin-left");d=b.getStyle("margin-right");c=c&&c.match(r);d=d&&d.match(r);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("hspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-left"),b.removeStyle("margin-right")):(b.setStyle("margin-left",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-right",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("hspace")):
-8==a&&(b.removeAttribute("hspace"),b.removeStyle("margin-left"),b.removeStyle("margin-right"))}},{type:"text",id:"txtVSpace",requiredContent:"img{margin-top,margin-bottom}",width:"60px",label:d.lang.image.vSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){k.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateVSpace),setup:function(a,b){if(1==a){var c,d;c=b.getStyle("margin-top");d=b.getStyle("margin-bottom");c=c&&c.match(r);
-d=d&&d.match(r);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("vspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-top"),b.removeStyle("margin-bottom")):(b.setStyle("margin-top",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-bottom",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("vspace")):8==a&&(b.removeAttribute("vspace"),b.removeStyle("margin-top"),b.removeStyle("margin-bottom"))}},
-{id:"cmbAlign",requiredContent:"img{float}",type:"select",widths:["35%","65%"],style:"width:90px",label:d.lang.common.align,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.alignLeft,"left"],[d.lang.common.alignRight,"right"]],onChange:function(){e(this.getDialog());k.call(this,"advanced:txtdlgGenStyle")},setup:function(a,b){if(1==a){var c=b.getStyle("float");switch(c){case "inherit":case "none":c=""}!c&&(c=(b.getAttribute("align")||"").toLowerCase());this.setValue(c)}},commit:function(a,
-b){var c=this.getValue();if(1==a||4==a){if(c?b.setStyle("float",c):b.removeStyle("float"),1==a)switch(c=(b.getAttribute("align")||"").toLowerCase(),c){case "left":case "right":b.removeAttribute("align")}}else 8==a&&b.removeStyle("float")}}]}]},{type:"vbox",height:"250px",children:[{type:"html",id:"htmlPreview",style:"width:95%;",html:"\x3cdiv\x3e"+CKEDITOR.tools.htmlEncode(d.lang.common.preview)+'\x3cbr\x3e\x3cdiv id\x3d"'+p+'" class\x3d"ImagePreviewLoader" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"ImagePreviewBox"\x3e\x3ctable\x3e\x3ctr\x3e\x3ctd\x3e\x3ca href\x3d"javascript:void(0)" target\x3d"_blank" onclick\x3d"return false;" id\x3d"'+
-E+'"\x3e\x3cimg id\x3d"'+D+'" alt\x3d"" /\x3e\x3c/a\x3e'+(d.config.image_previewText||"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.")+
-"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/div\x3e"}]}]}]},{id:"Link",requiredContent:"a[href]",label:d.lang.image.linkTab,padding:0,elements:[{id:"txtUrl",type:"text",label:d.lang.common.url,style:"width: 100%","default":"",setup:function(a,b){if(2==a){var c=b.data("cke-saved-href");c||(c=b.getAttribute("href"));this.setValue(c)}},commit:function(a,b){if(2==a&&(this.getValue()||this.isChanged())){var c=this.getValue();b.data("cke-saved-href",c);b.setAttribute("href",c);this.getValue()||
-!d.config.image_removeLinkByEmptyURL?this.getDialog().addLink=!0:this.getDialog().addLink=!1}}},{type:"button",id:"browse",className:"cke_dialog_image_browse",filebrowser:{action:"Browse",target:"Link:txtUrl",url:d.config.filebrowserImageBrowseLinkUrl},style:"float:right",hidden:!0,label:d.lang.common.browseServer},{id:"cmbTarget",type:"select",requiredContent:"a[target]",label:d.lang.common.target,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.targetNew,"_blank"],[d.lang.common.targetTop,
-"_top"],[d.lang.common.targetSelf,"_self"],[d.lang.common.targetParent,"_parent"]],setup:function(a,b){2==a&&this.setValue(b.getAttribute("target")||"")},commit:function(a,b){2==a&&(this.getValue()||this.isChanged())&&b.setAttribute("target",this.getValue())}}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:d.lang.image.upload,elements:[{type:"file",id:"upload",label:d.lang.image.btnUpload,style:"height:40px",size:38},{type:"fileButton",id:"uploadButton",filebrowser:"info:txtUrl",label:d.lang.image.btnUpload,
-"for":["Upload","upload"]}]},{id:"advanced",label:d.lang.common.advancedTab,elements:[{type:"hbox",widths:["50%","25%","25%"],children:[{type:"text",id:"linkId",requiredContent:"img[id]",label:d.lang.common.id,setup:function(a,b){1==a&&this.setValue(b.getAttribute("id"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("id",this.getValue())}},{id:"cmbLangDir",type:"select",requiredContent:"img[dir]",style:"width : 100px;",label:d.lang.common.langDir,"default":"",items:[[d.lang.common.notSet,
-""],[d.lang.common.langDirLtr,"ltr"],[d.lang.common.langDirRtl,"rtl"]],setup:function(a,b){1==a&&this.setValue(b.getAttribute("dir"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("dir",this.getValue())}},{type:"text",id:"txtLangCode",requiredContent:"img[lang]",label:d.lang.common.langCode,"default":"",setup:function(a,b){1==a&&this.setValue(b.getAttribute("lang"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("lang",this.getValue())}}]},
-{type:"text",id:"txtGenLongDescr",requiredContent:"img[longdesc]",label:d.lang.common.longDescr,setup:function(a,b){1==a&&this.setValue(b.getAttribute("longDesc"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("longDesc",this.getValue())}},{type:"hbox",widths:["50%","50%"],children:[{type:"text",id:"txtGenClass",requiredContent:"img(cke-xyz)",label:d.lang.common.cssClass,"default":"",setup:function(a,b){1==a&&this.setValue(b.getAttribute("class"))},commit:function(a,
-b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("class",this.getValue())}},{type:"text",id:"txtGenTitle",requiredContent:"img[title]",label:d.lang.common.advisoryTitle,"default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("title"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("title",this.getValue()):4==a?b.setAttribute("title",this.getValue()):8==a&&b.removeAttribute("title")}}]},{type:"text",id:"txtdlgGenStyle",
-requiredContent:"img{cke-xyz}",label:d.lang.common.cssStyle,validate:CKEDITOR.dialog.validate.inlineStyle(d.lang.common.invalidInlineStyle),"default":"",setup:function(a,b){if(1==a){var c=b.getAttribute("style");!c&&b.$.style.cssText&&(c=b.$.style.cssText);this.setValue(c);var d=b.$.style.height,c=b.$.style.width,d=(d?d:"").match(m),c=(c?c:"").match(m);this.attributesInStyle={height:!!d,width:!!c}}},onChange:function(){k.call(this,"info:cmbFloat info:cmbAlign info:txtVSpace info:txtHSpace info:txtBorder info:txtWidth info:txtHeight".split(" "));
-e(this)},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("style",this.getValue())}}]}]}};CKEDITOR.dialog.add("image",function(d){return v(d,"image")});CKEDITOR.dialog.add("imagebutton",function(d){return v(d,"imagebutton")})})();
+ */
+(function () {
+    var v = function (d, l) {
+        function v() {
+            var a = arguments, b = this.getContentElement("advanced", "txtdlgGenStyle");
+            b && b.commit.apply(b, a);
+            this.foreach(function (b) {
+                b.commit && "txtdlgGenStyle" != b.id && b.commit.apply(b, a)
+            })
+        }
+
+        function k(a) {
+            if (!w) {
+                w = 1;
+                var b = this.getDialog(), c = b.imageElement;
+                if (c) {
+                    this.commit(1, c);
+                    a = [].concat(a);
+                    for (var d = a.length, f, g = 0; g < d; g++)(f = b.getContentElement.apply(b, a[g].split(":"))) && f.setup(1, c)
+                }
+                w = 0
+            }
+        }
+
+        var m = /^\s*(\d+)((px)|\%)?\s*$/i, z = /(^\s*(\d+)((px)|\%)?\s*$)|^$/i, r = /^\d+px$/,
+            A = function () {
+                var a = this.getValue(), b = this.getDialog(), c = a.match(m);
+                c && ("%" == c[2] && n(b, !1), a = c[1]);
+                b.lockRatio && (c = b.originalElement, "true" == c.getCustomData("isReady") && ("txtHeight" == this.id ? (a && "0" != a && (a = Math.round(a / c.$.height * c.$.width)), isNaN(a) || b.setValueOf("info", "txtWidth", a)) : (a && "0" != a && (a = Math.round(a / c.$.width * c.$.height)), isNaN(a) || b.setValueOf("info", "txtHeight", a))));
+                e(b)
+            }, e = function (a) {
+                if (!a.originalElement || !a.preview)return 1;
+                a.commitContent(4, a.preview);
+                return 0
+            }, w, n = function (a,
+                                b) {
+                if (!a.getContentElement("info", "ratioLock"))return null;
+                var c = a.originalElement;
+                if (!c)return null;
+                if ("check" == b) {
+                    if (!a.userlockRatio && "true" == c.getCustomData("isReady")) {
+                        var d = a.getValueOf("info", "txtWidth"), f = a.getValueOf("info", "txtHeight"), c = 1E3 * c.$.width / c.$.height, g = 1E3 * d / f;
+                        a.lockRatio = !1;
+                        d || f ? isNaN(c) || isNaN(g) || Math.round(c) != Math.round(g) || (a.lockRatio = !0) : a.lockRatio = !0
+                    }
+                } else void 0 !== b ? a.lockRatio = b : (a.userlockRatio = 1, a.lockRatio = !a.lockRatio);
+                d = CKEDITOR.document.getById(t);
+                a.lockRatio ?
+                    d.removeClass("cke_btn_unlocked") : d.addClass("cke_btn_unlocked");
+                d.setAttribute("aria-checked", a.lockRatio);
+                CKEDITOR.env.hc && d.getChild(0).setHtml(a.lockRatio ? CKEDITOR.env.ie ? "■" : "▣" : CKEDITOR.env.ie ? "□" : "▢");
+                return a.lockRatio
+            }, B = function (a, b) {
+                var c = a.originalElement;
+                if ("true" == c.getCustomData("isReady")) {
+                    var d = a.getContentElement("info", "txtWidth"), f = a.getContentElement("info", "txtHeight"), g;
+                    b ? c = g = 0 : (g = c.$.width, c = c.$.height);
+                    d && d.setValue(g);
+                    f && f.setValue(c)
+                }
+                e(a)
+            }, C = function (a, b) {
+                function c(a, b) {
+                    var c =
+                        a.match(m);
+                    return c ? ("%" == c[2] && (c[1] += "%", n(d, !1)), c[1]) : b
+                }
+
+                if (1 == a) {
+                    var d = this.getDialog(), f = "", g = "txtWidth" == this.id ? "width" : "height", e = b.getAttribute(g);
+                    e && (f = c(e, f));
+                    f = c(b.getStyle(g), f);
+                    this.setValue(f)
+                }
+            }, x, u = function () {
+                var a = this.originalElement, b = CKEDITOR.document.getById(p);
+                a.setCustomData("isReady", "true");
+                a.removeListener("load", u);
+                a.removeListener("error", h);
+                a.removeListener("abort", h);
+                b && b.setStyle("display", "none");
+                this.dontResetSize || B(this, !1 === d.config.image_prefillDimensions);
+                this.firstLoad &&
+                CKEDITOR.tools.setTimeout(function () {
+                    n(this, "check")
+                }, 0, this);
+                this.dontResetSize = this.firstLoad = !1;
+                e(this)
+            }, h = function () {
+                var a = this.originalElement, b = CKEDITOR.document.getById(p);
+                a.removeListener("load", u);
+                a.removeListener("error", h);
+                a.removeListener("abort", h);
+                a = CKEDITOR.getUrl(CKEDITOR.plugins.get("image").path + "images/noimage.png");
+                this.preview && this.preview.setAttribute("src", a);
+                b && b.setStyle("display", "none");
+                n(this, !1)
+            }, q = function (a) {
+                return CKEDITOR.tools.getNextId() + "_" + a
+            }, t = q("btnLockSizes"),
+            y = q("btnResetSize"), p = q("ImagePreviewLoader"), E = q("previewLink"), D = q("previewImage");
+        return {
+            title: d.lang.image["image" == l ? "title" : "titleButton"],
+            minWidth: "moono-lisa" == (CKEDITOR.skinName || d.config.skin) ? 500 : 420,
+            minHeight: 360,
+            onShow: function () {
+                this.linkEditMode = this.imageEditMode = this.linkElement = this.imageElement = !1;
+                this.lockRatio = !0;
+                this.userlockRatio = 0;
+                this.dontResetSize = !1;
+                this.firstLoad = !0;
+                this.addLink = !1;
+                var a = this.getParentEditor(), b = a.getSelection(), c = (b = b && b.getSelectedElement()) && a.elementPath(b).contains("a",
+                        1), d = CKEDITOR.document.getById(p);
+                d && d.setStyle("display", "none");
+                x = new CKEDITOR.dom.element("img", a.document);
+                this.preview = CKEDITOR.document.getById(D);
+                this.originalElement = a.document.createElement("img");
+                this.originalElement.setAttribute("alt", "");
+                this.originalElement.setCustomData("isReady", "false");
+                c && (this.linkElement = c, this.addLink = this.linkEditMode = !0, a = c.getChildren(), 1 == a.count() && (d = a.getItem(0), d.type == CKEDITOR.NODE_ELEMENT && (d.is("img") || d.is("input")) && (this.imageElement = a.getItem(0),
+                    this.imageElement.is("img") ? this.imageEditMode = "img" : this.imageElement.is("input") && (this.imageEditMode = "input"))), "image" == l && this.setupContent(2, c));
+                if (this.customImageElement)this.imageEditMode = "img", this.imageElement = this.customImageElement, delete this.customImageElement; else if (b && "img" == b.getName() && !b.data("cke-realelement") || b && "input" == b.getName() && "image" == b.getAttribute("type"))this.imageEditMode = b.getName(), this.imageElement = b;
+                this.imageEditMode && (this.cleanImageElement = this.imageElement,
+                    this.imageElement = this.cleanImageElement.clone(!0, !0), this.setupContent(1, this.imageElement));
+                n(this, !0);
+                CKEDITOR.tools.trim(this.getValueOf("info", "txtUrl")) || (this.preview.removeAttribute("src"), this.preview.setStyle("display", "none"))
+
+                CKEDITOR.currentImageDialog = this; //._.element.$;
+            },
+            onOk: function () {
+                if (this.imageEditMode) {
+                    var a = this.imageEditMode;
+                    "image" == l && "input" == a && confirm(d.lang.image.button2Img) ? (this.imageElement = d.document.createElement("img"), this.imageElement.setAttribute("alt", ""), d.insertElement(this.imageElement)) : "image" != l && "img" ==
+                    a && confirm(d.lang.image.img2Button) ? (this.imageElement = d.document.createElement("input"), this.imageElement.setAttributes({
+                        type: "image",
+                        alt: ""
+                    }), d.insertElement(this.imageElement)) : (this.imageElement = this.cleanImageElement, delete this.cleanImageElement)
+                } else"image" == l ? this.imageElement = d.document.createElement("img") : (this.imageElement = d.document.createElement("input"), this.imageElement.setAttribute("type", "image")), this.imageElement.setAttribute("alt", "");
+                this.linkEditMode || (this.linkElement = d.document.createElement("a"));
+                this.commitContent(1, this.imageElement);
+                this.commitContent(2, this.linkElement);
+                if( MWF.xDesktop.uploadedImageId ){
+                    this.imageElement.setAttributes({
+                        "data-id": MWF.xDesktop.uploadedImageId
+                    });
+                }
+                this.imageElement.setAttributes({
+                    "onerror": "MWF.xDesktop.setImageSrc()"
+                });
+                MWF.xDesktop.uploadedImageId = "";
+                this.imageElement.getAttribute("style") || this.imageElement.removeAttribute("style");
+                this.imageEditMode ? !this.linkEditMode && this.addLink ? (d.insertElement(this.linkElement), this.imageElement.appendTo(this.linkElement)) : this.linkEditMode && !this.addLink && (d.getSelection().selectElement(this.linkElement), d.insertElement(this.imageElement)) : this.addLink ? this.linkEditMode ? this.linkElement.equals(d.getSelection().getSelectedElement()) ?
+                    (this.linkElement.setHtml(""), this.linkElement.append(this.imageElement, !1)) : d.insertElement(this.imageElement) : (d.insertElement(this.linkElement), this.linkElement.append(this.imageElement, !1)) : d.insertElement(this.imageElement)
+            },
+            onLoad: function () {
+                "image" != l && this.hidePage("Link");
+                var a = this._.element.getDocument();
+                this.getContentElement("info", "ratioLock") && (this.addFocusable(a.getById(y), 5), this.addFocusable(a.getById(t), 5));
+                this.commitContent = v
+            },
+            onHide: function () {
+                this.preview && this.commitContent(8,
+                    this.preview);
+                this.originalElement && (this.originalElement.removeListener("load", u), this.originalElement.removeListener("error", h), this.originalElement.removeListener("abort", h), this.originalElement.remove(), this.originalElement = !1);
+                delete this.imageElement
+            },
+            contents: [{
+                id: "info", label: d.lang.image.infoTab, accessKey: "I", elements: [{
+                    type: "vbox", padding: 0, children: [{
+                        type: "hbox",
+                        widths: ["280px", "110px"],
+                        align: "right",
+                        className: "cke_dialog_image_url",
+                        children: [{
+                            id: "txtUrl", type: "text", label: d.lang.common.url,
+                            required: !0, onChange: function () {
+                                var a = this.getDialog(), b = this.getValue();
+                                if (0 < b.length) {
+                                    var a = this.getDialog(), c = a.originalElement;
+                                    a.preview && a.preview.removeStyle("display");
+                                    c.setCustomData("isReady", "false");
+                                    var d = CKEDITOR.document.getById(p);
+                                    d && d.setStyle("display", "");
+                                    c.on("load", u, a);
+                                    c.on("error", h, a);
+                                    c.on("abort", h, a);
+                                    c.setAttribute("src", b);
+                                    a.preview && (x.setAttribute("src", b), a.preview.setAttribute("src", x.$.src), e(a))
+                                } else a.preview && (a.preview.removeAttribute("src"), a.preview.setStyle("display",
+                                    "none"))
+                            }, setup: function (a, b) {
+                                if (1 == a) {
+                                    var c = b.data("cke-saved-src") || b.getAttribute("src");
+                                    this.getDialog().dontResetSize = !0;
+                                    this.setValue(c);
+                                    this.setInitValue()
+                                }
+                            }, commit: function (a, b) {
+                                1 == a && (this.getValue() || this.isChanged()) ? (b.data("cke-saved-src", this.getValue()), b.setAttribute("src", this.getValue())) : 8 == a && (b.setAttribute("src", ""), b.removeAttribute("src"))
+                            }, validate: CKEDITOR.dialog.validate.notEmpty(d.lang.image.urlMissing)
+                        }, {
+                            type: "button", id: "browse", style: "display:inline-block;margin-top:14px;",
+                            align: "center", label: d.lang.common.browseServer, hidden: !0, filebrowser: "info:txtUrl"
+                        }]
+                    }]
+                }, {
+                    type: "hbox",
+                    widths: ["27%", "30%", "40%"],
+                    hidden: ( d.config.reference && d.config.referenceType ) ? !1 : !0,
+                    children: [{
+                        type: "button",
+                        id: "browseLocal",
+                        style: "display:inline-block;margin-bottom:4px;",
+                        align: "center",
+                        label: "选择本地图片",//c.lang.common.browseServer,
+                        hidden: !( d.config.reference && d.config.referenceType ),
+                        onClick: function (e) {
+                            //var fileNode = document.getElementById("fckLocalFileUpload");
+                            //fileNode.click();
+                            MWF.require("MWF.widget.Upload", function(){
+                                var action =  new MWF.xDesktop.Actions.RestActions("/xDesktop/Actions/action.json", "x_file_assemble_control");
+                                var dialogElement = CKEDITOR.currentImageDialog._.element.$;
+                                var contentElement = dialogElement.getElement(".cke_dialog_body").getParent();
+                                var upload = new MWF.widget.Upload(contentElement, {
+                                    "data": null,
+                                    "parameter": {"reference" : d.config.reference, "referencetype": d.config.referenceType, "scale" : 800 },
+                                    "action": action,
+                                    "method": "uploadImageByScale",
+                                    "onEvery": function(json){
+                                        var id = json.data ? json.data.id : json.id;
+                                        var src = MWF.xDesktop.getImageSrc( id );
+                                        MWF.xDesktop.uploadedImageId = id;
+                                        var txtUrlElement = CKEDITOR.currentImageDialog.getContentElement("info", "txtUrl");
+                                        txtUrlElement.setValue( src );
+                                    }.bind(this)
+                                });
+                                upload.load();
+                            }.bind(this));
+                        },
+                        onLoad: function () {
+                            //var fileNode = document.getElementById("fckLocalFileUpload");
+                            //if( !fileNode ){
+                            //    fileNode = new Element("input", {
+                            //        "id" : "fckLocalFileUpload",
+                            //        "type" : "file",
+                            //        "accept":"images/*",
+                            //        "styles" : {"display":"none"}
+                            //    }).inject(document.body);
+                            //    fileNode.addEvent("change", function(event){
+                            //        var file= fileNode.files[0];
+                            //        var formData = new FormData();
+                            //        formData.append('file', file, file.name);
+                            //        MWF.xDesktop.uploadImageByScale( d.config.reference, d.config.referenceType, 800, formData, file, function( json ){
+                            //            var src = MWF.xDesktop.getImageSrc( json.id );
+                            //            MWF.xDesktop.uploadedImageId = json.id;
+                            //            var txtUrlElement = CKEDITOR.currentImageDialog.getContentElement("info", "txtUrl");
+                            //            txtUrlElement.setValue( src );
+                            //        }.bind(this), function( error ){
+                            //            MWF.xDesktop.notice("图片上传失败,请联系管理员"+ error.responseText ,"error");
+                            //        });
+                            //    }.bind( this ));
+                            //}
+                        }
+                    }, {
+                        type: "button",
+                        id: "browseFiles",
+                        style: "display:inline-block;margin-bottom:4px;",
+                        align: "center",
+                        label: "选择云文件图片",//c.lang.common.browseServer,
+                        hidden: !0, //!( d.config.reference && d.config.referenceType ), //d.config.filebrowserFilesImage ? !1 : !0, //!0,
+                        onClick: function (e) {
+                            //d.config.filebrowserFilesImage(e, function (url, base64Code) {
+                            //    txtUrlElement.setValue( base64Code || url );
+                            //});
+                            MWF.xDesktop.requireApp("File", "FileSelector", function(){
+                                ( new MWF.xApplication.File.FileSelector( document.body ,{
+                                    "style" : "default",
+                                    "title": "选择云文件图片",
+                                    "reference" :  d.config.reference,
+                                    "referenceType" : d.config.referenceType,
+                                    "listStyle": "preview",
+                                    "selectType" : "images",
+                                    "onPostSelectAttachment" : function( url, id ){
+                                        MWF.xDesktop.uploadedImageId = id;
+                                        //var txtUrlElement = this.getDialog().getContentElement("info", "txtUrl");
+                                        var txtUrlElement = CKEDITOR.currentImageDialog.getContentElement("info", "txtUrl");
+                                        txtUrlElement.setValue( url );
+                                    }.bind(this)
+                                })).load();
+                            }.bind(this), true);
+                        }
+                    },{
+                        type: "button",
+                        id: "browseDocumentAttachment",
+                        style: "display:inline-block;margin-bottom:4px;",
+                        align: "center",
+                        label: "选择本文档图片",//c.lang.common.browseServer,
+                        hidden: !0, //d.config.filebrowserCurrentDocumentImage ? !1 : !0,
+                        onClick: function (e) {
+                            var txtUrlElement = this.getDialog().getContentElement("info", "txtUrl");
+                            d.config.filebrowserCurrentDocumentImage(e, function (url, base64Code) {
+                                txtUrlElement.setValue( base64Code || url);
+                            });
+                        }
+                    }]
+                },  {
+                    id: "txtAlt",
+                    type: "text",
+                    label: d.lang.image.alt,
+                    accessKey: "T",
+                    "default": "",
+                    onChange: function () {
+                        e(this.getDialog())
+                    },
+                    setup: function (a, b) {
+                        1 == a && this.setValue(b.getAttribute("alt"))
+                    },
+                    commit: function (a, b) {
+                        1 == a ? (this.getValue() || this.isChanged()) && b.setAttribute("alt", this.getValue()) : 4 == a ? b.setAttribute("alt", this.getValue()) : 8 == a && b.removeAttribute("alt")
+                    }
+                }, {
+                    type: "hbox", children: [{
+                        id: "basic", type: "vbox", children: [{
+                            type: "hbox",
+                            requiredContent: "img{width,height}", widths: ["50%", "50%"], children: [{
+                                type: "vbox", padding: 1, children: [{
+                                    type: "text",
+                                    width: "45px",
+                                    id: "txtWidth",
+                                    label: d.lang.common.width,
+                                    onKeyUp: A,
+                                    onChange: function () {
+                                        k.call(this, "advanced:txtdlgGenStyle")
+                                    },
+                                    validate: function () {
+                                        var a = this.getValue().match(z);
+                                        (a = !(!a || 0 === parseInt(a[1], 10))) || alert(d.lang.common.invalidWidth);
+                                        return a
+                                    },
+                                    setup: C,
+                                    commit: function (a, b) {
+                                        var c = this.getValue();
+                                        1 == a ? (c && d.activeFilter.check("img{width,height}") ? b.setStyle("width", CKEDITOR.tools.cssLength(c)) :
+                                            b.removeStyle("width"), b.removeAttribute("width")) : 4 == a ? c.match(m) ? b.setStyle("width", CKEDITOR.tools.cssLength(c)) : (c = this.getDialog().originalElement, "true" == c.getCustomData("isReady") && b.setStyle("width", c.$.width + "px")) : 8 == a && (b.removeAttribute("width"), b.removeStyle("width"))
+                                    }
+                                }, {
+                                    type: "text",
+                                    id: "txtHeight",
+                                    width: "45px",
+                                    label: d.lang.common.height,
+                                    onKeyUp: A,
+                                    onChange: function () {
+                                        k.call(this, "advanced:txtdlgGenStyle")
+                                    },
+                                    validate: function () {
+                                        var a = this.getValue().match(z);
+                                        (a = !(!a || 0 === parseInt(a[1], 10))) ||
+                                        alert(d.lang.common.invalidHeight);
+                                        return a
+                                    },
+                                    setup: C,
+                                    commit: function (a, b) {
+                                        var c = this.getValue();
+                                        1 == a ? (c && d.activeFilter.check("img{width,height}") ? b.setStyle("height", CKEDITOR.tools.cssLength(c)) : b.removeStyle("height"), b.removeAttribute("height")) : 4 == a ? c.match(m) ? b.setStyle("height", CKEDITOR.tools.cssLength(c)) : (c = this.getDialog().originalElement, "true" == c.getCustomData("isReady") && b.setStyle("height", c.$.height + "px")) : 8 == a && (b.removeAttribute("height"), b.removeStyle("height"))
+                                    }
+                                }]
+                            }, {
+                                id: "ratioLock",
+                                type: "html",
+                                className: "cke_dialog_image_ratiolock",
+                                style: "margin-top:30px;width:40px;height:40px;",
+                                onLoad: function () {
+                                    var a = CKEDITOR.document.getById(y), b = CKEDITOR.document.getById(t);
+                                    a && (a.on("click", function (a) {
+                                        B(this);
+                                        a.data && a.data.preventDefault()
+                                    }, this.getDialog()), a.on("mouseover", function () {
+                                        this.addClass("cke_btn_over")
+                                    }, a), a.on("mouseout", function () {
+                                        this.removeClass("cke_btn_over")
+                                    }, a));
+                                    b && (b.on("click", function (a) {
+                                        n(this);
+                                        var b = this.originalElement, d = this.getValueOf("info", "txtWidth");
+                                        "true" ==
+                                        b.getCustomData("isReady") && d && (b = b.$.height / b.$.width * d, isNaN(b) || (this.setValueOf("info", "txtHeight", Math.round(b)), e(this)));
+                                        a.data && a.data.preventDefault()
+                                    }, this.getDialog()), b.on("mouseover", function () {
+                                        this.addClass("cke_btn_over")
+                                    }, b), b.on("mouseout", function () {
+                                        this.removeClass("cke_btn_over")
+                                    }, b))
+                                },
+                                html: '\x3cdiv\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"' + d.lang.image.lockRatio + '" class\x3d"cke_btn_locked" id\x3d"' + t + '" role\x3d"checkbox"\x3e\x3cspan class\x3d"cke_icon"\x3e\x3c/span\x3e\x3cspan class\x3d"cke_label"\x3e' +
+                                d.lang.image.lockRatio + '\x3c/span\x3e\x3c/a\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"' + d.lang.image.resetSize + '" class\x3d"cke_btn_reset" id\x3d"' + y + '" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3e' + d.lang.image.resetSize + "\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e"
+                            }]
+                        }, {
+                            type: "vbox", padding: 1, children: [{
+                                type: "text",
+                                id: "txtBorder",
+                                requiredContent: "img{border-width}",
+                                width: "60px",
+                                label: d.lang.image.border,
+                                "default": "",
+                                onKeyUp: function () {
+                                    e(this.getDialog())
+                                },
+                                onChange: function () {
+                                    k.call(this,
+                                        "advanced:txtdlgGenStyle")
+                                },
+                                validate: CKEDITOR.dialog.validate.integer(d.lang.image.validateBorder),
+                                setup: function (a, b) {
+                                    if (1 == a) {
+                                        var c;
+                                        c = (c = (c = b.getStyle("border-width")) && c.match(/^(\d+px)(?: \1 \1 \1)?$/)) && parseInt(c[1], 10);
+                                        isNaN(parseInt(c, 10)) && (c = b.getAttribute("border"));
+                                        this.setValue(c)
+                                    }
+                                },
+                                commit: function (a, b) {
+                                    var c = parseInt(this.getValue(), 10);
+                                    1 == a || 4 == a ? (isNaN(c) ? !c && this.isChanged() && b.removeStyle("border") : (b.setStyle("border-width", CKEDITOR.tools.cssLength(c)), b.setStyle("border-style",
+                                        "solid")), 1 == a && b.removeAttribute("border")) : 8 == a && (b.removeAttribute("border"), b.removeStyle("border-width"), b.removeStyle("border-style"), b.removeStyle("border-color"))
+                                }
+                            }, {
+                                type: "text",
+                                id: "txtHSpace",
+                                requiredContent: "img{margin-left,margin-right}",
+                                width: "60px",
+                                label: d.lang.image.hSpace,
+                                "default": "",
+                                onKeyUp: function () {
+                                    e(this.getDialog())
+                                },
+                                onChange: function () {
+                                    k.call(this, "advanced:txtdlgGenStyle")
+                                },
+                                validate: CKEDITOR.dialog.validate.integer(d.lang.image.validateHSpace),
+                                setup: function (a, b) {
+                                    if (1 == a) {
+                                        var c,
+                                            d;
+                                        c = b.getStyle("margin-left");
+                                        d = b.getStyle("margin-right");
+                                        c = c && c.match(r);
+                                        d = d && d.match(r);
+                                        c = parseInt(c, 10);
+                                        d = parseInt(d, 10);
+                                        c = c == d && c;
+                                        isNaN(parseInt(c, 10)) && (c = b.getAttribute("hspace"));
+                                        this.setValue(c)
+                                    }
+                                },
+                                commit: function (a, b) {
+                                    var c = parseInt(this.getValue(), 10);
+                                    1 == a || 4 == a ? (isNaN(c) ? !c && this.isChanged() && (b.removeStyle("margin-left"), b.removeStyle("margin-right")) : (b.setStyle("margin-left", CKEDITOR.tools.cssLength(c)), b.setStyle("margin-right", CKEDITOR.tools.cssLength(c))), 1 == a && b.removeAttribute("hspace")) :
+                                    8 == a && (b.removeAttribute("hspace"), b.removeStyle("margin-left"), b.removeStyle("margin-right"))
+                                }
+                            }, {
+                                type: "text",
+                                id: "txtVSpace",
+                                requiredContent: "img{margin-top,margin-bottom}",
+                                width: "60px",
+                                label: d.lang.image.vSpace,
+                                "default": "",
+                                onKeyUp: function () {
+                                    e(this.getDialog())
+                                },
+                                onChange: function () {
+                                    k.call(this, "advanced:txtdlgGenStyle")
+                                },
+                                validate: CKEDITOR.dialog.validate.integer(d.lang.image.validateVSpace),
+                                setup: function (a, b) {
+                                    if (1 == a) {
+                                        var c, d;
+                                        c = b.getStyle("margin-top");
+                                        d = b.getStyle("margin-bottom");
+                                        c = c && c.match(r);
+                                        d = d && d.match(r);
+                                        c = parseInt(c, 10);
+                                        d = parseInt(d, 10);
+                                        c = c == d && c;
+                                        isNaN(parseInt(c, 10)) && (c = b.getAttribute("vspace"));
+                                        this.setValue(c)
+                                    }
+                                },
+                                commit: function (a, b) {
+                                    var c = parseInt(this.getValue(), 10);
+                                    1 == a || 4 == a ? (isNaN(c) ? !c && this.isChanged() && (b.removeStyle("margin-top"), b.removeStyle("margin-bottom")) : (b.setStyle("margin-top", CKEDITOR.tools.cssLength(c)), b.setStyle("margin-bottom", CKEDITOR.tools.cssLength(c))), 1 == a && b.removeAttribute("vspace")) : 8 == a && (b.removeAttribute("vspace"), b.removeStyle("margin-top"), b.removeStyle("margin-bottom"))
+                                }
+                            },
+                                {
+                                    id: "cmbAlign",
+                                    requiredContent: "img{float}",
+                                    type: "select",
+                                    widths: ["35%", "65%"],
+                                    style: "width:90px",
+                                    label: d.lang.common.align,
+                                    "default": "",
+                                    items: [[d.lang.common.notSet, ""], [d.lang.common.alignLeft, "left"], [d.lang.common.alignRight, "right"]],
+                                    onChange: function () {
+                                        e(this.getDialog());
+                                        k.call(this, "advanced:txtdlgGenStyle")
+                                    },
+                                    setup: function (a, b) {
+                                        if (1 == a) {
+                                            var c = b.getStyle("float");
+                                            switch (c) {
+                                                case "inherit":
+                                                case "none":
+                                                    c = ""
+                                            }
+                                            !c && (c = (b.getAttribute("align") || "").toLowerCase());
+                                            this.setValue(c)
+                                        }
+                                    },
+                                    commit: function (a,
+                                                      b) {
+                                        var c = this.getValue();
+                                        if (1 == a || 4 == a) {
+                                            if (c ? b.setStyle("float", c) : b.removeStyle("float"), 1 == a)switch (c = (b.getAttribute("align") || "").toLowerCase(), c) {
+                                                case "left":
+                                                case "right":
+                                                    b.removeAttribute("align")
+                                            }
+                                        } else 8 == a && b.removeStyle("float")
+                                    }
+                                }]
+                        }]
+                    }, {
+                        type: "vbox", height: "250px", children: [{
+                            type: "html",
+                            id: "htmlPreview",
+                            style: "width:95%;",
+                            html: "\x3cdiv\x3e" + CKEDITOR.tools.htmlEncode(d.lang.common.preview) + '\x3cbr\x3e\x3cdiv id\x3d"' + p + '" class\x3d"ImagePreviewLoader" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"ImagePreviewBox"\x3e\x3ctable\x3e\x3ctr\x3e\x3ctd\x3e\x3ca href\x3d"javascript:void(0)" target\x3d"_blank" onclick\x3d"return false;" id\x3d"' +
+                            E + '"\x3e\x3cimg id\x3d"' + D + '" alt\x3d"" /\x3e\x3c/a\x3e' + (d.config.image_previewText || "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.") +
+                            "\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/div\x3e"
+                        }]
+                    }]
+                }]
+            }, {
+                id: "Link", requiredContent: "a[href]", label: d.lang.image.linkTab, padding: 0, elements: [{
+                    id: "txtUrl",
+                    type: "text",
+                    label: d.lang.common.url,
+                    style: "width: 100%",
+                    "default": "",
+                    setup: function (a, b) {
+                        if (2 == a) {
+                            var c = b.data("cke-saved-href");
+                            c || (c = b.getAttribute("href"));
+                            this.setValue(c)
+                        }
+                    },
+                    commit: function (a, b) {
+                        if (2 == a && (this.getValue() || this.isChanged())) {
+                            var c = this.getValue();
+                            b.data("cke-saved-href", c);
+                            b.setAttribute("href", c);
+                            this.getValue() || !d.config.image_removeLinkByEmptyURL ? this.getDialog().addLink = !0 : this.getDialog().addLink = !1
+                        }
+                    }
+                }, {
+                    type: "button",
+                    id: "browse",
+                    className: "cke_dialog_image_browse",
+                    filebrowser: {action: "Browse", target: "Link:txtUrl", url: d.config.filebrowserImageBrowseLinkUrl},
+                    style: "float:right",
+                    hidden: !0,
+                    label: d.lang.common.browseServer
+                }, {
+                    id: "cmbTarget",
+                    type: "select",
+                    requiredContent: "a[target]",
+                    label: d.lang.common.target,
+                    "default": "",
+                    items: [[d.lang.common.notSet, ""], [d.lang.common.targetNew, "_blank"], [d.lang.common.targetTop,
+                        "_top"], [d.lang.common.targetSelf, "_self"], [d.lang.common.targetParent, "_parent"]],
+                    setup: function (a, b) {
+                        2 == a && this.setValue(b.getAttribute("target") || "")
+                    },
+                    commit: function (a, b) {
+                        2 == a && (this.getValue() || this.isChanged()) && b.setAttribute("target", this.getValue())
+                    }
+                }]
+            }, {
+                id: "Upload",
+                hidden: !0,
+                filebrowser: "uploadButton",
+                label: d.lang.image.upload,
+                elements: [{
+                    type: "file",
+                    id: "upload",
+                    label: d.lang.image.btnUpload,
+                    style: "height:40px",
+                    size: 38
+                }, {
+                    type: "fileButton", id: "uploadButton", filebrowser: "info:txtUrl", label: d.lang.image.btnUpload,
+                    "for": ["Upload", "upload"]
+                }]
+            }, {
+                id: "advanced", label: d.lang.common.advancedTab, elements: [{
+                    type: "hbox",
+                    widths: ["50%", "25%", "25%"],
+                    children: [{
+                        type: "text",
+                        id: "linkId",
+                        requiredContent: "img[id]",
+                        label: d.lang.common.id,
+                        setup: function (a, b) {
+                            1 == a && this.setValue(b.getAttribute("id"))
+                        },
+                        commit: function (a, b) {
+                            1 == a && (this.getValue() || this.isChanged()) && b.setAttribute("id", this.getValue())
+                        }
+                    }, {
+                        id: "cmbLangDir",
+                        type: "select",
+                        requiredContent: "img[dir]",
+                        style: "width : 100px;",
+                        label: d.lang.common.langDir,
+                        "default": "",
+                        items: [[d.lang.common.notSet,
+                            ""], [d.lang.common.langDirLtr, "ltr"], [d.lang.common.langDirRtl, "rtl"]],
+                        setup: function (a, b) {
+                            1 == a && this.setValue(b.getAttribute("dir"))
+                        },
+                        commit: function (a, b) {
+                            1 == a && (this.getValue() || this.isChanged()) && b.setAttribute("dir", this.getValue())
+                        }
+                    }, {
+                        type: "text",
+                        id: "txtLangCode",
+                        requiredContent: "img[lang]",
+                        label: d.lang.common.langCode,
+                        "default": "",
+                        setup: function (a, b) {
+                            1 == a && this.setValue(b.getAttribute("lang"))
+                        },
+                        commit: function (a, b) {
+                            1 == a && (this.getValue() || this.isChanged()) && b.setAttribute("lang", this.getValue())
+                        }
+                    }]
+                },
+                    {
+                        type: "text",
+                        id: "txtGenLongDescr",
+                        requiredContent: "img[longdesc]",
+                        label: d.lang.common.longDescr,
+                        setup: function (a, b) {
+                            1 == a && this.setValue(b.getAttribute("longDesc"))
+                        },
+                        commit: function (a, b) {
+                            1 == a && (this.getValue() || this.isChanged()) && b.setAttribute("longDesc", this.getValue())
+                        }
+                    }, {
+                        type: "hbox", widths: ["50%", "50%"], children: [{
+                            type: "text",
+                            id: "txtGenClass",
+                            requiredContent: "img(cke-xyz)",
+                            label: d.lang.common.cssClass,
+                            "default": "",
+                            setup: function (a, b) {
+                                1 == a && this.setValue(b.getAttribute("class"))
+                            },
+                            commit: function (a,
+                                              b) {
+                                1 == a && (this.getValue() || this.isChanged()) && b.setAttribute("class", this.getValue())
+                            }
+                        }, {
+                            type: "text",
+                            id: "txtGenTitle",
+                            requiredContent: "img[title]",
+                            label: d.lang.common.advisoryTitle,
+                            "default": "",
+                            onChange: function () {
+                                e(this.getDialog())
+                            },
+                            setup: function (a, b) {
+                                1 == a && this.setValue(b.getAttribute("title"))
+                            },
+                            commit: function (a, b) {
+                                1 == a ? (this.getValue() || this.isChanged()) && b.setAttribute("title", this.getValue()) : 4 == a ? b.setAttribute("title", this.getValue()) : 8 == a && b.removeAttribute("title")
+                            }
+                        }]
+                    }, {
+                        type: "text",
+                        id: "txtdlgGenStyle",
+                        requiredContent: "img{cke-xyz}",
+                        label: d.lang.common.cssStyle,
+                        validate: CKEDITOR.dialog.validate.inlineStyle(d.lang.common.invalidInlineStyle),
+                        "default": "",
+                        setup: function (a, b) {
+                            if (1 == a) {
+                                var c = b.getAttribute("style");
+                                !c && b.$.style.cssText && (c = b.$.style.cssText);
+                                this.setValue(c);
+                                var d = b.$.style.height, c = b.$.style.width, d = (d ? d : "").match(m), c = (c ? c : "").match(m);
+                                this.attributesInStyle = {height: !!d, width: !!c}
+                            }
+                        },
+                        onChange: function () {
+                            k.call(this, "info:cmbFloat info:cmbAlign info:txtVSpace info:txtHSpace info:txtBorder info:txtWidth info:txtHeight".split(" "));
+                            e(this)
+                        },
+                        commit: function (a, b) {
+                            1 == a && (this.getValue() || this.isChanged()) && b.setAttribute("style", this.getValue())
+                        }
+                    }]
+            }]
+        }
+    };
+    CKEDITOR.dialog.add("image", function (d) {
+        return v(d, "image")
+    });
+    CKEDITOR.dialog.add("imagebutton", function (d) {
+        return v(d, "imagebutton")
+    })
+})();

+ 2 - 1
o2web/source/x_component_AppCenter/$Main/default/css.wcss

@@ -163,7 +163,8 @@
     "moduleSetupListIconNode": {
         "height": "36px",
         "float": "left",
-        "width": "36px"
+        "width": "36px",
+        "cursor": "pointer"
     },
     "moduleSetupListNameNode": {
         "height": "36px",

+ 30 - 10
o2web/source/x_component_Common/Main.js

@@ -66,6 +66,7 @@ MWF.xApplication.Common.Main = new Class({
 		this.options.icon = this.path+this.options.style+"/"+this.options.icon;
 		
 		this.cssPath =this.path+this.options.style+"/css.wcss";
+        if (this.options.mvcStyle) this.stylePath = this.path+this.options.style+"/"+this.options.mvcStyle;
 		this._loadCss();
 	},
 	fireAppEvent: function(when){
@@ -110,9 +111,14 @@ MWF.xApplication.Common.Main = new Class({
 				this.fireAppEvent("postLoadWindow");
 				this.fireAppEvent("queryLoadApplication");
 				this.setContentEvent();
+
+				//load css
+				if (this.stylePath) o2.loadCss(this.stylePath);
 				this.loadApplication(function(){
 					this.fireAppEvent("postLoadApplication");
 				}.bind(this));
+
+
 				this.fireAppEvent("postLoad");
 			}.bind(this),
 			"onResize": function(){
@@ -537,19 +543,33 @@ MWF.xApplication.Common.Main = new Class({
 	alert: function(type, e, title, text, width, height){
 		MWF.require("MWF.widget.Dialog", function(){
 			var size = $(document.body).getSize();
-			
-			var x = parseFloat(e.event.x);
-			var y = parseFloat(e.event.y);
-            if (Browser.name=="firefox"){
-                x = parseFloat(e.event.clientX);
-                y = parseFloat(e.event.clientY);
+
+            var x = 0, y = 0;
+			if (e==="center") {
+                var p = o2.getCenterPosition(document.body, width, height);
+                x = p.x;
+                y = p.y;
+            }else{
+                x = parseFloat(e.event.x);
+                y = parseFloat(e.event.y);
+                if (Browser.name=="firefox"){
+                    x = parseFloat(e.event.clientX);
+                    y = parseFloat(e.event.clientY);
+                }
+                x = x - parseFloat(width)/2;
+                y = y - parseFloat(height)/2;
             }
-			x = x - parseFloat(width)/2;
-			y = y - parseFloat(height)/2;
-			
+
 			if (x+parseFloat(width)>size.x){
 				x = x-parseFloat(width);
 			}
+            if (x<0) x=0;
+
+            if (y+parseFloat(height)>size.y){
+                y = y-parseFloat(height);
+            }
+            if (y<0) y=0;
+
 
             var ctext = "";
             var chtml = "";
@@ -566,7 +586,7 @@ MWF.xApplication.Common.Main = new Class({
 				"top": y,
 				"left": x,
 				"fromTop":y,
-				"fromLeft": (Browser.name=="firefox") ? e.event.clientX : e.event.x,
+				"fromLeft": x,
 				"width": width,
 				"height": height,
                 "text": ctext,

+ 8 - 9
o2web/source/x_component_ControlPanel/$Main/applications.json

@@ -13,13 +13,13 @@
     "iconPath": "appicon.png",
     "allowList": ["xadmin", "Manager"]
   },
-//  {
-//    "name": "Deployment",
-//    "path": "Deployment",
-//    "title": "部署管理",
-//    "iconPath": "appicon.png",
-//    "allowList": ["xadmin", "Manager"]
-//  },
+  {
+    "name": "ANN",
+    "path": "ANN",
+    "title": "神经网络模型",
+    "iconPath": "appicon.png",
+    "allowList": ["xadmin", "Manager"]
+  },
   {
     "name": "Org",
     "path": "Org",
@@ -43,7 +43,6 @@
     "title": "错误日志",
     "path": "LogViewer",
     "iconPath": "appicon.png",
-    "allowList": ["xadmin", "Manager"],
-    "denyList": []
+    "allowList": ["xadmin", "Manager"]
   }
 ]

+ 2 - 2
o2web/source/x_component_ControlPanel/$Main/default/css.wcss

@@ -27,8 +27,8 @@
         "-moz-user-select": "none"
     },
     "contentNodeTo": {
-        "width": "800px",
-        "height": "220px"
+        "width": "680px",
+        "height": "350px"
     },
     "titleAreaNode": {
         "height": "70px",

+ 2 - 1
o2web/source/x_component_ControlPanel/Main.js

@@ -6,7 +6,7 @@ MWF.xApplication.ControlPanel.Main = new Class({
 		"style": "default",
 		"name": "ControlPanel",
 		"icon": "icon.png",
-		"width": "740",
+		"width": "840",
         "isResize": false,
         "isMax": false,
 		"height": "280",
@@ -105,6 +105,7 @@ MWF.xApplication.ControlPanel.Main = new Class({
         this.contentNode.setStyles({"width": ""+w+"px"});
     },
     loadApplications: function(){
+        debugger;
     	COMMON.JSON.get(this.path+"applications.json", function(catalog){
             var user = this.layout.session.user;
             var currentNames = [user.name, user.distinguishedName, user.id, user.unique];

+ 1 - 0
o2web/source/x_component_Forum/lp/zh-cn.js

@@ -1,3 +1,4 @@
+MWF.xApplication.Forum = MWF.xApplication.Forum || {};
 MWF.xApplication.Forum.LP = {
 	"title": "论坛首页",
 	"delete" : "删除",

+ 7 - 7
o2web/source/x_component_ForumDocument/Main.js

@@ -386,8 +386,8 @@ MWF.xApplication.ForumDocument.Main = new Class({
 					content: {text: this.lp.content, type : "rtf", notEmpty : true, RTFConfig : {
 						isSetImageMaxWidth : true,
 						reference : this.advanceId || this.data.id,
-						referenceType: "forumDocument",
-						skin : "bootstrapck" //,
+						referenceType: "forumDocument"//,
+						//skin : "bootstrapck" //,
 						//filebrowserCurrentDocumentImage: function (e, callback) {
 						//	_self.selectDocImage( callback );
 						//}
@@ -961,7 +961,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
 		}
 
 
-		if( this.permission.manageAble || this.data.creatorName == this.userName ){
+		if( this.permission.manageAble || this.permission.editAble || this.data.creatorName == this.userName ){
 			action = new Element("div", {
 				"styles" : this.css.actionItem,
 				"text" : this.lp.delete
@@ -975,7 +975,7 @@ MWF.xApplication.ForumDocument.Main = new Class({
 		}
 
 		if( this.data.typeCategory != this.lp.vote ){
-			if( this.permission.manageAble || this.data.creatorName == this.userName ){
+			if( this.permission.manageAble || this.permission.editAble || this.data.creatorName == this.userName ){
 				action = new Element("div", {
 					"styles" : this.css.actionItem,
 					"text" : this.lp.edit
@@ -1739,7 +1739,7 @@ MWF.xApplication.ForumDocument.ReplyEditor = new Class({
 					}.bind(this)},
 					creatorName: { type : "innerText", value : ( this.app.userName || "" ).split('@')[0] },
 					content: { type : "rtf", RTFConfig : {
-						skin : "bootstrapck",
+						//skin : "bootstrapck",
 						"resize_enabled": false,
 						isSetImageMaxWidth : true,
 						reference : this.advanceReplyId,
@@ -1791,7 +1791,7 @@ MWF.xApplication.ForumDocument.ReplyForm = new Class({
 	Implements: [Options, Events],
 	options: {
 		"style": "default",
-		"width": "820",
+		"width": "860",
 		"height": "470",
 		"hasTop": true,
 		"hasIcon": false,
@@ -1850,7 +1850,7 @@ MWF.xApplication.ForumDocument.ReplyForm = new Class({
 				itemTemplate: {
 					mainSubject: { type: "innertext", defaultValue : "RE:" + this.mainData.title },
 					content: { type : "rtf", RTFConfig : {
-						skin : "bootstrapck",
+						//skin : "bootstrapck",
 						"resize_enabled": false,
 						isSetImageMaxWidth : true,
 						reference : this.advanceReplyId || this.data.id,

+ 11 - 4
o2web/source/x_component_Minder/Common.js

@@ -1136,13 +1136,20 @@ MWF.xApplication.Minder.Document = new Class({
                 ev.stopPropagation()
             }.bind(this))
         }
-        this.app.restActions.getMindIcon( itemData.id, function( json ){
+        //this.app.restActions.getMindIcon( itemData.id, function( json ){
+        //    var thumbnailNode = itemNode.getElement("[item=thumbnail]");
+        //    thumbnailNode.set("src", "data:image/png;base64,"+ json.data.value );
+        //}, function(){
+        //    var thumbnailNode = itemNode.getElement("[item=thumbnail]");
+        //    thumbnailNode.set("src", this.app.path +  this.view.options.style + "/icon/default_thumbnail.png" );
+        //}.bind(this))
+        if( itemData.icon ){
             var thumbnailNode = itemNode.getElement("[item=thumbnail]");
-            thumbnailNode.set("src", "data:image/png;base64,"+ json.data.value );
-        }, function(){
+            thumbnailNode.set("src", MWF.xDesktop.getImageSrc(itemData.icon) );
+        }else{
             var thumbnailNode = itemNode.getElement("[item=thumbnail]");
             thumbnailNode.set("src", this.app.path +  this.view.options.style + "/icon/default_thumbnail.png" );
-        }.bind(this))
+        }
     },
     setSelect : function( flag ){
         var select = this.node.getElement("[item=select]");

+ 249 - 249
o2web/source/x_component_MinderEditor/Dialog.js

@@ -92,255 +92,255 @@ MWF.xApplication.MinderEditor.HyperLinkForm = new Class({
     }
 });
 
-MWF.xApplication.MinderEditor.ImageForm = new Class({
-    Extends: MPopupForm,
-    Implements: [Options, Events],
-    options: {
-        "style": "report",
-        "width": 800,
-        "height": 640,
-        "hasTop": true,
-        "hasIcon": false,
-        "draggable": true,
-        "title" : "图片"
-    },
-    createContent: function () {
-
-        this.createTab();
-
-        this.formContentNode = new Element("div.formContentNode", {
-            "styles": this.css.formContentNode
-        }).inject(this.formNode);
-
-        this.formTableContainer = new Element("div.formTableContainer", {
-            "styles": this.css.formTableContainer
-        }).inject(this.formContentNode);
-
-        this.formTableArea = new Element("div.formTableArea", {
-            "styles": this.css.formTableArea
-        }).inject(this.formTableContainer);
-
-        this._createTableContent();
-    },
-    _createTableContent: function () {
-
-        this.linkContainer = new Element("div.linkContainer").inject(this.formTableArea);
-
-        var html = "<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable' style='margin-top: 20px; '>" +
-            "<tr><td styles='formTableTitle' lable='url' width='20%'></td>" +
-            "    <td styles='formTableValue14' item='url' colspan='3'></td></tr>" +
-            "<tr><td styles='formTableTitle' lable='title'></td>" +
-            "    <td styles='formTableValue14' item='title' colspan='3'></td></tr>" +
-            "<tr><td styles='formTableTitle'>预览:</td>" +
-            "    <td styles='formTableValue14' item='preview' colspan='3'></td></tr>" +
-            "</table>";
-        this.linkContainer.set("html", html);
-
-        var data = this.app.minder.queryCommandValue('image');
-
-        this.linkform = new MForm(this.linkContainer, data, {
-            isEdited: true,
-            style : "report",
-            hasColon : true,
-            itemTemplate: {
-                url: { text : "图片地址",  notEmpty : true,
-                    validRule : { isInvalid : function( value, it ){
-                        var R_URL = /^https?\:\/\/\w+/;
-                        return R_URL.test( value )
-                    }.bind(this)},
-                    validMessage : { isInvalid : "请输入正确的链接" },
-                    attr : { placeholder : "必填:以 http(s):// 开始" },
-                    event : { blur : function( it ){
-                        if( it.getValue() )it.form.getItem("preview").setValue( it.getValue() )
-                    }.bind(this)}
-                },
-                title: { text : "提示文本", attr : { placeholder : "选填:鼠标在图片上悬停时提示的文本" } },
-                preview : { type : "img", defaultValue : data.url || "", style : { "max-width" : "400px", "max-height" : "260px" } }
-            }
-        }, this.app);
-        this.linkform.load();
-
-
-
-        this.uploadContainer = new Element("div.uploadContainer", { styles : {"display":"none"} }).inject( this.formTableArea );
-
-        var html = "<table width='100%' bordr='0' cellpadding='0' cellspacing='0' styles='formTable' style='margin-top: 20px; '>" +
-            "<tr><td item='image' colspan='4' style='padding-bottom: 10px;'></td></tr>" +
-            "<tr><td styles='formTableTitle' lable='title2' width='20%'></td>" +
-            "    <td styles='formTableValue14' item='title2' colspan='3'></td></tr>" +
-            "</table>";
-        this.uploadContainer.set("html", html);
-
-        var data = this.app.minder.queryCommandValue('image');
-
-        this.uploadform = new MForm(this.uploadContainer, data, {
-            isEdited: true,
-            style : "report",
-            hasColon : true,
-            itemTemplate: {
-                title2: { text : "提示文本", attr : { placeholder : "选填:鼠标在图片上悬停时提示的文本" } }
-            }
-        }, this.app);
-        this.uploadform.load();
-
-        this.image = new MWF.widget.ImageClipper(this.uploadContainer.getElement("[item='image']"), {
-            "aspectRatio": 0,
-            "description" : "",
-            "imageUrl" : "",
-            "ratioAdjustedEnable" : true,
-            "reference" : "1111",
-            "referenceType": "forumDocument",
-            "fromFileEnable" : false,
-            "resetEnable" : true
-        });
-        this.image.load();
-
-    },
-    createTab: function(){
-        var _self = this;
-
-        this.tabContainer = new Element("div.formTabContainer",{
-            styles : this.css.formTabContainer
-        }).inject(this.formNode);
-
-        var tabNode = new Element("div.formTabNode", {
-            "styles": this.css.formTabNode,
-            "text" : "外链图片"
-        }).inject(this.tabContainer);
-        tabNode.addEvents({
-            "mouseover" : function(){ if( _self.currentTabNode != this.node)this.node.setStyles(_self.css.formTabNode_over) }.bind({node : tabNode }),
-            "mouseout" : function(){ if( _self.currentTabNode != this.node)this.node.setStyles(_self.css.formTabNode) }.bind({node : tabNode }),
-            "click":function(){
-                if( _self.currentTabNode )_self.currentTabNode.setStyles(_self.css.formTabNode);
-                _self.currentTabNode = this.node;
-                this.node.setStyles(_self.css.formTabNode_current);
-                _self.linkContainer.setStyle("display","");
-                _self.uploadContainer.setStyle("display","none");
-            }.bind({ node : tabNode })
-        })
-        tabNode.setStyles( this.css.formTabNode_current );
-        _self.currentTabNode = tabNode;
-
-        var tabNode = new Element("div.tabNode", {
-            "styles": this.css.formTabNode,
-            "text" : "上传图片"
-        }).inject(this.tabContainer);
-        tabNode.addEvents({
-            "mouseover" : function(){ if( _self.currentTabNode != this.node)this.node.setStyles(_self.css.formTabNode_over) }.bind({node : tabNode }),
-            "mouseout" : function(){ if( _self.currentTabNode != this.node)this.node.setStyles(_self.css.formTabNode) }.bind({node : tabNode }),
-            "click":function(){
-                if( _self.currentTabNode )_self.currentTabNode.setStyles(_self.css.formTabNode);
-                _self.currentTabNode = this.node;
-                this.node.setStyles(_self.css.formTabNode_current);
-                _self.linkContainer.setStyle("display","none");
-                _self.uploadContainer.setStyle("display","");
-            }.bind({ node : tabNode })
-        })
-    },
-    _createBottomContent: function () {
-
-        if (this.isNew || this.isEdited) {
-
-            this.okActionNode = new Element("button.inputOkButton", {
-                "styles": this.css.inputOkButton,
-                "text": "确定"
-            }).inject(this.formBottomNode);
-
-            this.okActionNode.addEvent("click", function (e) {
-                this.save(e);
-            }.bind(this));
-        }
-
-        this.removeAction = new Element("button.inputCancelButton", {
-            "styles": this.css.inputCancelButton,
-            "text": "删除图片"
-        }).inject(this.formBottomNode);
-
-        this.removeAction.addEvent("click", function (e) {
-            this.remove(e);
-        }.bind(this));
-
-        this.cancelActionNode = new Element("button.inputCancelButton", {
-            "styles": (this.isEdited || this.isNew || this.getEditPermission() ) ? this.css.inputCancelButton : this.css.inputCancelButton_long,
-            "text": "关闭"
-        }).inject(this.formBottomNode);
-
-        this.cancelActionNode.addEvent("click", function (e) {
-            this.close(e);
-        }.bind(this));
-
-    },
-    save: function(){
-        if( this.image.resizedImage ){
-            this.image.uploadImage( function( json ){
-                var data = {
-                    url : MWF.xDesktop.getImageSrc( json.id ),
-                    title :  this.uploadform.getResult(true,null,true,false,true)["title2"]
-                };
-                this.app.minder.execCommand('image', data.url, data.title || '');
-                this.close();
-            }.bind(this));
-        }else{
-            var data = this.linkform.getResult(true,null,true,false,true);
-            if( data ){
-                this.app.minder.execCommand('image', data.url, data.title || '');
-                this.close();
-            }
-        }
-    },
-    remove: function( ev ){
-        this.app.minder.execCommand('image', '' );
-        this.close();
-    },
-    setFormNodeSize: function (width, height, top, left) {
-        if (!width)width = this.options.width ? this.options.width : "50%";
-        if (!height)height = this.options.height ? this.options.height : "50%";
-        if (!top) top = this.options.top ? this.options.top : 0;
-        if (!left) left = this.options.left ? this.options.left : 0;
-
-        var containerSize = this.container.getSize();
-        if( containerSize.x < width )width = containerSize.x;
-        if( containerSize.y < height )height = containerSize.y;
-
-        var allSize = this.app.content.getSize();
-        var limitWidth = allSize.x; //window.screen.width
-        var limitHeight = allSize.y; //window.screen.height
-
-        "string" == typeof width && (1 < width.length && "%" == width.substr(width.length - 1, 1)) && (width = parseInt(limitWidth * parseInt(width, 10) / 100, 10));
-        "string" == typeof height && (1 < height.length && "%" == height.substr(height.length - 1, 1)) && (height = parseInt(limitHeight * parseInt(height, 10) / 100, 10));
-        300 > width && (width = 300);
-        220 > height && (height = 220);
-
-        top = top || parseInt((limitHeight - height) / 2, 10); //+appTitleSize.y);
-        left = left || parseInt((limitWidth - width) / 2, 10);
-
-        this.formAreaNode.setStyles({
-            "width": "" + width + "px",
-            "height": "" + height + "px",
-            "top": "" + top + "px",
-            "left": "" + left + "px"
-        });
-
-        this.formNode.setStyles({
-            "width": "" + width + "px",
-            "height": "" + height + "px"
-        });
-
-        var iconSize = this.formIconNode ? this.formIconNode.getSize() : {x: 0, y: 0};
-        var topSize = this.formTopNode ? this.formTopNode.getSize() : {x: 0, y: 0};
-        var bottomSize = this.formBottomNode ? this.formBottomNode.getSize() : {x: 0, y: 0};
-        var tabSize = this.tabContainer ? this.tabContainer.getSize() : {x: 0, y: 0};
-
-        var contentHeight = height - iconSize.y - topSize.y - bottomSize.y - tabSize.y;
-        //var formMargin = formHeight -iconSize.y;
-        this.formContentNode.setStyles({
-            "height": "" + contentHeight + "px"
-        });
-        this.formTableContainer.setStyles({
-            "height": "" + contentHeight + "px"
-        });
-    }
-});
+//MWF.xApplication.MinderEditor.ImageForm = new Class({
+//    Extends: MPopupForm,
+//    Implements: [Options, Events],
+//    options: {
+//        "style": "report",
+//        "width": 800,
+//        "height": 640,
+//        "hasTop": true,
+//        "hasIcon": false,
+//        "draggable": true,
+//        "title" : "图片"
+//    },
+//    createContent: function () {
+//
+//        this.createTab();
+//
+//        this.formContentNode = new Element("div.formContentNode", {
+//            "styles": this.css.formContentNode
+//        }).inject(this.formNode);
+//
+//        this.formTableContainer = new Element("div.formTableContainer", {
+//            "styles": this.css.formTableContainer
+//        }).inject(this.formContentNode);
+//
+//        this.formTableArea = new Element("div.formTableArea", {
+//            "styles": this.css.formTableArea
+//        }).inject(this.formTableContainer);
+//
+//        this._createTableContent();
+//    },
+//    _createTableContent: function () {
+//
+//        this.linkContainer = new Element("div.linkContainer").inject(this.formTableArea);
+//
+//        var html = "<table width='100%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable' style='margin-top: 20px; '>" +
+//            "<tr><td styles='formTableTitle' lable='url' width='20%'></td>" +
+//            "    <td styles='formTableValue14' item='url' colspan='3'></td></tr>" +
+//            "<tr><td styles='formTableTitle' lable='title'></td>" +
+//            "    <td styles='formTableValue14' item='title' colspan='3'></td></tr>" +
+//            "<tr><td styles='formTableTitle'>预览:</td>" +
+//            "    <td styles='formTableValue14' item='preview' colspan='3'></td></tr>" +
+//            "</table>";
+//        this.linkContainer.set("html", html);
+//
+//        var data = this.app.minder.queryCommandValue('image');
+//
+//        this.linkform = new MForm(this.linkContainer, data, {
+//            isEdited: true,
+//            style : "report",
+//            hasColon : true,
+//            itemTemplate: {
+//                url: { text : "图片地址",  notEmpty : true,
+//                    validRule : { isInvalid : function( value, it ){
+//                        var R_URL = /^https?\:\/\/\w+/;
+//                        return R_URL.test( value )
+//                    }.bind(this)},
+//                    validMessage : { isInvalid : "请输入正确的链接" },
+//                    attr : { placeholder : "必填:以 http(s):// 开始" },
+//                    event : { blur : function( it ){
+//                        if( it.getValue() )it.form.getItem("preview").setValue( it.getValue() )
+//                    }.bind(this)}
+//                },
+//                title: { text : "提示文本", attr : { placeholder : "选填:鼠标在图片上悬停时提示的文本" } },
+//                preview : { type : "img", defaultValue : data.url || "", style : { "max-width" : "400px", "max-height" : "260px" } }
+//            }
+//        }, this.app);
+//        this.linkform.load();
+//
+//
+//
+//        this.uploadContainer = new Element("div.uploadContainer", { styles : {"display":"none"} }).inject( this.formTableArea );
+//
+//        var html = "<table width='100%' bordr='0' cellpadding='0' cellspacing='0' styles='formTable' style='margin-top: 20px; '>" +
+//            "<tr><td item='image' colspan='4' style='padding-bottom: 10px;'></td></tr>" +
+//            "<tr><td styles='formTableTitle' lable='title2' width='20%'></td>" +
+//            "    <td styles='formTableValue14' item='title2' colspan='3'></td></tr>" +
+//            "</table>";
+//        this.uploadContainer.set("html", html);
+//
+//        var data = this.app.minder.queryCommandValue('image');
+//
+//        this.uploadform = new MForm(this.uploadContainer, data, {
+//            isEdited: true,
+//            style : "report",
+//            hasColon : true,
+//            itemTemplate: {
+//                title2: { text : "提示文本", attr : { placeholder : "选填:鼠标在图片上悬停时提示的文本" } }
+//            }
+//        }, this.app);
+//        this.uploadform.load();
+//
+//        this.image = new MWF.widget.ImageClipper(this.uploadContainer.getElement("[item='image']"), {
+//            "aspectRatio": 0,
+//            "description" : "",
+//            "imageUrl" : "",
+//            "ratioAdjustedEnable" : true,
+//            "reference" :  this.app.data.id || "1111",
+//            "referenceType": "mindInfo",
+//            "fromFileEnable" : false,
+//            "resetEnable" : true
+//        });
+//        this.image.load();
+//
+//    },
+//    createTab: function(){
+//        var _self = this;
+//
+//        this.tabContainer = new Element("div.formTabContainer",{
+//            styles : this.css.formTabContainer
+//        }).inject(this.formNode);
+//
+//        var tabNode = new Element("div.formTabNode", {
+//            "styles": this.css.formTabNode,
+//            "text" : "外链图片"
+//        }).inject(this.tabContainer);
+//        tabNode.addEvents({
+//            "mouseover" : function(){ if( _self.currentTabNode != this.node)this.node.setStyles(_self.css.formTabNode_over) }.bind({node : tabNode }),
+//            "mouseout" : function(){ if( _self.currentTabNode != this.node)this.node.setStyles(_self.css.formTabNode) }.bind({node : tabNode }),
+//            "click":function(){
+//                if( _self.currentTabNode )_self.currentTabNode.setStyles(_self.css.formTabNode);
+//                _self.currentTabNode = this.node;
+//                this.node.setStyles(_self.css.formTabNode_current);
+//                _self.linkContainer.setStyle("display","");
+//                _self.uploadContainer.setStyle("display","none");
+//            }.bind({ node : tabNode })
+//        })
+//        tabNode.setStyles( this.css.formTabNode_current );
+//        _self.currentTabNode = tabNode;
+//
+//        var tabNode = new Element("div.tabNode", {
+//            "styles": this.css.formTabNode,
+//            "text" : "上传图片"
+//        }).inject(this.tabContainer);
+//        tabNode.addEvents({
+//            "mouseover" : function(){ if( _self.currentTabNode != this.node)this.node.setStyles(_self.css.formTabNode_over) }.bind({node : tabNode }),
+//            "mouseout" : function(){ if( _self.currentTabNode != this.node)this.node.setStyles(_self.css.formTabNode) }.bind({node : tabNode }),
+//            "click":function(){
+//                if( _self.currentTabNode )_self.currentTabNode.setStyles(_self.css.formTabNode);
+//                _self.currentTabNode = this.node;
+//                this.node.setStyles(_self.css.formTabNode_current);
+//                _self.linkContainer.setStyle("display","none");
+//                _self.uploadContainer.setStyle("display","");
+//            }.bind({ node : tabNode })
+//        })
+//    },
+//    _createBottomContent: function () {
+//
+//        if (this.isNew || this.isEdited) {
+//
+//            this.okActionNode = new Element("button.inputOkButton", {
+//                "styles": this.css.inputOkButton,
+//                "text": "确定"
+//            }).inject(this.formBottomNode);
+//
+//            this.okActionNode.addEvent("click", function (e) {
+//                this.save(e);
+//            }.bind(this));
+//        }
+//
+//        this.removeAction = new Element("button.inputCancelButton", {
+//            "styles": this.css.inputCancelButton,
+//            "text": "删除图片"
+//        }).inject(this.formBottomNode);
+//
+//        this.removeAction.addEvent("click", function (e) {
+//            this.remove(e);
+//        }.bind(this));
+//
+//        this.cancelActionNode = new Element("button.inputCancelButton", {
+//            "styles": (this.isEdited || this.isNew || this.getEditPermission() ) ? this.css.inputCancelButton : this.css.inputCancelButton_long,
+//            "text": "关闭"
+//        }).inject(this.formBottomNode);
+//
+//        this.cancelActionNode.addEvent("click", function (e) {
+//            this.close(e);
+//        }.bind(this));
+//
+//    },
+//    save: function(){
+//        if( this.image.resizedImage ){
+//            this.image.uploadImage( function( json ){
+//                var data = {
+//                    url : MWF.xDesktop.getImageSrc( json.id ),
+//                    title :  this.uploadform.getResult(true,null,true,false,true)["title2"]
+//                };
+//                this.app.minder.execCommand('image', data.url, data.title || '', json.id);
+//                this.close();
+//            }.bind(this));
+//        }else{
+//            var data = this.linkform.getResult(true,null,true,false,true);
+//            if( data ){
+//                this.app.minder.execCommand('image', data.url, data.title || '', '');
+//                this.close();
+//            }
+//        }
+//    },
+//    remove: function( ev ){
+//        this.app.minder.execCommand('image', '' );
+//        this.close();
+//    },
+//    setFormNodeSize: function (width, height, top, left) {
+//        if (!width)width = this.options.width ? this.options.width : "50%";
+//        if (!height)height = this.options.height ? this.options.height : "50%";
+//        if (!top) top = this.options.top ? this.options.top : 0;
+//        if (!left) left = this.options.left ? this.options.left : 0;
+//
+//        var containerSize = this.container.getSize();
+//        if( containerSize.x < width )width = containerSize.x;
+//        if( containerSize.y < height )height = containerSize.y;
+//
+//        var allSize = this.app.content.getSize();
+//        var limitWidth = allSize.x; //window.screen.width
+//        var limitHeight = allSize.y; //window.screen.height
+//
+//        "string" == typeof width && (1 < width.length && "%" == width.substr(width.length - 1, 1)) && (width = parseInt(limitWidth * parseInt(width, 10) / 100, 10));
+//        "string" == typeof height && (1 < height.length && "%" == height.substr(height.length - 1, 1)) && (height = parseInt(limitHeight * parseInt(height, 10) / 100, 10));
+//        300 > width && (width = 300);
+//        220 > height && (height = 220);
+//
+//        top = top || parseInt((limitHeight - height) / 2, 10); //+appTitleSize.y);
+//        left = left || parseInt((limitWidth - width) / 2, 10);
+//
+//        this.formAreaNode.setStyles({
+//            "width": "" + width + "px",
+//            "height": "" + height + "px",
+//            "top": "" + top + "px",
+//            "left": "" + left + "px"
+//        });
+//
+//        this.formNode.setStyles({
+//            "width": "" + width + "px",
+//            "height": "" + height + "px"
+//        });
+//
+//        var iconSize = this.formIconNode ? this.formIconNode.getSize() : {x: 0, y: 0};
+//        var topSize = this.formTopNode ? this.formTopNode.getSize() : {x: 0, y: 0};
+//        var bottomSize = this.formBottomNode ? this.formBottomNode.getSize() : {x: 0, y: 0};
+//        var tabSize = this.tabContainer ? this.tabContainer.getSize() : {x: 0, y: 0};
+//
+//        var contentHeight = height - iconSize.y - topSize.y - bottomSize.y - tabSize.y;
+//        //var formMargin = formHeight -iconSize.y;
+//        this.formContentNode.setStyles({
+//            "height": "" + contentHeight + "px"
+//        });
+//        this.formTableContainer.setStyles({
+//            "height": "" + contentHeight + "px"
+//        });
+//    }
+//});
 
 MWF.xApplication.MinderEditor.NoteForm = new Class({
     Extends: MPopupForm,

+ 4 - 4
o2web/source/x_component_MinderEditor/WidgetInEditMode.js

@@ -737,8 +737,8 @@ MWF.xApplication.MinderEditor.ImageForm = new Class({
             "description" : "",
             "imageUrl" : "",
             "ratioAdjustedEnable" : true,
-            "reference" : "1111",
-            "referenceType": "forumDocument",
+            "reference" :  this.app.data.id || "1111",
+            "referenceType": "mindInfo",
             "fromFileEnable" : false,
             "resetEnable" : true
         });
@@ -826,13 +826,13 @@ MWF.xApplication.MinderEditor.ImageForm = new Class({
                     url : MWF.xDesktop.getImageSrc( json.id ),
                     title :  this.uploadform.getResult(true,null,true,false,true)["title2"]
                 };
-                this.app.minder.execCommand('image', data.url, data.title || '');
+                this.app.minder.execCommand('image', data.url, data.title || '', json.id );
                 this.close();
             }.bind(this));
         }else{
             var data = this.linkform.getResult(true,null,true,false,true);
             if( data ){
-                this.app.minder.execCommand('image', data.url, data.title || '');
+                this.app.minder.execCommand('image', data.url, data.title || '', '');
                 this.close();
             }
         }

+ 19 - 4
o2web/source/x_component_OnlineMeeting/Actions/RestActions.js

@@ -37,11 +37,26 @@ MWF.xApplication.OnlineMeeting.Actions.RestActions = new Class({
         //var par = "http://";
         //par = (data.host) ? (par+data.host) : (par+window.location.host);
         //this.roomHost = par;
-        par = this.roomHost+"/openmeetings/signin?oauthid="+data.oauth2Id;
+        par = this.roomHost+"/openmeetings/signin?oauthid="+data.oauth2Id+"&redirect_uri={url}";
         return uri.replace(/{uri}/, escape(par));
     },
-    getRoomUri: function(data){
-        var par = this.roomHost+this.actionAuth.actions["room"].uri;
-        return par.replace(/{id}/, data.id);
+    getRoomUri: function(meetingLoginData, data){
+        //var url = this.getLoginUri(meetingLoginData);
+
+        this.actionAuth.getActions();
+        var action = this.actionAuth.actions["login"];
+        var ssouri = this.actionAuth.address+action.uri;
+        var ssopar = this.roomHost+"/openmeetings/signin?oauthid="+meetingLoginData.oauth2Id+"&redirect_uri={url}";
+
+        var par = this.roomHost+this.action.actions["room"].uri;
+        par = par.replace(/{id}/, data.id);
+
+        ssopar = ssopar.replace(/{url}/, par);
+
+        // var par = this.roomHost+this.action.actions["room"].uri;
+        // //return par.replace(/{id}/, data.id);
+        // var r = par.replace(/{id}/, data.id);
+
+        return ssouri.replace(/{uri}/, escape(ssopar));
     }
 });

+ 23 - 6
o2web/source/x_component_OnlineMeeting/Main.js

@@ -1,4 +1,5 @@
 MWF.xDesktop.requireApp("OnlineMeeting", "Actions.RestActions", null, false);
+MWF.require("MWF.widget.MaskNode", null, false);
 MWF.xApplication.OnlineMeeting.options.multitask = false;
 MWF.xApplication.OnlineMeeting.Main = new Class({
 	Extends: MWF.xApplication.Common.Main,
@@ -19,14 +20,28 @@ MWF.xApplication.OnlineMeeting.Main = new Class({
         this.actions = new MWF.xApplication.OnlineMeeting.Actions.RestActions();
     },
     getLogin: function(success, failure){
+        //if (success) success();
         if (failure) failure();
     },
     loginOpenMeeting: function(data, success, failure){
         var uri = this.actions.getLoginUri(data);
         var iframe = new Element("iframe", {"src": uri, "styles": {"display": "none"}}).inject(this.content);
-        window.setTimeout(function(){
+        //window.open(uri);
+        //window.setTimeout(function(){
             if (success) success();
-        }.bind(this), 3000);
+        //}.bind(this), 5000);
+    },
+    mask: function(){
+        if (!this.maskNode){
+            this.maskNode = new MWF.widget.MaskNode(this.content, {"style": "bam"});
+            this.maskNode.load();
+        }
+    },
+    unmask: function(){
+        if (this.maskNode) this.maskNode.hide(function(){
+            MWF.release(this.maskNode);
+            this.maskNode = null;
+        }.bind(this));
     },
     loadApplication: function(callback) {
         this.actions.getOpenMeeting(function(json){
@@ -35,6 +50,7 @@ MWF.xApplication.OnlineMeeting.Main = new Class({
                 this.loadMeetingRoom();
             }.bind(this), function(){
                 if (this.meetingLoginData){
+                    this.mask();
                     this.loginOpenMeeting(this.meetingLoginData, function(){
                         this.loadMeetingRoom();
                     }.bind(this));
@@ -67,9 +83,10 @@ MWF.xApplication.OnlineMeeting.Main = new Class({
     loadCountent: function(){
         this.actions.listRoom(function(json){
             json.data.each(function(d){
-                d.url = this.actions.getRoomUri(d);
+                d.url = this.actions.getRoomUri(this.meetingLoginData, d);
                 new MWF.xApplication.OnlineMeeting.room(this, d);
             }.bind(this));
+            this.unmask();
         }.bind(this));
     }
 });
@@ -91,9 +108,9 @@ MWF.xApplication.OnlineMeeting.room = new Class({
 
         this.node.addEvent("click", function(e){
             window.open(this.data.url);
-//             var _self = this;
-//             var options = {"url": this.data.url};
-//             this.app.desktop.openApplication(e, "OnlineMeetingRoom", options);
+             // var _self = this;
+             // var options = {"url": this.data.url};
+             // this.app.desktop.openApplication(e, "OnlineMeetingRoom", options);
         }.bind(this));
     }
 });

+ 92 - 24
o2web/source/x_component_Org/UnitExplorer.js

@@ -60,9 +60,26 @@ MWF.xApplication.Org.UnitExplorer = new Class({
         }.bind(this));
     },
     _listElementNext: function(callback){
-        this.actions.listTopUnit(function(json){
-            if (callback) callback.apply(this, [json]);
-        }.bind(this));
+        if (MWF.AC.isOrganizationManager()){
+            this.actions.listTopUnit(function(json){
+                if (callback) callback.apply(this, [json]);
+            }.bind(this));
+        }else{
+            if (layout.session.user.identityList.length){
+                var json = {"data": []};
+                layout.session.user.identityList.each(function(id){
+                    var idFlag = (id.distinguishedName || id.id || id.unique || id.name);
+                    o2.Actions.get("x_organization_assemble_express").getUnitWithIdentityAndLevel({"identity": idFlag, "level": 1}, function(o){
+                        if (o.data){
+                            this.actions.getUnit(o.data.distinguishedName, function(u){
+                                json.data.push(u.data);
+                            }.bind(this),null, false);
+                        }
+                    }.bind(this), null, false);
+                }.bind(this));
+                if (callback) callback.apply(this, [json]);
+            }
+        }
     },
     _newElement: function(data, explorer){
         return new MWF.xApplication.Org.UnitExplorer.Unit(data, explorer, this.isEditor, 0);
@@ -461,15 +478,18 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({
         this.dutyContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
         this.dutyPage = this.propertyTab.addTab(this.dutyContentNode, this.explorer.app.lp.unitDutys);
 
-        this.attributeContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
-        this.attributePage = this.propertyTab.addTab(this.attributeContentNode, this.explorer.app.lp.unitAttribute);
+        if (this.data.control.allowEdit){
+            this.attributeContentNode = new Element("div", {"styles": this.item.style.tabContentNode});
+            this.attributePage = this.propertyTab.addTab(this.attributeContentNode, this.explorer.app.lp.unitAttribute);
+        }
     },
     _loadContent: function(){
+        debugger;
         this._listBaseInfor();
         this.loadListCount();
         this._listIdentityMembers();
         this._listDutys();
-        this._listAttributes();
+        if (this.data.control.allowEdit) this._listAttributes();
         //var _self = this;
         // this.personMemberList = this._listMembers("personList", "woSubDirectIdentityList", this.personMemberContentNode, [{
         //     "get": function(){
@@ -512,16 +532,20 @@ MWF.xApplication.Org.UnitExplorer.UnitContent = new Class({
         }else{
             if (this.dutyCountNode) this.dutyCountNode.destroy();
         }
-        var attributeCount = this.data.woUnitAttributeList.length;
-        if (attributeCount){
-            if (this.attributeCountNode){
-                this.attributeCountNode.set("text", attributeCount);
+
+        if (this.data.control.allowEdit){
+            var attributeCount = this.data.woUnitAttributeList.length;
+            if (attributeCount){
+                if (this.attributeCountNode){
+                    this.attributeCountNode.set("text", attributeCount);
+                }else{
+                    this.attributeCountNode = new Element("div", {"styles": this.item.style.tabCountNode, "text": attributeCount}).inject(this.attributePage.tabNode);
+                }
             }else{
-                this.attributeCountNode = new Element("div", {"styles": this.item.style.tabCountNode, "text": attributeCount}).inject(this.attributePage.tabNode);
+                if (this.attributeCountNode) this.attributeCountNode.destroy();
             }
-        }else{
-            if (this.attributeCountNode) this.attributeCountNode.destroy();
         }
+
     },
     _listBaseInfor: function(){
         this.baseInfor = new MWF.xApplication.Org.UnitExplorer.UnitContent.BaseInfor(this);
@@ -991,26 +1015,35 @@ MWF.xApplication.Org.UnitExplorer.UnitContent.BaseInfor = new Class({
         this.editContentNode.getElements("td.inforAction").setStyles(this.style.baseInforActionNode);
 
         var tdContents = this.editContentNode.getElements("td.inforContent");
-        if (this.data.controllerList){
-            this.data.controllerList.each(function(id){
-                new MWF.widget.O2Person({"name": id}, tdContents[5], {"style": "xform"});
-            }.bind(this));
+        if (this.data.control.allowEdit){
+            if (this.data.controllerList){
+                this.data.controllerList.each(function(id){
+                    new MWF.widget.O2Person({"name": id}, tdContents[5], {"style": "xform"});
+                }.bind(this));
+            }
+            if (this.data.superior) new MWF.widget.O2Unit({"name": this.data.superior}, tdContents[6], {"style": "xform"});
         }
 
+
         this.loadAction();
     },
     getContentHtml: function(){
+        debugger;
         var html = "<table width='100%' cellpadding='3px' cellspacing='5px'>";
-        html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.unitName+":</td><td class='inforContent'>"+(this.data.name || "")+"</td>" +
-            "<td class='inforTitle'>"+this.explorer.app.lp.unitUnique+":</td><td class='inforContent'>"+(this.data.unique || "")+"</td></tr>";
-        html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.unitTypeList+":</td><td class='inforContent'>"+(this.data.typeList.join(", ") || "")+"</td>" +
+        html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.unitName+":</td><td class='inforContent'>"+(this.data.name || "")+"</td>";
+        if (this.data.control.allowEdit) html += "<td class='inforTitle'>"+this.explorer.app.lp.unitUnique+":</td><td class='inforContent'>"+(this.data.unique || "")+"</td>";
+        html += "</tr><tr><td class='inforTitle'>"+this.explorer.app.lp.unitTypeList+":</td><td class='inforContent'>"+(this.data.typeList.join(", ") || "")+"</td>" +
             "<td class='inforTitle'>"+this.explorer.app.lp.unitShortName+":</td><td class='inforContent'>"+(this.data.shortName || "")+"</td></tr>";
         // html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.unitLevel+":</td><td class='inforContent'>"+this.data.level+"</td>" +
         //     "<td class='inforTitle'>"+this.explorer.app.lp.unitLevelName+":</td><td class='inforContent'>"+(this.data.levelName || "")+"</td></tr>";
 
         html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.unitDescription+":</td><td colspan='3' class='inforContent'>"+(this.data.description || "")+"</td>";
-        html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.unitControllerList+":</td><td colspan='3' class='inforContent'></td>";
-        html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.orderNumber+":</td><td colspan='3' class='inforContent'>"+(this.data.orderNumber || "")+"</td>";
+        if (this.data.control.allowEdit){
+            html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.unitControllerList+":</td><td class='inforContent'></td>" +
+                "<td class='inforTitle'>"+this.explorer.app.lp.unitSuperUnit+":</td><td class='inforContent'>"+this.data.description+"</td></tr>";
+            html += "<tr><td class='inforTitle'>"+this.explorer.app.lp.orderNumber+":</td><td colspan='3' class='inforContent'>"+(this.data.orderNumber || "")+"</td></tr>";
+        }
+
         html += "<tr><td colspan='4' class='inforAction'></td></tr>";
         //this.baseInforRightNode.set("html", html);
 
@@ -1067,10 +1100,35 @@ MWF.xApplication.Org.UnitExplorer.UnitContent.BaseInfor = new Class({
         this.controllerListInputNode = new Element("div", {"styles": this.style.inputNode_person}).inject(tdContents[5]);
 
         tdContents[6].setStyles(this.style.baseInforContentNode_edit).empty();
-        this.orderNumberInputNode = new Element("input", {"styles": this.style.inputNode, "type":"number"}).inject(tdContents[6]);
+        this.superUnitInputNode = new Element("div", {"styles": this.style.inputNode_person}).inject(tdContents[6]);
+
+        tdContents[7].setStyles(this.style.baseInforContentNode_edit).empty();
+        this.orderNumberInputNode = new Element("input", {"styles": this.style.inputNode, "type":"number"}).inject(tdContents[7]);
         this.orderNumberInputNode.set("value", (this.data.orderNumber || ""));
         //this.controllerListInputNode.set("value", ((this.data.controllerList) ? this.data.controllerList.join(", ") : ""));
 
+        if (this.data.superior) new MWF.widget.O2Unit({"name": this.data.superior}, this.superUnitInputNode, {"style": "xform"});
+        this.superUnitInputNode.addEvent("click", function(){
+            MWF.xDesktop.requireApp("Selector", "package", function(){
+                var options = {
+                    "type": "unit",
+                    "values": [this.data.superior] || [],
+                    "count": 1,
+                    "onComplete": function(items){
+                        this.superUnitInputNode.empty();
+                        this.data.oldSuperior = this.data.superior;
+                        if (items.length){
+                            this.data.superior = items[0].data.id;
+                            new MWF.widget.O2Unit({"name": this.data.superior}, this.superUnitInputNode, {"style": "xform"})
+                        }else{
+                            this.data.superior = "";
+                        }
+                    }.bind(this)
+                };
+                var selector = new MWF.O2Selector(this.explorer.app.content, options);
+            }.bind(this));
+        }.bind(this));
+
         if (this.data.controllerList){
             this.data.controllerList.each(function(id){
                 new MWF.widget.O2Person({"name": id}, this.controllerListInputNode, {"style": "xform"});
@@ -1083,6 +1141,7 @@ MWF.xApplication.Org.UnitExplorer.UnitContent.BaseInfor = new Class({
                     "values": this.data.controllerList || [],
                     "count": 0,
                     "onComplete": function(items){
+                        this.data.oldControllerList = this.data.controllerList;
                         var controllerList = [];
                         this.controllerListInputNode.empty();
                         items.each(function(item){
@@ -1197,6 +1256,8 @@ MWF.xApplication.Org.UnitExplorer.UnitContent.BaseInfor = new Class({
         data.shortName = this.shortNameInputNode.get("value");
         data.description = this.descriptionInputNode.get("value");
         data.orderNumber = this.orderNumberInputNode.get("value");
+        delete data.oldSuperior;
+        delete data.oldControllerList;
         //data.controllerList = (this.controllerListInputNode.get("value")) ? this.controllerListInputNode.get("value").split(/,\s*/g) : [];
 
         this.explorer.actions.saveUnit(data, function(json){
@@ -1228,8 +1289,15 @@ MWF.xApplication.Org.UnitExplorer.UnitContent.BaseInfor = new Class({
             tdContents[4].setStyles(this.style.baseInforContentNode).set("html", this.data.description || "");
             //tdContents[5].setStyles(this.style.baseInforContentNode).set("html", ((this.data.controllerList.length) ? this.data.controllerList.join(", "): ""));
             tdContents[5].setStyles(this.style.baseInforContentNode).empty();
-            tdContents[6].setStyles(this.style.baseInforContentNode).set("html", this.data.orderNumber || "");
+            tdContents[6].setStyles(this.style.baseInforContentNode).empty();
+            tdContents[7].setStyles(this.style.baseInforContentNode).set("html", this.data.orderNumber || "");
+
+            if (this.data.oldSuperior) this.data.superior = this.data.oldSuperior;
+            if (this.data.oldControllerList) this.data.controllerList = this.data.oldControllerList;
+            delete this.data.oldSuperior;
+            delete this.data.oldControllerList;
 
+            if (this.data.superior) new MWF.widget.O2Unit({"name": this.data.superior}, tdContents[6], {"style": "xform"});
             if (this.data.controllerList){
                 this.data.controllerList.each(function(id){
                     new MWF.widget.O2Person({"name": id}, tdContents[5], {"style": "xform"});

+ 1 - 0
o2web/source/x_component_Org/lp/zh-cn.js

@@ -69,6 +69,7 @@ MWF.xApplication.Org.LP = {
     "unitLevel": "组织层级",
     "unitLevelName": "层级名称",
     "unitControllerList": "管理者",
+    "unitSuperUnit": "上级组织",
     "unitDescription": "组织描述",
     "editUnit": "编辑组织信息",
     "saveUnit": "保存组织信息",

+ 209 - 437
o2web/source/x_component_Profile/Main.js

@@ -11,177 +11,217 @@ MWF.xApplication.Profile.Main = new Class({
         "height": "600",
         "isResize": false,
         "isMax": false,
+        "mvcStyle": "style.css",
         "title": MWF.xApplication.Profile.LP.title
     },
+    _loadCss: function(){},
+    loadCss: function(file, callback){
+        var path = (file && typeOf(file)==="string") ? file : "style.css";
+        var cb = (file && typeOf(file)==="function") ? file : callback;
+        var cssPath = this.path+this.options.style+"/"+path;
+        this.content.loadCss(cssPath, cb);
+    },
     onQueryLoad: function(){
         this.lp = MWF.xApplication.Profile.LP;
+        this.action = MWF.Actions.get("x_organization_assemble_personal");
     },
     loadApplication: function(callback){
-        this.loadTitle();
-        this.loadContent();
-    },
-
-    loadTitle: function(){
-        this.loadTitleBar();
-        this.loadTitleUserNode();
-        this.loadTitleTextNode();
-    },
+        this.action.getPerson(function(json){
+            this.personData = json.data;
+            this.personData.personIcon = this.action.getPersonIcon();
+            this.content.loadHtml(this.path+this.options.style+"/view.html", {"bind": {"data": this.personData, "lp": this.lp}}, function(){
+                this.loadContent()
+            }.bind(this));
+        }.bind(this));
+        //this.loadCss();
 
-    loadTitleBar: function(){
-        this.titleBar = new Element("div", {
-            "styles": this.css.titleBar
-        }).inject(this.content);
-    },
-    loadTitleUserNode: function(){
-        this.titleUserNode = new Element("div", {
-            "styles": this.css.titleUserNode
-        }).inject(this.titleBar);
-        this.titleUserIconNode = new Element("div", {
-            "styles": this.css.titleUserIconNode
-        }).inject(this.titleUserNode);
-        this.titleUserTextNode = new Element("div", {
-            "styles": this.css.titleUserTextNode,
-            "text": this.desktop.session.user.name
-        }).inject(this.titleUserNode);
-    },
-    loadTitleTextNode: function(){
-        this.taskTitleTextNode = new Element("div", {
-            "styles": this.css.titleTextNode,
-            "text": this.lp.title
-        }).inject(this.titleBar);
+        // this.loadTitle();
+        // this.loadContent();
+        if (callback) callback();
     },
 
     loadContent: function(){
-        this.contentNode = new Element("div", {"styles": this.css.contentNode}).inject(this.content);
+        var pageConfigNodes = this.content.getElements(".o2_profile_configNode");
+        this.contentNode = this.content.getElement(".o2_profile_contentNode");
         MWF.require("MWF.widget.Tab", function(){
             this.tab = new MWF.widget.Tab(this.contentNode, {"style": "profile"});
             this.tab.load();
 
-            this.loadInforConfigNode();
-            this.loadLayoutConfigNode();
-            this.loadIdeaConfigNode();
-            this.loadPasswordConfigNode();
-            this.loadSSOConfigNode();
-
-            this.inforConfigPage = this.tab.addTab(this.inforConfigNode, this.lp.inforConfig);
-            this.layoutConfigPage = this.tab.addTab(this.layoutConfigNode, this.lp.layoutConfig);
-            this.ideaConfigPage = this.tab.addTab(this.ideaConfigNode, this.lp.ideaConfig);
-            this.passwordConfigPage = this.tab.addTab(this.passwordConfigNode, this.lp.passwordConfig);
-            this.ssoConfigPage = this.tab.addTab(this.ssoConfigNode, this.lp.ssoConfig);
+            pageConfigNodes.each(function(node){
+                this.tab.addTab(node, node.get("title"));
+            }.bind(this));
 
             if (this.options.tab){
-                this[this.options.tab].showIm();
+                this.tab.pages[this.options.tab].showIm();
             }else{
-                this.inforConfigPage.showIm();
+                this.tab.pages[0].showIm();
             }
 
+            this.loadInforConfigActions();
+            this.loadLayoutConfigActions();
+            this.loadIdeaConfigActions();
+            this.loadPasswordConfigActions();
+            this.loadSSOConfigAction();
+
         }.bind(this));
     },
-    loadInforConfigNode: function(){
-        this.inforConfigNode = new Element("div", {"styles": this.css.configNode}).inject(this.content);
-        this.inforConfigAreaNode = new Element("div", {"styles": this.css.inforConfigAreaNode}).inject(this.inforConfigNode);
-
-        this.getAction(function(){
-            this.action.getPerson(function(json){
-                this.personData = json.data;
-                // var icon = json.data.icon;
-                // if (!icon){
-                //     if (json.data.genderType=="f"){
-                //         icon = "/x_component_Profile/$Main/"+this.options.style+"/female.png";
-                //     }else{
-                //         icon = "/x_component_Profile/$Main/"+this.options.style+"/man.png";
-                //     }
-                // }else{
-                //     icon = "data:image/png;base64,"+icon;
-                // }
-
-                //var html = "<table width='100%' border='0' cellpadding='5px'>" +
-                //    "<tr><td>头像:</td><td><img src='"+icon+"' style='width:72px; height: 72px; border:0px; float:left'/>" +
-                //    "<div style='margin: 20px 10px; cursor: pointer; float: left; border: 1px solid #999; padding: 3px 5px'>更换头像</div></td></tr>" +
-                //    "<tr><td>姓名:</td><td>"+json.data.name+"</td></tr>" +
-                //    "<tr><td>工号:</td><td>"+json.data.employee+"</td></tr>" +
-                //    "<tr><td>邮件:</td><td></td></tr>" +
-                //    "<tr><td>微信:</td><td>"+json.data.employee+"</td></tr>" +
-                //    "<tr><td>手机:</td><td>"+json.data.employee+"</td></tr>" +
-                //    "<tr><td>QQ:</td><td>"+json.data.employee+"</td></tr>" +
-                //    "</table>"
-                //this.inforConfigAreaNode.set("html", html);
-                var _self = this;
+    loadInforConfigActions: function(){
+        this.contentImgNode = this.content.getElement(".o2_profile_inforIconContentImg");
+        this.content.getElement(".o2_profile_inforIconChange").addEvent("click", function(){
+            this.changeIcon();
+        }.bind(this));
+
+        var inputs = this.tab.pages[0].contentNode.getElements("input");
+        this.mailInputNode = inputs[0];
+        this.mobileInputNode = inputs[1];
+        this.officePhoneInputNode = inputs[2];
+        this.weixinInputNode = inputs[3];
+        this.qqInputNode = inputs[4];
+        this.signatureInputNode = inputs[5];
+
+        this.content.getElement(".o2_profile_saveInforAction").addEvent("click", function(){
+            this.savePersonInfor();
+        }.bind(this));
+    },
+
+    loadLayoutConfigActions: function(){
+        var buttons = this.tab.pages[1].contentNode.getElements(".o2_profile_layoutClearDataAction");
+        this.clearDataAction = buttons[0];
+        this.defaultDataAction = (buttons.length>1) ? buttons[1]: null;
+        this.clearDefaultDataAction = (buttons.length>2) ? buttons[2]: null;
+        this.forceDataAction = (buttons.length>3) ? buttons[3]: null;
+        this.deleteForceDataAction = (buttons.length>4) ? buttons[4]: null;
+
+        this.clearDataAction.addEvent("click", function(){
+            MWF.require("MWF.widget.UUID", function(){
+                MWF.UD.deleteData("layout", function(){
+                    this.notice(this.lp.clearok, "success");
+                    this.desktop.notRecordStatus = true;
+                }.bind(this));
+            }.bind(this));
+        }.bind(this));
+
+        if( MWF.AC.isAdministrator() ){
+            this.defaultDataAction.addEvent("click", function(){
+                MWF.require("MWF.widget.UUID", function(){
+                    var text = this.lp.setDefaultOk;
+                    this.close();
+                    var status = layout.desktop.getLayoutStatusData();
+                    MWF.UD.putPublicData("defaultLayout", status, function(){
+                        MWF.xDesktop.notice("success", {"x": "right", "y": "top"}, text, layout.desktop.desktopNode);
+                    }.bind(this));
+                }.bind(this));
+            }.bind(this));
+
+            this.clearDefaultDataAction.addEvent("click", function(){
+                MWF.require("MWF.widget.UUID", function(){
+                    MWF.UD.deletePublicData("defaultLayout", function(){
+                        this.notice(this.lp.clearok, "success");
+                        this.desktop.notRecordStatus = true;
+                    }.bind(this));
+                }.bind(this));
+            }.bind(this));
+
+            this.forceDataAction.addEvent("click", function(){
+                MWF.require("MWF.widget.UUID", function(){
+                    var text = this.lp.setForceOk;
+                    this.close();
+                    var status = layout.desktop.getLayoutStatusData();
+                    MWF.UD.putPublicData("forceLayout", status, function(){
+                        MWF.xDesktop.notice("success", {"x": "right", "y": "top"}, text, layout.desktop.desktopNode);
+                    }.bind(this));
+                }.bind(this));
+            }.bind(this));
+
+            this.deleteForceDataAction.addEvent("click", function(){
+                MWF.require("MWF.widget.UUID", function(){
+                    MWF.UD.deletePublicData("forceLayout", function(){
+                        this.notice(this.lp.clearok, "success");
+                        this.desktop.notRecordStatus = true;
+                    }.bind(this));
+                }.bind(this));
+            }.bind(this));
+        }
+
 
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforIconTitleNode, "text": this.lp.icon}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforIconContentNode}).inject(lineNode);
-                this.contentImgNode = new Element("img", {"styles": this.css.inforIconContentImgNode, "src": this.action.getPersonIcon()}).inject(contentNode);
-                var actionNode = new Element("div", {"styles": this.css.inforChangeIconNode, "text": this.lp.changeIcon, "events": {
-                    "click": function(){this.changeIcon();}.bind(this)
-                }}).inject(lineNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.name}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforContentNode, "text": json.data.name}).inject(lineNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.employee}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforContentNode, "text": json.data.employee}).inject(lineNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.mail}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-                this.mailInputNode = new Element("input", {"styles": this.css.inforContentInputNode, "value": json.data.mail, "events": {
-                    "blur": function(){this.setStyles(_self.css.inforContentInputNode);},
-                    "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);}
-                }}).inject(contentNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.mobile}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-                this.mobileInputNode = new Element("input", {"styles": this.css.inforContentInputNode, "value": json.data.mobile, "events": {
-                    "blur": function(){this.setStyles(_self.css.inforContentInputNode);},
-                    "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);}
-                }}).inject(contentNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.officePhone}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-                this.officePhoneInputNode = new Element("input", {"styles": this.css.inforContentInputNode, "value": json.data.officePhone, "events": {
-                    "blur": function(){this.setStyles(_self.css.inforContentInputNode);},
-                    "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);}
-                }}).inject(contentNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.weixin}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-                this.weixinInputNode = new Element("input", {"styles": this.css.inforContentInputNode, "value": json.data.weixin, "events": {
-                    "blur": function(){this.setStyles(_self.css.inforContentInputNode);},
-                    "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);}
-                }}).inject(contentNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.QQ}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-                this.qqInputNode = new Element("input", {"styles": this.css.inforContentInputNode, "value": json.data.qq, "events": {
-                    "blur": function(){this.setStyles(_self.css.inforContentInputNode);},
-                    "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);}
-                }}).inject(contentNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.signature}).inject(lineNode);
-                var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-                this.signatureInputNode = new Element("input", {"styles": this.css.inforContentInputNode, "value": json.data.signature, "events": {
-                    "blur": function(){this.setStyles(_self.css.inforContentInputNode);},
-                    "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);}
-                }}).inject(contentNode);
-
-                var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.inforConfigAreaNode);
-                this.saveAction = new Element("div", {"styles": this.css.saveAction, "text": this.lp.saveInfor}).inject(lineNode);
-                this.saveAction.addEvent("click", function(){
-                    this.savePersonInfor();
+        var UINode = this.tab.pages[1].contentNode.getLast();
+        this.loadDesktopBackground(UINode);
+    },
+
+    loadIdeaConfigActions: function(){
+        this.ideasArea = this.tab.pages[2].contentNode.getElement("textarea");
+        this.ideasSaveAction = this.ideasArea.getNext();
+        this.ideasSaveDefaultAction = this.ideasSaveAction.getNext() || null;
+
+        if (MWF.AC.isAdministrator()){
+            this.ideasSaveDefaultAction.addEvent("click", function(){
+                MWF.require("MWF.widget.UUID", function(){
+                    var data = {};
+                    data.ideas = this.ideasArea.get("value").split("\n");
+                    MWF.UD.putPublicData("idea", data, function(){
+                        this.notice(this.lp.ideaSaveOk, "success");
+                    }.bind(this));
                 }.bind(this));
+            }.bind(this))
+        }
 
+        MWF.require("MWF.widget.UUID", function(){
+            MWF.UD.getDataJson("idea", function(json){
+                if (json){
+                    if (json.ideas) this.ideasArea.set("value", json.ideas.join("\n"));
+                }
+            }.bind(this));
+        }.bind(this));
 
-            }.bind(this), null, this.desktop.session.user.name)
+        this.ideasSaveAction.addEvent("click", function(){
+            MWF.require("MWF.widget.UUID", function(){
+                var data = {};
+                data.ideas = this.ideasArea.get("value").split("\n");
+                MWF.UD.putData("idea", data, function(){
+                    this.notice(this.lp.ideaSaveOk, "success");
+                }.bind(this));
+            }.bind(this));
+        }.bind(this))
+    },
+
+    loadPasswordConfigActions: function(){
+        var inputs = this.tab.pages[3].contentNode.getElements("input");
+        this.oldPasswordInputNode = inputs[0];
+        this.passwordInputNode = inputs[1];
+        this.morePasswordInputNode = inputs[2];
+        this.savePasswordAction = this.tab.pages[3].contentNode.getElement(".o2_profile_savePasswordAction");
+
+        this.oldPasswordInputNode.addEvents({
+            "blur": function(){this.removeClass("o2_profile_inforContentInput_focus");},
+            "focus": function(){this.addClass("o2_profile_inforContentInput_focus");}
+        });
+        this.passwordInputNode.addEvents({
+            "blur": function(){this.removeClass("o2_profile_inforContentInput_focus");},
+            "focus": function(){this.addClass("o2_profile_inforContentInput_focus");},
+            "keyup" : function(){ this.checkPassowrdStrength(  this.passwordInputNode.get("value") ) }.bind(this)
+        });
+        this.morePasswordInputNode.addEvents({
+            "blur": function(){this.removeClass("o2_profile_inforContentInput_focus");},
+            "focus": function(){this.addClass("o2_profile_inforContentInput_focus");}
+        });
+        this.savePasswordAction.addEvent("click", function(){
+            this.changePassword();
         }.bind(this));
     },
+    loadSSOConfigAction: function(){
+        this.ssoConfigAreaNode = this.tab.pages[4].contentNode.getElement(".o2_profile_ssoConfigArea");
+        MWF.Actions.get("x_organization_assemble_authentication").listOauthServer(function(json){
+            json.data.each(function(d){
+                var node = new Element("a", {
+                    "styles": {"font-size": "14px", "display": "block", "margin-bottom": "10px"},
+                    "text": d.displayName,
+                    "target": "_blank",
+                    "href": "/x_desktop/oauth.html?oauth="+encodeURIComponent(d.name)+"&redirect="+"&method=oauthBind"
+                }).inject(this.ssoConfigAreaNode)
+            }.bind(this));
+        }.bind(this));
+    },
+
     changeIcon: function(){
         var options = {};
         var width = "668";
@@ -270,56 +310,10 @@ MWF.xApplication.Profile.Main = new Class({
                         }
                     }.bind(this))
                 }.bind(this), null, this.image.getFormData(), this.image.resizedImage);
-
-
-                // this.explorer.actions.changePersonIcon(this.data.id ,function(){
-                //     this.iconNode.set("src", "");
-                //     if (this.item.iconNode) this.item.iconNode.getElement("img").set("src", "");
-                //     window.setTimeout(function(){
-                //         this.iconNode.set("src", this._getIcon(true));
-                //         if (this.item.iconNode) this.item.iconNode.getElement("img").set("src", this.item._getIcon(true));
-                //     }.bind(this), 100);
-                // }.bind(this), null, this.image.getFormData(), this.image.resizedImage);
             }
         }
     },
 
-    // changeIcon: function(){
-    //     if (!this.uploadFileAreaNode){
-    //         this.uploadFileAreaNode = new Element("div");
-    //         var html = "<input name=\"file\" type=\"file\"/>";
-    //         this.uploadFileAreaNode.set("html", html);
-    //
-    //         this.fileUploadNode = this.uploadFileAreaNode.getFirst();
-    //         this.fileUploadNode.addEvent("change", function(){
-    //
-    //             var files = fileNode.files;
-    //             if (files.length){
-    //                 for (var i = 0; i < files.length; i++) {
-    //                     var file = files.item(i);
-    //
-    //                     var formData = new FormData();
-    //                     formData.append('file', file);
-    //                     //formData.append('name', file.name);
-    //                     //formData.append('folder', folderId);
-    //                     this.action.changeIcon(function(){
-    //                         this.action.getPerson(function(json){
-    //                             if (json.data){
-    //                                 this.personData = json.data;
-    //                                 //if (this.personData.icon){
-    //                                     this.contentImgNode.set("src", this.action.getPersonIcon());
-    //                                 //}
-    //                             }
-    //                         }.bind(this))
-    //                     }.bind(this), null, formData, file);
-    //                 }
-    //             }
-    //
-    //         }.bind(this));
-    //     }
-    //     var fileNode = this.uploadFileAreaNode.getFirst();
-    //     fileNode.click();
-    // },
     savePersonInfor: function(){
         this.personData.officePhone = this.officePhoneInputNode.get("value");
         this.personData.mail = this.mailInputNode.get("value");
@@ -331,94 +325,7 @@ MWF.xApplication.Profile.Main = new Class({
             this.notice(this.lp.saveInforOk, "success");
         }.bind(this));
     },
-    loadLayoutConfigNode: function(){
-        this.layoutConfigNode = new Element("div", {"styles": this.css.configNode}).inject(this.content);
-
-        new Element("div", {"styles": this.css.layoutTitleNode, "text": this.lp.layoutAction}).inject(this.layoutConfigNode);
 
-        var buttonNode = new Element("div", {"styles": this.css.buttonNodeArea}).inject(this.layoutConfigNode);
-
-        this.clearDataAction = new Element("div", {"styles": this.css.clearDataAction, "text": this.lp.clear}).inject(buttonNode);
-        this.clearDataAction.addEvent("click", function(){
-            MWF.require("MWF.widget.UUID", function(){
-                //MWF.UD.putData("layout", {}, function(){
-                //    this.notice(this.lp.clearok, "success");
-                //    this.desktop.notRecordStatus = true;
-                //}.bind(this));
-
-                MWF.UD.deleteData("layout", function(){
-                    this.notice(this.lp.clearok, "success");
-                    this.desktop.notRecordStatus = true;
-                }.bind(this));
-
-            }.bind(this));
-        }.bind(this));
-
-        if (MWF.AC.isAdministrator()){
-            var defaultNode = new Element("div", {"styles": {"overflow":"hidden", "clear": "left"}}).inject(buttonNode);
-            this.defaultDataAction = new Element("div", {"styles": this.css.setDefaultDataAction, "text": this.lp.setDefault}).inject(defaultNode);
-            this.defaultDataAction.addEvent("click", function(){
-                MWF.require("MWF.widget.UUID", function(){
-                    var text = this.lp.setDefaultOk;
-                    this.close();
-                    var status = layout.desktop.getLayoutStatusData();
-                    MWF.UD.putPublicData("defaultLayout", status, function(){
-                        MWF.xDesktop.notice("success", {"x": "right", "y": "top"}, text, layout.desktop.desktopNode);
-                    }.bind(this));
-                }.bind(this));
-            }.bind(this));
-
-            this.clearDefaultDataAction = new Element("div", {"styles": this.css.setDefaultDataAction, "text": this.lp.clearDefault}).inject(defaultNode);
-            this.clearDefaultDataAction.addEvent("click", function(){
-                MWF.require("MWF.widget.UUID", function(){
-                    MWF.UD.deletePublicData("defaultLayout", function(){
-                        this.notice(this.lp.clearok, "success");
-                        this.desktop.notRecordStatus = true;
-                    }.bind(this));
-                    //
-                    // var text = this.lp.setDefaultOk;
-                    // this.close();
-                    // var status = layout.desktop.getLayoutStatusData();
-                    // MWF.UD.putPublicData("defaultLayout", status, function(){
-                    //     MWF.xDesktop.notice("success", {"x": "right", "y": "top"}, text, layout.desktop.desktopNode);
-                    // }.bind(this));
-                }.bind(this));
-            }.bind(this));
-
-
-            //var tmpNode = new Element("div", {"styles": {
-            //    "width": "300px",
-            //    "margin": "-20px auto"
-            //}}).inject(this.layoutConfigNode);
-
-            this.forceDataAction = new Element("div", {"styles": this.css.setDefaultDataAction, "text": this.lp.setForce}).inject(buttonNode);
-            this.forceDataAction.setStyle("float", "left");
-            this.forceDataAction.addEvent("click", function(){
-                MWF.require("MWF.widget.UUID", function(){
-                    var text = this.lp.setForceOk;
-                    this.close();
-                    var status = layout.desktop.getLayoutStatusData();
-                    MWF.UD.putPublicData("forceLayout", status, function(){
-                        MWF.xDesktop.notice("success", {"x": "right", "y": "top"}, text, layout.desktop.desktopNode);
-                    }.bind(this));
-                }.bind(this));
-            }.bind(this));
-
-            this.deleteForceDataAction = new Element("div", {"styles": this.css.setDefaultDataAction, "text": this.lp.clearForce}).inject(buttonNode);
-            this.deleteForceDataAction.addEvent("click", function(){
-                MWF.require("MWF.widget.UUID", function(){
-                    MWF.UD.deletePublicData("forceLayout", function(){
-                        this.notice(this.lp.clearok, "success");
-                        this.desktop.notRecordStatus = true;
-                    }.bind(this));
-                }.bind(this));
-            }.bind(this));
-        }
-
-        new Element("div", {"styles": this.css.layoutTitleNode, "text": this.lp.desktopBackground}).inject(this.layoutConfigNode);
-        var UINode = new Element("div", {"styles": this.css.buttonNodeArea}).inject(this.layoutConfigNode);
-        this.loadDesktopBackground(UINode);
-    },
     loadDesktopBackground: function(UINode){
         var currentSrc = layout.desktop.options.style;
         MWF.UD.getDataJson("layoutDesktop", function(json){
@@ -429,7 +336,7 @@ MWF.xApplication.Profile.Main = new Class({
             json.each(function(style){
                 var img = MWF.defaultPath+"/xDesktop/$Layout/"+style.style+"/preview.jpg";
                 //var dskImg = MWF.defaultPath+"/xDesktop/$Layout/"+style.style+"/desktop.jpg";
-                var imgArea = new Element("div", {"styles": this.css.previewBackground}).inject(UINode);
+                var imgArea = new Element("div.o2_profile_previewBackground").inject(UINode);
                 if (currentSrc==style.style){
                     imgArea.setStyles({"border": "4px solid #ffea00"});
                 }
@@ -440,14 +347,6 @@ MWF.xApplication.Profile.Main = new Class({
                 imgArea.addEvent("click", function(){ _self.selectDesktopImg(this, UINode); });
             }.bind(this));
         }.bind(this));
-
-        //MWF.UD.getPublicData("layoutDesktopImgs", function(json){
-        //    if (json) currentSrc = json.src;
-        //}.bind(this), false);
-        //
-        if (MWF.AC.isAdministrator()){
-
-        }
     },
     selectDesktopImg: function(item, UINode){
         var desktopImg = item.retrieve("dskimg");
@@ -461,89 +360,6 @@ MWF.xApplication.Profile.Main = new Class({
             layout.desktop.node.setStyle("background-image", "url("+dskImg+")");
         }.bind(this));
     },
-
-    loadIdeaConfigNode: function(){
-        this.ideaConfigNode = new Element("div", {"styles": this.css.configNode}).inject(this.content);
-        this.ideasArea = new Element("textarea", {"styles": this.css.ideasArea}).inject(this.ideaConfigNode);
-        this.ideasSaveAction = new Element("div", {"styles": this.css.ideasSaveAction, "text": this.lp.saveIdea}).inject(this.ideaConfigNode);
-
-        if (MWF.AC.isAdministrator()){
-            this.ideasSaveDefaultAction = new Element("div", {"styles": this.css.ideasSaveAction, "text": this.lp.saveIdeaDefault}).inject(this.ideaConfigNode);
-            this.ideasSaveDefaultAction.addEvent("click", function(){
-                MWF.require("MWF.widget.UUID", function(){
-                    var data = {};
-                    data.ideas = this.ideasArea.get("value").split("\n");
-                    MWF.UD.putPublicData("idea", data, function(){
-                        this.notice(this.lp.ideaSaveOk, "success");
-                    }.bind(this));
-                }.bind(this));
-            }.bind(this))
-        }
-
-        MWF.require("MWF.widget.UUID", function(){
-            MWF.UD.getDataJson("idea", function(json){
-                if (json){
-                    if (json.ideas) this.ideasArea.set("value", json.ideas.join("\n"));
-                }
-            }.bind(this));
-        }.bind(this));
-
-        this.ideasSaveAction.addEvent("click", function(){
-            MWF.require("MWF.widget.UUID", function(){
-                var data = {};
-                data.ideas = this.ideasArea.get("value").split("\n");
-                MWF.UD.putData("idea", data, function(){
-                    this.notice(this.lp.ideaSaveOk, "success");
-                }.bind(this));
-            }.bind(this));
-        }.bind(this))
-    },
-    loadPasswordConfigNode: function(){
-        this.passwordConfigNode = new Element("div", {"styles": this.css.configNode});
-        this.passwordConfigAreaNode = new Element("div", {"styles": this.css.inforConfigAreaNode}).inject(this.passwordConfigNode);
-
-        var _self = this;
-        var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.passwordConfigAreaNode);
-        var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.oldPassword}).inject(lineNode);
-        var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-        this.oldPasswordInputNode = new Element("input", {"type": "password", "styles": this.css.inforContentInputNode, "events": {
-            "blur": function(){this.setStyles(_self.css.inforContentInputNode);},
-            "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);}
-        }}).inject(contentNode);
-
-        var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.passwordConfigAreaNode);
-        var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.password}).inject(lineNode);
-        var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-        this.passwordInputNode = new Element("input", {"type": "password", "styles": this.css.inforContentInputNode, "events": {
-            "blur": function(){
-                this.setStyles(_self.css.inforContentInputNode);
-            },
-            "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);},
-            "keyup" : function(){ this.checkPassowrdStrength(  this.passwordInputNode.get("value") ) }.bind(this)
-        }}).inject(contentNode);
-
-        var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.passwordConfigAreaNode);
-        var titleNode = new Element("div", {"styles": this.css.inforTitleNode}).inject(lineNode);
-        this.passwordRemindContainer = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-
-        var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.passwordConfigAreaNode);
-        var titleNode = new Element("div", {"styles": this.css.inforTitleNode, "text": this.lp.morePassword}).inject(lineNode);
-        var contentNode = new Element("div", {"styles": this.css.inforContentNode}).inject(lineNode);
-        this.morePasswordInputNode = new Element("input", {"type": "password", "styles": this.css.inforContentInputNode, "events": {
-            "blur": function(){this.setStyles(_self.css.inforContentInputNode);},
-            "focus": function(){this.setStyles(_self.css.inforContentInputNode_focus);}
-        }}).inject(contentNode);
-
-        var lineNode = new Element("div", {"styles": this.css.inforLineNode}).inject(this.passwordConfigAreaNode);
-        this.saveAction = new Element("div", {"styles": this.css.saveAction, "text": this.lp.passwordConfig}).inject(lineNode);
-        this.saveAction.addEvent("click", function(){
-            this.changePassword();
-        }.bind(this));
-
-        this.createPasswordStrengthNode();
-        this.passworRemindNode = new Element("div",{"styles": this.css.passwordRemindNode, "text": this.lp.paswordRule }).inject( this.passwordRemindContainer );
-
-    },
     changePassword: function(){
         var oldPassword = this.oldPasswordInputNode.get("value");
         var password = this.passwordInputNode.get("value");
@@ -576,10 +392,6 @@ MWF.xApplication.Profile.Main = new Class({
         if (!this.acrion){
             this.action = MWF.Actions.get("x_organization_assemble_personal");
             if (callback) callback();
-            // MWF.xDesktop.requireApp("Profile", "Actions.RestActions", function(){
-            //     this.action = new MWF.xApplication.Profile.Actions.RestActions();
-            //     if (callback) callback();
-            // }.bind(this));
         }else{
             if (callback) callback();
         }
@@ -614,12 +426,23 @@ MWF.xApplication.Profile.Main = new Class({
         }.bind(this) );
     },
     checkPassowrdStrength: function(pwd){
-        this.lowColorNode.setStyles( this.css.passwordStrengthColor );
-        this.lowTextNode.setStyles( this.css.passwordStrengthText );
-        this.middleColorNode.setStyles( this.css.passwordStrengthColor );
-        this.middleTextNode.setStyles( this.css.passwordStrengthText );
-        this.highColorNode.setStyles( this.css.passwordStrengthColor );
-        this.highTextNode.setStyles( this.css.passwordStrengthText );
+        var passwordStrengthNode = this.tab.pages[3].contentNode.getElement(".o2_profile_passwordStrengthArea");
+        var nodes = passwordStrengthNode.getElements(".o2_profile_passwordStrengthColor");
+        var lowColorNode = nodes[0];
+        var middleColorNode = nodes[1];
+        var highColorNode = nodes[2];
+        nodes = passwordStrengthNode.getElements(".o2_profile_passwordStrengthText");
+        var lowTextNode = nodes[0];
+        var middleTextNode = nodes[1];
+        var highTextNode = nodes[2];
+
+        lowColorNode.removeClass("o2_profile_passwordStrengthColor_low");
+        middleColorNode.removeClass("o2_profile_passwordStrengthColor_middle");
+        highColorNode.removeClass("o2_profile_passwordStrengthColor_high");
+        lowTextNode.removeClass("o2_profile_passwordStrengthText_current");
+        middleTextNode.removeClass("o2_profile_passwordStrengthText_current");
+        highTextNode.removeClass("o2_profile_passwordStrengthText_current");
+
         if (pwd==null||pwd==''){
         }else{
             this.getPasswordLevel( pwd, function( level ){
@@ -628,72 +451,21 @@ MWF.xApplication.Profile.Main = new Class({
                     case 1:
                     case 2:
                     case 3:
-                        this.lowColorNode.setStyles( this.css.passwordStrengthColor_low );
-                        this.lowTextNode.setStyles( this.css.passwordStrengthText_current );
+                        lowColorNode.addClass("o2_profile_passwordStrengthColor_low");
+                        lowTextNode.addClass("o2_profile_passwordStrengthText_current");
                         break;
                     case 4:
                     case 5:
                     case 6:
-                        this.middleColorNode.setStyles( this.css.passwordStrengthColor_middle );
-                        this.middleTextNode.setStyles( this.css.passwordStrengthText_current );
+                        middleColorNode.addClass("o2_profile_passwordStrengthColor_middle");
+                        middleTextNode.addClass("o2_profile_passwordStrengthText_current");
                         break;
                     default:
-                        this.highColorNode.setStyles( this.css.passwordStrengthColor_high );
-                        this.highTextNode.setStyles( this.css.passwordStrengthText_current );
+                        highColorNode.addClass("o2_profile_passwordStrengthColor_high");
+                        highTextNode.addClass("o2_profile_passwordStrengthText_current");
                 }
             }.bind(this) )
 
         }
-    },
-    loadSSOConfigNode: function(){
-        this.ssoConfigNode = new Element("div", {"styles": this.css.configNode}).inject(this.content);
-        this.ssoConfigTitleNode = new Element("div", {"styles": this.css.ssoConfigTitleNode, "text": this.lp.bindOauth}).inject(this.ssoConfigNode);
-        this.ssoConfigAreaNode = new Element("div", {"styles": {"padding": "10px 40px"}}).inject(this.ssoConfigNode);
-
-        MWF.Actions.get("x_organization_assemble_authentication").listOauthServer(function(json){
-            json.data.each(function(d){
-                var node = new Element("a", {
-                    "styles": {"font-size": "14px", "display": "block", "margin-bottom": "10px"},
-                    "text": d.displayName,
-                    "target": "_blank",
-                    "href": "/x_desktop/oauth.html?oauth="+encodeURIComponent(d.name)+"&redirect="+"&method=oauthBind"
-                }).inject(this.ssoConfigAreaNode)
-            }.bind(this));
-        }.bind(this));
-
-
-        // this.ideasArea = new Element("textarea", {"styles": this.css.ideasArea}).inject(this.ideaConfigNode);
-        // this.ideasSaveAction = new Element("div", {"styles": this.css.ideasSaveAction, "text": this.lp.saveIdea}).inject(this.ideaConfigNode);
-        //
-        // if (MWF.AC.isAdministrator()){
-        //     this.ideasSaveDefaultAction = new Element("div", {"styles": this.css.ideasSaveAction, "text": this.lp.saveIdeaDefault}).inject(this.ideaConfigNode);
-        //     this.ideasSaveDefaultAction.addEvent("click", function(){
-        //         MWF.require("MWF.widget.UUID", function(){
-        //             var data = {};
-        //             data.ideas = this.ideasArea.get("value").split("\n");
-        //             MWF.UD.putPublicData("idea", data, function(){
-        //                 this.notice(this.lp.ideaSaveOk, "success");
-        //             }.bind(this));
-        //         }.bind(this));
-        //     }.bind(this))
-        // }
-        //
-        // MWF.require("MWF.widget.UUID", function(){
-        //     MWF.UD.getDataJson("idea", function(json){
-        //         if (json){
-        //             if (json.ideas) this.ideasArea.set("value", json.ideas.join("\n"));
-        //         }
-        //     }.bind(this));
-        // }.bind(this));
-        //
-        // this.ideasSaveAction.addEvent("click", function(){
-        //     MWF.require("MWF.widget.UUID", function(){
-        //         var data = {};
-        //         data.ideas = this.ideasArea.get("value").split("\n");
-        //         MWF.UD.putData("idea", data, function(){
-        //             this.notice(this.lp.ideaSaveOk, "success");
-        //         }.bind(this));
-        //     }.bind(this));
-        // }.bind(this))
     }
-});
+});

+ 14 - 9
o2web/source/x_component_Report/Setting.js

@@ -525,16 +525,21 @@ MWF.xApplication.Report.SettingForm = new Class({
         return arr;
     },
     save: function(e){
-        var pdata = this.personform.getResult(true,null,true,false,false);
-        if( pdata){
-            MWF.UD.putData("reportConfig", pdata, function(){
-                if( this.sysform ){
-                    this.saveSysData();
-                }else{
-                    this.app.notice(this.lp.save_success, "success");
-                }
-            }.bind(this), false);
+        if( this.personform ){
+            var pdata = this.personform.getResult(true,null,true,false,false);
+            if( pdata){
+                MWF.UD.putData("reportConfig", pdata, function(){
+                    if( this.sysform ){
+                        this.saveSysData();
+                    }else{
+                        this.app.notice(this.lp.save_success, "success");
+                    }
+                }.bind(this), false);
+            }
+        }else if( this.sysform ){
+            this.saveSysData();
         }
+
     },
     saveSysData: function(){
         var sdata = this.sysform.getResult(true,"|",true,false,false);

+ 15 - 4
o2web/source/x_component_Selector/IdentityWidthDuty.js

@@ -11,6 +11,7 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({
         "values": [],
         "zIndex": 1000,
         "expand": false,
+        "expandSubEnable": true,
         "exclude" : []
     },
     loadSelectItems: function(addToNext){
@@ -18,8 +19,8 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({
             this.options.dutys.each(function(duty){
                 var data = {"name": duty, "id":duty};
                 var category = this._newItemCategory("ItemCategory",data, this, this.itemAreaNode);
-                category.loadSub();
-                category.clickItem();
+                //category.loadSub();
+                //category.clickItem();
                 // this.action.getUnitduty(function(dutyData){
                 //     var category = this._newItemCategory("ItemCategory", dutyData.data, this, this.itemAreaNode);
                 // }.bind(this), null, duty);
@@ -164,6 +165,9 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
             if (this.selector.options.units.length){
                 var action = MWF.Actions.get("x_organization_assemble_express");
                 var data = {"name":this.data.name, "unit":""};
+                var count = this.selector.options.units.length;
+                alert(count)
+                var i = 0;
                 this.selector.options.units.each(function(u){
                     if (typeOf(u)==="string"){
                         data.unit = u;
@@ -177,10 +181,17 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
                                 this.selector.items.push(item);
                             }
                         }.bind(this));
+                        i++;
+                        if (i>=count){
+                            if (!this.loaded) {
+                                this.loaded = true;
+                                if (callback) callback();
+                            }
+                        }
                     }.bind(this));
                 }.bind(this));
-                this.loaded = true;
-                if (callback) callback();
+
+                //if (callback) callback();
 
             }else{
                 this.selector.orgAction.listIdentityWithDuty(function(json){

+ 6 - 1
o2web/source/x_component_Selector/Person.js

@@ -231,8 +231,9 @@ MWF.xApplication.Selector.Person = new Class({
             if (this.options.count.toInt()!==1) this.loadSelectedNodeMobile();
             this.loadSelectNodeMobile();
         }else{
-            if (this.options.count.toInt()!==1) this.loadSelectedNode();
             this.loadSelectNode();
+            if (this.options.count.toInt()!==1) this.loadSelectedNode();
+
         }
     },
     loadSelectNodeMobile: function(){
@@ -477,6 +478,9 @@ MWF.xApplication.Selector.Person = new Class({
 
         this.setSelectedItem();
 
+        this.loadSelectedNodeScroll();
+    },
+    loadSelectedNodeScroll: function(){
         MWF.require("MWF.widget.ScrollBar", function(){
             var _self = this;
             new MWF.widget.ScrollBar(this.selectedScrollNode, {
@@ -484,6 +488,7 @@ MWF.xApplication.Selector.Person = new Class({
             });
         }.bind(this));
     },
+
     loadSelectedNodeMobile: function(){
         this.selectedScrollNode = new Element("div", {
             "styles": this.css.selectedScrollNode

+ 2 - 2
o2web/source/x_component_Selector/Process.js

@@ -42,9 +42,9 @@ MWF.xApplication.Selector.Process = new Class({
         return false;
     },
     _getItem: function(callback, failure, id, async){
-        this.action.getProcess(function(json){
+        this.processAction.getProcess(function(json){
             if (callback) callback.apply(this, [json]);
-        }.bind(this), failure, ((typeOf(id)==="string") ? id : id.id), async);
+        }.bind(this), failure, ((typeOf(id)==="string") ? id : (typeOf(id)=="string") ? id : id.id), async);
     },
     _newItemSelected: function(data, selector, item){
         return new MWF.xApplication.Selector.Process.ItemSelected(data, selector, item)

+ 58 - 1
o2web/source/x_component_Selector/package.js

@@ -89,5 +89,62 @@ MWF.O2SelectorFilter = new Class({
     filter: function(value, callback){
         return this.selectFilter.filter(value, callback);
     }
+});
 
-});
+(function(){
+    var _createEl = function(data, node){
+        var dname = data.distinguishedName;
+        if (typeOf(data)==="string"){
+            data = {"id": data};
+            dname = data.id;
+        }
+        var len = dname.length;
+        var flag = dname.substring(len-1,len);
+        switch (flag){
+            case "U":
+                new o2.widget.O2Unit(data, node, {"style": "xform"});
+                break;
+            case "I":
+                new o2.widget.O2Identity(data, node, {"style": "xform"});
+                break;
+            case "G":
+                new o2.widget.O2Group(data, node, {"style": "xform"});
+                break;
+            case "P":
+                new o2.widget.O2Person(data, node, {"style": "xform"});
+                break;
+            case "R":
+                new o2.widget.O2Role(data, node, {"style": "xform"});
+                break;
+        }
+    };
+
+    Element.prototype.setSelectPerson = function(container, options){
+        if (options.types) options.type = "";
+        options.onComplete = function(items){
+            debugger;
+            o2.require("o2.widget.O2Identity", function(){
+                options.values = [];
+                this.empty();
+                items.each(function(item){
+                    options.values.push(item.data);
+                    _createEl(item.data, this);
+                    if (options.selectItem) options.selectItem(item);
+                }.bind(this));
+                this.store("data-value", options.values);
+            }.bind(this));
+        }.bind(this);
+
+        if (options.values){
+            options.values.each(function(v){
+                this.store("data-value", options.values);
+                _createEl(v, this);
+            }.bind(this));
+        }
+        this.addEvent("click", function(){
+            var i = this.getZIndex();
+            options.zIndex = i+1;
+            new MWF.O2Selector(container, options);
+        }.bind(this));
+    };
+})();

+ 8 - 0
o2web/source/x_component_Setting/$SettingModuleUI/default/css.wcss

@@ -141,6 +141,14 @@
         "height": "36px",
         "margin-left": "100px",
     },
+    "deployIconNode": {
+        "height": "64px",
+        "width": "64px",
+        "background-color": "#cccccc",
+        "float": "left",
+        "overflow": "hidden",
+        "margin-right": "10px"
+    },
     "deployInputNode": {
         "height": "18px",
         "width": "95%"

+ 1 - 1
o2web/source/x_component_Setting/SettingMobile.js

@@ -51,7 +51,7 @@ MWF.xApplication.Setting.MobileConnectDocument = new Class({
             "lp": {"title": this.lp.mobile_application, "infor": this.lp.mobile_application_infor, "editAction": this.lp.mobile_application_action},
             "data": {"key": "proxyData", "valueKey": "applicationList", "notEmpty": false},
             "value": this.explorer.proxyData.applicationList,
-            "itemTitle": "{node} - {proxyHost}:{proxyPort}",
+            "itemTitle": "{proxyHost}:{proxyPort}",
             "readonly": ["node"],
             "icon": "server.png"
         });

+ 0 - 21
o2web/source/x_component_Setting/components.json

@@ -125,13 +125,6 @@
     "iconPath": "appicon.png",
     "visible": true
   },
-  {
-    "name": "Execution",
-    "path": "Execution",
-    "title": "执行力管理",
-    "iconPath": "appicon.png",
-    "visible": true
-  },
   {
     "name": "Attendance",
     "path": "Attendance",
@@ -174,20 +167,6 @@
     "iconPath": "appicon.png",
     "visible": true
   },
-  {
-    "name": "Strategy",
-    "path": "Strategy",
-    "title": "战略管理",
-    "iconPath": "appicon.png",
-    "visible": true
-  },
-  {
-    "name": "Report",
-    "path": "Report",
-    "title": "工作报告",
-    "iconPath": "appicon.png",
-    "visible": true
-  },
   {
     "name": "Minder",
     "path": "Minder",

BIN
o2web/source/x_component_Strategy/$Main/default/icon/navi/icon_nianbushu.png


BIN
o2web/source/x_component_Strategy/$Main/default/icon/navi/icon_nianbushu__click.png


+ 1 - 1
o2web/source/x_component_Strategy/PriorityList.js

@@ -519,7 +519,7 @@ MWF.xApplication.Strategy.PriorityList.View = new Class({
         if (!count)count = 100;
         var id = (this.items.length) ? this.items[this.items.length - 1].data.id : "(0)";
 
-        if(id=="(0)") {
+        if(id=="(0)") {debugger;
             this.explorer.explorer.createShade();
         }
 

+ 0 - 159
o2web/source/x_component_Template/StatJson.js

@@ -1,159 +0,0 @@
-var StatJson = new Class({
-    options : {
-    },
-    initialize: function ( context, options ) {
-        this.setOptions(options);
-        this.context = context;
-    },
-    load : function(){
-        if( this.context.statJson ){
-            this.json = JSON.parse(this.context.statJson);
-        }else{
-            this.json = {
-                total : {
-                    publishedCount : 0,
-                    errorCount : 0
-                },
-                batch: {}
-            }
-        }
-    },
-    sumit : function(){
-        this.context.statJson = JSON.stringify(this.json);
-    },
-    addBatch : function( batchName, isSetCurrent ){
-        if( !this.json.batch[batchName] ){
-            this.json.batch[batchName] = {
-                publishedCount : 0,
-                errorCount : 0
-            };
-        }
-        if( isSetCurrent )this.currentBatch = this.json.batch[batchName];
-    },
-    deleteBatch : function( batchName ){
-        var json = this.json;
-        if( json.batch[batchName] ){
-            var batch = json.batch[batchName];
-            if( batch.publishedCount ){
-                json.total.publishedCount = json.total.publishedCount - batch.publishedCount;
-            }
-            if( batch.errorCount ){
-                json.total.errorCount = json.total.errorCount - batch.errorCount;
-            }
-            delete this.json.batch[batchName];
-        }
-    },
-    addData: function( cmsDocData ){
-        var d = cmsDocData;
-        var totalJson = this.json.total;
-        var batchJson = this.currentBatch;
-        if( d.docStatus == "published" ){
-            totalJson.publishedCount++;
-            batchJson.publishedCount++;
-            this.addCount( totalJson, d );
-            this.addCount( batchJson, d );
-        }else if( d.docStatus == "error" ){
-            totalJson.errorCount++;
-            batchJson.errorCount++;
-        }
-    },
-    addCount : function( json, d ){
-        if( d.city ){
-            var cityJson = json[ d.city ];
-            if( !cityJson ){
-                cityJson = json[ d.city ] = { publishedCount : 0 };
-            }
-            cityJson.publishedCount ++;
-            if( d.county ){
-                var countyJson = cityJson[ d.county ];
-                if( !countyJson ){
-                    countyJson = cityJson[ d.county ] = { publishedCount : 0 };
-                }
-                countyJson.publishedCount ++;
-                if( d.brach ) {
-                    var branchJson = countyJson[d.brach];
-                    if (!branchJson) {
-                        branchJson = countyJson[d.brach] = {publishedCount: 0};
-                    }
-                    branchJson.publishedCount++;
-                }
-            }
-        }
-    },
-    reduceCount : function( json, d ){
-        if( d.city ){
-            var cityJson = json[ d.city ];
-            if( !cityJson ){
-                cityJson = json[ d.city ] = { publishedCount : 0 };
-            }
-            cityJson.publishedCount --;
-            if( d.county ){
-                var countyJson = cityJson[ d.county ];
-                if( !countyJson ){
-                    countyJson = cityJson[ d.county ] = { publishedCount : 0 };
-                }
-                countyJson.publishedCount --;
-                if( d.brach ) {
-                    var branchJson = countyJson[d.brach];
-                    if (!branchJson) {
-                        branchJson = countyJson[d.brach] = {publishedCount: 0};
-                    }
-                    branchJson.publishedCount--;
-                }
-            }
-        }
-    },
-    getCity : function(){
-        var totalJson = this.json.total;
-        var city = [];
-        for( var key in totalJson ){
-            if( key != "publishedCount" && key != "errorCount" ){
-                if( totalJson[key].publishedCount > 0 ){
-                    city.push(key);
-                }
-            }
-        }
-        return city;
-    },
-    changeData : function( cmsDocData, oldData ){
-        var d = cmsDocData;
-        //var oldData = {
-        //    status : "error",
-        //    city : "",
-        //    county : "",
-        //    branch : ""
-        //};
-
-        var batchJson;
-        if( d.$importBatchName && this.json.batch[d.$importBatchName]) {
-            batchJson = this.json.batch[d.$importBatchName];
-        }
-        var totalJson = this.json.total;
-
-        if( oldData.status == "error" ){
-            totalJson.errorCount--;
-            if( batchJson )batchJson.errorCount--;
-        }
-        if( oldData.status == "published" ){
-            totalJson.publishedCount--;
-            this.reduceCount( totalJson, oldData );
-            if( batchJson ){
-                batchJson.publishedCount--;
-                this.reduceCount( batchJson, oldData );
-            }
-        }
-
-        if( d.docStatus == "error"){
-            totalJson.errorCount++;
-            if( batchJson )batchJson.errorCount++;
-        }
-        if( d.docStatus == "published"){
-            totalJson.publishedCount++;
-            this.addCount( totalJson, d );
-            if( batchJson ){
-                batchJson.publishedCount++;
-                this.addCount( batchJson, d );
-            }
-        }
-    }
-});

+ 0 - 0
o2web/source/x_component_Template/test.xml


+ 146 - 0
o2web/source/x_component_cms_ColumnManager/$Explorer/default/css.wcss

@@ -663,5 +663,151 @@
 	"width": "100%",
 	"height": "100%"
 	//"border-radius": "10px"
+  },
+  "fileDesignerTitleNode": {
+	"height": "40px",
+	"line-height": "40px"
+  },
+  "fileDesignerTitleIconNode": {
+	"width": "40px",
+	"height": "40px",
+	"float": "left",
+	"background-repeat": "no-repeat",
+	"background-position": "left top"
+  },
+  "fileDesignerTitleTextNode": {
+	"margin": "0px 40px",
+	"height": "40px",
+	"text-align": "center",
+	"font-size": "18px",
+	"color": "#666666",
+	"font-weight": "bold"
+  },
+  "fileDesignerContentNode": {
+	"overflow": "auto"
+  },
+  "fileDesignerButtonNode": {
+	"height": "50px"
+  },
+  "fileDesignerContentAreaNode": {
+	"overflow": "hidden",
+	"padding": "20px"
+  },
+  "fileDesignerContentLineNode": {
+	"height": "30px",
+	"line-height": "30px",
+	"width": "80%",
+	"margin": "auto",
+	"margin-top": "10px"
+  },
+  "fileDesignerContentLineTitleNode": {
+	"height": "30px",
+	"width": "80px",
+	"float": "left",
+	"font-size": "16px",
+	"color": "#666666",
+	"text-align": "left",
+	"font-weight": "bold"
+  },
+  "fileDesignerContentLineContentNode": {
+	"height": "30px",
+	"margin-left": "80px",
+	"-webkit-user-select": "text",
+	"-moz-user-select": "text"
+  },
+  "fileDesignerContentLineInputNode": {
+	"border": "1px solid #999999",
+	"height": "22px",
+	"line-height": "22px",
+	"width": "99%",
+	"color": "#666666"
+  },
+  "fileDesignerContentFileLineNode": {
+	"height": "80px",
+	"line-height": "80px",
+	"width": "80%",
+	"margin": "auto",
+	"margin-top": "10px"
+  },
+  "fileDesignerContentFileLineTitleNode": {
+	"height": "80px",
+	"width": "80px",
+	"float": "left",
+	"font-size": "16px",
+	"color": "#666666",
+	"text-align": "left",
+	"font-weight": "bold"
+  },
+  "fileDesignerContentFileLineContentNode": {
+	"height": "80px",
+	"margin": "0px 80px"
+  },
+  "fileDesignerContentFileLineRightNode":{
+	"height": "80px",
+	"width": "80px",
+	"float": "right",
+  },
+  "fileDesignerUploadButtonNode": {
+	"height": "24px",
+	"width": "70px",
+	"line-height": "24px",
+	"border": "1px solid #999999",
+	"border-radius": "5px",
+	"text-align": "center",
+	"color": "#666666",
+	"float": "right",
+	"margin-top": "28px",
+	"background-color": "#F3F3F3",
+	"cursor": "pointer"
+  },
+
+  "fileDesignerCancelButtonNode": {
+	"height": "26px",
+	"width": "80px",
+	"line-height": "26px",
+	"border": "1px solid #999999",
+	"border-radius": "5px",
+	"text-align": "center",
+	"color": "#666666",
+	"float": "right",
+	"margin-right": "60px",
+	"background-color": "#F3F3F3",
+	"cursor": "pointer"
+  },
+  "fileDesignerOkButtonNode": {
+	"height": "26px",
+	"width": "100px",
+	"line-height": "26px",
+	"border": "1px solid #999999",
+	"border-radius": "5px",
+	"text-align": "center",
+	"color": "#FFFFFF",
+	"float": "right",
+	"margin-right": "20px",
+	"background-color": "#4c6b87",
+	"cursor": "pointer"
+  },
+
+  "fileDesignerContentFileLineFileIconNode": {
+	"height": "80px",
+	"width": "80px",
+	"float": "left",
+	"background-repeat": "no-repeat",
+	"background-position": "center"
+  },
+  "fileDesignerContentFileLineFileNameNode": {
+	"margin-left": "85px",
+	"height": "40px",
+	"line-height": "20px",
+	"font-size": "14px",
+	"word-break": "break-all",
+	"color": "#666666"
+  },
+  "fileDesignerContentFileLineFileSizeNode": {
+	"margin-left": "85px",
+	"height": "40px",
+	"line-height": "20px",
+	"font-size": "14px",
+	"color": "#999999"
   }
 }

+ 146 - 0
o2web/source/x_component_cms_ColumnManager/$Explorer/full/css.wcss

@@ -848,5 +848,151 @@
 	"font-size" : "14px",
 	"text-align" : "left",
 	"color" : "#666"
+  },
+  "fileDesignerTitleNode": {
+	"height": "40px",
+	"line-height": "40px"
+  },
+  "fileDesignerTitleIconNode": {
+	"width": "40px",
+	"height": "40px",
+	"float": "left",
+	"background-repeat": "no-repeat",
+	"background-position": "left top"
+  },
+  "fileDesignerTitleTextNode": {
+	"margin": "0px 40px",
+	"height": "40px",
+	"text-align": "center",
+	"font-size": "18px",
+	"color": "#666666",
+	"font-weight": "bold"
+  },
+  "fileDesignerContentNode": {
+	"overflow": "auto"
+  },
+  "fileDesignerButtonNode": {
+	"height": "50px"
+  },
+  "fileDesignerContentAreaNode": {
+	"overflow": "hidden",
+	"padding": "20px"
+  },
+  "fileDesignerContentLineNode": {
+	"height": "30px",
+	"line-height": "30px",
+	"width": "80%",
+	"margin": "auto",
+	"margin-top": "10px"
+  },
+  "fileDesignerContentLineTitleNode": {
+	"height": "30px",
+	"width": "80px",
+	"float": "left",
+	"font-size": "16px",
+	"color": "#666666",
+	"text-align": "left",
+	"font-weight": "bold"
+  },
+  "fileDesignerContentLineContentNode": {
+	"height": "30px",
+	"margin-left": "80px",
+	"-webkit-user-select": "text",
+	"-moz-user-select": "text"
+  },
+  "fileDesignerContentLineInputNode": {
+	"border": "1px solid #999999",
+	"height": "22px",
+	"line-height": "22px",
+	"width": "99%",
+	"color": "#666666"
+  },
+  "fileDesignerContentFileLineNode": {
+	"height": "80px",
+	"line-height": "80px",
+	"width": "80%",
+	"margin": "auto",
+	"margin-top": "10px"
+  },
+  "fileDesignerContentFileLineTitleNode": {
+	"height": "80px",
+	"width": "80px",
+	"float": "left",
+	"font-size": "16px",
+	"color": "#666666",
+	"text-align": "left",
+	"font-weight": "bold"
+  },
+  "fileDesignerContentFileLineContentNode": {
+	"height": "80px",
+	"margin": "0px 80px"
+  },
+  "fileDesignerContentFileLineRightNode":{
+	"height": "80px",
+	"width": "80px",
+	"float": "right",
+  },
+  "fileDesignerUploadButtonNode": {
+	"height": "24px",
+	"width": "70px",
+	"line-height": "24px",
+	"border": "1px solid #999999",
+	"border-radius": "5px",
+	"text-align": "center",
+	"color": "#666666",
+	"float": "right",
+	"margin-top": "28px",
+	"background-color": "#F3F3F3",
+	"cursor": "pointer"
+  },
+
+  "fileDesignerCancelButtonNode": {
+	"height": "26px",
+	"width": "80px",
+	"line-height": "26px",
+	"border": "1px solid #999999",
+	"border-radius": "5px",
+	"text-align": "center",
+	"color": "#666666",
+	"float": "right",
+	"margin-right": "60px",
+	"background-color": "#F3F3F3",
+	"cursor": "pointer"
+  },
+  "fileDesignerOkButtonNode": {
+	"height": "26px",
+	"width": "100px",
+	"line-height": "26px",
+	"border": "1px solid #999999",
+	"border-radius": "5px",
+	"text-align": "center",
+	"color": "#FFFFFF",
+	"float": "right",
+	"margin-right": "20px",
+	"background-color": "#4c6b87",
+	"cursor": "pointer"
+  },
+
+  "fileDesignerContentFileLineFileIconNode": {
+	"height": "80px",
+	"width": "80px",
+	"float": "left",
+	"background-repeat": "no-repeat",
+	"background-position": "center"
+  },
+  "fileDesignerContentFileLineFileNameNode": {
+	"margin-left": "85px",
+	"height": "40px",
+	"line-height": "20px",
+	"font-size": "14px",
+	"word-break": "break-all",
+	"color": "#666666"
+  },
+  "fileDesignerContentFileLineFileSizeNode": {
+	"margin-left": "85px",
+	"height": "40px",
+	"line-height": "20px",
+	"font-size": "14px",
+	"color": "#999999"
   }
 }

+ 12 - 1
o2web/source/x_component_cms_ColumnManager/$Main/startMenu.json

@@ -62,7 +62,18 @@
     "icon": "icon_jiao_ben.png",
     "selectedIcon": "icon_jiao_ben_click.png",
     "create" : true,
-    "createAction" : "createScriptConfig",
+    "createAction" : "createScriptConfig" ,
+    "expand": false,
+    "sub": []
+  },
+  {
+    "title": "资源文件",
+    "id": "fileConfig",
+    "action": "fileConfig",
+    "icon": "icon_jiao_ben.png",
+    "selectedIcon": "icon_jiao_ben_click.png",
+    "create" : true,
+    "createAction" : "createFileConfig",
     "expand": false,
     "sub": []
   },

+ 113 - 76
o2web/source/x_component_cms_ColumnManager/Main.js

@@ -5,26 +5,26 @@ MWF.xDesktop.requireApp("Selector", "package", null, false);
 MWF.require("MWF.xAction.org.express.RestActions", null,false);
 MWF.require("MWF.widget.O2Identity", null,false);
 MWF.xApplication.cms.ColumnManager.Main = new Class({
-	Extends: MWF.xApplication.Common.Main,
-	Implements: [Options, Events],
+    Extends: MWF.xApplication.Common.Main,
+    Implements: [Options, Events],
 
-	options: {
+    options: {
         "column": null,
         "application" : null,
-		"style": "default",
-		"name": "cms.ColumnManager",
-		"icon": "icon.png",
-		"width": "1100",
-		"height": "700",
-		"title": MWF.xApplication.cms.ColumnManager.LP.title,
+        "style": "default",
+        "name": "cms.ColumnManager",
+        "icon": "icon.png",
+        "width": "1100",
+        "height": "700",
+        "title": MWF.xApplication.cms.ColumnManager.LP.title,
         "currentCategoryId" : ""
-	},
-	onQueryLoad: function(){
+    },
+    onQueryLoad: function(){
         if(this.options.column)this.options.column.icon = this.options.column.appIcon;
         if(!this.options.application) this.options.application = this.options.column;
-		this.lp = MWF.xApplication.cms.ColumnManager.LP;
-		this.currentContentNode = null;
-	},
+        this.lp = MWF.xApplication.cms.ColumnManager.LP;
+        this.currentContentNode = null;
+    },
     loadApplication: function(callback){
 
         this.restActions = MWF.Actions.get("x_cms_assemble_control"); //new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
@@ -260,6 +260,11 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
             this.queryViewConfiguratorContent.destroy();
             this.queryViewConfiguratorContent = null;
         }
+        if (this.fileConfiguratorContent){
+            if (this.queryViewConfigurator) delete this.fileConfiguratorContent;
+            this.fileConfiguratorContent.destroy();
+            this.fileConfiguratorContent = null;
+        }
     },
 
     applicationProperty: function(){
@@ -290,24 +295,24 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
     loadCategoryConfig: function(){
         MWF.xDesktop.requireApp("cms.ColumnManager", "CategoryExplorer", function(){
             //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                var navi = this.menu.itemObject.categoryConfig;
-                var subNode = navi.retrieve( "subNode" );
-                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                this.categoryConfigurator = new MWF.xApplication.cms.ColumnManager.CategoryExplorer(this.categoryConfiguratorContent, subNode, this.restActions, {
-                    "currentCategoryId" : this.options.currentCategoryId,
-                    "onPostLoadCategoryList" : function(){
-                    }.bind(this),
-                    "onPostClickSub" : function(){
-                        this.menu.cancelCurrentNavi();
-                    }.bind(this)
-                });
-                this.categoryConfigurator.isActive = true;
-                this.categoryConfigurator.app = this;
-                //this.categoryConfigurator.categoryScrollWrapNode = this.menu.naviNode;
-                //this.categoryConfigurator.categoryScrollContentNode = this.menu.areaNode;
-                this.categoryConfigurator.load();
-                this.options.currentCategoryId = "";
-           //}.bind(this));
+            var navi = this.menu.itemObject.categoryConfig;
+            var subNode = navi.retrieve( "subNode" );
+            //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+            this.categoryConfigurator = new MWF.xApplication.cms.ColumnManager.CategoryExplorer(this.categoryConfiguratorContent, subNode, this.restActions, {
+                "currentCategoryId" : this.options.currentCategoryId,
+                "onPostLoadCategoryList" : function(){
+                }.bind(this),
+                "onPostClickSub" : function(){
+                    this.menu.cancelCurrentNavi();
+                }.bind(this)
+            });
+            this.categoryConfigurator.isActive = true;
+            this.categoryConfigurator.app = this;
+            //this.categoryConfigurator.categoryScrollWrapNode = this.menu.naviNode;
+            //this.categoryConfigurator.categoryScrollContentNode = this.menu.areaNode;
+            this.categoryConfigurator.load();
+            this.options.currentCategoryId = "";
+            //}.bind(this));
         }.bind(this));
     },
     createCategory : function(){
@@ -333,10 +338,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
     loadFormConfig: function(){
         MWF.xDesktop.requireApp("cms.ColumnManager", "FormExplorer", function(){
             //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                this.formConfigurator = new MWF.xApplication.cms.ColumnManager.FormExplorer(this.formConfiguratorContent, this.restActions, { "title" : "表单配置" });
-                this.formConfigurator.app = this;
-                this.formConfigurator.load();
+            //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+            this.formConfigurator = new MWF.xApplication.cms.ColumnManager.FormExplorer(this.formConfiguratorContent, this.restActions, { "title" : "表单配置" });
+            this.formConfigurator.app = this;
+            this.formConfigurator.load();
             //}.bind(this));
         }.bind(this));
     },
@@ -346,10 +351,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
         }else{
             MWF.xDesktop.requireApp("cms.ColumnManager", "FormExplorer", function(){
                 //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                    //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                    this.formConfigurator = new MWF.xApplication.cms.ColumnManager.FormExplorer(this.formConfiguratorContent, this.restActions);
-                    this.formConfigurator.app = this;
-                    this.formConfigurator._createElement();
+                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+                this.formConfigurator = new MWF.xApplication.cms.ColumnManager.FormExplorer(this.formConfiguratorContent, this.restActions);
+                this.formConfigurator.app = this;
+                this.formConfigurator._createElement();
                 //}.bind(this));
             }.bind(this));
         }
@@ -365,10 +370,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
     loadDataConfig: function(){
         MWF.xDesktop.requireApp("cms.ColumnManager", "DictionaryExplorer", function(){
             //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                this.dataConfigurator = new MWF.xApplication.cms.ColumnManager.DictionaryExplorer(this.dataConfiguratorContent, this.restActions, { "title" : "数据配置" });
-                this.dataConfigurator.app = this;
-                this.dataConfigurator.load();
+            //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+            this.dataConfigurator = new MWF.xApplication.cms.ColumnManager.DictionaryExplorer(this.dataConfiguratorContent, this.restActions, { "title" : "数据配置" });
+            this.dataConfigurator.app = this;
+            this.dataConfigurator.load();
             //}.bind(this));
         }.bind(this));
     },
@@ -378,10 +383,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
         }else{
             MWF.xDesktop.requireApp("cms.ColumnManager", "DictionaryExplorer", function(){
                 //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                    //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                    this.dataConfigurator = new MWF.xApplication.cms.ColumnManager.DictionaryExplorer(this.dataConfiguratorContent, this.restActions);
-                    this.dataConfigurator.app = this;
-                    this.dataConfigurator._createElement();
+                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+                this.dataConfigurator = new MWF.xApplication.cms.ColumnManager.DictionaryExplorer(this.dataConfiguratorContent, this.restActions);
+                this.dataConfigurator.app = this;
+                this.dataConfigurator._createElement();
                 //}.bind(this));
             }.bind(this));
         }
@@ -397,10 +402,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
     loadScriptConfig: function(){
         MWF.xDesktop.requireApp("cms.ColumnManager", "ScriptExplorer", function(){
             //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                this.scriptConfigurator = new MWF.xApplication.cms.ColumnManager.ScriptExplorer(this.scriptConfiguratorContent, this.restActions, { "title" : "脚本配置" });
-                this.scriptConfigurator.app = this;
-                this.scriptConfigurator.load();
+            //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+            this.scriptConfigurator = new MWF.xApplication.cms.ColumnManager.ScriptExplorer(this.scriptConfiguratorContent, this.restActions, { "title" : "脚本配置" });
+            this.scriptConfigurator.app = this;
+            this.scriptConfigurator.load();
             //}.bind(this));
         }.bind(this));
     },
@@ -410,10 +415,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
         }else{
             MWF.xDesktop.requireApp("cms.ColumnManager", "ScriptExplorer", function(){
                 //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                    //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                    this.scriptConfigurator = new MWF.xApplication.cms.ColumnManager.ScriptExplorer(this.scriptConfiguratorContent, this.restActions);
-                    this.scriptConfigurator.app = this;
-                    this.scriptConfigurator._createElement();
+                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+                this.scriptConfigurator = new MWF.xApplication.cms.ColumnManager.ScriptExplorer(this.scriptConfiguratorContent, this.restActions);
+                this.scriptConfigurator.app = this;
+                this.scriptConfigurator._createElement();
                 //}.bind(this));
             }.bind(this));
         }
@@ -429,10 +434,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
     loadViewConfig: function(){
         MWF.xDesktop.requireApp("cms.ColumnManager", "ViewExplorer", function(){
             //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                this.viewConfigurator = new MWF.xApplication.cms.ColumnManager.ViewExplorer(this.viewConfiguratorContent, this.restActions, { "title" : "列表配置" });
-                this.viewConfigurator.app = this;
-                this.viewConfigurator.load();
+            //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+            this.viewConfigurator = new MWF.xApplication.cms.ColumnManager.ViewExplorer(this.viewConfiguratorContent, this.restActions, { "title" : "列表配置" });
+            this.viewConfigurator.app = this;
+            this.viewConfigurator.load();
             //}.bind(this));
         }.bind(this));
     },
@@ -442,10 +447,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
         }else{
             MWF.xDesktop.requireApp("cms.ColumnManager", "ViewExplorer", function(){
                 //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                    //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                    this.viewConfigurator = new MWF.xApplication.cms.ColumnManager.ViewExplorer(this.viewConfiguratorContent, this.restActions);
-                    this.viewConfigurator.app = this;
-                    this.viewConfigurator._createElement();
+                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+                this.viewConfigurator = new MWF.xApplication.cms.ColumnManager.ViewExplorer(this.viewConfiguratorContent, this.restActions);
+                this.viewConfigurator.app = this;
+                this.viewConfigurator._createElement();
                 //}.bind(this));
             }.bind(this));
         }
@@ -461,10 +466,10 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
     loadQueryViewConfig: function(){
         MWF.xDesktop.requireApp("cms.ColumnManager", "QueryViewExplorer", function(){
             //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                this.queryViewConfigurator = new MWF.xApplication.cms.ColumnManager.QueryViewExplorer(this.queryViewConfiguratorContent, this.restActions, { "title" : "数据视图配置" });
-                this.queryViewConfigurator.app = this;
-                this.queryViewConfigurator.load();
+            //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+            this.queryViewConfigurator = new MWF.xApplication.cms.ColumnManager.QueryViewExplorer(this.queryViewConfiguratorContent, this.restActions, { "title" : "数据视图配置" });
+            this.queryViewConfigurator.app = this;
+            this.queryViewConfigurator.load();
             //}.bind(this));
         }.bind(this));
     },
@@ -474,11 +479,43 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
         }else{
             MWF.xDesktop.requireApp("cms.ColumnManager", "QueryViewExplorer", function(){
                 //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
-                    //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
-                    this.queryViewConfigurator = new MWF.xApplication.cms.ColumnManager.QueryViewExplorer(this.queryViewConfiguratorContent, this.restActions);
-                    this.queryViewConfigurator.app = this;
-                    this.queryViewConfigurator._createElement();
-               // }.bind(this));
+                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+                this.queryViewConfigurator = new MWF.xApplication.cms.ColumnManager.QueryViewExplorer(this.queryViewConfiguratorContent, this.restActions);
+                this.queryViewConfigurator.app = this;
+                this.queryViewConfigurator._createElement();
+                // }.bind(this));
+            }.bind(this));
+        }
+    },
+
+    fileConfig: function(){
+        this.clearContent();
+        this.fileConfiguratorContent = new Element("div", {
+            "styles": this.css.rightContentNode
+        }).inject(this.node);
+        this.loadFileConfig();
+    },
+    loadFileConfig: function(){
+        MWF.xDesktop.requireApp("cms.ColumnManager", "FileExplorer", function(){
+            //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
+            //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+            this.fileConfigurator = new MWF.xApplication.cms.ColumnManager.FileExplorer(this.fileConfiguratorContent, this.restActions, { "title" : "附件配置" });
+            this.fileConfigurator.app = this;
+            this.fileConfigurator.load();
+            //}.bind(this));
+        }.bind(this));
+    },
+    createFileConfig : function(){
+        if( this.fileConfigurator ){
+            this.fileConfigurator._createElement();
+        }else{
+            MWF.xDesktop.requireApp("cms.ColumnManager", "QueryViewExplorer", function(){
+                //MWF.xDesktop.requireApp("cms.ColumnManager", "Actions.RestActions", function(){
+                //if (!this.restActions) this.restActions = new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
+                this.fileConfigurator = new MWF.xApplication.cms.ColumnManager.FileViewExplorer(this.fileConfiguratorContent, this.restActions);
+                this.fileConfigurator.app = this;
+                this.fileConfigurator._createElement();
+                // }.bind(this));
             }.bind(this));
         }
     },
@@ -533,7 +570,7 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
         };
     }
 
-//	onResize: function(){
+//onResize: function() {
 //		if (this.menu) this.menu.onResize();
 //	}
 });
@@ -943,8 +980,8 @@ MWF.xApplication.cms.ColumnManager.ApplicationProperty = new Class({
         html += "<tr><td class='formTitle'>"+this.app.lp.application.documentType+"</td><td id='formApplicationType' class='formValue'>"+(this.data.documentType || "信息" )+"</td></tr>";
         html += "<tr><td class='formTitle'>"+this.app.lp.application.description+"</td><td id='formApplicationDescription'></td></tr>";
         html += "<tr><td class='formTitle'>"+this.app.lp.application.sort+"</td><td id='formApplicationSort'></td></tr>";
-       // html += "<tr><td class='formTitle'>"+this.app.lp.application.type+"</td><td id='formApplicationType'></td></tr>";
-   //     html += "<tr><td class='formTitle'>"+this.app.lp.application.icon+"</td><td id='formApplicationIcon'></td></tr>";
+        // html += "<tr><td class='formTitle'>"+this.app.lp.application.type+"</td><td id='formApplicationType'></td></tr>";
+        //     html += "<tr><td class='formTitle'>"+this.app.lp.application.icon+"</td><td id='formApplicationIcon'></td></tr>";
         html += "</table>";
         this.propertyContentNode.set("html", html);
         this.propertyContentNode.getElements("td.formTitle").setStyles(this.app.css.propertyBaseContentTdTitle);

+ 23 - 1
o2web/source/x_component_cms_ColumnManager/lp/zh-cn.js

@@ -20,6 +20,7 @@ MWF.xApplication.cms.ColumnManager.LP = {
 
     "setting" : "设置",
 
+    "ok": "确定",
     "edit": "编辑",
     "save": "保存",
     "cancel": "取消",
@@ -178,5 +179,26 @@ MWF.xApplication.cms.ColumnManager.LP = {
         "loaded": "数据视图加载完毕",
         "deleteFormTitle": "删除数据视图确认",
         "deleteForm": "是否确定要删除当前数据视图?"
-    }
+    },
+    "file": {
+        "create": "新建附件",
+        "search": "搜索附件",
+        "searchText": "请输入关键字",
+        "description": "附件信息",
+
+        "noScriptNoticeText": "此应用现在还没有附件,您可以点击此处创建一个新附件",
+        "loaded": "附件加载完毕",
+        "deleteFormTitle": "删除附件确认",
+        "deleteForm": "是否确定要删除当前附件?",
+        "saveSuccess": "附件已保存!",
+        "saveConfirm": "保存确认",
+        "saveConfirmText": "附件已被修改,您是否要保存修改的内容?",
+        "uploadSuccess": "附件已上传",
+        "loadFiles": "批量上传附件"
+    },
+
+    "name": "名称",
+    "alias": "别名",
+    "attachment": "附件",
+    "upload": "上传附件"
 };

+ 0 - 72
o2web/source/x_component_cms_ColumnManager/lp/zh-cn.js.bak

@@ -1,72 +0,0 @@
-MWF.xApplication.cms.ColumnManager.LP = {
-	"title": "栏目管理",
-	"categoryTitle": "分类管理",
-	"description": "描述",
-    "deleteItems": "删除选中的内容",
-
-    "edit": "编辑",
-    "save": "保存",
-    "cancel": "取消",
-
-    "phone": "手机",
-    "mail": "邮件",
-
-    "deleteElementTitle": "删除设计确认",
-    "deleteElement": "是否确定要删除选中的设计元素?",
-
-	"process": {
-        "create": "新建流程",
-        "search": "搜索流程",
-        "searchText": "请输入关键字",
-
-		"noProcessNoticeText": "此应用现在还没有流程,您可以点击此处创建一个新流程",
-		"loaded": "流程加载完毕",
-		
-		"deleteProcessTitle": "删除流程确认",
-		"deleteProcess": "是否确定要删除当前流程?"
-		
-	},
-	"form": {
-        "create": "新建表单",
-        "search": "搜索表单",
-        "searchText": "请输入关键字",
-
-		"noFormNoticeText": "此应用现在还没有表单,您可以点击此处创建一个新表单",
-		"loaded": "表单加载完毕",
-		"deleteFormTitle": "删除表单确认",
-		"deleteForm": "是否确定要删除当前表单?"
-		
-	},
-    "dictionary": {
-        "create": "新建数据字典",
-        "search": "搜索数据字典",
-        "searchText": "请输入关键字",
-
-        "noDictionaryNoticeText": "此应用现在还没有数据字典,您可以点击此处创建一个新数据字典",
-        "noDictionaryNoCreateNoticeText": "此应用现在没有数据字典",
-        "loaded": "数据字典加载完毕",
-        "deleteFormTitle": "删除数据字典确认",
-        "deleteForm": "是否确定要删除当前数据字典?"
-    },
-    "script": {
-        "create": "新建脚本",
-        "search": "搜索脚本",
-        "searchText": "请输入关键字",
-
-        "noScriptNoticeText": "此应用现在还没有脚本,您可以点击此处创建一个新脚本",
-        "loaded": "脚本加载完毕",
-        "deleteFormTitle": "删除脚本确认",
-        "deleteForm": "是否确定要删除当前脚本?"
-    },
-    "application": {
-        "inputApplicationName": "请输入应用名称",
-        "property": "应用属性",
-        "name": "应用名称",
-        "alias": "应用别名",
-        "description": "应用描述",
-        "type": "应用类型",
-        "icon": "应用图标",
-        "controllerList": "管理者",
-        "available": "可用范围"
-    }
-};

+ 1 - 1
o2web/source/x_component_cms_ColumnManager/widget/PermissionSetting.js

@@ -33,7 +33,7 @@ MWF.xApplication.cms.ColumnManager.PermissionSetting = new Class({
         }.bind(this));
     },
     createNode: function(){
-        if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
+        //if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
 
         this.titleNode = new Element("div.availableTitleNode", {
             "styles": this.app.css.availableTitleNode,

+ 5 - 2
o2web/source/x_component_cms_FormDesigner/$Main/bottom/formToolbars.html

@@ -8,8 +8,11 @@
 	<span MWFnodetype="MWFToolBarSeparator"></span>
 	
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formExplode.gif" title="表单导出" MWFButtonAction="formExplode" MWFButtonText=""></span>
-	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formImplode.gif" title="表单导入" MWFButtonAction="formImplode" MWFButtonText=""></span>
-
+	<span MWFnodetype="MWFToolBarMenu" MWFButtonImage="formImplode.gif" title="表单导入" MWFButtonText="">
+		<span MWFnodetype="MWFToolBarMenuItem" MWFButtonImage="o216.png" title="导入O2格式表单" MWFButtonAction="formImplode" MWFButtonText="从O2数据导入"></span>
+		<span MWFnodetype="MWFToolBarMenuItem" MWFButtonImage="html.png" title="从HTML导入" MWFButtonAction="htmlImplode" MWFButtonText="从HTML导入"></span>
+		<span MWFnodetype="MWFToolBarMenuItem" MWFButtonImage="word.png" title="从WORD或EXCEL导入" MWFButtonAction="officeImplode" MWFButtonText="从WORD或EXCEL导入"></span>
+	</span>
     <span MWFnodetype="MWFToolBarSeparator"></span>
 	
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="help.png" title="帮助" MWFButtonAction="formHelp" MWFButtonText=""></span>

+ 5 - 1
o2web/source/x_component_cms_FormDesigner/$Main/bottom/tools.json

@@ -140,7 +140,11 @@
     "text": "HTML",
     "className": "Html"
   },
-
+  "common": {
+    "icon": "common.png",
+    "text": "通用元素",
+    "className": "Common"
+  },
   "tab": {
     "icon": "tabs.png",
     "text": "分页",

+ 19 - 2
o2web/source/x_component_cms_FormDesigner/$Main/default/css.wcss

@@ -8,7 +8,7 @@
 	//	"background-color": "#cfebaa"
 	},
 	"propertyNode": {
-		"width": "340px",
+		"width": "360px",
 		"overflow": "hidden",
 		"float": "right",
 		"-webkit-user-select": "text",
@@ -16,7 +16,7 @@
 	},
 	"formNode": {
 		"margin-left": "141px",
-		"margin-right": "301px",
+		"margin-right": "361px",
 		"border-right": "1px solid #505050",
 		"border-left": "1px solid #505050",
 		"background-color": "#FFF",
@@ -358,5 +358,22 @@
         "box-shadow": "0px 0px 0px #666",
         "border": "1px solid #999",
         "background": "url("+"/x_component_process_FormDesigner/$Main/default/editCancel_bg.png) no-repeat"
+    },
+
+    "designTabScriptAreaNode": {
+        "height": "100%"
+    },
+    "designTabScriptPcAreaNode": {
+        "height": "100%"
+    },
+    "designTabScriptMobileAreaNode": {
+        "height": "100%",
+        "display": "none"
+    },
+    "scriptPageDragNode": {
+        "opacity": 0.7,
+        "border": "2px dashed #999",
+        "background-color": "#CCC",
+        "position": "absolute"
     }
 }

+ 9 - 3
o2web/source/x_component_cms_FormDesigner/$Main/default/formToolbars.html

@@ -6,10 +6,16 @@
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="print.gif" title="打印" MWFButtonAction="printForm" MWFButtonText=""></span>
 	
 	<span MWFnodetype="MWFToolBarSeparator"></span>
-	
-	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formExplode.gif" title="表单导出" MWFButtonAction="formExplode" MWFButtonText=""></span>
-	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formImplode.gif" title="表单导入" MWFButtonAction="formImplode" MWFButtonText=""></span>
 
+	<span MWFnodetype="MWFToolBarOnOffButton" MWFButtonImage="brush.png" title="格式刷" MWFButtonAction="styleBrush" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarSeparator"></span>
+
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formExplode.gif" title="表单导出" MWFButtonAction="formExplode" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarMenu" MWFButtonImage="formImplode.gif" title="表单导入" MWFButtonText="">
+		<span MWFnodetype="MWFToolBarMenuItem" MWFButtonImage="o216.png" title="导入O2格式表单" MWFButtonAction="formImplode" MWFButtonText="从O2数据导入"></span>
+		<span MWFnodetype="MWFToolBarMenuItem" MWFButtonImage="html.png" title="从HTML导入" MWFButtonAction="htmlImplode" MWFButtonText="从HTML导入"></span>
+		<span MWFnodetype="MWFToolBarMenuItem" MWFButtonImage="word.png" title="从WORD或EXCEL导入" MWFButtonAction="officeImplode" MWFButtonText="从WORD或EXCEL导入"></span>
+	</span>
     <span MWFnodetype="MWFToolBarSeparator"></span>
 	
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="help.png" title="帮助" MWFButtonAction="formHelp" MWFButtonText=""></span>

+ 5 - 1
o2web/source/x_component_cms_FormDesigner/$Main/default/tools.json

@@ -141,7 +141,11 @@
     "text": "HTML",
     "className": "Html"
   },
-
+  "common": {
+    "icon": "common.png",
+    "text": "通用元素",
+    "className": "Common"
+  },
   "tab": {
     "icon": "tabs.png",
     "text": "分页",

+ 305 - 6
o2web/source/x_component_cms_FormDesigner/Main.js

@@ -95,8 +95,11 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
                 if (this.form.currentSelectedModule) {
                     var module = this.form.currentSelectedModule;
                     if (module.moduleType != "form" && module.moduleName.indexOf("$") == -1) {
+
+                        this.form.fireEvent("queryGetFormData", [module.node]);
                         var html = module.getHtml();
                         var json = module.getJson();
+                        this.form.fireEvent("postGetFormData", [module.node]);
 
                         MWF.clipboard.data = {
                             "type": "form",
@@ -387,8 +390,13 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
         }
         this.form.unSelectedMulti();
 
+        if (this.form.designTabPageScriptAreaNode) this.form.designTabPageScriptAreaNode.hide();
         this.form = this.pcForm;
 
+        if ((this.scriptPage && this.scriptPage.isShow) || this.scriptPanel){
+            this.loadAllScript();
+        }
+
         this.currentDesignerMode = "PC";
     },
 
@@ -414,11 +422,19 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
 
         if (!this.mobileForm){
             this.mobileForm = new MWF.CMSFCForm(this, this.designMobileNode, {"mode": "Mobile"});
+            if (!Object.keys(this.formMobileData.json.moduleList).length){
+                this.formMobileData = Object.clone(this.formData);
+            }
             this.mobileForm.load(this.formMobileData);
         }
 
+        if (this.form.designTabPageScriptAreaNode) this.form.designTabPageScriptAreaNode.hide();
         this.form = this.mobileForm;
 
+        if ((this.scriptPage && this.scriptPage.isShow) || this.scriptPanel){
+            this.loadAllScript();
+        }
+
         this.currentDesignerMode = "Mobile";
     },
 
@@ -478,9 +494,15 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
         //         this.designNode.setStyle("margin", "0px");
         //         this.designNode.setStyles(this.css.designNode);
 
+        MWF.require("MWF.widget.Tab", null, false);
+        this.designTabNode = new Element("div").inject(this.formContentNode);
+        this.designTab = new MWF.widget.Tab(this.designTabNode, {"style": "design"});
+        this.designTab.load();
+        this.designTabPageAreaNode = Element("div");
+
         this.designNode = new Element("div", {
             "styles": this.css.designNode
-        }).inject(this.formContentNode);
+        }).inject(this.designTabPageAreaNode);
         //this.designContentNode = new Element("div", {
         //    "styles": {"overflow": "visible"}
         //}).inject(this.designNode);
@@ -492,14 +514,170 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
 
         this.designMobileNode = new Element("div", {
             "styles": this.css.designMobileNode
-        }).inject(this.formContentNode);
+        }).inject(this.designTabPageAreaNode);
 
         //MWF.require("MWF.widget.ScrollBar", function(){
         //    new MWF.widget.ScrollBar(this.designMobileNode, {"distance": 50, "style": "xApp_mobileForm"});
         //}.bind(this));
         //    }.bind(this), 2000);
 
+       this.designTabScriptAreaNode = Element("div", {"styles": this.css.designTabScriptAreaNode});
+
+        this.designPage = this.designTab.addTab(this.designTabPageAreaNode, this.lp.design);
+        this.scriptPage = this.designTab.addTab(this.designTabScriptAreaNode, this.lp.script);
+
+        this.setScriptPageEvent();
 
+        this.designPage.showTabIm();
+        this.scriptPage.addEvent("postShow", function(){
+            this.checkLoadAllScript();
+            this.fireEvent("resize");
+        }.bind(this));
+        this.designPage.addEvent("postShow", function(){
+            this.fireEvent("resize");
+        }.bind(this));
+    },
+     createScriptPanel: function(p, s){
+        MWF.require("MWF.widget.Panel", function(){
+            this.scriptPanel = new MWF.widget.Panel(this.designTabScriptAreaNode, {
+                "title": this.lp.script,
+                "minLeft": "500",
+                "minTop": "1",
+                "style": "page",
+                "target": this.content,
+                "limitMove": false,
+                "isClose": false,
+                "width": s.x,
+                "height": s.y,
+                "top": p.y,
+                "left": p.x,
+                "onPostLoad": function(){
+                    this.loadAllScript();
+                    this.fireEvent("resize");
+                }.bind(this),
+                "onResize": function(){
+                    this.fireEvent("resize");
+                }.bind(this),
+                "onDrag": function(el, e){
+                    if (el.getStyle("top").toInt()<0) el.setStyle("top", "0px");
+                    if (!this.scriptPage.tab.tabNodeContainer.isOutside(e)){
+                        this.scriptPage.tabNode.show();
+                        this.scriptPanel.container.setStyle("opacity", "0.5");
+                    }else{
+                        this.scriptPage.tabNode.hide();
+                        this.scriptPanel.container.setStyle("opacity", "1");
+                    }
+                }.bind(this),
+                "onCompleteMove": function(el, e){
+                    if (!this.scriptPage.tab.tabNodeContainer.isOutside(e)){
+                        this.scriptPage.tabNode.show();
+
+                        this.designTabScriptAreaNode.inject(this.designTab.contentNodeContainer.getLast());
+                        this.fireEvent("resize");
+                        this.scriptPage.showTabIm();
+
+                        this.scriptPanel.closePanel();
+                        this.scriptPanel = null;
+                    }
+                }.bind(this)
+            });
+            this.scriptPanel.load();
+        }.bind(this));
+    },
+    createScriptPageDragNode: function(e){
+        var size = this.scriptPage.tab.contentNodeContainer.getSize();
+        var position = this.scriptPage.tab.contentNodeContainer.getPosition(this.content);
+        if (!this.scriptPageContentDrag){
+            var dragNode = new Element("div", {"styles": this.css.scriptPageDragNode}).inject(this.content);
+
+            this.scriptPageContentDrag = new Drag.Move(dragNode, {
+                "droppables": [this.scriptPage.tab.tabNodeContainer],
+                "onEnter": function(el, drop){
+                    this.scriptPage.tabNode.show();
+                    this.designTabScriptAreaNode.show();
+
+                    // this.scriptPageContentDrag.stop();
+                    // this.scriptPageContentDrag.detach();
+                    this.scriptPageContentDrag = null;
+                    dragNode.destroy();
+
+                    this.scriptPageDrag.start(e);
+                }.bind(this),
+                "onComplete": function(el, e){
+                    if (this.scriptPage.tab.tabNodeContainer.isOutside(e)){
+                        this.createScriptPanel(dragNode.getPosition(this.content), dragNode.getSize());
+                        this.designPage.showTabIm();
+                    }
+                    this.scriptPageContentDrag = null;
+                    if (dragNode) dragNode.destroy();
+                    this.designTabScriptAreaNode.show();
+                }.bind(this)
+
+            });
+        }
+
+        var tabPosition = this.scriptPage.tabNode.getPosition();
+        var dx = e.page.x-tabPosition.x;
+        var dy = e.page.y-tabPosition.y;
+
+        this.scriptPage.tabNode.hide();
+        this.designTabScriptAreaNode.hide();
+
+        var w = size.x*0.7;
+        var h = size.y*0.7;
+        var x = position.x+dx;
+        var y = position.y+dy-20;
+
+        dragNode.setStyles({
+            "width": ""+w+"px",
+            "height": ""+h+"px",
+            "top": ""+y+"px",
+            "left": ""+x+"px"
+        });
+        this.scriptPageContentDrag.start(e);
+
+    },
+    setScriptPageEvent: function(){
+        this.scriptPageDrag =  new Drag(this.scriptPage.tabNode, {
+            "snap": 20,
+            "onStart": function(el,e){
+                el.setStyle("position", "static");
+            },
+            "onDrag": function(el,e){
+                if (this.scriptPage.tab.tabNodeContainer.isOutside(e)){
+                    this.scriptPageDrag.stop();
+                    el.setStyle("left", "auto");
+                    this.createScriptPageDragNode(e);
+                }
+            }.bind(this),
+            "onComplete": function(el){
+                el.setStyle("left", "auto");
+                //el.setStyle("position", "relative");
+            }.bind(this)
+        });
+    },
+    checkLoadAllScript: function(){
+        if (this.form){
+            this.loadAllScript();
+        }else{
+            this.designPage.showTabIm();
+        }
+    },
+    loadAllScript: function(){
+        if (!this.form.designTabPageScriptAreaNode) this.form.designTabPageScriptAreaNode = Element("div", {"styles": this.css.designTabScriptPcAreaNode}).inject(this.designTabScriptAreaNode);
+        this.form.designTabPageScriptAreaNode.show();
+
+        if (!this.form.scriptDesigner){
+            MWF.xDesktop.requireApp("cms.FormDesigner", "Script", function(){
+                this.form.scriptDesigner = new MWF.xApplication.cms.FormDesigner.Script(this, this.form.designTabPageScriptAreaNode, this.form.json);
+                // var moduleJson = this.pageData.json;
+                // if (moduleJson.jsheader){
+                //     if (moduleJson.jsheader.code){
+                //
+                //     }
+                // }
+            }.bind(this));
+        }
     },
     reloadPropertyStyles: function(){
         //MWF.release(this.css);
@@ -868,10 +1046,17 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
         var y = nodeSize.y - allFormToolberSize.totalHeight - formToolbarMarginTop - formToolbarMarginBottom;
         this.formContentNode.setStyle("height", ""+y+"px");
 
+        var tabSize = this.designTab.tabNodeContainer.getComputedSize();
+        var tabMarginTop = this.designTab.tabNodeContainer.getStyle("margin-top").toFloat();
+        var tabMarginBottom = this.designTab.tabNodeContainer.getStyle("margin-bottom").toFloat();
+        y = y-tabSize.totalHeight-tabMarginTop-tabMarginBottom;
+        this.designTab.contentNodeContainer.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 - allFormToolberSize.totalHeight - formToolbarMarginTop - formToolbarMarginBottom - designMarginTop - designMarginBottom;
+            //y = nodeSize.y - allFormToolberSize.totalHeight - formToolbarMarginTop - formToolbarMarginBottom - designMarginTop - designMarginBottom;
+            y = y - designMarginTop - designMarginBottom;
             this.designNode.setStyle("height", ""+y+"px");
         }
 
@@ -915,10 +1100,17 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
         var y = designerHeight - allFormToolberSize.totalHeight - formToolbarMarginTop - formToolbarMarginBottom;
         //    this.formContentNode.setStyle("height", ""+designerHeight+"px");
 
+        var tabSize = this.designTab.tabNodeContainer.getComputedSize();
+        var tabMarginTop = this.designTab.tabNodeContainer.getStyle("margin-top").toFloat();
+        var tabMarginBottom = this.designTab.tabNodeContainer.getStyle("margin-bottom").toFloat();
+        y = y-tabSize.totalHeight-tabMarginTop-tabMarginBottom;
+        this.designTab.contentNodeContainer.setStyle("height", ""+y+"px");
+
         if (this.designNode){
             var designMarginTop = this.designNode.getStyle("margin-top").toFloat();
             var designMarginBottom = this.designNode.getStyle("margin-bottom").toFloat();
-            y = designerHeight - allFormToolberSize.totalHeight - formToolbarMarginTop - formToolbarMarginBottom - designMarginTop - designMarginBottom;
+            //y = designerHeight - allFormToolberSize.totalHeight - formToolbarMarginTop - formToolbarMarginBottom - designMarginTop - designMarginBottom;
+            y = y - designMarginTop - designMarginBottom;
             this.designNode.setStyle("height", ""+y+"px");
         }
 
@@ -1133,6 +1325,61 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
             }
         }.bind(this));
         return fieldList;
+    },
+       checkSubform: function(){
+        var pcSubforms = [];
+        if (this.pcForm){
+            this.pcForm.moduleList.each(function(module){
+                if (module.moduleName==="subform"){
+                    if (module.regetSubformData()){
+                        module.subformData.updateTime = "";
+                        var moduleNames = module.getConflictFields();
+                        if (moduleNames.length){
+                            var o = {
+                                "id": module.json.id,
+                                "fields": moduleNames
+                            };
+                            pcSubforms.push(o);
+                        }
+                    }
+
+                }
+            }.bind(this));
+        }
+        var mobileSubforms = [];
+        if (this.mobileForm){
+            this.mobileForm.moduleList.each(function(module){
+                if (module.moduleName==="subform"){
+                    if (module.regetSubformData()){
+                        module.subformData.updateTime = "";
+                        var moduleNames = module.getConflictFields();
+                        if (moduleNames.length){
+                            var o = {
+                                "id": module.json.id,
+                                "fields": moduleNames
+                            };
+                            mobileSubforms.push(o);
+                        }
+                    }
+                }
+            }.bind(this));
+        }
+        var txt = "";
+        if (pcSubforms.length){
+            var pctxt = "";
+            pcSubforms.each(function(subform){
+                pctxt += subform.id+" ( "+subform.fields.join(", ")+" ) <br>";
+            });
+            txt += this.lp.checkSubformPcInfor.replace("{subform}", pctxt);
+        }
+        if (mobileSubforms.length){
+            var mobiletxt = "";
+            mobileSubforms.each(function(subform){
+                mobiletxt += subform.id+" ( "+subform.fields.join(", ")+" ) <br>";
+            });
+            txt += this.lp.checkSubformMobileInfor.replace("{subform}", mobiletxt);
+        }
+        return txt;
     },
     saveForm: function(){
         if (!this.isSave){
@@ -1171,13 +1418,18 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
                 this.options.desktopReload = true;
                 this.options.id = this.pcForm.json.id;
 
-                this.isSave = false;
+                //this.fireAppEvent("postSave"); //add by cxy
+                if (this.pcForm) this.pcForm.fireEvent("postSave");
+                if (this.mobileForm) this.mobileForm.fireEvent("postSave");
 
-                this.fireAppEvent("postSave"); //add by cxy
+                this.isSave = false;
 
             }.bind(this), function(xhr, text, error){
                 this.isSave = false;
 
+                if (this.pcForm) this.pcForm.fireEvent("postSaveError");
+                if (this.mobileForm) this.mobileForm.fireEvent("postSaveError");
+
                 var errorText = error+":"+text;
                 if (xhr) errorText = xhr.responseText;
                 MWF.xDesktop.notice("error", {x: "right", y:"top"}, "request json error: "+errorText);
@@ -1201,6 +1453,15 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
     formExplode: function(){
         this.form.explode();
     },
+    formImplode: function(){
+        this.form.implode();
+    },
+    htmlImplode: function(){
+        this.form.implodeHTML();
+    },
+    officeImplode: function(){
+        this.form.implodeOffice();
+    },
     recordStatus: function(){
         return {"id": this.options.id};
     },
@@ -1370,5 +1631,43 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
         }else{
             MWF.xDesktop.notice("info", {x: "right", y:"top"}, this.lp.isSave);
         }
+    },
+    styleBrush: function(status, bt){
+        if (status==="on"){
+            var module = this.form.currentSelectedModule;
+            if (module && module.json.type!=="Form"){
+                this.form.brushStyle = module.json.styles;
+                this.brushCursor = new Element("div", {"styles": {
+                    "position": "absolute",
+                    "width": "16px",
+                    "height": "16px",
+                    "z-index": 20000,
+                    "background": "url("+this.path+this.options.style+"/pageToolbar/wand.png)"
+                }}).inject(this.content);
+                this.brushCursorMoveFun = this.brushCursorMove.bind(this);
+                this.content.addEvent("mousemove", this.brushCursorMoveFun);
+
+                //this.designNode.setStyle("cursor", "url(/"+this.path+this.options.style+"/pageToolbar/brush.png)");
+            }else{
+                bt.off();
+            }
+        }else{
+            this.form.brushStyle = null;
+            if (this.brushCursorMoveFun) this.content.removeEvent("mousemove", this.brushCursorMoveFun);
+            if (this.brushCursor){
+                this.brushCursor.destroy();
+                this.brushCursor = null;
+            }
+        }
+    },
+    brushCursorMove: function(e){
+        if (this.brushCursor){
+            var x = e.event.layerX+10;
+            var y = e.event.layerY+10;
+            this.brushCursor.setStyles({
+                "left": ""+x+"px",
+                "top": ""+y+"px"
+            });
+        }
     }
 });

+ 113 - 2
o2web/source/x_component_cms_FormDesigner/Module/Form.js

@@ -84,7 +84,7 @@ MWF.xApplication.cms.FormDesigner.Module.Form = MWF.CMSFCForm = new Class({
 			newTool.create(moduleData, e);
 		}.bind(this));
 	},
-	getTemplateData: function(className, callback){
+	getTemplateData: function(className, callback, async){
 		if (this.dataTemplate[className]){
 			if (callback) callback(this.dataTemplate[className]);
 		}else{
@@ -93,7 +93,7 @@ MWF.xApplication.cms.FormDesigner.Module.Form = MWF.CMSFCForm = new Class({
 			MWF.getJSON(templateUrl, function(responseJSON, responseText){
 				this.dataTemplate[className] = responseJSON;
 				if (callback) callback(responseJSON);
-			}.bind(this));
+			}.bind(this), async);
 		}
 	},
 	showProperty: function(){
@@ -124,6 +124,117 @@ MWF.xApplication.cms.FormDesigner.Module.Form = MWF.CMSFCForm = new Class({
 		//	//this.reload(responseJSON.data);
 		//}.bind(this));
 	},
+	implode: function(){
+        MWF.xDesktop.requireApp("cms.FormDesigner", "Import", function(){
+            MWF.CMSFormImport.create("O2", this);
+        }.bind(this));
+    },
+    implodeHTML: function(){
+        MWF.xDesktop.requireApp("cms.FormDesigner", "Import", function(){
+            MWF.CMSFormImport.create("html", this, {"type": "process"});
+        }.bind(this));
+    },
+    implodeOffice: function(){
+        MWF.xDesktop.requireApp("cms.FormDesigner", "Import", function(){
+            MWF.CMSFormImport.create("office", this);
+        }.bind(this));
+    },
+	setPropertiesOrStyles: function(name){
+		if (name=="styles"){
+			this.setCustomStyles();
+		}
+		if (name=="properties"){
+			this.node.setProperties(this.json.properties);
+		}
+	},
+	setCustomStyles: function(){
+		var border = this.node.getStyle("border");
+		this.node.clearStyles();
+		this.node.setStyles((this.options.mode==="Mobile") ? this.css.formMobileNode : this.css.formNode);
+        var y = this.container.getStyle("height");
+        y = (y) ? y.toInt()-2 : this.container.getSize().y-2;
+		this.node.setStyle("min-height", ""+y+"px");
+
+		if (this.initialStyles) this.node.setStyles(this.initialStyles);
+		this.node.setStyle("border", border);
+
+		Object.each(this.json.styles, function(value, key){
+			var reg = /^border\w*/ig;
+			if (!key.test(reg)){
+				this.node.setStyle(key, value);
+			}
+		}.bind(this));
+	},
+	_setEditStyle: function(name, obj, oldValue){
+		if (name=="name"){
+			var title = this.json.name || this.json.id;
+			this.treeNode.setText("<"+this.json.type+"> "+title+" ["+this.options.mode+"] ");
+		}
+		if (name=="id"){
+			if (!this.json.name) this.treeNode.setText("<"+this.json.type+"> "+this.json.id+" ["+this.options.mode+"] ");
+			this.treeNode.setTitle(this.json.id);
+			this.node.set("id", this.json.id);
+		}
+        if (name=="formStyleType"){
+            this.templateStyles = (this.stylesList && this.json.formStyleType) ? this.stylesList[this.json.formStyleType] : null;
+            if (oldValue) {
+                var oldTemplateStyles = this.stylesList[oldValue];
+                if (oldTemplateStyles){
+                    if (oldTemplateStyles["form"]) this.clearTemplateStyles(oldTemplateStyles["form"]);
+                }
+            }
+            if (this.templateStyles){
+                if (this.templateStyles["form"]) this.setTemplateStyles(this.templateStyles["form"]);
+            }
+            this.setAllStyles();
+
+            this.moduleList.each(function(module){
+                if (oldTemplateStyles){
+                    module.clearTemplateStyles(oldTemplateStyles[module.moduleName]);
+                }
+                module.setStyleTemplate();
+                module.setAllStyles();
+            }.bind(this));
+        }
+        if (name==="css"){
+            this.reloadCss();
+        }
+		this._setEditStyle_custom(name, obj, oldValue);
+	},
+
+    parseCSS: function(css){
+        var rex = /(url\(.*\))/g;
+        var match;
+        while ((match = rex.exec(css)) !== null) {
+            var pic = match[0];
+            var len = pic.length;
+            var s = pic.substring(pic.length-2, pic.length-1);
+            var n0 = (s==="'" || s==="\"") ? 5 : 4;
+            var n1 = (s==="'" || s==="\"") ? 2 : 1;
+            pic = pic.substring(n0, pic.length-n1);
+
+            if ((pic.indexOf("x_processplatform_assemble_surface")!=-1 || pic.indexOf("x_portal_assemble_surface")!=-1)){
+                var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+                var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+                if (pic.indexOf("/x_processplatform_assemble_surface")!==-1){
+                    pic = pic.replace("/x_processplatform_assemble_surface", pic+"/x_processplatform_assemble_surface");
+                }else if (pic.indexOf("x_processplatform_assemble_surface")!==-1){
+                    pic = pic.replace("x_processplatform_assemble_surface", pic+"/x_processplatform_assemble_surface");
+                }
+                if (pic.indexOf("/x_portal_assemble_surface")!==-1){
+                    pic = pic.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }else if (pic.indexOf("x_portal_assemble_surface")!==-1){
+                    pic = pic.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }
+            }
+            pic = "url('"+pic+"')";
+            var len2 = pic.length;
+
+            css = css.substring(0, match.index) + pic + css.substring(rex.lastIndex, css.length);
+            rex.lastIndex = rex.lastIndex + (len2-len);
+        }
+        return css;
+    },
 	preview: function(){
 
 		MWF.xDesktop.requireApp("cms.FormDesigner", "Preview", function(){

+ 1 - 1
o2web/source/x_component_cms_FormDesigner/Module/Form/form.html

@@ -36,7 +36,7 @@
                 </td>
             </tr>
         </table>
-		
+
 		<!--<div class="MWFArraylist" name="cssLinks" title="CSS引用"></div>-->
 		<!--<div class="MWFArraylist" name="scriptSrc" title="JS引用"></div>-->
 		

+ 3 - 4
o2web/source/x_component_cms_FormDesigner/Module/Form/template/form_publish_edit.json

@@ -1360,8 +1360,7 @@
             "height": "200",
             "width": "",
             "readOnly": false,
-            "title": "",
-            "skin": "bootstrapck"
+            "title": ""
           },
           "config": {
             "code": "",
@@ -3705,8 +3704,8 @@
             "height": "200",
             "width": "",
             "readOnly": false,
-            "title": "",
-            "skin": "bootstrapck"
+            "title": ""
+            //"skin": "bootstrapck"
           },
           "config": {
             "code": "",

+ 3 - 4
o2web/source/x_component_cms_FormDesigner/Module/Form/template/form_publish_read.json

@@ -898,8 +898,7 @@
             "height": "200",
             "width": "",
             "readOnly": false,
-            "title": "",
-            "skin": "bootstrapck"
+            "title": ""
           },
           "config": {
             "code": "",
@@ -2261,8 +2260,8 @@
             "height": "200",
             "width": "",
             "readOnly": false,
-            "title": "",
-            "skin": "bootstrapck"
+            "title": ""//,
+            //"skin": "bootstrapck"
           },
           "config": {
             "code": "",

+ 39 - 1
o2web/source/x_component_cms_FormDesigner/Module/Htmleditor.js

@@ -2,5 +2,43 @@ MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Mod
 MWF.xDesktop.requireApp("process.FormDesigner", "Module.Htmleditor", null, false);
 MWF.xApplication.cms.FormDesigner.Module.Htmleditor = MWF.CMSFCHtmleditor = new Class({
 	Extends: MWF.FCHtmleditor,
-	Implements : [MWF.CMSFCMI]
+	Implements : [MWF.CMSFCMI],
+	loadCkeditor: function(config){
+		COMMON.AjaxModule.load("ckeditor", function(){
+			CKEDITOR.disableAutoInline = true;
+			var editorDiv = new Element("div").inject(this.node);
+			if (this.json.templateCode) editorDiv.set("html", this.json.templateCode);
+
+			var height = this.node.getSize().y;
+			var editorConfig = config || {};
+			if (this.form.options.mode=="Mobile"){
+				//    if (!editorConfig.toolbar && !editorConfig.toolbarGroups){
+				editorConfig.toolbar = [
+					//{ name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
+					//{ name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
+					//{ name: 'links' },
+					//{ name: 'insert' },
+					//{ name: 'forms' },
+					//{ name: 'tools' },
+					//{ name: 'document',    groups: [ 'mode', 'document', 'doctools' ] },
+					//{ name: 'others' },
+					//'/',
+					{ name: 'paragraph',   items: [ 'Bold', 'Italic', "-" , 'TextColor', "BGColor", 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', "-", 'Undo', 'Redo' ] },
+					{ name: 'basicstyles', items: [ 'Styles', 'FontSize']}
+					//{ name: 'colors' },
+					//{ name: 'about' }
+				];
+				//    }
+			}
+
+
+			//  CKEDITOR.basePath = COMMON.contentPath+"/res/framework/htmleditor/ckeditor/";
+			if( editorConfig.skin )editorConfig.skin = "moono-lisa";
+			this.editor = CKEDITOR.replace(editorDiv, editorConfig);
+
+			this.editor.on("dataReady", function(){
+				this.editor.setReadOnly(true);
+			}, this);
+		}.bind(this));
+	}
 });

+ 1 - 0
o2web/source/x_component_cms_FormDesigner/Module/Package.js

@@ -33,6 +33,7 @@ MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Tab", null, false);
 MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Tree", null, false);
 MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Iframe", null, false);
 MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Htmleditor", null, false);
+MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Common", null, false);
 MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Office", null, false);
 MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Attachment", null, false);
 MWF.xDesktop.requireApp("cms.FormDesigner", "Module.Log", null, false);

+ 40 - 16
o2web/source/x_component_cms_Index/Starter.js

@@ -83,7 +83,7 @@ MWF.xApplication.cms.Index.Starter = new Class({
 
             this.areaNode.inject(this.markNode, "after");
             this.areaNode.fade("in");
-            $("form_startSubject").focus();
+            if($("form_startSubject"))$("form_startSubject").focus();
 
             this.setStartNodeSize();
             this.setStartNodeSizeFun = this.setStartNodeSize.bind(this);
@@ -170,6 +170,22 @@ MWF.xApplication.cms.Index.Starter = new Class({
             this.okStart(e);
         }.bind(this));
     },
+    getIdentities: function(){
+        var identities = [];
+        MWF.Actions.get("x_organization_assemble_personal").getPerson(function(json){
+            var identities1 = (json.data && json.data.woIdentityList) ? json.data.woIdentityList : [];
+            identities1.each( function(i){
+                if( this.options.identity ){
+                    if( this.options.identity == i.distinguishedName ){
+                        if( i.distinguishedName )identities.push(i);
+                    }
+                }else{
+                    if( i.distinguishedName )identities.push(i);
+                }
+            }.bind(this));
+        }.bind(this), null, false );
+        return identities;
+    },
     setStartFormContent: function(){
         this.dateArea = this.formNode.getElementById("form_startDate");
         var d = new Date();
@@ -194,7 +210,7 @@ MWF.xApplication.cms.Index.Starter = new Class({
         return this.categoryData && this.categoryData.documentType != "信息"
     },
     checkSubject: function(){
-        if( this.categoryData ){
+        if( this.categoryData &&  this.subjectInput ){
             if( this.isIgnoreTitle() ){
                 this.subjectInput.getParent("tr").setStyle("display","none");
             }else{
@@ -266,7 +282,7 @@ MWF.xApplication.cms.Index.Starter = new Class({
     },
     cancelStart: function(e){
         var _self = this;
-        if ($("form_startSubject").get("value")){
+        if ($("form_startSubject") && $("form_startSubject").get("value")){
             this.app.confirm("warn", e, this.lp.start_cancel_title, this.lp.start_cancel, "320px", "100px", function(){
                 _self.markNode.destroy();
                 _self.areaNode.destroy();
@@ -287,13 +303,14 @@ MWF.xApplication.cms.Index.Starter = new Class({
         }
     },
     _createDocument: function(e){
-        var title = $("form_startSubject").get("value")|| "";
+        var subjectObj = $("form_startSubject");
+        var title = subjectObj ? subjectObj.get("value") : "";
         this.getDocumentAction();
         var data = {
             "id" : this.documentAction.getUUID(),
             "isNewDocument" : true,
             "title": title,
-            "creatorIdentity": this.identityArea.get("value"),
+            "creatorIdentity": this.identityArea ? this.identityArea.get("value") : this.identityList[0].distinguishedName,
             "appId" :this.categoryData.appId,
             "categoryId" : this.categoryData.id,
             "form" : this.categoryData.formId,
@@ -305,22 +322,26 @@ MWF.xApplication.cms.Index.Starter = new Class({
         };
 
         if (!data.title && !this.isIgnoreTitle()){
-            $("form_startSubject").setStyle("border-color", "red");
-            $("form_startSubject").focus();
+            if( subjectObj ){
+                subjectObj.setStyle("border-color", "red");
+                subjectObj.focus();
+            }
             this.app.notice(this.lp.inputSubject, "error");
         }else if (!data.creatorIdentity){
             this.departmentSelArea.setStyle("border-color", "red");
             this.app.notice(this.lp.selectStartId, "error");
         }else{
             if( this.isIgnoreTitle() )data.title = "无标题";
-            this.mask = new MWF.widget.Mask({"style": "desktop"});
-            this.mask.loadNode(this.areaNode);
+            if( this.areaNode ){
+                this.mask = new MWF.widget.Mask({"style": "desktop"});
+                this.mask.loadNode(this.areaNode);
+            }
             this.getDocumentAction(function(){
                 this.documentAction.addDocument( data, function(json){
-                    this.mask.hide();
+                    if(this.mask)this.mask.hide();
 
-                    this.markNode.destroy();
-                    this.areaNode.destroy();
+                    if(this.markNode)this.markNode.destroy();
+                    if(this.areaNode)this.areaNode.destroy();
 
                     this._openDocument( json.data.id );
                     //this.fireEvent("started", [json.data, title, this.categoryData.name]);
@@ -345,15 +366,18 @@ MWF.xApplication.cms.Index.Starter = new Class({
 
 
     _createProcessDocument:function(e){
-        var title = $("form_startSubject").get("value") || "";
+        var subjectObj = $("form_startSubject");
+        var title = subjectObj ? subjectObj.get("value") : "";
         var processId = this.categoryData.workflowFlag;
         var data = {
-            "title":$("form_startSubject").get("value"),
+            "title":title,
             "identity": this.identityArea.get("value")
         };
         if (!data.title || !this.isIgnoreTitle()){
-            $("form_startSubject").setStyle("border-color", "red");
-            $("form_startSubject").focus();
+            if( subjectObj ){
+                subjectObj.setStyle("border-color", "red");
+                subjectObj.focus();
+            }
             this.app.notice(this.lp.inputSubject, "error");
         }else if (!data.identity){
             this.departmentSelArea.setStyle("border-color", "red");

BIN
o2web/source/x_component_cms_Module/$ExcelForm/Excel导入合法性说明.xls


BIN
o2web/source/x_component_cms_Module/$ExcelForm/Excel模板下载.xls


+ 1 - 1
o2web/source/x_component_cms_Module/$ListExplorer/default/css.wcss

@@ -11,7 +11,7 @@
     "height": "50px",
     "overflow": "hidden",
     "float" : "left",
-    "width" : "600px"
+    "width" : "300px"
   },
   "searchBarNode": {
     "width" : "200px",

+ 45 - 0
o2web/source/x_component_cms_Module/$Main/default/css.wcss

@@ -92,6 +92,51 @@
     "background": "url(/x_component_cms_Index/$Main/default/icon/createDocument_over.png) 20px center no-repeat"
   },
 
+  "copyDocumentAction": {
+    "height": "50px",
+    "line-height": "50px",
+    "color" : "#666",
+    "font-size" : "15px",
+    "background": "url(/x_component_cms_Module/$Main/default/icon/copy.png) 20px center no-repeat",
+    "float": "right",
+    "padding-left" : "40px",
+    "cursor": "pointer"
+  },
+  "copyDocumentAction_over": {
+    "color" : "#3c76b7",
+    "background": "url(/x_component_cms_Module/$Main/default/icon/copy_over.png) 20px center no-repeat"
+  },
+
+  "batchRemoveDocumentAction" : {
+    "height": "50px",
+    "line-height": "50px",
+    "color" : "#666",
+    "font-size" : "15px",
+    "background": "url(/x_component_cms_Module/$ListExplorer/default/icon/delete.png) 20px center no-repeat",
+    "float": "right",
+    "padding-left" : "40px",
+    "cursor": "pointer"
+  },
+  "batchRemoveDocumentAction_over": {
+    "color" : "#3c76b7",
+    "background": "url(/x_component_cms_Module/$ListExplorer/default/icon/delete_over.png) 20px center no-repeat"
+  },
+
+  "batchRemoveConfirmDocumentAction" : {
+    "height": "50px",
+    "line-height": "50px",
+    "color" : "red",
+    "font-size" : "15px",
+    "background": "url(/x_component_cms_Module/$ListExplorer/default/icon/delete_red.png) 20px center no-repeat",
+    "float": "right",
+    "padding-left" : "40px",
+    "cursor": "pointer"
+  },
+  "batchRemoveConfirmDocumentAction_over": {
+    "color" : "red",
+    "background": "url(/x_component_cms_Module/$ListExplorer/default/icon/delete_red.png) 20px center no-repeat"
+  },
+
   "importAction": {
     "height": "50px",
     "line-height": "50px",

+ 1 - 1
o2web/source/x_component_cms_Module/ListExplorer.js

@@ -34,7 +34,7 @@ MWF.xApplication.cms.Module.ListExplorer = new Class({
 		this.node = $(node);
         this.searchNode = $(searchNode);
 		this.initData();
-        if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
+        if (!this.personActions) this.personActions = MWF.Actions.get("x_organization_assemble_express");
 	},
 	setTooltip: function(tooltip){
 		if (tooltip) this.options.tooltip = Object.merge(this.options.tooltip, tooltip);

+ 114 - 36
o2web/source/x_component_cms_Module/Main.js

@@ -122,6 +122,7 @@ MWF.xApplication.cms.Module.Main = new Class({
 				this.loadTitleContentNode();
 				this.loadCopyActionNode();
 				this.loadPastEvent();
+				this.loadBatchRemoveAction();
 				this.loadSearchNode();
 				if(callback)callback();
 			}.bind(this)
@@ -165,10 +166,82 @@ MWF.xApplication.cms.Module.Main = new Class({
 			//}.bind(this));
 		}
 	},
+	loadBatchRemoveAction : function(){
+		if( !this.isAdmin )return;
+
+		this.batchRemoveAction = new Element("div", {
+			"styles": this.css.batchRemoveDocumentAction,
+			"text" : this.lp.batchRemove
+		}).inject(this.titleBar);
+		this.batchRemoveAction.addEvents({
+			"click": function(e){
+				if( this.view ){
+					if( this.view.selectEnable ){
+						this.view.disableSelectMode();
+						this.batchRemoveConfirmAction.setStyle("display","none");
+						//this.batchRemoveAction.set("text",this.lp.batchRemove);
+					}else{
+						this.view.selectMode();
+						this.batchRemoveConfirmAction.setStyle("display","");
+						//this.batchRemoveAction.set("text",this.lp.cancel);
+					}
+				}
+			}.bind(this),
+			"mouseover" : function(e){
+				this.batchRemoveAction.setStyles( this.css.batchRemoveDocumentAction_over )
+			}.bind(this),
+			"mouseout" : function(e){
+				this.batchRemoveAction.setStyles( this.css.batchRemoveDocumentAction )
+			}.bind(this)
+		});
+
+
+		this.batchRemoveConfirmAction = new Element("div", {
+			"styles": this.css.batchRemoveConfirmDocumentAction,
+			"text" : this.lp.batchRemoveConfirm
+		}).inject(this.titleBar);
+		var _self = this;
+		this.batchRemoveConfirmAction.addEvents({
+			"click": function (e) {
+				var itemIds = this.view.getSelectedIds();
+				if (itemIds.length) {
+					_self.readyRemove = true;
+					var text = "删除后无法恢复,确定要删除选中的"+itemIds.length+"个文档?";
+					this.confirm("warn", e, "清除确认", text, 350, 120, function(){
+
+						_self.removeDocumentList(itemIds);
+
+						this.close();
+
+					}, function(){
+						_self.readyRemove = false;
+						this.close();
+					});
+				}else{
+					this.notice("请先选择文档","error")
+				}
+			}.bind(this)
+		});
+		this.batchRemoveConfirmAction.setStyle("display","none");
+	},
+	removeDocumentList : function( itemIds ){
+		var count = 0;
+		itemIds.each( function(id){
+			this.restActions.removeDocument(id, function(json){
+				count++;
+				if( count === itemIds.length ){
+					this.notice("清除成功", "success");
+					this.view.disableSelectMode();
+					this.batchRemoveConfirmAction.setStyle("display","none");
+					this.view.reload();
+				}
+			}.bind(this));
+		}.bind(this))
+	},
 	loadCopyActionNode : function(){
 		if( !this.isAdmin )return;
 		this.copyAction = new Element("div", {
-			"styles": this.css.createDocumentAction,
+			"styles": this.css.copyDocumentAction,
 			"text" : this.lp.copy
 		}).inject(this.titleBar);
 		this.copyAction.addEvents({
@@ -198,53 +271,58 @@ MWF.xApplication.cms.Module.Main = new Class({
 				}
 			}.bind(this),
 			"mouseover" : function(e){
-				this.copyAction.setStyles( this.css.createDocumentAction_over )
+				this.copyAction.setStyles( this.css.copyDocumentAction_over )
 			}.bind(this),
 			"mouseout" : function(e){
-				this.copyAction.setStyles( this.css.createDocumentAction )
+				this.copyAction.setStyles( this.css.copyDocumentAction )
 			}.bind(this)
 		});
 	},
 	keyCopyItems: function(e){
-		var itemIds = this.view.getSelectedIds();
-		if (itemIds.length){
-			var items = [];
-			var i = 0;
-
-			var checkItems = function(e){
-				if (i>= itemIds.length){
-					if (items.length){
-						var str = JSON.encode(items);
-						if (e && e.clipboardData){
-							e.clipboardData.setData('text/plain', str);
-						}else {
-							window.clipboardData.setData("Text", str);
+		if (layout.desktop.currentApp && layout.desktop.currentApp.appId===this.appId) {
+			var itemIds = this.view.getSelectedIds();
+			if (itemIds.length) {
+				var items = [];
+				var i = 0;
+
+				var checkItems = function (e) {
+					if (i >= itemIds.length) {
+						if (items.length) {
+							var str = JSON.encode(items);
+							if (e && e.clipboardData) {
+								e.clipboardData.setData('text/plain', str);
+								e.preventDefault();
+							} else {
+								window.clipboardData.setData("Text", str);
+							}
+							this.notice(this.lp.copyed, "success");
 						}
-						this.notice(this.lp.copyed, "success");
 					}
-				}
-			}.bind(this);
-
-			itemIds.each(function(id){
-				this.restActions.getDocument( id, function(json){
-					json.data.elementType = "cmsDocument";
-					items.push(json.data);
-					i++;
-					checkItems(e);
-				}.bind(this), null, false)
-			}.bind(this));
+				}.bind(this);
+
+				itemIds.each(function (id) {
+					this.restActions.getDocument(id, function (json) {
+						json.data.elementType = "cmsDocument";
+						items.push(json.data);
+						i++;
+						checkItems(e);
+					}.bind(this), null, false)
+				}.bind(this));
+			}
 		}
 	},
 	keyPasteItems: function(e){
-		var dataStr = "";
-		if (e && e.clipboardData){
-			dataStr = e.clipboardData.getData('text/plain');
-		}else{
-			dataStr = window.clipboardData.getData("Text");
-		}
-		var data = JSON.decode(dataStr);
+		if (layout.desktop.currentApp && layout.desktop.currentApp.appId===this.appId) {
+			var dataStr = "";
+			if (e && e.clipboardData) {
+				dataStr = e.clipboardData.getData('text/plain');
+			} else {
+				dataStr = window.clipboardData.getData("Text");
+			}
+			var data = JSON.decode(dataStr);
 
-		this.pasteItem(data, 0);
+			this.pasteItem(data, 0);
+		}
 	},
 	pasteItem: function(data, i){
 		if (i<data.length){

+ 3 - 0
o2web/source/x_component_cms_Module/lp/zh-cn.js

@@ -28,6 +28,9 @@ MWF.xApplication.cms.Module.LP = {
 	"completedTime": "完成时间",
 	"process": "流程",
 
+	"batchRemove" : "清除",
+	"batchRemoveConfirm" : "确定清除",
+
 	"processList": "流程",
 	"activityNameList": "活动",
 	"creatorCompanyList": "创建公司",

+ 1 - 0
o2web/source/x_component_cms_Xform/Htmleditor.js

@@ -72,6 +72,7 @@ MWF.xApplication.cms.Xform.Htmleditor = MWF.CMSHtmleditor =  new Class({
             editorConfig.reference = this.form.businessData.document.id;
             editorConfig.referenceType = "cmsDocument";
 
+            if( editorConfig.skin )editorConfig.skin = "moono-lisa";
             this.editor = CKEDITOR.replace(editorDiv, editorConfig);
             this._loadEvents();
 

+ 55 - 2
o2web/source/x_component_cms_Xform/Package.js

@@ -21,8 +21,61 @@ MWF.xApplication.cms.Xform.Div = MWF.CMSDiv = new Class({
 	Extends: MWF.APPDiv
 });
 
-MWF.xApplication.cms.Xform.Image = MWF.CMSImage = new Class({
-	Extends: MWF.APPImage
+MWF.xApplication.cms.Xform.Common = MWF.CMSCommon =  new Class({
+    Extends: MWF.APPCommon
+});
+
+//MWF.xApplication.cms.Xform.Image = MWF.CMSImage = new Class({
+//	Extends: MWF.APPImage
+//});
+
+MWF.xApplication.cms.Xform.Image = MWF.CMSImage =  new Class({
+    Extends: MWF.APP$Module,
+    _loadUserInterface: function(){
+        if (this.json.properties && this.json.properties["src"]){
+            var value = this.json.properties["src"];
+            if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1 || value.indexOf("x_cms_assemble_control")!=-1)){
+                var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+                var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+				var host3 = MWF.Actions.getHost("x_cms_assemble_control");
+                if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+                    value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+                }
+                if (value.indexOf("/x_portal_assemble_surface")!==-1){
+                    value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }else if (value.indexOf("x_portal_assemble_surface")!==-1){
+                    value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+                }
+				if (value.indexOf("/x_cms_assemble_control")!==-1){
+					value = value.replace("/x_cms_assemble_control", host3+"/x_cms_assemble_control");
+				}else if (value.indexOf("x_cms_assemble_control")!==-1){
+					value = value.replace("x_cms_assemble_control", host3+"/x_cms_assemble_control");
+				}
+            }
+            try{
+                this.node.set("src", value);
+            }catch(e){}
+        }else if (this.json.srcfile && this.json.srcfile!="none"){
+            value = this.json.srcfile;
+            if (typeOf(value)==="object"){
+                var url = (value.portal) ? MWF.xDesktop.getPortalFileUr(value.id, value.portal) : MWF.xDesktop.getProcessFileUr(value.id, value.application);
+                this.node.set("src", url);
+            }else{
+                var host = MWF.Actions.getHost("x_portal_assemble_surface");
+                var action = MWF.Actions.get("x_portal_assemble_surface");
+                var uri = action.action.actions.readFile.uri;
+                uri = uri.replace("{flag}", value);
+                uri = uri.replace("{applicationFlag}", this.form.json.application);
+                value = host+"/x_portal_assemble_surface"+uri;
+                this.node.set("src", value);
+            }
+        }else if (typeOf(this.json.src)=="object"){
+            var src = MWF.xDesktop.getImageSrc( this.json.src.imageId );
+            this.node.set("src", src);
+        }
+    }
 });
 
 //MWF.xDesktop.requireApp("cms.Xform", "ImageClipper", null, false);

+ 19 - 12
o2web/source/x_component_portal_PageDesigner/Module/Tab/tab.html

@@ -1,18 +1,25 @@
 <div style="background-color: #FFF; overflow: hidden">
 	<div title="基本" class="MWFTab">
 		<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
-		  <tr>
-		    <td class="editTableTitle">标识:</td>
-		    <td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
-		  </tr>
-		  <tr>
-		    <td class="editTableTitle">名称:</td>
-		    <td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
-		  </tr>
-		  <tr>
-		    <td class="editTableTitle">描述:</td>
-		    <td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
-		  </tr>
+			<tr>
+				<td class="editTableTitle">标识:</td>
+				<td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
+			</tr>
+			<tr>
+				<td class="editTableTitle">名称:</td>
+				<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
+			</tr>
+			<tr>
+				<td class="editTableTitle">描述:</td>
+				<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
+			</tr>
+			<tr title="延时加载为是时,未显示的tab页内容不会加载,只有在tab页第一次显示时才会加载内容">
+				<td class="editTableTitle">延时加载:</td>
+				<td class="editTableValue">
+					<input type="radio" name="isDelay" value="true" text{($.isDelay)?'checked':''}/>是
+					<input type="radio" name="isDelay" value="false" text{(!$.isDelay)?'checked':''}/>否
+				</td>
+			</tr>
 		</table>
 		
 		<div class="MWFMaplist" name="styles" title="样式"></div>

+ 1 - 0
o2web/source/x_component_portal_PortalExplorer/Main.js

@@ -304,6 +304,7 @@ MWF.xApplication.portal.PortalExplorer.Portal = new Class({
         if (id){
             var _self = this;
             var options = {
+                "appId": "portal.PageDesigner"+id,
                 "onQueryLoad": function(){
                     this.actions = _self.app.actions;
                     //this.category = _self;

+ 34 - 16
o2web/source/x_component_portal_PortalManager/FileExplorer.js

@@ -9,18 +9,18 @@ MWF.xApplication.portal.PortalManager.FileExplorer = new Class({
         "noElement": MWF.APPPM.LP.file.noDictionaryNoticeText
     },
 
-    _createElement: function(e){
-        // var _self = this;
-        // var options = {
-        //     "onQueryLoad": function(){
-        //         this.actions = _self.app.restActions;
-        //         this.application = _self.app.options.application || _self.app.application;
-        //         this.explorer = _self;
-        //     }
-        // };
-        // this.app.desktop.openApplication(e, "process.FileDesigner", options);
-        new MWF.xApplication.portal.PortalManager.FileDesigner(this);
-    },
+    // _createElement: function(e){
+    //     // var _self = this;
+    //     // var options = {
+    //     //     "onQueryLoad": function(){
+    //     //         this.actions = _self.app.restActions;
+    //     //         this.application = _self.app.options.application || _self.app.application;
+    //     //         this.explorer = _self;
+    //     //     }
+    //     // };
+    //     // this.app.desktop.openApplication(e, "process.FileDesigner", options);
+    //     new MWF.xApplication.portal.PortalManager.FileDesigner(this);
+    // },
     getNewData: function(){
         return {
             "id": "",
@@ -32,7 +32,13 @@ MWF.xApplication.portal.PortalManager.FileExplorer = new Class({
         }
     },
     implodeFiles: function(){
+        if (this.upload){
+            this.upload.upload();
+        }else{
+
+        }
         MWF.require("MWF.widget.Upload", function(){
+            var datas = [];
             new MWF.widget.Upload(this.app.content, {
                 "action": MWF.Actions.get("x_portal_assemble_designer").action,
                 "multiple": true,
@@ -51,10 +57,15 @@ MWF.xApplication.portal.PortalManager.FileExplorer = new Class({
                         if (node) if (node.hasClass("noElementNode")){
                             node.destroy();
                         }
-
-                        var itemObj = this._getItemObject(data);
-                        itemObj.load();
+                        datas.push(data);
+                        // var itemObj = this._getItemObject(data);
+                        // itemObj.load();
                     }.bind(this), null, false);
+                }.bind(this),
+                "onEvery": function(json, current, count, file){
+                    var data = datas[current-1];
+                    var itemObj = this._getItemObject(data);
+                    itemObj.load();
                 }.bind(this)
             }).load();
         }.bind(this));
@@ -74,6 +85,13 @@ MWF.xApplication.portal.PortalManager.FileExplorer.File = new Class({
             new MWF.xApplication.portal.PortalManager.FileDesigner(this.explorer, this.data);
         }.bind(this));
 	},
+    _getUrl: function(){
+        var url = MWF.Actions.get("x_portal_assemble_surface").action.actions.readFile.uri;
+        url = url.replace(/{flag}/, this.data.id);
+        url = url.replace(/{applicationFlag}/, this.data.portal);
+        url = "/x_portal_assemble_surface"+url;
+        return MWF.Actions.getHost("x_portal_assemble_surface")+url;
+    },
     _getIcon: function(){
         return "file.png";
     },
@@ -85,7 +103,7 @@ MWF.xApplication.portal.PortalManager.FileExplorer.File = new Class({
         var href = MWF.Actions.getHost("x_portal_assemble_surface")+url;
 
 		return {
-			"icon": this.explorer.path+this.explorer.options.style+"/fileIcon/lnk.png",
+			"icon": this.data.iconUrl,
 			"title": this.data.name,
             "par": "@url#"+href
 		};

+ 1 - 0
o2web/source/x_component_portal_PortalManager/PageExplorer.js

@@ -417,6 +417,7 @@ MWF.xApplication.portal.PortalManager.PageExplorer.Page= new Class({
 	_open: function(e){
         var _self = this;
         var options = {
+            "appId": "portal.PageDesigner"+_self.data.id,
             "onQueryLoad": function(){
                 this.actions = _self.explorer.actions;
                 this.category = _self;

+ 1 - 0
o2web/source/x_component_portal_PortalManager/ScriptExplorer.js

@@ -212,6 +212,7 @@ MWF.xApplication.portal.PortalManager.ScriptExplorer.Script = new Class({
 	_open: function(e){
 		var _self = this;
 		var options = {
+            "appId": "portal.ScriptDesigner"+_self.data.id,
 			"onQueryLoad": function(){
 				this.actions = _self.explorer.actions;
 				this.category = _self;

+ 1 - 0
o2web/source/x_component_process_Application/$WorkExplorer/default/css.wcss

@@ -619,6 +619,7 @@
     },
     "personAreaHeadNode": {
         "height": "40px",
+        "line-height": "40px",
         "margin-right": "240px"
     },
     "actionAreaHeadNode": {

+ 11 - 8
o2web/source/x_component_process_Application/WorkExplorer.js

@@ -434,7 +434,7 @@ MWF.xApplication.process.Application.WorkExplorer = new Class({
     },
 
     loadProcess: function(){
-        this.actions.listProcessManage(this.app.options.id, function(json){
+        this.actions.listProcessCountManage(this.app.options.id, function(json){
             json.data.each(function(process){
                 this.loadProcessNode(process);
             }.bind(this));
@@ -1190,12 +1190,13 @@ MWF.xApplication.process.Application.WorkExplorer.Work = new Class({
     },
 
     setPersonData: function(){
-        var data = {
-            "name": MWF.name.cn(this.data.creatorIdentity),
-            "unitName": (this.data.creatorUnit) ? MWF.name.cn(this.data.creatorUnit) : "",
-            "id": this.data.creatorIdentity
-        };
-        new MWF.widget.O2Identity(data, this.personAreaNode, {"style": "work", "lazy": true});
+        // var data = {
+        //     "name": MWF.name.cn(this.data.creatorIdentity),
+        //     "unitName": (this.data.creatorUnit) ? MWF.name.cn(this.data.creatorUnit) : "",
+        //     "id": this.data.creatorIdentity
+        // };
+        this.personAreaNode.set("text", MWF.name.cn(this.data.creatorIdentity)+"("+((this.data.creatorUnit) ? MWF.name.cn(this.data.creatorUnit) : "")+")");
+        //new MWF.widget.O2Identity(data, this.personAreaNode, {"style": "work", "lazy": true});
     },
     setStatusData: function(){
         this.createStatusIcon("start");
@@ -1292,8 +1293,10 @@ MWF.xApplication.process.Application.WorkExplorer.Task = new Class({
         this.setEvents();
     },
     setTaskContent: function () {
+        debugger;
         //var time = new Date().parse(this.data.startTime).format("%Y-%m-%d %H:%M");
-        new MWF.widget.O2Identity({"name": this.data.identity}, this.personAreaNode, {"style": "task"});
+        this.personAreaNode.set("text", o2.name.cn(this.data.identity)+"("+o2.name.cn(this.data.unit)+")");
+        //new MWF.widget.O2Identity({"name": this.data.identity}, this.personAreaNode, {"style": "task"});
 
         var time = new Date().parse(this.data.startTime).format("%Y-%m-%d %H:%M");
         this.timeAreaNode.set("text", time);

+ 42 - 19
o2web/source/x_component_process_ApplicationExplorer/Main.js

@@ -55,6 +55,14 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
 		this.loadApplicationContent();
 		if (callback) callback();
 	},
+    hasCreatorRole: function(){
+	    return MWF.AC.isProcessPlatformCreator();
+    },
+    hasManagerRole: function(){
+        if (MWF.AC.isAdministrator()) return true;
+        if (MWF.AC.isProcessManager()) return true;
+        return false;
+    },
 	loadApplicationContent: function(){
 	//	this.loadStartMenu();
         this.loadToolbar();
@@ -75,7 +83,7 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
         this.createSearchAction();
     },
     createCreateAction: function(){
-        if (MWF.AC.isProcessPlatformCreator()){
+        if (this.hasCreatorRole()){
             this.createApplicationNode = new Element("div", {
                 "styles": this.css.createApplicationNode,
                 "title": this.options.tooltip.create
@@ -153,7 +161,7 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
         //    "styles": this.css.categoryActionNode,
         //    "text": this.options.tooltip.selectCategory
         //}).inject(this.categoryAreaNode);
-        if (MWF.AC.isProcessPlatformCreator()){
+        if (this.hasCreatorRole()){
             this.importActionNode = new Element("div", {
                 "styles": this.css.importActionNode,
                 "text": this.lp.application.import
@@ -333,7 +341,7 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
                 }.bind(this));
                 //}
             }else {
-                if (MWF.AC.isProcessPlatformCreator()){
+                if (this.hasCreatorRole()){
                     var noApplicationNode = new Element("div", {
                         "styles": this.css.noApplicationNode,
                         "text": this.options.tooltip.noApplicationCreate
@@ -636,6 +644,16 @@ MWF.xApplication.process.ApplicationExplorer.Application = new Class({
         this.node.inject(this.container, this.options.where);
 	},
 
+    canManage: function(){
+        if (this.app.hasCreatorRole()){
+            if ((this.data.creatorPerson==layout.desktop.session.user.name) || MWF.AC.isAdministrator() || this.app.hasManagerRole()){
+                return true;
+            }
+        }else{
+           if (this.data.controllerList.indexOf(layout.desktop.session.user.distinguishedName)!==-1) return true;
+        }
+        return false;
+    },
     loadTopNode: function(){
         this.topNode = new Element("div", {
             "styles": this.css.applicationItemTopNode
@@ -647,8 +665,8 @@ MWF.xApplication.process.ApplicationExplorer.Application = new Class({
         }.bind(this));
     },
     loadDeleteAction: function(){
-        if (MWF.AC.isProcessPlatformCreator()){
-            if ((this.data.creatorPerson==layout.desktop.session.user.name) || MWF.AC.isAdministrator()){
+        if (this.canManage()){
+            //if ((this.data.creatorPerson==layout.desktop.session.user.name) || (this.data.controllerList.indexOf(layout.desktop.session.user.distinguishedName)!==-1) || MWF.AC.isAdministrator()){
                 this.delAdctionNode = new Element("div", {
                     "styles": this.css.applicationItemDelActionNode
                 }).inject(this.topNode);
@@ -661,12 +679,12 @@ MWF.xApplication.process.ApplicationExplorer.Application = new Class({
                     this.checkDeleteApplication(e);
                     e.stopPropagation();
                 }.bind(this));
-            }
+            //}
         }
     },
     loadExportAction: function(){
-        if (MWF.AC.isProcessPlatformCreator()) {
-            if ((this.data.creatorPerson == layout.desktop.session.user.name) || MWF.AC.isAdministrator()) {
+        if (this.canManage()) {
+            //if ((this.data.creatorPerson == layout.desktop.session.user.name) || MWF.AC.isAdministrator() || MWF.AC.isProcessManager()) {
                 this.exportAdctionNode = new Element("div", {
                     "styles": this.css.applicationItemExportActionNode,
                     "title": this.app.lp.application.export
@@ -684,7 +702,7 @@ MWF.xApplication.process.ApplicationExplorer.Application = new Class({
                     this.exportApplication(e);
                     e.stopPropagation();
                 }.bind(this));
-            }
+            //}
         }
     },
     exportApplication: function(){
@@ -886,6 +904,7 @@ MWF.xApplication.process.ApplicationExplorer.Application = new Class({
         if (id){
             var _self = this;
             var options = {
+                "appId": "process.ProcessDesigner"+id,
                 "onQueryLoad": function(){
                     this.actions = _self.app.actions;
                     //this.category = _self;
@@ -975,16 +994,20 @@ MWF.xApplication.process.ApplicationExplorer.Application = new Class({
     openForm: function(node, e){
         var id = node.retrieve("formId");
         if (id){
-            var _self = this;
-            var options = {
-                "onQueryLoad": function(){
-                    this.actions = _self.app.actions;
-                    //this.category = _self;
-                    this.options.id = id;
-                    this.application = _self.data;
-                }
-            };
-            this.app.desktop.openApplication(e, "process.FormDesigner", options);
+            layout.desktop.getFormDesignerStyle(function(){
+                var _self = this;
+                var options = {
+                    "style": layout.desktop.formDesignerStyle,
+                    "appId": "process.FormDesigner"+id,
+                    "onQueryLoad": function(){
+                        this.actions = _self.app.actions;
+                        //this.category = _self;
+                        this.options.id = id;
+                        this.application = _self.data;
+                    }
+                };
+                this.app.desktop.openApplication(e, "process.FormDesigner", options);
+            }.bind(this));
         }
     },
 

+ 3 - 19
o2web/source/x_component_process_FormDesigner/Module/Actionbar.js

@@ -104,6 +104,8 @@ MWF.xApplication.process.FormDesigner.Module.Actionbar = MWF.FCActionbar = new C
             this.toolbarNode = this.node.getFirst("div");
             this.toolbarNode.empty();
             this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {"style": this.json.style}, this);
+            if (!this.json.actionStyles) this.json.actionStyles = Object.clone(this.toolbarWidget.css);
+            this.toolbarWidget.css = this.json.actionStyles;
 
             if (this.json.defaultTools){
                 var json = Array.clone(this.json.defaultTools);
@@ -121,27 +123,9 @@ MWF.xApplication.process.FormDesigner.Module.Actionbar = MWF.FCActionbar = new C
                     //json = null;
                 }.bind(this), false);
             }
-         //   if (this.json.sysTools.editTools){
-         //       this.setToolbars(this.json.sysTools.editTools, this.toolbarNode);
-         ////       this.setToolbars(this.json.tools.editTools, this.toolbarNode);
-         //   }else{
-         //       this.setToolbars(this.json.sysTools, this.toolbarNode);
-         ////       this.setToolbars(this.json.tools, this.toolbarNode);
-         //   }
-
         }
 
     },
-    //resetIcons: function(){
-    //    var divs = this.toolbarNode.getElements("div");
-    //    divs.each(function(item, idx){
-    //        var img = item.get("MWFButtonImage");
-    //        if (img){
-    //            item.set("MWFButtonImage", this.path+""+this.options.style+"/tools/"+img);
-    //        }
-    //    }.bind(this));
-    //
-    //},
     setToolbars: function(tools, node){
         tools.each(function(tool){
             var actionNode = new Element("div", {
@@ -170,7 +154,7 @@ MWF.xApplication.process.FormDesigner.Module.Actionbar = MWF.FCActionbar = new C
                 });
             }
         }
-        if (name=="defaultTools" || name=="tools"){
+        if (name=="defaultTools" || name=="tools" || name==="actionStyles"){
             this._refreshActionbar();
         }
 

+ 3 - 0
o2web/source/x_component_process_FormDesigner/Module/Actionbar/actionbar.html

@@ -26,6 +26,9 @@
     <div title="操作"  class="MWFTab" style="overflow: hidden">
 		<div class="MWFDefaultActionArea" name="defaultTools"></div>
         <div class="MWFActionArea" name="tools"></div>
+    </div>
+    <div title="样式"  class="MWFTab">
+        <div class="MWFActionStylesArea" name="actionStyles"></div>
     </div>
 	<div title="HTML"  class="MWFTab">
 		<div class="MWFHTMLArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>

+ 31 - 10
o2web/source/x_component_process_FormDesigner/Module/Actionbar/toolbars.json

@@ -53,6 +53,17 @@
     "condition": "",
     "read": true
   },
+  {
+    "type": "MWFToolBarButton",
+    "img": "split.png",
+    "title": "增加拆分分支",
+    "action": "addSplit",
+    "text": "增加分支",
+    "id": "action_split",
+    "control": "allowAddSplit",
+    "condition": "",
+    "read": true
+  },
   {
     "type": "MWFToolBarButton",
     "img": "retract.png",
@@ -64,6 +75,16 @@
     "condition": "",
     "read": true
   },
+  {
+    "type": "MWFToolBarButton",
+    "img": "rollback.png",
+    "title": "回溯到指定的环节,不保留流程记录",
+    "action": "rollback",
+    "text": "流程回溯",
+    "id": "action_rollback",
+    "control": "allowRollback",
+    "condition": ""
+  },
   {
     "type": "MWFToolBarButton",
     "img": "del.png",
@@ -85,7 +106,7 @@
     "control": "",
     "condition": "",
     "read": true
-  },
+  }
 //  {
 //    "type": "MWFToolBarMenu",
 //    "img": "tool.png",
@@ -99,13 +120,13 @@
 //
 //    ]
 //  },
-  {
-    "type": "MWFToolBarSeparator",
-    "img": "",
-    "title": "",
-    "action": "",
-    "text": "",
-    "condition": "",
-    "read": true
-  }
+//  {
+//    "type": "MWFToolBarSeparator",
+//    "img": "",
+//    "title": "",
+//    "action": "",
+//    "text": "",
+//    "condition": "",
+//    "read": true
+//  }
 ]

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff