Browse Source

CreateModule

luoyifan 2 years ago
parent
commit
e9645ed401
3 changed files with 6640 additions and 6557 deletions
  1. 39 0
      assets/mxgraph-editor/fix.js
  2. 6600 6556
      dist/yvan-ext.js
  3. 1 1
      dist/yvan-ext.js.map

+ 39 - 0
assets/mxgraph-editor/fix.js

@@ -0,0 +1,39 @@
+// 运行在 mxgraph-editor 内部的 fix.js
+// 用于和 WhLayoutDesign.js 组件打配合
+
+// window.designer 代表 whLayoutDesign 对象
+// window.editorInitFn 是 whLayoutDesign 的回调对象
+(function () {
+    var editorUiInit = EditorUi.prototype.init;
+    var editorInitFn = window['editorInitFn']
+
+    EditorUi.prototype.init = function () {
+        editorUiInit.apply(this, arguments);
+        if (typeof editorInitFn === 'function') {
+            editorInitFn(this)
+        } else {
+            alert('无法找到 editorInitFn')
+        }
+    };
+
+    // Adds required resources (disables loading of fallback properties, this can only
+    // be used if we know that all keys are defined in the language specific file)
+    mxResources.loadDefaultBundle = false;
+    var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
+        mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);
+
+    // Fixes possible asynchronous requests
+    mxUtils.getAll([bundle, STYLE_PATH + '/default.xml'], function (xhr) {
+        // Adds bundle text to resources
+        mxResources.parse(xhr[0].getText());
+
+        // Configures the default graph theme
+        var themes = new Object();
+        themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();
+
+        // Main
+        new EditorUi(new Editor(urlParams['chrome'] == '0', themes));
+    }, function () {
+        document.body.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
+    });
+})();

File diff suppressed because it is too large
+ 6600 - 6556
dist/yvan-ext.js


File diff suppressed because it is too large
+ 1 - 1
dist/yvan-ext.js.map