[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js loleaflet/src
loleaflet/js/w2ui-1.5.rc1.js |4 ++-- loleaflet/src/control/Control.FormulaBar.js |3 ++- loleaflet/src/control/Control.MobileBottomBar.js |2 +- loleaflet/src/control/Control.MobileTopBar.js|2 +- loleaflet/src/control/Control.PresentationBar.js |3 ++- loleaflet/src/control/Control.SearchBar.js |2 +- loleaflet/src/control/Control.SheetsBar.js |3 ++- loleaflet/src/control/Control.SigningBar.js |3 ++- loleaflet/src/control/Control.StatusBar.js |3 +-- loleaflet/src/control/Control.TopToolbar.js |2 +- 10 files changed, 15 insertions(+), 12 deletions(-) New commits: commit 8a2debcc18dfbf9bffe98eb075357bffb4d54d9b Author: Pranam Lashkari AuthorDate: Wed Sep 9 01:30:07 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 9 14:19:16 2020 +0200 leaflet: replaced w2ui tooltip with jquery tooltip makes UI more consistent with notebookbar some tooltip used to go out of screen on edges Change-Id: I306591146c21cc9d4f2d92361f411628a91f3d89 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102294 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/js/w2ui-1.5.rc1.js b/loleaflet/js/w2ui-1.5.rc1.js index 4ff42eed2..c9cee36e8 100644 --- a/loleaflet/js/w2ui-1.5.rc1.js +++ b/loleaflet/js/w2ui-1.5.rc1.js @@ -6067,7 +6067,7 @@ w2utils.event = { html += ''; } else { html += ''+ +'class="'+ (it.disabled ? 'disabled' : '') +'" valign="middle" title="'+ (it.hint ? it.hint : "") + '">' ''; } } @@ -6193,7 +6193,7 @@ w2utils.event = { var html = ''; if (item.caption != null && item.text == null) item.text = item.caption; // for backward compatibility if (item.text == null) item.text = ''; -if (item.tooltip == null && item.hint != null) item.tooltip = item.hint; // for backward compatibility + if (item.tooltip == null) item.tooltip = ''; var img = ' '; var text = item.text; diff --git a/loleaflet/src/control/Control.FormulaBar.js b/loleaflet/src/control/Control.FormulaBar.js index 60fd848d9..b58353d82 100644 --- a/loleaflet/src/control/Control.FormulaBar.js +++ b/loleaflet/src/control/Control.FormulaBar.js @@ -26,7 +26,6 @@ L.Control.FormulaBar = L.Control.extend({ var toolbar = $('#formulabar'); toolbar.w2toolbar({ name: 'formulabar', - tooltip: 'bottom', hidden: true, items: [ {type: 'html', id: 'left'}, @@ -43,6 +42,8 @@ L.Control.FormulaBar = L.Control.extend({ $('#addressInput').off('keyup', that.onAddressInput.bind(that)).on('keyup', that.onAddressInput.bind(that)); } }); + toolbar.tooltip(); + toolbar.bind('touchstart', function(e) { w2ui['formulabar'].touchStarted = true; var touchEvent = e.originalEvent; diff --git a/loleaflet/src/control/Control.MobileBottomBar.js b/loleaflet/src/control/Control.MobileBottomBar.js index 340e8d1ab..be3dd0062 100644 --- a/loleaflet/src/control/Control.MobileBottomBar.js +++ b/loleaflet/src/control/Control.MobileBottomBar.js @@ -109,7 +109,6 @@ L.Control.MobileBottomBar = L.Control.extend({ var toolbar = $('#toolbar-down'); toolbar.w2toolbar({ name: 'editbar', - tooltip: 'top', items: toolItems, onClick: function (e) { // use global handler @@ -124,6 +123,7 @@ L.Control.MobileBottomBar = L.Control.extend({ window.insertShapes(); } }); + toolbar.bind('touchstart', function(e) { w2ui['editbar'].touchStarted = true; var touchEvent = e.originalEvent; diff --git a/loleaflet/src/control/Control.MobileTopBar.js b/loleaflet/src/control/Control.MobileTopBar.js index d7f259893..b562c0153 100644 --- a/loleaflet/src/control/Control.MobileTopBar.js +++ b/loleaflet/src/control/Control.MobileTopBar.js @@ -71,13 +71,13 @@ L.Control.MobileTopBar = L.Control.extend({ var toolbar = $('#toolbar-up'); toolbar.w2toolbar({ name: 'actionbar', - tooltip: 'bottom', items: toolItems, onClick: function (e) { that.onClick(e, e.target); window.hideTooltip(this, e.target); }
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js
loleaflet/js/w2ui-1.5.rc1.js |1 + 1 file changed, 1 insertion(+) New commits: commit 16c743d61044224aa521e1428beda2703030 Author: gokaysatir AuthorDate: Sat Jul 11 14:35:26 2020 +0300 Commit: Aron Budea CommitDate: Tue Aug 11 22:59:40 2020 +0200 loleaflet: Hide w2ui tooltips on mobile. Change-Id: Iaf57e6f53fbc363e22ac1c11de0eb657d492edd3 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98558 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro (cherry picked from commit 9aae80518d23dab3dbd8fdc9369b61d70798ea67) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100364 Reviewed-by: Aron Budea diff --git a/loleaflet/js/w2ui-1.5.rc1.js b/loleaflet/js/w2ui-1.5.rc1.js index 533941987..4ff42eed2 100644 --- a/loleaflet/js/w2ui-1.5.rc1.js +++ b/loleaflet/js/w2ui-1.5.rc1.js @@ -6266,6 +6266,7 @@ w2utils.event = { }, tooltipShow: function (id, event, forceRefresh) { +if (window.mode.isMobile()) { return; } if (window.ThisIsTheiOSApp) return; if (this.tooltip == null) return; var $el = $(this.box).find('#tb_'+ this.name + '_item_'+ w2utils.escapeId(id)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js
loleaflet/js/global.js |9 - 1 file changed, 4 insertions(+), 5 deletions(-) New commits: commit 3aa7bec6665565a41595ec14374af079f2df9fc4 Author: Jan Holesovsky AuthorDate: Fri Aug 7 13:49:32 2020 +0200 Commit: Jan Holesovsky CommitDate: Fri Aug 7 15:08:55 2020 +0200 android: Chromebook is not a touch device, avoid using Hammer there. This fixes the mouse wheel - now it works on the chromebooks. Change-Id: I5bf2a7e1ae397ef171221ac58172940bb43cbb3c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100310 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index c1397ee99..8f5c53c0f 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -34,8 +34,10 @@ gecko3d = 'MozPerspective' in doc.style, opera12 = 'OTransition' in doc.style; + var chromebook = window.ThisIsTheAndroidApp && window.LOOLMessageHandler.isChromeOS(); + var touch = !window.L_NO_TOUCH && (pointer || 'ontouchstart' in window || - (window.DocumentTouch && document instanceof window.DocumentTouch)); + (window.DocumentTouch && document instanceof window.DocumentTouch)) && !chromebook; var isInternetExplorer = (navigator.userAgent.toLowerCase().indexOf('msie') != -1 || navigator.userAgent.toLowerCase().indexOf('trident') != -1); @@ -160,10 +162,7 @@ global.mode = { isChromebook: function() { - if (!window.ThisIsTheAndroidApp) - return false; - - return window.LOOLMessageHandler.isChromeOS(); + return chromebook; }, // Here "mobile" means "mobile phone" (at least for now). Has to match small screen size // requirement. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js loleaflet/src
loleaflet/js/global.js | 23 --- loleaflet/src/core/LOUtil.js |9 - 2 files changed, 16 insertions(+), 16 deletions(-) New commits: commit 41c21563a2a4edbdb9d6cdb2a75b6717dee760a5 Author: Henry Castro AuthorDate: Mon Jul 27 10:04:07 2020 -0400 Commit: Aron Budea CommitDate: Wed Jul 29 01:06:24 2020 +0200 loleaflet: move constant parameters to global initialization This should be initialized when html is loading Change-Id: Ief99d3a613ddaa86caaf5285795a97e3f56787b5 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99511 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99566 Reviewed-by: Aron Budea diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index 619bb91db..c1397ee99 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -2,6 +2,13 @@ /* global Uint8Array */ (function (global) { + global.getParameterByName = function (name) { + name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); + var regex = new RegExp('[\\?&]' + name + '=([^]*)'); + var results = regex.exec(location.search); + return results === null ? '' : results[1].replace(/\+/g, ' '); + }; + var ua = navigator.userAgent.toLowerCase(), uv = navigator.vendor.toLowerCase(), doc = document.documentElement, @@ -34,6 +41,15 @@ navigator.userAgent.toLowerCase().indexOf('trident') != -1); global.L = {}; + + global.L.Params = { + /// Shows close button if non-zero value provided + closeButtonEnabled: global.getParameterByName('closebutton'), + + /// Shows revision history file menu option + revHistoryEnabled: global.getParameterByName('revisionhistory'), + }; + global.L.Browser = { // @property ie: Boolean @@ -682,13 +698,6 @@ } }; - global.getParameterByName = function (name) { - name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); - var regex = new RegExp('[\\?&]' + name + '=([^]*)'); - var results = regex.exec(location.search); - return results === null ? '' : results[1].replace(/\+/g, ' '); - }; - global._ = function (string) { // In the mobile app case we can't use the stuff from l10n-for-node, as that assumes HTTP. if (window.ThisIsAMobileApp) { diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js index 617d66433..27aec995a 100644 --- a/loleaflet/src/core/LOUtil.js +++ b/loleaflet/src/core/LOUtil.js @@ -1,5 +1,4 @@ /* -*- js-indent-level: 8 -*- */ -/* global getParameterByName */ /* * L.LOUtil contains various LO related utility functions used throughout the code */ @@ -162,11 +161,3 @@ L.LOUtil = { return -1; } }; - -L.Params = { - /// Shows close button if non-zero value provided - closeButtonEnabled: getParameterByName('closebutton'), - - /// Shows revision history file menu option - revHistoryEnabled: getParameterByName('revisionhistory'), -}; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js
loleaflet/js/global.js | 35 +++ 1 file changed, 23 insertions(+), 12 deletions(-) New commits: commit d49e05cde9a057712ad469e82079ce9ffb45e988 Author: mert AuthorDate: Wed Jun 24 19:39:32 2020 +0300 Commit: Andras Timar CommitDate: Thu Jun 25 15:36:57 2020 +0200 Fix url errors on backgroundImage in css files for proxy Current replacing url strings method works fine, however, it does not cover all the rules for cases like when @media or @import are used. They have a subset of their own rules which must be covered as well. Change-Id: Ib10f7cc361aea5cd3b855f64e3a64566a6c51a12 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97060 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index 6a0bd23df..5e0007d43 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -571,20 +571,16 @@ { // re-write relative URLs in CSS - somewhat grim. window.addEventListener('load', function() { - var sheets = document.styleSheets; - for (var i = 0; i < sheets.length; ++i) { - var relBases = sheets[i].href.split('/'); - relBases.pop(); // bin last - css name. - var replaceBase = 'url("' + relBases.join('/') + '/images/'; + var replaceUrls = function(rules, replaceBase) { + if (!rules) + return; - var rules; - try { - rules = sheets[i].cssRules || sheets[i].rules; - } catch (err) { - console.log('Missing CSS from ' + sheets[i].href); - continue; - } for (var r = 0; r < rules.length; ++r) { + // check subset of rules like @media or @import + if (rules[r] && rules[r].type != 1) { + replaceUrls(rules[r].cssRules || rules[r].rules, replaceBase); + continue; + } if (!rules[r] || !rules[r].style) continue; var img = rules[r].style.backgroundImage; @@ -596,6 +592,21 @@ img.replace('url("images/', replaceBase); } } + }; + var sheets = document.styleSheets; + for (var i = 0; i < sheets.length; ++i) { + var relBases = sheets[i].href.split('/'); + relBases.pop(); // bin last - css name. + var replaceBase = 'url("' + relBases.join('/') + '/images/'; + + var rules; + try { + rules = sheets[i].cssRules || sheets[i].rules; + } catch (err) { + console.log('Missing CSS from ' + sheets[i].href); + continue; + } + replaceUrls(rules, replaceBase); } }, false); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js
loleaflet/js/global.js | 33 - 1 file changed, 20 insertions(+), 13 deletions(-) New commits: commit f05c794b321da38eef62c8501d6523673918cac0 Author: Michael Meeks AuthorDate: Tue Jun 9 11:29:11 2020 +0100 Commit: Andras Timar CommitDate: Wed Jun 10 16:40:14 2020 +0200 Proxy: detect un-responsive sockets & close after 30secs. Also: + fix double poll timer in error + remove & rename incorrect interval timer names Change-Id: Idfae44c0a388312b248c78fc9ad04fe3725990b6 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95910 Tested-by: Jenkins Reviewed-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96007 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index c6590389b..6a0bd23df 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -350,14 +350,16 @@ }; this.sendQueue = ''; this._signalErrorClose = function() { + clearInterval(this.pollInterval); + clearTimeout(this.delaySession); + this.pollInterval = undefined; + this.delaySession = undefined; + if (that.readyState < 3) { this.onerror(); this.onclose(); } - clearInterval(this.waitInterval); - clearTimeout(this.delaySession); - this.waitInterval = undefined; this.sessionId = 'open'; this.inSerial = 0; this.outSerial = 0; @@ -365,9 +367,14 @@ this.openInflight = 0; this.readyState = 3; // CLOSED }; + // For those who think that long-running sockets are a + // better way to wait: you're so right. However, each + // consumes a scarce server worker thread while it waits, + // so ... back in the real world: this._setPollInterval = function(intervalMs) { - clearInterval(that.pollInterval); - that.pollInterval = setInterval(that.doSend, intervalMs); + clearInterval(this.pollInterval); + if (this.readyState === 1) + this.pollInterval = setInterval(this.doSend, intervalMs); }, this.doSend = function () { if (that.sessionId === 'open') @@ -388,6 +395,11 @@ console.debug('High latency connection - too much in-flight, throttling to ' + that.curPollMs + ' ms.'); that._setPollInterval(that.curPollMs); } + else if (performance.now() - that.lastDataTimestamp > 30 * 1000) + { + console.debug('Close connection after no response for 30secs'); + that._signalErrorClose(); + } else console.debug('High latency connection - too much in-flight, pausing.'); return; @@ -490,12 +502,7 @@ that.sessionId = this.responseText; that.readyState = 1; that.onopen(); - - // For those who think that long-running sockets are a - // better way to wait: you're so right. However, each - // consumes a scarce server worker thread while it waits, - // so ... back in the real world: - that.pollInterval = setInterval(that.doSend, that.curPollMs); + that._setPollInterval(that.curPollMs); } }); req.addEventListener('loadend', function() { @@ -540,9 +547,9 @@ console.debug('proxy: close socket'); this.readyState = 3; this.onclose(); - clearInterval(this.waitInterval); + clearInterval(this.pollInterval); clearTimeout(this.delaySession); - this.waitInterval = undefined; + this.pollInterval = undefined; if (oldState === 1) // was open this.sendClose
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js
loleaflet/js/global.js | 35 --- 1 file changed, 16 insertions(+), 19 deletions(-) New commits: commit 95fae63098d42a28e559c39ca79021a079cd7b57 Author: Michael Meeks AuthorDate: Tue Jun 9 10:44:30 2020 +0100 Commit: Andras Timar CommitDate: Tue Jun 9 14:27:03 2020 +0200 Proxy: don't implement a magic re-connecting socket. Websockets don't magically re-connect, so we shouldn't either. Also avoid starting our send interval timer until we've opened to simplify. Change-Id: Id71049da2d4b4d0ac2f38a3d7410f2446d04f0b1 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95906 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Michael Meeks (cherry picked from commit 19b544477e3f425fb55ca6e51be255860c6b13b1) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95885 Reviewed-by: Andras Timar diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index 0cafa649c..c6590389b 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -354,15 +354,15 @@ { this.onerror(); this.onclose(); - clearInterval(this.waitInterval); - clearTimeout(this.delaySession); - this.waitInterval = undefined; - this.sessionId = 'open'; - this.inSerial = 0; - this.outSerial = 0; - this.msgInflight = 0; - this.openInflight = 0; } + clearInterval(this.waitInterval); + clearTimeout(this.delaySession); + this.waitInterval = undefined; + this.sessionId = 'open'; + this.inSerial = 0; + this.outSerial = 0; + this.msgInflight = 0; + this.openInflight = 0; this.readyState = 3; // CLOSED }; this._setPollInterval = function(intervalMs) { @@ -373,10 +373,7 @@ if (that.sessionId === 'open') { if (that.readyState === 3) - { - console.debug('Session closed, opening a new one.'); - that.getSessionId(); - } + console.debug('Error: sending on closed socket'); return; } @@ -488,11 +485,17 @@ console.debug('Error: failed to fetch session id! error: ' + this.status); that._signalErrorClose(); } - else + else // we connected - lets get going ... { that.sessionId = this.responseText; that.readyState = 1; that.onopen(); + + // For those who think that long-running sockets are a + // better way to wait: you're so right. However, each + // consumes a scarce server worker thread while it waits, + // so ... back in the real world: + that.pollInterval = setInterval(that.doSend, that.curPollMs); } }); req.addEventListener('loadend', function() { @@ -555,12 +558,6 @@ // queue fetch of session id. this.getSessionId(); - - // For those who think that long-running sockets are a - // better way to wait: you're so right. However, each - // consumes a scarce server worker thread while it waits, - // so ... back in the real world: - this.pollInterval = setInterval(this.doSend, this.curPollMs); }; if (global.socketProxy) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits