From 5abe22fa6e4e024903f97dca397604ed7cd3322b Mon Sep 17 00:00:00 2001 From: OVSharova Date: Sun, 18 Jul 2021 02:15:10 +0300 Subject: [PATCH] moove to PE --- apps/presentationeditor/main/app.js | 4 +- .../main/app/controller/Main.js | 6 +- .../main/app/controller/Statusbar.js | 7 -- .../main/app/controller/Toolbar.js | 4 +- .../main/app}/controller/Transitions.js | 19 ++--- .../main/app}/view/Transitions.js | 78 +------------------ apps/presentationeditor/main/app_dev.js | 4 +- 7 files changed, 18 insertions(+), 104 deletions(-) rename apps/{common/main/lib => presentationeditor/main/app}/controller/Transitions.js (94%) rename apps/{common/main/lib => presentationeditor/main/app}/view/Transitions.js (74%) diff --git a/apps/presentationeditor/main/app.js b/apps/presentationeditor/main/app.js index 5d827e8b3..b28e2da91 100644 --- a/apps/presentationeditor/main/app.js +++ b/apps/presentationeditor/main/app.js @@ -162,7 +162,7 @@ require([ ,'Common.Controllers.ExternalDiagramEditor' ,'Common.Controllers.ReviewChanges' ,'Common.Controllers.Protection' - ,'Common.Controllers.Transitions' + ,'Transitions' ] }); @@ -198,7 +198,7 @@ require([ ,'common/main/lib/controller/Protection' ,'common/main/lib/controller/Themes' ,'common/main/lib/controller/Desktop' - ,'common/main/lib/controller/Transitions' + ,'presentationeditor/main/app/controller/Transitions' ], function() { app.start(); }); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 6d6f34895..9912a8761 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -97,7 +97,7 @@ define([ 'Common.Views.ReviewChanges': { 'settings:apply': _.bind(this.applySettings, this) }/*, - 'Common.Views.Transitions': { + 'Transitions': { 'settings:apply': _.bind(this.applySettings, this) }*/ }); @@ -1019,7 +1019,7 @@ define([ app.getController('Common.Controllers.ReviewChanges').SetDisabled(disable); } if (options.transit) { - app.getController('Common.Controllers.Transitions').SetDisabled(disable); + app.getController('Transitions').SetDisabled(disable); } if (options.viewport) { app.getController('Viewport').SetDisabled(disable); @@ -1234,7 +1234,7 @@ define([ reviewController = application.getController('Common.Controllers.ReviewChanges'); reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api).loadDocument({doc:me.document}); - var transitController = application.getController('Common.Controllers.Transitions'); + var transitController = application.getController('Transitions'); transitController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api).loadDocument({doc:me.document}); if (this.appOptions.isEdit || this.appOptions.isRestrictedEdit) { // set api events for toolbar in the Restricted Editing mode) diff --git a/apps/presentationeditor/main/app/controller/Statusbar.js b/apps/presentationeditor/main/app/controller/Statusbar.js index d98846f4f..7d3dd803c 100644 --- a/apps/presentationeditor/main/app/controller/Statusbar.js +++ b/apps/presentationeditor/main/app/controller/Statusbar.js @@ -107,13 +107,6 @@ define([ me.btnDocLang = review.getButton('doclang', 'statusbar'); me.btnDocLang.render( me.statusbar.$el.find('#btn-doc-lang') ); - - - var transit = me.getApplication().getController('Common.Controllers.Transitions').getView(); - me.btnSpelling = transit.getButton('spelling', 'statusbar'); - me.btnSpelling.render( me.statusbar.$el.find('#btn-doc-spell') ); - me.btnDocLang = transit.getButton('doclang', 'statusbar'); - me.btnDocLang.render( me.statusbar.$el.find('#btn-doc-lang') ); } else { me.statusbar.$el.find('.el-edit, .el-review').hide(); } diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index ae7e1fc13..43aa7d163 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -2407,10 +2407,10 @@ define([ me.toolbar.setVisible('review', config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments); }*/ var tab = {action: 'transit', caption: me.toolbar.textTabTransitions}; - var $panel = me.getApplication().getController('Common.Controllers.Transitions').createToolbarPanel(); + var $panel = me.getApplication().getController('Transitions').createToolbarPanel(); if ( $panel ) { me.toolbar.addTab(tab, $panel, 3); - me.toolbar.setVisible('transit', config.isEdit || config.canViewReview || config.canCoAuthoring && config.canComments); + me.toolbar.setVisible('transit', true); } if ( config.isEdit ) { me.toolbar.setMode(config); diff --git a/apps/common/main/lib/controller/Transitions.js b/apps/presentationeditor/main/app/controller/Transitions.js similarity index 94% rename from apps/common/main/lib/controller/Transitions.js rename to apps/presentationeditor/main/app/controller/Transitions.js index 5e5861e04..b1ab3e3f3 100644 --- a/apps/common/main/lib/controller/Transitions.js +++ b/apps/presentationeditor/main/app/controller/Transitions.js @@ -38,22 +38,18 @@ * */ -if (Common === undefined) - var Common = {}; -Common.Controllers = Common.Controllers || {}; - define([ 'core', - 'common/main/lib/view/Transitions', + 'presentationeditor/main/app/view/Transitions' ], function () { 'use strict'; - Common.Controllers.Transitions = Backbone.Controller.extend(_.extend({ + PE.Controllers.Transitions = Backbone.Controller.extend(_.extend({ models : [], collections : [ ], views : [ - 'Common.Views.Transitions' + 'PE.Views.Transitions' ], sdkViewName : '#id_main', @@ -64,7 +60,7 @@ define([ 'settings:apply': this.applySettings.bind(this) },*/ - 'Common.Views.Transitions': { + 'PE.Views.Transitions': { //'transit:accept': _.bind(this.onAcceptClick, this), //'transit:reject': _.bind(this.onRejectClick, this), //'transit:delete': _.bind(this.onDeleteClick, this), @@ -89,7 +85,6 @@ define([ }); }, onLaunch: function () { - //this.collection = this.getApplication().getCollection('Common.Collections.ReviewChanges'); this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false, compareSettings: null /*new AscCommon.CComparisonPr()*/}; Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); @@ -125,7 +120,7 @@ define([ setMode: function(mode) { this.appConfig = mode; this.popoverChanges = new Common.Collections.ReviewChanges(); - this.view = this.createView('Common.Views.Transitions', { mode: mode }); + this.view = this.createView('PE.Views.Transitions', { mode: mode }); return this; }, @@ -207,7 +202,5 @@ define([ } } - - - }, Common.Controllers.Transitions || {})); + }, PE.Controllers.Transitions || {})); }); \ No newline at end of file diff --git a/apps/common/main/lib/view/Transitions.js b/apps/presentationeditor/main/app/view/Transitions.js similarity index 74% rename from apps/common/main/lib/view/Transitions.js rename to apps/presentationeditor/main/app/view/Transitions.js index f72a59225..7158a3dff 100644 --- a/apps/common/main/lib/view/Transitions.js +++ b/apps/presentationeditor/main/app/view/Transitions.js @@ -50,11 +50,12 @@ define([ 'common/main/lib/component/Button', 'common/main/lib/component/DataView', 'common/main/lib/component/Layout', + "SlideSettings", 'common/main/lib/component/Window' ], function () { 'use strict'; - Common.Views.Transitions = Common.UI.BaseView.extend(_.extend((function(){ + PE.Views.Transitions = Common.UI.BaseView.extend(_.extend((function(){ var template = '
' + //'' + @@ -193,83 +194,10 @@ define([ this.fireEvent('show', this); }, - getButton: function(type, parent) { - if ( type == 'turn' && parent == 'statusbar' ) { - var button = new Common.UI.Button({ - cls : 'btn-toolbar', - iconCls : 'toolbar__icon btn-ic-review', - hintAnchor : 'top', - hint : this.tipReview, - split : !this.appConfig.isReviewOnly, - enableToggle: true/*, - menu: this.appConfig.isReviewOnly ? false : new Common.UI.Menu({ - menuAlign: 'bl-tl', - style: 'margin-top:-5px;', - items: [ - { - caption: this.txtOn, - value: 0, - checkable: true, - toggleGroup: 'menuTurnReviewStb' - }, - { - caption: this.txtOff, - value: 1, - checkable: true, - toggleGroup: 'menuTurnReviewStb' - }, - { - caption: this.txtOnGlobal, - value: 2, - checkable: true, - toggleGroup: 'menuTurnReviewStb' - }, - { - caption: this.txtOffGlobal, - value: 3, - checkable: true, - toggleGroup: 'menuTurnReviewStb' - } - ]})*/ - }); - - // this.btnsTurnReview.push(button); - - return button; - } else - if ( type == 'spelling' ) { - button = new Common.UI.Button({ - cls: 'btn-toolbar', - iconCls: 'toolbar__icon btn-ic-docspell', - hintAnchor : 'top', - hint: this.tipSetSpelling, - enableToggle: true - }); - //this.btnsSpelling.push(button); - - return button; - } else if (type == 'doclang' && parent == 'statusbar' ) { - button = new Common.UI.Button({ - cls: 'btn-toolbar', - iconCls: 'toolbar__icon btn-ic-doclang', - hintAnchor : 'top', - hint: this.tipSetDocLang, - disabled: true - }); - //this.btnsDocLang.push(button); - - return button; - } - }, - getUserName: function (username) { return Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(username)); }, - markChanges: function(status) { - - }, - turnSpelling: function (state) { }, @@ -293,6 +221,6 @@ define([ txtCommentResolveMy: 'Resolve My Comments', txtCommentResolveAll: 'Resolve All Comments' } - }()), Common.Views.Transitions || {})); + }()), PE.Views.Transitions || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app_dev.js b/apps/presentationeditor/main/app_dev.js index ea42aaf9a..8fa452dae 100644 --- a/apps/presentationeditor/main/app_dev.js +++ b/apps/presentationeditor/main/app_dev.js @@ -153,7 +153,7 @@ require([ ,'Common.Controllers.ExternalDiagramEditor' ,'Common.Controllers.ReviewChanges' ,'Common.Controllers.Protection' - ,'Common.Controllers.Transitions' + ,'Transitions' ] }); @@ -189,7 +189,7 @@ require([ ,'common/main/lib/controller/Protection' ,'common/main/lib/controller/Themes' ,'common/main/lib/controller/Desktop' - ,'common/main/lib/controller/transitions' + ,'presentationeditor/main/app/controller/Transitions' ], function() { window.compareVersions = true; app.start();