From c8176c94dc6c0e466a6298fa5d8b096b74222124 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Fri, 2 Dec 2016 14:06:27 +0300 Subject: [PATCH 1/9] zoom only for chrome --- apps/common/main/lib/util/utils.js | 73 ++++++++++++++++-------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index ce019dd08..8a18386d4 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -105,51 +105,54 @@ Common.Utils = _.extend(new(function() { me = this, checkSize = function() { me.zoom = 1; - if (false) + if (isChrome && !isOpera && document && document.firstElementChild && document.body) { - // этот код - рабочий, но только если этот ифрейм открыт на весь размер браузера - // (window.outerWidth и window.innerWidth зависимы) - if (window.innerWidth > 300) + if (false) + { + // этот код - рабочий, но только если этот ифрейм открыт на весь размер браузера + // (window.outerWidth и window.innerWidth зависимы) + if (window.innerWidth > 300) + me.zoom = window.outerWidth / window.innerWidth; + + if (Math.abs(me.zoom - 1) < 0.1) + me.zoom = 1; + me.zoom = window.outerWidth / window.innerWidth; - if (Math.abs(me.zoom - 1) < 0.1) - me.zoom = 1; + var _devicePixelRatio = window.devicePixelRatio / me.zoom; - me.zoom = window.outerWidth / window.innerWidth; + // device pixel ratio: кратно 0.5 + _devicePixelRatio = (5 * (((2.5 + 10 * _devicePixelRatio) / 5) >> 0)) / 10; + me.zoom = window.devicePixelRatio / _devicePixelRatio; - var _devicePixelRatio = window.devicePixelRatio / me.zoom; - - // device pixel ratio: кратно 0.5 - _devicePixelRatio = (5 * (((2.5 + 10 * _devicePixelRatio) / 5) >> 0)) / 10; - me.zoom = window.devicePixelRatio / _devicePixelRatio; - - // chrome 54.x: zoom = "reset" - clear retina zoom (windows) - //document.firstElementChild.style.zoom = "reset"; - document.firstElementChild.style.zoom = 1.0 / me.zoom; - } - else - { - // делаем простую проверку - // считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio; - // считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio; - if (window.devicePixelRatio > 0.1) - { - if (window.devicePixelRatio < 1.99) - { - var _devicePixelRatio = 1; - me.zoom = window.devicePixelRatio / _devicePixelRatio; - } - else - { - var _devicePixelRatio = 2; - me.zoom = window.devicePixelRatio / _devicePixelRatio; - } // chrome 54.x: zoom = "reset" - clear retina zoom (windows) //document.firstElementChild.style.zoom = "reset"; document.firstElementChild.style.zoom = 1.0 / me.zoom; } else - document.firstElementChild.style.zoom = "normal"; + { + // делаем простую проверку + // считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio; + // считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio; + if (window.devicePixelRatio > 0.1) + { + if (window.devicePixelRatio < 1.99) + { + var _devicePixelRatio = 1; + me.zoom = window.devicePixelRatio / _devicePixelRatio; + } + else + { + var _devicePixelRatio = 2; + me.zoom = window.devicePixelRatio / _devicePixelRatio; + } + // chrome 54.x: zoom = "reset" - clear retina zoom (windows) + //document.firstElementChild.style.zoom = "reset"; + document.firstElementChild.style.zoom = 1.0 / me.zoom; + } + else + document.firstElementChild.style.zoom = "normal"; + } } me.innerWidth = window.innerWidth * me.zoom; me.innerHeight = window.innerHeight * me.zoom; From 047a8ce7504bd1086a03ee613addab135bc5e9dd Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Fri, 2 Dec 2016 18:53:18 +0300 Subject: [PATCH 2/9] Removed version number --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index d6ba7016a..62163b654 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](http://www.gnu.org/licenses/agpl-3.0.ru.html) ![Release](https://img.shields.io/badge/Release-v4.1.2-blue.svg?style=flat) +[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](http://www.gnu.org/licenses/agpl-3.0.ru.html) ## web-apps From 95bccf6c37f6904abe1c2a4ebcc90a8113f88ed4 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 5 Dec 2016 11:06:53 +0300 Subject: [PATCH 3/9] Fix Bug 33599, fix Bug 33600 + fix bug with ThemeColorPalette, when zoom<100. --- .../common/main/lib/view/AdvancedSettingsWindow.js | 2 +- .../main/app/view/DropcapSettingsAdvanced.js | 4 ++-- .../main/app/view/ParagraphSettings.js | 2 +- .../main/app/view/ParagraphSettingsAdvanced.js | 4 ++-- apps/documenteditor/main/app/view/ShapeSettings.js | 10 +++++----- apps/documenteditor/main/app/view/TableSettings.js | 4 ++-- .../main/app/view/TableSettingsAdvanced.js | 6 +++--- .../main/app/view/TextArtSettings.js | 6 +++--- apps/documenteditor/main/app/view/Toolbar.js | 4 ++-- .../main/app/view/ShapeSettings.js | 10 +++++----- .../main/app/view/SlideSettings.js | 8 ++++---- .../main/app/view/TableSettings.js | 4 ++-- .../main/app/view/TextArtSettings.js | 10 +++++----- apps/presentationeditor/main/app/view/Toolbar.js | 2 +- .../main/app/view/AutoFilterDialog.js | 4 ++-- .../main/app/view/ChartSettings.js | 14 +++++++------- .../main/app/view/ShapeSettings.js | 10 +++++----- apps/spreadsheeteditor/main/app/view/Statusbar.js | 2 +- .../main/app/view/TextArtSettings.js | 10 +++++----- apps/spreadsheeteditor/main/app/view/Toolbar.js | 6 +++--- 20 files changed, 61 insertions(+), 61 deletions(-) diff --git a/apps/common/main/lib/view/AdvancedSettingsWindow.js b/apps/common/main/lib/view/AdvancedSettingsWindow.js index 2ad8a0524..520e89a0e 100644 --- a/apps/common/main/lib/view/AdvancedSettingsWindow.js +++ b/apps/common/main/lib/view/AdvancedSettingsWindow.js @@ -104,7 +104,7 @@ define([ }); var cnt_panel = $window.find('.content-panel'); cnt_panel.width(this.contentWidth); - $window.width($window.find('.menu-panel').width() + cnt_panel.outerWidth() + 1); + $window.width($window.find('.menu-panel').width() + cnt_panel.outerWidth() + 2); this.content_panels = $window.find('.settings-panel'); if (this.btnsCategory.length>0) diff --git a/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js b/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js index de19d810f..2c4543c7d 100644 --- a/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js @@ -163,7 +163,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) @@ -188,7 +188,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) diff --git a/apps/documenteditor/main/app/view/ParagraphSettings.js b/apps/documenteditor/main/app/view/ParagraphSettings.js index c79b66775..ae517e060 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettings.js +++ b/apps/documenteditor/main/app/view/ParagraphSettings.js @@ -444,7 +444,7 @@ define([ if (!this.mnuColorPicker) { this.btnColor.setMenu( new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] })); diff --git a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js index eaec79147..641145f40 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js @@ -212,7 +212,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) @@ -266,7 +266,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 0e13335b9..152b0c296 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -1561,7 +1561,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1581,7 +1581,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1600,7 +1600,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1619,7 +1619,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1638,7 +1638,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index 826da4c1a..00e9e9b6a 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -642,7 +642,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -660,7 +660,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js index 4221ed5b6..7ba24b0eb 100644 --- a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js @@ -881,7 +881,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) @@ -901,7 +901,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) @@ -921,7 +921,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js index 37d395a23..f00789a40 100644 --- a/apps/documenteditor/main/app/view/TextArtSettings.js +++ b/apps/documenteditor/main/app/view/TextArtSettings.js @@ -1054,7 +1054,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1073,7 +1073,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1092,7 +1092,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 30d071290..14d17c2ce 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -253,7 +253,7 @@ define([ template : _.template('<%= caption %>') }, {caption:'--'}, - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -267,7 +267,7 @@ define([ split : true, menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index dc2414d3d..5efee8b75 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -1420,7 +1420,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1440,7 +1440,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1459,7 +1459,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1478,7 +1478,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1497,7 +1497,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/presentationeditor/main/app/view/SlideSettings.js b/apps/presentationeditor/main/app/view/SlideSettings.js index 30c70bfdf..6a9ee30af 100644 --- a/apps/presentationeditor/main/app/view/SlideSettings.js +++ b/apps/presentationeditor/main/app/view/SlideSettings.js @@ -985,7 +985,7 @@ define([ disabled: true, menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1005,7 +1005,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1024,7 +1024,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1043,7 +1043,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/presentationeditor/main/app/view/TableSettings.js b/apps/presentationeditor/main/app/view/TableSettings.js index 01ff9c201..57e5bfcea 100644 --- a/apps/presentationeditor/main/app/view/TableSettings.js +++ b/apps/presentationeditor/main/app/view/TableSettings.js @@ -538,7 +538,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -556,7 +556,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/presentationeditor/main/app/view/TextArtSettings.js b/apps/presentationeditor/main/app/view/TextArtSettings.js index a957bec19..d62f28ed0 100644 --- a/apps/presentationeditor/main/app/view/TextArtSettings.js +++ b/apps/presentationeditor/main/app/view/TextArtSettings.js @@ -1456,7 +1456,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1476,7 +1476,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1495,7 +1495,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1514,7 +1514,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1533,7 +1533,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 671606671..46bcc4ddb 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -322,7 +322,7 @@ define([ split : true, menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index 895065774..e78a3d268 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -54,7 +54,7 @@ define([ var t = this, _options = {}; _.extend(_options, { - width : 500, + width : 501, height : 230, contentWidth : 180, header : true, @@ -478,7 +478,7 @@ define([ var t = this, _options = {}; _.extend(_options, { - width : 448, + width : 450, height : 265, contentWidth : 400, header : false, diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js index a320fa70b..a422d2bb1 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js @@ -524,7 +524,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -543,7 +543,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -558,7 +558,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -573,7 +573,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -588,7 +588,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -603,7 +603,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -618,7 +618,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index 28ebe0db4..08a2d92bf 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -1445,7 +1445,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1465,7 +1465,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1484,7 +1484,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1503,7 +1503,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1522,7 +1522,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index de2cb001d..d38298746 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -264,7 +264,7 @@ define([ menuAlign: 'tl-tr', cls: 'color-tab', items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }); diff --git a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js index 914ed9caf..d7844c5f4 100644 --- a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js @@ -1461,7 +1461,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1480,7 +1480,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1500,7 +1500,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1519,7 +1519,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) @@ -1538,7 +1538,7 @@ define([ style: "width:45px;", menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + this.textNewColor + '') } ] }) diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 726b0b3b3..fc1f8abb1 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -283,7 +283,7 @@ define([ lock : [_set.selImage, _set.editFormula, _set.selRange, _set.coAuth, _set.coAuthText, _set.lostConnect], menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) @@ -306,7 +306,7 @@ define([ lock : [_set.selImage, _set.editCell, _set.coAuth, _set.coAuthText, _set.lostConnect], menu : new Common.UI.Menu({ items: [ - { template: _.template('
') }, + { template: _.template('
') }, { template: _.template('' + me.textNewColor + '') } ] }) @@ -1523,7 +1523,7 @@ define([ menu : new Common.UI.Menu({ menuAlign : 'tl-tr', items : [ - { template: _.template('
'), stopPropagation: true }, + { template: _.template('
'), stopPropagation: true }, { template: _.template('' + this.textNewColor + ''), stopPropagation: true } ] }) From 48d244a51340c0ef66c097dd376d667d94eb882b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 5 Dec 2016 11:47:45 +0300 Subject: [PATCH 4/9] [SSE] Fix Bug 33598. --- .../main/app/view/ChartSettingsDlg.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js index f3ed54337..51c240162 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js @@ -1263,8 +1263,6 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' var changed = false, value = this.cmbEmptyCells.getValue(); if (rawData.type !== Asc.c_oAscSparklineType.Line && this._arrEmptyCells.length>2) { - if (value == Asc.c_oAscEDispBlanksAs.Span) - value = Asc.c_oAscEDispBlanksAs.Gap; this._arrEmptyCells.pop(); changed = true; } else if (rawData.type == Asc.c_oAscSparklineType.Line && this._arrEmptyCells.length<3) { @@ -1273,9 +1271,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' } if (changed) { this.cmbEmptyCells.setData(this._arrEmptyCells); - this.cmbEmptyCells.setValue(value); - if (this._changedProps) - this._changedProps.asc_setDisplayEmpty(value); + this.cmbEmptyCells.setValue((rawData.type !== Asc.c_oAscSparklineType.Line && value==Asc.c_oAscEDispBlanksAs.Span) ? this.textEmptyLine : value); } this.updateSparkStyles(this.chartSettings.asc_getStyles()); @@ -1360,7 +1356,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' if (this._state.SparkType !== Asc.c_oAscSparklineType.Line) this._arrEmptyCells.pop(); this.cmbEmptyCells.setData(this._arrEmptyCells); - this.cmbEmptyCells.setValue(props.asc_getDisplayEmpty()); + + var value = props.asc_getDisplayEmpty(); + this.cmbEmptyCells.setValue((this._state.SparkType !== Asc.c_oAscSparklineType.Line && value==Asc.c_oAscEDispBlanksAs.Span) ? this.textEmptyLine : value); this.chShowEmpty.setValue(props.asc_getDisplayHidden(), true); this.chShowAxis.setValue(props.asc_getDisplayXAxis(), true); From dd1a531707d5687b89f8c1862d9f040d5526d5de Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 5 Dec 2016 17:08:58 +0300 Subject: [PATCH 5/9] Fix Bug 33597 (+ disable clicking on btnCancel when frame is loading). --- apps/common/main/lib/view/ExternalDiagramEditor.js | 2 +- apps/common/main/resources/less/buttons.less | 8 ++++---- apps/spreadsheeteditor/main/app/controller/Main.js | 10 ++++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/common/main/lib/view/ExternalDiagramEditor.js b/apps/common/main/lib/view/ExternalDiagramEditor.js index f1dc2ccc5..6d3edd310 100644 --- a/apps/common/main/lib/view/ExternalDiagramEditor.js +++ b/apps/common/main/lib/view/ExternalDiagramEditor.js @@ -62,7 +62,7 @@ define([ '
', '' ].join(''); diff --git a/apps/common/main/resources/less/buttons.less b/apps/common/main/resources/less/buttons.less index 492ba1a13..cac8a3afc 100644 --- a/apps/common/main/resources/less/buttons.less +++ b/apps/common/main/resources/less/buttons.less @@ -454,8 +454,8 @@ color: @gray-deep; background-color: @secondary; - &:hover, - &.hover { + &:hover:not(.disabled), + &.hover:not(.disabled) { background-color: @secondary-hover; } @@ -463,8 +463,8 @@ color: #fff; background-color: @primary; - &:hover, - &.hover { + &:hover:not(.disabled), + &.hover:not(.disabled) { background-color: @primary-hover; } } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 3a341caca..c7d8a382b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -158,7 +158,7 @@ define([ var me = this; // Syncronize focus with api $(document.body).on('focus', 'input, textarea:not(#ce-cell-content)', function(e) { - if (this.isAppDisabled === true) return; + if (me.isAppDisabled === true) return; if (e && e.target && !/area_id/.test(e.target.id)) { if (/msg-reply/.test(e.target.className)) @@ -167,7 +167,8 @@ define([ }); $(document.body).on('blur', 'input, textarea', function(e) { - if (this.isAppDisabled === true) return; + if (me.isAppDisabled === true || me.isFrameClosed) return; + if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible())) { if (!e.relatedTarget || !/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */ @@ -284,6 +285,8 @@ define([ if (this.appOptions.location == 'us' || this.appOptions.location == 'ca') Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch); + + this.isFrameClosed = (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge); }, loadDocument: function(data) { @@ -1617,6 +1620,7 @@ define([ break; case 'queryClose': if ($('body .asc-window:visible').length === 0) { + this.isFrameClosed = true; this.api.asc_closeCellEditor(); Common.Gateway.internalMessage('canClose', {mr:data.data.mr, answer: true}); } @@ -1634,6 +1638,7 @@ define([ setChartData: function(chart) { if (typeof chart === 'object' && this.api) { this.api.asc_addChartDrawingObject(chart); + this.isFrameClosed = false; } }, @@ -1656,6 +1661,7 @@ define([ setMergeData: function(merge) { if (typeof merge === 'object' && this.api) { this.api.asc_setData(merge); + this.isFrameClosed = false; } }, From 6f83abb8ee8a8d6a129a4ad7ded63e56caf691aa Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Tue, 6 Dec 2016 14:32:37 +0300 Subject: [PATCH 6/9] refactoring mobile (web) --- apps/documenteditor/sdk_dev_scripts.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/documenteditor/sdk_dev_scripts.js b/apps/documenteditor/sdk_dev_scripts.js index eb9739e1f..9d88f2f9a 100644 --- a/apps/documenteditor/sdk_dev_scripts.js +++ b/apps/documenteditor/sdk_dev_scripts.js @@ -67,6 +67,7 @@ var sdk_dev_scrpipts = [ "../../../../sdkjs/common/Drawings/HatchPattern.js", "../../../../sdkjs/common/scroll.js", "../../../../sdkjs/common/Scrolls/iscroll.js", + "../../../../sdkjs/common/Scrolls/mobileTouchManagerBase.js", "../../../../sdkjs/common/wordcopypaste.js", "../../../../sdkjs/word/apiDefines.js", "../../../../sdkjs/cell/utils/utils.js", @@ -143,6 +144,7 @@ var sdk_dev_scrpipts = [ "../../../../sdkjs/word/Drawing/Rulers.js", "../../../../sdkjs/word/Drawing/HtmlPage.js", "../../../../sdkjs/word/Drawing/documentrenderer.js", + "../../../../sdkjs/word/Drawing/mobileTouchManager.js", "../../../../sdkjs/word/apiCommon.js", "../../../../sdkjs/common/apiBase.js", "../../../../sdkjs/word/api.js", From 9c65d45fb6a4bd54afa5fc5f34508c663e48ebf6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 6 Dec 2016 17:38:35 +0300 Subject: [PATCH 7/9] [PE mobile] Edit hyperlinks. --- apps/presentationeditor/mobile/app-dev.js | 6 +- apps/presentationeditor/mobile/app.js | 6 +- .../mobile/app/controller/add/AddLink.js | 17 +- .../app/controller/edit/EditContainer.js | 4 +- .../mobile/app/controller/edit/EditLink.js | 362 ++++++++++++++++++ .../mobile/app/template/EditLink.template | 175 +++++++++ .../mobile/app/view/add/AddLink.js | 8 - .../mobile/app/view/edit/EditLink.js | 141 +++++++ 8 files changed, 692 insertions(+), 27 deletions(-) create mode 100644 apps/presentationeditor/mobile/app/controller/edit/EditLink.js create mode 100644 apps/presentationeditor/mobile/app/template/EditLink.template create mode 100644 apps/presentationeditor/mobile/app/view/edit/EditLink.js diff --git a/apps/presentationeditor/mobile/app-dev.js b/apps/presentationeditor/mobile/app-dev.js index 2c19f161c..f6a07eee4 100644 --- a/apps/presentationeditor/mobile/app-dev.js +++ b/apps/presentationeditor/mobile/app-dev.js @@ -141,12 +141,11 @@ require([ 'Settings', 'EditContainer', 'EditText', - // 'EditParagraph', 'EditTable', 'EditImage', 'EditShape', // 'EditChart', - // 'EditHyperlink', + 'EditLink', 'AddContainer', 'AddTable', 'AddShape', @@ -206,12 +205,11 @@ require([ 'presentationeditor/mobile/app/controller/Settings', 'presentationeditor/mobile/app/controller/edit/EditContainer', 'presentationeditor/mobile/app/controller/edit/EditText', - // 'presentationeditor/mobile/app/controller/edit/EditParagraph', 'presentationeditor/mobile/app/controller/edit/EditTable', 'presentationeditor/mobile/app/controller/edit/EditImage', 'presentationeditor/mobile/app/controller/edit/EditShape', // 'presentationeditor/mobile/app/controller/edit/EditChart', - // 'presentationeditor/mobile/app/controller/edit/EditHyperlink', + 'presentationeditor/mobile/app/controller/edit/EditLink', 'presentationeditor/mobile/app/controller/add/AddContainer', 'presentationeditor/mobile/app/controller/add/AddTable', 'presentationeditor/mobile/app/controller/add/AddShape', diff --git a/apps/presentationeditor/mobile/app.js b/apps/presentationeditor/mobile/app.js index bb382e486..596a997c1 100644 --- a/apps/presentationeditor/mobile/app.js +++ b/apps/presentationeditor/mobile/app.js @@ -152,12 +152,11 @@ require([ // 'Settings', // 'EditContainer', 'EditText', - // 'EditParagraph' 'EditTable', 'EditImage', 'EditShape', // 'EditChart', - // 'EditHyperlink', + 'EditLink', 'AddContainer', 'AddTable', 'AddShape', @@ -217,12 +216,11 @@ require([ // 'presentationeditor/mobile/app/controller/Settings', 'presentationeditor/mobile/app/controller/edit/EditContainer', 'presentationeditor/mobile/app/controller/edit/EditText', - // 'presentationeditor/mobile/app/controller/edit/EditParagraph' 'presentationeditor/mobile/app/controller/edit/EditTable', 'presentationeditor/mobile/app/controller/edit/EditImage', 'presentationeditor/mobile/app/controller/edit/EditShape', // 'presentationeditor/mobile/app/controller/edit/EditChart', - // 'presentationeditor/mobile/app/controller/edit/EditHyperlink', + 'presentationeditor/mobile/app/controller/edit/EditLink', 'presentationeditor/mobile/app/controller/add/AddContainer', 'presentationeditor/mobile/app/controller/add/AddTable', 'presentationeditor/mobile/app/controller/add/AddShape', diff --git a/apps/presentationeditor/mobile/app/controller/add/AddLink.js b/apps/presentationeditor/mobile/app/controller/add/AddLink.js index 31341045a..768c3f4a3 100644 --- a/apps/presentationeditor/mobile/app/controller/add/AddLink.js +++ b/apps/presentationeditor/mobile/app/controller/add/AddLink.js @@ -46,8 +46,7 @@ define([ 'use strict'; PE.Controllers.AddLink = Backbone.Controller.extend(_.extend((function() { - var _linkObject = undefined, - c_oHyperlinkType = { + var c_oHyperlinkType = { InternalLink:0, WebLink: 1 }, @@ -105,11 +104,15 @@ define([ var $target = $(e.currentTarget); if ($target && $target.prop('id') === 'add-link') { + _linkType = c_oHyperlinkType.WebLink; + _slideLink = _slideNum = 0; + _isDisplayChanged = false; var text = this.api.can_AddHyperlink(); if (text !== false) { - _linkObject = new Asc.CHyperlinkProperty(); - _linkObject.put_Text(text); + $('#add-link-display input').val((text !== null) ? text : this.textDefault); + $('#add-link-display').toggleClass('disabled', text === null); } + this.initSettings(); } }, @@ -123,11 +126,7 @@ define([ _slidesCount = me.api.getCountPages(); $('#page-addlink-slidenumber input').val([_slideLink]); $('#addlink-slide-number .item-after label').text(_slideNum+1); - } else if (_linkObject) { - var text = _linkObject.get_Text(); - $('#add-link-display input').val((text!==null) ? text : me.textDefault); - $('#add-link-display').toggleClass('disabled',text===null); - + } else { $('#add-link-type .item-after').text((_linkType==c_oHyperlinkType.WebLink) ? me.textExternalLink : me.textInternalLink); $('#add-link-url')[(_linkType==c_oHyperlinkType.WebLink) ? 'show' : 'hide'](); $('#add-link-number')[(_linkType==c_oHyperlinkType.WebLink) ? 'hide' : 'show'](); diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js b/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js index 1cfa69a93..867fb2ba4 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js @@ -157,7 +157,7 @@ define([ editors.push({ caption: me.textHyperlink, id: 'edit-link', - layout: PE.getController('EditHyperlink').getView('EditHyperlink').rootLayout() + layout: PE.getController('EditLink').getView('EditLink').rootLayout() }) } } @@ -334,7 +334,7 @@ define([ _settings.push('shape'); no_text = false; } else if (Asc.c_oAscTypeSelectElement.Hyperlink == type) { - // _settings.push('hyperlink'); + _settings.push('hyperlink'); } }); if (!no_text) diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditLink.js b/apps/presentationeditor/mobile/app/controller/edit/EditLink.js new file mode 100644 index 000000000..efdbd0970 --- /dev/null +++ b/apps/presentationeditor/mobile/app/controller/edit/EditLink.js @@ -0,0 +1,362 @@ +/* + * + * (c) Copyright Ascensio System Limited 2010-2016 + * + * 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 Lubanas st. 125a-25, Riga, Latvia, + * EU, LV-1021. + * + * 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 + * + */ + +/** + * EditLink.js + * Presentation Editor + * + * Created by Julia Radzhabova on 12/06/16 + * Copyright (c) 2016 Ascensio System SIA. All rights reserved. + * + */ + + +define([ + 'core', + 'presentationeditor/mobile/app/view/edit/EditLink' +], function (core) { + 'use strict'; + + PE.Controllers.EditLink = Backbone.Controller.extend(_.extend((function() { + // Private + var _stack = [], + _linkObject = undefined, + c_oHyperlinkType = { + InternalLink:0, + WebLink: 1 + }, + c_oSlideLink = { + Next: 0, + Previouse: 1, + Last: 2, + First: 3, + Num: 4 + }, + _linkType = c_oHyperlinkType.WebLink, + _slideLink = 0, + _slideNum = 0, + _slidesCount = 0, + _isDisplayChanged = false; + + return { + models: [], + collections: [], + views: [ + 'EditLink' + ], + + initialize: function () { + Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this)); + Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this)); + + this.addListeners({ + 'EditLink': { + 'page:show' : this.onPageShow + } + }); + + var me = this; + uiApp.onPageBack('editlink-type editlink-slidenumber', function (page) { + me.initSettings(); + }); + }, + + setApi: function (api) { + var me = this; + me.api = api; + + me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me)); + }, + + onLaunch: function () { + this.createView('EditLink').render(); + }, + + initEvents: function () { + var me = this; + + $('#edit-link-edit').single('click', _.bind(me.onEditLink, me)); + $('#edit-link-remove').single('click', _.bind(me.onRemoveLink, me)); + }, + + categoryShow: function (e) { + var $target = $(e.currentTarget); + + if ($target && $target.prop('id') === 'edit-link' && _linkObject) { + var url = _linkObject.get_Value(); + if (url===null || url===undefined || url=='' ) + _linkType = c_oHyperlinkType.WebLink; + else { + var indAction = url.indexOf("ppaction://hlink"); + if (0 == indAction) { + if (url == "ppaction://hlinkshowjump?jump=firstslide") { + _slideLink = 2; + } else if (url == "ppaction://hlinkshowjump?jump=lastslide") { + _slideLink = 3; + } + else if (url == "ppaction://hlinkshowjump?jump=nextslide") { + _slideLink = 0; + } + else if (url == "ppaction://hlinkshowjump?jump=previousslide") { + _slideLink = 1; + } + else { + _slideLink = 4; + _slidesCount = this.api.getCountPages(); + var mask = "ppaction://hlinksldjumpslide", + indSlide = url.indexOf(mask); + if (0 == indSlide) { + _slideNum = parseInt(url.substring(mask.length)); + if (_slideNum < 0) _slideNum = 0; + if (_slideNum >= _slidesCount) _slideNum = _slidesCount - 1; + } else + _slideNum = 0; + } + _linkType = c_oHyperlinkType.InternalLink; + } else { + _linkType = c_oHyperlinkType.WebLink; + } + } + + var text = _linkObject.get_Text(); + if (text !== false) { + $('#edit-link-display input').val((text !== null) ? text : this.textDefault); + $('#edit-link-display').toggleClass('disabled', text === null); + } + if (_linkType==c_oHyperlinkType.WebLink) { + var value = _linkObject.get_Value(); + $('#edit-link-url input').val(value ? [value.replace(new RegExp(" ", 'g'), "%20")] : ''); + } + $('#edit-link-tip input').val([_linkObject.get_ToolTip()]); + + this.initSettings(); + } + }, + + initSettings: function (pageId) { + var me = this; + + if (pageId == '#editlink-type') { + $('#page-editlink-type input').val([_linkType]); + } else if (pageId == '#editlink-slidenumber') { + _slidesCount = me.api.getCountPages(); + $('#page-editlink-slidenumber input').val([_slideLink]); + $('#editlink-slide-number .item-after label').text(_slideNum+1); + } else { + $('#edit-link-type .item-after').text((_linkType==c_oHyperlinkType.WebLink) ? me.textExternalLink : me.textInternalLink); + $('#edit-link-url')[(_linkType==c_oHyperlinkType.WebLink) ? 'show' : 'hide'](); + $('#edit-link-number')[(_linkType==c_oHyperlinkType.WebLink) ? 'hide' : 'show'](); + + if (_linkType==c_oHyperlinkType.WebLink) { + _.delay(function () { + $('.page[data-page=editlink-link] input[type=url]').focus(); + }, 1000); + } else { + var slidename = ''; + switch (_slideLink) { + case 0: + slidename = me.textNext; + break; + case 1: + slidename = me.textPrev; + break; + case 2: + slidename = me.textFirst; + break; + case 3: + slidename = me.textLast; + break; + case 4: + slidename = me.textSlide + ' ' + (_slideNum+1); + break; + } + $('#edit-link-number .item-after').text(slidename); + } + + $('#edit-link-edit').toggleClass('disabled', (_linkType==c_oHyperlinkType.WebLink) && _.isEmpty($('#edit-link-url input').val())); + } + }, + + onPageShow: function (view, pageId) { + var me = this; + + $('#page-editlink-type li').single('click', _.buffered(me.onLinkType, 100, me)); + $('#page-editlink-slidenumber li').single('click', _.buffered(me.onSlideLink, 100, me)); + $('#editlink-slide-number .button').single('click',_.buffered(me.onSlideNumber, 100, me)); + $('#edit-link-display input[type="text"]').single('input', _.bind(function(e) { + _isDisplayChanged = true; + }, this)); + me.initSettings(pageId); + }, + + // Handlers + + onEditLink: function () { + var me = this, + display = $('#edit-link-display input').val(), + tip = $('#edit-link-tip input').val(), + props = new Asc.CHyperlinkProperty(), + def_display = ''; + + if (_linkType==c_oHyperlinkType.WebLink) { + var url = $('#edit-link-url input').val(), + urltype = me.api.asc_getUrlType($.trim(url)), + isEmail = (urltype == 2); + if (urltype < 1) { + uiApp.alert(me.txtNotUrl); + return; + } + + url = url.replace(/^\s+|\s+$/g,''); + if (! /(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(url) ) + url = (isEmail ? 'mailto:' : 'http://' ) + url; + url = url.replace(new RegExp("%20",'g')," "); + + props.put_Value( url ); + props.put_ToolTip(tip); + def_display = url; + } else { + var url = "ppaction://hlink"; + var slidetip = ''; + switch (_slideLink) { + case 0: + url = url + "showjump?jump=nextslide"; + slidetip = this.textNext; + break; + case 1: + url = url + "showjump?jump=previousslide"; + slidetip = this.textPrev; + break; + case 2: + url = url + "showjump?jump=firstslide"; + slidetip = this.textFirst; + break; + case 3: + url = url + "showjump?jump=lastslide"; + slidetip = this.textLast; + break; + case 4: + url = url + "sldjumpslide" + _slideNum; + slidetip = this.textSlide + ' ' + (_slideNum+1); + break; + } + props.put_Value( url ); + props.put_ToolTip(_.isEmpty(tip) ? slidetip : tip); + def_display = slidetip; + } + + if (!$('#edit-link-display').hasClass('disabled') && (_isDisplayChanged || _.isEmpty(display))) { + props.put_Text(_.isEmpty(display) ? def_display : display); + } else + props.put_Text(null); + + me.api.change_Hyperlink(props); + + PE.getController('EditContainer').hideModal(); + }, + + onRemoveLink: function () { + this.api && this.api.remove_Hyperlink(); + PE.getController('EditContainer').hideModal(); + }, + + onLinkType: function (e) { + var $target = $(e.currentTarget).find('input'); + + if ($target && this.api) { + _linkType = parseFloat($target.prop('value')); + } + }, + + onSlideLink: function (e) { + var $target = $(e.currentTarget).find('input'); + + if ($target && this.api) { + _slideLink = parseFloat($target.prop('value')); + } + }, + + onSlideNumber: function (e) { + var $button = $(e.currentTarget), + slide = _slideNum; + + if ($button.hasClass('decrement')) { + slide = Math.max(0, --slide); + } else { + slide = Math.min(_slidesCount-1, ++slide); + } + _slideNum = slide; + $('#editlink-slide-number .item-after label').text(slide+1); + }, + + // API handlers + + onApiFocusObject: function (objects) { + _stack = objects; + + var links = []; + + _.each(_stack, function (object) { + if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink) { + links.push(object); + } + }); + + if (links.length > 0) { + var object = links[links.length - 1]; // get top + _linkObject = object.get_ObjectValue(); + } else { + _linkObject = undefined; + } + }, + + // Helpers + + _closeIfNeed: function () { + if (!this._isImageInStack()) { + PE.getController('EditContainer').hideModal(); + } + }, + + txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"', + textDefault: 'Selected text', + textNext: 'Next Slide', + textPrev: 'Previous Slide', + textFirst: 'First Slide', + textLast: 'Last Slide', + textSlide: 'Slide', + textExternalLink: 'External Link', + textInternalLink: 'Slide in this Presentation' + }; + })(), PE.Controllers.EditLink || {})) +}); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/template/EditLink.template b/apps/presentationeditor/mobile/app/template/EditLink.template new file mode 100644 index 000000000..af56452c5 --- /dev/null +++ b/apps/presentationeditor/mobile/app/template/EditLink.template @@ -0,0 +1,175 @@ + + + + + + + + \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/view/add/AddLink.js b/apps/presentationeditor/mobile/app/view/add/AddLink.js index f92bd8686..cbc7b169e 100644 --- a/apps/presentationeditor/mobile/app/view/add/AddLink.js +++ b/apps/presentationeditor/mobile/app/view/add/AddLink.js @@ -68,8 +68,6 @@ define([ $('#add-link-number').single('click', _.bind(me.showPageNumber, me)); $('#add-link-type').single('click', _.bind(me.showLinkType, me)); - - me.initControls(); }, // Render layout @@ -93,10 +91,6 @@ define([ return ''; }, - initControls: function () { - // - }, - showPage: function (templateId) { var rootView = PE.getController('AddContainer').rootView; @@ -139,8 +133,6 @@ define([ textFirst: 'First Slide', textLast: 'Last Slide', textNumber: 'Slide Number' - - } })(), PE.Views.AddLink || {})) }); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/view/edit/EditLink.js b/apps/presentationeditor/mobile/app/view/edit/EditLink.js new file mode 100644 index 000000000..853f49975 --- /dev/null +++ b/apps/presentationeditor/mobile/app/view/edit/EditLink.js @@ -0,0 +1,141 @@ +/* + * + * (c) Copyright Ascensio System Limited 2010-2016 + * + * 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 Lubanas st. 125a-25, Riga, Latvia, + * EU, LV-1021. + * + * 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 + * + */ + +/** + * EditLink.js + * Presentation Editor + * + * Created by Julia Radzhabova on 12/06/16 + * Copyright (c) 2016 Ascensio System SIA. All rights reserved. + * + */ + + +define([ + 'text!presentationeditor/mobile/app/template/EditLink.template', + 'jquery', + 'underscore', + 'backbone' +], function (editTemplate, $, _, Backbone) { + 'use strict'; + + PE.Views.EditLink = Backbone.View.extend(_.extend((function() { + // private + + return { + // el: '.view-main', + + template: _.template(editTemplate), + + events: { + }, + + initialize: function () { + Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this)); + }, + + initEvents: function () { + var me = this; + + $('#edit-link-number').single('click', _.bind(me.showPageNumber, me)); + $('#edit-link-type').single('click', _.bind(me.showLinkType, me)); + }, + + // Render layout + render: function () { + this.layout = $('
').append(this.template({ + android : Common.SharedSettings.get('android'), + phone : Common.SharedSettings.get('phone'), + scope : this + })); + + return this; + }, + + rootLayout: function () { + if (this.layout) { + return this.layout + .find('#edit-link-root') + .html(); + } + + return ''; + }, + + showPage: function (templateId) { + var rootView = PE.getController('EditContainer').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() + }); + + this.fireEvent('page:show', [this, templateId]); + } + }, + + showLinkType: function () { + this.showPage('#editlink-type'); + }, + + showPageNumber: function () { + this.showPage('#editlink-slidenumber'); + }, + + textLinkType: 'Link Type', + textExternalLink: 'External Link', + textInternalLink: 'Slide in this Presentation', + textLink: 'Link', + textLinkSlide: 'Link to', + textBack: 'Back', + textAddLink: 'Add Link', + textDisplay: 'Display', + textTip: 'Screen Tip', + textInsert: 'Insert', + textNext: 'Next Slide', + textPrev: 'Previous Slide', + textFirst: 'First Slide', + textLast: 'Last Slide', + textNumber: 'Slide Number', + textEdit: 'Edit Link', + textRemove: 'Remove Link' + } + })(), PE.Views.EditLink || {})) +}); \ No newline at end of file From 747d24cbd71b22e36f6dbe8c3f56be4fa5601c85 Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Wed, 7 Dec 2016 13:00:05 +0300 Subject: [PATCH 8/9] update about.js for 4.3 --- apps/common/main/lib/view/About.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/main/lib/view/About.js b/apps/common/main/lib/view/About.js index 29e0789ac..c79cc8f55 100644 --- a/apps/common/main/lib/view/About.js +++ b/apps/common/main/lib/view/About.js @@ -52,7 +52,7 @@ define([ initialize: function(options) { Common.UI.BaseView.prototype.initialize.call(this,arguments); - this.txtVersionNum = '4.2'; + this.txtVersionNum = '4.3'; this.txtAscMail = 'support@onlyoffice.com'; this.txtAscTelNum = '+371 660-16425'; this.txtAscUrl = 'www.onlyoffice.com'; From bad28bbe332e81fda061b77d68b3ac613ae5d6fc Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 7 Dec 2016 13:54:26 +0300 Subject: [PATCH 9/9] Remove zoom correction on mobile devices. --- apps/common/main/lib/util/utils.js | 70 ++++++++++-------------------- 1 file changed, 23 insertions(+), 47 deletions(-) diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index 8a18386d4..08d845fdd 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -102,57 +102,33 @@ Common.Utils = _.extend(new(function() { Chart : 7, MailMerge : 8 }, + isMobile = /android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera), me = this, checkSize = function() { me.zoom = 1; - if (isChrome && !isOpera && document && document.firstElementChild && document.body) + if (isChrome && !isOpera && !isMobile && document && document.firstElementChild && document.body) { - if (false) - { - // этот код - рабочий, но только если этот ифрейм открыт на весь размер браузера - // (window.outerWidth и window.innerWidth зависимы) - if (window.innerWidth > 300) - me.zoom = window.outerWidth / window.innerWidth; - - if (Math.abs(me.zoom - 1) < 0.1) - me.zoom = 1; - - me.zoom = window.outerWidth / window.innerWidth; - - var _devicePixelRatio = window.devicePixelRatio / me.zoom; - - // device pixel ratio: кратно 0.5 - _devicePixelRatio = (5 * (((2.5 + 10 * _devicePixelRatio) / 5) >> 0)) / 10; - me.zoom = window.devicePixelRatio / _devicePixelRatio; - - // chrome 54.x: zoom = "reset" - clear retina zoom (windows) - //document.firstElementChild.style.zoom = "reset"; - document.firstElementChild.style.zoom = 1.0 / me.zoom; - } - else - { - // делаем простую проверку - // считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio; - // считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio; - if (window.devicePixelRatio > 0.1) - { - if (window.devicePixelRatio < 1.99) - { - var _devicePixelRatio = 1; - me.zoom = window.devicePixelRatio / _devicePixelRatio; - } - else - { - var _devicePixelRatio = 2; - me.zoom = window.devicePixelRatio / _devicePixelRatio; - } - // chrome 54.x: zoom = "reset" - clear retina zoom (windows) - //document.firstElementChild.style.zoom = "reset"; - document.firstElementChild.style.zoom = 1.0 / me.zoom; - } - else - document.firstElementChild.style.zoom = "normal"; - } + // делаем простую проверку + // считаем: 0 < window.devicePixelRatio < 2 => _devicePixelRatio = 1; zoom = window.devicePixelRatio / _devicePixelRatio; + // считаем: window.devicePixelRatio >= 2 => _devicePixelRatio = 2; zoom = window.devicePixelRatio / _devicePixelRatio; + if (window.devicePixelRatio > 0.1) + { + if (window.devicePixelRatio < 1.99) + { + var _devicePixelRatio = 1; + me.zoom = window.devicePixelRatio / _devicePixelRatio; + } + else + { + var _devicePixelRatio = 2; + me.zoom = window.devicePixelRatio / _devicePixelRatio; + } + // chrome 54.x: zoom = "reset" - clear retina zoom (windows) + //document.firstElementChild.style.zoom = "reset"; + document.firstElementChild.style.zoom = 1.0 / me.zoom; + } + else + document.firstElementChild.style.zoom = "normal"; } me.innerWidth = window.innerWidth * me.zoom; me.innerHeight = window.innerHeight * me.zoom;