From c8176c94dc6c0e466a6298fa5d8b096b74222124 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Fri, 2 Dec 2016 14:06:27 +0300 Subject: [PATCH 1/8] 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/8] 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/8] 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/8] [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/8] 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/8] 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 747d24cbd71b22e36f6dbe8c3f56be4fa5601c85 Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Wed, 7 Dec 2016 13:00:05 +0300 Subject: [PATCH 7/8] 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 8/8] 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;