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

合并初始化js文件,减少载入请求数,修正cms脚本编辑器保存错误

huqi 5 лет назад
Родитель
Сommit
07ebb73f6c

+ 20 - 18
o2web/source/x_component_cms_ScriptDesigner/Script.js

@@ -229,15 +229,16 @@ MWF.xApplication.cms.ScriptDesigner.Script = new Class({
 
 
     save: function(callback){
-        var session = this.editor.editor.getSession();
-        var annotations = session.getAnnotations();
-        var validated = true;
-        for (var i=0; i<annotations.length; i++){
-            if (annotations[i].type=="error"){
-                validated = false;
-                break;
-            }
-        }
+        // var session = this.editor.editor.getSession();
+        // var annotations = session.getAnnotations();
+        // var validated = true;
+        // for (var i=0; i<annotations.length; i++){
+        //     if (annotations[i].type=="error"){
+        //         validated = false;
+        //         break;
+        //     }
+        // }
+        var validated = this.editor.validated();
 
         var name = this.designer.propertyNameNode.get("value");
         var alias = this.designer.propertyAliasNode.get("value");
@@ -265,15 +266,16 @@ MWF.xApplication.cms.ScriptDesigner.Script = new Class({
         }.bind(this));
     },
     saveSilence: function(callback){
-        var session = this.editor.editor.getSession();
-        var annotations = session.getAnnotations();
-        var validated = true;
-        for (var i=0; i<annotations.length; i++){
-            if (annotations[i].type=="error"){
-                validated = false;
-                break;
-            }
-        }
+        // var session = this.editor.editor.getSession();
+        // var annotations = session.getAnnotations();
+        // var validated = true;
+        // for (var i=0; i<annotations.length; i++){
+        //     if (annotations[i].type=="error"){
+        //         validated = false;
+        //         break;
+        //     }
+        // }
+        var validated = this.editor.validated();
 
         if( this.designer.currentScript == this ) {
             var name = this.designer.propertyNameNode.get("value");

+ 3 - 0
o2web/source/x_component_cms_Xform/Package.js

@@ -17,10 +17,12 @@ MWF.xDesktop.requireApp("cms.Xform", "ModuleImplements", null, false);
 //MWF.xDesktop.requireApp("cms.Xform", "Checkbox", null, false);
 //MWF.xDesktop.requireApp("cms.Xform", "Button", null, false);
 
+MWF.xDesktop.requireApp("process.Xform", "Div", null, false);
 MWF.xApplication.cms.Xform.Div = MWF.CMSDiv = new Class({
 	Extends: MWF.APPDiv
 });
 
+MWF.xDesktop.requireApp("process.Xform", "Common", null, false);
 MWF.xApplication.cms.Xform.Common = MWF.CMSCommon =  new Class({
     Extends: MWF.APPCommon
 });
@@ -29,6 +31,7 @@ MWF.xApplication.cms.Xform.Common = MWF.CMSCommon =  new Class({
 //	Extends: MWF.APPImage
 //});
 
+MWF.xDesktop.requireApp("process.Xform", "Image", null, false);
 MWF.xApplication.cms.Xform.Image = MWF.CMSImage =  new Class({
     Extends: MWF.APP$Module,
     _loadUserInterface: function(){