diff --git a/apps/common/main/lib/controller/ExternalDiagramEditor.js b/apps/common/main/lib/controller/ExternalDiagramEditor.js index 16a83128f..610692c47 100644 --- a/apps/common/main/lib/controller/ExternalDiagramEditor.js +++ b/apps/common/main/lib/controller/ExternalDiagramEditor.js @@ -120,7 +120,9 @@ define([ } externalEditor.attachMouseEvents(); } else { - createExternalEditor.apply(this); + require(['api'], function () { + createExternalEditor.apply(this); + }.bind(this)); } this.isExternalEditorVisible = true; this.isHandlerCalled = false; diff --git a/apps/common/main/lib/controller/ExternalMergeEditor.js b/apps/common/main/lib/controller/ExternalMergeEditor.js index a7d61f7c2..312d10daf 100644 --- a/apps/common/main/lib/controller/ExternalMergeEditor.js +++ b/apps/common/main/lib/controller/ExternalMergeEditor.js @@ -118,7 +118,9 @@ define([ } externalEditor.attachMouseEvents(); } else { - createExternalEditor.apply(this); + require(['api'], function () { + createExternalEditor.apply(this); + }.bind(this)) } this.isExternalEditorVisible = true; this.isHandlerCalled = false; diff --git a/apps/common/main/lib/controller/ExternalOleEditor.js b/apps/common/main/lib/controller/ExternalOleEditor.js index c21055b95..197145e3e 100644 --- a/apps/common/main/lib/controller/ExternalOleEditor.js +++ b/apps/common/main/lib/controller/ExternalOleEditor.js @@ -120,7 +120,9 @@ define([ } externalEditor.attachMouseEvents(); } else { - createExternalEditor.apply(this); + require(['api'], function () { + createExternalEditor.apply(this); + }.bind(this)); } this.isExternalEditorVisible = true; this.isHandlerCalled = false; diff --git a/apps/documenteditor/main/app.js b/apps/documenteditor/main/app.js index 5b55970f3..cffb24b31 100644 --- a/apps/documenteditor/main/app.js +++ b/apps/documenteditor/main/app.js @@ -56,7 +56,7 @@ require.config({ socketio : '../vendor/socketio/socket.io.min', allfonts : '../../sdkjs/common/AllFonts', sdk : '../../sdkjs/word/sdk-all-min', - // api : 'api/documents/api', + api : 'api/documents/api', core : 'common/main/lib/core/application', notification : 'common/main/lib/core/NotificationCenter', keymaster : 'common/main/lib/core/keymaster', @@ -128,7 +128,6 @@ require([ 'backbone', 'bootstrap', 'core', - // 'api', 'analytics', 'gateway', 'locale' diff --git a/apps/documenteditor/main/app_dev.js b/apps/documenteditor/main/app_dev.js index e99e33aa4..ddfd664d6 100644 --- a/apps/documenteditor/main/app_dev.js +++ b/apps/documenteditor/main/app_dev.js @@ -54,7 +54,7 @@ require.config({ jmousewheel : '../vendor/perfect-scrollbar/src/jquery.mousewheel', xregexp : '../vendor/xregexp/xregexp-all-min', socketio : '../vendor/socketio/socket.io.min', - // api : 'api/documents/api', + api : 'api/documents/api', core : 'common/main/lib/core/application', notification : 'common/main/lib/core/NotificationCenter', keymaster : 'common/main/lib/core/keymaster', @@ -116,7 +116,6 @@ require([ 'backbone', 'bootstrap', 'core', - // 'api', 'analytics', 'gateway', 'locale', diff --git a/apps/presentationeditor/main/app.js b/apps/presentationeditor/main/app.js index 52ee654b1..b2343b81e 100644 --- a/apps/presentationeditor/main/app.js +++ b/apps/presentationeditor/main/app.js @@ -127,7 +127,6 @@ require([ 'bootstrap', 'core', 'sdk', - 'api', 'analytics', 'gateway', 'locale' diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 50770545c..d2d5af115 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1869,7 +1869,8 @@ define([ onServerVersion: function(buildVersion) { if (this.changeServerVersion) return true; - if (DocsAPI.DocEditor.version() !== buildVersion && !window.compareVersions) { + const cur_version = this.getApplication().getController('LeftMenu').leftMenu.getMenu('about').txtVersionNum; + if ( !window.compareVersions && cur_version !== buildVersion ) { this.changeServerVersion = true; Common.UI.warning({ title: this.titleServerVersion, diff --git a/apps/presentationeditor/main/app_dev.js b/apps/presentationeditor/main/app_dev.js index d3765f0d4..ffb4209e2 100644 --- a/apps/presentationeditor/main/app_dev.js +++ b/apps/presentationeditor/main/app_dev.js @@ -115,7 +115,6 @@ require([ 'backbone', 'bootstrap', 'core', - 'api', 'analytics', 'gateway', 'locale', diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js index d00247a5f..9ebd906c7 100644 --- a/apps/spreadsheeteditor/main/app.js +++ b/apps/spreadsheeteditor/main/app.js @@ -127,7 +127,6 @@ require([ 'bootstrap', 'core', 'sdk', - 'api', 'analytics', 'gateway', 'locale' diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index be6774232..40b126438 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2263,7 +2263,8 @@ define([ onServerVersion: function(buildVersion) { if (this.changeServerVersion) return true; - if (DocsAPI.DocEditor.version() !== buildVersion && !window.compareVersions) { + const cur_version = this.getApplication().getController('LeftMenu').leftMenu.getMenu('about').txtVersionNum; + if (!window.compareVersions && cur_version !== buildVersion) { this.changeServerVersion = true; Common.UI.warning({ title: this.titleServerVersion, diff --git a/apps/spreadsheeteditor/main/app_dev.js b/apps/spreadsheeteditor/main/app_dev.js index d807bf1c7..fb9dcbf59 100644 --- a/apps/spreadsheeteditor/main/app_dev.js +++ b/apps/spreadsheeteditor/main/app_dev.js @@ -115,7 +115,6 @@ require([ 'backbone', 'bootstrap', 'core', - 'api', 'analytics', 'gateway', 'locale',