From 788e240b755576ee1fe47120447c8a2b4e29bddf Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Sat, 2 Mar 2024 21:47:35 +0300 Subject: [PATCH] [DE] added module LaunchController --- .../main/lib/controller/LaunchController.js | 30 +++++++++++++++++++ .../main/app/controller/Main.js | 5 ++-- apps/documenteditor/main/app_dev.js | 19 +++++++----- 3 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 apps/common/main/lib/controller/LaunchController.js diff --git a/apps/common/main/lib/controller/LaunchController.js b/apps/common/main/lib/controller/LaunchController.js new file mode 100644 index 0000000000..da01b5036c --- /dev/null +++ b/apps/common/main/lib/controller/LaunchController.js @@ -0,0 +1,30 @@ + +define([ +], function () { + const launchController = function () { + const init = function (api) { + this.api = api; + Common.NotificationCenter.on('app:ready', on_app_ready.bind(this)); + } + + const on_app_ready = function (config) { + const me = this; + + const app = window.DE || window.PE || window.SSE || window.PDFE; + !app.postLaunchScripts && (app.postLaunchScripts = []); + // console.log('on_app_ready', app.postLaunchScripts); + + require(app.postLaunchScripts, function () { + Common.UI.ScreenReaderFocusManager.init(me.api); + + Common.NotificationCenter.trigger('script:loaded'); + }); + } + + return { + init: init + }; + } + + Common.Controllers.LaunchController = new launchController(); +}); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index acc944a862..d89aa3474c 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -56,7 +56,8 @@ define([ 'common/main/lib/controller/ScreenReaderFocus', 'common/main/lib/controller/HintManager', 'common/main/lib/controller/LayoutManager', - 'common/main/lib/controller/ExternalUsers' + 'common/main/lib/controller/ExternalUsers', + 'common/main/lib/controller/LaunchController', ], function () { 'use strict'; @@ -190,9 +191,9 @@ define([ this.api = this.getApplication().getController('Viewport').getApi(); Common.UI.FocusManager.init(); - Common.UI.ScreenReaderFocusManager.init(this.api); Common.UI.HintManager.init(this.api); Common.UI.Themes.init(this.api); + Common.Controllers.LaunchController.init(this.api); if (this.api){ this.api.SetDrawingFreeze(true); diff --git a/apps/documenteditor/main/app_dev.js b/apps/documenteditor/main/app_dev.js index 838a5e1ad0..efc08212f2 100644 --- a/apps/documenteditor/main/app_dev.js +++ b/apps/documenteditor/main/app_dev.js @@ -186,13 +186,6 @@ require([ 'documenteditor/main/app/controller/DocProtection', 'documenteditor/main/app/controller/Print', 'documenteditor/main/app/view/FileMenuPanels', - 'documenteditor/main/app/view/ParagraphSettings', - 'documenteditor/main/app/view/HeaderFooterSettings', - 'documenteditor/main/app/view/ImageSettings', - 'documenteditor/main/app/view/TableSettings', - 'documenteditor/main/app/view/ShapeSettings', - 'documenteditor/main/app/view/TextArtSettings', - 'documenteditor/main/app/view/SignatureSettings', 'common/main/lib/util/utils', 'common/main/lib/controller/Fonts', 'common/main/lib/controller/History' @@ -201,7 +194,6 @@ require([ ,'common/main/lib/controller/Chat' /** coauthoring end **/ ,'common/main/lib/controller/Plugins' - ,'documenteditor/main/app/view/ChartSettings' ,'common/main/lib/controller/ExternalDiagramEditor' ,'common/main/lib/controller/ExternalMergeEditor' ,'common/main/lib/controller/ExternalOleEditor' @@ -209,6 +201,17 @@ require([ ,'common/main/lib/controller/Protection' ,'common/main/lib/controller/Draw' ], function() { + app.postLaunchScripts = [ + 'documenteditor/main/app/view/ParagraphSettings', + 'documenteditor/main/app/view/HeaderFooterSettings', + 'documenteditor/main/app/view/ImageSettings', + 'documenteditor/main/app/view/TableSettings', + 'documenteditor/main/app/view/ShapeSettings', + 'documenteditor/main/app/view/TextArtSettings', + 'documenteditor/main/app/view/SignatureSettings', + 'documenteditor/main/app/view/ChartSettings', + ]; + window.compareVersions = true; app.start(); });