From a46b3ee10d134f796b45f83abbfda7e384b76377 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Mon, 15 Jul 2019 16:06:54 +0300 Subject: [PATCH 001/154] [DE mobile] [PE mobile] [SSE mobile] Collaboration moved into Common --- .../mobile/lib}/controller/Collaboration.js | 184 ++++++++------- .../lib}/template/Collaboration.template | 58 ++--- .../mobile/lib}/view/Collaboration.js | 22 +- apps/documenteditor/mobile/app-dev.js | 4 +- apps/documenteditor/mobile/app.js | 4 +- .../mobile/app/controller/DocumentHolder.js | 10 +- .../mobile/app/controller/Settings.js | 8 +- .../documenteditor/mobile/app/view/Toolbar.js | 2 +- apps/documenteditor/mobile/locale/en.json | 144 ++++++------ apps/presentationeditor/mobile/app-dev.js | 4 +- apps/presentationeditor/mobile/app.js | 4 +- .../mobile/app/controller/Collaboration.js | 217 ------------------ .../mobile/app/controller/Settings.js | 2 +- .../app/template/Collaboration.template | 47 ---- .../mobile/app/view/Collaboration.js | 149 ------------ .../mobile/app/view/Toolbar.js | 2 +- apps/presentationeditor/mobile/locale/en.json | 10 +- apps/spreadsheeteditor/mobile/app-dev.js | 4 +- apps/spreadsheeteditor/mobile/app.js | 4 +- .../mobile/app/controller/Collaboration.js | 217 ------------------ .../mobile/app/controller/Settings.js | 2 +- .../app/template/Collaboration.template | 47 ---- .../mobile/app/view/Collaboration.js | 149 ------------ .../mobile/app/view/Toolbar.js | 2 +- apps/spreadsheeteditor/mobile/locale/en.json | 10 +- 25 files changed, 253 insertions(+), 1053 deletions(-) rename apps/{documenteditor/mobile/app => common/mobile/lib}/controller/Collaboration.js (93%) rename apps/{documenteditor/mobile/app => common/mobile/lib}/template/Collaboration.template (93%) rename apps/{documenteditor/mobile/app => common/mobile/lib}/view/Collaboration.js (89%) delete mode 100644 apps/presentationeditor/mobile/app/controller/Collaboration.js delete mode 100644 apps/presentationeditor/mobile/app/template/Collaboration.template delete mode 100644 apps/presentationeditor/mobile/app/view/Collaboration.js delete mode 100644 apps/spreadsheeteditor/mobile/app/controller/Collaboration.js delete mode 100644 apps/spreadsheeteditor/mobile/app/template/Collaboration.template delete mode 100644 apps/spreadsheeteditor/mobile/app/view/Collaboration.js diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js similarity index 93% rename from apps/documenteditor/mobile/app/controller/Collaboration.js rename to apps/common/mobile/lib/controller/Collaboration.js index cbc18da07..c5d3afc1d 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -33,44 +33,49 @@ /** * Collaboration.js - * Document Editor * - * Created by Julia Svinareva on 14/5/19 + * Created by Julia Svinareva on 12/7/19 * Copyright (c) 2019 Ascensio System SIA. All rights reserved. * */ + +if (Common === undefined) + var Common = {}; + +Common.Controllers = Common.Controllers || {}; + define([ 'core', 'jquery', 'underscore', 'backbone', - 'documenteditor/mobile/app/view/Collaboration' + 'common/mobile/lib/view/Collaboration' ], function (core, $, _, Backbone) { 'use strict'; - DE.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() { + Common.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() { // Private - var _settings = [], - _headerType = 1, - rootView, + var rootView, + _userId, + editUsers = [], + editor = !!window.DE ? 'DE' : !!window.PE ? 'PE' : 'SSE', displayMode = "Markup", arrChangeReview = [], dateChange = [], - _fileKey, - _userId, - editUsers = []; + _fileKey; + return { models: [], collections: [], views: [ - 'Collaboration' + 'Common.Views.Collaboration' ], initialize: function() { var me = this; me.addListeners({ - 'Collaboration': { + 'Common.Views.Collaboration': { 'page:show' : me.onPageShow } }); @@ -78,19 +83,23 @@ define([ setApi: function(api) { this.api = api; - this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.changeReview, this)); this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this)); this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this)); + if (editor === 'DE') { + this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.changeReview, this)); + } }, onLaunch: function () { - this.createView('Collaboration').render(); + this.createView('Common.Views.Collaboration').render(); }, setMode: function(mode) { this.appConfig = mode; - _fileKey = mode.fileKey; _userId = mode.user.id; + if (editor === 'DE') { + _fileKey = mode.fileKey; + } return this; }, @@ -99,7 +108,8 @@ define([ var me = this, isAndroid = Framework7.prototype.device.android === true, modalView, - mainView = DE.getController('Editor').getView('Editor').f7View; + appPrefix = !!window.DE ? DE : !!window.PE ? PE : SSE, + mainView = appPrefix.getController('Editor').getView('Editor').f7View; uiApp.closeModal(); @@ -107,7 +117,7 @@ define([ modalView = $$(uiApp.pickerModal( '
' + '' + '
' )).on('opened', function () { @@ -129,7 +139,7 @@ define([ '
' + '
' + '' + '
' + '
' + @@ -149,9 +159,9 @@ define([ }); Common.NotificationCenter.trigger('collaborationcontainer:show'); - this.onPageShow(this.getView('Collaboration')); + this.onPageShow(this.getView('Common.Views.Collaboration')); - DE.getController('Toolbar').getView('Toolbar').hideSearch(); + appPrefix.getController('Toolbar').getView('Toolbar').hideSearch(); }, rootView : function() { @@ -173,13 +183,69 @@ define([ } else if('#edit-users-view' == pageId) { me.initEditUsers(); Common.Utils.addScrollIfNeed('.page[data-page=edit-users-view]', '.page[data-page=edit-users-view] .page-content'); + } else if ('#comments-view' == pageId) { + me.initComments(); + Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content'); } else { - if(!this.appConfig.canReview) { + if(editor === 'DE' && !this.appConfig.canReview) { $('#reviewing-settings').hide(); } } }, + //Edit users + + onChangeEditUsers: function(users) { + editUsers = users; + }, + + initEditUsers: function() { + var usersArray = []; + _.each(editUsers, function(item){ + var fio = item.asc_getUserName().split(' '); + var initials = fio[0].substring(0, 1).toUpperCase(); + if (fio.length > 1) { + initials += fio[fio.length - 1].substring(0, 1).toUpperCase(); + } + if(!item.asc_getView()) { + var userAttr = { + color: item.asc_getColor(), + id: item.asc_getId(), + idOriginal: item.asc_getIdOriginal(), + name: item.asc_getUserName(), + view: item.asc_getView(), + initial: initials + }; + if(item.asc_getIdOriginal() == _userId) { + usersArray.unshift(userAttr); + } else { + usersArray.push(userAttr); + } + } + }); + var userSort = _.chain(usersArray).groupBy('idOriginal').value(); + var templateUserItem = _.template([ + '<% _.each(users, function (user) { %>', + '
  • ' + + '
    ' + + '
    <%= user[0].initial %>
    '+ + '' + + '<% if (user.length>1) { %><% } %>' + + '
    '+ + '
  • ', + '<% }); %>'].join('')); + var templateUserList = _.template( + '
    ' + + this.textEditUser + + '
    ' + + ''); + $('#user-list').html(templateUserList()); + }, + + //Review + initReviewingSettingsView: function () { var me = this; $('#settings-review input:checkbox').attr('checked', this.appConfig.isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); @@ -204,13 +270,14 @@ define([ $checkbox.attr('checked', true); } else { this.api.asc_SetTrackRevisions(state); - Common.localStorage.setItem("de-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0); + var prefix = !!window.DE ? 'de' : !!window.PE ? 'pe' : 'sse'; + Common.localStorage.setItem(prefix + "-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0); } }, onAcceptAllClick: function() { if (this.api) { - this.api.asc_AcceptAllChanges(); + this.api.asc_AcceptAllChanges(); } }, @@ -517,15 +584,15 @@ define([ changetext += ''; changetext += proptext; break; - case Asc.c_oAscRevisionsChangeType.TablePr: - changetext = me.textTableChanged; - break; - case Asc.c_oAscRevisionsChangeType.RowsAdd: - changetext = me.textTableRowsAdd; - break; - case Asc.c_oAscRevisionsChangeType.RowsRem: - changetext = me.textTableRowsDel; - break; + case Asc.c_oAscRevisionsChangeType.TablePr: + changetext = me.textTableChanged; + break; + case Asc.c_oAscRevisionsChangeType.RowsAdd: + changetext = me.textTableRowsAdd; + break; + case Asc.c_oAscRevisionsChangeType.RowsRem: + changetext = me.textTableRowsDel; + break; } var date = (item.get_DateTime() == '') ? new Date() : new Date(item.get_DateTime()), @@ -577,57 +644,6 @@ define([ } }, - onChangeEditUsers: function(users) { - editUsers = users; - }, - - initEditUsers: function() { - var usersArray = []; - _.each(editUsers, function(item){ - var fio = item.asc_getUserName().split(' '); - var initials = fio[0].substring(0, 1).toUpperCase(); - if (fio.length > 1) { - initials += fio[fio.length - 1].substring(0, 1).toUpperCase(); - } - if(!item.asc_getView()) { - var userAttr = { - color: item.asc_getColor(), - id: item.asc_getId(), - idOriginal: item.asc_getIdOriginal(), - name: item.asc_getUserName(), - view: item.asc_getView(), - initial: initials - }; - if(item.asc_getIdOriginal() == _userId) { - usersArray.unshift(userAttr); - } else { - usersArray.push(userAttr); - } - } - }); - var userSort = _.chain(usersArray).groupBy('idOriginal').value(); - var templateUserItem = _.template([ - '<% _.each(users, function (user) { %>', - '
  • ' + - '
    ' + - '
    <%= user[0].initial %>
    '+ - '' + - '<% if (user.length>1) { %><% } %>' + - '
    '+ - '
  • ', - '<% }); %>'].join('')); - var templateUserList = _.template( - '
    ' + - this.textEditUser + - '
    ' + - ''); - $('#user-list').html(templateUserList()); - }, - - - textInserted: 'Inserted:', textDeleted: 'Deleted:', @@ -690,5 +706,5 @@ define([ textEditUser: 'Document is currently being edited by several users.' } - })(), DE.Controllers.Collaboration || {})) + })(), Common.Controllers.Collaboration || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/template/Collaboration.template b/apps/common/mobile/lib/template/Collaboration.template similarity index 93% rename from apps/documenteditor/mobile/app/template/Collaboration.template rename to apps/common/mobile/lib/template/Collaboration.template index 8555c942b..6256a860a 100644 --- a/apps/documenteditor/mobile/app/template/Collaboration.template +++ b/apps/common/mobile/lib/template/Collaboration.template @@ -20,6 +20,7 @@ + <% if (editor === 'DE') { %>
  • @@ -29,6 +30,7 @@
  • + <% } %> @@ -36,6 +38,25 @@ + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    @@ -170,7 +191,7 @@ - + @@ -186,23 +207,4 @@
    - - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/view/Collaboration.js b/apps/common/mobile/lib/view/Collaboration.js similarity index 89% rename from apps/documenteditor/mobile/app/view/Collaboration.js rename to apps/common/mobile/lib/view/Collaboration.js index 22b8db64a..c886a0f5b 100644 --- a/apps/documenteditor/mobile/app/view/Collaboration.js +++ b/apps/common/mobile/lib/view/Collaboration.js @@ -33,22 +33,26 @@ /** * Collaboration.js - * Document Editor * - * Created by Julia Svinareva on 14/5/19 + * Created by Julia Svinareva on 12/7/19 * Copyright (c) 2019 Ascensio System SIA. All rights reserved. * */ +if (Common === undefined) + var Common = {}; + +Common.Views = Common.Views || {}; + define([ - 'text!documenteditor/mobile/app/template/Collaboration.template', + 'text!common/mobile/lib/template/Collaboration.template', 'jquery', 'underscore', 'backbone' ], function (settingsTemplate, $, _, Backbone) { 'use strict'; - DE.Views.Collaboration = Backbone.View.extend(_.extend((function() { + Common.Views.Collaboration = Backbone.View.extend(_.extend((function() { // private return { @@ -81,7 +85,8 @@ define([ android : Common.SharedSettings.get('android'), phone : Common.SharedSettings.get('phone'), orthography: Common.SharedSettings.get('sailfish'), - scope : this + scope : this, + editor : !!window.DE ? 'DE' : !!window.PE ? 'PE' : 'SSE' })); return this; @@ -119,7 +124,10 @@ define([ }, showPage: function(templateId, animate) { - var rootView = DE.getController('Collaboration').rootView(); + var me = this; + var prefix = !!window.DE ? DE : !!window.PE ? PE : SSE; + var rootView = prefix.getController('Common.Controllers.Collaboration').rootView(); + if (rootView && this.layout) { var $content = this.layout.find(templateId); @@ -155,5 +163,5 @@ define([ textEditUsers: 'Users' } - })(), DE.Views.Collaboration || {})) + })(), Common.Views.Collaboration || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/app-dev.js b/apps/documenteditor/mobile/app-dev.js index 768ce7629..db28adc5d 100644 --- a/apps/documenteditor/mobile/app-dev.js +++ b/apps/documenteditor/mobile/app-dev.js @@ -151,7 +151,7 @@ require([ 'AddShape', 'AddImage', 'AddOther', - 'Collaboration' + 'Common.Controllers.Collaboration' ] }); @@ -222,7 +222,7 @@ require([ 'documenteditor/mobile/app/controller/add/AddShape', 'documenteditor/mobile/app/controller/add/AddImage', 'documenteditor/mobile/app/controller/add/AddOther', - 'documenteditor/mobile/app/controller/Collaboration' + 'common/mobile/lib/controller/Collaboration' ], function() { window.compareVersions = true; app.start(); diff --git a/apps/documenteditor/mobile/app.js b/apps/documenteditor/mobile/app.js index 0b3aeb561..465d67e69 100644 --- a/apps/documenteditor/mobile/app.js +++ b/apps/documenteditor/mobile/app.js @@ -162,7 +162,7 @@ require([ 'AddShape', 'AddImage', 'AddOther', - 'Collaboration' + 'Common.Controllers.Collaboration' ] }); @@ -233,7 +233,7 @@ require([ 'documenteditor/mobile/app/controller/add/AddShape', 'documenteditor/mobile/app/controller/add/AddImage', 'documenteditor/mobile/app/controller/add/AddOther', - 'documenteditor/mobile/app/controller/Collaboration' + 'common/mobile/lib/controller/Collaboration' ], function() { app.start(); }); diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index bff7031dc..7ceeca7d4 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -149,14 +149,14 @@ define([ } }); } else if ('review' == eventName) { - var getCollaboration = DE.getController('Collaboration'); + var getCollaboration = DE.getController('Common.Controllers.Collaboration'); getCollaboration.showModal(); - getCollaboration.getView('Collaboration').showPage('#reviewing-settings-view', false); + getCollaboration.getView('Common.Views.Collaboration').showPage('#reviewing-settings-view', false); } else if('reviewchange' == eventName) { - var getCollaboration = DE.getController('Collaboration'); + var getCollaboration = DE.getController('Common.Controllers.Collaboration'); getCollaboration.showModal(); - getCollaboration.getView('Collaboration').showPage('#reviewing-settings-view', false); - getCollaboration.getView('Collaboration').showPage('#change-view', false); + getCollaboration.getView('Common.Views.Collaboration').showPage('#reviewing-settings-view', false); + getCollaboration.getView('Common.Views.Collaboration').showPage('#change-view', false); } else if ('showActionSheet' == eventName && _actionSheets.length > 0) { _.delay(function () { _.each(_actionSheets, function (action) { diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index be2f7dcc9..9ed879014 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -47,7 +47,7 @@ define([ 'underscore', 'backbone', 'documenteditor/mobile/app/view/Settings', - 'documenteditor/mobile/app/controller/Collaboration' + 'common/mobile/lib/controller/Collaboration' ], function (core, $, _, Backbone) { 'use strict'; @@ -249,7 +249,7 @@ define([ $('#settings-download').single('click', _.bind(me.onDownloadOrigin, me)); $('#settings-print').single('click', _.bind(me.onPrint, me)); $('#settings-collaboration').single('click', _.bind(me.clickCollaboration, me)); - var _stateDisplayMode = DE.getController('Collaboration').getDisplayMode(); + var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode(); if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") { $('#settings-document').addClass('disabled'); } @@ -261,7 +261,7 @@ define([ }, clickCollaboration: function() { - DE.getController('Collaboration').showModal(); + DE.getController('Common.Controllers.Collaboration').showModal(); }, onNoCharacters: function(e) { @@ -339,7 +339,7 @@ define([ var value = Common.localStorage.getItem('de-mobile-settings-unit'); value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); $unitMeasurement.val([value]); - var _stateDisplayMode = DE.getController('Collaboration').getDisplayMode(); + var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode(); if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") { $('#settings-no-characters').addClass('disabled'); $('#settings-hidden-borders').addClass('disabled'); diff --git a/apps/documenteditor/mobile/app/view/Toolbar.js b/apps/documenteditor/mobile/app/view/Toolbar.js index 4738c92c5..c941d416c 100644 --- a/apps/documenteditor/mobile/app/view/Toolbar.js +++ b/apps/documenteditor/mobile/app/view/Toolbar.js @@ -153,7 +153,7 @@ define([ //Collaboration showCollaboration: function () { - DE.getController('Collaboration').showModal(); + DE.getController('Common.Controllers.Collaboration').showModal(); }, editDocument: function () { diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 0823b2b2a..ba5c164b2 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -3,6 +3,65 @@ "Common.UI.ThemeColorPalette.textThemeColors": "Theme Colors", "Common.Utils.Metric.txtCm": "cm", "Common.Utils.Metric.txtPt": "pt", + "Common.Controllers.Collaboration.textInserted": "Inserted:", + "Common.Controllers.Collaboration.textDeleted": "Deleted:", + "Common.Controllers.Collaboration.textParaInserted": "Paragraph Inserted", + "Common.Controllers.Collaboration.textParaDeleted": "Paragraph Deleted", + "Common.Controllers.Collaboration.textFormatted": "Formatted", + "Common.Controllers.Collaboration.textParaFormatted": "Paragraph Formatted", + "Common.Controllers.Collaboration.textNot": "Not", + "Common.Controllers.Collaboration.textBold": "Bold", + "Common.Controllers.Collaboration.textItalic": "Italic", + "Common.Controllers.Collaboration.textStrikeout": "Strikeout", + "Common.Controllers.Collaboration.textUnderline": "Underline", + "Common.Controllers.Collaboration.textColor": "Font color", + "Common.Controllers.Collaboration.textBaseline": "Baseline", + "Common.Controllers.Collaboration.textSuperScript": "Superscript", + "Common.Controllers.Collaboration.textSubScript": "Subscript", + "Common.Controllers.Collaboration.textHighlight": "Highlight color", + "Common.Controllers.Collaboration.textSpacing": "Spacing", + "Common.Controllers.Collaboration.textDStrikeout": "Double strikeout", + "Common.Controllers.Collaboration.textCaps": "All caps", + "Common.Controllers.Collaboration.textSmallCaps": "Small caps", + "Common.Controllers.Collaboration.textPosition": "Position", + "Common.Controllers.Collaboration.textShd": "Background color", + "Common.Controllers.Collaboration.textContextual": "Don't add interval between paragraphs of the same style", + "Common.Controllers.Collaboration.textNoContextual": "Add interval between paragraphs of the same style", + "Common.Controllers.Collaboration.textIndentLeft": "Indent left", + "Common.Controllers.Collaboration.textIndentRight": "Indent right", + "Common.Controllers.Collaboration.textFirstLine": "First line", + "Common.Controllers.Collaboration.textRight": "Align right", + "Common.Controllers.Collaboration.textLeft": "Align left", + "Common.Controllers.Collaboration.textCenter": "Align center", + "Common.Controllers.Collaboration.textJustify": "Align justify", + "Common.Controllers.Collaboration.textBreakBefore": "Page break before", + "Common.Controllers.Collaboration.textKeepNext": "Keep with next", + "Common.Controllers.Collaboration.textKeepLines": "Keep lines together", + "Common.Controllers.Collaboration.textNoBreakBefore": "No page break before", + "Common.Controllers.Collaboration.textNoKeepNext": "Don't keep with next", + "Common.Controllers.Collaboration.textNoKeepLines": "Don't keep lines together", + "Common.Controllers.Collaboration.textLineSpacing": "Line Spacing: ", + "Common.Controllers.Collaboration.textMultiple": "multiple", + "Common.Controllers.Collaboration.textAtLeast": "at least", + "Common.Controllers.Collaboration.textExact": "exactly", + "Common.Controllers.Collaboration.textSpacingBefore": "Spacing before", + "Common.Controllers.Collaboration.textSpacingAfter": "Spacing after", + "Common.Controllers.Collaboration.textAuto": "auto", + "Common.Controllers.Collaboration.textWidow": "Widow control", + "Common.Controllers.Collaboration.textNoWidow": "No widow control", + "Common.Controllers.Collaboration.textTabs": "Change tabs", + "Common.Controllers.Collaboration.textNum": "Change numbering", + "Common.Controllers.Collaboration.textEquation": "Equation", + "Common.Controllers.Collaboration.textImage": "Image", + "Common.Controllers.Collaboration.textChart": "Chart", + "Common.Controllers.Collaboration.textShape": "Shape", + "Common.Controllers.Collaboration.textTableChanged": "Table Settings Changed", + "Common.Controllers.Collaboration.textTableRowsAdd": "Table Rows Added", + "Common.Controllers.Collaboration.textTableRowsDel": "Table Rows Deleted", + "Common.Controllers.Collaboration.textParaMoveTo": "Moved:", + "Common.Controllers.Collaboration.textParaMoveFromUp": "Moved Up:", + "Common.Controllers.Collaboration.textParaMoveFromDown": "Moved Down:", + "Common.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.", "DE.Controllers.AddContainer.textImage": "Image", "DE.Controllers.AddContainer.textOther": "Other", "DE.Controllers.AddContainer.textShape": "Shape", @@ -185,65 +244,6 @@ "DE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application", "DE.Controllers.Toolbar.leaveButtonText": "Leave this Page", "DE.Controllers.Toolbar.stayButtonText": "Stay on this Page", - "DE.Controllers.Collaboration.textInserted": "Inserted:", - "DE.Controllers.Collaboration.textDeleted": "Deleted:", - "DE.Controllers.Collaboration.textParaInserted": "Paragraph Inserted", - "DE.Controllers.Collaboration.textParaDeleted": "Paragraph Deleted", - "DE.Controllers.Collaboration.textFormatted": "Formatted", - "DE.Controllers.Collaboration.textParaFormatted": "Paragraph Formatted", - "DE.Controllers.Collaboration.textNot": "Not", - "DE.Controllers.Collaboration.textBold": "Bold", - "DE.Controllers.Collaboration.textItalic": "Italic", - "DE.Controllers.Collaboration.textStrikeout": "Strikeout", - "DE.Controllers.Collaboration.textUnderline": "Underline", - "DE.Controllers.Collaboration.textColor": "Font color", - "DE.Controllers.Collaboration.textBaseline": "Baseline", - "DE.Controllers.Collaboration.textSuperScript": "Superscript", - "DE.Controllers.Collaboration.textSubScript": "Subscript", - "DE.Controllers.Collaboration.textHighlight": "Highlight color", - "DE.Controllers.Collaboration.textSpacing": "Spacing", - "DE.Controllers.Collaboration.textDStrikeout": "Double strikeout", - "DE.Controllers.Collaboration.textCaps": "All caps", - "DE.Controllers.Collaboration.textSmallCaps": "Small caps", - "DE.Controllers.Collaboration.textPosition": "Position", - "DE.Controllers.Collaboration.textShd": "Background color", - "DE.Controllers.Collaboration.textContextual": "Don't add interval between paragraphs of the same style", - "DE.Controllers.Collaboration.textNoContextual": "Add interval between paragraphs of the same style", - "DE.Controllers.Collaboration.textIndentLeft": "Indent left", - "DE.Controllers.Collaboration.textIndentRight": "Indent right", - "DE.Controllers.Collaboration.textFirstLine": "First line", - "DE.Controllers.Collaboration.textRight": "Align right", - "DE.Controllers.Collaboration.textLeft": "Align left", - "DE.Controllers.Collaboration.textCenter": "Align center", - "DE.Controllers.Collaboration.textJustify": "Align justify", - "DE.Controllers.Collaboration.textBreakBefore": "Page break before", - "DE.Controllers.Collaboration.textKeepNext": "Keep with next", - "DE.Controllers.Collaboration.textKeepLines": "Keep lines together", - "DE.Controllers.Collaboration.textNoBreakBefore": "No page break before", - "DE.Controllers.Collaboration.textNoKeepNext": "Don't keep with next", - "DE.Controllers.Collaboration.textNoKeepLines": "Don't keep lines together", - "DE.Controllers.Collaboration.textLineSpacing": "Line Spacing: ", - "DE.Controllers.Collaboration.textMultiple": "multiple", - "DE.Controllers.Collaboration.textAtLeast": "at least", - "DE.Controllers.Collaboration.textExact": "exactly", - "DE.Controllers.Collaboration.textSpacingBefore": "Spacing before", - "DE.Controllers.Collaboration.textSpacingAfter": "Spacing after", - "DE.Controllers.Collaboration.textAuto": "auto", - "DE.Controllers.Collaboration.textWidow": "Widow control", - "DE.Controllers.Collaboration.textNoWidow": "No widow control", - "DE.Controllers.Collaboration.textTabs": "Change tabs", - "DE.Controllers.Collaboration.textNum": "Change numbering", - "DE.Controllers.Collaboration.textEquation": "Equation", - "DE.Controllers.Collaboration.textImage": "Image", - "DE.Controllers.Collaboration.textChart": "Chart", - "DE.Controllers.Collaboration.textShape": "Shape", - "DE.Controllers.Collaboration.textTableChanged": "Table Settings Changed", - "DE.Controllers.Collaboration.textTableRowsAdd": "Table Rows Added", - "DE.Controllers.Collaboration.textTableRowsDel": "Table Rows Deleted", - "DE.Controllers.Collaboration.textParaMoveTo": "Moved:", - "DE.Controllers.Collaboration.textParaMoveFromUp": "Moved Up:", - "DE.Controllers.Collaboration.textParaMoveFromDown": "Moved Down:", - "DE.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.", "DE.Views.AddImage.textAddress": "Address", "DE.Views.AddImage.textBack": "Back", "DE.Views.AddImage.textFromLibrary": "Picture from Library", @@ -493,17 +493,17 @@ "DE.Views.Settings.textNoCharacters": "Nonprinting Characters", "DE.Views.Settings.textHiddenTableBorders": "Hidden Table Borders", "DE.Views.Toolbar.textBack": "Back", - "DE.Views.Collaboration.textCollaboration": "Collaboration", - "DE.Views.Collaboration.textReviewing": "Review", - "DE.Views.Collaboration.textСomments": "Сomments", - "DE.Views.Collaboration.textBack": "Back", - "DE.Views.Collaboration.textReview": "Track Changes", - "DE.Views.Collaboration.textAcceptAllChanges": "Accept All Changes", - "DE.Views.Collaboration.textRejectAllChanges": "Reject All Changes", - "DE.Views.Collaboration.textDisplayMode": "Display Mode", - "DE.Views.Collaboration.textMarkup": "Markup", - "DE.Views.Collaboration.textFinal": "Final", - "DE.Views.Collaboration.textOriginal": "Original", - "DE.Views.Collaboration.textChange": "Review Change", - "DE.Views.Collaboration.textEditUsers": "Users" + "Common.Views.Collaboration.textCollaboration": "Collaboration", + "Common.Views.Collaboration.textReviewing": "Review", + "Common.Views.Collaboration.textСomments": "Сomments", + "Common.Views.Collaboration.textBack": "Back", + "Common.Views.Collaboration.textReview": "Track Changes", + "Common.Views.Collaboration.textAcceptAllChanges": "Accept All Changes", + "Common.Views.Collaboration.textRejectAllChanges": "Reject All Changes", + "Common.Views.Collaboration.textDisplayMode": "Display Mode", + "Common.Views.Collaboration.textMarkup": "Markup", + "Common.Views.Collaboration.textFinal": "Final", + "Common.Views.Collaboration.textOriginal": "Original", + "Common.Views.Collaboration.textChange": "Review Change", + "Common.Views.Collaboration.textEditUsers": "Users" } \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app-dev.js b/apps/presentationeditor/mobile/app-dev.js index eb062d384..575778b44 100644 --- a/apps/presentationeditor/mobile/app-dev.js +++ b/apps/presentationeditor/mobile/app-dev.js @@ -149,7 +149,7 @@ require([ 'AddImage', 'AddLink', 'AddSlide', - 'Collaboration' + 'Common.Controllers.Collaboration' ] }); @@ -218,7 +218,7 @@ require([ 'presentationeditor/mobile/app/controller/add/AddImage', 'presentationeditor/mobile/app/controller/add/AddLink', 'presentationeditor/mobile/app/controller/add/AddSlide', - 'presentationeditor/mobile/app/controller/Collaboration' + 'common/mobile/lib/controller/Collaboration' ], function() { window.compareVersions = true; diff --git a/apps/presentationeditor/mobile/app.js b/apps/presentationeditor/mobile/app.js index 5103851de..c2f9901d1 100644 --- a/apps/presentationeditor/mobile/app.js +++ b/apps/presentationeditor/mobile/app.js @@ -160,7 +160,7 @@ require([ 'AddImage', 'AddLink', 'AddSlide', - 'Collaboration' + 'Common.Controllers.Collaboration' ] }); @@ -229,7 +229,7 @@ require([ 'presentationeditor/mobile/app/controller/add/AddImage', 'presentationeditor/mobile/app/controller/add/AddLink', 'presentationeditor/mobile/app/controller/add/AddSlide', - 'presentationeditor/mobile/app/controller/Collaboration' + 'common/mobile/lib/controller/Collaboration' ], function() { app.start(); }); diff --git a/apps/presentationeditor/mobile/app/controller/Collaboration.js b/apps/presentationeditor/mobile/app/controller/Collaboration.js deleted file mode 100644 index ac31c2bf5..000000000 --- a/apps/presentationeditor/mobile/app/controller/Collaboration.js +++ /dev/null @@ -1,217 +0,0 @@ -/* - * - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ - -/** - * Collaboration.js - * Presentation Editor - * - * Created by Julia Svinareva on 31/5/19 - * Copyright (c) 2019 Ascensio System SIA. All rights reserved. - * - */ -define([ - 'core', - 'jquery', - 'underscore', - 'backbone', - 'presentationeditor/mobile/app/view/Collaboration' -], function (core, $, _, Backbone) { - 'use strict'; - - PE.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() { - // Private - var rootView, - _userId, - editUsers = []; - - return { - models: [], - collections: [], - views: [ - 'Collaboration' - ], - - initialize: function() { - var me = this; - me.addListeners({ - 'Collaboration': { - 'page:show' : me.onPageShow - } - }); - }, - - setApi: function(api) { - this.api = api; - this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this)); - this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this)); - }, - - onLaunch: function () { - this.createView('Collaboration').render(); - }, - - setMode: function(mode) { - this.appConfig = mode; - _userId = mode.user.id; - return this; - }, - - - showModal: function() { - var me = this, - isAndroid = Framework7.prototype.device.android === true, - modalView, - mainView = PE.getController('Editor').getView('Editor').f7View; - - uiApp.closeModal(); - - if (Common.SharedSettings.get('phone')) { - modalView = $$(uiApp.pickerModal( - '
    ' + - '' + - '
    ' - )).on('opened', function () { - if (_.isFunction(me.api.asc_OnShowContextMenu)) { - me.api.asc_OnShowContextMenu() - } - }).on('close', function (e) { - mainView.showNavbar(); - }).on('closed', function () { - if (_.isFunction(me.api.asc_OnHideContextMenu)) { - me.api.asc_OnHideContextMenu() - } - }); - mainView.hideNavbar(); - } else { - modalView = uiApp.popover( - '
    ' + - '
    ' + - '
    ' + - '
    ' + - '' + - '
    ' + - '
    ' + - '
    ', - $$('#toolbar-collaboration') - ); - } - - if (Framework7.prototype.device.android === true) { - $$('.view.collaboration-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed'); - $$('.view.collaboration-root-view .navbar').prependTo('.view.collaboration-root-view > .pages > .page'); - } - - rootView = uiApp.addView('.collaboration-root-view', { - dynamicNavbar: true, - domCache: true - }); - - Common.NotificationCenter.trigger('collaborationcontainer:show'); - this.onPageShow(this.getView('Collaboration')); - - PE.getController('Toolbar').getView('Toolbar').hideSearch(); - }, - - rootView : function() { - return rootView; - }, - - onPageShow: function(view, pageId) { - var me = this; - - if('#edit-users-view' == pageId) { - me.initEditUsers(); - Common.Utils.addScrollIfNeed('.page[data-page=edit-users-view]', '.page[data-page=edit-users-view] .page-content'); - } else { - } - }, - - onChangeEditUsers: function(users) { - editUsers = users; - }, - - initEditUsers: function() { - var usersArray = []; - _.each(editUsers, function(item){ - var fio = item.asc_getUserName().split(' '); - var initials = fio[0].substring(0, 1).toUpperCase(); - if (fio.length > 1) { - initials += fio[fio.length - 1].substring(0, 1).toUpperCase(); - } - if(!item.asc_getView()) { - var userAttr = { - color: item.asc_getColor(), - id: item.asc_getId(), - idOriginal: item.asc_getIdOriginal(), - name: item.asc_getUserName(), - view: item.asc_getView(), - initial: initials - }; - if(item.asc_getIdOriginal() == _userId) { - usersArray.unshift(userAttr); - } else { - usersArray.push(userAttr); - } - } - }); - var userSort = _.chain(usersArray).groupBy('idOriginal').value(); - var templateUserItem = _.template([ - '<% _.each(users, function (user) { %>', - '
  • ' + - '
    ' + - '
    <%= user[0].initial %>
    '+ - '' + - '<% if (user.length>1) { %><% } %>' + - '
    '+ - '
  • ', - '<% }); %>'].join('')); - var templateUserList = _.template( - '
    ' + - this.textEditUser + - '
    ' + - '
      ' + - templateUserItem({users: userSort}) + - '
    '); - $('#user-list').html(templateUserList()); - }, - - - textEditUser: 'Document is currently being edited by several users.' - - } - })(), PE.Controllers.Collaboration || {})) -}); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index 14050c3e0..43472adc2 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -194,7 +194,7 @@ define([ }, onCollaboration: function() { - PE.getController('Collaboration').showModal(); + PE.getController('Common.Controllers.Collaboration').showModal(); }, initPageColorSchemes: function () { diff --git a/apps/presentationeditor/mobile/app/template/Collaboration.template b/apps/presentationeditor/mobile/app/template/Collaboration.template deleted file mode 100644 index 599f0a369..000000000 --- a/apps/presentationeditor/mobile/app/template/Collaboration.template +++ /dev/null @@ -1,47 +0,0 @@ - -
    - - -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/view/Collaboration.js b/apps/presentationeditor/mobile/app/view/Collaboration.js deleted file mode 100644 index 6b8299f82..000000000 --- a/apps/presentationeditor/mobile/app/view/Collaboration.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ - -/** - * Collaboration.js - * Presentation Editor - * - * Created by Julia Svinareva on 31/5/19 - * Copyright (c) 2019 Ascensio System SIA. All rights reserved. - * - */ - -define([ - 'text!presentationeditor/mobile/app/template/Collaboration.template', - 'jquery', - 'underscore', - 'backbone' -], function (settingsTemplate, $, _, Backbone) { - 'use strict'; - - PE.Views.Collaboration = Backbone.View.extend(_.extend((function() { - // private - - return { - - template: _.template(settingsTemplate), - - events: { - // - }, - - initialize: function() { - Common.NotificationCenter.on('collaborationcontainer:show', _.bind(this.initEvents, this)); - this.on('page:show', _.bind(this.updateItemHandlers, this)); - }, - - initEvents: function () { - var me = this; - - Common.Utils.addScrollIfNeed('.view[data-page=collaboration-root-view] .pages', '.view[data-page=collaboration-root-view] .page'); - me.updateItemHandlers(); - }, - - initControls: function() { - // - }, - - // Render layout - render: function() { - this.layout = $('
    ').append(this.template({ - android : Common.SharedSettings.get('android'), - phone : Common.SharedSettings.get('phone'), - orthography: Common.SharedSettings.get('sailfish'), - scope : this - })); - - return this; - }, - - updateItemHandlers: function () { - var selectorsDynamicPage = [ - '.page[data-page=collaboration-root-view]' - ].map(function (selector) { - return selector + ' a.item-link[data-page]'; - }).join(', '); - - $(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this)); - }, - - onItemClick: function (e) { - var $target = $(e.currentTarget), - page = $target.data('page'); - - if (page && page.length > 0 ) { - this.showPage(page); - } - }, - - rootLayout: function () { - if (this.layout) { - var $layour = this.layout.find('#collaboration-root-view'), - isPhone = Common.SharedSettings.get('phone'); - - return $layour.html(); - } - - return ''; - }, - - showPage: function(templateId, animate) { - var rootView = PE.getController('Collaboration').rootView(); - - if (rootView && this.layout) { - var $content = this.layout.find(templateId); - - // Android fix for navigation - if (Framework7.prototype.device.android) { - $content.find('.page').append($content.find('.navbar')); - } - - rootView.router.load({ - content: $content.html(), - animatePages: animate !== false - }); - - this.fireEvent('page:show', [this, templateId]); - } - }, - - - - textCollaboration: 'Collaboration', - textСomments: 'Сomments', - textBack: 'Back', - textEditUsers: 'Users' - - } - })(), PE.Views.Collaboration || {})) -}); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/view/Toolbar.js b/apps/presentationeditor/mobile/app/view/Toolbar.js index e71a47607..6e7c74ded 100644 --- a/apps/presentationeditor/mobile/app/view/Toolbar.js +++ b/apps/presentationeditor/mobile/app/view/Toolbar.js @@ -162,7 +162,7 @@ define([ //Collaboration showCollaboration: function () { - PE.getController('Collaboration').showModal(); + PE.getController('Common.Controllers.Collaboration').showModal(); }, textBack: 'Back' diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 43260e8f6..389a52701 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -226,7 +226,7 @@ "PE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application", "PE.Controllers.Toolbar.leaveButtonText": "Leave this Page", "PE.Controllers.Toolbar.stayButtonText": "Stay on this Page", - "PE.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.", + "Common.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.", "PE.Views.AddImage.textAddress": "Address", "PE.Views.AddImage.textBack": "Back", "PE.Views.AddImage.textFromLibrary": "Picture from Library", @@ -477,8 +477,8 @@ "PE.Views.Settings.unknownText": "Unknown", "PE.Views.Settings.textCollaboration": "Collaboration", "PE.Views.Toolbar.textBack": "Back", - "PE.Views.Collaboration.textCollaboration": "Collaboration", - "PE.Views.Collaboration.textСomments": "Сomments", - "PE.Views.Collaboration.textBack": "Back", - "PE.Views.Collaboration.textEditUsers": "Users" + "Common.Views.Collaboration.textCollaboration": "Collaboration", + "Common.Views.Collaboration.textСomments": "Сomments", + "Common.Views.Collaboration.textBack": "Back", + "Common.Views.Collaboration.textEditUsers": "Users" } \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/app-dev.js b/apps/spreadsheeteditor/mobile/app-dev.js index 0a41b8910..1a92b9ba2 100644 --- a/apps/spreadsheeteditor/mobile/app-dev.js +++ b/apps/spreadsheeteditor/mobile/app-dev.js @@ -134,8 +134,8 @@ require([ ,'AddShape' ,'AddOther' ,'AddLink' - ,'Collaboration' ,'FilterOptions' + ,'Common.Controllers.Collaboration' ] }); @@ -207,8 +207,8 @@ require([ ,'spreadsheeteditor/mobile/app/controller/add/AddShape' ,'spreadsheeteditor/mobile/app/controller/add/AddOther' ,'spreadsheeteditor/mobile/app/controller/add/AddLink' - ,'spreadsheeteditor/mobile/app/controller/Collaboration' ,'spreadsheeteditor/mobile/app/controller/FilterOptions' + ,'common/mobile/lib/controller/Collaboration' ], function() { window.compareVersions = true; app.start(); diff --git a/apps/spreadsheeteditor/mobile/app.js b/apps/spreadsheeteditor/mobile/app.js index 1f518f056..82d26b8e4 100644 --- a/apps/spreadsheeteditor/mobile/app.js +++ b/apps/spreadsheeteditor/mobile/app.js @@ -145,8 +145,8 @@ require([ ,'AddShape' ,'AddOther' ,'AddLink' - ,'Collaboration' ,'FilterOptions' + ,'Common.Controllers.Collaboration' ] }); @@ -218,8 +218,8 @@ require([ ,'spreadsheeteditor/mobile/app/controller/add/AddShape' ,'spreadsheeteditor/mobile/app/controller/add/AddOther' ,'spreadsheeteditor/mobile/app/controller/add/AddLink' - ,'spreadsheeteditor/mobile/app/controller/Collaboration' ,'spreadsheeteditor/mobile/app/controller/FilterOptions' + ,'common/mobile/lib/controller/Collaboration' ], function() { app.start(); }); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Collaboration.js b/apps/spreadsheeteditor/mobile/app/controller/Collaboration.js deleted file mode 100644 index 2e98a912e..000000000 --- a/apps/spreadsheeteditor/mobile/app/controller/Collaboration.js +++ /dev/null @@ -1,217 +0,0 @@ -/* - * - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ - -/** - * Collaboration.js - * Spreadsheet Editor - * - * Created by Julia Svinareva on 4/6/19 - * Copyright (c) 2019 Ascensio System SIA. All rights reserved. - * - */ -define([ - 'core', - 'jquery', - 'underscore', - 'backbone', - 'spreadsheeteditor/mobile/app/view/Collaboration' -], function (core, $, _, Backbone) { - 'use strict'; - - SSE.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() { - // Private - var rootView, - _userId, - editUsers = []; - - return { - models: [], - collections: [], - views: [ - 'Collaboration' - ], - - initialize: function() { - var me = this; - me.addListeners({ - 'Collaboration': { - 'page:show' : me.onPageShow - } - }); - }, - - setApi: function(api) { - this.api = api; - this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this)); - this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this)); - }, - - onLaunch: function () { - this.createView('Collaboration').render(); - }, - - setMode: function(mode) { - this.appConfig = mode; - _userId = mode.user.id; - return this; - }, - - - showModal: function() { - var me = this, - isAndroid = Framework7.prototype.device.android === true, - modalView, - mainView = SSE.getController('Editor').getView('Editor').f7View; - - uiApp.closeModal(); - - if (Common.SharedSettings.get('phone')) { - modalView = $$(uiApp.pickerModal( - '
    ' + - '' + - '
    ' - )).on('opened', function () { - if (_.isFunction(me.api.asc_OnShowContextMenu)) { - me.api.asc_OnShowContextMenu() - } - }).on('close', function (e) { - mainView.showNavbar(); - }).on('closed', function () { - if (_.isFunction(me.api.asc_OnHideContextMenu)) { - me.api.asc_OnHideContextMenu() - } - }); - mainView.hideNavbar(); - } else { - modalView = uiApp.popover( - '
    ' + - '
    ' + - '
    ' + - '
    ' + - '' + - '
    ' + - '
    ' + - '
    ', - $$('#toolbar-collaboration') - ); - } - - if (Framework7.prototype.device.android === true) { - $$('.view.collaboration-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed'); - $$('.view.collaboration-root-view .navbar').prependTo('.view.collaboration-root-view > .pages > .page'); - } - - rootView = uiApp.addView('.collaboration-root-view', { - dynamicNavbar: true, - domCache: true - }); - - Common.NotificationCenter.trigger('collaborationcontainer:show'); - this.onPageShow(this.getView('Collaboration')); - - SSE.getController('Toolbar').getView('Toolbar').hideSearch(); - }, - - rootView : function() { - return rootView; - }, - - onPageShow: function(view, pageId) { - var me = this; - - if('#edit-users-view' == pageId) { - me.initEditUsers(); - Common.Utils.addScrollIfNeed('.page[data-page=edit-users-view]', '.page[data-page=edit-users-view] .page-content'); - } else { - } - }, - - onChangeEditUsers: function(users) { - editUsers = users; - }, - - initEditUsers: function() { - var usersArray = []; - _.each(editUsers, function(item){ - var fio = item.asc_getUserName().split(' '); - var initials = fio[0].substring(0, 1).toUpperCase(); - if (fio.length > 1) { - initials += fio[fio.length - 1].substring(0, 1).toUpperCase(); - } - if(!item.asc_getView()) { - var userAttr = { - color: item.asc_getColor(), - id: item.asc_getId(), - idOriginal: item.asc_getIdOriginal(), - name: item.asc_getUserName(), - view: item.asc_getView(), - initial: initials - }; - if(item.asc_getIdOriginal() == _userId) { - usersArray.unshift(userAttr); - } else { - usersArray.push(userAttr); - } - } - }); - var userSort = _.chain(usersArray).groupBy('idOriginal').value(); - var templateUserItem = _.template([ - '<% _.each(users, function (user) { %>', - '
  • ' + - '
    ' + - '
    <%= user[0].initial %>
    '+ - '' + - '<% if (user.length>1) { %><% } %>' + - '
    '+ - '
  • ', - '<% }); %>'].join('')); - var templateUserList = _.template( - '
    ' + - this.textEditUser + - '
    ' + - '
      ' + - templateUserItem({users: userSort}) + - '
    '); - $('#user-list').html(templateUserList()); - }, - - - textEditUser: 'Document is currently being edited by several users.' - - } - })(), SSE.Controllers.Collaboration || {})) -}); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 26966e450..7babd4a74 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -282,7 +282,7 @@ define([ }, onCollaboration: function() { - SSE.getController('Collaboration').showModal(); + SSE.getController('Common.Controllers.Collaboration').showModal(); }, initSpreadsheetSettings: function() { diff --git a/apps/spreadsheeteditor/mobile/app/template/Collaboration.template b/apps/spreadsheeteditor/mobile/app/template/Collaboration.template deleted file mode 100644 index 599f0a369..000000000 --- a/apps/spreadsheeteditor/mobile/app/template/Collaboration.template +++ /dev/null @@ -1,47 +0,0 @@ - -
    - - -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/app/view/Collaboration.js b/apps/spreadsheeteditor/mobile/app/view/Collaboration.js deleted file mode 100644 index be4328c70..000000000 --- a/apps/spreadsheeteditor/mobile/app/view/Collaboration.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * - * (c) Copyright Ascensio System SIA 2010-2019 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha - * street, Riga, Latvia, EU, LV-1050. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ - -/** - * Collaboration.js - * Presentation Editor - * - * Created by Julia Svinareva on 31/5/19 - * Copyright (c) 2019 Ascensio System SIA. All rights reserved. - * - */ - -define([ - 'text!spreadsheeteditor/mobile/app/template/Collaboration.template', - 'jquery', - 'underscore', - 'backbone' -], function (settingsTemplate, $, _, Backbone) { - 'use strict'; - - SSE.Views.Collaboration = Backbone.View.extend(_.extend((function() { - // private - - return { - - template: _.template(settingsTemplate), - - events: { - // - }, - - initialize: function() { - Common.NotificationCenter.on('collaborationcontainer:show', _.bind(this.initEvents, this)); - this.on('page:show', _.bind(this.updateItemHandlers, this)); - }, - - initEvents: function () { - var me = this; - - Common.Utils.addScrollIfNeed('.view[data-page=collaboration-root-view] .pages', '.view[data-page=collaboration-root-view] .page'); - me.updateItemHandlers(); - }, - - initControls: function() { - // - }, - - // Render layout - render: function() { - this.layout = $('
    ').append(this.template({ - android : Common.SharedSettings.get('android'), - phone : Common.SharedSettings.get('phone'), - orthography: Common.SharedSettings.get('sailfish'), - scope : this - })); - - return this; - }, - - updateItemHandlers: function () { - var selectorsDynamicPage = [ - '.page[data-page=collaboration-root-view]' - ].map(function (selector) { - return selector + ' a.item-link[data-page]'; - }).join(', '); - - $(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this)); - }, - - onItemClick: function (e) { - var $target = $(e.currentTarget), - page = $target.data('page'); - - if (page && page.length > 0 ) { - this.showPage(page); - } - }, - - rootLayout: function () { - if (this.layout) { - var $layour = this.layout.find('#collaboration-root-view'), - isPhone = Common.SharedSettings.get('phone'); - - return $layour.html(); - } - - return ''; - }, - - showPage: function(templateId, animate) { - var rootView = SSE.getController('Collaboration').rootView(); - - if (rootView && this.layout) { - var $content = this.layout.find(templateId); - - // Android fix for navigation - if (Framework7.prototype.device.android) { - $content.find('.page').append($content.find('.navbar')); - } - - rootView.router.load({ - content: $content.html(), - animatePages: animate !== false - }); - - this.fireEvent('page:show', [this, templateId]); - } - }, - - - - textCollaboration: 'Collaboration', - textСomments: 'Сomments', - textBack: 'Back', - textEditUsers: 'Users' - - } - })(), SSE.Views.Collaboration || {})) -}); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/app/view/Toolbar.js b/apps/spreadsheeteditor/mobile/app/view/Toolbar.js index d5bc17b8e..00bfacc15 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/mobile/app/view/Toolbar.js @@ -158,7 +158,7 @@ define([ //Collaboration showCollaboration: function () { - SSE.getController('Collaboration').showModal(); + SSE.getController('Common.Controllers.Collaboration').showModal(); }, textBack: 'Back' diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 801de3914..e897f9296 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -300,7 +300,7 @@ "SSE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application", "SSE.Controllers.Toolbar.leaveButtonText": "Leave this Page", "SSE.Controllers.Toolbar.stayButtonText": "Stay on this Page", - "SSE.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.", + "Common.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.", "SSE.Controllers.FilterOptions.textEmptyItem": "{Blanks}", "SSE.Controllers.FilterOptions.textSelectAll": "Select All", "SSE.Controllers.FilterOptions.textErrorTitle": "Warning", @@ -556,10 +556,10 @@ "SSE.Views.Settings.textR1C1Style": "R1C1 Reference Style", "SSE.Views.Settings.textRegionalSettings": "Regional Settings", "SSE.Views.Toolbar.textBack": "Back", - "SSE.Views.Collaboration.textCollaboration": "Collaboration", - "SSE.Views.Collaboration.textСomments": "Сomments", - "SSE.Views.Collaboration.textBack": "Back", - "SSE.Views.Collaboration.textEditUsers": "Users", + "Common.Views.Collaboration.textCollaboration": "Collaboration", + "Common.Views.Collaboration.textСomments": "Сomments", + "Common.Views.Collaboration.textBack": "Back", + "Common.Views.Collaboration.textEditUsers": "Users", "SSE.Views.FilterOptions.textFilter": "Filter Options", "SSE.Views.FilterOptions.textClearFilter": "Clear Filter", "SSE.Views.FilterOptions.textDeleteFilter": "Delete Filter" From a8db76ea39a48db72f723c0005f00799408ecbd0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Jul 2019 15:07:53 +0300 Subject: [PATCH 002/154] Move selecting comment on loading document to sdkjs --- apps/common/main/lib/controller/Comments.js | 13 +------------ apps/documenteditor/main/app/controller/Main.js | 7 ------- apps/presentationeditor/main/app/controller/Main.js | 7 ------- apps/spreadsheeteditor/main/app/controller/Main.js | 7 ------- 4 files changed, 1 insertion(+), 33 deletions(-) diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index 855e85b5a..24c937fd5 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -130,7 +130,6 @@ define([ }); Common.NotificationCenter.on('comments:updatefilter', _.bind(this.onUpdateFilter, this)); - Common.NotificationCenter.on('comments:showaction', _.bind(this.onShowAction, this)); Common.NotificationCenter.on('app:comment:add', _.bind(this.onAppAddComment, this)); Common.NotificationCenter.on('layout:changed', function(area){ Common.Utils.asyncCall(function(e) { @@ -282,12 +281,7 @@ define([ return false; }, onShowComment: function (id, selected) { - var comment; - if (typeof id == 'object') { - comment = id; - id = comment.get('uid'); - } else - comment = this.findComment(id); + var comment = this.findComment(id); if (comment) { if (null !== comment.get('quote')) { if (this.api) { @@ -1528,11 +1522,6 @@ define([ clearCollections: function() { this.collection.reset(); this.groupCollection = []; - }, - - onShowAction: function(id, selected) { - var comment = this.collection.findWhere({guid: id}); - comment && this.onShowComment(comment, selected); } }, Common.Controllers.Comments || {})); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 28b0d65d7..252208ffa 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -195,7 +195,6 @@ define([ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); - Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this)); this.isShowOpenDialog = false; @@ -1045,12 +1044,6 @@ define([ Common.Gateway.documentReady(); }, - onDocumentReady: function() { - if (this.editorConfig.actionLink && this.editorConfig.actionLink.action && this.editorConfig.actionLink.action.type == 'comment') { - Common.NotificationCenter.trigger('comments:showaction', this.editorConfig.actionLink.action.data, false); - } - }, - onLicenseChanged: function(params) { var licType = params.asc_getLicenseType(); if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' && diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index a16b70921..0d7d7bbc2 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -180,7 +180,6 @@ define([ this.api.asc_registerCallback('asc_onSpellCheckInit', _.bind(this.loadLanguages, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); - Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this)); this.isShowOpenDialog = false; @@ -790,12 +789,6 @@ define([ Common.Gateway.documentReady(); }, - onDocumentReady: function() { - if (this.editorConfig.actionLink && this.editorConfig.actionLink.action && this.editorConfig.actionLink.action.type == 'comment') { - Common.NotificationCenter.trigger('comments:showaction', this.editorConfig.actionLink.action.data, false); - } - }, - onLicenseChanged: function(params) { var licType = params.asc_getLicenseType(); if (licType !== undefined && this.appOptions.canEdit && this.editorConfig.mode !== 'view' && diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index b07853775..cf40a13df 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -168,7 +168,6 @@ define([ Common.NotificationCenter.on('goback', _.bind(this.goBack, this)); Common.NotificationCenter.on('namedrange:locked', _.bind(this.onNamedRangeLocked, this)); Common.NotificationCenter.on('download:cancel', _.bind(this.onDownloadCancel, this)); - Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this)); this.stackLongActions = new Common.IrregularStack({ strongCompare : this._compareActionStrong, @@ -801,12 +800,6 @@ define([ Common.Gateway.documentReady(); }, - onDocumentReady: function() { - if (this.editorConfig.actionLink && this.editorConfig.actionLink.action && this.editorConfig.actionLink.action.type == 'comment') { - Common.NotificationCenter.trigger('comments:showaction', this.editorConfig.actionLink.action.data, false); - } - }, - onLicenseChanged: function(params) { if (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) return; From 4af91fb4f8dd29a595a98bdcef0ecfedb3414653 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Jul 2019 15:19:21 +0300 Subject: [PATCH 003/154] Bug 33669 --- apps/documenteditor/main/app/view/RightMenu.js | 6 ++++-- apps/presentationeditor/main/app/view/RightMenu.js | 3 ++- apps/spreadsheeteditor/main/app/view/RightMenu.js | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/view/RightMenu.js b/apps/documenteditor/main/app/view/RightMenu.js index 6afb0a335..e33266c43 100644 --- a/apps/documenteditor/main/app/view/RightMenu.js +++ b/apps/documenteditor/main/app/view/RightMenu.js @@ -187,7 +187,8 @@ define([ asctype: Common.Utils.documentSettingsType.MailMerge, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this._settings[Common.Utils.documentSettingsType.MailMerge] = {panel: "id-mail-merge-settings", btn: this.btnMailMerge}; @@ -202,7 +203,8 @@ define([ asctype: Common.Utils.documentSettingsType.Signature, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this._settings[Common.Utils.documentSettingsType.Signature] = {panel: "id-signature-settings", btn: this.btnSignature}; diff --git a/apps/presentationeditor/main/app/view/RightMenu.js b/apps/presentationeditor/main/app/view/RightMenu.js index 2304e2458..58462c338 100644 --- a/apps/presentationeditor/main/app/view/RightMenu.js +++ b/apps/presentationeditor/main/app/view/RightMenu.js @@ -186,7 +186,8 @@ define([ asctype: Common.Utils.documentSettingsType.Signature, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this._settings[Common.Utils.documentSettingsType.Signature] = {panel: "id-signature-settings", btn: this.btnSignature}; diff --git a/apps/spreadsheeteditor/main/app/view/RightMenu.js b/apps/spreadsheeteditor/main/app/view/RightMenu.js index 49c5a9803..1706af412 100644 --- a/apps/spreadsheeteditor/main/app/view/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/view/RightMenu.js @@ -202,7 +202,8 @@ define([ asctype: Common.Utils.documentSettingsType.Signature, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this._settings[Common.Utils.documentSettingsType.Signature] = {panel: "id-signature-settings", btn: this.btnSignature}; From fc5d7781341df540407ba9a0ff5c8ebf00a3de2b Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 18 Jul 2019 11:08:26 +0300 Subject: [PATCH 004/154] [Common mobile] Add Comments into Collaboration --- .../mobile/lib/controller/Collaboration.js | 215 ++++++++++++++++++ .../lib/template/Collaboration.template | 29 +++ apps/common/mobile/lib/view/Collaboration.js | 38 ++++ .../resources/less/ios/_collaboration.less | 95 ++++++++ .../less/material/_collaboration.less | 96 ++++++++ .../mobile/resources/css/app-ios.css | 110 +++++++-- .../mobile/resources/css/app-material.css | 110 +++++++-- .../mobile/resources/less/app-ios.less | 30 --- .../mobile/resources/less/app-material.less | 29 --- .../mobile/resources/css/app-ios.css | 174 ++++++++++++-- .../mobile/resources/css/app-material.css | 166 ++++++++++++-- .../mobile/resources/less/app-ios.less | 31 +-- .../mobile/resources/less/app-material.less | 30 +-- .../mobile/app/controller/Toolbar.js | 1 + .../mobile/resources/css/app-ios.css | 174 ++++++++++++-- .../mobile/resources/css/app-material.css | 166 ++++++++++++-- .../mobile/resources/less/app-ios.less | 31 +-- .../mobile/resources/less/app-material.less | 30 +-- 18 files changed, 1240 insertions(+), 315 deletions(-) diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index c5d3afc1d..22841217b 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -79,12 +79,17 @@ define([ 'page:show' : me.onPageShow } }); + Common.NotificationCenter.on('comments:filterchange', _.bind(this.onFilterChange, this)); }, setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this)); this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this)); + this.api.asc_registerCallback('asc_onAddComment', _.bind(this.onApiAddComment, this)); + this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this)); + this.api.asc_registerCallback('asc_onChangeCommentData', _.bind(this.onApiChangeCommentData, this)); + this.api.asc_registerCallback('asc_onRemoveComment', _.bind(this.onApiRemoveComment, this)); if (editor === 'DE') { this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.changeReview, this)); } @@ -644,6 +649,216 @@ define([ } }, + //Comments + + groupCollectionComments: [], + collectionComments: [], + groupCollectionFilter: [], + filter: [], + + initComments: function() { + this.getView('Common.Views.Collaboration').renderComments((this.groupCollectionFilter.length !== 0) ? this.groupCollectionFilter : (this.collectionComments.length !== 0) ? this.collectionComments : false); + $('.comment-quote').single('click', _.bind(this.onSelectComment, this)); + }, + + readSDKReplies: function (data) { + var i = 0, + replies = [], + date = null; + var repliesCount = data.asc_getRepliesCount(); + if (repliesCount) { + for (i = 0; i < repliesCount; ++i) { + date = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) : + ((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime()))); + + var user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()}); + replies.push({ + userid : data.asc_getReply(i).asc_getUserId(), + username : data.asc_getReply(i).asc_getUserName(), + usercolor : (user) ? user.asc_getColor() : null, + date : this.dateToLocaleTimeString(date), + reply : data.asc_getReply(i).asc_getText(), + time : date.getTime() + }); + } + } + return replies; + }, + + readSDKComment: function(id, data) { + var date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) : + ((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime()))); + var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}), + groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/); + var comment = { + uid : id, + userid : data.asc_getUserId(), + username : data.asc_getUserName(), + usercolor : (user) ? user.asc_getColor() : null, + date : this.dateToLocaleTimeString(date), + quote : data.asc_getQuoteText(), + comment : data.asc_getText(), + resolved : data.asc_getSolved(), + unattached : !_.isUndefined(data.asc_getDocumentFlag) ? data.asc_getDocumentFlag() : false, + time : date.getTime(), + replys : [], + groupName : (groupname && groupname.length>1) ? groupname[1] : null + } + if (comment) { + var replies = this.readSDKReplies(data); + if (replies.length) { + comment.replys = replies; + } + } + return comment; + }, + + onApiChangeCommentData: function(id, data) { + var me = this, + i = 0, + date = null, + replies = null, + repliesCount = 0, + dateReply = null, + comment = _.findWhere(me.collectionComments, {uid: id}) || this.findCommentInGroup(id); + + if (comment) { + + date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) : + ((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime()))); + + var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}); + comment.comment = data.asc_getText(); + comment.userid = data.asc_getUserId(); + comment.username = data.asc_getUserName(); + comment.usercolor = (user) ? user.asc_getColor() : null; + comment.resolved = data.asc_getSolved(); + comment.quote = data.asc_getQuoteText(); + comment.time = date.getTime(); + comment.date = me.dateToLocaleTimeString(date); + + replies = _.clone(comment.replys); + + replies.length = 0; + + repliesCount = data.asc_getRepliesCount(); + for (i = 0; i < repliesCount; ++i) { + + dateReply = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) : + ((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime()))); + + user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()}); + replies.push({ + userid : data.asc_getReply(i).asc_getUserId(), + username : data.asc_getReply(i).asc_getUserName(), + usercolor : (user) ? user.asc_getColor() : null, + date : me.dateToLocaleTimeString(dateReply), + reply : data.asc_getReply(i).asc_getText(), + time : dateReply.getTime() + }); + } + comment.replys = replies; + if($('.page-comments').length > 0) { + this.initComments(); + } + } + }, + + onApiAddComment: function (id, data) { + var comment = this.readSDKComment(id, data); + if (comment) { + comment.groupName ? this.addCommentToGroupCollection(comment) : this.collectionComments.push(comment); + } + if($('.page-comments').length > 0) { + this.initComments(); + } + }, + + onApiAddComments: function (data) { + for (var i = 0; i < data.length; ++i) { + var comment = this.readSDKComment(data[i].asc_getId(), data[i]); + comment.groupName ? this.addCommentToGroupCollection(comment) : this.collectionComments.push(comment); + } + if($('.page-comments').length > 0) { + this.initComments(); + } + }, + + stringOOToLocalDate: function (date) { + if (typeof date === 'string') + return parseInt(date); + return 0; + }, + + addCommentToGroupCollection: function (comment) { + var groupname = comment.groupName; + if (!this.groupCollectionComments[groupname]) + this.groupCollectionComments[groupname] = []; + this.groupCollectionComments[groupname].push(comment); + if (this.filter.indexOf(groupname) != -1) { + this.groupCollectionFilter.push(comment); + } + }, + + findCommentInGroup: function (id) { + for (var name in this.groupCollectionComments) { + var store = this.groupCollectionComments[name], + model = _.findWhere(store, {uid: id}); + if (model) return model; + } + }, + + onApiRemoveComment: function (id) { + function remove (collection, key) { + if(collection instanceof Array) { + var index = collection.indexOf(key); + if(index != -1) { + collection.splice(index, 1); + } + } + } + if (this.groupCollectionComments) { + for (var name in this.groupCollectionComments) { + var store = this.groupCollectionComments[name], + comment = _.findWhere(store, {uid: id}); + if (comment) { + remove(this.groupCollectionComments[name], comment); + if (this.filter.indexOf(name) != -1) { + remove(this.groupCollectionFilter, comment); + } + } + } + } + if (this.collectionComments.length > 0) { + var comment = _.findWhere(this.collectionComments, {uid: id}); + if (comment) { + remove(this.collectionComments, comment); + } + } + if($('.page-comments').length > 0) { + this.initComments(); + } + }, + + onFilterChange: function (filter) { + if (filter) { + var me = this, + comments = []; + this.filter = filter; + filter.forEach(function(item){ + if (!me.groupCollectionComments[item]) + me.groupCollectionComments[item] = []; + comments = comments.concat(me.groupCollectionComments[item]); + }); + this.groupCollectionFilter = comments; + } + }, + + onSelectComment: function (e) { + var id = $(e.currentTarget).data('id'); + this.api.asc_selectComment(id); + }, + textInserted: 'Inserted:', textDeleted: 'Deleted:', diff --git a/apps/common/mobile/lib/template/Collaboration.template b/apps/common/mobile/lib/template/Collaboration.template index 6256a860a..39e076ded 100644 --- a/apps/common/mobile/lib/template/Collaboration.template +++ b/apps/common/mobile/lib/template/Collaboration.template @@ -20,6 +20,15 @@
    +
  • + +
    +
    +
    <%= scope.textСomments %>
    +
    +
    +
    +
  • <% if (editor === 'DE') { %>
  • @@ -207,4 +216,24 @@
  • + + + +
    + +
    +
    +
    +
    +
      +
      +
      +
      +
      \ No newline at end of file diff --git a/apps/common/mobile/lib/view/Collaboration.js b/apps/common/mobile/lib/view/Collaboration.js index c886a0f5b..f8f57ca2c 100644 --- a/apps/common/mobile/lib/view/Collaboration.js +++ b/apps/common/mobile/lib/view/Collaboration.js @@ -146,6 +146,44 @@ define([ } }, + renderComments: function (comments) { + var $listComments = $('#comments-list'), + items = []; + + _.each(comments, function (comment) { + var itemTemplate = [ + '
    • ', + '
      ', + '

      <%= item.username %>

      ', + '

      <%= item.date %>

      ', + '<% if(item.quote) {%>', + '

      <%= item.quote %>

      ', + '<% } %>', + '

      <%= item.comment %>

      ', + '<% if(replys > 0) {%>', + '
        ', + '<% _.each(item.replys, function (reply) { %>', + '
      • ', + '

        <%= reply.username %>

        ', + '

        <%= reply.date %>

        ', + '

        <%= reply.reply %>

        ', + '
      • ', + '<% }); %>', + '
      ', + '<% } %>', + '
      ', + '
    • ' + ].join(''); + items.push(_.template(itemTemplate)({ + android: Framework7.prototype.device.android, + item: comment, + replys: comment.replys.length + })); + }); + + $listComments.html(items); + }, + textCollaboration: 'Collaboration', diff --git a/apps/common/mobile/resources/less/ios/_collaboration.less b/apps/common/mobile/resources/less/ios/_collaboration.less index ff87fb8b9..37361bc8e 100644 --- a/apps/common/mobile/resources/less/ios/_collaboration.less +++ b/apps/common/mobile/resources/less/ios/_collaboration.less @@ -59,4 +59,99 @@ .page-content .list-block:first-child { margin-top: -1px; } +} + +//Edit users +@initialEditUser: #373737; + +#user-list { + .item-content { + padding-left: 0; + } + .item-inner { + justify-content: flex-start; + padding-left: 15px; + } + .length { + margin-left: 4px; + } + .color { + min-width: 40px; + min-height: 40px; + margin-right: 20px; + text-align: center; + border-radius: 50px; + line-height: 40px; + color: @initialEditUser; + font-weight: 500; + + } + ul:before { + content: none; + } +} + +//Comments +.page-comments { + .list-block .item-inner { + display: block; + padding: 16px 0; + word-wrap: break-word; + } + p { + margin: 0; + } + .user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + font-weight: bold; + } + .comment-date, .reply-date { + font-size: 12px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 0px; + } + .comment-text, .reply-text { + color: #000000; + font-size: 15px; + line-height: 25px; + margin: 0; + max-width: 100%; + padding-right: 15px; + } + .reply-item { + margin-top: 15px; + .user-name { + padding-top: 16px; + } + &:before { + content: ''; + position: absolute; + left: auto; + bottom: 0; + right: auto; + top: 0; + height: 1px; + width: 100%; + background-color: @listBlockBorderColor; + display: block; + z-index: 15; + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; + } + } + .comment-quote { + color: @themeColor; + border-left: 1px solid @themeColor; + padding-left: 10px; + margin: 5px 0; + font-size: 15px; + } +} +.settings.popup .list-block ul.list-reply:last-child:after, .settings.popover .list-block ul.list-reply:last-child:after { + display: none; } \ No newline at end of file diff --git a/apps/common/mobile/resources/less/material/_collaboration.less b/apps/common/mobile/resources/less/material/_collaboration.less index ba21a8794..ea3cdf0f0 100644 --- a/apps/common/mobile/resources/less/material/_collaboration.less +++ b/apps/common/mobile/resources/less/material/_collaboration.less @@ -57,4 +57,100 @@ .page-content .list-block:first-child { margin-top: -1px; } +} + + +//Edit users +@initialEditUser: #373737; + +#user-list { + .item-content { + padding-left: 0; + } + .item-inner { + justify-content: flex-start; + padding-left: 15px; + } + .length { + margin-left: 4px; + } + .color { + min-width: 40px; + min-height: 40px; + margin-right: 20px; + text-align: center; + border-radius: 50px; + line-height: 40px; + color: @initialEditUser; + font-weight: 400; + } + ul:before { + content: none; + } +} + + +//Comments +.page-comments { + .list-block .item-inner { + display: block; + padding: 16px 0; + word-wrap: break-word; + } + p { + margin: 0; + } + .user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + font-weight: bold; + } + .comment-date, .reply-date { + font-size: 12px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 0px; + } + .comment-text, .reply-text { + color: #000000; + font-size: 15px; + line-height: 25px; + margin: 0; + max-width: 100%; + padding-right: 15px; + } + .reply-item { + margin-top: 15px; + .user-name { + padding-top: 16px; + } + &:before { + content: ''; + position: absolute; + left: auto; + bottom: 0; + right: auto; + top: 0; + height: 1px; + width: 100%; + background-color: @listBlockBorderColor; + display: block; + z-index: 15; + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; + } + } + .comment-quote { + color: @themeColor; + border-left: 1px solid @themeColor; + padding-left: 10px; + margin: 5px 0; + font-size: 15px; + } +} +.settings.popup .list-block ul.list-reply:last-child:after, .settings.popover .list-block ul.list-reply:last-child:after { + display: none; } \ No newline at end of file diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index 5f8bc366d..4c600bf19 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -6338,6 +6338,93 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after .container-collaboration .page-content .list-block:first-child { margin-top: -1px; } +#user-list .item-content { + padding-left: 0; +} +#user-list .item-inner { + justify-content: flex-start; + padding-left: 15px; +} +#user-list .length { + margin-left: 4px; +} +#user-list .color { + min-width: 40px; + min-height: 40px; + margin-right: 20px; + text-align: center; + border-radius: 50px; + line-height: 40px; + color: #373737; + font-weight: 500; +} +#user-list ul:before { + content: none; +} +.page-comments .list-block .item-inner { + display: block; + padding: 16px 0; + word-wrap: break-word; +} +.page-comments p { + margin: 0; +} +.page-comments .user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + font-weight: bold; +} +.page-comments .comment-date, +.page-comments .reply-date { + font-size: 12px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 0px; +} +.page-comments .comment-text, +.page-comments .reply-text { + color: #000000; + font-size: 15px; + line-height: 25px; + margin: 0; + max-width: 100%; + padding-right: 15px; +} +.page-comments .reply-item { + margin-top: 15px; +} +.page-comments .reply-item .user-name { + padding-top: 16px; +} +.page-comments .reply-item:before { + content: ''; + position: absolute; + left: auto; + bottom: 0; + right: auto; + top: 0; + height: 1px; + width: 100%; + background-color: #c8c7cc; + display: block; + z-index: 15; + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; +} +.page-comments .comment-quote { + color: #446995; + border-left: 1px solid #446995; + padding-left: 10px; + margin: 5px 0; + font-size: 15px; +} +.settings.popup .list-block ul.list-reply:last-child:after, +.settings.popover .list-block ul.list-reply:last-child:after { + display: none; +} .tablet .searchbar.document.replace .center .searchbar:first-child { margin-right: 10px; } @@ -6989,26 +7076,3 @@ html.pixel-ratio-3 .numbers li { max-height: 100%; overflow: auto; } -#user-list .item-content { - padding-left: 0; -} -#user-list .item-inner { - justify-content: flex-start; - padding-left: 15px; -} -#user-list .length { - margin-left: 4px; -} -#user-list .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: #373737; - font-weight: 500; -} -#user-list ul:before { - content: none; -} diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index d1aabb74d..b830d72e1 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -5923,6 +5923,93 @@ html.phone .document-menu .list-block .item-link { .container-collaboration .page-content .list-block:first-child { margin-top: -1px; } +#user-list .item-content { + padding-left: 0; +} +#user-list .item-inner { + justify-content: flex-start; + padding-left: 15px; +} +#user-list .length { + margin-left: 4px; +} +#user-list .color { + min-width: 40px; + min-height: 40px; + margin-right: 20px; + text-align: center; + border-radius: 50px; + line-height: 40px; + color: #373737; + font-weight: 400; +} +#user-list ul:before { + content: none; +} +.page-comments .list-block .item-inner { + display: block; + padding: 16px 0; + word-wrap: break-word; +} +.page-comments p { + margin: 0; +} +.page-comments .user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + font-weight: bold; +} +.page-comments .comment-date, +.page-comments .reply-date { + font-size: 12px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 0px; +} +.page-comments .comment-text, +.page-comments .reply-text { + color: #000000; + font-size: 15px; + line-height: 25px; + margin: 0; + max-width: 100%; + padding-right: 15px; +} +.page-comments .reply-item { + margin-top: 15px; +} +.page-comments .reply-item .user-name { + padding-top: 16px; +} +.page-comments .reply-item:before { + content: ''; + position: absolute; + left: auto; + bottom: 0; + right: auto; + top: 0; + height: 1px; + width: 100%; + background-color: rgba(0, 0, 0, 0.12); + display: block; + z-index: 15; + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; +} +.page-comments .comment-quote { + color: #446995; + border-left: 1px solid #446995; + padding-left: 10px; + margin: 5px 0; + font-size: 15px; +} +.settings.popup .list-block ul.list-reply:last-child:after, +.settings.popover .list-block ul.list-reply:last-child:after { + display: none; +} .tablet .searchbar.document.replace .center > .replace { display: flex; } @@ -6760,26 +6847,3 @@ html.pixel-ratio-3 .numbers li { max-height: 100%; overflow: auto; } -#user-list .item-content { - padding-left: 0; -} -#user-list .item-inner { - justify-content: flex-start; - padding-left: 15px; -} -#user-list .length { - margin-left: 4px; -} -#user-list .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: #373737; - font-weight: 400; -} -#user-list ul:before { - content: none; -} diff --git a/apps/documenteditor/mobile/resources/less/app-ios.less b/apps/documenteditor/mobile/resources/less/app-ios.less index acfb7401b..9cd8b17cc 100644 --- a/apps/documenteditor/mobile/resources/less/app-ios.less +++ b/apps/documenteditor/mobile/resources/less/app-ios.less @@ -240,33 +240,3 @@ input, textarea { max-height: 100%; overflow: auto; } - -//Edit users -@initialEditUser: #373737; - -#user-list { - .item-content { - padding-left: 0; - } - .item-inner { - justify-content: flex-start; - padding-left: 15px; - } - .length { - margin-left: 4px; - } - .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: @initialEditUser; - font-weight: 500; - - } - ul:before { - content: none; - } -} \ No newline at end of file diff --git a/apps/documenteditor/mobile/resources/less/app-material.less b/apps/documenteditor/mobile/resources/less/app-material.less index 54e5c2199..67653a7d2 100644 --- a/apps/documenteditor/mobile/resources/less/app-material.less +++ b/apps/documenteditor/mobile/resources/less/app-material.less @@ -227,32 +227,3 @@ input, textarea { max-height: 100%; overflow: auto; } - -//Edit users -@initialEditUser: #373737; - -#user-list { - .item-content { - padding-left: 0; - } - .item-inner { - justify-content: flex-start; - padding-left: 15px; - } - .length { - margin-left: 4px; - } - .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: @initialEditUser; - font-weight: 400; - } - ul:before { - content: none; - } -} \ No newline at end of file diff --git a/apps/presentationeditor/mobile/resources/css/app-ios.css b/apps/presentationeditor/mobile/resources/css/app-ios.css index 793548ff6..cbd29c840 100644 --- a/apps/presentationeditor/mobile/resources/css/app-ios.css +++ b/apps/presentationeditor/mobile/resources/css/app-ios.css @@ -6274,6 +6274,157 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after margin-left: 20px; color: #212121; } +.page-change .block-description { + background-color: #fff; + padding-top: 15px; + padding-bottom: 15px; + margin: 0; + max-width: 100%; + word-wrap: break-word; +} +.page-change #user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; +} +.page-change #date-change { + font-size: 14px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 3px; +} +.page-change #text-change { + color: #000000; + font-size: 15px; + line-height: 20px; + margin: 0; + margin-top: 10px; +} +.page-change .block-btn, +.page-change .content-block.block-btn:first-child { + display: flex; + flex-direction: row; + justify-content: space-around; + margin: 26px 0; +} +.page-change .block-btn #btn-next-change, +.page-change .content-block.block-btn:first-child #btn-next-change, +.page-change .block-btn #btn-reject-change, +.page-change .content-block.block-btn:first-child #btn-reject-change { + margin-left: 20px; +} +.page-change .block-btn #btn-goto-change, +.page-change .content-block.block-btn:first-child #btn-goto-change { + margin-right: 20px; +} +.page-change .block-btn .right-buttons, +.page-change .content-block.block-btn:first-child .right-buttons { + display: flex; +} +.page-change .block-btn .link, +.page-change .content-block.block-btn:first-child .link { + display: inline-block; +} +.navbar .center-collaboration { + display: flex; + justify-content: space-around; +} +.container-collaboration .navbar .right.close-collaboration { + position: absolute; + right: 10px; +} +.container-collaboration .page-content .list-block:first-child { + margin-top: -1px; +} +#user-list .item-content { + padding-left: 0; +} +#user-list .item-inner { + justify-content: flex-start; + padding-left: 15px; +} +#user-list .length { + margin-left: 4px; +} +#user-list .color { + min-width: 40px; + min-height: 40px; + margin-right: 20px; + text-align: center; + border-radius: 50px; + line-height: 40px; + color: #373737; + font-weight: 500; +} +#user-list ul:before { + content: none; +} +.page-comments .list-block .item-inner { + display: block; + padding: 16px 0; + word-wrap: break-word; +} +.page-comments p { + margin: 0; +} +.page-comments .user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + font-weight: bold; +} +.page-comments .comment-date, +.page-comments .reply-date { + font-size: 12px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 0px; +} +.page-comments .comment-text, +.page-comments .reply-text { + color: #000000; + font-size: 15px; + line-height: 25px; + margin: 0; + max-width: 100%; + padding-right: 15px; +} +.page-comments .reply-item { + margin-top: 15px; +} +.page-comments .reply-item .user-name { + padding-top: 16px; +} +.page-comments .reply-item:before { + content: ''; + position: absolute; + left: auto; + bottom: 0; + right: auto; + top: 0; + height: 1px; + width: 100%; + background-color: #c8c7cc; + display: block; + z-index: 15; + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; +} +.page-comments .comment-quote { + color: #aa5252; + border-left: 1px solid #aa5252; + padding-left: 10px; + margin: 5px 0; + font-size: 15px; +} +.settings.popup .list-block ul.list-reply:last-child:after, +.settings.popover .list-block ul.list-reply:last-child:after { + display: none; +} .tablet .searchbar.document.replace .center .searchbar:first-child { margin-right: 10px; } @@ -6873,26 +7024,3 @@ html.pixel-ratio-3 .numbers li { max-height: 100%; overflow: auto; } -#user-list .item-content { - padding-left: 0; -} -#user-list .item-inner { - justify-content: flex-start; - padding-left: 15px; -} -#user-list .length { - margin-left: 4px; -} -#user-list .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: #373737; - font-weight: 500; -} -#user-list ul:before { - content: none; -} diff --git a/apps/presentationeditor/mobile/resources/css/app-material.css b/apps/presentationeditor/mobile/resources/css/app-material.css index 39ffc9763..2f83aeb7d 100644 --- a/apps/presentationeditor/mobile/resources/css/app-material.css +++ b/apps/presentationeditor/mobile/resources/css/app-material.css @@ -5867,6 +5867,149 @@ html.phone .document-menu .list-block .item-link { margin-left: 20px; color: #212121; } +.page-change .block-description { + background-color: #fff; + padding-top: 15px; + padding-bottom: 15px; + margin: 0; + max-width: 100%; + word-wrap: break-word; +} +.page-change #user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; +} +.page-change #date-change { + font-size: 14px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 3px; +} +.page-change #text-change { + color: #000000; + font-size: 15px; + line-height: 20px; + margin: 0; + margin-top: 10px; +} +.page-change .block-btn { + display: flex; + flex-direction: row; + justify-content: space-around; + margin: 0; + padding: 26px 0; + background-color: #EFEFF4; +} +.page-change .block-btn #btn-next-change, +.page-change .block-btn #btn-reject-change { + margin-left: 20px; +} +.page-change .block-btn #btn-goto-change { + margin-right: 20px; +} +.page-change .block-btn .right-buttons { + display: flex; +} +.page-change .block-btn .link { + display: inline-block; +} +.container-collaboration .navbar .right.close-collaboration { + position: absolute; + right: 5px; +} +.container-collaboration .page-content .list-block:first-child { + margin-top: -1px; +} +#user-list .item-content { + padding-left: 0; +} +#user-list .item-inner { + justify-content: flex-start; + padding-left: 15px; +} +#user-list .length { + margin-left: 4px; +} +#user-list .color { + min-width: 40px; + min-height: 40px; + margin-right: 20px; + text-align: center; + border-radius: 50px; + line-height: 40px; + color: #373737; + font-weight: 400; +} +#user-list ul:before { + content: none; +} +.page-comments .list-block .item-inner { + display: block; + padding: 16px 0; + word-wrap: break-word; +} +.page-comments p { + margin: 0; +} +.page-comments .user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + font-weight: bold; +} +.page-comments .comment-date, +.page-comments .reply-date { + font-size: 12px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 0px; +} +.page-comments .comment-text, +.page-comments .reply-text { + color: #000000; + font-size: 15px; + line-height: 25px; + margin: 0; + max-width: 100%; + padding-right: 15px; +} +.page-comments .reply-item { + margin-top: 15px; +} +.page-comments .reply-item .user-name { + padding-top: 16px; +} +.page-comments .reply-item:before { + content: ''; + position: absolute; + left: auto; + bottom: 0; + right: auto; + top: 0; + height: 1px; + width: 100%; + background-color: rgba(0, 0, 0, 0.12); + display: block; + z-index: 15; + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; +} +.page-comments .comment-quote { + color: #aa5252; + border-left: 1px solid #aa5252; + padding-left: 10px; + margin: 5px 0; + font-size: 15px; +} +.settings.popup .list-block ul.list-reply:last-child:after, +.settings.popover .list-block ul.list-reply:last-child:after { + display: none; +} .tablet .searchbar.document.replace .center > .replace { display: flex; } @@ -6701,26 +6844,3 @@ html.pixel-ratio-3 .numbers li { max-height: 100%; overflow: auto; } -#user-list .item-content { - padding-left: 0; -} -#user-list .item-inner { - justify-content: flex-start; - padding-left: 15px; -} -#user-list .length { - margin-left: 4px; -} -#user-list .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: #373737; - font-weight: 400; -} -#user-list ul:before { - content: none; -} diff --git a/apps/presentationeditor/mobile/resources/less/app-ios.less b/apps/presentationeditor/mobile/resources/less/app-ios.less index 2ac567445..2778f67bc 100644 --- a/apps/presentationeditor/mobile/resources/less/app-ios.less +++ b/apps/presentationeditor/mobile/resources/less/app-ios.less @@ -72,6 +72,7 @@ input, textarea { @import url('../../../../common/mobile/resources/less/ios/_color-palette.less'); @import url('../../../../common/mobile/resources/less/ios/_about.less'); @import url('../../../../common/mobile/resources/less/ios/_color-schema.less'); +@import url('../../../../common/mobile/resources/less/ios/_collaboration.less'); @import url('ios/_search.less'); @import url('ios/_icons.less'); @@ -244,33 +245,3 @@ input, textarea { max-height: 100%; overflow: auto; } - -//Edit users -@initialEditUser: #373737; - -#user-list { - .item-content { - padding-left: 0; - } - .item-inner { - justify-content: flex-start; - padding-left: 15px; - } - .length { - margin-left: 4px; - } - .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: @initialEditUser; - font-weight: 500; - - } - ul:before { - content: none; - } -} \ No newline at end of file diff --git a/apps/presentationeditor/mobile/resources/less/app-material.less b/apps/presentationeditor/mobile/resources/less/app-material.less index 604bfa755..211286e3b 100644 --- a/apps/presentationeditor/mobile/resources/less/app-material.less +++ b/apps/presentationeditor/mobile/resources/less/app-material.less @@ -54,6 +54,7 @@ @import url('../../../../common/mobile/resources/less/material/_color-palette.less'); @import url('../../../../common/mobile/resources/less/material/_about.less'); @import url('../../../../common/mobile/resources/less/material/_color-schema.less'); +@import url('../../../../common/mobile/resources/less/material/_collaboration.less'); @import url('material/_search.less'); @import url('material/_icons.less'); @@ -232,32 +233,3 @@ input, textarea { max-height: 100%; overflow: auto; } - -//Edit users -@initialEditUser: #373737; - -#user-list { - .item-content { - padding-left: 0; - } - .item-inner { - justify-content: flex-start; - padding-left: 15px; - } - .length { - margin-left: 4px; - } - .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: @initialEditUser; - font-weight: 400; - } - ul:before { - content: none; - } -} \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js b/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js index 8f0ab5c36..e886dce69 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Toolbar.js @@ -160,6 +160,7 @@ define([ onApiActiveSheetChanged: function (index) { locked.sheet = this.api.asc_isWorksheetLockedOrDeleted(index); + Common.NotificationCenter.trigger('comments:filterchange', ['doc', 'sheet' + this.api.asc_getWorksheetId(index)], false ); }, onApiCanRevert: function(which, can) { diff --git a/apps/spreadsheeteditor/mobile/resources/css/app-ios.css b/apps/spreadsheeteditor/mobile/resources/css/app-ios.css index 0adba5b26..ebe1733cd 100644 --- a/apps/spreadsheeteditor/mobile/resources/css/app-ios.css +++ b/apps/spreadsheeteditor/mobile/resources/css/app-ios.css @@ -6274,6 +6274,157 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after margin-left: 20px; color: #212121; } +.page-change .block-description { + background-color: #fff; + padding-top: 15px; + padding-bottom: 15px; + margin: 0; + max-width: 100%; + word-wrap: break-word; +} +.page-change #user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; +} +.page-change #date-change { + font-size: 14px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 3px; +} +.page-change #text-change { + color: #000000; + font-size: 15px; + line-height: 20px; + margin: 0; + margin-top: 10px; +} +.page-change .block-btn, +.page-change .content-block.block-btn:first-child { + display: flex; + flex-direction: row; + justify-content: space-around; + margin: 26px 0; +} +.page-change .block-btn #btn-next-change, +.page-change .content-block.block-btn:first-child #btn-next-change, +.page-change .block-btn #btn-reject-change, +.page-change .content-block.block-btn:first-child #btn-reject-change { + margin-left: 20px; +} +.page-change .block-btn #btn-goto-change, +.page-change .content-block.block-btn:first-child #btn-goto-change { + margin-right: 20px; +} +.page-change .block-btn .right-buttons, +.page-change .content-block.block-btn:first-child .right-buttons { + display: flex; +} +.page-change .block-btn .link, +.page-change .content-block.block-btn:first-child .link { + display: inline-block; +} +.navbar .center-collaboration { + display: flex; + justify-content: space-around; +} +.container-collaboration .navbar .right.close-collaboration { + position: absolute; + right: 10px; +} +.container-collaboration .page-content .list-block:first-child { + margin-top: -1px; +} +#user-list .item-content { + padding-left: 0; +} +#user-list .item-inner { + justify-content: flex-start; + padding-left: 15px; +} +#user-list .length { + margin-left: 4px; +} +#user-list .color { + min-width: 40px; + min-height: 40px; + margin-right: 20px; + text-align: center; + border-radius: 50px; + line-height: 40px; + color: #373737; + font-weight: 500; +} +#user-list ul:before { + content: none; +} +.page-comments .list-block .item-inner { + display: block; + padding: 16px 0; + word-wrap: break-word; +} +.page-comments p { + margin: 0; +} +.page-comments .user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + font-weight: bold; +} +.page-comments .comment-date, +.page-comments .reply-date { + font-size: 12px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 0px; +} +.page-comments .comment-text, +.page-comments .reply-text { + color: #000000; + font-size: 15px; + line-height: 25px; + margin: 0; + max-width: 100%; + padding-right: 15px; +} +.page-comments .reply-item { + margin-top: 15px; +} +.page-comments .reply-item .user-name { + padding-top: 16px; +} +.page-comments .reply-item:before { + content: ''; + position: absolute; + left: auto; + bottom: 0; + right: auto; + top: 0; + height: 1px; + width: 100%; + background-color: #c8c7cc; + display: block; + z-index: 15; + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; +} +.page-comments .comment-quote { + color: #40865c; + border-left: 1px solid #40865c; + padding-left: 10px; + margin: 5px 0; + font-size: 15px; +} +.settings.popup .list-block ul.list-reply:last-child:after, +.settings.popover .list-block ul.list-reply:last-child:after { + display: none; +} i.icon.icon-search { width: 24px; height: 24px; @@ -7222,29 +7373,6 @@ html.pixel-ratio-3 .cell-styles.dataview .row li { max-height: 100%; overflow: auto; } -#user-list .item-content { - padding-left: 0; -} -#user-list .item-inner { - justify-content: flex-start; - padding-left: 15px; -} -#user-list .length { - margin-left: 4px; -} -#user-list .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: #373737; - font-weight: 500; -} -#user-list ul:before { - content: none; -} .filter-root-view .list-center .item-title { text-align: center; width: 100%; diff --git a/apps/spreadsheeteditor/mobile/resources/css/app-material.css b/apps/spreadsheeteditor/mobile/resources/css/app-material.css index f4134c4ed..275f928f6 100644 --- a/apps/spreadsheeteditor/mobile/resources/css/app-material.css +++ b/apps/spreadsheeteditor/mobile/resources/css/app-material.css @@ -5877,6 +5877,149 @@ html.phone .document-menu .list-block .item-link { margin-left: 20px; color: #212121; } +.page-change .block-description { + background-color: #fff; + padding-top: 15px; + padding-bottom: 15px; + margin: 0; + max-width: 100%; + word-wrap: break-word; +} +.page-change #user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; +} +.page-change #date-change { + font-size: 14px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 3px; +} +.page-change #text-change { + color: #000000; + font-size: 15px; + line-height: 20px; + margin: 0; + margin-top: 10px; +} +.page-change .block-btn { + display: flex; + flex-direction: row; + justify-content: space-around; + margin: 0; + padding: 26px 0; + background-color: #EFEFF4; +} +.page-change .block-btn #btn-next-change, +.page-change .block-btn #btn-reject-change { + margin-left: 20px; +} +.page-change .block-btn #btn-goto-change { + margin-right: 20px; +} +.page-change .block-btn .right-buttons { + display: flex; +} +.page-change .block-btn .link { + display: inline-block; +} +.container-collaboration .navbar .right.close-collaboration { + position: absolute; + right: 5px; +} +.container-collaboration .page-content .list-block:first-child { + margin-top: -1px; +} +#user-list .item-content { + padding-left: 0; +} +#user-list .item-inner { + justify-content: flex-start; + padding-left: 15px; +} +#user-list .length { + margin-left: 4px; +} +#user-list .color { + min-width: 40px; + min-height: 40px; + margin-right: 20px; + text-align: center; + border-radius: 50px; + line-height: 40px; + color: #373737; + font-weight: 400; +} +#user-list ul:before { + content: none; +} +.page-comments .list-block .item-inner { + display: block; + padding: 16px 0; + word-wrap: break-word; +} +.page-comments p { + margin: 0; +} +.page-comments .user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + font-weight: bold; +} +.page-comments .comment-date, +.page-comments .reply-date { + font-size: 12px; + line-height: 18px; + color: #6d6d72; + margin: 0; + margin-top: 0px; +} +.page-comments .comment-text, +.page-comments .reply-text { + color: #000000; + font-size: 15px; + line-height: 25px; + margin: 0; + max-width: 100%; + padding-right: 15px; +} +.page-comments .reply-item { + margin-top: 15px; +} +.page-comments .reply-item .user-name { + padding-top: 16px; +} +.page-comments .reply-item:before { + content: ''; + position: absolute; + left: auto; + bottom: 0; + right: auto; + top: 0; + height: 1px; + width: 100%; + background-color: rgba(0, 0, 0, 0.12); + display: block; + z-index: 15; + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; +} +.page-comments .comment-quote { + color: #40865c; + border-left: 1px solid #40865c; + padding-left: 10px; + margin: 5px 0; + font-size: 15px; +} +.settings.popup .list-block ul.list-reply:last-child:after, +.settings.popover .list-block ul.list-reply:last-child:after { + display: none; +} .tablet .searchbar.document.replace .center > .replace { display: flex; } @@ -7090,29 +7233,6 @@ html.pixel-ratio-3 .cell-styles.dataview .row li { max-height: 100%; overflow: auto; } -#user-list .item-content { - padding-left: 0; -} -#user-list .item-inner { - justify-content: flex-start; - padding-left: 15px; -} -#user-list .length { - margin-left: 4px; -} -#user-list .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: #373737; - font-weight: 400; -} -#user-list ul:before { - content: none; -} .filter-root-view .list-center .item-title { text-align: center; width: 100%; diff --git a/apps/spreadsheeteditor/mobile/resources/less/app-ios.less b/apps/spreadsheeteditor/mobile/resources/less/app-ios.less index c255df6f4..44991a56a 100644 --- a/apps/spreadsheeteditor/mobile/resources/less/app-ios.less +++ b/apps/spreadsheeteditor/mobile/resources/less/app-ios.less @@ -74,6 +74,7 @@ input, textarea { @import url('../../../../common/mobile/resources/less/ios/_color-palette.less'); @import url('../../../../common/mobile/resources/less/ios/_about.less'); @import url('../../../../common/mobile/resources/less/ios/_color-schema.less'); +@import url('../../../../common/mobile/resources/less/ios/_collaboration.less'); @import url('ios/_icons.less'); @@ -193,36 +194,6 @@ input, textarea { overflow: auto; } -//Edit users -@initialEditUser: #373737; - -#user-list { - .item-content { - padding-left: 0; - } - .item-inner { - justify-content: flex-start; - padding-left: 15px; - } - .length { - margin-left: 4px; - } - .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: @initialEditUser; - font-weight: 500; - - } - ul:before { - content: none; - } -} - //Filter Options .filter-root-view { .list-center .item-title { diff --git a/apps/spreadsheeteditor/mobile/resources/less/app-material.less b/apps/spreadsheeteditor/mobile/resources/less/app-material.less index 8ec1cb479..af682c430 100644 --- a/apps/spreadsheeteditor/mobile/resources/less/app-material.less +++ b/apps/spreadsheeteditor/mobile/resources/less/app-material.less @@ -67,6 +67,7 @@ input, textarea { @import url('../../../../common/mobile/resources/less/material/_color-palette.less'); @import url('../../../../common/mobile/resources/less/material/_about.less'); @import url('../../../../common/mobile/resources/less/material/_color-schema.less'); +@import url('../../../../common/mobile/resources/less/material/_collaboration.less'); @import url('material/_search.less'); @import url('material/_icons.less'); @@ -180,35 +181,6 @@ input, textarea { overflow: auto; } -//Edit users -@initialEditUser: #373737; - -#user-list { - .item-content { - padding-left: 0; - } - .item-inner { - justify-content: flex-start; - padding-left: 15px; - } - .length { - margin-left: 4px; - } - .color { - min-width: 40px; - min-height: 40px; - margin-right: 20px; - text-align: center; - border-radius: 50px; - line-height: 40px; - color: @initialEditUser; - font-weight: 400; - } - ul:before { - content: none; - } -} - //Filter Options .filter-root-view { .list-center .item-title { From 9012784170a2ed7798b732ad721a02267e22ad36 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Jul 2019 11:37:34 +0300 Subject: [PATCH 005/154] [PE] Load default styles from image --- .../main/app/controller/Toolbar.js | 47 ++++++++++++++----- .../main/app/view/DocumentHolder.js | 2 +- .../main/app/view/Toolbar.js | 4 +- .../main/resources/less/toolbar.less | 8 ++++ 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 2692b5750..2024b51fa 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1960,26 +1960,51 @@ define([ me.toolbar.listTheme.menuPicker.store.reset([]); // remove all var themeStore = this.getCollection('SlideThemes'), - mainController = this.getApplication().getController('Main'); + mainController = this.getApplication().getController('Main'), + imageUrl = (window.devicePixelRatio > 1) ? '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png' : '../../../../sdkjs/common/Images/fonts_thumbnail.png'; if (themeStore) { - var arr = []; - _.each(defaultThemes.concat(docThemes), function(theme) { - arr.push(new Common.UI.DataViewModel({ - imageUrl: theme.get_Image(), + var arr1 = [], arr2 = []; + _.each(defaultThemes, function(theme, index) { + var tip = mainController.translationTable[theme.get_Name()] || theme.get_Name(); + arr1.push(new Common.UI.DataViewModel({ + imageUrl: imageUrl, uid : Common.UI.getId(), themeId : theme.get_Index(), - tip : mainController.translationTable[theme.get_Name()] || theme.get_Name(), + tip : tip, itemWidth : 85, - itemHeight : 38 + itemHeight : 38, + offsety : index * 38 })); - me.toolbar.listTheme.menuPicker.store.add({ - imageUrl: theme.get_Image(), + arr2.push({ + imageUrl: imageUrl, uid : Common.UI.getId(), themeId : theme.get_Index(), - tip : mainController.translationTable[theme.get_Name()] || theme.get_Name() + tip : tip, + offsety : index * 38 }); }); - themeStore.reset(arr); + _.each(docThemes, function(theme) { + var image = theme.get_Image(), + tip = mainController.translationTable[theme.get_Name()] || theme.get_Name(); + arr1.push(new Common.UI.DataViewModel({ + imageUrl: image, + uid : Common.UI.getId(), + themeId : theme.get_Index(), + tip : tip, + itemWidth : 85, + itemHeight : 38, + offsety : 0 + })); + arr2.push({ + imageUrl: image, + uid : Common.UI.getId(), + themeId : theme.get_Index(), + tip : tip, + offsety : 0 + }); + }); + themeStore.reset(arr1); + me.toolbar.listTheme.menuPicker.store.reset(arr2); } if (me.toolbar.listTheme.menuPicker.store.length > 0 && me.toolbar.listTheme.rendered){ diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 8b66850f8..dc2a87364 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -2032,7 +2032,7 @@ define([ store : PE.getCollection('SlideThemes'), itemTemplate: _.template([ '
      ', - '
      ', + '
      ', '
      ' ].join('')) }).on('item:click', function(picker, item, record, e) { diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 836eb8822..f3fd39f7c 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -804,12 +804,12 @@ define([ me.listTheme.fieldPicker.itemTemplate = _.template([ '
      ', - '
      ', + '
      ', '
      ' ].join('')); me.listTheme.menuPicker.itemTemplate = _.template([ '
      ', - '
      ', + '
      ', '
      ' ].join('')); diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index 2ac1e08e4..e947c0e89 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -332,4 +332,12 @@ z-index: @zindex-dropdown - 20; background-color: @gray-light; border: 1px solid @gray; +} + +.combo-styles { + .style { + > div { + background-size: auto; + } + } } \ No newline at end of file From fca164082065e146e76bb7f4fce6755e670628b7 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 18 Jul 2019 13:35:35 +0300 Subject: [PATCH 006/154] [Common mobile] Fix bug with hide overlay --- .../mobile/lib/controller/Collaboration.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index 22841217b..673092e46 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -163,6 +163,22 @@ define([ domCache: true }); + if (!Common.SharedSettings.get('phone')) { + this.picker = $$(modalView); + var $overlay = $('.modal-overlay'); + + $$(this.picker).on('opened', function () { + $overlay.on('removeClass', function () { + if (!$overlay.hasClass('modal-overlay-visible')) { + $overlay.addClass('modal-overlay-visible') + } + }); + }).on('close', function () { + $overlay.off('removeClass'); + $overlay.removeClass('modal-overlay-visible') + }); + } + Common.NotificationCenter.trigger('collaborationcontainer:show'); this.onPageShow(this.getView('Common.Views.Collaboration')); From 697e99916e12ebe3ed006aa3b3729919f92f563d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Jul 2019 13:46:09 +0300 Subject: [PATCH 007/154] [Mentions] Fix comment opening --- apps/presentationeditor/main/app/controller/Main.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 0d7d7bbc2..8f8ccf91a 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -340,7 +340,7 @@ define([ this.permissions = $.extend(this.permissions, data.doc.permissions); var _permissions = $.extend({}, data.doc.permissions), - _options = $.extend({}, data.doc.options, {actions: this.editorConfig.actionLink || {}}); + _options = $.extend({}, data.doc.options, this.editorConfig.actionLink || {}); var _user = new Asc.asc_CUserInfo(); _user.put_Id(this.appOptions.user.id); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index cf40a13df..0341e638d 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -353,7 +353,7 @@ define([ this.permissions = _.extend(this.permissions, data.doc.permissions); var _permissions = $.extend({}, data.doc.permissions), - _options = $.extend({}, data.doc.options, {actions: this.editorConfig.actionLink || {}}); + _options = $.extend({}, data.doc.options, this.editorConfig.actionLink || {}); var _user = new Asc.asc_CUserInfo(); _user.put_Id(this.appOptions.user.id); From 579fb0d32a16b7b99e4a7b065ecfcdc6889ba080 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Jul 2019 14:05:31 +0300 Subject: [PATCH 008/154] [Mentions] Fix changing comments --- apps/common/main/lib/controller/Comments.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index 24c937fd5..b8f30b6c4 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -252,6 +252,7 @@ define([ ascComment.asc_putUserId(comment.get('userid')); ascComment.asc_putUserName(comment.get('username')); ascComment.asc_putSolved(!comment.get('resolved')); + ascComment.asc_putGuid(comment.get('guid')); if (!_.isUndefined(ascComment.asc_putDocumentFlag)) { ascComment.asc_putDocumentFlag(comment.get('unattached')); @@ -344,6 +345,7 @@ define([ ascComment.asc_putUserId(t.currentUserId); ascComment.asc_putUserName(t.currentUserName); ascComment.asc_putSolved(comment.get('resolved')); + ascComment.asc_putGuid(comment.get('guid')); if (!_.isUndefined(ascComment.asc_putDocumentFlag)) { ascComment.asc_putDocumentFlag(comment.get('unattached')); @@ -400,6 +402,7 @@ define([ ascComment.asc_putUserId(comment.get('userid')); ascComment.asc_putUserName(comment.get('username')); ascComment.asc_putSolved(comment.get('resolved')); + ascComment.asc_putGuid(comment.get('guid')); if (!_.isUndefined(ascComment.asc_putDocumentFlag)) { ascComment.asc_putDocumentFlag(comment.get('unattached')); @@ -462,6 +465,7 @@ define([ ascComment.asc_putUserId(comment.get('userid')); ascComment.asc_putUserName(comment.get('username')); ascComment.asc_putSolved(comment.get('resolved')); + ascComment.asc_putGuid(comment.get('guid')); if (!_.isUndefined(ascComment.asc_putDocumentFlag)) { ascComment.asc_putDocumentFlag(comment.get('unattached')); @@ -520,6 +524,7 @@ define([ ascComment.asc_putUserId(comment.get('userid')); ascComment.asc_putUserName(comment.get('username')); ascComment.asc_putSolved(comment.get('resolved')); + ascComment.asc_putGuid(comment.get('guid')); if (!_.isUndefined(ascComment.asc_putDocumentFlag)) { ascComment.asc_putDocumentFlag(comment.get('unattached')); From d27c3b0ca3b7ab149d9ee5e0fd7883e4838dbc2c Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 18 Jul 2019 17:32:15 +0300 Subject: [PATCH 009/154] [DE mobile] [SSE mobile] Add Commenting Display settings --- .../mobile/app/controller/Main.js | 3 +- .../mobile/app/controller/Settings.js | 36 ++++++++++++++++++ .../mobile/app/template/Settings.template | 28 ++++++++++++++ .../mobile/app/view/Settings.js | 5 ++- .../mobile/app/controller/Main.js | 6 +-- .../mobile/app/controller/Settings.js | 38 +++++++++++++++++++ .../mobile/app/template/Settings.template | 27 +++++++++++++ .../mobile/app/view/Settings.js | 5 ++- 8 files changed, 142 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index deed7d300..45cbc4f19 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -516,7 +516,8 @@ define([ /** coauthoring begin **/ this.isLiveCommenting = Common.localStorage.getBool("de-settings-livecomment", true); - this.isLiveCommenting ? this.api.asc_showComments(true) : this.api.asc_hideComments(); + var resolved = Common.localStorage.getBool("de-settings-resolvedcomment", true); + this.isLiveCommenting ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); /** coauthoring end **/ value = Common.localStorage.getItem("de-settings-zoom"); diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 9ed879014..0c676adf1 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -234,6 +234,16 @@ define([ $('#settings-hidden-borders input:checkbox').attr('checked', (Common.localStorage.getItem("de-mobile-hidden-borders") == 'true') ? true : false); $('#settings-hidden-borders input:checkbox').single('change', _.bind(me.onShowTableEmptyLine, me)); $('#settings-orthography').single('click', _.bind(me.onOrthographyCheck, me)); + var displayComments = Common.localStorage.getBool("de-settings-livecomment", true); + $('#settings-display-comments input:checkbox').attr('checked', displayComments); + $('#settings-display-comments input:checkbox').single('change', _.bind(me.onChangeDisplayComments, me)); + var displayResolved = Common.localStorage.getBool("de-settings-resolvedcomment", true); + if (!displayComments) { + $("#settings-display-resolved").addClass("disabled"); + displayResolved = false; + } + $('#settings-display-resolved input:checkbox').attr('checked', displayResolved); + $('#settings-display-resolved input:checkbox').single('change', _.bind(me.onChangeDisplayResolved, me)); Common.Utils.addScrollIfNeed('.page[data-page=settings-advanced-view]', '.page[data-page=settings-advanced-view] .page-content'); } else if ('#color-schemes-view' == pageId) { me.initPageColorSchemes(); @@ -260,6 +270,32 @@ define([ } }, + onChangeDisplayComments: function(e) { + var displayComments = $(e.currentTarget).is(':checked'); + if (!displayComments) { + this.api.asc_hideComments(); + $("#settings-display-resolved input").prop( "checked", false ); + Common.localStorage.setBool("de-settings-resolvedcomment", false); + $("#settings-display-resolved").addClass("disabled"); + } else { + var resolved = Common.localStorage.getBool("de-settings-resolvedcomment"); + this.api.asc_showComments(resolved); + $("#settings-display-resolved").removeClass("disabled"); + } + Common.localStorage.setBool("de-settings-livecomment", displayComments); + }, + + onChangeDisplayResolved: function(e) { + var displayComments = Common.localStorage.getBool("de-settings-livecomment"); + if (displayComments) { + var resolved = $(e.currentTarget).is(':checked'); + if (this.api) { + this.api.asc_showComments(resolved); + } + Common.localStorage.setBool("de-settings-resolvedcomment", resolved); + } + }, + clickCollaboration: function() { DE.getController('Common.Controllers.Collaboration').showModal(); }, diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 7c8325042..a1e19eae9 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -639,6 +639,34 @@
      +
      <%= scope.textCommentingDisplay %>
      +
      +
        +
        +
        +
        <%= scope.textDisplayComments %>
        +
        + +
        +
        +
        +
        +
        +
        <%= scope.textDisplayResolvedComments %>
        +
        + +
        +
        +
        +
      +
      +
      diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index eb85b01ca..b796ced47 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -287,7 +287,10 @@ define([ textColorSchemes: 'Color Schemes', textNoCharacters: 'Nonprinting Characters', textHiddenTableBorders: 'Hidden Table Borders', - textCollaboration: 'Collaboration' + textCollaboration: 'Collaboration', + textCommentingDisplay: 'Commenting Display', + textDisplayComments: 'Display Comments', + textDisplayResolvedComments: 'Display Resolved Comments' } })(), DE.Views.Settings || {})) diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index de81e7b61..d42699006 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -507,9 +507,9 @@ define([ this.api.asc_setZoom(zf>0 ? zf : 1); /** coauthoring begin **/ - value = Common.localStorage.getItem("sse-settings-livecomment"); - this.isLiveCommenting = !(value!==null && parseInt(value) == 0); - this.isLiveCommenting?this.api.asc_showComments(true):this.api.asc_hideComments(); + this.isLiveCommenting = Common.localStorage.getBool("sse-settings-livecomment", true); + var resolved = Common.localStorage.getBool("sse-settings-resolvedcomment", true); + this.isLiveCommenting ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { // Force ON fast co-authoring mode diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 7babd4a74..126da3a34 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -549,6 +549,44 @@ define([ var $r1c1Style = $('.page[data-page=settings-application-view] #r1-c1-style input'); $r1c1Style.prop('checked',value); $r1c1Style.single('change', _.bind(me.clickR1C1Style, me)); + + //init Commenting Display + var displayComments = Common.localStorage.getBool("sse-settings-livecomment", true); + $('#settings-display-comments input:checkbox').attr('checked', displayComments); + $('#settings-display-comments input:checkbox').single('change', _.bind(me.onChangeDisplayComments, me)); + var displayResolved = Common.localStorage.getBool("sse-settings-resolvedcomment", true); + if (!displayComments) { + $("#settings-display-resolved").addClass("disabled"); + displayResolved = false; + } + $('#settings-display-resolved input:checkbox').attr('checked', displayResolved); + $('#settings-display-resolved input:checkbox').single('change', _.bind(me.onChangeDisplayResolved, me)); + }, + + onChangeDisplayComments: function(e) { + var displayComments = $(e.currentTarget).is(':checked'); + if (!displayComments) { + this.api.asc_hideComments(); + $("#settings-display-resolved input").prop( "checked", false ); + Common.localStorage.setBool("sse-settings-resolvedcomment", false); + $("#settings-display-resolved").addClass("disabled"); + } else { + var resolved = Common.localStorage.getBool("sse-settings-resolvedcomment"); + this.api.asc_showComments(resolved); + $("#settings-display-resolved").removeClass("disabled"); + } + Common.localStorage.setBool("sse-settings-livecomment", displayComments); + }, + + onChangeDisplayResolved: function(e) { + var displayComments = Common.localStorage.getBool("sse-settings-livecomment"); + if (displayComments) { + var resolved = $(e.currentTarget).is(':checked'); + if (this.api) { + this.api.asc_showComments(resolved); + } + Common.localStorage.setBool("sse-settings-resolvedcomment", resolved); + } }, clickR1C1Style: function(e) { diff --git a/apps/spreadsheeteditor/mobile/app/template/Settings.template b/apps/spreadsheeteditor/mobile/app/template/Settings.template index de6530a45..252d9bf79 100644 --- a/apps/spreadsheeteditor/mobile/app/template/Settings.template +++ b/apps/spreadsheeteditor/mobile/app/template/Settings.template @@ -462,6 +462,33 @@
      +
      <%= scope.textCommentingDisplay %>
      +
      +
        +
        +
        +
        <%= scope.textDisplayComments %>
        +
        + +
        +
        +
        +
        +
        +
        <%= scope.textDisplayResolvedComments %>
        +
        + +
        +
        +
        +
      +
      diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index fdc640ed5..cc73f525a 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -381,7 +381,10 @@ define([ textFormulaLanguage: 'Formula Language', textExample: 'Example', textR1C1Style: 'R1C1 Reference Style', - textRegionalSettings: 'Regional Settings' + textRegionalSettings: 'Regional Settings', + textCommentingDisplay: 'Commenting Display', + textDisplayComments: 'Display Comments', + textDisplayResolvedComments: 'Display Resolved Comments' } })(), SSE.Views.Settings || {})) }); \ No newline at end of file From 35a8b6ffe6e3eb386b23146fdbb28e3129405fec Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 19 Jul 2019 14:59:49 +0300 Subject: [PATCH 010/154] [DE mobile] [SSE mobile] Add translations --- apps/documenteditor/mobile/app/view/Settings.js | 4 ++-- apps/documenteditor/mobile/locale/en.json | 3 +++ apps/spreadsheeteditor/mobile/app/view/Settings.js | 4 ++-- apps/spreadsheeteditor/mobile/locale/en.json | 3 +++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index b796ced47..341c9ee59 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -289,8 +289,8 @@ define([ textHiddenTableBorders: 'Hidden Table Borders', textCollaboration: 'Collaboration', textCommentingDisplay: 'Commenting Display', - textDisplayComments: 'Display Comments', - textDisplayResolvedComments: 'Display Resolved Comments' + textDisplayComments: 'Comments', + textDisplayResolvedComments: 'Resolved Comments' } })(), DE.Views.Settings || {})) diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index ba5c164b2..3e5f76b8e 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -492,6 +492,9 @@ "DE.Views.Settings.textColorSchemes": "Color Schemes", "DE.Views.Settings.textNoCharacters": "Nonprinting Characters", "DE.Views.Settings.textHiddenTableBorders": "Hidden Table Borders", + "DE.Views.Settings.textCommentingDisplay": "Commenting Display", + "DE.Views.Settings.textDisplayComments": "Comments", + "DE.Views.Settings.textDisplayResolvedComments": "Resolved Comments", "DE.Views.Toolbar.textBack": "Back", "Common.Views.Collaboration.textCollaboration": "Collaboration", "Common.Views.Collaboration.textReviewing": "Review", diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index cc73f525a..e83b5788c 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -383,8 +383,8 @@ define([ textR1C1Style: 'R1C1 Reference Style', textRegionalSettings: 'Regional Settings', textCommentingDisplay: 'Commenting Display', - textDisplayComments: 'Display Comments', - textDisplayResolvedComments: 'Display Resolved Comments' + textDisplayComments: 'Comments', + textDisplayResolvedComments: 'Resolved Comments' } })(), SSE.Views.Settings || {})) }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index e897f9296..92984012b 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -555,6 +555,9 @@ "SSE.Views.Settings.textCollaboration": "Collaboration", "SSE.Views.Settings.textR1C1Style": "R1C1 Reference Style", "SSE.Views.Settings.textRegionalSettings": "Regional Settings", + "SSE.Views.Settings.textCommentingDisplay": "Commenting Display", + "SSE.Views.Settings.textDisplayComments": "Comments", + "SSE.Views.Settings.textDisplayResolvedComments": "Resolved Comments", "SSE.Views.Toolbar.textBack": "Back", "Common.Views.Collaboration.textCollaboration": "Collaboration", "Common.Views.Collaboration.textСomments": "Сomments", From 54374199c62f399eb4df3c7c2df42f77af3eb721 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 19 Jul 2019 15:31:04 +0300 Subject: [PATCH 011/154] [SSE] Fix applying settings in the viewer --- apps/spreadsheeteditor/main/app/controller/FormulaDialog.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js index 730a51d60..42994f29f 100644 --- a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js @@ -68,6 +68,8 @@ define([ this.addListeners({ 'FileMenu': { 'settings:apply': function() { + if (!me.mode || !me.mode.isEdit) return; + me.needUpdateFormula = true; var lang = Common.localStorage.getItem("sse-settings-func-locale"); @@ -135,6 +137,7 @@ define([ }, setMode: function(mode) { + this.mode = mode; return this; }, From 16dc5af83b7781c8b2a068be2e855b7037ff3627 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 19 Jul 2019 15:57:57 +0300 Subject: [PATCH 012/154] [DE mobile] [SSE mobile] Display Comments Settings and R1C1 for view mode --- .../mobile/app/controller/Settings.js | 7 +++- .../mobile/app/template/Settings.template | 4 +- .../mobile/app/view/Settings.js | 1 - .../mobile/app/template/Settings.template | 38 +++++++++---------- .../mobile/app/view/Settings.js | 4 +- 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 0c676adf1..fed7658ed 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -85,7 +85,8 @@ define([ _isReviewOnly = false, _fileKey, templateInsert, - _metricText = Common.Utils.Metric.getCurrentMetricName(); + _metricText = Common.Utils.Metric.getCurrentMetricName(), + _isEdit; var mm2Cm = function(mm) { return parseFloat((mm/10.).toFixed(2)); @@ -147,6 +148,7 @@ define([ _canReview = mode.canReview; _isReviewOnly = mode.isReviewOnly; _fileKey = mode.fileKey; + _isEdit = mode.isEdit; }, initEvents: function () { @@ -380,6 +382,9 @@ define([ $('#settings-no-characters').addClass('disabled'); $('#settings-hidden-borders').addClass('disabled'); } + if (!_isEdit) { + $('.page[data-page=settings-advanced-view] .page-content > :not(.display-view)').hide(); + } }, initPageDocumentSettings: function () { diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index a1e19eae9..a75b245d8 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -639,8 +639,8 @@ -
      <%= scope.textCommentingDisplay %>
      -
      +
      <%= scope.textCommentingDisplay %>
      +
        diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 341c9ee59..cf4e30692 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -124,7 +124,6 @@ define([ $layour.find('#settings-search .item-title').text(this.textFindAndReplace) } else { $layour.find('#settings-document').hide(); - $layour.find('#settings-advanced').hide(); $layour.find('#color-schemes').hide(); $layour.find('#settings-spellcheck').hide(); $layour.find('#settings-orthography').hide(); diff --git a/apps/spreadsheeteditor/mobile/app/template/Settings.template b/apps/spreadsheeteditor/mobile/app/template/Settings.template index 252d9bf79..a82e106f7 100644 --- a/apps/spreadsheeteditor/mobile/app/template/Settings.template +++ b/apps/spreadsheeteditor/mobile/app/template/Settings.template @@ -430,23 +430,6 @@
      -
      -
        -
      • -
        -
        -
        <%= scope.textR1C1Style %>
        -
        - -
        -
        -
        -
      • -
      -
      <%= scope.textRegionalSettings %>
        @@ -462,8 +445,8 @@
      -
      <%= scope.textCommentingDisplay %>
      -
      +
      <%= scope.textCommentingDisplay %>
      +
        @@ -489,6 +472,23 @@
      +
      +
        +
      • +
        +
        +
        <%= scope.textR1C1Style %>
        +
        + +
        +
        +
        +
      • +
      +
      diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index e83b5788c..4c8f6a6d3 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -130,7 +130,6 @@ define([ $layout.find('#settings-search .item-title').text(this.textFindAndReplace) } else { $layout.find('#settings-spreadsheet').hide(); - $layout.find('#settings-application').hide(); } if (!canDownload) $layout.find('#settings-download').hide(); if (!canAbout) $layout.find('#settings-about').hide(); @@ -170,6 +169,9 @@ define([ this.showPage('#settings-application-view'); $('#language-formula').single('click', _.bind(this.showFormulaLanguage, this)); $('#regional-settings').single('click', _.bind(this.showRegionalSettings, this)); + if (!isEdit) { + $('.page[data-page=settings-application-view] .page-content > :not(.display-view)').hide(); + } }, showFormulaLanguage: function () { From 5149515f13c017d6b31823625b3bcd6c63dd6368 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 22 Jul 2019 11:52:16 +0300 Subject: [PATCH 013/154] Fix Bug 42147 --- apps/documenteditor/main/app/view/Statusbar.js | 9 +++++---- apps/presentationeditor/main/app/view/Statusbar.js | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index 346af6733..c62d7310f 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -364,12 +364,13 @@ define([ this.langMenu.prevTip = info.value; - var index = $parent.find('ul li a:contains("'+info.displayValue+'")').parent().index(); - if (index < 0) { + var lang = this.langMenu.items.find(function(item){ return item.caption == info.displayValue; }); + if (lang) + lang.setChecked(true); + else { this.langMenu.saved = info.displayValue; this.langMenu.clearAll(); - } else - this.langMenu.items[index].setChecked(true); + } } }, diff --git a/apps/presentationeditor/main/app/view/Statusbar.js b/apps/presentationeditor/main/app/view/Statusbar.js index 9dd58ce2d..2af687127 100644 --- a/apps/presentationeditor/main/app/view/Statusbar.js +++ b/apps/presentationeditor/main/app/view/Statusbar.js @@ -351,13 +351,13 @@ define([ $parent.find('#status-label-lang').text(info.displayValue); this.langMenu.prevTip = info.value; - - var index = $parent.find('ul li a:contains("'+info.displayValue+'")').parent().index(); - if (index < 0) { + var lang = this.langMenu.items.find(function(item){ return item.caption == info.displayValue; }); + if (lang) + lang.setChecked(true); + else { this.langMenu.saved = info.displayValue; this.langMenu.clearAll(); - } else - this.langMenu.items[index].setChecked(true); + } } }, From bf6f074aed97b1c21537dbf78bc8552f5afe60a1 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Mon, 22 Jul 2019 14:32:38 +0300 Subject: [PATCH 014/154] [DE mobile] Added new options into Document Info --- .../mobile/app/controller/Settings.js | 25 ++++++- .../mobile/app/template/Settings.template | 65 +++++++++++++++---- .../mobile/app/view/Settings.js | 7 +- 3 files changed, 82 insertions(+), 15 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index fed7658ed..7a98f7512 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -416,8 +416,29 @@ define([ info = document.info || {}; $('#settings-document-title').html(document.title ? document.title : me.unknownText); - $('#settings-document-autor').html(info.author ? info.author : me.unknownText); - $('#settings-document-date').html(info.created ? info.created : me.unknownText); + $('#settings-document-owner').html(info.author ? info.author : me.unknownText); + + var appProps = (this.api) ? this.api.asc_getAppProps() : null; + if (appProps) { + var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); + appName ? $('#settings-doc-application').html(appName) : $('.display-application').remove(); + } + var props = (this.api) ? this.api.asc_getCoreProps() : null, + value; + if (props) { + value = props.asc_getTitle(); + value ? $('#settings-doc-title').html(value) : $('.display-title').remove(); + value = props.asc_getSubject(); + value ? $('#settings-doc-subject').html(value) : $('.display-subject').remove(); + value = props.asc_getDescription(); + value ? $('#settings-doc-comment').html(value) : $('.display-comment').remove(); + value = props.asc_getCreator(); + var templateCreator = ""; + value && value.split(/\s*[,;]\s*/).forEach(function(item) { + templateCreator = templateCreator + "
    • " + item + "
    • "; + }); + templateCreator ? $('#list-creator').html(templateCreator) : $('.display-author').remove(); + } } }, diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index a75b245d8..ff5505ebb 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -302,22 +302,12 @@ -
      <%= scope.textAuthor %>
      +
      <%= scope.textOwner %>
      • -
        <%= scope.textLoading %>
        -
        -
      • -
      -
      -
      <%= scope.textCreateDate %>
      -
      -
        -
      • -
        -
        <%= scope.textLoading %>
        +
        <%= scope.textLoading %>
      @@ -357,6 +347,57 @@
      + +
      <%= scope.textSubject %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textTitle %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textComment %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textApplication %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textAuthor %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index cf4e30692..9665fb8bd 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -289,7 +289,12 @@ define([ textCollaboration: 'Collaboration', textCommentingDisplay: 'Commenting Display', textDisplayComments: 'Comments', - textDisplayResolvedComments: 'Resolved Comments' + textDisplayResolvedComments: 'Resolved Comments', + textSubject: 'Subject', + textTitle: 'Title', + textComment: 'Comment', + textOwner: 'Owner', + textApplication : 'Application' } })(), DE.Views.Settings || {})) From 469893845fd1a712de7febf3495122a91c446ee1 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 22 Jul 2019 15:54:20 +0300 Subject: [PATCH 015/154] [PE] Change path to style images --- apps/presentationeditor/main/app/controller/Toolbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 2024b51fa..19814335d 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1961,7 +1961,7 @@ define([ var themeStore = this.getCollection('SlideThemes'), mainController = this.getApplication().getController('Main'), - imageUrl = (window.devicePixelRatio > 1) ? '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png' : '../../../../sdkjs/common/Images/fonts_thumbnail.png'; + imageUrl = (window.devicePixelRatio > 1) ? '../../../../sdkjs/common/Images/themes_thumbnail@2x.png' : '../../../../sdkjs/common/Images/themes_thumbnail.png'; if (themeStore) { var arr1 = [], arr2 = []; _.each(defaultThemes, function(theme, index) { From d4cc5df5bc9d789db06ce860aa18be72a43b99e9 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Jul 2019 10:21:00 +0300 Subject: [PATCH 016/154] [PE] Fix rendering themes --- apps/presentationeditor/main/app/view/DocumentHolder.js | 2 +- apps/presentationeditor/main/resources/less/toolbar.less | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index dc2a87364..076d779fc 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -2032,7 +2032,7 @@ define([ store : PE.getCollection('SlideThemes'), itemTemplate: _.template([ '
      ', - '
      ', + '
      ', '
      ' ].join('')) }).on('item:click', function(picker, item, record, e) { diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index e947c0e89..2ac1e08e4 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -332,12 +332,4 @@ z-index: @zindex-dropdown - 20; background-color: @gray-light; border: 1px solid @gray; -} - -.combo-styles { - .style { - > div { - background-size: auto; - } - } } \ No newline at end of file From 7844686a749d7f03f074cd81ea220fc27006b3a3 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 23 Jul 2019 11:18:20 +0300 Subject: [PATCH 017/154] [PE mobile] Document Info --- .../mobile/app/controller/Settings.js | 42 ++++++++ .../mobile/app/template/Settings.template | 96 +++++++++++++++++-- .../mobile/app/view/Settings.js | 18 ++-- 3 files changed, 140 insertions(+), 16 deletions(-) diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index 43472adc2..a7580e2a6 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -190,9 +190,51 @@ define([ me.initPageApplicationSettings(); } else if ('#color-schemes-view' == pageId) { me.initPageColorSchemes(); + } else if ('#settings-info-view' == pageId) { + me.initPageInfo(); } }, + initPageInfo: function() { + var document = Common.SharedSettings.get('document') || {}, + info = document.info || {}; + + document.title ? $('#settings-presentation-title').html(document.title) : $('.display-presentation-title').remove(); + info.author ? $('#settings-pe-owner').html(info.author) : $('.display-owner').remove(); + info.uploaded ? $('#settings-pe-uploaded').html(info.uploaded.toLocaleString()) : $('.display-uploaded').remove(); + /*info.created ? $('#settings-pe-date').html(info.created) : $('.display-created-date').remove();*/ + + var appProps = (this.api) ? this.api.asc_getAppProps() : null; + if (appProps) { + var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); + appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove(); + } + + var props = (this.api) ? this.api.asc_getCoreProps() : null, + value; + if (props) { + value = props.asc_getTitle(); + value ? $('#settings-pe-title').html(value) : $('.display-title').remove(); + value = props.asc_getSubject(); + value ? $('#settings-pe-subject').html(value) : $('.display-subject').remove(); + value = props.asc_getDescription(); + value ? $('#settings-pe-comment').html(value) : $('.display-comment').remove(); + value = props.asc_getModified(); + value ? $('#settings-pe-last-mod').html(value.toLocaleString()) : $('.display-last-mode').remove(); + value = props.asc_getLastModifiedBy(); + value ? $('#settings-pe-mod-by').html(value) : $('.display-mode-by').remove(); + value = props.asc_getCreated(); + value ? $('#settings-pe-date').html(value.toLocaleString()) : $('.display-created-date').remove(); + value = props.asc_getCreator(); + var templateCreator = ""; + value && value.split(/\s*[,;]\s*/).forEach(function(item) { + templateCreator = templateCreator + "
    • " + item + "
    • "; + }); + templateCreator ? $('#list-creator').html(templateCreator) : $('.display-author').remove(); + } + + }, + onCollaboration: function() { PE.getController('Common.Controllers.Collaboration').showModal(); }, diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 97e870c9d..7bae06462 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -143,8 +143,8 @@
      -
      <%= scope.textPresentTitle %>
      -
      +
      <%= scope.textPresentTitle %>
      +
      • @@ -153,22 +153,102 @@
      -
      <%= scope.textAuthor %>
      -
      +
      <%= scope.textOwner %>
      +
      • -
        <%= scope.textLoading %>
        +
        <%= scope.textLoading %>
      -
      <%= scope.textCreateDate %>
      -
      +
      <%= scope.textUploaded %>
      +
      • -
        <%= scope.textLoading %>
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textSubject %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textTitle %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textComment %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textLastModified %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textLastModifiedBy %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textCreated %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textApplication %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textAuthor %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
      diff --git a/apps/presentationeditor/mobile/app/view/Settings.js b/apps/presentationeditor/mobile/app/view/Settings.js index d9d893ab1..e37e566f6 100644 --- a/apps/presentationeditor/mobile/app/view/Settings.js +++ b/apps/presentationeditor/mobile/app/view/Settings.js @@ -168,13 +168,6 @@ define([ showInfo: function () { this.showPage('#settings-info-view'); - - var document = Common.SharedSettings.get('document') || {}, - info = document.info || {}; - - $('#settings-presentation-title').html(document.title ? document.title : this.unknownText); - $('#settings-presentation-autor').html(info.author ? info.author : this.unknownText); - $('#settings-presentation-date').html(info.created ? info.created : this.unknownText); }, showDownload: function () { @@ -248,7 +241,16 @@ define([ textPoint: 'Point', textInch: 'Inch', textColorSchemes: 'Color Schemes', - textCollaboration: 'Collaboration' + textCollaboration: 'Collaboration', + textSubject: 'Subject', + textTitle: 'Title', + textComment: 'Comment', + textOwner: 'Owner', + textApplication : 'Application', + textCreated: 'Created', + textLastModified: 'Last Modified', + textLastModifiedBy: 'Last Modified By', + textUploaded: 'Uploaded' } })(), PE.Views.Settings || {})) }); \ No newline at end of file From 5a2d2abe6ceaf63df67ba666d74075fd85d42994 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Jul 2019 11:39:55 +0300 Subject: [PATCH 018/154] [SSE] Fix context menu in header/footer dialog --- apps/spreadsheeteditor/main/app/controller/DocumentHolder.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 9bba63078..e73d49bc6 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -1661,7 +1661,8 @@ define([ formatTableInfo = cellinfo.asc_getFormatTableInfo(), isinsparkline = (cellinfo.asc_getSparklineInfo()!==null), isintable = (formatTableInfo !== null), - ismultiselect = cellinfo.asc_getFlags().asc_getMultiselect(); + ismultiselect = cellinfo.asc_getFlags().asc_getMultiselect(), + inHeaderDlg = $('.asc-window.enable-key-events:visible').length>0; documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null; documentHolder.ssMenu.cellColor = cellinfo.asc_getFill().asc_getColor(); documentHolder.ssMenu.fontColor = cellinfo.asc_getFont().asc_getColor(); @@ -1718,6 +1719,8 @@ define([ commentsController && commentsController.blockPopover(true); + documentHolder.pmiClear.setVisible(!inHeaderDlg); + documentHolder.ssMenu.items[3].setVisible(!inHeaderDlg); documentHolder.pmiClear.menu.items[0].setDisabled(!this.permissions.canModifyFilter); documentHolder.pmiClear.menu.items[1].setDisabled(iscelledit); documentHolder.pmiClear.menu.items[2].setDisabled(iscelledit || !this.permissions.canModifyFilter); From 135d35322066220ee65b19cedb6668e89e842cea Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Jul 2019 12:58:51 +0300 Subject: [PATCH 019/154] [PE] Fix rendering themes (on retina) --- apps/presentationeditor/main/app/controller/Toolbar.js | 9 +-------- apps/presentationeditor/main/app/view/DocumentHolder.js | 4 ++-- apps/presentationeditor/main/app/view/Toolbar.js | 4 ++-- apps/presentationeditor/main/resources/less/toolbar.less | 9 ++++++++- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 19814335d..e236209f8 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1960,23 +1960,18 @@ define([ me.toolbar.listTheme.menuPicker.store.reset([]); // remove all var themeStore = this.getCollection('SlideThemes'), - mainController = this.getApplication().getController('Main'), - imageUrl = (window.devicePixelRatio > 1) ? '../../../../sdkjs/common/Images/themes_thumbnail@2x.png' : '../../../../sdkjs/common/Images/themes_thumbnail.png'; + mainController = this.getApplication().getController('Main'); if (themeStore) { var arr1 = [], arr2 = []; _.each(defaultThemes, function(theme, index) { var tip = mainController.translationTable[theme.get_Name()] || theme.get_Name(); arr1.push(new Common.UI.DataViewModel({ - imageUrl: imageUrl, uid : Common.UI.getId(), themeId : theme.get_Index(), tip : tip, - itemWidth : 85, - itemHeight : 38, offsety : index * 38 })); arr2.push({ - imageUrl: imageUrl, uid : Common.UI.getId(), themeId : theme.get_Index(), tip : tip, @@ -1991,8 +1986,6 @@ define([ uid : Common.UI.getId(), themeId : theme.get_Index(), tip : tip, - itemWidth : 85, - itemHeight : 38, offsety : 0 })); arr2.push({ diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 076d779fc..ce8338258 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -2031,8 +2031,8 @@ define([ style: 'max-height: 300px;', store : PE.getCollection('SlideThemes'), itemTemplate: _.template([ - '
      ', - '
      ', + '
      ', + '
      ' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"/>', '
      ' ].join('')) }).on('item:click', function(picker, item, record, e) { diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index f3fd39f7c..c71d95291 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -804,12 +804,12 @@ define([ me.listTheme.fieldPicker.itemTemplate = _.template([ '
      ', - '
      ', + '
      ' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"/>', '
      ' ].join('')); me.listTheme.menuPicker.itemTemplate = _.template([ '
      ', - '
      ', + '
      ' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"/>', '
      ' ].join('')); diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index 2ac1e08e4..cf734ba8a 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -332,4 +332,11 @@ z-index: @zindex-dropdown - 20; background-color: @gray-light; border: 1px solid @gray; -} \ No newline at end of file +} + +.item-theme { + width: 85px; + height: 38px; + .background-ximage('../../../../../../sdkjs/common/Images/themes_thumbnail.png', '../../../../../../sdkjs/common/Images/themes_thumbnail@2x.png', 85px); + background-size: cover +} From 0ea40446a6768176649cd0df57906fbd90d1648c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Jul 2019 13:05:34 +0300 Subject: [PATCH 020/154] Bug 42147 --- apps/documenteditor/main/app/view/Statusbar.js | 2 +- apps/presentationeditor/main/app/view/Statusbar.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index c62d7310f..f0fa2212a 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -364,7 +364,7 @@ define([ this.langMenu.prevTip = info.value; - var lang = this.langMenu.items.find(function(item){ return item.caption == info.displayValue; }); + var lang = _.find(this.langMenu.items, function(item) { return item.caption == info.displayValue; }); if (lang) lang.setChecked(true); else { diff --git a/apps/presentationeditor/main/app/view/Statusbar.js b/apps/presentationeditor/main/app/view/Statusbar.js index 2af687127..0c1345649 100644 --- a/apps/presentationeditor/main/app/view/Statusbar.js +++ b/apps/presentationeditor/main/app/view/Statusbar.js @@ -351,7 +351,7 @@ define([ $parent.find('#status-label-lang').text(info.displayValue); this.langMenu.prevTip = info.value; - var lang = this.langMenu.items.find(function(item){ return item.caption == info.displayValue; }); + var lang = _.find(this.langMenu.items, function(item) { return item.caption == info.displayValue; }); if (lang) lang.setChecked(true); else { From 126c92d14f2041913675317161449714e9ec27db Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Jul 2019 13:24:38 +0300 Subject: [PATCH 021/154] [SSE] Fix Bug 42169 --- .../main/app/controller/DocumentHolder.js | 13 +++++++---- .../main/app/view/DocumentHolder.js | 23 +++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index e73d49bc6..1ea24df64 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -159,6 +159,9 @@ define([ view.pmiTextCut.on('click', _.bind(me.onCopyPaste, me)); view.pmiTextCopy.on('click', _.bind(me.onCopyPaste, me)); view.pmiTextPaste.on('click', _.bind(me.onCopyPaste, me)); + view.pmiCommonCut.on('click', _.bind(me.onCopyPaste, me)); + view.pmiCommonCopy.on('click', _.bind(me.onCopyPaste, me)); + view.pmiCommonPaste.on('click', _.bind(me.onCopyPaste, me)); view.pmiInsertEntire.on('click', _.bind(me.onInsertEntire, me)); view.pmiDeleteEntire.on('click', _.bind(me.onDeleteEntire, me)); view.pmiInsertCells.menu.on('item:click', _.bind(me.onInsertCells, me)); @@ -1514,7 +1517,10 @@ define([ case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = !internaleditor; break; } - if (isimagemenu || isshapemenu || ischartmenu) { + if (this.api.asc_getHeaderFooterMode()) { + if (!documentHolder.copyPasteMenu || !showMenu && !documentHolder.copyPasteMenu.isVisible()) return; + if (showMenu) this.showPopupMenu(documentHolder.copyPasteMenu, {}, event); + } else if (isimagemenu || isshapemenu || ischartmenu) { if (!documentHolder.imgMenu || !showMenu && !documentHolder.imgMenu.isVisible()) return; isimagemenu = isshapemenu = ischartmenu = false; @@ -1661,8 +1667,7 @@ define([ formatTableInfo = cellinfo.asc_getFormatTableInfo(), isinsparkline = (cellinfo.asc_getSparklineInfo()!==null), isintable = (formatTableInfo !== null), - ismultiselect = cellinfo.asc_getFlags().asc_getMultiselect(), - inHeaderDlg = $('.asc-window.enable-key-events:visible').length>0; + ismultiselect = cellinfo.asc_getFlags().asc_getMultiselect(); documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null; documentHolder.ssMenu.cellColor = cellinfo.asc_getFill().asc_getColor(); documentHolder.ssMenu.fontColor = cellinfo.asc_getFont().asc_getColor(); @@ -1719,8 +1724,6 @@ define([ commentsController && commentsController.blockPopover(true); - documentHolder.pmiClear.setVisible(!inHeaderDlg); - documentHolder.ssMenu.items[3].setVisible(!inHeaderDlg); documentHolder.pmiClear.menu.items[0].setDisabled(!this.permissions.canModifyFilter); documentHolder.pmiClear.menu.items[1].setDisabled(iscelledit); documentHolder.pmiClear.menu.items[2].setDisabled(iscelledit || !this.permissions.canModifyFilter); diff --git a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js index 5f723028e..5613d6d40 100644 --- a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js @@ -922,6 +922,29 @@ define([ ] }); + me.pmiCommonCut = new Common.UI.MenuItem({ + caption : me.txtCut, + value : 'cut' + }); + + me.pmiCommonCopy = new Common.UI.MenuItem({ + caption : me.txtCopy, + value : 'copy' + }); + + me.pmiCommonPaste = new Common.UI.MenuItem({ + caption : me.txtPaste, + value : 'paste' + }); + + this.copyPasteMenu = new Common.UI.Menu({ + items: [ + me.pmiCommonCut, + me.pmiCommonCopy, + me.pmiCommonPaste + ] + }); + this.entriesMenu = new Common.UI.Menu({ maxHeight: 200, cyclic: false, From 3c8d3c8e5ce188efd1c6f1156fb75cf87af79425 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Jul 2019 13:43:10 +0300 Subject: [PATCH 022/154] [PE] Header/Footer: apply font size by pressing enter --- .../main/app/view/HeaderFooterDialog.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js index 8ee3b5d13..29dbae752 100644 --- a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js @@ -372,6 +372,9 @@ define([ data: data })); this.cmbFontSize[0].on('selected', _.bind(this.onFontSizeSelect, this)); + this.cmbFontSize[0].on('changed:before', _.bind(this.onFontSizeChanged, this, true)); + this.cmbFontSize[0].on('changed:after', _.bind(this.onFontSizeChanged, this, false)); + this.cmbFontSize[0].setValue(this._state.fontsize); this.headerControls.push(this.cmbFontSize[0]); @@ -385,6 +388,8 @@ define([ data: data })); this.cmbFontSize[1].on('selected', _.bind(this.onFontSizeSelect, this)); + this.cmbFontSize[1].on('changed:before', _.bind(this.onFontSizeChanged, this, true)); + this.cmbFontSize[1].on('changed:after', _.bind(this.onFontSizeChanged, this, false)); this.cmbFontSize[1].setValue(this._state.fontsize); this.footerControls.push(this.cmbFontSize[1]); @@ -782,6 +787,36 @@ define([ this.onCanvasClick(this.currentCanvas); }, + onFontSizeChanged: function(before, combo, record, e) { + var value, + me = this; + + if (before) { + var item = combo.store.findWhere({ + displayValue: record.value + }); + + if (!item) { + value = /^\+?(\d*\.?\d+)$|^\+?(\d+\.?\d*)$/.exec(record.value); + + if (!value) { + value = combo.getValue(); + combo.setRawValue(value); + e.preventDefault(); + return false; + } + } + } else { + value = parseFloat(record.value); + value = value > 409 ? 409 : + value < 1 ? 1 : Math.floor((value+0.4)*2)/2; + + combo.setRawValue(value); + if (this.HFObject) + this.HFObject.setFontSize(value); + } + }, + onBoldClick: function(btn, e) { if (this.HFObject) { this.HFObject.setBold(btn.pressed); From f97967a60c603c4909eecc123db256b32254db58 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Jul 2019 13:56:02 +0300 Subject: [PATCH 023/154] [PE] Header/Footer: reset preset name --- apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js index 29dbae752..5914dd12d 100644 --- a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js @@ -763,6 +763,7 @@ define([ }, onPresetSelect: function(footer, combo, record) { + combo.setValue(this.textPresets); if (this.HFObject) this.HFObject.applyPreset(record.value, !!footer); this.onCanvasClick(footer ? '#footer-left-img' : '#header-left-img'); From a5a01c04713bb12bf64bead582554868eb1ddfc6 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 23 Jul 2019 14:40:18 +0300 Subject: [PATCH 024/154] [DE mobile] [PE mobile] [SSE mobile] Document Info --- .../mobile/app/controller/Settings.js | 12 +- .../mobile/app/template/Settings.template | 54 ++++++++- .../mobile/app/view/Settings.js | 8 +- apps/documenteditor/mobile/locale/en.json | 10 ++ .../mobile/app/controller/Settings.js | 2 +- .../mobile/app/template/Settings.template | 10 ++ .../mobile/app/view/Settings.js | 3 +- apps/presentationeditor/mobile/locale/en.json | 10 ++ .../mobile/app/controller/Settings.js | 42 +++++++ .../mobile/app/template/Settings.template | 108 ++++++++++++++++-- .../mobile/app/view/Settings.js | 21 ++-- apps/spreadsheeteditor/mobile/locale/en.json | 10 ++ 12 files changed, 264 insertions(+), 26 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 7a98f7512..ed2c91303 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -415,8 +415,10 @@ define([ var document = Common.SharedSettings.get('document') || {}, info = document.info || {}; - $('#settings-document-title').html(document.title ? document.title : me.unknownText); - $('#settings-document-owner').html(info.author ? info.author : me.unknownText); + document.title ? $('#settings-document-title').html(document.title) : $('.display-document-title').remove(); + info.author ? $('#settings-document-owner').html(info.author) : $('.display-owner').remove(); + info.uploaded ? $('#settings-doc-uploaded').html(info.uploaded.toLocaleString()) : $('.display-uploaded').remove(); + info.folder ? $('#settings-doc-location').html(info.folder) : $('.display-location').remove(); var appProps = (this.api) ? this.api.asc_getAppProps() : null; if (appProps) { @@ -432,6 +434,12 @@ define([ value ? $('#settings-doc-subject').html(value) : $('.display-subject').remove(); value = props.asc_getDescription(); value ? $('#settings-doc-comment').html(value) : $('.display-comment').remove(); + value = props.asc_getModified(); + value ? $('#settings-doc-last-mod').html(value.toLocaleString()) : $('.display-last-mode').remove(); + value = props.asc_getLastModifiedBy(); + value ? $('#settings-doc-mod-by').html(value) : $('.display-mode-by').remove(); + value = props.asc_getCreated(); + value ? $('#settings-doc-date').html(value.toLocaleString()) : $('.display-created-date').remove(); value = props.asc_getCreator(); var templateCreator = ""; value && value.split(/\s*[,;]\s*/).forEach(function(item) { diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index ff5505ebb..9fd27d6be 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -302,8 +302,8 @@
      -
      <%= scope.textOwner %>
      -
      +
      <%= scope.textOwner %>
      +
      • @@ -312,6 +312,26 @@
      +
      <%= scope.textLocation %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textUploaded %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      <%= scope.textStatistic %>
        @@ -378,6 +398,36 @@
      +
      <%= scope.textLastModified %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textLastModifiedBy %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      +
      <%= scope.textCreated %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      <%= scope.textApplication %>
        diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 9665fb8bd..f640eaecb 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -294,7 +294,13 @@ define([ textTitle: 'Title', textComment: 'Comment', textOwner: 'Owner', - textApplication : 'Application' + textApplication : 'Application', + textLocation: 'Location', + textUploaded: 'Uploaded', + textLastModified: 'Last Modified', + textLastModifiedBy: 'Last Modified By', + textCreated: 'Created' + } })(), DE.Views.Settings || {})) diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 3e5f76b8e..268d3347f 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -495,6 +495,16 @@ "DE.Views.Settings.textCommentingDisplay": "Commenting Display", "DE.Views.Settings.textDisplayComments": "Comments", "DE.Views.Settings.textDisplayResolvedComments": "Resolved Comments", + "DE.Views.Settings.textSubject": "Subject", + "DE.Views.Settings.textTitle": "Title", + "DE.Views.Settings.textComment": "Comment", + "DE.Views.Settings.textOwner": "Owner", + "DE.Views.Settings.textApplication": "Application", + "DE.Views.Settings.textLocation": "Location", + "DE.Views.Settings.textUploaded": "Uploaded", + "DE.Views.Settings.textLastModified": "Last Modified", + "DE.Views.Settings.textLastModifiedBy": "Last Modified By", + "DE.Views.Settings.textCreated": "Created", "DE.Views.Toolbar.textBack": "Back", "Common.Views.Collaboration.textCollaboration": "Collaboration", "Common.Views.Collaboration.textReviewing": "Review", diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index a7580e2a6..ba56d02d7 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -202,7 +202,7 @@ define([ document.title ? $('#settings-presentation-title').html(document.title) : $('.display-presentation-title').remove(); info.author ? $('#settings-pe-owner').html(info.author) : $('.display-owner').remove(); info.uploaded ? $('#settings-pe-uploaded').html(info.uploaded.toLocaleString()) : $('.display-uploaded').remove(); - /*info.created ? $('#settings-pe-date').html(info.created) : $('.display-created-date').remove();*/ + info.folder ? $('#settings-pe-location').html(info.folder) : $('.display-location').remove(); var appProps = (this.api) ? this.api.asc_getAppProps() : null; if (appProps) { diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 7bae06462..eeb815f61 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -163,6 +163,16 @@
      +
      <%= scope.textLocation %>
      +
      +
        +
      • +
        +
        <%= scope.textLoading %>
        +
        +
      • +
      +
      <%= scope.textUploaded %>