From e7d08c0e5d94c7300d478cac2423bb66a0c22153 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 1 Feb 2018 17:12:23 +0300 Subject: [PATCH 001/391] unlocked zoom --- apps/documenteditor/main/app/controller/Main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index f1e71bd65..d810393e1 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -962,6 +962,8 @@ define([ Common.NotificationCenter.trigger('document:ready', 'main'); me.applyLicense(); + + $(window).off('resize'); } }, 50); } else { From 1497eae9d2529995e42effdf1f275d156d1b5e2a Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 1 Feb 2018 17:14:11 +0300 Subject: [PATCH 002/391] zomm step changed to 50% --- apps/common/main/lib/util/utils.js | 31 +++++++++---------- .../main/app/controller/Main.js | 1 + 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index b30f674dc..a2a746a34 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -108,31 +108,26 @@ Common.Utils = _.extend(new(function() { 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 && !isMobile && document && document.firstElementChild && document.body) - { + me.zoom = 1; + if (isChrome && !isOpera && !isMobile && document && document.firstElementChild && document.body) { // делаем простую проверку // считаем: 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; + if (window.devicePixelRatio > 0.1) { + var _fraction = window.devicePixelRatio % 1; + var _devicePixelRatio = Math.floor(window.devicePixelRatio); + + if ( !(_fraction < .5) ) { + _devicePixelRatio += .5; } - else - { - var _devicePixelRatio = 2; - me.zoom = window.devicePixelRatio / _devicePixelRatio; - } - // chrome 54.x: zoom = "reset" - clear retina zoom (windows) - //document.firstElementChild.style.zoom = "reset"; + + me.zoom = window.devicePixelRatio / _devicePixelRatio; 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; }; @@ -143,6 +138,8 @@ Common.Utils = _.extend(new(function() { $(window).on('resize', checkSize); return { + checkSize: checkSize, + userAgent: userAgent, isStrict: isStrict, isIEQuirks: isIE && (!isStrict && (isIE6 || isIE7 || isIE8 || isIE9)), diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index d810393e1..9e8bac347 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -964,6 +964,7 @@ define([ me.applyLicense(); $(window).off('resize'); + $(window).on('resize', Common.Utils.checkSize); } }, 50); } else { From e2f86ace350e47754e61cad3d32c1b52597416e9 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 1 Feb 2018 17:15:56 +0300 Subject: [PATCH 003/391] in button added icon for 150% of zoom --- apps/common/main/lib/component/Button.js | 3 +- apps/common/main/lib/view/Header.js | 5 ++- .../main/resources/img/header/buttons150.svg | 24 +++++++++++ apps/common/main/resources/less/buttons.less | 40 +++++++++++++++++++ apps/documenteditor/main/index.html | 1 + 5 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 apps/common/main/resources/img/header/buttons150.svg diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js index e55b50942..57cfac85d 100644 --- a/apps/common/main/lib/component/Button.js +++ b/apps/common/main/lib/component/Button.js @@ -190,7 +190,8 @@ define([ // '<% if (iconCls != "") { print(\' \'); }} %>', '<% if (iconCls != "") { ' + ' if (/svgicon/.test(iconCls)) {' + - 'print(\'\');' + + 'print(\'' + + '\');' + '} else ' + 'print(\' \'); ' + '}} %>', diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 792c70ff7..0ce0f489e 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -83,7 +83,10 @@ define([ // '' + '