From b32bedb845abe3c8956cd53ab78c518d5d3f48e7 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 10 Apr 2019 13:48:40 +0300 Subject: [PATCH 01/59] Add layout advanced settings --- .../mobile/app/template/Settings.template | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 3b156b48a..eeeca441c 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -99,6 +99,18 @@ +
  • + +
    +
    + +
    +
    +
    Advanced Settings
    +
    +
    +
    +
  • From b3596016a6a13c4804e93dd6490a395e24eafeaa Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 10 Apr 2019 13:55:48 +0300 Subject: [PATCH 02/59] Update mobile layout Advanced Settings --- apps/documenteditor/mobile/app/template/Settings.template | 2 +- apps/documenteditor/mobile/app/view/Settings.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index eeeca441c..c9499b1b5 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -106,7 +106,7 @@
    -
    Advanced Settings
    +
    <%= scope.textAdvancedSettings %>
    diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 3189471a4..83c434940 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -276,7 +276,8 @@ define([ textTop: 'Top', textLeft: 'Left', textBottom: 'Bottom', - textRight: 'Right' + textRight: 'Right', + textAdvancedSettings: 'Advanced Settings' } })(), DE.Views.Settings || {})) From 02a9aad05d2e4ca50d1616355b060edce262f983 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 11 Apr 2019 14:43:18 +0300 Subject: [PATCH 03/59] [de mobile] add settings for units --- .../mobile/app/controller/Main.js | 10 ++-- .../mobile/app/controller/Settings.js | 21 ++++++++ .../mobile/app/template/Settings.template | 49 +++++++++++++++++++ .../mobile/app/view/Settings.js | 10 +++- 4 files changed, 83 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index f419d3536..6c57bc018 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -756,11 +756,11 @@ define([ applyModeEditorElements: function() { if (this.appOptions.isEdit) { var me = this; -// -// var value = Common.localStorage.getItem('de-settings-unit'); -// value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); -// Common.Utils.Metric.setCurrentMetric(value); -// me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter)); + + var value = Common.localStorage.getItem('de-mobile-settings-unit'); + value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); + Common.Utils.Metric.setCurrentMetric(value); + me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter)); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index f15b1d004..62fcfbe32 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -221,6 +221,9 @@ define([ // About me.setLicInfo(_licInfo); Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content'); + } else if ('#settings-advanced-view' == pageId) { + me.initPageAdvancedSettings(); + Common.Utils.addScrollIfNeed('.page[data-page=settings-advanced-view]', '.page[data-page=settings-advanced-view] .page-content'); } else { $('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode')); $('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false)); @@ -236,6 +239,15 @@ define([ } }, + initPageAdvancedSettings: function () { + var me = this, + $unitMeasurement = $('.page[data-page=settings-advanced-view] input:radio[name=unit-of-measurement]'); + $unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me)); + var value = Common.localStorage.getItem('de-mobile-settings-unit'); + value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); + $unitMeasurement.val([value]); + }, + initPageDocumentSettings: function () { var me = this, $pageOrientation = $('.page[data-page=settings-document-view] input:radio[name=doc-orientation]'), @@ -462,6 +474,15 @@ define([ }, 300); }, + unitMeasurementChange: function (e) { + var value = $(e.currentTarget).val(); + value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); + Common.Utils.Metric.setCurrentMetric(value); + Common.localStorage.setItem("de-mobile-settings-unit", value); + this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter)); + + }, + onPageMarginsChange: function (align, e) { var me = this, $button = $(e.currentTarget), diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index c9499b1b5..b0f75d806 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -612,4 +612,53 @@ + + + +
    + +
    +
    +
    +
    <%= scope.textUnitOfMeasurement %>
    +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 83c434940..47e18307f 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -124,6 +124,7 @@ define([ $layour.find('#settings-search .item-title').text(this.textFindAndReplace) } else { $layour.find('#settings-document').hide(); + $layour.find('#settings-advanced').hide(); $layour.find('#settings-spellcheck').hide(); $layour.find('#settings-orthography').hide(); } @@ -154,7 +155,8 @@ define([ updateItemHandlers: function () { var selectorsDynamicPage = [ '.page[data-page=settings-root-view]', - '.page[data-page=settings-document-view]' + '.page[data-page=settings-document-view]', + '.page[data-page=settings-advanced-view]' ].map(function (selector) { return selector + ' a.item-link[data-page]'; }).join(', '); @@ -277,7 +279,11 @@ define([ textLeft: 'Left', textBottom: 'Bottom', textRight: 'Right', - textAdvancedSettings: 'Advanced Settings' + textAdvancedSettings: 'Advanced Settings', + textUnitOfMeasurement: 'Unit of Measurement', + textCentimeter: 'Centimeter', + textPoint: 'Point', + textInch: 'Inch' } })(), DE.Views.Settings || {})) From 0f043e0faaa476c20d5c12e8222153db491fdc33 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 11 Apr 2019 16:13:41 +0300 Subject: [PATCH 04/59] [de mobile] change metric text --- apps/documenteditor/mobile/app/controller/edit/EditChart.js | 4 +++- apps/documenteditor/mobile/app/controller/edit/EditImage.js | 1 + .../mobile/app/controller/edit/EditParagraph.js | 1 + apps/documenteditor/mobile/app/controller/edit/EditShape.js | 1 + apps/documenteditor/mobile/app/controller/edit/EditTable.js | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/app/controller/edit/EditChart.js b/apps/documenteditor/mobile/app/controller/edit/EditChart.js index 25db03196..553dbaf1b 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditChart.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditChart.js @@ -171,7 +171,7 @@ define([ initSettings: function (pageId) { var me = this; - + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); if (_chartObject) { if (pageId == '#edit-chart-wrap') { me._initWrapView(); @@ -222,6 +222,7 @@ define([ paletteFillColor = me.getView('EditChart').paletteFillColor, paletteBorderColor = me.getView('EditChart').paletteBorderColor; + // Style var type = chartProperties.getType(); @@ -426,6 +427,7 @@ define([ properties = new Asc.asc_CImgProperty(), paddings = new Asc.asc_CPaddings(); + $('.chart-wrap .distance .item-after').text(value + ' ' + _metricText); value = Common.Utils.Metric.fnRecalcToMM(parseInt(value)); diff --git a/apps/documenteditor/mobile/app/controller/edit/EditImage.js b/apps/documenteditor/mobile/app/controller/edit/EditImage.js index 7098f8969..a8ad16c6e 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditImage.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditImage.js @@ -147,6 +147,7 @@ define([ me._initWrapView(); } } + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); }, _initWrapView: function() { diff --git a/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js b/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js index efd160e66..3386260cc 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js @@ -129,6 +129,7 @@ define([ initSettings: function () { var me = this; + metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); var selectedElements = me.api.getSelectedElements(); if (selectedElements && _.isArray(selectedElements)) { for (var i = selectedElements.length - 1; i >= 0; i--) { diff --git a/apps/documenteditor/mobile/app/controller/edit/EditShape.js b/apps/documenteditor/mobile/app/controller/edit/EditShape.js index f432ad22e..34eaa64e4 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditShape.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditShape.js @@ -181,6 +181,7 @@ define([ me.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().get_CanFill(); } } + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); }, _initWrapView: function() { diff --git a/apps/documenteditor/mobile/app/controller/edit/EditTable.js b/apps/documenteditor/mobile/app/controller/edit/EditTable.js index 86b7dde72..ae90d74b1 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditTable.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditTable.js @@ -185,6 +185,7 @@ define([ initSettings: function (pageId) { var me = this; + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); if (_tableObject) { if (pageId == '#edit-table-wrap') { From 20c211c1daf2edf2828479ff821fdf2a5e9f926e Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 11 Apr 2019 16:36:29 +0300 Subject: [PATCH 05/59] [de mobile] change application settings and add traslation --- apps/documenteditor/mobile/app/controller/edit/EditImage.js | 3 ++- apps/documenteditor/mobile/app/controller/edit/EditShape.js | 3 +-- apps/documenteditor/mobile/app/view/Settings.js | 2 +- apps/documenteditor/mobile/locale/en.json | 5 +++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/edit/EditImage.js b/apps/documenteditor/mobile/app/controller/edit/EditImage.js index a8ad16c6e..8e3c9de4b 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditImage.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditImage.js @@ -142,12 +142,13 @@ define([ initSettings: function (pageId) { var me = this; + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); + if (_imageObject) { if (pageId == '#edit-image-wrap-view') { me._initWrapView(); } } - _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); }, _initWrapView: function() { diff --git a/apps/documenteditor/mobile/app/controller/edit/EditShape.js b/apps/documenteditor/mobile/app/controller/edit/EditShape.js index 34eaa64e4..7c1e9272a 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditShape.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditShape.js @@ -171,7 +171,7 @@ define([ var me = this; // me.api && me.api.UpdateInterfaceState(); - + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); if (_shapeObject) { if (pageId == '#edit-shape-wrap') { me._initWrapView(); @@ -181,7 +181,6 @@ define([ me.getView('EditShape').isShapeCanFill = _shapeObject.get_ShapeProperties().get_CanFill(); } } - _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); }, _initWrapView: function() { diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 47e18307f..e0c329237 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -279,7 +279,7 @@ define([ textLeft: 'Left', textBottom: 'Bottom', textRight: 'Right', - textAdvancedSettings: 'Advanced Settings', + textAdvancedSettings: 'Application Settings', textUnitOfMeasurement: 'Unit of Measurement', textCentimeter: 'Centimeter', textPoint: 'Point', diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 6efabb094..eb0849b2a 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -414,5 +414,10 @@ "DE.Views.Settings.textVersion": "Version", "DE.Views.Settings.textWords": "Words", "DE.Views.Settings.unknownText": "Unknown", + "DE.Views.Settings.textAdvancedSettings": "Application Settings", + "DE.Views.Settings.textUnitOfMeasurement": "Unit of Measurement", + "DE.Views.Settings.textCentimeter": "Centimeter", + "DE.Views.Settings.textPoint": "Point", + "DE.Views.Settings.textInch": "Inch", "DE.Views.Toolbar.textBack": "Back" } \ No newline at end of file From db404dfac07cd4fcb6db095af75a8c92f06db4c4 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 12 Apr 2019 14:30:19 +0300 Subject: [PATCH 06/59] =?UTF-8?q?[de=20mobile]=20=D1=81hanged=20unit=20siz?= =?UTF-8?q?es=20for=20table=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/documenteditor/mobile/app/controller/edit/EditChart.js | 4 ++-- apps/documenteditor/mobile/app/controller/edit/EditShape.js | 4 ++-- apps/documenteditor/mobile/app/controller/edit/EditTable.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/edit/EditChart.js b/apps/documenteditor/mobile/app/controller/edit/EditChart.js index 553dbaf1b..d38fbf8a9 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditChart.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditChart.js @@ -233,7 +233,7 @@ define([ var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4; var borderType = shapeProperties.get_stroke().get_type(); $('#edit-chart-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]); - $('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText); + $('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); paletteFillColor && paletteFillColor.on('select', _.bind(me.onFillColor, me)); paletteBorderColor && paletteBorderColor.on('select', _.bind(me.onBorderColor, me)); @@ -477,7 +477,7 @@ define([ onBorderSizeChanging: function (e) { var $target = $(e.currentTarget); - $('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText); + $('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); }, onFillColor: function(palette, color) { diff --git a/apps/documenteditor/mobile/app/controller/edit/EditShape.js b/apps/documenteditor/mobile/app/controller/edit/EditShape.js index 7c1e9272a..e55506676 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditShape.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditShape.js @@ -224,7 +224,7 @@ define([ var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4; var borderType = shapeProperties.get_stroke().get_type(); $('#edit-shape-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]); - $('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText); + $('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); // Init style opacity $('#edit-shape-effect input').val([shapeProperties.get_fill().asc_getTransparent() ? shapeProperties.get_fill().asc_getTransparent() / 2.55 : 100]); @@ -444,7 +444,7 @@ define([ onBorderSizeChanging: function (e) { var $target = $(e.currentTarget); - $('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText); + $('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); }, onOpacity: function (e) { diff --git a/apps/documenteditor/mobile/app/controller/edit/EditTable.js b/apps/documenteditor/mobile/app/controller/edit/EditTable.js index ae90d74b1..5c5c5ba25 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditTable.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditTable.js @@ -337,7 +337,7 @@ define([ // } $('#edit-table-bordersize input').val([borderSizeTransform.indexSizeByValue(_cellBorderWidth)]); - $('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByValue(_cellBorderWidth) + ' ' + _metricText); + $('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByValue(_cellBorderWidth) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); var borderPalette = me.getView('EditTable').paletteBorderColor; @@ -623,7 +623,7 @@ define([ onBorderSizeChanging: function (e) { var $target = $(e.currentTarget); - $('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText); + $('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); }, // API handlers From 652fafcbedcbca67dc08aa0f9cd3258a83516f89 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 12 Apr 2019 14:32:19 +0300 Subject: [PATCH 07/59] [pe mobile] added application settings (units) --- .../mobile/app/controller/Settings.js | 19 ++++++ .../mobile/app/controller/edit/EditChart.js | 4 +- .../mobile/app/controller/edit/EditShape.js | 4 +- .../mobile/app/controller/edit/EditTable.js | 5 +- .../mobile/app/controller/edit/EditText.js | 2 + .../mobile/app/template/Settings.template | 65 +++++++++++++++++++ .../mobile/app/view/Settings.js | 12 +++- apps/presentationeditor/mobile/locale/en.json | 5 ++ 8 files changed, 109 insertions(+), 7 deletions(-) diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index 222c16a6d..59c3e019c 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -175,9 +175,28 @@ define([ } else if (pageId == '#settings-about-view') { // About me.setLicInfo(_licInfo); + } else if ('#settings-application-view' == pageId) { + me.initPageApplicationSettings(); } }, + initPageApplicationSettings: function () { + var me = this, + $unitMeasurement = $('.page[data-page=settings-application-view] input:radio[name=unit-of-measurement]'); + $unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me)); + var value = Common.localStorage.getItem('pe-mobile-settings-unit'); + value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); + $unitMeasurement.val([value]); + }, + + unitMeasurementChange: function (e) { + var value = $(e.currentTarget).val(); + value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); + Common.Utils.Metric.setCurrentMetric(value); + Common.localStorage.setItem("pe-mobile-settings-unit", value); + this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter)); + }, + setLicInfo: function(data){ if (data && typeof data == 'object' && typeof(data.customer)=='object') { $('.page[data-page=settings-about-view] .logo').hide(); diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditChart.js b/apps/presentationeditor/mobile/app/controller/edit/EditChart.js index e03437470..1372edec8 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditChart.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditChart.js @@ -166,7 +166,7 @@ define([ var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4, borderType = _shapeObject.get_stroke().get_type(); $('#edit-chart-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]); - $('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText); + $('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); paletteFillColor && paletteFillColor.on('select', _.bind(me.onFillColor, me)); paletteBorderColor && paletteBorderColor.on('select', _.bind(me.onBorderColor, me)); @@ -330,7 +330,7 @@ define([ onBorderSizeChanging: function (e) { var $target = $(e.currentTarget); - $('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText); + $('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); }, onFillColor: function(palette, color) { diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditShape.js b/apps/presentationeditor/mobile/app/controller/edit/EditShape.js index 8ca49d3d0..3f264a65b 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditShape.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditShape.js @@ -157,7 +157,7 @@ define([ var borderSize = _shapeObject.get_stroke().get_width() * 72.0 / 25.4, borderType = _shapeObject.get_stroke().get_type(); $('#edit-shape-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]); - $('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText); + $('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); // Init style opacity $('#edit-shape-effect input').val([_shapeObject.get_fill().asc_getTransparent() ? _shapeObject.get_fill().asc_getTransparent() / 2.55 : 100]); @@ -306,7 +306,7 @@ define([ onBorderSizeChanging: function (e) { var $target = $(e.currentTarget); - $('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText); + $('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); }, onOpacity: function (e) { diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditTable.js b/apps/presentationeditor/mobile/app/controller/edit/EditTable.js index 4837138b7..ee7bce32a 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditTable.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditTable.js @@ -167,6 +167,7 @@ define([ initSettings: function (pageId) { var me = this; + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); if (_tableObject) { if (pageId == "#edit-table-style" || pageId == '#edit-table-border-color-view') { me._initStyleView(); @@ -268,7 +269,7 @@ define([ // } $('#edit-table-bordersize input').val([borderSizeTransform.indexSizeByValue(_cellBorderWidth)]); - $('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByValue(_cellBorderWidth) + ' ' + _metricText); + $('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByValue(_cellBorderWidth) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); var borderPalette = me.getView('EditTable').paletteBorderColor; @@ -464,7 +465,7 @@ define([ onBorderSizeChanging: function (e) { var $target = $(e.currentTarget); - $('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText); + $('#edit-table-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); }, onReorder: function (e) { diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditText.js b/apps/presentationeditor/mobile/app/controller/edit/EditText.js index b89a43cfd..546cea397 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditText.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditText.js @@ -170,6 +170,8 @@ define([ initSettings: function (pageId) { var me = this; + metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); + me.api && me.api.UpdateInterfaceState(); // TODO: refactor me if (_paragraphObject) { diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 52494bc42..6fd7a4afb 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -77,6 +77,18 @@
  • +
  • + +
    +
    + +
    +
    +
    <%= scope.textApplicationSettings %>
    +
    +
    +
    +
  • @@ -342,4 +354,57 @@
    + + + +
    + +
    +
    +
    +
    <%= scope.textUnitOfMeasurement %>
    +
    + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/view/Settings.js b/apps/presentationeditor/mobile/app/view/Settings.js index e31e4d909..a5510db8a 100644 --- a/apps/presentationeditor/mobile/app/view/Settings.js +++ b/apps/presentationeditor/mobile/app/view/Settings.js @@ -80,6 +80,7 @@ define([ $('#settings-help').single('click', _.bind(me.showHelp, me)); $('#settings-about').single('click', _.bind(me.showAbout, me)); $('#settings-presentation-setup').single('click', _.bind(me.showSetup, me)); + $('#settings-application').single('click', _.bind(me.showSetApp, me)); Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page'); me.initControls(); @@ -192,6 +193,10 @@ define([ this.showPage('#settings-setup-view'); }, + showSetApp: function () { + this.showPage('#settings-application-view'); + }, + loadDocument: function (data) { var permissions = {}; @@ -229,7 +234,12 @@ define([ textPoweredBy: 'Powered by', textFindAndReplace: 'Find and Replace', textSpellcheck: 'Spell Checking', - textPrint: 'Print' + textPrint: 'Print', + textApplicationSettings: 'Application Settings', + textUnitOfMeasurement: 'Unit of Measurement', + textCentimeter: 'Centimeter', + textPoint: 'Point', + textInch: 'Inch' } })(), PE.Views.Settings || {})) }); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 3cf5ab52e..95a83c7dc 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -465,6 +465,11 @@ "PE.Views.Settings.textSpellcheck": "Spell Checking", "PE.Views.Settings.textTel": "tel", "PE.Views.Settings.textVersion": "Version", + "DE.Views.Settings.textApplicationSettings": "Application Settings", + "DE.Views.Settings.textUnitOfMeasurement": "Unit of Measurement", + "DE.Views.Settings.textCentimeter": "Centimeter", + "DE.Views.Settings.textPoint": "Point", + "DE.Views.Settings.textInch": "Inch", "PE.Views.Settings.unknownText": "Unknown", "PE.Views.Toolbar.textBack": "Back" } \ No newline at end of file From 6e789718103012854c6f5045e7e9e7f7dcd98790 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 12 Apr 2019 14:33:14 +0300 Subject: [PATCH 08/59] [se mobile] added application settings (units) --- .../mobile/app/controller/Settings.js | 18 +++++ .../mobile/app/controller/edit/EditChart.js | 4 +- .../mobile/app/controller/edit/EditShape.js | 4 +- .../mobile/app/template/Settings.template | 65 +++++++++++++++++++ .../mobile/app/view/Settings.js | 12 +++- apps/spreadsheeteditor/mobile/locale/en.json | 5 ++ 6 files changed, 103 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index e4bf4c34e..10a0f72d9 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -158,6 +158,8 @@ define([ if (pageId == '#settings-about-view') { // About me.setLicInfo(_licInfo); + } else if ('#settings-application-view' == pageId) { + me.initPageApplicationSettings(); } }, @@ -198,6 +200,22 @@ define([ } }, + initPageApplicationSettings: function() { + var me = this, + $unitMeasurement = $('.page[data-page=settings-application-view] input:radio[name=unit-of-measurement]'); + $unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me)); + var value = Common.localStorage.getItem('se-mobile-settings-unit'); + value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); + $unitMeasurement.val([value]); + }, + + unitMeasurementChange: function (e) { + var value = $(e.currentTarget).val(); + value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric(); + Common.Utils.Metric.setCurrentMetric(value); + Common.localStorage.setItem("se-mobile-settings-unit", value); + }, + // API handlers _onSearch: function (e) { diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditChart.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditChart.js index 54e3727f8..7c396b240 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditChart.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditChart.js @@ -225,7 +225,7 @@ define([ var borderSize = shapeProperties.get_stroke().get_width() * 72.0 / 25.4, borderType = shapeProperties.get_stroke().get_type(); $('#edit-chart-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]); - $('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText); + $('#edit-chart-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); $('#edit-chart-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me)); $('#edit-chart-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me)); @@ -660,7 +660,7 @@ define([ onBorderSizeChanging: function (e) { var $target = $(e.currentTarget); - $('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText); + $('#edit-chart-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); }, onBorderColor: function (palette, color) { diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditShape.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditShape.js index 5ebd9a60e..d5b0afd6d 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditShape.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditShape.js @@ -182,7 +182,7 @@ define([ var borderSize = me._mm2pt(shapeProperties.get_stroke().get_width()), borderType = shapeProperties.get_stroke().get_type(); $('#edit-shape-bordersize input').val([(borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.indexSizeByValue(borderSize)]); - $('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + _metricText); + $('#edit-shape-bordersize .item-after').text(((borderType == Asc.c_oAscStrokeType.STROKE_NONE) ? 0 : borderSizeTransform.sizeByValue(borderSize)) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); $('#edit-shape-bordersize input').single('change touchend', _.buffered(me.onBorderSize, 100, me)); $('#edit-shape-bordersize input').single('input', _.bind(me.onBorderSizeChanging, me)); @@ -301,7 +301,7 @@ define([ onBorderSizeChanging: function (e) { var $target = $(e.currentTarget); - $('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + _metricText); + $('#edit-shape-bordersize .item-after').text(borderSizeTransform.sizeByIndex($target.val()) + ' ' + Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt)); }, onOpacity: function (e) { diff --git a/apps/spreadsheeteditor/mobile/app/template/Settings.template b/apps/spreadsheeteditor/mobile/app/template/Settings.template index c95d2ad14..bc36e9f8e 100644 --- a/apps/spreadsheeteditor/mobile/app/template/Settings.template +++ b/apps/spreadsheeteditor/mobile/app/template/Settings.template @@ -49,6 +49,18 @@
  • +
  • + +
    +
    + +
    +
    +
    <%= scope.textApplicationSettings %>
    +
    +
    +
    +
  • @@ -329,4 +341,57 @@
    + + + +
    + +
    +
    +
    +
    <%= scope.textUnitOfMeasurement %>
    +
    + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index 4e25b43e1..35de971fe 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -79,6 +79,7 @@ define([ $('#settings-history').single('click', _.bind(me.showHistory, me)); $('#settings-help').single('click', _.bind(me.showHelp, me)); $('#settings-about').single('click', _.bind(me.showAbout, me)); + $('#settings-application').single('click', _.bind(me.showSetApp, me)); Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page'); me.initControls(); @@ -162,6 +163,10 @@ define([ } }, + showSetApp: function() { + this.showPage('#settings-application-view'); + }, + showDocumentInfo: function() { this.showPage('#settings-info-view'); @@ -225,7 +230,12 @@ define([ textEmail: 'email', textTel: 'tel', textPoweredBy: 'Powered by', - textPrint: 'Print' + textPrint: 'Print', + textApplicationSettings: 'Application Settings', + textUnitOfMeasurement: 'Unit of Measurement', + textCentimeter: 'Centimeter', + textPoint: 'Point', + textInch: 'Inch' } })(), 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 fe13bd8ea..7656c8304 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -512,6 +512,11 @@ "SSE.Views.Settings.textSettings": "Settings", "SSE.Views.Settings.textTel": "tel", "SSE.Views.Settings.textVersion": "Version", + "DE.Views.Settings.textApplicationSettings": "Application Settings", + "DE.Views.Settings.textUnitOfMeasurement": "Unit of Measurement", + "DE.Views.Settings.textCentimeter": "Centimeter", + "DE.Views.Settings.textPoint": "Point", + "DE.Views.Settings.textInch": "Inch", "SSE.Views.Settings.unknownText": "Unknown", "SSE.Views.Toolbar.textBack": "Back" } \ No newline at end of file From 1ae45b6f2a8e14aa2c92f40f37fdf99c1d0a70b7 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Mon, 15 Apr 2019 17:42:17 +0300 Subject: [PATCH 09/59] [de mobile] added color schemes --- .../resources/less/ios/_color-schema.less | 27 +++++++++++++++ .../less/material/_color-schema.less | 27 +++++++++++++++ .../mobile/app/controller/Settings.js | 34 +++++++++++++++++-- .../mobile/app/template/Settings.template | 32 +++++++++++++++++ .../mobile/app/view/Settings.js | 4 ++- .../mobile/resources/css/app-ios.css | 28 +++++++++++++++ .../mobile/resources/css/app-material.css | 29 +++++++++++++++- .../mobile/resources/less/app-ios.less | 1 + .../mobile/resources/less/app-material.less | 1 + 9 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 apps/common/mobile/resources/less/ios/_color-schema.less create mode 100644 apps/common/mobile/resources/less/material/_color-schema.less diff --git a/apps/common/mobile/resources/less/ios/_color-schema.less b/apps/common/mobile/resources/less/ios/_color-schema.less new file mode 100644 index 000000000..0e5581f32 --- /dev/null +++ b/apps/common/mobile/resources/less/ios/_color-schema.less @@ -0,0 +1,27 @@ +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; + .item-content { + padding-left: 0; + } + .item-inner { + justify-content: flex-start; + padding-left: 16px; + } + .color-schema-block { + min-width: 150px; + display: flex; + } + .color { + min-width: 26px; + min-height: 26px; + flex-grow: 1; + margin: 0 1px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; + } + .text { + margin-left: 20px; + color: #212121; + } +} \ No newline at end of file diff --git a/apps/common/mobile/resources/less/material/_color-schema.less b/apps/common/mobile/resources/less/material/_color-schema.less new file mode 100644 index 000000000..0e5581f32 --- /dev/null +++ b/apps/common/mobile/resources/less/material/_color-schema.less @@ -0,0 +1,27 @@ +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; + .item-content { + padding-left: 0; + } + .item-inner { + justify-content: flex-start; + padding-left: 16px; + } + .color-schema-block { + min-width: 150px; + display: flex; + } + .color { + min-width: 26px; + min-height: 26px; + flex-grow: 1; + margin: 0 1px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; + } + .text { + margin-left: 20px; + color: #212121; + } +} \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 62fcfbe32..29f878b17 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -82,7 +82,8 @@ define([ _licInfo, _canReview = false, _isReviewOnly = false, - _fileKey; + _fileKey, + templateInsert; var mm2Cm = function(mm) { return parseFloat((mm/10.).toFixed(2)); @@ -130,6 +131,7 @@ define([ me.api.asc_registerCallback('asc_onDocumentName', _.bind(me.onApiDocumentName, me)); me.api.asc_registerCallback('asc_onDocSize', _.bind(me.onApiPageSize, me)); me.api.asc_registerCallback('asc_onPageOrient', _.bind(me.onApiPageOrient, me)); + me.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(me.onSendThemeColorSchemes, me)); }, onLaunch: function () { @@ -224,6 +226,9 @@ define([ } else if ('#settings-advanced-view' == pageId) { me.initPageAdvancedSettings(); 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(); + Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content'); } else { $('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode')); $('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false)); @@ -239,7 +244,32 @@ define([ } }, - initPageAdvancedSettings: function () { + initPageColorSchemes: function() { + $('#color-schemes-content').html(templateInsert); + $('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this)); + }, + + onSendThemeColorSchemes: function (schemas) { + templateInsert = ""; + _.each(schemas, function (schema, index) { + var colors = schema.get_colors();//schema.colors; + templateInsert = templateInsert + "
    "; + for (var j = 2; j < 7; j++) { + var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b()); + templateInsert = templateInsert + "" + } + templateInsert = templateInsert + "" + schema.get_name() + "
    "; + }, this); + }, + + onColorSchemaClick: function(event) { + if (this.api) { + var ind = $(event.currentTarget).children('input').val(); + this.api.ChangeColorScheme(ind); + } + }, + + initPageAdvancedSettings: function() { var me = this, $unitMeasurement = $('.page[data-page=settings-advanced-view] input:radio[name=unit-of-measurement]'); $unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me)); diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index b0f75d806..b29f3b986 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -111,6 +111,18 @@
  • +
  • + +
    +
    + +
    +
    +
    <%= scope.textColorSchemes %>
    +
    +
    +
    +
  • @@ -658,6 +670,26 @@
    + + + + + + +
    + +
    +
    +
    +
    + +
    +
    diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index e0c329237..8adba6250 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -125,6 +125,7 @@ define([ } 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(); } @@ -283,7 +284,8 @@ define([ textUnitOfMeasurement: 'Unit of Measurement', textCentimeter: 'Centimeter', textPoint: 'Point', - textInch: 'Inch' + textInch: 'Inch', + textColorSchemes: 'Color Schemes' } })(), DE.Views.Settings || {})) diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index e4e902ab9..af9f6c188 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -6830,3 +6830,31 @@ html.pixel-ratio-3 .numbers li { max-height: 100%; overflow: auto; } + +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; +} +.color-schemes-menu .item-content { + padding-left: 0; +} +.color-schemes-menu .item-inner { + justify-content: flex-start; + padding-left: 16px; +} +.color-schemes-menu .color-schema-block { + min-width: 150px; + display: flex; +} +.color-schemes-menu .color { + min-width: 26px; + min-height: 26px; + flex-grow: 1; + margin: 0 1px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; +} +.color-schemes-menu .text { + margin-left: 20px; + color: #212121; +} diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index 7d3b21c84..50fc7fe4b 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -5836,7 +5836,34 @@ html.phone .document-menu .list-block .item-link { margin-right: 5px; } .about .logo { - background: url('../../../../common/mobile/resources/img/about/logo.svg') no-repeat center; + background: url('../../../../common/mobile/resources/img/about/onlyoffice.svg') no-repeat center; +} +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; +} +.color-schemes-menu .item-content { + padding-left: 0; +} +.color-schemes-menu .item-inner { + justify-content: flex-start; + padding-left: 16px; +} +.color-schemes-menu .color-schema-block { + min-width: 150px; + display: flex; +} +.color-schemes-menu .color { + min-width: 26px; + min-height: 26px; + flex-grow: 1; + margin: 0 1px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; +} +.color-schemes-menu .text { + margin-left: 20px; + color: #212121; } .tablet .searchbar.document.replace .center > .replace { display: flex; diff --git a/apps/documenteditor/mobile/resources/less/app-ios.less b/apps/documenteditor/mobile/resources/less/app-ios.less index 2c7ace91f..26ec02ce6 100644 --- a/apps/documenteditor/mobile/resources/less/app-ios.less +++ b/apps/documenteditor/mobile/resources/less/app-ios.less @@ -40,6 +40,7 @@ @import url('../../../../../vendor/framework7/src/less/ios/notifications.less'); //@import url('../../../../../vendor/framework7/src/less/ios/login-screen.less'); @import url('../../../../../vendor/framework7/src/less/ios/disabled.less'); +@import url('../../../../common/mobile/resources/less/material/_color-schema.less'); // Disable text select * { diff --git a/apps/documenteditor/mobile/resources/less/app-material.less b/apps/documenteditor/mobile/resources/less/app-material.less index 6b3372451..87cbc32a5 100644 --- a/apps/documenteditor/mobile/resources/less/app-material.less +++ b/apps/documenteditor/mobile/resources/less/app-material.less @@ -53,6 +53,7 @@ @import url('../../../../common/mobile/resources/less/material/_contextmenu.less'); @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('material/_search.less'); @import url('material/_icons.less'); From 42667a48bf9661b2682851ef1245bebf03b306f9 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 16 Apr 2019 20:33:47 +0300 Subject: [PATCH 10/59] [de mobile] transfer color schemes to document settings and transfer spellcheck to application settings --- .../mobile/app/controller/Settings.js | 8 +-- .../mobile/app/template/Settings.template | 58 ++++++++++--------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 29f878b17..44b8717da 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -225,18 +225,18 @@ define([ Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content'); } else if ('#settings-advanced-view' == pageId) { me.initPageAdvancedSettings(); + $('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false)); + $('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me)); + $('#settings-orthography').single('click', _.bind(me.onOrthographyCheck, 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(); Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content'); } else { $('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode')); - $('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false)); $('#settings-review input:checkbox').attr('checked', _isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); $('#settings-search').single('click', _.bind(me.onSearch, me)); $('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me)); - $('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me)); - $('#settings-orthography').single('click', _.bind(me.onOrthographyCheck, me)); $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); $('#settings-help').single('click', _.bind(me.onShowHelp, me)); $('#settings-download').single('click', _.bind(me.onDownloadOrigin, me)); @@ -253,7 +253,7 @@ define([ templateInsert = ""; _.each(schemas, function (schema, index) { var colors = schema.get_colors();//schema.colors; - templateInsert = templateInsert + "
  • -
  • -
    -
    - -
    -
    -
    <%= scope.textSpellcheck %>
    -
    - -
    -
    -
    -
  • <% if (orthography) { %>
  • @@ -111,18 +95,6 @@
  • -
  • - -
    -
    - -
    -
    -
    <%= scope.textColorSchemes %>
    -
    -
    -
    -
  • @@ -328,6 +300,19 @@
  • +
    + +
    @@ -637,6 +622,7 @@
    +
    <%= scope.textUnitOfMeasurement %>
      @@ -670,6 +656,22 @@
    +
    +
      +
      +
      +
      <%= scope.textSpellcheck %>
      +
      + +
      +
      +
      +
    +
    +
    From a7e375ced19f2672ab4415527591f8362b2f07af Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 16 Apr 2019 20:34:44 +0300 Subject: [PATCH 11/59] [pe mobile] corrected translation --- apps/presentationeditor/mobile/locale/en.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 95a83c7dc..f9c720d89 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -465,11 +465,11 @@ "PE.Views.Settings.textSpellcheck": "Spell Checking", "PE.Views.Settings.textTel": "tel", "PE.Views.Settings.textVersion": "Version", - "DE.Views.Settings.textApplicationSettings": "Application Settings", - "DE.Views.Settings.textUnitOfMeasurement": "Unit of Measurement", - "DE.Views.Settings.textCentimeter": "Centimeter", - "DE.Views.Settings.textPoint": "Point", - "DE.Views.Settings.textInch": "Inch", + "PE.Views.Settings.textApplicationSettings": "Application Settings", + "PE.Views.Settings.textUnitOfMeasurement": "Unit of Measurement", + "PE.Views.Settings.textCentimeter": "Centimeter", + "PE.Views.Settings.textPoint": "Point", + "PE.Views.Settings.textInch": "Inch", "PE.Views.Settings.unknownText": "Unknown", "PE.Views.Toolbar.textBack": "Back" } \ No newline at end of file From eca55fd472ab7672962a547af6f1a89499502f6b Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 16 Apr 2019 20:36:19 +0300 Subject: [PATCH 12/59] [de mobile] corrected link and change less color schemes --- .../resources/less/ios/_color-schema.less | 4 +- .../less/material/_color-schema.less | 4 +- .../mobile/resources/css/app-ios.css | 55 +++++++++---------- .../mobile/resources/css/app-material.css | 6 +- .../mobile/resources/less/app-ios.less | 3 +- 5 files changed, 32 insertions(+), 40 deletions(-) diff --git a/apps/common/mobile/resources/less/ios/_color-schema.less b/apps/common/mobile/resources/less/ios/_color-schema.less index 0e5581f32..ce527c340 100644 --- a/apps/common/mobile/resources/less/ios/_color-schema.less +++ b/apps/common/mobile/resources/less/ios/_color-schema.less @@ -10,14 +10,12 @@ padding-left: 16px; } .color-schema-block { - min-width: 150px; display: flex; } .color { min-width: 26px; min-height: 26px; - flex-grow: 1; - margin: 0 1px 0 0; + margin: 0 2px 0 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; } .text { diff --git a/apps/common/mobile/resources/less/material/_color-schema.less b/apps/common/mobile/resources/less/material/_color-schema.less index 0e5581f32..ce527c340 100644 --- a/apps/common/mobile/resources/less/material/_color-schema.less +++ b/apps/common/mobile/resources/less/material/_color-schema.less @@ -10,14 +10,12 @@ padding-left: 16px; } .color-schema-block { - min-width: 150px; display: flex; } .color { min-width: 26px; min-height: 26px; - flex-grow: 1; - margin: 0 1px 0 0; + margin: 0 2px 0 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; } .text { diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index af9f6c188..635aa35b5 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -874,7 +874,7 @@ p { width: 100%; height: 100%; overflow: hidden; - background: #efeff4; + background: #000; } .page { box-sizing: border-box; @@ -6239,6 +6239,31 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after background: url('../../../../common/mobile/resources/img/about/logo.svg') no-repeat center; margin-top: 20px; } +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; +} +.color-schemes-menu .item-content { + padding-left: 0; +} +.color-schemes-menu .item-inner { + justify-content: flex-start; + padding-left: 16px; +} +.color-schemes-menu .color-schema-block { + display: flex; +} +.color-schemes-menu .color { + min-width: 26px; + min-height: 26px; + margin: 0 2px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; +} +.color-schemes-menu .text { + margin-left: 20px; + color: #212121; +} .tablet .searchbar.document.replace .center .searchbar:first-child { margin-right: 10px; } @@ -6830,31 +6855,3 @@ html.pixel-ratio-3 .numbers li { max-height: 100%; overflow: auto; } - -.color-schemes-menu { - cursor: pointer; - display: block; - background-color: #fff; -} -.color-schemes-menu .item-content { - padding-left: 0; -} -.color-schemes-menu .item-inner { - justify-content: flex-start; - padding-left: 16px; -} -.color-schemes-menu .color-schema-block { - min-width: 150px; - display: flex; -} -.color-schemes-menu .color { - min-width: 26px; - min-height: 26px; - flex-grow: 1; - margin: 0 1px 0 0; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; -} -.color-schemes-menu .text { - margin-left: 20px; - color: #212121; -} diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index 50fc7fe4b..6fe7b8da6 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -5836,7 +5836,7 @@ html.phone .document-menu .list-block .item-link { margin-right: 5px; } .about .logo { - background: url('../../../../common/mobile/resources/img/about/onlyoffice.svg') no-repeat center; + background: url('../../../../common/mobile/resources/img/about/logo.svg') no-repeat center; } .color-schemes-menu { cursor: pointer; @@ -5851,14 +5851,12 @@ html.phone .document-menu .list-block .item-link { padding-left: 16px; } .color-schemes-menu .color-schema-block { - min-width: 150px; display: flex; } .color-schemes-menu .color { min-width: 26px; min-height: 26px; - flex-grow: 1; - margin: 0 1px 0 0; + margin: 0 2px 0 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; } .color-schemes-menu .text { diff --git a/apps/documenteditor/mobile/resources/less/app-ios.less b/apps/documenteditor/mobile/resources/less/app-ios.less index 26ec02ce6..4b6a4d160 100644 --- a/apps/documenteditor/mobile/resources/less/app-ios.less +++ b/apps/documenteditor/mobile/resources/less/app-ios.less @@ -40,7 +40,6 @@ @import url('../../../../../vendor/framework7/src/less/ios/notifications.less'); //@import url('../../../../../vendor/framework7/src/less/ios/login-screen.less'); @import url('../../../../../vendor/framework7/src/less/ios/disabled.less'); -@import url('../../../../common/mobile/resources/less/material/_color-schema.less'); // Disable text select * { @@ -72,6 +71,8 @@ input, textarea { @import url('../../../../common/mobile/resources/less/ios/_contextmenu.less'); @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('ios/_search.less'); @import url('ios/_icons.less'); From 7f2342feef38cade5bed92b72d66d7142004f07e Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 16 Apr 2019 20:37:44 +0300 Subject: [PATCH 13/59] [mobile] css color schemes --- .../resources/less/css/_color-schema.css | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 apps/common/mobile/resources/less/css/_color-schema.css diff --git a/apps/common/mobile/resources/less/css/_color-schema.css b/apps/common/mobile/resources/less/css/_color-schema.css new file mode 100644 index 000000000..29d698302 --- /dev/null +++ b/apps/common/mobile/resources/less/css/_color-schema.css @@ -0,0 +1,25 @@ +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; +} +.color-schemes-menu .item-content { + padding-left: 0; +} +.color-schemes-menu .item-inner { + justify-content: flex-start; + padding-left: 16px; +} +.color-schemes-menu .color-schema-block { + display: flex; +} +.color-schemes-menu .color { + min-width: 26px; + min-height: 26px; + margin: 0 2px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; +} +.color-schemes-menu .text { + margin-left: 20px; + color: #212121; +} From 9d9afccc1168a2a62eebd029c607a572fe24f541 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 17 Apr 2019 10:32:32 +0300 Subject: [PATCH 14/59] [pe mobile] added color schemes in presentation settings and spellcheck moved to application settings --- .../mobile/app/controller/Settings.js | 33 ++++++++- .../mobile/app/template/Settings.template | 73 ++++++++++++++----- .../mobile/app/view/Settings.js | 9 ++- apps/presentationeditor/mobile/locale/en.json | 2 + .../mobile/resources/css/app-ios.css | 25 +++++++ .../mobile/resources/css/app-material.css | 25 +++++++ .../mobile/resources/less/app-ios.less | 1 + .../mobile/resources/less/app-material.less | 1 + 8 files changed, 147 insertions(+), 22 deletions(-) diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index 59c3e019c..be74cbd36 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -56,7 +56,8 @@ define([ inProgress, infoObj, modalView, - _licInfo; + _licInfo, + templateInsert; var _slideSizeArr = [ [254, 190.5], [254, 143] @@ -84,6 +85,7 @@ define([ this.api = api; this.api.asc_registerCallback('asc_onPresentationSize', _.bind(this.onApiPageSize, this)); + this.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(this.onSendThemeColorSchemes, this)); }, onLaunch: function () { @@ -158,7 +160,7 @@ define([ $('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me)); $('#settings-spellcheck input:checkbox').single('change', _.bind(me._onSpellcheck, me)); $(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me)); - $('#page-settings-setup-view li').single('click', _.bind(me._onSlideSize, me)); + $('#page-settings-setup-view #slide-size-block li').single('click', _.bind(me._onSlideSize, me)); $('#settings-print').single('click', _.bind(me._onPrint, me)); Common.Utils.addScrollIfNeed('.page[data-page=settings-download-view]', '.page[data-page=settings-download-view] .page-content'); @@ -177,6 +179,33 @@ define([ me.setLicInfo(_licInfo); } else if ('#settings-application-view' == pageId) { me.initPageApplicationSettings(); + } else if ('#color-schemes-view' == pageId) { + me.initPageColorSchemes(); + } + }, + + initPageColorSchemes: function () { + $('#color-schemes-content').html(templateInsert); + $('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this)); + }, + + onSendThemeColorSchemes: function (schemas) { + templateInsert = ""; + _.each(schemas, function (schema, index) { + var colors = schema.get_colors();//schema.colors; + templateInsert = templateInsert + "
    "; + for (var j = 2; j < 7; j++) { + var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b()); + templateInsert = templateInsert + "" + } + templateInsert = templateInsert + "" + schema.get_name() + "
    "; + }, this); + }, + + onColorSchemaClick: function () { + if (this.api) { + var ind = $(event.currentTarget).children('input').val(); + this.api.ChangeColorScheme(ind); } }, diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 6fd7a4afb..30d56a8f0 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -25,22 +25,6 @@ <% } %> -
  • -
    -
    - -
    -
    -
    <%= scope.textSpellcheck %>
    -
    - -
    -
    -
    -
  • @@ -48,7 +32,7 @@
    -
    <%= scope.textPresentSetup %>
    +
    <%= scope.textPresentSettings %>
    @@ -325,12 +309,13 @@
    -
    +
    <%= scope.textSlideSize %>
    +
    + + +
    @@ -404,6 +404,41 @@
  • +
    +
      +
      +
      +
      <%= scope.textSpellcheck %>
      +
      + +
      +
      +
      +
    +
    + + + + + + +
    + +
    +
    +
    +
    + +
    +
    diff --git a/apps/presentationeditor/mobile/app/view/Settings.js b/apps/presentationeditor/mobile/app/view/Settings.js index a5510db8a..16929b4d0 100644 --- a/apps/presentationeditor/mobile/app/view/Settings.js +++ b/apps/presentationeditor/mobile/app/view/Settings.js @@ -161,6 +161,10 @@ define([ } }, + showColorSchemes: function () { + this.showPage('#color-schemes-view'); + }, + showInfo: function () { this.showPage('#settings-info-view'); @@ -191,6 +195,7 @@ define([ showSetup: function () { this.showPage('#settings-setup-view'); + $('#color-schemes').single('click', _.bind(this.showColorSchemes, this)); }, showSetApp: function () { @@ -214,6 +219,7 @@ define([ textDone: 'Done', textEditPresent: 'Edit Presentation', textPresentSetup: 'Presentation Setup', + textPresentSettings: 'Presentation Settings', textDownload: 'Download', textPresentInfo: 'Presentation Info', textHelp: 'Help', @@ -239,7 +245,8 @@ define([ textUnitOfMeasurement: 'Unit of Measurement', textCentimeter: 'Centimeter', textPoint: 'Point', - textInch: 'Inch' + textInch: 'Inch', + textColorSchemes: 'Color Schemes' } })(), PE.Views.Settings || {})) }); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index f9c720d89..b53d3eced 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -470,6 +470,8 @@ "PE.Views.Settings.textCentimeter": "Centimeter", "PE.Views.Settings.textPoint": "Point", "PE.Views.Settings.textInch": "Inch", + "PE.Views.Settings.textPresentSettings": "Presentation Settings", + "PE.Views.Settings.textColorSchemes": "Color Schemes", "PE.Views.Settings.unknownText": "Unknown", "PE.Views.Toolbar.textBack": "Back" } \ 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 db9a40694..b1deee838 100644 --- a/apps/presentationeditor/mobile/resources/css/app-ios.css +++ b/apps/presentationeditor/mobile/resources/css/app-ios.css @@ -6239,6 +6239,31 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after background: url('../../../../common/mobile/resources/img/about/logo.svg') no-repeat center; margin-top: 20px; } +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; +} +.color-schemes-menu .item-content { + padding-left: 0; +} +.color-schemes-menu .item-inner { + justify-content: flex-start; + padding-left: 16px; +} +.color-schemes-menu .color-schema-block { + display: flex; +} +.color-schemes-menu .color { + min-width: 26px; + min-height: 26px; + margin: 0 2px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; +} +.color-schemes-menu .text { + margin-left: 20px; + color: #212121; +} .tablet .searchbar.document.replace .center .searchbar:first-child { margin-right: 10px; } diff --git a/apps/presentationeditor/mobile/resources/css/app-material.css b/apps/presentationeditor/mobile/resources/css/app-material.css index 12ccf7ffe..5944bbcba 100644 --- a/apps/presentationeditor/mobile/resources/css/app-material.css +++ b/apps/presentationeditor/mobile/resources/css/app-material.css @@ -5838,6 +5838,31 @@ html.phone .document-menu .list-block .item-link { .about .logo { background: url('../../../../common/mobile/resources/img/about/logo.svg') no-repeat center; } +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; +} +.color-schemes-menu .item-content { + padding-left: 0; +} +.color-schemes-menu .item-inner { + justify-content: flex-start; + padding-left: 16px; +} +.color-schemes-menu .color-schema-block { + display: flex; +} +.color-schemes-menu .color { + min-width: 26px; + min-height: 26px; + margin: 0 2px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; +} +.color-schemes-menu .text { + margin-left: 20px; + color: #212121; +} .tablet .searchbar.document.replace .center > .replace { display: flex; } diff --git a/apps/presentationeditor/mobile/resources/less/app-ios.less b/apps/presentationeditor/mobile/resources/less/app-ios.less index da419eaa6..f81800cda 100644 --- a/apps/presentationeditor/mobile/resources/less/app-ios.less +++ b/apps/presentationeditor/mobile/resources/less/app-ios.less @@ -71,6 +71,7 @@ input, textarea { @import url('../../../../common/mobile/resources/less/ios/_contextmenu.less'); @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('ios/_search.less'); @import url('ios/_icons.less'); diff --git a/apps/presentationeditor/mobile/resources/less/app-material.less b/apps/presentationeditor/mobile/resources/less/app-material.less index 0a5285306..4b29b3d90 100644 --- a/apps/presentationeditor/mobile/resources/less/app-material.less +++ b/apps/presentationeditor/mobile/resources/less/app-material.less @@ -53,6 +53,7 @@ @import url('../../../../common/mobile/resources/less/material/_contextmenu.less'); @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('material/_search.less'); @import url('material/_icons.less'); From ea65f55d58837df0775e8bbe8540279f33ec6412 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 17 Apr 2019 10:34:01 +0300 Subject: [PATCH 15/59] [se mobile] added color schemes --- .../mobile/app/controller/Settings.js | 31 +++++++++- .../mobile/app/template/Settings.template | 60 +++++++++++++++++++ .../mobile/app/view/Settings.js | 14 ++++- apps/spreadsheeteditor/mobile/locale/en.json | 12 ++-- .../mobile/resources/css/app-ios.css | 25 ++++++++ .../mobile/resources/css/app-material.css | 25 ++++++++ .../mobile/resources/less/app-ios.less | 2 + .../mobile/resources/less/app-material.less | 1 + 8 files changed, 163 insertions(+), 7 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 10a0f72d9..058b99a28 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -52,7 +52,8 @@ define([ inProgress, infoObj, modalView, - _licInfo; + _licInfo, + templateInsert; return { models: [], @@ -78,6 +79,7 @@ define([ setApi: function (api) { var me = this; me.api = api; + me.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(me.onSendThemeColorSchemes, me)); }, onLaunch: function () { @@ -160,6 +162,33 @@ define([ me.setLicInfo(_licInfo); } else if ('#settings-application-view' == pageId) { me.initPageApplicationSettings(); + } else if ('#color-schemes-view' == pageId) { + me.initPageColorSchemes(); + } + }, + + initPageColorSchemes: function() { + $('#color-schemes-content').html(templateInsert); + $('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this)); + }, + + onSendThemeColorSchemes: function (schemas) { + templateInsert = ""; + _.each(schemas, function (schema, index) { + var colors = schema.get_colors();//schema.colors; + templateInsert = templateInsert + "
    "; + for (var j = 2; j < 7; j++) { + var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b()); + templateInsert = templateInsert + "" + } + templateInsert = templateInsert + "" + schema.get_name() + "
    "; + }, this); + }, + + onColorSchemaClick: function(event) { + if (this.api) { + var ind = $(event.currentTarget).children('input').val(); + this.api.asc_ChangeColorScheme(ind); } }, diff --git a/apps/spreadsheeteditor/mobile/app/template/Settings.template b/apps/spreadsheeteditor/mobile/app/template/Settings.template index bc36e9f8e..301c15201 100644 --- a/apps/spreadsheeteditor/mobile/app/template/Settings.template +++ b/apps/spreadsheeteditor/mobile/app/template/Settings.template @@ -49,6 +49,18 @@
    +
  • + +
    +
    + +
    +
    +
    <%= scope.textSpreadsheetSettings %>
    +
    +
    +
    +
  • @@ -394,4 +406,52 @@
    + + +
    + + +
    + + +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index 35de971fe..ee9cf3606 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -80,6 +80,7 @@ define([ $('#settings-help').single('click', _.bind(me.showHelp, me)); $('#settings-about').single('click', _.bind(me.showAbout, me)); $('#settings-application').single('click', _.bind(me.showSetApp, me)); + $('#settings-spreadsheet').single('click', _.bind(me.showSetSpreadsheet, me)); Common.Utils.addScrollIfNeed('.view[data-page=settings-root-view] .pages', '.view[data-page=settings-root-view] .page'); me.initControls(); @@ -167,6 +168,15 @@ define([ this.showPage('#settings-application-view'); }, + showColorSchemes: function () { + this.showPage('#color-schemes-view'); + }, + + showSetSpreadsheet: function () { + this.showPage('#settings-spreadsheet-view'); + $('#color-schemes').single('click', _.bind(this.showColorSchemes, this)); + }, + showDocumentInfo: function() { this.showPage('#settings-info-view'); @@ -235,7 +245,9 @@ define([ textUnitOfMeasurement: 'Unit of Measurement', textCentimeter: 'Centimeter', textPoint: 'Point', - textInch: 'Inch' + textInch: 'Inch', + textSpreadsheetSettings: 'Spreadsheet Settings', + textColorSchemes: 'Color Schemes' } })(), 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 7656c8304..993c4f851 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -512,11 +512,13 @@ "SSE.Views.Settings.textSettings": "Settings", "SSE.Views.Settings.textTel": "tel", "SSE.Views.Settings.textVersion": "Version", - "DE.Views.Settings.textApplicationSettings": "Application Settings", - "DE.Views.Settings.textUnitOfMeasurement": "Unit of Measurement", - "DE.Views.Settings.textCentimeter": "Centimeter", - "DE.Views.Settings.textPoint": "Point", - "DE.Views.Settings.textInch": "Inch", + "SSE.Views.Settings.textApplicationSettings": "Application Settings", + "SSE.Views.Settings.textUnitOfMeasurement": "Unit of Measurement", + "SSE.Views.Settings.textCentimeter": "Centimeter", + "SSE.Views.Settings.textPoint": "Point", + "SSE.Views.Settings.textInch": "Inch", + "SSE.Views.Settings.textColorSchemes": "Color Schemes", + "SSE.Views.Settings.textSpreadsheetSettings": "Spreadsheet Settings", "SSE.Views.Settings.unknownText": "Unknown", "SSE.Views.Toolbar.textBack": "Back" } \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/resources/css/app-ios.css b/apps/spreadsheeteditor/mobile/resources/css/app-ios.css index 26d61f96e..8b212bfe8 100644 --- a/apps/spreadsheeteditor/mobile/resources/css/app-ios.css +++ b/apps/spreadsheeteditor/mobile/resources/css/app-ios.css @@ -6239,6 +6239,31 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after background: url('../../../../common/mobile/resources/img/about/logo.svg') no-repeat center; margin-top: 20px; } +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; +} +.color-schemes-menu .item-content { + padding-left: 0; +} +.color-schemes-menu .item-inner { + justify-content: flex-start; + padding-left: 16px; +} +.color-schemes-menu .color-schema-block { + display: flex; +} +.color-schemes-menu .color { + min-width: 26px; + min-height: 26px; + margin: 0 2px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; +} +.color-schemes-menu .text { + margin-left: 20px; + color: #212121; +} i.icon.icon-search { width: 24px; height: 24px; diff --git a/apps/spreadsheeteditor/mobile/resources/css/app-material.css b/apps/spreadsheeteditor/mobile/resources/css/app-material.css index 6ca2422bd..c62e83d46 100644 --- a/apps/spreadsheeteditor/mobile/resources/css/app-material.css +++ b/apps/spreadsheeteditor/mobile/resources/css/app-material.css @@ -5848,6 +5848,31 @@ html.phone .document-menu .list-block .item-link { .about .logo { background: url('../../../../common/mobile/resources/img/about/logo.svg') no-repeat center; } +.color-schemes-menu { + cursor: pointer; + display: block; + background-color: #fff; +} +.color-schemes-menu .item-content { + padding-left: 0; +} +.color-schemes-menu .item-inner { + justify-content: flex-start; + padding-left: 16px; +} +.color-schemes-menu .color-schema-block { + display: flex; +} +.color-schemes-menu .color { + min-width: 26px; + min-height: 26px; + margin: 0 2px 0 0; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; +} +.color-schemes-menu .text { + margin-left: 20px; + color: #212121; +} .tablet .searchbar.document.replace .center > .replace { display: flex; } diff --git a/apps/spreadsheeteditor/mobile/resources/less/app-ios.less b/apps/spreadsheeteditor/mobile/resources/less/app-ios.less index 82301d8b0..2d43c3aab 100644 --- a/apps/spreadsheeteditor/mobile/resources/less/app-ios.less +++ b/apps/spreadsheeteditor/mobile/resources/less/app-ios.less @@ -73,6 +73,8 @@ input, textarea { @import url('../../../../common/mobile/resources/less/ios/_contextmenu.less'); @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('ios/_icons.less'); @import url('app-common'); diff --git a/apps/spreadsheeteditor/mobile/resources/less/app-material.less b/apps/spreadsheeteditor/mobile/resources/less/app-material.less index 251d35960..33b93927d 100644 --- a/apps/spreadsheeteditor/mobile/resources/less/app-material.less +++ b/apps/spreadsheeteditor/mobile/resources/less/app-material.less @@ -66,6 +66,7 @@ input, textarea { @import url('../../../../common/mobile/resources/less/material/_contextmenu.less'); @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('material/_search.less'); @import url('material/_icons.less'); From cf1c329f49e16232935b0e1ebe6c3e39e235ebc8 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 17 Apr 2019 10:34:50 +0300 Subject: [PATCH 16/59] [de mobile] added translation color schemes --- apps/documenteditor/mobile/locale/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index eb0849b2a..0897b9ea1 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -419,5 +419,6 @@ "DE.Views.Settings.textCentimeter": "Centimeter", "DE.Views.Settings.textPoint": "Point", "DE.Views.Settings.textInch": "Inch", + "DE.Views.Settings.textColorSchemes": "Color Schemes", "DE.Views.Toolbar.textBack": "Back" } \ No newline at end of file From 8db9269761f4501c71c9dafb5f4392e17a94caad Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 17 Apr 2019 12:15:11 +0300 Subject: [PATCH 17/59] [mobile] delete color-schema.css --- .../resources/less/css/_color-schema.css | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 apps/common/mobile/resources/less/css/_color-schema.css diff --git a/apps/common/mobile/resources/less/css/_color-schema.css b/apps/common/mobile/resources/less/css/_color-schema.css deleted file mode 100644 index 29d698302..000000000 --- a/apps/common/mobile/resources/less/css/_color-schema.css +++ /dev/null @@ -1,25 +0,0 @@ -.color-schemes-menu { - cursor: pointer; - display: block; - background-color: #fff; -} -.color-schemes-menu .item-content { - padding-left: 0; -} -.color-schemes-menu .item-inner { - justify-content: flex-start; - padding-left: 16px; -} -.color-schemes-menu .color-schema-block { - display: flex; -} -.color-schemes-menu .color { - min-width: 26px; - min-height: 26px; - margin: 0 2px 0 0; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset; -} -.color-schemes-menu .text { - margin-left: 20px; - color: #212121; -} From a5c48f2f780b9bb66db9493c0b797282e6b398ce Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 17 Apr 2019 13:35:20 +0300 Subject: [PATCH 18/59] [pe mobile] [sse mobile] fix bag moving in pages --- .../presentationeditor/mobile/app/controller/Settings.js | 9 ++++++--- apps/spreadsheeteditor/mobile/app/controller/Settings.js | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index be74cbd36..5bb4b7209 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -140,7 +140,8 @@ define([ } rootView = uiApp.addView('.settings-root-view', { - dynamicNavbar: true + dynamicNavbar: true, + domCache: true }); Common.NotificationCenter.trigger('settingscontainer:show'); @@ -160,12 +161,14 @@ define([ $('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me)); $('#settings-spellcheck input:checkbox').single('change', _.bind(me._onSpellcheck, me)); $(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me)); - $('#page-settings-setup-view #slide-size-block li').single('click', _.bind(me._onSlideSize, me)); + $('#page-settings-view #slide-size-block li').single('click', _.bind(me._onSlideSize, me)); $('#settings-print').single('click', _.bind(me._onPrint, me)); + Common.Utils.addScrollIfNeed('.page[data-page=settings-setup-view]', '.page[data-page=settings-setup-view] .page-content'); Common.Utils.addScrollIfNeed('.page[data-page=settings-download-view]', '.page[data-page=settings-download-view] .page-content'); Common.Utils.addScrollIfNeed('.page[data-page=settings-info-view]', '.page[data-page=settings-info-view] .page-content'); Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content'); + Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content'); me.initSettings(pageId); }, @@ -202,7 +205,7 @@ define([ }, this); }, - onColorSchemaClick: function () { + onColorSchemaClick: function (event) { if (this.api) { var ind = $(event.currentTarget).children('input').val(); this.api.ChangeColorScheme(ind); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 058b99a28..309177f4f 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -134,7 +134,8 @@ define([ } rootView = uiApp.addView('.settings-root-view', { - dynamicNavbar: true + dynamicNavbar: true, + domCache: true }); Common.NotificationCenter.trigger('settingscontainer:show'); @@ -162,8 +163,10 @@ define([ me.setLicInfo(_licInfo); } else if ('#settings-application-view' == pageId) { me.initPageApplicationSettings(); + Common.Utils.addScrollIfNeed('.page[data-page=settings-application-view]', '.page[data-page=settings-application-view] .page-content'); } else if ('#color-schemes-view' == pageId) { me.initPageColorSchemes(); + Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content'); } }, From b2504cdfe6f5394e8e0afe65507f0a4f33ac10fa Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 17 Apr 2019 13:39:15 +0300 Subject: [PATCH 19/59] [pe mobile] corrected template --- .../presentationeditor/mobile/app/template/Settings.template | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 30d56a8f0..7ee92b9a3 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -308,11 +308,12 @@
    -
    +
    <%= scope.textSlideSize %>
    From 1e1261b892274cf7a62254d8a57baee9338e9d2f Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 17 Apr 2019 13:50:50 +0300 Subject: [PATCH 20/59] [pe mobile] [sse mobile] changed the order of settings --- .../mobile/app/template/Settings.template | 24 +++++----- .../mobile/app/template/Settings.template | 48 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 7ee92b9a3..6f5257ab0 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -37,6 +37,18 @@
  • +
  • + +
    +
    + +
    +
    +
    <%= scope.textApplicationSettings %>
    +
    +
    +
    +
  • @@ -61,18 +73,6 @@
  • -
  • - -
    -
    - -
    -
    -
    <%= scope.textApplicationSettings %>
    -
    -
    -
    -
  • <% } %> -
  • - -
    -
    - -
    -
    -
    <%= scope.textDownload %>
    -
    -
    -
    -
  • -
  • - -
    -
    - -
    -
    -
    <%= scope.textPrint %>
    -
    -
    -
    -
  • @@ -73,6 +49,30 @@
  • +
  • + +
    +
    + +
    +
    +
    <%= scope.textDownload %>
    +
    +
    +
    +
  • +
  • + +
    +
    + +
    +
    +
    <%= scope.textPrint %>
    +
    +
    +
    +
  • From 34fe237ef37376244e4c2bf2bbe1dce5c2234515 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 18 Apr 2019 10:54:42 +0300 Subject: [PATCH 21/59] [de mobile] Margins settings placed on a separate page --- .../mobile/app/controller/Settings.js | 42 +++-- .../mobile/app/template/Settings.template | 146 +++++++++++------- 2 files changed, 112 insertions(+), 76 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 44b8717da..b3c477e2a 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -115,7 +115,7 @@ define([ } }); - uiApp.onPageAfterBack('settings-document-view', function (page) { + uiApp.onPageAfterBack('margin-view', function (page) { me.applyPageMarginsIfNeed() }); }, @@ -232,6 +232,9 @@ define([ } else if ('#color-schemes-view' == pageId) { me.initPageColorSchemes(); Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content'); + } else if ('#margins-view' == pageId) { + me.initPageMargin(); + Common.Utils.addScrollIfNeed('.page[data-page=margin-view]', '.page[data-page=margin-view] .page-content'); } else { $('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode')); $('#settings-review input:checkbox').attr('checked', _isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); @@ -244,6 +247,27 @@ define([ } }, + initPageMargin: function() { + var me = this; + + // Init page margins + me.localSectionProps = me.api.asc_GetSectionProps(); + + if (me.localSectionProps) { + me.maxMarginsH = me.localSectionProps.get_H() - 26; + me.maxMarginsW = me.localSectionProps.get_W() - 127; + + $('#document-margin-top .item-after label').text(mm2Cm(me.localSectionProps.get_TopMargin()) + ' ' + txtCm); + $('#document-margin-bottom .item-after label').text(mm2Cm(me.localSectionProps.get_BottomMargin()) + ' ' + txtCm); + $('#document-margin-left .item-after label').text(mm2Cm(me.localSectionProps.get_LeftMargin()) + ' ' + txtCm); + $('#document-margin-right .item-after label').text(mm2Cm(me.localSectionProps.get_RightMargin()) + ' ' + txtCm); + } + + _.each(["top", "left", "bottom", "right"], function(align) { + $(Common.Utils.String.format('#document-margin-{0} .button', align)).single('click', _.bind(me.onPageMarginsChange, me, align)); + }) + }, + initPageColorSchemes: function() { $('#color-schemes-content').html(templateInsert); $('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this)); @@ -292,22 +316,6 @@ define([ $pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']); $pageSize.find('.item-subtitle').text(_pageSizes[_pageSizesIndex]['subtitle']); - // Init page margins - me.localSectionProps = me.api.asc_GetSectionProps(); - - if (me.localSectionProps) { - me.maxMarginsH = me.localSectionProps.get_H() - 26; - me.maxMarginsW = me.localSectionProps.get_W() - 127; - - $('#document-margin-top .item-after label').text(mm2Cm(me.localSectionProps.get_TopMargin()) + ' ' + txtCm); - $('#document-margin-bottom .item-after label').text(mm2Cm(me.localSectionProps.get_BottomMargin()) + ' ' + txtCm); - $('#document-margin-left .item-after label').text(mm2Cm(me.localSectionProps.get_LeftMargin()) + ' ' + txtCm); - $('#document-margin-right .item-after label').text(mm2Cm(me.localSectionProps.get_RightMargin()) + ' ' + txtCm); - } - - _.each(["top", "left", "bottom", "right"], function(align) { - $(Common.Utils.String.format('#document-margin-{0} .button', align)).single('click', _.bind(me.onPageMarginsChange, me, align)); - }) }, initPageInfo: function () { diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 4c6420d8d..454a852b4 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -235,70 +235,18 @@
  • -
    <%= scope.textMargins %>
    -
    +
    +
      @@ -695,4 +643,84 @@
    + + + +
    + +
    +
    +
    +
    +
      +
    • +
      +
      +
      <%= scope.textTop %>
      +
      + <% if (!android) { %><% } %> +

      + <% if (android) { %><% } else { %>-<% } %> + <% if (android) { %><% } %> + <% if (android) { %><% } else { %>+<% } %> +

      +
      +
      +
      +
    • +
    • +
      +
      +
      <%= scope.textBottom %>
      +
      + <% if (!android) { %><% } %> +

      + <% if (android) { %><% } else { %>-<% } %> + <% if (android) { %><% } %> + <% if (android) { %><% } else { %>+<% } %> +

      +
      +
      +
      +
    • +
    • +
      +
      +
      <%= scope.textLeft %>
      +
      + <% if (!android) { %><% } %> +

      + <% if (android) { %><% } else { %>-<% } %> + <% if (android) { %><% } %> + <% if (android) { %><% } else { %>+<% } %> +

      +
      +
      +
      +
    • +
    • +
      +
      +
      <%= scope.textRight %>
      +
      + <% if (!android) { %><% } %> +

      + <% if (android) { %><% } else { %>-<% } %> + <% if (android) { %><% } %> + <% if (android) { %><% } else { %>+<% } %> +

      +
      +
      +
      +
    • +
    +
    +
    +
    +
    \ No newline at end of file From 445f317868333895464453a2a3e9947f3fc4609d Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 18 Apr 2019 16:49:37 +0300 Subject: [PATCH 22/59] [de mobile] Edit template in the format settings --- apps/documenteditor/mobile/app/template/Settings.template | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 454a852b4..fe2bad291 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -233,10 +233,6 @@ - - -
    -
    ', '', '' From 465273ad49bde5fbaac6d3f8225851069bd471f7 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 25 Apr 2019 16:05:44 +0300 Subject: [PATCH 32/59] [SSE mobile] Add current units in page size settings --- apps/spreadsheeteditor/mobile/app/controller/Settings.js | 7 ++++++- apps/spreadsheeteditor/mobile/app/view/Settings.js | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 54a9bdd61..7112015ea 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -237,7 +237,12 @@ define([ var $pageSize = $('#settings-spreadsheet-format'); this.changeCurrentPageSize(opt.asc_getWidth(), opt.asc_getHeight()); $pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']); - $pageSize.find('.item-subtitle').text(_pageSizes[_pageSizesIndex]['subtitle']); + var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()), + sizeW = Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2), + sizeH = Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2); + + var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName; + $pageSize.find('.item-subtitle').text(pageSizeTxt); }, changeCurrentPageSize: function(w, h) { diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index 8ed7ca186..2c0087add 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -244,8 +244,7 @@ define([ '
    ', '
    <%= item.caption %>
    ', '
    ', - // '
    <%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[0]).toFixed(2)) %><%= Common.Utils.Metric.getCurrentMetricName() %> x <%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[1]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %>
    ', - '
    <%= item.subtitle %>
    ', + '
    <%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[0]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %> x <%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(item.value[1]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %>
    ', '', '', '' From 42481b7db9cc252833a8f2b9e3b92e1a0e17c688 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Sat, 27 Apr 2019 16:43:10 +0300 Subject: [PATCH 33/59] [SSE mobile] Add current units in margins --- .../mobile/app/controller/Settings.js | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 7112015ea..d8d9caafb 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -75,7 +75,8 @@ define([ { caption: 'A1', subtitle: Common.Utils.String.format('59,4{0} x 84,1{0}', txtCm), value: [594, 841] }, { caption: 'A2', subtitle: Common.Utils.String.format('42{0} x 59,4{0}', txtCm), value: [420, 594] }, { caption: 'A6', subtitle: Common.Utils.String.format('10,5{0} x 14,8{0}', txtCm), value: [105, 148] } - ]; + ], + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()) var mm2Cm = function(mm) { return parseFloat((mm/10.).toFixed(2)); @@ -237,9 +238,14 @@ define([ var $pageSize = $('#settings-spreadsheet-format'); this.changeCurrentPageSize(opt.asc_getWidth(), opt.asc_getHeight()); $pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']); + + var valueUnit = Common.localStorage.getItem('se-mobile-settings-unit'); + valueUnit = (valueUnit!==null) ? parseInt(valueUnit) : Common.Utils.Metric.getDefaultMetric(); + Common.Utils.Metric.setCurrentMetric(valueUnit); + var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()), - sizeW = Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2), - sizeH = Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2); + sizeW = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)), + sizeH = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2)); var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName; $pageSize.find('.item-subtitle').text(pageSizeTxt); @@ -278,17 +284,19 @@ define([ props = me.api.asc_getPageOptions(currentSheet); me.localMarginProps = props.asc_getPageMargins(); - var left = me.localMarginProps.asc_getLeft(), - top = me.localMarginProps.asc_getTop(), - right = me.localMarginProps.asc_getRight(), - bottom = me.localMarginProps.asc_getBottom(); + _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); + + var left = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getLeft())).toFixed(2)), + top = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getTop())).toFixed(2)), + right = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getRight())).toFixed(2)), + bottom = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getBottom())).toFixed(2)); if (me.localMarginProps) { - $('#spreadsheet-margin-top .item-after label').text(mm2Cm(top) + ' ' + txtCm); - $('#spreadsheet-margin-bottom .item-after label').text(mm2Cm(bottom) + ' ' + txtCm); - $('#spreadsheet-margin-left .item-after label').text(mm2Cm(left) + ' ' + txtCm); - $('#spreadsheet-margin-right .item-after label').text(mm2Cm(right) + ' ' + txtCm); + $('#spreadsheet-margin-top .item-after label').text(top + ' ' + _metricText); + $('#spreadsheet-margin-bottom .item-after label').text(bottom + ' ' + _metricText); + $('#spreadsheet-margin-left .item-after label').text(left + ' ' + _metricText); + $('#spreadsheet-margin-right .item-after label').text(right + ' ' + _metricText); } _.each(["top", "left", "bottom", "right"], function(align) { @@ -303,8 +311,15 @@ define([ txtCm = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.cm), marginValue = null; - var maxMarginsH = 48.25, - maxMarginsW = 48.25; + var maxMarginsH = 482.5, + maxMarginsW = 482.5; + + if(Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits.pt) { + step = 1; + } else { + step = 0.1; + } + step = Common.Utils.Metric.fnRecalcToMM(step); switch (align) { case 'left': marginValue = me.localMarginProps.asc_getLeft(); break; @@ -332,7 +347,7 @@ define([ case 'bottom': changeProps.asc_setBottom(marginValue); break; } - $(Common.Utils.String.format('#document-margin-{0} .item-after label', align)).text(mm2Cm(marginValue) + ' ' + txtCm); + $(Common.Utils.String.format('#document-margin-{0} .item-after label', align)).text(parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue)).toFixed(2) + ' ' + _metricText); me.api.asc_changePageMargins(changeProps.asc_getLeft(), changeProps.asc_getRight(), changeProps.asc_getTop(), changeProps.asc_getBottom(), me.api.asc_getActiveWorksheetIndex()); me.initSpreadsheetMargins(); From 9c4725cfd362a7730a11fadd7a06db7b5434f433 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Sat, 27 Apr 2019 17:04:02 +0300 Subject: [PATCH 34/59] [DE mobile] Remove all trailing zeroes in the decimal part in format and paragraph settings --- .../mobile/app/controller/Settings.js | 14 +++++++------- .../mobile/app/controller/edit/EditParagraph.js | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 5513d6934..73d7246e1 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -259,10 +259,10 @@ define([ me.maxMarginsH = me.localSectionProps.get_H() - 26; me.maxMarginsW = me.localSectionProps.get_W() - 127; - var top = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_TopMargin())).toFixed(2), - bottom = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_BottomMargin())).toFixed(2), - left = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_LeftMargin())).toFixed(2), - right = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_RightMargin())).toFixed(2); + var top = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_TopMargin())).toFixed(2)), + bottom = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_BottomMargin())).toFixed(2)), + left = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_LeftMargin())).toFixed(2)), + right = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_RightMargin())).toFixed(2)); $('#document-margin-top .item-after label').text(top + ' ' + _metricText); $('#document-margin-bottom .item-after label').text(bottom + ' ' + _metricText); @@ -321,8 +321,8 @@ define([ // Init format $pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']); var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()), - sizeW = Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2), - sizeH = Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2); + sizeW = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)), + sizeH = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2)); var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName; $pageSize.find('.item-subtitle').text(pageSizeTxt); @@ -564,7 +564,7 @@ define([ case 'bottom': me.localSectionProps.put_BottomMargin(marginValue); break; } - var valueCurrentMetric = parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue)).toFixed(2); + var valueCurrentMetric = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue)).toFixed(2)); $(Common.Utils.String.format('#document-margin-{0} .item-after label', align)).text(valueCurrentMetric + ' ' + _metricText); me.applyPageMarginsIfNeed() diff --git a/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js b/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js index ee32015e1..e66e691ef 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js @@ -144,15 +144,15 @@ define([ if (_paragraphProperty.get_Ind()===null || _paragraphProperty.get_Ind()===undefined) { _paragraphProperty.get_Ind().put_FirstLine(0); } - var firstLineFix = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_paragraphProperty.get_Ind().get_FirstLine())).toFixed(2); + var firstLineFix = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(_paragraphProperty.get_Ind().get_FirstLine())).toFixed(2)); $('#paragraph-spin-first-line .item-after label').text(firstLineFix + ' ' + metricText); } if (_paragraphObject) { _paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before()); _paragraphInfo.spaceAfter = _paragraphObject.get_Spacing().get_After() < 0 ? _paragraphObject.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_After()); - var distanceBeforeFix = parseFloat(_paragraphInfo.spaceBefore).toFixed(2); - var distanceAfterFix = parseFloat(_paragraphInfo.spaceAfter).toFixed(2); + var distanceBeforeFix = +(parseFloat(_paragraphInfo.spaceBefore).toFixed(2)); + var distanceAfterFix = +(parseFloat(_paragraphInfo.spaceAfter).toFixed(2)); $('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : distanceBeforeFix + ' ' + metricText); $('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : distanceAfterFix + ' ' + metricText); @@ -253,7 +253,7 @@ define([ distance = Math.min(maxValue, distance + step); } - var distanceFix = distance.toFixed(2); + var distanceFix = +(distance.toFixed(2)); _paragraphInfo.spaceBefore = distance; @@ -282,7 +282,7 @@ define([ distance = Math.min(maxValue, distance + step); } - var distanceFix = distance.toFixed(2); + var distanceFix = +(distance.toFixed(2)); _paragraphInfo.spaceAfter = distance; @@ -314,7 +314,7 @@ define([ distance = Math.min(maxValue, distance + step); } - var distanceFix = distance.toFixed(2); + var distanceFix = +(distance.toFixed(2)); $('#paragraph-spin-first-line .item-after label').text(distanceFix + ' ' + metricText); From 3bd69c7d113691c88593bb3c3eb9239cc064cc6a Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Sat, 27 Apr 2019 18:29:27 +0300 Subject: [PATCH 35/59] [DE mobile] Add merge cells in table options --- .../mobile/app/controller/edit/EditTable.js | 7 +++++++ .../mobile/app/template/EditTable.template | 11 +++++++++++ apps/documenteditor/mobile/app/view/edit/EditTable.js | 3 ++- apps/documenteditor/mobile/locale/en.json | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/app/controller/edit/EditTable.js b/apps/documenteditor/mobile/app/controller/edit/EditTable.js index 5c5c5ba25..d0a10e4aa 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditTable.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditTable.js @@ -236,6 +236,7 @@ define([ $('#table-options-margins input').val(distance); $('#table-options-margins .item-after').text(distance + ' ' + _metricText); } + $('#table-merge-cells').single('click', _.bind(this.onMergeCellClick, this)); }, _initWrappView: function() { @@ -614,6 +615,12 @@ define([ me.api.tblApply(properties); }, + onMergeCellClick: function () { + if (this.api) { + this.api.MergeCells(); + } + }, + onBorderSize: function (e) { var $target = $(e.currentTarget), value = $target.val(); diff --git a/apps/documenteditor/mobile/app/template/EditTable.template b/apps/documenteditor/mobile/app/template/EditTable.template index 7347774d9..e24b1cdc2 100644 --- a/apps/documenteditor/mobile/app/template/EditTable.template +++ b/apps/documenteditor/mobile/app/template/EditTable.template @@ -220,6 +220,17 @@ + diff --git a/apps/documenteditor/mobile/app/view/edit/EditTable.js b/apps/documenteditor/mobile/app/view/edit/EditTable.js index 279ddd11d..e9ae443b6 100644 --- a/apps/documenteditor/mobile/app/view/edit/EditTable.js +++ b/apps/documenteditor/mobile/app/view/edit/EditTable.js @@ -242,7 +242,8 @@ define([ textBandedRow: 'Banded Row', textFirstColumn: 'First Column', textLastColumn: 'Last Column', - textBandedColumn: 'Banded Column' + textBandedColumn: 'Banded Column', + textMergeCells: 'Merge Cells' } })(), DE.Views.EditTable || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 0897b9ea1..0bda8afed 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -338,6 +338,7 @@ "DE.Views.EditTable.textTotalRow": "Total Row", "DE.Views.EditTable.textWithText": "Move with Text", "DE.Views.EditTable.textWrap": "Wrap", + "DE.Views.EditTable.textMergeCells": "Merge Cells", "DE.Views.EditText.textAdditional": "Additional", "DE.Views.EditText.textAdditionalFormat": "Additional Formatting", "DE.Views.EditText.textAllCaps": "All Caps", From 46409ac45d7a2a841fa7dd3bf5c4f40ae50a17b9 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Mon, 29 Apr 2019 17:01:35 +0300 Subject: [PATCH 36/59] [DE mobile] Merge Cells moved to context menu --- .../mobile/app/controller/DocumentHolder.js | 12 +++++++++++- .../mobile/app/controller/edit/EditTable.js | 6 ------ .../mobile/app/template/EditTable.template | 11 ----------- .../documenteditor/mobile/app/view/edit/EditTable.js | 3 +-- apps/documenteditor/mobile/locale/en.json | 2 +- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index 0e9841f63..9cf53f5d3 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -123,6 +123,8 @@ define([ me.api.Copy(); } else if ('paste' == eventName) { me.api.Paste(); + } else if ('merge' == eventName) { + me.api.MergeCells(); } else if ('delete' == eventName) { me.api.asc_Remove(); } else if ('edit' == eventName) { @@ -399,6 +401,13 @@ define([ event: 'paste' }); + if(isTable && me.api.CheckBeforeMergeCells()) { + menuItems.push({ + caption: me.menuMerge, + event: 'merge' + }); + } + menuItems.push({ caption: me.menuDelete, event: 'delete' @@ -490,7 +499,8 @@ define([ menuAccept: 'Accept', menuAcceptAll: 'Accept All', menuReject: 'Reject', - menuRejectAll: 'Reject All' + menuRejectAll: 'Reject All', + menuMerge: 'Merge Cells' } })(), DE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/controller/edit/EditTable.js b/apps/documenteditor/mobile/app/controller/edit/EditTable.js index d0a10e4aa..48737cd56 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditTable.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditTable.js @@ -236,7 +236,6 @@ define([ $('#table-options-margins input').val(distance); $('#table-options-margins .item-after').text(distance + ' ' + _metricText); } - $('#table-merge-cells').single('click', _.bind(this.onMergeCellClick, this)); }, _initWrappView: function() { @@ -615,11 +614,6 @@ define([ me.api.tblApply(properties); }, - onMergeCellClick: function () { - if (this.api) { - this.api.MergeCells(); - } - }, onBorderSize: function (e) { var $target = $(e.currentTarget), diff --git a/apps/documenteditor/mobile/app/template/EditTable.template b/apps/documenteditor/mobile/app/template/EditTable.template index e24b1cdc2..7347774d9 100644 --- a/apps/documenteditor/mobile/app/template/EditTable.template +++ b/apps/documenteditor/mobile/app/template/EditTable.template @@ -220,17 +220,6 @@ - diff --git a/apps/documenteditor/mobile/app/view/edit/EditTable.js b/apps/documenteditor/mobile/app/view/edit/EditTable.js index e9ae443b6..279ddd11d 100644 --- a/apps/documenteditor/mobile/app/view/edit/EditTable.js +++ b/apps/documenteditor/mobile/app/view/edit/EditTable.js @@ -242,8 +242,7 @@ define([ textBandedRow: 'Banded Row', textFirstColumn: 'First Column', textLastColumn: 'Last Column', - textBandedColumn: 'Banded Column', - textMergeCells: 'Merge Cells' + textBandedColumn: 'Banded Column' } })(), DE.Views.EditTable || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 0bda8afed..8167ca51d 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -29,6 +29,7 @@ "DE.Controllers.DocumentHolder.menuReview": "Review", "DE.Controllers.DocumentHolder.sheetCancel": "Cancel", "DE.Controllers.DocumentHolder.textGuest": "Guest", + "DE.Controllers.DocumentHolder.menuMerge": "Merge Cells", "DE.Controllers.EditContainer.textChart": "Chart", "DE.Controllers.EditContainer.textFooter": "Footer", "DE.Controllers.EditContainer.textHeader": "Header", @@ -338,7 +339,6 @@ "DE.Views.EditTable.textTotalRow": "Total Row", "DE.Views.EditTable.textWithText": "Move with Text", "DE.Views.EditTable.textWrap": "Wrap", - "DE.Views.EditTable.textMergeCells": "Merge Cells", "DE.Views.EditText.textAdditional": "Additional", "DE.Views.EditText.textAdditionalFormat": "Additional Formatting", "DE.Views.EditText.textAllCaps": "All Caps", From 9450c4ac67c7398c2ab3ddec5555e2ba10f047f6 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Mon, 29 Apr 2019 18:17:50 +0300 Subject: [PATCH 37/59] [DE mobile] [SSE mobile] Refactoring commits --- .../mobile/app/controller/Settings.js | 14 +++++------ .../app/controller/edit/EditParagraph.js | 12 +++++----- .../mobile/app/controller/Settings.js | 23 +++++++------------ 3 files changed, 21 insertions(+), 28 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 73d7246e1..38111f728 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -259,10 +259,10 @@ define([ me.maxMarginsH = me.localSectionProps.get_H() - 26; me.maxMarginsW = me.localSectionProps.get_W() - 127; - var top = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_TopMargin())).toFixed(2)), - bottom = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_BottomMargin())).toFixed(2)), - left = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_LeftMargin())).toFixed(2)), - right = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_RightMargin())).toFixed(2)); + var top = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_TopMargin()).toFixed(2)), + bottom = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_BottomMargin()).toFixed(2)), + left = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_LeftMargin()).toFixed(2)), + right = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localSectionProps.get_RightMargin()).toFixed(2)); $('#document-margin-top .item-after label').text(top + ' ' + _metricText); $('#document-margin-bottom .item-after label').text(bottom + ' ' + _metricText); @@ -321,8 +321,8 @@ define([ // Init format $pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']); var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()), - sizeW = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)), - sizeH = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2)); + sizeW = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)), + sizeH = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2)); var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName; $pageSize.find('.item-subtitle').text(pageSizeTxt); @@ -564,7 +564,7 @@ define([ case 'bottom': me.localSectionProps.put_BottomMargin(marginValue); break; } - var valueCurrentMetric = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue)).toFixed(2)); + var valueCurrentMetric = parseFloat(Common.Utils.Metric.fnRecalcFromMM(marginValue).toFixed(2)); $(Common.Utils.String.format('#document-margin-{0} .item-after label', align)).text(valueCurrentMetric + ' ' + _metricText); me.applyPageMarginsIfNeed() diff --git a/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js b/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js index e66e691ef..23545050b 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditParagraph.js @@ -144,15 +144,15 @@ define([ if (_paragraphProperty.get_Ind()===null || _paragraphProperty.get_Ind()===undefined) { _paragraphProperty.get_Ind().put_FirstLine(0); } - var firstLineFix = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(_paragraphProperty.get_Ind().get_FirstLine())).toFixed(2)); + var firstLineFix = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_paragraphProperty.get_Ind().get_FirstLine()).toFixed(2)); $('#paragraph-spin-first-line .item-after label').text(firstLineFix + ' ' + metricText); } if (_paragraphObject) { _paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before()); _paragraphInfo.spaceAfter = _paragraphObject.get_Spacing().get_After() < 0 ? _paragraphObject.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_After()); - var distanceBeforeFix = +(parseFloat(_paragraphInfo.spaceBefore).toFixed(2)); - var distanceAfterFix = +(parseFloat(_paragraphInfo.spaceAfter).toFixed(2)); + var distanceBeforeFix = parseFloat(_paragraphInfo.spaceBefore.toFixed(2)); + var distanceAfterFix = parseFloat(_paragraphInfo.spaceAfter.toFixed(2)); $('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : distanceBeforeFix + ' ' + metricText); $('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : distanceAfterFix + ' ' + metricText); @@ -253,7 +253,7 @@ define([ distance = Math.min(maxValue, distance + step); } - var distanceFix = +(distance.toFixed(2)); + var distanceFix = parseFloat(distance.toFixed(2)); _paragraphInfo.spaceBefore = distance; @@ -282,7 +282,7 @@ define([ distance = Math.min(maxValue, distance + step); } - var distanceFix = +(distance.toFixed(2)); + var distanceFix = parseFloat(distance.toFixed(2)); _paragraphInfo.spaceAfter = distance; @@ -314,7 +314,7 @@ define([ distance = Math.min(maxValue, distance + step); } - var distanceFix = +(distance.toFixed(2)); + var distanceFix = parseFloat(distance.toFixed(2)); $('#paragraph-spin-first-line .item-after label').text(distanceFix + ' ' + metricText); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index d8d9caafb..3fafbad3c 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -111,8 +111,6 @@ define([ setApi: function (api) { this.api = api; this.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(this.onSendThemeColorSchemes, this)); - this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.sheetChanged, this)); - this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', _.bind(this.sheetChanged, this)); }, onLaunch: function () { @@ -219,7 +217,7 @@ define([ $switchHideHeadings.single('change', _.bind(me.clickCheckboxHideHeadings, me)); $switchHideGridlines.single('change', _.bind(me.clickCheckboxHideGridlines, me)); - var params = me.sheetChanged(); + var params = me.api.asc_getSheetViewSettings(); $switchHideHeadings.prop('checked',!params.asc_getShowRowColHeaders()); $switchHideGridlines.prop('checked',!params.asc_getShowGridLines()); @@ -227,7 +225,7 @@ define([ var currentSheet = this.api.asc_getActiveWorksheetIndex(), props = this.api.asc_getPageOptions(currentSheet), opt = props.asc_getPageSetup(); - if(Number(opt.asc_getOrientation()) === 0) { + if(opt.asc_getOrientation() === Asc.c_oAscPageOrientation.PagePortrait) { $('.page[data-page=settings-spreadsheet-view] input:radio[name=table-orientation][value="0"]').prop( "checked", true ); } else { $('.page[data-page=settings-spreadsheet-view] input:radio[name=table-orientation][value="1"]').prop( "checked", true ); @@ -244,8 +242,8 @@ define([ Common.Utils.Metric.setCurrentMetric(valueUnit); var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()), - sizeW = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)), - sizeH = +(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2)); + sizeW = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)), + sizeH = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2)); var pageSizeTxt = sizeW + ' ' + curMetricName + ' x ' + sizeH + ' ' + curMetricName; $pageSize.find('.item-subtitle').text(pageSizeTxt); @@ -286,10 +284,10 @@ define([ _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); - var left = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getLeft())).toFixed(2)), - top = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getTop())).toFixed(2)), - right = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getRight())).toFixed(2)), - bottom = +(parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getBottom())).toFixed(2)); + var left = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getLeft()).toFixed(2)), + top = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getTop()).toFixed(2)), + right = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getRight()).toFixed(2)), + bottom = parseFloat(Common.Utils.Metric.fnRecalcFromMM(me.localMarginProps.asc_getBottom()).toFixed(2)); if (me.localMarginProps) { @@ -371,11 +369,6 @@ define([ this.api.asc_setDisplayGridlines(!checked); }, - sheetChanged: function() { - var params = this.api.asc_getSheetViewSettings(); - return(params); - }, - initPageColorSchemes: function() { $('#color-schemes-content').html(templateInsert); $('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this)); From cb61b0a26d927d6312f9c67c7dd21f2450e7e578 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Mon, 6 May 2019 12:09:27 +0300 Subject: [PATCH 38/59] [DE mobile] Add Split Cell in context table menu --- .../mobile/app/controller/DocumentHolder.js | 65 ++++++++++++++++++- apps/documenteditor/mobile/locale/en.json | 4 ++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index 9cf53f5d3..e7b301029 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -125,6 +125,9 @@ define([ me.api.Paste(); } else if ('merge' == eventName) { me.api.MergeCells(); + } else if ('split' == eventName) { + _view.hideMenu(); + me.showSplitModal(); } else if ('delete' == eventName) { me.api.asc_Remove(); } else if ('edit' == eventName) { @@ -184,6 +187,55 @@ define([ _view.hideMenu(); }, + showSplitModal: function() { + var me = this, + picker; + uiApp.modal({ + title : me.menuSplit, + text: '', + afterText: + '
    ' + + '
    ' + + '
    ' + me.textColumns + '
    ' + + '
    ' + me.textRows + '
    ' + + '
    ' + + '
    ' + + '
    ', + buttons: [ + { + text: me.textCancel + }, + { + text: 'OK', + bold: true, + onClick: function () { + var size = picker.value; + if (me.api) { + me.api.SplitCell(parseInt(size[0]), parseInt(size[1])); + } + } + } + ] + }); + + picker = uiApp.picker({ + container: '#picker-split-size', + toolbar: false, + rotateEffect: true, + value: [3, 3], + cols: [{ + textAlign: 'center', + width: '100%', + values: [1,2,3,4,5,6,7,8,9,10] + }, { + textAlign: 'center', + width: '100%', + values: [1,2,3,4,5,6,7,8,9,10] + }] + }); + + }, + // API Handlers onEditorResize: function(cmp) { @@ -408,6 +460,13 @@ define([ }); } + if(isTable && me.api.CheckBeforeSplitCells()) { + menuItems.push({ + caption: me.menuSplit, + event: 'split' + }); + } + menuItems.push({ caption: me.menuDelete, event: 'delete' @@ -486,6 +545,9 @@ define([ }, textGuest: 'Guest', + textCancel: 'Cancel', + textColumns: 'Columns', + textRows: 'Rows', menuCut: 'Cut', menuCopy: 'Copy', menuPaste: 'Paste', @@ -500,7 +562,8 @@ define([ menuAcceptAll: 'Accept All', menuReject: 'Reject', menuRejectAll: 'Reject All', - menuMerge: 'Merge Cells' + menuMerge: 'Merge Cells', + menuSplit: 'Split Cell' } })(), DE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 8167ca51d..0713487ed 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -30,6 +30,10 @@ "DE.Controllers.DocumentHolder.sheetCancel": "Cancel", "DE.Controllers.DocumentHolder.textGuest": "Guest", "DE.Controllers.DocumentHolder.menuMerge": "Merge Cells", + "DE.Controllers.DocumentHolder.menuSplit": "Split Cell", + "DE.Controllers.DocumentHolder.textCancel": "Cancel", + "DE.Controllers.DocumentHolder.textColumns": "Columns", + "DE.Controllers.DocumentHolder.textRows": "Rows", "DE.Controllers.EditContainer.textChart": "Chart", "DE.Controllers.EditContainer.textFooter": "Footer", "DE.Controllers.EditContainer.textHeader": "Header", From c5a9f9809ab293b9ee5ceab608c98c4cd8b80c90 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Mon, 6 May 2019 16:20:02 +0300 Subject: [PATCH 39/59] [DE mobile] Add Nonprinting Characters in application settings --- .../documenteditor/mobile/app/controller/Main.js | 3 +++ .../mobile/app/controller/Settings.js | 10 ++++++++++ .../mobile/app/template/Settings.template | 16 ++++++++++++++++ apps/documenteditor/mobile/app/view/Settings.js | 3 ++- apps/documenteditor/mobile/locale/en.json | 1 + 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 6c57bc018..89ca6022f 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -536,6 +536,9 @@ define([ me.api.SetTextBoxInputMode(Common.localStorage.getBool("de-settings-inputmode")); + value = Common.localStorage.getItem("de-mobile-no-characters"); + me.api.put_ShowParaMarks((value!==null) ? eval(value) : false); + /** coauthoring begin **/ if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { // Force ON fast co-authoring mode diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 38111f728..70a1262d6 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -228,6 +228,8 @@ define([ me.initPageAdvancedSettings(); $('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false)); $('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me)); + $('#settings-no-characters input:checkbox').attr('checked', (Common.localStorage.getItem("de-mobile-no-characters") == 'true') ? true : false); + $('#settings-no-characters input:checkbox').single('change', _.bind(me.onNoCharacters, me)); $('#settings-orthography').single('click', _.bind(me.onOrthographyCheck, me)); Common.Utils.addScrollIfNeed('.page[data-page=settings-advanced-view]', '.page[data-page=settings-advanced-view] .page-content'); } else if ('#color-schemes-view' == pageId) { @@ -248,6 +250,14 @@ define([ } }, + onNoCharacters: function(e) { + var me = this; + var $checkbox = $(e.currentTarget), + state = $checkbox.is(':checked'); + Common.localStorage.setItem("de-mobile-no-characters", state); + me.api.put_ShowParaMarks(state); + }, + initPageMargin: function() { var me = this; _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index fe2bad291..082958a96 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -616,6 +616,22 @@ +
    +
      +
      +
      +
      <%= scope.textNoCharacters %>
      +
      + +
      +
      +
      +
    +
    + diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 0c534e27e..b1ad49d0f 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -284,7 +284,8 @@ define([ textCentimeter: 'Centimeter', textPoint: 'Point', textInch: 'Inch', - textColorSchemes: 'Color Schemes' + textColorSchemes: 'Color Schemes', + textNoCharacters: 'Nonprinting Characters' } })(), DE.Views.Settings || {})) diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 0713487ed..17d6b0f34 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -425,5 +425,6 @@ "DE.Views.Settings.textPoint": "Point", "DE.Views.Settings.textInch": "Inch", "DE.Views.Settings.textColorSchemes": "Color Schemes", + "DE.Views.Settings.textNoCharacters": "Nonprinting Characters", "DE.Views.Toolbar.textBack": "Back" } \ No newline at end of file From d014d961987f998a528228fe5e6d9b84cb99a6c2 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Mon, 6 May 2019 16:52:03 +0300 Subject: [PATCH 40/59] [DE mobile] Add Hidden Table Borders in application settings --- apps/documenteditor/mobile/app/controller/Main.js | 3 +++ apps/documenteditor/mobile/app/controller/Settings.js | 10 ++++++++++ .../mobile/app/template/Settings.template | 11 +++++++++++ apps/documenteditor/mobile/app/view/Settings.js | 3 ++- apps/documenteditor/mobile/locale/en.json | 1 + 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 89ca6022f..3d6e653db 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -539,6 +539,9 @@ define([ value = Common.localStorage.getItem("de-mobile-no-characters"); me.api.put_ShowParaMarks((value!==null) ? eval(value) : false); + value = Common.localStorage.getItem("de-mobile-hidden-borders"); + me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true) + /** coauthoring begin **/ if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { // Force ON fast co-authoring mode diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 70a1262d6..d135ce7f2 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -230,6 +230,8 @@ define([ $('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me)); $('#settings-no-characters input:checkbox').attr('checked', (Common.localStorage.getItem("de-mobile-no-characters") == 'true') ? true : false); $('#settings-no-characters input:checkbox').single('change', _.bind(me.onNoCharacters, me)); + $('#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)); Common.Utils.addScrollIfNeed('.page[data-page=settings-advanced-view]', '.page[data-page=settings-advanced-view] .page-content'); } else if ('#color-schemes-view' == pageId) { @@ -258,6 +260,14 @@ define([ me.api.put_ShowParaMarks(state); }, + onShowTableEmptyLine: function(e) { + var me = this, + $checkbox = $(e.currentTarget), + state = $checkbox.is(':checked'); + Common.localStorage.setItem("de-mobile-hidden-borders", state); + me.api.put_ShowTableEmptyLine(state); + }, + initPageMargin: function() { var me = this; _metricText = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()); diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 082958a96..7da79a08a 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -629,6 +629,17 @@ +
    +
    +
    <%= scope.textHiddenTableBorders %>
    +
    + +
    +
    +
    diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index b1ad49d0f..b49d816bc 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -285,7 +285,8 @@ define([ textPoint: 'Point', textInch: 'Inch', textColorSchemes: 'Color Schemes', - textNoCharacters: 'Nonprinting Characters' + textNoCharacters: 'Nonprinting Characters', + textHiddenTableBorders: 'Hidden Table Borders' } })(), DE.Views.Settings || {})) diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 17d6b0f34..e7958d7cd 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -426,5 +426,6 @@ "DE.Views.Settings.textInch": "Inch", "DE.Views.Settings.textColorSchemes": "Color Schemes", "DE.Views.Settings.textNoCharacters": "Nonprinting Characters", + "DE.Views.Settings.textHiddenTableBorders": "Hidden Table Borders", "DE.Views.Toolbar.textBack": "Back" } \ No newline at end of file From 110dec35defa708e47289a4cde6219ee13a17570 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 7 May 2019 17:48:22 +0300 Subject: [PATCH 41/59] [DE mobile] fixed syntax error --- apps/documenteditor/mobile/app/controller/Main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 3d6e653db..13bdf651d 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -540,7 +540,7 @@ define([ me.api.put_ShowParaMarks((value!==null) ? eval(value) : false); value = Common.localStorage.getItem("de-mobile-hidden-borders"); - me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true) + me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true); /** coauthoring begin **/ if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { From 9f3773cc599644f19c60e970532b9b043c7944a9 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 7 May 2019 19:28:51 +0300 Subject: [PATCH 42/59] [SSE mobile] Add Freeze Panes in context menu --- .../mobile/app/controller/DocumentHolder.js | 20 ++++++++++++++++++- apps/spreadsheeteditor/mobile/locale/en.json | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index 867ee9609..18e9150d4 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -152,6 +152,9 @@ define([ me.api.asc_getUrlType(url) > 0 && openLink(url); } break; + case 'freezePanes': + me.api.asc_freezePane(); + break; } if ('showActionSheet' == event && _actionSheets.length > 0) { @@ -320,9 +323,22 @@ define([ }); } } + if (!this.api.asc_getSheetViewSettings().asc_getIsFreezePane()) { + menuItems.push({ + caption: me.menuFreezePanes, + event: 'freezePanes' + }); + } else { + menuItems.push({ + caption: me.menuUnfreezePanes, + event: 'freezePanes' + }); + } } } + + if (Common.SharedSettings.get('phone') && menuItems.length > 3) { _actionSheets = menuItems.slice(3); @@ -356,7 +372,9 @@ define([ menuEdit: 'Edit', menuCell: 'Cell', menuMore: 'More', - sheetCancel: 'Cancel' + sheetCancel: 'Cancel', + menuFreezePanes: 'Freeze Panes', + menuUnfreezePanes: 'Unfreeze Panes' } })(), SSE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 4bff52803..238daa1c4 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -33,6 +33,8 @@ "SSE.Controllers.DocumentHolder.menuWrap": "Wrap", "SSE.Controllers.DocumentHolder.sheetCancel": "Cancel", "SSE.Controllers.DocumentHolder.warnMergeLostData": "Operation can destroy data in the selected cells.
    Continue?", + "SSE.Controllers.DocumentHolder.menuFreezePanes": "Freeze Panes", + "SSE.Controllers.DocumentHolder.menuUnfreezePanes": "Unfreeze Panes", "SSE.Controllers.EditCell.textAuto": "Auto", "SSE.Controllers.EditCell.textFonts": "Fonts", "SSE.Controllers.EditCell.textPt": "pt", From e10bd011a5599729cc5c6b73b961d868a3512730 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 8 May 2019 10:44:00 +0300 Subject: [PATCH 43/59] [DE mobile] Add delete table in context menu --- .../mobile/app/controller/DocumentHolder.js | 12 +++++++++++- apps/documenteditor/mobile/locale/en.json | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index e7b301029..f96f25f2c 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -130,6 +130,8 @@ define([ me.showSplitModal(); } else if ('delete' == eventName) { me.api.asc_Remove(); + } else if('deletetable' == eventName) { + me.api.remTable(); } else if ('edit' == eventName) { _view.hideMenu(); @@ -472,6 +474,13 @@ define([ event: 'delete' }); + if(isTable) { + menuItems.push({ + caption: me.menuDeleteTable, + event: 'deletetable' + }); + } + menuItems.push({ caption: me.menuEdit, event: 'edit' @@ -563,7 +572,8 @@ define([ menuReject: 'Reject', menuRejectAll: 'Reject All', menuMerge: 'Merge Cells', - menuSplit: 'Split Cell' + menuSplit: 'Split Cell', + menuDeleteTable: 'Delete Table' } })(), DE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index e7958d7cd..910a5c3ab 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -34,6 +34,7 @@ "DE.Controllers.DocumentHolder.textCancel": "Cancel", "DE.Controllers.DocumentHolder.textColumns": "Columns", "DE.Controllers.DocumentHolder.textRows": "Rows", + "DE.Controllers.DocumentHolder.menuDeleteTable": "Delete Table", "DE.Controllers.EditContainer.textChart": "Chart", "DE.Controllers.EditContainer.textFooter": "Footer", "DE.Controllers.EditContainer.textHeader": "Header", From d8a722c1c4e104f9dca356ccf721ac01c4a8f03c Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 8 May 2019 11:36:06 +0300 Subject: [PATCH 44/59] [SSE mobile] fix code structure --- .../mobile/app/controller/DocumentHolder.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index 18e9150d4..86cd96482 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -323,17 +323,12 @@ define([ }); } } - if (!this.api.asc_getSheetViewSettings().asc_getIsFreezePane()) { - menuItems.push({ - caption: me.menuFreezePanes, - event: 'freezePanes' - }); - } else { - menuItems.push({ - caption: me.menuUnfreezePanes, - event: 'freezePanes' - }); - } + + menuItems.push({ + caption: this.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? me.menuUnfreezePanes : me.menuFreezePanes, + event: 'freezePanes' + }); + } } From 01440c04af63b4cb2bb6f5d2f95c96ae68bbcdb9 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 8 May 2019 14:31:48 +0300 Subject: [PATCH 45/59] [DE mobile] Fix locked settings in context menu --- .../mobile/app/controller/DocumentHolder.js | 58 ++++++++++++------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index f96f25f2c..a5541cfa1 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -407,15 +407,25 @@ define([ isImage = false, isChart = false, isShape = false, - isLink = false; + isLink = false, + lockedText = false, + lockedTable = false, + lockedImage = false, + lockedHeader = false; _.each(stack, function (item) { var objectType = item.get_ObjectType(), objectValue = item.get_ObjectValue(); + if (objectType == Asc.c_oAscTypeSelectElement.Header) { + lockedHeader = objectValue.get_Locked(); + } + if (objectType == Asc.c_oAscTypeSelectElement.Text) { isText = true; + lockedText = objectValue.get_Locked(); } else if (objectType == Asc.c_oAscTypeSelectElement.Image) { + lockedImage = objectValue.get_Locked(); if (objectValue && objectValue.get_ChartProperties()) { isChart = true; } else if (objectType && objectValue.get_ShapeProperties()) { @@ -425,22 +435,20 @@ define([ } } else if (objectType == Asc.c_oAscTypeSelectElement.Table) { isTable = true; + lockedTable = objectValue.get_Locked(); } else if (objectType == Asc.c_oAscTypeSelectElement.Hyperlink) { isLink = true; } }); if (stack.length > 0) { - var topObject = _.find(stack.reverse(), function(obj){ return obj.get_ObjectType() != Asc.c_oAscTypeSelectElement.SpellCheck; }), - topObjectValue = topObject.get_ObjectValue(), - objectLocked = _.isFunction(topObjectValue.get_Locked) ? topObjectValue.get_Locked() : false; var swapItems = function(items, indexBefore, indexAfter) { items[indexAfter] = items.splice(indexBefore, 1, items[indexAfter])[0]; }; - if (!objectLocked && _isEdit && !me.isDisconnected) { - if (canCopy) { + if (_isEdit && !me.isDisconnected) { + if (!lockedText && !lockedTable && !lockedImage && !lockedHeader && canCopy) { menuItems.push({ caption: me.menuCut, event: 'cut' @@ -450,43 +458,49 @@ define([ swapItems(menuItems, 0, 1); } - menuItems.push({ - caption: me.menuPaste, - event: 'paste' - }); + if (!lockedText && !lockedTable && !lockedImage && !lockedHeader) { + menuItems.push({ + caption: me.menuPaste, + event: 'paste' + }); + } - if(isTable && me.api.CheckBeforeMergeCells()) { + if(isTable && me.api.CheckBeforeMergeCells() && !lockedTable && !lockedHeader) { menuItems.push({ caption: me.menuMerge, event: 'merge' }); } - if(isTable && me.api.CheckBeforeSplitCells()) { + if(isTable && me.api.CheckBeforeSplitCells() && !lockedTable && !lockedHeader) { menuItems.push({ caption: me.menuSplit, event: 'split' }); } - menuItems.push({ - caption: me.menuDelete, - event: 'delete' - }); + if(!lockedText && !lockedTable && !lockedImage && !lockedHeader) { + menuItems.push({ + caption: me.menuDelete, + event: 'delete' + }); + } - if(isTable) { + if(isTable && !lockedTable && !lockedText && !lockedHeader) { menuItems.push({ caption: me.menuDeleteTable, event: 'deletetable' }); } - menuItems.push({ - caption: me.menuEdit, - event: 'edit' - }); + if(!lockedText && !lockedTable && !lockedImage && !lockedHeader){ + menuItems.push({ + caption: me.menuEdit, + event: 'edit' + }); + } - if (!_.isEmpty(me.api.can_AddHyperlink())) { + if (!_.isEmpty(me.api.can_AddHyperlink()) && !lockedHeader) { menuItems.push({ caption: me.menuAddLink, event: 'addlink' From c7a5162e8052b6b39ad4ef9079c6be31de40da9b Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 15 May 2019 14:48:38 +0300 Subject: [PATCH 46/59] [DE mobile] Add modal window collaboration, add Track Changes --- apps/documenteditor/mobile/app-dev.js | 6 +- apps/documenteditor/mobile/app.js | 6 +- .../mobile/app/controller/Collaboration.js | 191 ++++++++++++++++++ .../mobile/app/controller/Settings.js | 8 +- .../app/template/Collaboration.template | 81 ++++++++ .../mobile/app/template/Settings.template | 10 + .../mobile/app/view/Collaboration.js | 153 ++++++++++++++ .../mobile/app/view/Settings.js | 3 +- 8 files changed, 452 insertions(+), 6 deletions(-) create mode 100644 apps/documenteditor/mobile/app/controller/Collaboration.js create mode 100644 apps/documenteditor/mobile/app/template/Collaboration.template create mode 100644 apps/documenteditor/mobile/app/view/Collaboration.js diff --git a/apps/documenteditor/mobile/app-dev.js b/apps/documenteditor/mobile/app-dev.js index 653bd9b8c..95ac0d284 100644 --- a/apps/documenteditor/mobile/app-dev.js +++ b/apps/documenteditor/mobile/app-dev.js @@ -149,7 +149,8 @@ require([ 'AddTable', 'AddShape', 'AddImage', - 'AddOther' + 'AddOther', + 'Collaboration' ] }); @@ -218,7 +219,8 @@ require([ 'documenteditor/mobile/app/controller/add/AddTable', 'documenteditor/mobile/app/controller/add/AddShape', 'documenteditor/mobile/app/controller/add/AddImage', - 'documenteditor/mobile/app/controller/add/AddOther' + 'documenteditor/mobile/app/controller/add/AddOther', + 'documenteditor/mobile/app/controller/Collaboration' ], function() { window.compareVersions = true; app.start(); diff --git a/apps/documenteditor/mobile/app.js b/apps/documenteditor/mobile/app.js index e434c4546..4b139e5f6 100644 --- a/apps/documenteditor/mobile/app.js +++ b/apps/documenteditor/mobile/app.js @@ -160,7 +160,8 @@ require([ 'AddTable', 'AddShape', 'AddImage', - 'AddOther' + 'AddOther', + 'Collaboration' ] }); @@ -229,7 +230,8 @@ require([ 'documenteditor/mobile/app/controller/add/AddTable', 'documenteditor/mobile/app/controller/add/AddShape', 'documenteditor/mobile/app/controller/add/AddImage', - 'documenteditor/mobile/app/controller/add/AddOther' + 'documenteditor/mobile/app/controller/add/AddOther', + 'documenteditor/mobile/app/controller/Collaboration' ], function() { app.start(); }); diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js new file mode 100644 index 000000000..1a7257cdd --- /dev/null +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -0,0 +1,191 @@ +/* + * + * (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 + * Document Editor + * + * Created by Julia Svinareva on 14/5/19 + * Copyright (c) 2019 Ascensio System SIA. All rights reserved. + * + */ +define([ + 'core', + 'jquery', + 'underscore', + 'backbone', + 'documenteditor/mobile/app/view/Collaboration' +], function (core, $, _, Backbone) { + 'use strict'; + + DE.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() { + // Private + var _settings = [], + _headerType = 1, + rootView, + _isReviewOnly = false, + _fileKey, + _canReview = false; + + return { + models: [], + collections: [], + views: [ + 'Collaboration' + ], + + initialize: function() { + var me = this; + me.addListeners({ + 'Collaboration': { + 'page:show' : me.onPageShow + } + }); + }, + + setApi: function(api) { + this.api = api; + }, + + onLaunch: function () { + this.createView('Collaboration').render(); + }, + + setMode: function (mode) { + _isReviewOnly = mode.isReviewOnly; + _fileKey = mode.fileKey; + _canReview = mode.canReview; + }, + + + showModal: function() { + var me = this, + isAndroid = Framework7.prototype.device.android === true, + modalView, + mainView = DE.getController('Editor').getView('Editor').f7View; + + uiApp.closeModal(); + + /*me._showByStack(Common.SharedSettings.get('phone'));*/ + + 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-edit') + ); + } + + 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')); + + DE.getController('Toolbar').getView('Toolbar').hideSearch(); + }, + + rootView : function() { + return rootView; + }, + + onPageShow: function(view, pageId) { + var me = this; + + if ('#reviewing-settings-view' == pageId) { + me.initReviewingSettingsView(); + Common.Utils.addScrollIfNeed('.page[data-page=reviewing-settings-view]', '.page[data-page=reviewing-settings-view] .page-content'); + } else { + + } + }, + + initReviewingSettingsView: function () { + var me = this; + $('#settings-review input:checkbox').attr('checked', _isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); + $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); + if (_isReviewOnly) $layour.find('#settings-review').addClass('disabled'); + }, + + onTrackChanges: function(e) { + var $checkbox = $(e.currentTarget), + state = $checkbox.is(':checked'); + if ( _isReviewOnly ) { + $checkbox.attr('checked', true); + } else if ( _canReview ) { + this.api.asc_SetTrackRevisions(state); + Common.localStorage.setItem("de-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0); + } + }, + + + + text: '' + + } + })(), DE.Controllers.Collaboration || {})) +}); \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index d135ce7f2..49f377c25 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -46,7 +46,8 @@ define([ 'jquery', 'underscore', 'backbone', - 'documenteditor/mobile/app/view/Settings' + 'documenteditor/mobile/app/view/Settings', + 'documenteditor/mobile/app/controller/Collaboration' ], function (core, $, _, Backbone) { 'use strict'; @@ -249,9 +250,14 @@ define([ $('#settings-help').single('click', _.bind(me.onShowHelp, me)); $('#settings-download').single('click', _.bind(me.onDownloadOrigin, me)); $('#settings-print').single('click', _.bind(me.onPrint, me)); + $('#settings-collaboration').single('click', _.bind(me.clickCollaboration, me)); } }, + clickCollaboration: function() { + DE.getController('Collaboration').showModal(); + }, + onNoCharacters: function(e) { var me = this; var $checkbox = $(e.currentTarget), diff --git a/apps/documenteditor/mobile/app/template/Collaboration.template b/apps/documenteditor/mobile/app/template/Collaboration.template new file mode 100644 index 000000000..ffdd94803 --- /dev/null +++ b/apps/documenteditor/mobile/app/template/Collaboration.template @@ -0,0 +1,81 @@ + +
    + + +
    + + +
    + +
    +
    +
    +
    +
      +
    • +
      +
      + +
      +
      +
      <%= scope.textReview %>
      +
      + +
      +
      +
      +
    • + +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 7da79a08a..3c0dfa3ea 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -71,6 +71,16 @@ +
  • +
    +
    + +
    +
    +
    <%= scope.textCollaboration %>
    +
    +
    +
  • diff --git a/apps/documenteditor/mobile/app/view/Collaboration.js b/apps/documenteditor/mobile/app/view/Collaboration.js new file mode 100644 index 000000000..0bb12a2d2 --- /dev/null +++ b/apps/documenteditor/mobile/app/view/Collaboration.js @@ -0,0 +1,153 @@ +/* + * + * (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 + * Document Editor + * + * Created by Julia Svinareva on 14/5/19 + * Copyright (c) 2019 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'text!documenteditor/mobile/app/template/Collaboration.template', + 'jquery', + 'underscore', + 'backbone' +], function (settingsTemplate, $, _, Backbone) { + 'use strict'; + + DE.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]', + '.page[data-page=reviewing-settings-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, suspendEvent) { + var rootView = DE.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() + }); + + if (suspendEvent !== true) { + this.fireEvent('page:show', [this, templateId]); + } + } + }, + + + + + textCollaboration: 'Collaboration', + textReviewing: 'Reviewing', + textСomments: 'Сomments', + textBack: 'Back', + textReview: 'Track Changes', + + } + })(), DE.Views.Collaboration || {})) +}); \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index b49d816bc..eb85b01ca 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -286,7 +286,8 @@ define([ textInch: 'Inch', textColorSchemes: 'Color Schemes', textNoCharacters: 'Nonprinting Characters', - textHiddenTableBorders: 'Hidden Table Borders' + textHiddenTableBorders: 'Hidden Table Borders', + textCollaboration: 'Collaboration' } })(), DE.Views.Settings || {})) From 0a1d46176314c6be59fecd3d2314a532281168a1 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 16 May 2019 19:15:12 +0300 Subject: [PATCH 47/59] [DE mobile] Add settings: Display Mode, Accept All Changes, Reject All Changes, Next Change, Previous Change, Accept Change, Reject Change, Description Change in Collaboration. --- .../mobile/app/controller/Collaboration.js | 370 +++++++++++++++++- .../app/template/Collaboration.template | 131 ++++++- .../mobile/app/view/Collaboration.js | 7 + 3 files changed, 491 insertions(+), 17 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index 1a7257cdd..daf3ba54e 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -55,7 +55,9 @@ define([ rootView, _isReviewOnly = false, _fileKey, - _canReview = false; + _canReview = false, + displayMode = "Markup", + arrChangeReview = []; return { models: [], @@ -75,6 +77,7 @@ define([ setApi: function(api) { this.api = api; + this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.changeReview, this)); }, onLaunch: function () { @@ -159,16 +162,22 @@ define([ if ('#reviewing-settings-view' == pageId) { me.initReviewingSettingsView(); Common.Utils.addScrollIfNeed('.page[data-page=reviewing-settings-view]', '.page[data-page=reviewing-settings-view] .page-content'); - } else { - + } else if ('#display-mode-view' == pageId) { + me.initDisplayMode(); + Common.Utils.addScrollIfNeed('.page[data-page=display-mode-view]', '.page[data-page=display-mode-view] .page-content'); + } else if('#change-view' == pageId) { + me.initChange(); + Common.Utils.addScrollIfNeed('.page[data-page=change-view]', '.page[data-page=change-view] .page-content'); } }, initReviewingSettingsView: function () { var me = this; $('#settings-review input:checkbox').attr('checked', _isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); - $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); + $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); if (_isReviewOnly) $layour.find('#settings-review').addClass('disabled'); + $('#settings-accept-all').single('click', _.bind(me.onAcceptAllClick, me)); + $('#settings-reject-all').single('click', _.bind(me.onRejectAllClick, me)); }, onTrackChanges: function(e) { @@ -182,9 +191,360 @@ define([ } }, + onAcceptAllClick: function() { + if (this.api) { + this.api.asc_AcceptAllChanges(); + } + }, + + onRejectAllClick: function() { + if (this.api) { + this.api.asc_RejectAllChanges(); + } + }, + + initDisplayMode: function() { + var me = this; + $('input:radio').single('change', _.bind(me.onReviewViewClick, me)); + var value = displayMode; + if (value == null || value === "Markup") { + $('input[value="Markup"]').attr('checked', true); + } else if (value === 'Final') { + $('input[value="Final"]').attr('checked', true); + } else if (value === 'Original') { + $('input[value="Original"]').attr('checked', true); + } + }, + + onReviewViewClick: function(event) { + var value = $(event.currentTarget).val(); + this.turnDisplayMode(value); + }, + + turnDisplayMode: function(value) { + displayMode = value; + if (this.api) { + if (value === 'Final') + this.api.asc_BeginViewModeInReview(true); + + else if (value === 'Original') + this.api.asc_BeginViewModeInReview(false); + else + this.api.asc_EndViewModeInReview(); + } + }, + + initChange: function() { + if(arrChangeReview.length == 0) { + this.api.asc_GetNextRevisionsChange(); + } + $('#current-change #date-change').html(arrChangeReview[0]); + $('#current-change #user-name').html(arrChangeReview[1]); + $('#current-change #text-change').html(arrChangeReview[2]); + $('#btn-prev-change').single('click', _.bind(this.onPrevChange, this)); + $('#btn-next-change').single('click', _.bind(this.onNextChange, this)); + $('#btn-accept-change').single('click', _.bind(this.onAcceptCurrentChange, this)); + $('#btn-reject-change').single('click', _.bind(this.onRejectCurrentChange, this)); + + }, + + onPrevChange: function() { + this.api.asc_GetPrevRevisionsChange(); + this.updateInfoChange(); + }, + + onNextChange: function() { + this.api.asc_GetNextRevisionsChange(); + this.updateInfoChange(); + }, + + onAcceptCurrentChange: function() { + if (this.api) { + this.api.asc_AcceptChanges(); + } + this.updateInfoChange(); + }, + + onRejectCurrentChange: function() { + if (this.api) { + this.api.asc_RejectChanges(); + } + this.updateInfoChange(); + }, + + updateInfoChange: function() { + if(arrChangeReview.length == 0) { + $('#current-change #date-change').empty(); + $('#current-change #user-name').empty(); + $('#current-change #text-change').empty(); + } else { + this.initChange(); + } + }, + + changeReview: function (data) { + if (data && data.length>0) { + var me = this, arr = []; + _.each(data, function (item) { + var changetext = '', proptext = '', + value = item.get_Value(), + settings = false; + switch (item.get_Type()) { + case Asc.c_oAscRevisionsChangeType.TextAdd: + changetext = me.textInserted; + if (typeof value == 'object') { + _.each(value, function (obj) { + if (typeof obj === 'string') + changetext += (' ' + Common.Utils.String.htmlEncode(obj)); + else { + switch (obj) { + case 0: + changetext += (' <' + me.textImage + '>'); + break; + case 1: + changetext += (' <' + me.textShape + '>'); + break; + case 2: + changetext += (' <' + me.textChart + '>'); + break; + case 3: + changetext += (' <' + me.textEquation + '>'); + break; + } + } + }) + } else if (typeof value === 'string') { + changetext += (' ' + Common.Utils.String.htmlEncode(value)); + } + break; + case Asc.c_oAscRevisionsChangeType.TextRem: + changetext = me.textDeleted; + if (typeof value == 'object') { + _.each(value, function (obj) { + if (typeof obj === 'string') + changetext += (' ' + Common.Utils.String.htmlEncode(obj)); + else { + switch (obj) { + case 0: + changetext += (' <' + me.textImage + '>'); + break; + case 1: + changetext += (' <' + me.textShape + '>'); + break; + case 2: + changetext += (' <' + me.textChart + '>'); + break; + case 3: + changetext += (' <' + me.textEquation + '>'); + break; + } + } + }) + } else if (typeof value === 'string') { + changetext += (' ' + Common.Utils.String.htmlEncode(value)); + } + break; + case Asc.c_oAscRevisionsChangeType.ParaAdd: + changetext = me.textParaInserted; + break; + case Asc.c_oAscRevisionsChangeType.ParaRem: + changetext = me.textParaDeleted; + break; + case Asc.c_oAscRevisionsChangeType.TextPr: + changetext = '' + me.textFormatted; + if (value.Get_Bold() !== undefined) + proptext += ((value.Get_Bold() ? '' : me.textNot) + me.textBold + ', '); + if (value.Get_Italic() !== undefined) + proptext += ((value.Get_Italic() ? '' : me.textNot) + me.textItalic + ', '); + if (value.Get_Underline() !== undefined) + proptext += ((value.Get_Underline() ? '' : me.textNot) + me.textUnderline + ', '); + if (value.Get_Strikeout() !== undefined) + proptext += ((value.Get_Strikeout() ? '' : me.textNot) + me.textStrikeout + ', '); + if (value.Get_DStrikeout() !== undefined) + proptext += ((value.Get_DStrikeout() ? '' : me.textNot) + me.textDStrikeout + ', '); + if (value.Get_Caps() !== undefined) + proptext += ((value.Get_Caps() ? '' : me.textNot) + me.textCaps + ', '); + if (value.Get_SmallCaps() !== undefined) + proptext += ((value.Get_SmallCaps() ? '' : me.textNot) + me.textSmallCaps + ', '); + if (value.Get_VertAlign() !== undefined) + proptext += (((value.Get_VertAlign() == 1) ? me.textSuperScript : ((value.Get_VertAlign() == 2) ? me.textSubScript : me.textBaseline)) + ', '); + if (value.Get_Color() !== undefined) + proptext += (me.textColor + ', '); + if (value.Get_Highlight() !== undefined) + proptext += (me.textHighlight + ', '); + if (value.Get_Shd() !== undefined) + proptext += (me.textShd + ', '); + if (value.Get_FontFamily() !== undefined) + proptext += (value.Get_FontFamily() + ', '); + if (value.Get_FontSize() !== undefined) + proptext += (value.Get_FontSize() + ', '); + if (value.Get_Spacing() !== undefined) + proptext += (me.textSpacing + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_Spacing()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); + if (value.Get_Position() !== undefined) + proptext += (me.textPosition + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_Position()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); + if (value.Get_Lang() !== undefined) + proptext += (Common.util.LanguageInfo.getLocalLanguageName(value.Get_Lang())[1] + ', '); + + if (!_.isEmpty(proptext)) { + changetext += ': '; + proptext = proptext.substring(0, proptext.length - 2); + } + changetext += ''; + changetext += proptext; + break; + case Asc.c_oAscRevisionsChangeType.ParaPr: + changetext = '' + me.textParaFormatted; + if (value.Get_ContextualSpacing()) + proptext += ((value.Get_ContextualSpacing() ? me.textContextual : me.textNoContextual) + ', '); + if (value.Get_IndLeft() !== undefined) + proptext += (me.textIndentLeft + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndLeft()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); + if (value.Get_IndRight() !== undefined) + proptext += (me.textIndentRight + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndRight()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); + if (value.Get_IndFirstLine() !== undefined) + proptext += (me.textFirstLine + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndFirstLine()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); + if (value.Get_Jc() !== undefined) { + switch (value.Get_Jc()) { + case 0: + proptext += (me.textRight + ', '); + break; + case 1: + proptext += (me.textLeft + ', '); + break; + case 2: + proptext += (me.textCenter + ', '); + break; + case 3: + proptext += (me.textJustify + ', '); + break; + + } + } + if (value.Get_KeepLines() !== undefined) + proptext += ((value.Get_KeepLines() ? me.textKeepLines : me.textNoKeepLines) + ', '); + if (value.Get_KeepNext()) + proptext += ((value.Get_KeepNext() ? me.textKeepNext : me.textNoKeepNext) + ', '); + if (value.Get_PageBreakBefore()) + proptext += ((value.Get_PageBreakBefore() ? me.textBreakBefore : me.textNoBreakBefore) + ', '); + if (value.Get_SpacingLineRule() !== undefined && value.Get_SpacingLine() !== undefined) { + proptext += me.textLineSpacing; + proptext += (((value.Get_SpacingLineRule() == c_paragraphLinerule.LINERULE_LEAST) ? me.textAtLeast : ((value.Get_SpacingLineRule() == c_paragraphLinerule.LINERULE_AUTO) ? me.textMultiple : me.textExact)) + ' '); + proptext += (((value.Get_SpacingLineRule() == c_paragraphLinerule.LINERULE_AUTO) ? value.Get_SpacingLine() : Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingLine()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName()) + ', '); + } + if (value.Get_SpacingBeforeAutoSpacing()) + proptext += (me.textSpacingBefore + ' ' + me.textAuto + ', '); + else if (value.Get_SpacingBefore() !== undefined) + proptext += (me.textSpacingBefore + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingBefore()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); + if (value.Get_SpacingAfterAutoSpacing()) + proptext += (me.textSpacingAfter + ' ' + me.textAuto + ', '); + else if (value.Get_SpacingAfter() !== undefined) + proptext += (me.textSpacingAfter + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingAfter()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); + if (value.Get_WidowControl()) + proptext += ((value.Get_WidowControl() ? me.textWidow : me.textNoWidow) + ', '); + if (value.Get_Tabs() !== undefined) + proptext += proptext += (me.textTabs + ', '); + if (value.Get_NumPr() !== undefined) + proptext += proptext += (me.textNum + ', '); + if (value.Get_PStyle() !== undefined) { + var style = me.api.asc_GetStyleNameById(value.Get_PStyle()); + if (!_.isEmpty(style)) proptext += (style + ', '); + } + + if (!_.isEmpty(proptext)) { + changetext += ': '; + proptext = proptext.substring(0, proptext.length - 2); + } + changetext += ''; + changetext += proptext; + break; + + } + var date = (item.get_DateTime() == '') ? new Date() : new Date(item.get_DateTime()), + user = item.get_UserName(); + date = me.dateToLocaleTimeString(date); - text: '' + arr.push(date, user, changetext); + }); + arrChangeReview = arr; + } else { + arrChangeReview = []; + } + }, + + dateToLocaleTimeString: function (date) { + function format(date) { + var strTime, + hours = date.getHours(), + minutes = date.getMinutes(), + ampm = hours >= 12 ? 'pm' : 'am'; + + hours = hours % 12; + hours = hours ? hours : 12; // the hour '0' should be '12' + minutes = minutes < 10 ? '0'+minutes : minutes; + strTime = hours + ':' + minutes + ' ' + ampm; + + return strTime; + } + + // MM/dd/yyyy hh:mm AM + return (date.getMonth() + 1) + '/' + (date.getDate()) + '/' + date.getFullYear() + ' ' + format(date); + }, + + + + + textInserted: 'Inserted:
    ', + textDeleted: 'Deleted:
    ', + textParaInserted: 'Paragraph Inserted
    ', + textParaDeleted: 'Paragraph Deleted
    ', + textFormatted: 'Formatted', + textParaFormatted: 'Paragraph Formatted', + textNot: 'Not ', + textBold: 'Bold', + textItalic: 'Italic', + textStrikeout: 'Strikeout', + textUnderline: 'Underline', + textColor: 'Font color', + textBaseline: 'Baseline', + textSuperScript: 'Superscript', + textSubScript: 'Subscript', + textHighlight: 'Highlight color', + textSpacing: 'Spacing', + textDStrikeout: 'Double strikeout', + textCaps: 'All caps', + textSmallCaps: 'Small caps', + textPosition: 'Position', + textShd: 'Background color', + textContextual: 'Don\'t add interval between paragraphs of the same style', + textNoContextual: 'Add interval between paragraphs of the same style', + textIndentLeft: 'Indent left', + textIndentRight: 'Indent right', + textFirstLine: 'First line', + textRight: 'Align right', + textLeft: 'Align left', + textCenter: 'Align center', + textJustify: 'Align justify', + textBreakBefore: 'Page break before', + textKeepNext: 'Keep with next', + textKeepLines: 'Keep lines together', + textNoBreakBefore: 'No page break before', + textNoKeepNext: 'Don\'t keep with next', + textNoKeepLines: 'Don\'t keep lines together', + textLineSpacing: 'Line Spacing: ', + textMultiple: 'multiple', + textAtLeast: 'at least', + textExact: 'exactly', + textSpacingBefore: 'Spacing before', + textSpacingAfter: 'Spacing after', + textAuto: 'auto', + textWidow: 'Widow control', + textNoWidow: 'No widow control', + textTabs: 'Change tabs', + textNum: 'Change numbering', + textEquation: 'Equation', + textImage: 'Image', + textChart: 'Chart', + textShape: 'Shape' } })(), DE.Controllers.Collaboration || {})) diff --git a/apps/documenteditor/mobile/app/template/Collaboration.template b/apps/documenteditor/mobile/app/template/Collaboration.template index ffdd94803..53b61d022 100644 --- a/apps/documenteditor/mobile/app/template/Collaboration.template +++ b/apps/documenteditor/mobile/app/template/Collaboration.template @@ -23,18 +23,6 @@
  • -
  • - -
    -
    - -
    -
    -
    <%= scope.textСomments %>
    -
    -
    -
    -
  • @@ -71,6 +59,50 @@ +
  • + +
    +
    + +
    +
    +
    <%= scope.textDisplayMode %>
    +
    +
    +
    +
  • +
  • + +
    +
    + +
    +
    +
    <%= scope.textChange %>
    +
    +
    +
    +
  • +
  • +
    +
    + +
    +
    +
    <%= scope.textAcceptAllChanges %>
    +
    +
    +
  • +
  • +
    +
    + +
    +
    +
    <%= scope.textRejectAllChanges %>
    +
    +
    +
  • @@ -78,4 +110,79 @@ + + + +
    + +
    +
    +
    +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    + +
    +
    +
    +
    + + +
    + +
    +
    +
    +
    + + + Accept + Reject +
    +
    +

    +

    +

    +
    +
    +
    +
    \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/view/Collaboration.js b/apps/documenteditor/mobile/app/view/Collaboration.js index 0bb12a2d2..01d350e8e 100644 --- a/apps/documenteditor/mobile/app/view/Collaboration.js +++ b/apps/documenteditor/mobile/app/view/Collaboration.js @@ -147,6 +147,13 @@ define([ textСomments: 'Сomments', textBack: 'Back', textReview: 'Track Changes', + textAcceptAllChanges: 'Accept All Changes', + textRejectAllChanges: 'Reject All Changes', + textDisplayMode: 'Display Mode', + textMarkup: 'Markup', + textFinal: 'Final', + textOriginal: 'Original', + textChange: 'Change' } })(), DE.Views.Collaboration || {})) From 1723da332490171e53bf381fc8a0ed2c2484c9ab Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 17 May 2019 15:00:52 +0300 Subject: [PATCH 48/59] [DE mobile] Add check for mode = review into collaboration settings --- .../mobile/app/controller/Collaboration.js | 29 +++++++++++-------- .../app/template/Collaboration.template | 4 +-- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index daf3ba54e..0962553f0 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -53,9 +53,6 @@ define([ var _settings = [], _headerType = 1, rootView, - _isReviewOnly = false, - _fileKey, - _canReview = false, displayMode = "Markup", arrChangeReview = []; @@ -84,10 +81,9 @@ define([ this.createView('Collaboration').render(); }, - setMode: function (mode) { - _isReviewOnly = mode.isReviewOnly; - _fileKey = mode.fileKey; - _canReview = mode.canReview; + setMode: function(mode) { + this.appConfig = mode; + return this; }, @@ -173,21 +169,25 @@ define([ initReviewingSettingsView: function () { var me = this; - $('#settings-review input:checkbox').attr('checked', _isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); + $('#settings-review input:checkbox').attr('checked', this.appConfig.isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes")); $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); - if (_isReviewOnly) $layour.find('#settings-review').addClass('disabled'); $('#settings-accept-all').single('click', _.bind(me.onAcceptAllClick, me)); $('#settings-reject-all').single('click', _.bind(me.onRejectAllClick, me)); + if(this.appConfig.isReviewOnly) { + $('#settings-accept-all').addClass('disabled'); + $('#settings-reject-all').addClass('disabled'); + $('#settings-review').addClass('disabled'); + } }, onTrackChanges: function(e) { var $checkbox = $(e.currentTarget), state = $checkbox.is(':checked'); - if ( _isReviewOnly ) { + if ( this.appConfig.isReviewOnly ) { $checkbox.attr('checked', true); - } else if ( _canReview ) { + } else { this.api.asc_SetTrackRevisions(state); - Common.localStorage.setItem("de-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0); + Common.localStorage.setItem("de-mobile-track-changes", state ? 1 : 0); } }, @@ -234,6 +234,7 @@ define([ } }, + initChange: function() { if(arrChangeReview.length == 0) { this.api.asc_GetNextRevisionsChange(); @@ -245,6 +246,10 @@ define([ $('#btn-next-change').single('click', _.bind(this.onNextChange, this)); $('#btn-accept-change').single('click', _.bind(this.onAcceptCurrentChange, this)); $('#btn-reject-change').single('click', _.bind(this.onRejectCurrentChange, this)); + if(!this.appConfig.isReviewOnly) { + $('#btn-accept-change').removeClass('disabled'); + $('#btn-reject-change').removeClass('disabled'); + } }, diff --git a/apps/documenteditor/mobile/app/template/Collaboration.template b/apps/documenteditor/mobile/app/template/Collaboration.template index 53b61d022..1cda4cd3c 100644 --- a/apps/documenteditor/mobile/app/template/Collaboration.template +++ b/apps/documenteditor/mobile/app/template/Collaboration.template @@ -174,8 +174,8 @@

    From 4f9d1e85f3887790b771f7a5f54d9275e7e795d5 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 17 May 2019 17:18:56 +0300 Subject: [PATCH 49/59] [DE mobile] Add styles collaboration. --- .../resources/less/ios/_collaboration.less | 54 +++++++++++++++++++ .../less/material/_collaboration.less | 54 +++++++++++++++++++ .../mobile/app/controller/Collaboration.js | 5 ++ .../app/template/Collaboration.template | 20 ++++--- .../mobile/resources/css/app-ios.css | 51 ++++++++++++++++++ .../mobile/resources/css/app-material.css | 50 +++++++++++++++++ .../mobile/resources/less/app-ios.less | 1 + .../mobile/resources/less/app-material.less | 1 + 8 files changed, 228 insertions(+), 8 deletions(-) create mode 100644 apps/common/mobile/resources/less/ios/_collaboration.less create mode 100644 apps/common/mobile/resources/less/material/_collaboration.less diff --git a/apps/common/mobile/resources/less/ios/_collaboration.less b/apps/common/mobile/resources/less/ios/_collaboration.less new file mode 100644 index 000000000..98b14edf7 --- /dev/null +++ b/apps/common/mobile/resources/less/ios/_collaboration.less @@ -0,0 +1,54 @@ +.page-change { + .block-description { + background-color: #fff; + padding-top: 15px; + padding-bottom: 15px; + margin: 0; + } + #user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + } + #date-change { + font-size: 14px; + line-height: 18px; + color: #8C8C8C; + margin: 0; + margin-top: 3px; + } + #text-change { + color: #000000; + font-size: 15px; + line-height: 18px; + margin: 0; + margin-top: 10px; + } + .block-btn { + display: flex; + flex-direction: row; + justify-content: space-around; + margin: 26px 0; + + #btn-next-change, #btn-reject-change { + margin-left: 20px; + } + + .link { + height: 48px; + width: 48px; + display: inline-block; + .icon { + background-position: center; + height: 48px; + width: 48px; + } + } + } +} +.navbar .center-collaboration { + display: flex; + justify-content: space-around; + margin-left: 45px; +} \ 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 new file mode 100644 index 000000000..1bc3ca662 --- /dev/null +++ b/apps/common/mobile/resources/less/material/_collaboration.less @@ -0,0 +1,54 @@ +.page-change { + .block-description { + background-color: #fff; + padding-top: 15px; + padding-bottom: 15px; + margin: 0; + } + #user-name { + font-size: 17px; + line-height: 22px; + color: #000000; + margin: 0; + } + #date-change { + font-size: 14px; + line-height: 18px; + color: #8C8C8C; + margin: 0; + margin-top: 3px; + } + #text-change { + color: #000000; + font-size: 15px; + line-height: 18px; + margin: 0; + margin-top: 10px; + } + .block-btn { + display: flex; + flex-direction: row; + justify-content: space-around; + margin: 0; + padding: 26px 0; + background-color: #EFEFF4; + + #btn-next-change, #btn-reject-change { + margin-left: 20px; + } + + .link { + display: inline-block; + + .icon { + background-position: center; + height: 48px; + width: 48px; + } + } + } +} +.navbar .center-collaboration { + text-align: center; + margin-left: 54px; +} \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index 0962553f0..cd47d56f3 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -239,6 +239,9 @@ define([ if(arrChangeReview.length == 0) { this.api.asc_GetNextRevisionsChange(); } + if(arrChangeReview.length == 0) { + $('#current-change').css('display','none'); + } $('#current-change #date-change').html(arrChangeReview[0]); $('#current-change #user-name').html(arrChangeReview[1]); $('#current-change #text-change').html(arrChangeReview[2]); @@ -282,7 +285,9 @@ define([ $('#current-change #date-change').empty(); $('#current-change #user-name').empty(); $('#current-change #text-change').empty(); + $('#current-change').css('display','none'); } else { + $('#current-change').css('display','block'); this.initChange(); } }, diff --git a/apps/documenteditor/mobile/app/template/Collaboration.template b/apps/documenteditor/mobile/app/template/Collaboration.template index 1cda4cd3c..0581f4343 100644 --- a/apps/documenteditor/mobile/app/template/Collaboration.template +++ b/apps/documenteditor/mobile/app/template/Collaboration.template @@ -2,7 +2,7 @@
    @@ -169,15 +169,19 @@
    -
    +
    -
    - - - Accept - Reject +
    + + + + + + + +
    -
    +

    diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index 635aa35b5..8e0e18863 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -6264,6 +6264,57 @@ 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; +} +.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: #8C8C8C; + margin: 0; + margin-top: 3px; +} +.page-change #text-change { + color: #000000; + font-size: 15px; + line-height: 18px; + margin: 0; + margin-top: 10px; +} +.page-change .block-btn { + display: flex; + flex-direction: row; + justify-content: space-around; + margin: 26px 0; +} +.page-change .block-btn #btn-next-change, +.page-change .block-btn #btn-reject-change { + margin-left: 20px; +} +.page-change .block-btn .link { + height: 48px; + width: 48px; + display: inline-block; +} +.page-change .block-btn .link .icon { + background-position: center; + height: 48px; + width: 48px; +} +.navbar .center-collaboration { + display: flex; + justify-content: space-around; + margin-left: 45px; +} .tablet .searchbar.document.replace .center .searchbar:first-child { margin-right: 10px; } diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index 6fe7b8da6..ccd260710 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -5863,6 +5863,56 @@ 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; +} +.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: #8C8C8C; + margin: 0; + margin-top: 3px; +} +.page-change #text-change { + color: #000000; + font-size: 15px; + line-height: 18px; + 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 .link { + display: inline-block; +} +.page-change .block-btn .link .icon { + background-position: center; + height: 48px; + width: 48px; +} +.navbar .center-collaboration { + text-align: center; + margin-left: 54px; +} .tablet .searchbar.document.replace .center > .replace { display: flex; } diff --git a/apps/documenteditor/mobile/resources/less/app-ios.less b/apps/documenteditor/mobile/resources/less/app-ios.less index 4b6a4d160..f36d5fc97 100644 --- a/apps/documenteditor/mobile/resources/less/app-ios.less +++ b/apps/documenteditor/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'); diff --git a/apps/documenteditor/mobile/resources/less/app-material.less b/apps/documenteditor/mobile/resources/less/app-material.less index 87cbc32a5..37a4adfd3 100644 --- a/apps/documenteditor/mobile/resources/less/app-material.less +++ b/apps/documenteditor/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'); From a0337e4302634e384306b1cf5741329097f601ea Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 17 May 2019 18:56:58 +0300 Subject: [PATCH 50/59] [DE mobile] Add button exit modal window, delete track changes from settings. --- .../mobile/app/controller/Collaboration.js | 8 +++++--- .../mobile/app/controller/Settings.js | 13 ------------- .../mobile/app/template/Collaboration.template | 3 +++ .../mobile/app/template/Settings.template | 16 ---------------- 4 files changed, 8 insertions(+), 32 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index cd47d56f3..9877ad798 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -54,7 +54,8 @@ define([ _headerType = 1, rootView, displayMode = "Markup", - arrChangeReview = []; + arrChangeReview = [], + _fileKey; return { models: [], @@ -83,6 +84,7 @@ define([ setMode: function(mode) { this.appConfig = mode; + _fileKey = mode.fileKey; return this; }, @@ -169,7 +171,7 @@ define([ initReviewingSettingsView: function () { var me = this; - $('#settings-review input:checkbox').attr('checked', this.appConfig.isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes")); + $('#settings-review input:checkbox').attr('checked', this.appConfig.isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); $('#settings-accept-all').single('click', _.bind(me.onAcceptAllClick, me)); $('#settings-reject-all').single('click', _.bind(me.onRejectAllClick, me)); @@ -187,7 +189,7 @@ define([ $checkbox.attr('checked', true); } else { this.api.asc_SetTrackRevisions(state); - Common.localStorage.setItem("de-mobile-track-changes", state ? 1 : 0); + Common.localStorage.setItem("de-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0); } }, diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 49f377c25..ffdc04af3 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -243,10 +243,8 @@ define([ Common.Utils.addScrollIfNeed('.page[data-page=margin-view]', '.page[data-page=margin-view] .page-content'); } else { $('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode')); - $('#settings-review input:checkbox').attr('checked', _isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || ''))); $('#settings-search').single('click', _.bind(me.onSearch, me)); $('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me)); - $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); $('#settings-help').single('click', _.bind(me.onShowHelp, me)); $('#settings-download').single('click', _.bind(me.onDownloadOrigin, me)); $('#settings-print').single('click', _.bind(me.onPrint, me)); @@ -470,17 +468,6 @@ define([ this.api && this.api.asc_pluginRun("asc.{B631E142-E40B-4B4C-90B9-2D00222A286E}", 0); }, - onTrackChanges: function(e) { - var $checkbox = $(e.currentTarget), - state = $checkbox.is(':checked'); - if ( _isReviewOnly ) { - $checkbox.attr('checked', true); - } else if ( _canReview ) { - this.api.asc_SetTrackRevisions(state); - Common.localStorage.setItem("de-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0); - } - }, - onShowHelp: function () { window.open('{{SUPPORT_URL}}', "_blank"); this.hideModal(); diff --git a/apps/documenteditor/mobile/app/template/Collaboration.template b/apps/documenteditor/mobile/app/template/Collaboration.template index 0581f4343..af3fbdf5b 100644 --- a/apps/documenteditor/mobile/app/template/Collaboration.template +++ b/apps/documenteditor/mobile/app/template/Collaboration.template @@ -36,6 +36,7 @@
    @@ -118,6 +119,7 @@
    @@ -166,6 +168,7 @@
    diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 3c0dfa3ea..41deaec18 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -55,22 +55,6 @@ <% } %> -
  • -
    -
    - -
    -
    -
    <%= scope.textReview %>
    -
    - -
    -
    -
    -
  • From 039d15c233a545b569a3ef53a8d368fe4620e249 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 21 May 2019 11:00:00 +0300 Subject: [PATCH 51/59] [DE mobile] Fix disabled settings when change Display Mode --- .../mobile/app/controller/Collaboration.js | 37 +++++++++++++------ .../mobile/app/controller/Settings.js | 9 +++++ .../mobile/app/controller/Toolbar.js | 11 +++++- .../app/template/Collaboration.template | 4 +- 4 files changed, 46 insertions(+), 15 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index 9877ad798..a7302470c 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -129,8 +129,7 @@ define([ '
    ' + '
    ' + '
  • ' + - '
    ', - $$('#toolbar-edit') + '
    ' ); } @@ -175,10 +174,14 @@ define([ $('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me)); $('#settings-accept-all').single('click', _.bind(me.onAcceptAllClick, me)); $('#settings-reject-all').single('click', _.bind(me.onRejectAllClick, me)); - if(this.appConfig.isReviewOnly) { + if(this.appConfig.isReviewOnly || displayMode == "Final" || displayMode == "Original" ) { $('#settings-accept-all').addClass('disabled'); $('#settings-reject-all').addClass('disabled'); $('#settings-review').addClass('disabled'); + } else { + $('#settings-accept-all').removeClass('disabled'); + $('#settings-reject-all').removeClass('disabled'); + $('#settings-review').removeClass('disabled'); } }, @@ -218,6 +221,10 @@ define([ } }, + getDisplayMode: function() { + return displayMode; + }, + onReviewViewClick: function(event) { var value = $(event.currentTarget).val(); this.turnDisplayMode(value); @@ -234,6 +241,8 @@ define([ else this.api.asc_EndViewModeInReview(); } + this.initReviewingSettingsView(); + DE.getController('Toolbar').setDisplayMode(value); }, @@ -251,9 +260,15 @@ define([ $('#btn-next-change').single('click', _.bind(this.onNextChange, this)); $('#btn-accept-change').single('click', _.bind(this.onAcceptCurrentChange, this)); $('#btn-reject-change').single('click', _.bind(this.onRejectCurrentChange, this)); - if(!this.appConfig.isReviewOnly) { - $('#btn-accept-change').removeClass('disabled'); - $('#btn-reject-change').removeClass('disabled'); + if(this.appConfig.isReviewOnly) { + $('#btn-accept-change').addClass('disabled'); + $('#btn-reject-change').addClass('disabled'); + } + if(displayMode == "Final" || displayMode == "Original") { + $('#btn-accept-change').addClass('disabled'); + $('#btn-reject-change').addClass('disabled'); + $('#btn-prev-change').addClass('disabled'); + $('#btn-next-change').addClass('disabled'); } }, @@ -505,12 +520,12 @@ define([ - textInserted: 'Inserted:
    ', - textDeleted: 'Deleted:
    ', - textParaInserted: 'Paragraph Inserted
    ', - textParaDeleted: 'Paragraph Deleted
    ', + textInserted: 'Inserted:', + textDeleted: 'Deleted:', + textParaInserted: 'Paragraph Inserted ', + textParaDeleted: 'Paragraph Deleted ', textFormatted: 'Formatted', - textParaFormatted: 'Paragraph Formatted', + textParaFormatted: 'Paragraph Formatted', textNot: 'Not ', textBold: 'Bold', textItalic: 'Italic', diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index ffdc04af3..bf6192291 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -249,6 +249,10 @@ 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(); + if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") { + $('#settings-document').addClass('disabled'); + } } }, @@ -331,6 +335,11 @@ 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(); + if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") { + $('#settings-no-characters').addClass('disabled'); + $('#settings-hidden-borders').addClass('disabled'); + } }, initPageDocumentSettings: function () { diff --git a/apps/documenteditor/mobile/app/controller/Toolbar.js b/apps/documenteditor/mobile/app/controller/Toolbar.js index e1d1ed5b4..1bbb6344a 100644 --- a/apps/documenteditor/mobile/app/controller/Toolbar.js +++ b/apps/documenteditor/mobile/app/controller/Toolbar.js @@ -51,7 +51,8 @@ define([ DE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() { // private - var _backUrl; + var _backUrl, + stateDisplayMode = false; return { models: [], @@ -149,6 +150,12 @@ define([ } }, + setDisplayMode: function(displayMode) { + stateDisplayMode = displayMode == "Final" || displayMode == "Original" ? true : false; + var selected = this.api.getSelectedElements(); + this.onApiFocusObject(selected); + }, + onApiFocusObject: function (objects) { if (this.isDisconnected) return; @@ -159,7 +166,7 @@ define([ topObjectValue = topObject.get_ObjectValue(), objectLocked = _.isFunction(topObjectValue.get_Locked) ? topObjectValue.get_Locked() : false; - $('#toolbar-add, #toolbar-edit').toggleClass('disabled', objectLocked); + $('#toolbar-add, #toolbar-edit').toggleClass('disabled', objectLocked || stateDisplayMode); } }, diff --git a/apps/documenteditor/mobile/app/template/Collaboration.template b/apps/documenteditor/mobile/app/template/Collaboration.template index af3fbdf5b..ad199f58f 100644 --- a/apps/documenteditor/mobile/app/template/Collaboration.template +++ b/apps/documenteditor/mobile/app/template/Collaboration.template @@ -180,8 +180,8 @@ - - + +
    From 3eb99a778a8c8867b1258ba8f2fdc686ef771212 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 21 May 2019 11:02:03 +0300 Subject: [PATCH 52/59] [DE mobile] Fix text --- apps/common/mobile/resources/less/ios/_collaboration.less | 2 +- apps/common/mobile/resources/less/material/_collaboration.less | 2 +- apps/documenteditor/mobile/app/view/Collaboration.js | 2 +- apps/documenteditor/mobile/resources/css/app-ios.css | 2 +- apps/documenteditor/mobile/resources/css/app-material.css | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/common/mobile/resources/less/ios/_collaboration.less b/apps/common/mobile/resources/less/ios/_collaboration.less index 98b14edf7..442a8a4d1 100644 --- a/apps/common/mobile/resources/less/ios/_collaboration.less +++ b/apps/common/mobile/resources/less/ios/_collaboration.less @@ -14,7 +14,7 @@ #date-change { font-size: 14px; line-height: 18px; - color: #8C8C8C; + color: #6d6d72; margin: 0; margin-top: 3px; } diff --git a/apps/common/mobile/resources/less/material/_collaboration.less b/apps/common/mobile/resources/less/material/_collaboration.less index 1bc3ca662..1652b4ec4 100644 --- a/apps/common/mobile/resources/less/material/_collaboration.less +++ b/apps/common/mobile/resources/less/material/_collaboration.less @@ -14,7 +14,7 @@ #date-change { font-size: 14px; line-height: 18px; - color: #8C8C8C; + color: #6d6d72; margin: 0; margin-top: 3px; } diff --git a/apps/documenteditor/mobile/app/view/Collaboration.js b/apps/documenteditor/mobile/app/view/Collaboration.js index 01d350e8e..c7ad39177 100644 --- a/apps/documenteditor/mobile/app/view/Collaboration.js +++ b/apps/documenteditor/mobile/app/view/Collaboration.js @@ -143,7 +143,7 @@ define([ textCollaboration: 'Collaboration', - textReviewing: 'Reviewing', + textReviewing: 'Review', textСomments: 'Сomments', textBack: 'Back', textReview: 'Track Changes', diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index 8e0e18863..b600fd1d2 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -6279,7 +6279,7 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after .page-change #date-change { font-size: 14px; line-height: 18px; - color: #8C8C8C; + color: #6d6d72; margin: 0; margin-top: 3px; } diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index ccd260710..ce43babc0 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -5878,7 +5878,7 @@ html.phone .document-menu .list-block .item-link { .page-change #date-change { font-size: 14px; line-height: 18px; - color: #8C8C8C; + color: #6d6d72; margin: 0; margin-top: 3px; } From 0d74c6d33415c49d30337423d6269be4ba4292f5 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 21 May 2019 17:43:42 +0300 Subject: [PATCH 53/59] [DE mobile] Review: add delete current change in review mode and fix update description current change. --- .../mobile/app/controller/Collaboration.js | 58 +++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index a7302470c..35c1a6cdc 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -55,6 +55,7 @@ define([ rootView, displayMode = "Markup", arrChangeReview = [], + dateChange = [], _fileKey; return { @@ -97,8 +98,6 @@ define([ uiApp.closeModal(); - /*me._showByStack(Common.SharedSettings.get('phone'));*/ - if (Common.SharedSettings.get('phone')) { modalView = $$(uiApp.pickerModal( '
    ' + @@ -129,7 +128,8 @@ define([ '
    ' + '
    ' + '
    ' + - '
    ' + '
    ', + $$('#toolbar-settings') ); } @@ -252,17 +252,20 @@ define([ } if(arrChangeReview.length == 0) { $('#current-change').css('display','none'); + } else { + $('#current-change #date-change').html(arrChangeReview[0].date); + $('#current-change #user-name').html(arrChangeReview[0].user); + $('#current-change #text-change').html(arrChangeReview[0].changetext); } - $('#current-change #date-change').html(arrChangeReview[0]); - $('#current-change #user-name').html(arrChangeReview[1]); - $('#current-change #text-change').html(arrChangeReview[2]); $('#btn-prev-change').single('click', _.bind(this.onPrevChange, this)); $('#btn-next-change').single('click', _.bind(this.onNextChange, this)); $('#btn-accept-change').single('click', _.bind(this.onAcceptCurrentChange, this)); $('#btn-reject-change').single('click', _.bind(this.onRejectCurrentChange, this)); if(this.appConfig.isReviewOnly) { - $('#btn-accept-change').addClass('disabled'); - $('#btn-reject-change').addClass('disabled'); + $('#btn-accept-change').remove(); + $('#btn-reject-change').remove(); + $('.accept-reject').html('
    '); + $('#btn-delete-change').single('click', _.bind(this.onDeleteChange, this)); } if(displayMode == "Final" || displayMode == "Original") { $('#btn-accept-change').addClass('disabled'); @@ -275,37 +278,37 @@ define([ onPrevChange: function() { this.api.asc_GetPrevRevisionsChange(); - this.updateInfoChange(); }, onNextChange: function() { this.api.asc_GetNextRevisionsChange(); - this.updateInfoChange(); }, onAcceptCurrentChange: function() { if (this.api) { - this.api.asc_AcceptChanges(); + this.api.asc_AcceptChanges(dateChange[0]); } - this.updateInfoChange(); + this.api.asc_GetNextRevisionsChange(); }, onRejectCurrentChange: function() { if (this.api) { - this.api.asc_RejectChanges(); + this.api.asc_RejectChanges(dateChange[0]); } - this.updateInfoChange(); + this.api.asc_GetNextRevisionsChange(); }, updateInfoChange: function() { - if(arrChangeReview.length == 0) { - $('#current-change #date-change').empty(); - $('#current-change #user-name').empty(); - $('#current-change #text-change').empty(); - $('#current-change').css('display','none'); - } else { - $('#current-change').css('display','block'); - this.initChange(); + if($("[data-page=change-view]").length > 0) { + if (arrChangeReview.length == 0) { + $('#current-change #date-change').empty(); + $('#current-change #user-name').empty(); + $('#current-change #text-change').empty(); + $('#current-change').css('display', 'none'); + } else { + $('#current-change').css('display', 'block'); + this.initChange(); + } } }, @@ -490,12 +493,15 @@ define([ date = me.dateToLocaleTimeString(date); - arr.push(date, user, changetext); + arr.push({date: date, user: user, changetext: changetext}); }); arrChangeReview = arr; + dateChange = data; } else { arrChangeReview = []; + dateChange = []; } + this.updateInfoChange(); }, dateToLocaleTimeString: function (date) { @@ -517,6 +523,12 @@ define([ return (date.getMonth() + 1) + '/' + (date.getDate()) + '/' + date.getFullYear() + ' ' + format(date); }, + onDeleteChange: function() { + if (this.api) { + this.api.asc_RejectChanges(dateChange[0]); + } + }, + From 6f0c48fc5e8cb79f569db1190591d41758dc636d Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 22 May 2019 09:59:21 +0300 Subject: [PATCH 54/59] [DE mobile] Add check canReview --- apps/documenteditor/mobile/app/controller/Collaboration.js | 4 ++++ apps/documenteditor/mobile/app/controller/Settings.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index 35c1a6cdc..bccdf31c6 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -165,6 +165,10 @@ define([ } else if('#change-view' == pageId) { me.initChange(); Common.Utils.addScrollIfNeed('.page[data-page=change-view]', '.page[data-page=change-view] .page-content'); + } else { + if(!this.appConfig.canReview) { + $('#reviewing-settings').hide(); + } } }, diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index bf6192291..c9dce5c1d 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -253,6 +253,9 @@ define([ if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") { $('#settings-document').addClass('disabled'); } + if(!_canReview) { + $('#settings-collaboration').hide(); + } } }, From 88ee14544c156dbe8fbb52c030d7ee5412eda7eb Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 22 May 2019 10:20:49 +0300 Subject: [PATCH 55/59] [DE mobile] Change review --- .../mobile/app/controller/DocumentHolder.js | 53 ++----------------- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index a5541cfa1..9eb1b5516 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -148,26 +148,10 @@ define([ return true; } }); - } else if ('accept' == eventName) { - me.api.asc_GetNextRevisionsChange(); - me.api.asc_AcceptChanges(); - } else if ('acceptall' == eventName) { - me.api.asc_AcceptAllChanges(); - } else if ('reject' == eventName) { - me.api.asc_GetNextRevisionsChange(); - me.api.asc_RejectChanges(); - } else if ('rejectall' == eventName) { - me.api.asc_RejectAllChanges(); } else if ('review' == eventName) { - if (Common.SharedSettings.get('phone')) { - _actionSheets = me._initReviewMenu(); - me.onContextMenuClick(view, 'showActionSheet'); - } else { - _.delay(function () { - _view.showMenu(me._initReviewMenu(), _menuPos[0] || 0, _menuPos[1] || 0); - _timer = (new Date).getTime(); - }, 100); - } + var getCollaboration = DE.getController('Collaboration'); + getCollaboration.showModal(); + getCollaboration.getView('Collaboration').showPage('#reviewing-settings-view'); } else if ('showActionSheet' == eventName && _actionSheets.length > 0) { _.delay(function () { _.each(_actionSheets, function (action) { @@ -536,33 +520,6 @@ define([ return menuItems; }, - _initReviewMenu: function (stack) { - var me = this, - menuItems = []; - - menuItems.push({ - caption: me.menuAccept, - event: 'accept' - }); - - menuItems.push({ - caption: me.menuReject, - event: 'reject' - }); - - menuItems.push({ - caption: me.menuAcceptAll, - event: 'acceptall' - }); - - menuItems.push({ - caption: me.menuRejectAll, - event: 'rejectall' - }); - - return menuItems; - }, - onCoAuthoringDisconnect: function() { this.isDisconnected = true; }, @@ -581,10 +538,6 @@ define([ menuMore: 'More', sheetCancel: 'Cancel', menuReview: 'Review', - menuAccept: 'Accept', - menuAcceptAll: 'Accept All', - menuReject: 'Reject', - menuRejectAll: 'Reject All', menuMerge: 'Merge Cells', menuSplit: 'Split Cell', menuDeleteTable: 'Delete Table' From 840bd61c4b6b6ac7a1d868d79ba89fccb08c8305 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 22 May 2019 11:44:45 +0300 Subject: [PATCH 56/59] [DE mobile] Remove animation when review open --- .../mobile/app/controller/DocumentHolder.js | 2 +- apps/documenteditor/mobile/app/view/Collaboration.js | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index 9eb1b5516..2e126ea84 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -151,7 +151,7 @@ define([ } else if ('review' == eventName) { var getCollaboration = DE.getController('Collaboration'); getCollaboration.showModal(); - getCollaboration.getView('Collaboration').showPage('#reviewing-settings-view'); + getCollaboration.getView('Collaboration').showPage('#reviewing-settings-view', false); } else if ('showActionSheet' == eventName && _actionSheets.length > 0) { _.delay(function () { _.each(_actionSheets, function (action) { diff --git a/apps/documenteditor/mobile/app/view/Collaboration.js b/apps/documenteditor/mobile/app/view/Collaboration.js index c7ad39177..ed19a7e40 100644 --- a/apps/documenteditor/mobile/app/view/Collaboration.js +++ b/apps/documenteditor/mobile/app/view/Collaboration.js @@ -118,7 +118,7 @@ define([ return ''; }, - showPage: function(templateId, suspendEvent) { + showPage: function(templateId, animate) { var rootView = DE.getController('Collaboration').rootView(); if (rootView && this.layout) { @@ -130,18 +130,16 @@ define([ } rootView.router.load({ - content: $content.html() + content: $content.html(), + animatePages: animate !== false }); - if (suspendEvent !== true) { - this.fireEvent('page:show', [this, templateId]); - } + this.fireEvent('page:show', [this, templateId]); } }, - textCollaboration: 'Collaboration', textReviewing: 'Review', textСomments: 'Сomments', From ee7f41196bdeffca5333e0a3288a3ba596ea9915 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 22 May 2019 12:45:38 +0300 Subject: [PATCH 57/59] [DE mobile] Add translate --- apps/documenteditor/mobile/locale/en.json | 70 +++++++++++++++++++++-- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 910a5c3ab..9d21aa9c4 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -14,8 +14,6 @@ "DE.Controllers.AddTable.textColumns": "Columns", "DE.Controllers.AddTable.textRows": "Rows", "DE.Controllers.AddTable.textTableSize": "Table Size", - "DE.Controllers.DocumentHolder.menuAccept": "Accept", - "DE.Controllers.DocumentHolder.menuAcceptAll": "Accept All", "DE.Controllers.DocumentHolder.menuAddLink": "Add Link", "DE.Controllers.DocumentHolder.menuCopy": "Copy", "DE.Controllers.DocumentHolder.menuCut": "Cut", @@ -24,8 +22,6 @@ "DE.Controllers.DocumentHolder.menuMore": "More", "DE.Controllers.DocumentHolder.menuOpenLink": "Open Link", "DE.Controllers.DocumentHolder.menuPaste": "Paste", - "DE.Controllers.DocumentHolder.menuReject": "Reject", - "DE.Controllers.DocumentHolder.menuRejectAll": "Reject All", "DE.Controllers.DocumentHolder.menuReview": "Review", "DE.Controllers.DocumentHolder.sheetCancel": "Cancel", "DE.Controllers.DocumentHolder.textGuest": "Guest", @@ -185,6 +181,58 @@ "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.Views.AddImage.textAddress": "Address", "DE.Views.AddImage.textBack": "Back", "DE.Views.AddImage.textFromLibrary": "Picture from Library", @@ -428,5 +476,17 @@ "DE.Views.Settings.textColorSchemes": "Color Schemes", "DE.Views.Settings.textNoCharacters": "Nonprinting Characters", "DE.Views.Settings.textHiddenTableBorders": "Hidden Table Borders", - "DE.Views.Toolbar.textBack": "Back" + "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": "Change" } \ No newline at end of file From dc6402c41a243005af63332e19ab1e3fc29689bb Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 22 May 2019 15:36:43 +0300 Subject: [PATCH 58/59] [DE mobile] Add Collaboration icon into toolbar, fix less --- .../mobile/resources/less/ios/_collaboration.less | 7 ++++++- .../mobile/resources/less/material/_collaboration.less | 7 ++++++- .../mobile/app/controller/Collaboration.js | 6 +++--- .../mobile/app/template/Collaboration.template | 2 +- .../mobile/app/template/Settings.template | 2 ++ .../mobile/app/template/Toolbar.template | 5 +++++ apps/documenteditor/mobile/app/view/Toolbar.js | 10 ++++++++-- apps/documenteditor/mobile/resources/css/app-ios.css | 5 ++++- .../mobile/resources/css/app-material.css | 5 ++++- 9 files changed, 39 insertions(+), 10 deletions(-) diff --git a/apps/common/mobile/resources/less/ios/_collaboration.less b/apps/common/mobile/resources/less/ios/_collaboration.less index 442a8a4d1..5ccf0840d 100644 --- a/apps/common/mobile/resources/less/ios/_collaboration.less +++ b/apps/common/mobile/resources/less/ios/_collaboration.less @@ -50,5 +50,10 @@ .navbar .center-collaboration { display: flex; justify-content: space-around; - margin-left: 45px; +} +.container-collaboration { + .navbar .right.close-collaboration { + position: absolute; + right: 10px; + } } \ 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 1652b4ec4..3b3132690 100644 --- a/apps/common/mobile/resources/less/material/_collaboration.less +++ b/apps/common/mobile/resources/less/material/_collaboration.less @@ -50,5 +50,10 @@ } .navbar .center-collaboration { text-align: center; - margin-left: 54px; +} +.container-collaboration { + .navbar .right.close-collaboration { + position: absolute; + right: 5px; + } } \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/controller/Collaboration.js b/apps/documenteditor/mobile/app/controller/Collaboration.js index bccdf31c6..c5ce3c2bb 100644 --- a/apps/documenteditor/mobile/app/controller/Collaboration.js +++ b/apps/documenteditor/mobile/app/controller/Collaboration.js @@ -100,7 +100,7 @@ define([ if (Common.SharedSettings.get('phone')) { modalView = $$(uiApp.pickerModal( - '
    ' + + '
    ' + '' + @@ -119,7 +119,7 @@ define([ mainView.hideNavbar(); } else { modalView = uiApp.popover( - '
    ' + + '
    ' + '
    ' + '
    ' + '
    ' + @@ -129,7 +129,7 @@ define([ '
    ' + '
    ' + '
    ', - $$('#toolbar-settings') + $$('#toolbar-collaboration') ); } diff --git a/apps/documenteditor/mobile/app/template/Collaboration.template b/apps/documenteditor/mobile/app/template/Collaboration.template index ad199f58f..532c869b4 100644 --- a/apps/documenteditor/mobile/app/template/Collaboration.template +++ b/apps/documenteditor/mobile/app/template/Collaboration.template @@ -3,7 +3,7 @@
    diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 41deaec18..004ca88ff 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -55,6 +55,7 @@ <% } %> + <% if(phone) {%>
  • @@ -65,6 +66,7 @@
  • + <% } %>
  • diff --git a/apps/documenteditor/mobile/app/template/Toolbar.template b/apps/documenteditor/mobile/app/template/Toolbar.template index 92137c8a0..dcb188e8c 100644 --- a/apps/documenteditor/mobile/app/template/Toolbar.template +++ b/apps/documenteditor/mobile/app/template/Toolbar.template @@ -20,6 +20,11 @@
    <% } %>
    + <% if (!phone) { %> + + <% } %> <% if (android) { %>