[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Parts.js |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit d906bc19569dc14df6c693a4af3306ce87dc6b43 Author: gokaysatir AuthorDate: Mon Sep 28 12:29:37 2020 +0300 Commit: Andras Timar CommitDate: Wed Sep 30 21:51:02 2020 +0200 Loleaflet Calc: Add language support for "show sheet" buttons. Change-Id: I2e2fc8095be659b02ba9fb479e7159b9ec0af66e Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103540 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103731 diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js index 39a69fbd4..f654dc85f 100644 --- a/loleaflet/src/control/Parts.js +++ b/loleaflet/src/control/Parts.js @@ -3,7 +3,7 @@ * Document parts switching and selecting handler */ -/* global vex */ +/* global vex $ _ */ L.Map.include({ setPart: function (part, external, calledFromSetPartHandler) { @@ -369,8 +369,12 @@ L.Map.include({ } var socket_ = this._socket; - vex.dialog.confirm({ + vex.dialog.open({ unsafeMessage: container.outerHTML, + buttons: [ + $.extend({}, vex.dialog.buttons.NO, { text: _('Cancel') }), + $.extend({}, vex.dialog.buttons.YES, { text: _('OK') }) + ], callback: function (value) { if (value === true) { var checkboxList = document.querySelectorAll('input[id^="hidden-part-checkbox"]'); ___ 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/src
loleaflet/src/layer/tile/ImpressTileLayer.js |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit a28ea4a561c9b9a4f0b58b5b311de60c766d6f47 Author: Pranam Lashkari AuthorDate: Sat Sep 26 18:30:53 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 30 14:20:42 2020 +0200 leaflet: prevent updating parts in impress when vex is open Change-Id: Ia4b5688e277fe3a663ffdf3cd387aa0320ed1257 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103428 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index aa2cdcd3c..9023a0326 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -3,7 +3,7 @@ * Impress tile layer is used to display a presentation document */ -/* global $ L */ +/* global $ L isAnyVexDialogActive */ L.ImpressTileLayer = L.TileLayer.extend({ extraSize: L.point(290, 0), @@ -250,6 +250,8 @@ L.ImpressTileLayer = L.TileLayer.extend({ }, onUpdateParts: function () { + if (isAnyVexDialogActive()) // Need this check else vex loses focus + return; if (typeof this._prevSelectedPart === 'number') { this.hideAnnotations(this._prevSelectedPart); if (this.hasAnnotations(this._selectedPart)) { ___ 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/src
loleaflet/src/layer/marker/Cursor.js |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 310db08d0a7b25f5897af2b483d03d863924495a Author: Pranam Lashkari AuthorDate: Fri Sep 25 19:02:22 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 30 14:20:14 2020 +0200 leaflet: stop chaging mouse cursor when new view opend Problem: Open a spreadsheet in two views at the same time In the view opened the first, mouse pointer changes to caret placement icon. Change-Id: I33db0dbff4bd6229615d75892c7d1c23c9f39e7c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103339 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/marker/Cursor.js b/loleaflet/src/layer/marker/Cursor.js index 348356fc1..a164e3f9f 100644 --- a/loleaflet/src/layer/marker/Cursor.js +++ b/loleaflet/src/layer/marker/Cursor.js @@ -23,7 +23,8 @@ L.Cursor = L.Layer.extend({ if (!this._container) { this._initLayout(); } - $('.leaflet-pane.leaflet-map-pane').css('cursor', 'text'); + if (this._container.querySelector('.blinking-cursor') !== null) + $('.leaflet-pane.leaflet-map-pane').css('cursor', 'text'); this._zoomAnimated = this._zoomAnimated && this.options.zoomAnimation; if (this._zoomAnimated) { L.DomUtil.addClass(this._container, 'leaflet-zoom-animated'); ___ 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/src
loleaflet/src/control/Control.LokDialog.js |5 + 1 file changed, 5 insertions(+) New commits: commit 1abe1ff7481e8b30d0fc3307e1a73f83bcc6 Author: Szymon Kłos AuthorDate: Wed Sep 30 13:13:42 2020 +0200 Commit: Andras Timar CommitDate: Wed Sep 30 14:19:44 2020 +0200 Use correct position for sidebar tooltips Remove leftovers after old tooltips Change-Id: I935285150ed35c922fbcddbe7ff3af9a7c07fd34 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103682 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index af72bdfb4..279bf1720 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -377,6 +377,7 @@ L.Control.LokDialog = L.Control.extend({ if (parent) { // this is a floating window if (e.rectangle && this._dialogs[parent].childistooltip === true) { // resize tooltips on invalidation + this._removeDialogChild(parent); left = this._dialogs[parent].childx; top = this._dialogs[parent].childy; width = parseInt(e.rectangle.split(',')[2]); @@ -1674,11 +1675,15 @@ L.Control.LokDialog = L.Control.extend({ $('#' + dialogId).height(canvasHeight + 'px'); } this._dialogs[dialogId].childid = undefined; + this._dialogs[dialogId].childx = undefined; + this._dialogs[dialogId].childy = undefined; }, _removeDialogChild: function(id) { $('#' + this._toStrId(id) + '-floating').remove(); this._dialogs[id].childid = undefined; + this._dialogs[id].childx = undefined; + this._dialogs[id].childy = undefined; }, _createDialogChild: function(childId, parentId, top, left) { ___ 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/src
loleaflet/src/control/Control.StatusBar.js | 31 ++--- 1 file changed, 15 insertions(+), 16 deletions(-) New commits: commit 8d4dfb49a7d1468887b80fdbe8e2bc50c9f18c9d Author: Pranam Lashkari AuthorDate: Tue Sep 29 23:14:56 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 30 14:18:45 2020 +0200 leaflet: translate: fix language list localisation Change-Id: Ie505b91e2b5b212351a33a4751ee5889a6cb10f1 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103633 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.StatusBar.js b/loleaflet/src/control/Control.StatusBar.js index fd0b9b0aa..0e830c669 100644 --- a/loleaflet/src/control/Control.StatusBar.js +++ b/loleaflet/src/control/Control.StatusBar.js @@ -65,10 +65,10 @@ L.Control.StatusBar = L.Control.extend({ _updateVisibilityForToolbar: function(toolbar) { if (!toolbar) return; - + var toShow = []; var toHide = []; - + toolbar.items.forEach(function(item) { if (window.ThisIsTheiOSApp && window.mode.isTablet() && item.iosapptablet === false) { toHide.push(item.id); @@ -80,10 +80,10 @@ L.Control.StatusBar = L.Control.extend({ toShow.push(item.id); } }); - + console.log('explicitly hiding: ' + toHide); console.log('explicitly showing: ' + toShow); - + toHide.forEach(function(item) { toolbar.hide(item); }); toShow.forEach(function(item) { toolbar.show(item); }); }, @@ -287,7 +287,7 @@ L.Control.StatusBar = L.Control.extend({ case 'spreadsheet': if (statusbar) statusbar.remove('prev', 'next', 'prevnextbreak'); - + if (!window.mode.isMobile()) { statusbar.insert('left', [ {type: 'break', id: 'break1'}, @@ -383,7 +383,7 @@ L.Control.StatusBar = L.Control.extend({ {type: 'break', id: 'break8', mobile: false} ]); } - + // FALLTHROUGH intended case 'drawing': if (statusbar) @@ -412,7 +412,7 @@ L.Control.StatusBar = L.Control.extend({ // odd, but on mobile we need to invoke it twice toolbar.hide('cancelsearch'); } - + this.map._onGotFocus(); }, @@ -445,7 +445,7 @@ L.Control.StatusBar = L.Control.extend({ } else if (commandName === '.uno:InsertMode') { this.updateToolbarItem(statusbar, 'InsertMode', $('#InsertMode').html(state ? L.Styles.insertMode[state].toLocaleString() : ' Insert mode: inactive ').parent().html()); - + if (!state && this.map.hyperlinkPopup) { this.map.hyperlinkUnderCursor = null; this.map.closePopup(this.map.hyperlinkPopup); @@ -498,28 +498,27 @@ L.Control.StatusBar = L.Control.extend({ var noneLang = _('None (Do not check spelling)'); var languages = []; e.commandValues.forEach(function (language) { - languages.push({ translated: _(language), neutral: language }); + languages.push({ translated: _(language.split(';')[0]), neutral: language }); }); languages.sort(function (a, b) { return a.translated < b.translated ? -1 : a.translated > b.translated ? 1 : 0; }); - + var toolbaritems = []; toolbaritems.push({ text: noneLang, id: 'nonelanguage', uno: constLang + constNone }); - - + + for (var lang in languages) { translated = languages[lang].translated; neutral = languages[lang].neutral; - var splitTranslated = translated.split(';'); var splitNeutral = neutral.split(';'); - toolbaritems.push({ id: neutral, text: splitTranslated[0], uno: constLang + encodeURIComponent('Default_' + splitNeutral[0]) }); + toolbaritems.push({ id: neutral, text: translated, uno: constLang + encodeURIComponent('Default_' + splitNeutral[0]) }); } - +
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Permission.js |3 +++ loleaflet/src/map/Map.js|3 +++ 2 files changed, 6 insertions(+) New commits: commit 21ef608f6d47b34cf5fc70072e74cec4986a5bba Author: Tor Lillqvist AuthorDate: Mon Sep 28 12:58:13 2020 +0300 Commit: Tor Lillqvist CommitDate: Mon Sep 28 14:18:49 2020 +0200 tdf#136459: Show the spreadsheet formula input bar when switching to edit mode Factor out a code snippet from L.Map._onResize() into a function called showCalcInputBar(). Call that (in the iOS app in iPad case, which is what the bug is about) from L.Map._enterEditMode(). Seems to work. No idea if this is the ideal solution. Change-Id: I29677201212b37ebb292591b217741d8301dfa15 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103542 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/loleaflet/src/control/Permission.js b/loleaflet/src/control/Permission.js index 16ffe7742..57785cdcf 100644 --- a/loleaflet/src/control/Permission.js +++ b/loleaflet/src/control/Permission.js @@ -100,6 +100,9 @@ L.Map.include({ this.setZoom(10); } + if (window.ThisIsTheiOSApp && window.mode.isTablet() && this._docLayer._docType === 'spreadsheet') + this.showCalcInputBar(0); + if (window.ThisIsTheAndroidApp) window.postMobileMessage('EDITMODE on'); }, diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 1a0e1e988..fc0dc3634 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -1190,7 +1190,10 @@ L.Map = L.Evented.extend({ } } } + this.showCalcInputBar(deckOffset); + }, + showCalcInputBar: function(deckOffset) { if (this.dialog._calcInputBar && !this.dialog._calcInputBar.isPainting) { var id = this.dialog._calcInputBar.id; var calcInputbar = L.DomUtil.get('calc-inputbar'); ___ 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/src
loleaflet/src/control/Parts.js | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) New commits: commit c3aa6eaa5c9a677ee366b4df9f30ec5a584a5c86 Author: gokaysatir AuthorDate: Wed Sep 23 17:10:56 2020 +0300 Commit: Andras Timar CommitDate: Fri Sep 25 17:22:05 2020 +0200 Loleaflet: Show sheet feature is enabled also for mobile. Change-Id: I60dd7354ee5e54c00e8ea78f93d15b34ab5c1fda Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103259 Tested-by: Jenkins CollaboraOffice Tested-by: Henry Castro Reviewed-by: Henry Castro (cherry picked from commit b8025ec431226fe3a3d19ec46b660978edf2c1b9) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103334 Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js index fb75fe293..39a69fbd4 100644 --- a/loleaflet/src/control/Parts.js +++ b/loleaflet/src/control/Parts.js @@ -2,6 +2,9 @@ /* * Document parts switching and selecting handler */ + +/* global vex */ + L.Map.include({ setPart: function (part, external, calledFromSetPartHandler) { var docLayer = this._docLayer; @@ -344,7 +347,43 @@ L.Map.include({ showPage: function () { if (this.getDocType() === 'spreadsheet' && this.hasAnyHiddenPart()) { - this._socket.sendMessage('uno .uno:Show'); + var partNames_ = this._docLayer._partNames; + var hiddenParts_ = this._docLayer._hiddenParts; + + if (hiddenParts_.length > 0) { + var container = document.createElement('div'); + container.style.maxHeight = '300px'; + container.style.maxWidth = '200px'; + for (var i = 0; i < hiddenParts_.length; i++) { + var checkbox = document.createElement('input'); + checkbox.type = 'checkbox'; + checkbox.id = 'hidden-part-checkbox-' + String(hiddenParts_[i]); + var label = document.createElement('label'); + label.htmlFor = 'hidden-part-checkbox-' + String(hiddenParts_[i]); + label.innerText = partNames_[hiddenParts_[i]]; + var newLine = document.createElement('br'); + container.appendChild(checkbox); + container.appendChild(label); + container.appendChild(newLine); + } + } + + var socket_ = this._socket; + vex.dialog.confirm({ + unsafeMessage: container.outerHTML, + callback: function (value) { + if (value === true) { + var checkboxList = document.querySelectorAll('input[id^="hidden-part-checkbox"]'); + for (var i = 0; i < checkboxList.length; i++) { + if (checkboxList[i].checked === true) { + var partName_ = partNames_[parseInt(checkboxList[i].id.replace('hidden-part-checkbox-', ''))]; + var argument = {aTableName: {type: 'string', value: partName_}}; + socket_.sendMessage('uno .uno:Show ' + JSON.stringify(argument)); + } + } + } + } + }); } }, ___ 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/src
loleaflet/src/control/Control.Toolbar.js |3 +++ 1 file changed, 3 insertions(+) New commits: commit b6f754009794d9bcd6858a199b2b3eb09c3a30e0 Author: Tor Lillqvist AuthorDate: Fri Sep 25 15:47:14 2020 +0300 Commit: Tor Lillqvist CommitDate: Fri Sep 25 15:08:09 2020 +0200 tdf#136457: Hide even more things when we are going away shortly anyway Change-Id: Ibc0d7406ef49c19b35be462627fca04ecb84e520 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103396 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 4aae10784..3613b5f46 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -50,6 +50,9 @@ function onClose() { $('#closebuttonwrapper').hide(); $('#main-menu').hide(); $('#document-titlebar').hide(); + $('#sidebar-dock-wrapper').hide(); + $('#presentation-controls-wrapper').hide(); + $('#document-container').hide(); // Then tell the app to delete the web view window.postMobileMessage('BYE'); ___ 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/src
loleaflet/src/control/Control.Toolbar.js |9 + 1 file changed, 9 insertions(+) New commits: commit 32f33328d55fed1abfb0533ecee8496848931ded Author: Tor Lillqvist AuthorDate: Fri Sep 25 12:36:47 2020 +0300 Commit: Tor Lillqvist CommitDate: Fri Sep 25 11:59:56 2020 +0200 tdf#136457: Prevent tapping other UI elements after tapping the closebutton Change-Id: I925cd2d44f40ecca23fb51cbe2d2c6d15ecf9648 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103377 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 3562e57fb..4aae10784 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -43,6 +43,15 @@ function getUNOCommand(unoData) { function onClose() { if (window.ThisIsAMobileApp) { + // Hide stuff to avoid the user (even accidentally) tapping anything else right + // after tapping the closebutton, before the app has torn down the WebView. + // This is a silly workaround to avoid one possible way to reproduce tdf#136457. + $('#toolbar-wrapper').hide(); + $('#closebuttonwrapper').hide(); + $('#main-menu').hide(); + $('#document-titlebar').hide(); + + // Then tell the app to delete the web view window.postMobileMessage('BYE'); } else { map.fire('postMessage', {msgId: 'close', args: {EverModified: map._everModified, Deprecated: true}}); ___ 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/src
loleaflet/src/control/Control.AlertDialog.js |8 1 file changed, 8 insertions(+) New commits: commit bd85bf3a1d488ebc621fdfb9fdc512a1a32f0904 Author: Szymon Kłos AuthorDate: Tue Sep 22 13:38:56 2020 +0200 Commit: Andras Timar CommitDate: Wed Sep 23 18:39:02 2020 +0200 Send HYPERLINK post message when link opened Send only for non-app builds where window.postMobileMessage is not defined. Needed when embedded in webview in "other" iOS app. Change-Id: I17f3b378557ef33579ae932db9cf1718c7a18a7e Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103166 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.AlertDialog.js b/loleaflet/src/control/Control.AlertDialog.js index 8118a30f1..e417f9386 100644 --- a/loleaflet/src/control/Control.AlertDialog.js +++ b/loleaflet/src/control/Control.AlertDialog.js @@ -64,6 +64,14 @@ L.Control.AlertDialog = L.Control.extend({ click: function openClick () { window.open(url, '_blank'); vex.closeAll(); + + if (!window.ThisIsAMobileApp && + window.webkit && + window.webkit.messageHandlers && + window.webkit.messageHandlers.lool && + window.webkit.messageHandlers.lool.postMessage) { + window.webkit.messageHandlers.lool.postMessage('HYPERLINK ' + url); + } } }); } ___ 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/src
loleaflet/src/layer/tile/CalcTileLayer.js |1 + 1 file changed, 1 insertion(+) New commits: commit cf2dc409b4185a33ad6910d288aaf43f2a82a032 Author: Henry Castro AuthorDate: Mon Sep 14 13:37:29 2020 -0400 Commit: Andras Timar CommitDate: Wed Sep 23 17:31:31 2020 +0200 loleaflet: Hide the visibility of the cursor by default When loading a spreadsheet document, the server should send a message to show the cursor appropriately Change-Id: I520a2b21fab903fc6b17ea612bbe1691ef311dbd Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102692 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro (cherry picked from commit 6a70aeaad8c6a01d53f9ebb16b7d7327ebf688a2) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102930 Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 371e344bc..37bbe67f7 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -44,6 +44,7 @@ L.CalcTileLayer = L.TileLayer.extend({ }, beforeAdd: function (map) { + map._isCursorVisible = false; map._addZoomLimit(this); map.on('zoomend', this._onZoomRowColumns, this); map.on('updateparts', this._onUpdateParts, this); ___ 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/src
loleaflet/src/control/Control.LokDialog.js | 11 +++ 1 file changed, 11 insertions(+) New commits: commit 1b2bbb70b888c75111a841495a547372a3c74197 Author: Szymon Kłos AuthorDate: Tue Sep 22 13:05:43 2020 +0200 Commit: Andras Timar CommitDate: Tue Sep 22 20:40:18 2020 +0200 Resize tunneled tooltips on invalidation Prevent us from showing leftovers from previous (longer) tooltip. Change-Id: Ic35238c6a9780c975f90ee76b1c12b92065b4f1b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103162 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 4228f46d7..af72bdfb4 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -375,6 +375,17 @@ L.Control.LokDialog = L.Control.extend({ var parent = this._getParentId(e.id); var rectangle = e.rectangle; if (parent) { // this is a floating window + if (e.rectangle && this._dialogs[parent].childistooltip === true) { + // resize tooltips on invalidation + left = this._dialogs[parent].childx; + top = this._dialogs[parent].childy; + width = parseInt(e.rectangle.split(',')[2]); + height = parseInt(e.rectangle.split(',')[3]); + this._dialogs[parent].childwidth = width; + this._dialogs[parent].childheight = height; + this._createDialogChild(e.id, parent, top, left); + } + rectangle = this._createRectStr(null, 0, 0, this._dialogs[parent].childwidth, this._dialogs[parent].childheight); } else if (rectangle) { // this is the actual dialog if (this._isRectangleValid(rectangle)) { ___ 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/src
loleaflet/src/map/handler/Map.TouchGesture.js | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) New commits: commit 49447ec08c5d3904028e77a0f8f596571ab8a05b Author: mert AuthorDate: Wed Sep 16 17:31:46 2020 +0300 Commit: Andras Timar CommitDate: Mon Sep 21 20:29:08 2020 +0200 Fix pinch gesture causes hammer to stuck on Mobile Change-Id: If0ae311346ae9c9935ebacde3bc5ea874833 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102873 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit c43aeb3e35a99c2f35bb817037d2451dc8731ae5) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103057 diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 677d15dec..cd22175a5 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -53,9 +53,20 @@ L.Map.TouchGesture = L.Handler.extend({ var tripleTap = new Hammer.Tap({event: 'tripletap', taps: 3, posThreshold: posThreshold }); this._hammer.add(tripleTap); tripleTap.recognizeWith([doubleTap, singleTap]); - + var hammer = this._hammer; if (L.Browser.touch) { - L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchend touchcancel', L.DomEvent.preventDefault); + L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchcancel', L.DomEvent.preventDefault); + L.DomEvent.on(this._map._mapPane, 'touchend', function(e) { + // sometimes inputs get stuck in hammer and further events get mixed with the old ones + // this causes to a failure to use all the gestures properly. + // This is a workaround until it is fixed by hammer.js + if (hammer.input) { + if (hammer.input.store) { + hammer.input.store = []; + } + } + L.DomEvent.preventDefault(e); + }); } if (Hammer.prefixed(window, 'PointerEvent') !== undefined) { ___ 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/src
loleaflet/src/control/Control.JSDialogBuilder.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 94adc8682dc99afe8437fa95e82a2ba57694696e Author: Szymon Kłos AuthorDate: Thu Sep 17 13:32:29 2020 +0200 Commit: Andras Timar CommitDate: Mon Sep 21 16:32:32 2020 +0200 jsdialog: send FillColor as number Change-Id: Iab85bd2cc6ab082c368ec2a8669c9ce384305d24 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102921 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index e0b2f17be..7527d0fe5 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1766,7 +1766,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ gradientItem.endcolor = color; builder.map.sendUnoCommand('.uno:FillPageGradient?FillPageGradientJSON:string=' + JSON.stringify(gradientItem)); return; - } else if (data.id === 'Color' || data.id === 'CharBackColor') { + } else if (data.id === 'Color' || data.id === 'CharBackColor' || data.id === 'FillColor') { var params = {}; params[data.id] = { type : 'long', ___ 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/src
loleaflet/src/control/Control.TopToolbar.js | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) New commits: commit 58a9142907a6387389f52168ca24233087dd7f9e Author: Tor Lillqvist AuthorDate: Wed Sep 16 16:04:31 2020 +0300 Commit: Tor Lillqvist CommitDate: Wed Sep 16 15:51:39 2020 +0200 Make the 'modifypage' button work on first tap in iOS app Horrible hack: Could not figure out the root cause, so just pretend the user tapped twice then the first time. This is not intended to fix tdf#136457 though. But it might still have some effect on that whole can of worms. That bug is hard to reproduce or even descibe exactly, so it is hard to say. Change-Id: I147a448cceb0adc25fa5d136d59bfebf91839aaf Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102872 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/loleaflet/src/control/Control.TopToolbar.js b/loleaflet/src/control/Control.TopToolbar.js index 51322b5f8..af271b21f 100644 --- a/loleaflet/src/control/Control.TopToolbar.js +++ b/loleaflet/src/control/Control.TopToolbar.js @@ -1,4 +1,4 @@ -/* -*- js-indent-level: 8 -*- */ +/* -*- js-indent-level: 8; fill-column: 100 -*- */ /* * L.Control.TopToolbar */ @@ -237,6 +237,16 @@ L.Control.TopToolbar = L.Control.extend({ name: 'editbar', items: this.getToolItems(), onClick: function (e) { + if (window.ThisIsTheiOSApp && e.target === 'modifypage' && window.ModifyPageTapped === undefined) { + // Horrible hack. I can't figure out why it needs two taps + // to display initially, so call this an extra time for the + // first tap. And for some reason I need to do it after a + // short timeout. + setTimeout(function() { + window.onClick(e, e.target); + }, 100); + window.ModifyPageTapped = true; + } window.onClick(e, e.target); window.hideTooltip(this, e.target); }, ___ 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/src
loleaflet/src/layer/marker/Annotation.js |6 +-- loleaflet/src/map/handler/Map.TouchGesture.js | 45 -- 2 files changed, 38 insertions(+), 13 deletions(-) New commits: commit 94e461f8248341f9a24de2b2dc7cc48a755a Author: mert AuthorDate: Fri Sep 11 17:05:30 2020 +0300 Commit: Andras Timar CommitDate: Wed Sep 16 09:51:44 2020 +0200 Fix annotation kebab menu brings up keyboard on mobile Also fixed other weirdnesses on touch event with annotation box. It was sending click events to LOK even if we click on annotation box, which is not wanted. Change-Id: Ia43a879c72c22276c482e463fa725ce1c76df911 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102468 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index b5c7f3069..bcf3ab74d 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -203,7 +203,7 @@ L.Annotation = L.Layer.extend({ var tr = L.DomUtil.create('tr', empty, tbody); var tdImg = L.DomUtil.create(tagTd, 'loleaflet-annotation-img', tr); var tdAuthor = L.DomUtil.create(tagTd, 'loleaflet-annotation-author', tr); - var imgAuthor = L.DomUtil.create('img', 'avatar-img', tdImg); + var imgAuthor = L.DomUtil.create('img', 'avatar-img loleaflet-annotation-avatar-img', tdImg); imgAuthor.setAttribute('src', L.LOUtil.getImageURL('user.svg')); imgAuthor.setAttribute('width', this.options.imgSize.x); imgAuthor.setAttribute('height', this.options.imgSize.y); @@ -238,12 +238,12 @@ L.Annotation = L.Layer.extend({ } if (this._data.trackchange) { this._captionNode = L.DomUtil.create(tagDiv, 'loleaflet-annotation-caption', wrapper); - this._captionText = L.DomUtil.create(tagDiv, empty, this._captionNode); + this._captionText = L.DomUtil.create(tagDiv, 'loleaflet-annotation-caption-text', this._captionNode); } this._contentNode = L.DomUtil.create(tagDiv, 'loleaflet-annotation-content loleaflet-dont-break', wrapper); this._nodeModify = L.DomUtil.create(tagDiv, classEdit, wrapper); this._nodeModifyText = L.DomUtil.create(tagTextArea, classTextArea, this._nodeModify); - this._contentText = L.DomUtil.create(tagDiv, empty, this._contentNode); + this._contentText = L.DomUtil.create(tagDiv, 'loleaflet-annotation-content-text', this._contentNode); this._nodeReply = L.DomUtil.create(tagDiv, classEdit, wrapper); this._nodeReplyText = L.DomUtil.create(tagTextArea, classTextArea, this._nodeReply); diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 4257c0212..677d15dec 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -320,20 +320,27 @@ L.Map.TouchGesture = L.Handler.extend({ } this._map.fire('closepopups'); - this._map.fire('editorgotfocus'); var docLayer = this._map._docLayer; - // unselect if anything is selected already - if (docLayer && docLayer._annotations && docLayer._annotations.unselect) { - docLayer._annotations.unselect(); - var pointPx = docLayer._twipsToPixels(mousePos); - var bounds = docLayer._annotations.getBounds(); - if (bounds && bounds.contains(pointPx)) { - // not forward mouse events to core if the user tap on a comment box - // for instance on Writer that causes the text cursor to be moved - return; + if (docLayer && docLayer._annotations) { + var annotationClicked = false; + if (e.target) { + var className = e.target.className; + if (className && typeof className === 'string') { + if (className.indexOf('annotation') >= 0) { + annotationClicked = true; + return; + } + } + } + // unselect if anything is selected already + if (!annotationClicked && docLayer._annotations.unselect) { + docLayer._annotations.unselect(); } } + + t
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/layer/tile/TileLayer.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d0a0950c48ba6c0a00b908eae7af4c53a784d0f2 Author: Pranam Lashkari AuthorDate: Wed Sep 16 11:33:55 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 16 09:44:43 2020 +0200 leaflet: removed resolve thread option from impress Change-Id: I325ff47ea8961056e4fd23aa2c7f8c20113e0166 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102829 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index bb8b905de..c178bdb34 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -253,7 +253,7 @@ L.TileLayer = L.GridLayer.extend({ that.onAnnotationRemove.call(that, options.$trigger.get(0).annotation._data.id); } }, - removeThread: { + removeThread: that._docType !== 'text' ? undefined : { name: _('Remove Thread'), callback: function (key, options) { that.onAnnotationRemoveThread.call(that, options.$trigger.get(0).annotation._data.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/src
loleaflet/src/layer/AnnotationManager.js| 13 loleaflet/src/layer/tile/TileLayer.js | 78 ++-- loleaflet/src/layer/tile/WriterTileLayer.js |4 + 3 files changed, 58 insertions(+), 37 deletions(-) New commits: commit ff86f5240e15039840fcebb3709d12fca25121e8 Author: Pranam Lashkari AuthorDate: Tue Sep 15 16:33:50 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 16 06:39:51 2020 +0200 leaflet: made annotation context menu dynamic now annotation context menu options will be toggled between resolved and unresolved according to its state Change-Id: I477fdf4b77a940a458d320478801283b71ccb73b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102783 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index 3c1198c7a..6d71cd107 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -735,6 +735,19 @@ L.AnnotationManager = L.Class.extend({ this._map.focus(); }, + _isThreadResolved: function(annotation) { + var lastChild = this.getLastChildIndexOf(annotation._data.id); + + while (this._items[lastChild]._data.parent !== '0') { + if (this._items[lastChild]._data.resolved === 'false') + return false; + lastChild = this.getIndexOf(this._items[lastChild]._data.parent); + } + if (this._items[lastChild]._data.resolved === 'false') + return false; + return true; + }, + // Adjust parent-child relationship, if required, after `comment` is added adjustParentAdd: function(comment) { if (comment.parent && comment.parent > '0') { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 0a5cd72b7..bb8b905de 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -232,43 +232,47 @@ L.TileLayer = L.GridLayer.extend({ selector: '.loleaflet-annotation-menu', trigger: 'none', className: 'loleaflet-font', - items: { - modify: { - name: _('Modify'), - callback: function (key, options) { - that.onAnnotationModify.call(that, options.$trigger.get(0).annotation); - } - }, - reply: (this._docType !== 'text' && this._docType !== 'presentation') ? undefined : { - name: _('Reply'), - callback: function (key, options) { - that.onAnnotationReply.call(that, options.$trigger.get(0).annotation); - } - }, - remove: { - name: _('Remove'), - callback: function (key, options) { - that.onAnnotationRemove.call(that, options.$trigger.get(0).annotation._data.id); - } - }, - removeThread: { - name: _('Remove Thread'), - callback: function (key, options) { - that.onAnnotationRemoveThread.call(that, options.$trigger.get(0).annotation._data.id); - } - }, - resolve: this._docType !== 'text' ? undefined : { - name: _('Resolve'), - callback: function (key, options) { - that.onAnnotationResolve.call(that, options.$trigger.get(0).annotation); - } - }, - resolveThread: this._docType !== 'text' ? undefined : { - name: _('Resolve Thread'), - callback: function (key, options) { - that.onAnnotationResolveThread.call(that, options.$trigger.get(0).annotation); - } - } + build: function($trigger) { + return { + items: {
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/layer/AnnotationManager.js| 12 loleaflet/src/layer/tile/TileLayer.js |6 ++ loleaflet/src/layer/tile/WriterTileLayer.js |4 3 files changed, 22 insertions(+) New commits: commit b3d481979beb62a393d86e8a3fcf2eacf468837b Author: Pranam Lashkari AuthorDate: Tue Sep 15 10:09:35 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 16 06:39:27 2020 +0200 leaflet: annotation: new option added to remove thread Change-Id: Ib1578af2e2b53d801b74c1d94be789f7a6bce84c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102782 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index 7580884a8..3c1198c7a 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -699,6 +699,18 @@ L.AnnotationManager = L.Class.extend({ this._map.focus(); }, + removeThread: function (id) { + var comment = { + Id: { + type: 'string', + value: id + } + }; + this._map.sendUnoCommand('.uno:DeleteCommentThread', comment); + this.unselect(); + this._map.focus(); + }, + _onRedlineAccept: function(e) { var command = { AcceptTrackedChange: { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 760620a1a..0a5cd72b7 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -251,6 +251,12 @@ L.TileLayer = L.GridLayer.extend({ that.onAnnotationRemove.call(that, options.$trigger.get(0).annotation._data.id); } }, + removeThread: { + name: _('Remove Thread'), + callback: function (key, options) { + that.onAnnotationRemoveThread.call(that, options.$trigger.get(0).annotation._data.id); + } + }, resolve: this._docType !== 'text' ? undefined : { name: _('Resolve'), callback: function (key, options) { diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js index 53a15bea6..f32ea37ab 100644 --- a/loleaflet/src/layer/tile/WriterTileLayer.js +++ b/loleaflet/src/layer/tile/WriterTileLayer.js @@ -62,6 +62,10 @@ L.WriterTileLayer = L.TileLayer.extend({ this._annotations.remove(id); }, + onAnnotationRemoveThread: function (id) { + this._annotations.removeThread(id); + }, + onAnnotationReply: function (annotation) { this._annotations.reply(annotation); }, ___ 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/src
loleaflet/src/layer/AnnotationManager.js| 10 ++ loleaflet/src/layer/tile/TileLayer.js |6 ++ loleaflet/src/layer/tile/WriterTileLayer.js |4 3 files changed, 20 insertions(+) New commits: commit 9749382a92c01eb5232133393f1f6efbc1c109c9 Author: Pranam Lashkari AuthorDate: Mon Sep 14 12:57:54 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 16 06:38:43 2020 +0200 leaflet: annotation: new option added to resolve thread Change-Id: Iba14345c782a6e28003845d238debe2935c54be6 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102781 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index d5d9f2264..7580884a8 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -647,6 +647,16 @@ L.AnnotationManager = L.Class.extend({ this._map.sendUnoCommand('.uno:ResolveComment', comment); }, + resolveThread: function (annotation) { + var comment = { + Id: { + type: 'string', + value: annotation._data.id + } + }; + this._map.sendUnoCommand('.uno:ResolveCommentThread', comment); + }, + updateResolvedState: function (annotation) { var threadIndexFirst = this.getRootIndexOf(annotation._data.id); if (this._items[threadIndexFirst]._data.resolved !== annotation._data.resolved) { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index b5e4c0740..760620a1a 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -256,6 +256,12 @@ L.TileLayer = L.GridLayer.extend({ callback: function (key, options) { that.onAnnotationResolve.call(that, options.$trigger.get(0).annotation); } + }, + resolveThread: this._docType !== 'text' ? undefined : { + name: _('Resolve Thread'), + callback: function (key, options) { + that.onAnnotationResolveThread.call(that, options.$trigger.get(0).annotation); + } } }, events: { diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js index b41b7e58d..53a15bea6 100644 --- a/loleaflet/src/layer/tile/WriterTileLayer.js +++ b/loleaflet/src/layer/tile/WriterTileLayer.js @@ -70,6 +70,10 @@ L.WriterTileLayer = L.TileLayer.extend({ this._annotations.resolve(annotation); }, + onAnnotationResolveThread: function (annotation) { + this._annotations.resolveThread(annotation); + }, + onChangeAccept: function(id) { this._annotations.acceptChange(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/src
loleaflet/src/control/Control.Menubar.js |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) New commits: commit f29a261ba8e3fa28973bb5660fe90583deb52724 Author: Pedro Pinto Silva AuthorDate: Mon Sep 14 16:03:10 2020 +0200 Commit: Pedro Silva CommitDate: Tue Sep 15 16:17:58 2020 +0200 Mobile: Menu bar: Fix absent document-header on read-only documents Change-Id: Icd23f8236cfd7d72335b0cc295d62fb979090512 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102645 Tested-by: Jenkins CollaboraOffice Reviewed-by: Pedro Silva diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 2800a800f..a97ba8430 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -854,11 +854,8 @@ L.Control.Menubar = L.Control.extend({ }); $('#main-menu').attr('tabindex', 0); - // The _createFileIcon function shows the Collabora logo in the iOS app case, no - // need to delay that until the document has been made editable. - if (window.ThisIsTheiOSApp || !this._map.isPermissionReadOnly()) { - this._createFileIcon(); - } + + this._createFileIcon(); }, _onStyleMenu: function (e) { ___ 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/src
loleaflet/src/control/Control.ColumnHeader.js |2 +- loleaflet/src/control/Control.RowHeader.js|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 6faef8a61c610656ca6eafe00251d0b88977 Author: thais-dev AuthorDate: Tue Sep 1 07:22:23 2020 -0300 Commit: Andras Timar CommitDate: Tue Sep 15 15:57:39 2020 +0200 Loleaflet: add time value for the context menu of header be in sync with the context menu of the cells. Change-Id: I3f228e57375b10671b98de1a1444af87e8b2ed38 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101924 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist Reviewed-by: Aron Budea (cherry picked from commit e32fc7981e3fffe218d6211929b11a6d1b6f9ad6) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102418 Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index a18b707bd..4c7dc5372 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -99,7 +99,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ }); } else { var menuData = L.Control.JSDialogBuilder.getMenuStructureForMobileWizard(this._menuItem, true, ''); - (new Hammer(this._canvas, {recognizers: [[Hammer.Press]]})) + (new Hammer(this._canvas, {recognizers: [[Hammer.Press, {time: 500}]]})) .on('press', L.bind(function () { if (this._map.isPermissionEdit()) { window.contextMenuWizard = true; diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index 27a681f18..6cdc82a45 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -96,7 +96,7 @@ L.Control.RowHeader = L.Control.Header.extend({ }); } else { var menuData = L.Control.JSDialogBuilder.getMenuStructureForMobileWizard(this._menuItem, true, ''); - (new Hammer(this._canvas, {recognizers: [[Hammer.Press]]})) + (new Hammer(this._canvas, {recognizers: [[Hammer.Press, {time: 500}]]})) .on('press', L.bind(function () { if (this._map.isPermissionEdit()) { window.contextMenuWizard = true; ___ 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/src
loleaflet/src/control/Control.Menubar.js | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) New commits: commit 064d28077aa2b8359acbcc3feb86143a949bab42 Author: Pranam Lashkari AuthorDate: Tue Sep 15 17:38:15 2020 +0530 Commit: Andras Timar CommitDate: Tue Sep 15 15:50:59 2020 +0200 leaflet: removed bogus menu items in Draw menu Change-Id: I055cb3cb08b7f91d35602ee33c6b799048950134 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102651 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 92d84430b..2800a800f 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -283,15 +283,15 @@ L.Control.Menubar = L.Control.extend({ {name: _UNO('.uno:ZoomPlus', 'presentation'), id: 'zoomin', type: 'action'}, {name: _UNO('.uno:ZoomMinus', 'presentation'), id: 'zoomout', type: 'action'}, {name: _('Reset zoom'), id: 'zoomreset', type: 'action'}, - {type: 'separator'}, - {uno: '.uno:SlideMasterPage'}, - {type: 'separator'}, - {uno: '.uno:ModifyPage'}, - {uno: '.uno:SlideChangeWindow'}, - {uno: '.uno:CustomAnimation'}, - {uno: '.uno:MasterSlidesPanel'}, - {type: 'separator'}, - {uno: '.uno:Sidebar'}] + {type: 'separator', drawing: false}, + {uno: '.uno:SlideMasterPage', drawing: false}, + {type: 'separator', drawing: false}, + {uno: '.uno:ModifyPage', drawing: false}, + {uno: '.uno:SlideChangeWindow', drawing: false}, + {uno: '.uno:CustomAnimation', drawing: false}, + {uno: '.uno:MasterSlidesPanel', drawing: false}, + {type: 'separator', drawing: false}, + {uno: '.uno:Sidebar', drawing: false}] }, {name: _UNO('.uno:InsertMenu', 'presentation'), id: 'insert', type: 'menu', menu: [ {name: _('Local Image...'), id: 'insertgraphic', type: 'action'}, ___ 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/src
loleaflet/src/control/Control.FormulaBar.js |3 ++- loleaflet/src/control/Control.PresentationBar.js |3 ++- loleaflet/src/control/Control.SearchBar.js |3 ++- 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 |3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) New commits: commit a6194dd3e2d6edd460c2f84b9ad829883eace5c5 Author: Pranam Lashkari AuthorDate: Sat Sep 12 11:23:28 2020 +0530 Commit: Andras Timar CommitDate: Tue Sep 15 15:49:46 2020 +0200 leaflet: disable tooltip in mobile and tablet Change-Id: I591b2392d6c7072144bd7229a60933c61a2f3241 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102429 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.FormulaBar.js b/loleaflet/src/control/Control.FormulaBar.js index b58353d82..a4d666009 100644 --- a/loleaflet/src/control/Control.FormulaBar.js +++ b/loleaflet/src/control/Control.FormulaBar.js @@ -42,7 +42,8 @@ L.Control.FormulaBar = L.Control.extend({ $('#addressInput').off('keyup', that.onAddressInput.bind(that)).on('keyup', that.onAddressInput.bind(that)); } }); - toolbar.tooltip(); + if (window.mode.isDesktop()) + toolbar.tooltip(); toolbar.bind('touchstart', function(e) { w2ui['formulabar'].touchStarted = true; diff --git a/loleaflet/src/control/Control.PresentationBar.js b/loleaflet/src/control/Control.PresentationBar.js index 2adcf2eae..26076245b 100644 --- a/loleaflet/src/control/Control.PresentationBar.js +++ b/loleaflet/src/control/Control.PresentationBar.js @@ -42,7 +42,8 @@ L.Control.PresentationBar = L.Control.extend({ window.hideTooltip(this, e.target); } }); - toolbar.tooltip(); + if (window.mode.isDesktop()) + toolbar.tooltip(); toolbar.bind('touchstart', function() { w2ui['presentation-toolbar'].touchStarted = true; diff --git a/loleaflet/src/control/Control.SearchBar.js b/loleaflet/src/control/Control.SearchBar.js index 1025d39cf..a4d82f445 100644 --- a/loleaflet/src/control/Control.SearchBar.js +++ b/loleaflet/src/control/Control.SearchBar.js @@ -38,7 +38,8 @@ L.Control.SearchBar = L.Control.extend({ window.setupSearchInput(); } }); - toolbar.tooltip(); + if (window.mode.isDesktop()) + toolbar.tooltip(); toolbar.bind('touchstart', function(e) { w2ui['searchbar'].touchStarted = true; diff --git a/loleaflet/src/control/Control.SheetsBar.js b/loleaflet/src/control/Control.SheetsBar.js index d3a6012e9..a67e425e7 100644 --- a/loleaflet/src/control/Control.SheetsBar.js +++ b/loleaflet/src/control/Control.SheetsBar.js @@ -35,7 +35,8 @@ L.Control.SheetsBar = L.Control.extend({ window.hideTooltip(this, e.target); } }); - toolbar.tooltip(); + if (window.mode.isDesktop()) + toolbar.tooltip(); toolbar.bind('touchstart', function(e) { w2ui['spreadsheet-toolbar'].touchStarted = true; diff --git a/loleaflet/src/control/Control.SigningBar.js b/loleaflet/src/control/Control.SigningBar.js index c31d90ee4..acffbd77f 100644 --- a/loleaflet/src/control/Control.SigningBar.js +++ b/loleaflet/src/control/Control.SigningBar.js @@ -27,7 +27,8 @@ L.Control.SigningBar = L.Control.extend({ onRefresh: function() { } }); - toolbar.tooltip(); + if (window.mode.isDesktop()) + toolbar.tooltip(); toolbar.bind('touchstart', function() { w2ui['document-signing-bar'].touchStarted = true; diff --git a/loleaflet/src/control/Control.StatusBar.js b/loleaflet/src/control/Control.StatusBar.js index 98ec5cd55..fd0b9b0aa 100644 --- a/loleaflet/src/control/Control.StatusBar.js +++ b/loleaflet/src/control/Control.StatusBar.js @@ -238,7 +238,8 @@ L.Control.StatusBar = L.Control.extend({ window.setupSearchInput(); } }); - toolbar.tooltip(); + if (window.mode.isDesktop()) + toolbar.tooltip(); toolbar.show();
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/layer/AnnotationManager.js | 11 --- loleaflet/src/layer/marker/Annotation.js | 23 +++ loleaflet/src/layer/tile/ImpressTileLayer.js | 10 +++--- loleaflet/src/layer/tile/TileLayer.js|7 +-- 4 files changed, 35 insertions(+), 16 deletions(-) New commits: commit d89fc4147f23e7031d5b58f4f533187a0dc22600 Author: Pranam Lashkari AuthorDate: Fri Sep 11 08:53:19 2020 +0530 Commit: Andras Timar CommitDate: Tue Sep 15 15:49:03 2020 +0200 leaflet: annotation: use vex dialogs for annotation reply Change-Id: I171c5712fcae54b4c1c6e2a8be7dd12bd6765f0a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102413 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index 59d7ce867..d5d9f2264 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -627,9 +627,14 @@ L.AnnotationManager = L.Class.extend({ }, reply: function (annotation) { - annotation.reply(); - this.select(annotation); - annotation.focus(); + if (window.mode.isMobile() || window.mode.isTablet()) { + this._map._docLayer.newAnnotationVex(annotation, annotation._onReplyClick,/* isMod */ true, ''); + } + else { + annotation.reply(); + this.select(annotation); + annotation.focus(); + } }, resolve: function (annotation) { diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 2d1986ef6..b5c7f3069 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -343,14 +343,21 @@ L.Annotation = L.Layer.extend({ _onReplyClick: function (e) { L.DomEvent.stopPropagation(e); - this._data.reply = this._nodeReplyText.value; - // Assigning an empty string to .innerHTML property in some browsers will convert it to 'null' - // While in browsers like Chrome and Firefox, a null value is automatically converted to '' - // Better to assign '' here instead of null to keep the behavior same for all - this._nodeReplyText.value = ''; - this.show(); - this._checkBounds(); - this._map.fire('AnnotationReply', {annotation: this}); + if (window.mode.isMobile() || window.mode.isTablet()) { + e.annotation._data.reply = e.annotation.text; + e.annotation.show(); + e.annotation._checkBounds(); + this._map.fire('AnnotationReply', {annotation: e.annotation}); + } else { + this._data.reply = this._nodeReplyText.value; + // Assigning an empty string to .innerHTML property in some browsers will convert it to 'null' + // While in browsers like Chrome and Firefox, a null value is automatically converted to '' + // Better to assign '' here instead of null to keep the behavior same for all + this._nodeReplyText.value = ''; + this.show(); + this._checkBounds(); + this._map.fire('AnnotationReply', {annotation: this}); + } }, _onResolveClick: function (e) { diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index 9f9a3389f..22a310bc5 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -161,9 +161,13 @@ L.ImpressTileLayer = L.TileLayer.extend({ onAnnotationReply: function (annotation) { this.onAnnotationCancel(); this._selectedAnnotation = annotation._data.id; - annotation.reply(); - this.scrollUntilAnnotationIsVisible(annotation); - annotation.focus(); + if (window.mode.isMobile() || window.mode.isTablet()) { + this._map._docLayer.newAnnotationVex(annotation, annotation._onReplyClick,/* isMod */ true, ''); + } else { + annotation.reply(); + this.scrollUntilAnnotationIsVisible(annotation); + annotation.focus(); + } }, onAnnotationRemove: function (id) { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 79b936ada..b5e4c0740 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -381,7 +381,7 @@ L.TileLayer = L.GridLayer.extend({
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/map/handler/Map.Scroll.js |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 9ca84b6fe5d0ab84d0005530eedf76f8c7342e08 Author: Pranam Lashkari AuthorDate: Fri Sep 11 14:24:37 2020 +0530 Commit: Andras Timar CommitDate: Tue Sep 15 15:47:53 2020 +0200 scrolling: fixed multitouch horizontal scrolling Change-Id: I2b30be5bd2d96c4757cd4059a28fb08a702bc3ca Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102420 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/map/handler/Map.Scroll.js b/loleaflet/src/map/handler/Map.Scroll.js index 9377f2d75..3f088cd23 100644 --- a/loleaflet/src/map/handler/Map.Scroll.js +++ b/loleaflet/src/map/handler/Map.Scroll.js @@ -48,7 +48,10 @@ L.Map.Scroll = L.Handler.extend({ this._timer = setTimeout(L.bind(this._performScroll, this), left); } else { - this._vertical = 1; + if (Math.abs(e.deltaX) > Math.abs(e.deltaY)) + this._vertical = 0; + else + this._vertical = 1; this._timer = setTimeout(L.bind(this._performScroll, this), left); } ___ 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/src
loleaflet/src/control/Control.MobileWizard.js | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) New commits: commit 18d9de88f9c9d4813245bf1d156d5fd2722e6860 Author: Pranam Lashkari AuthorDate: Thu Sep 10 07:17:43 2020 +0530 Commit: Andras Timar CommitDate: Tue Sep 15 15:46:59 2020 +0200 leaflet: optimized the changing levels in wizard going up in wizards which has huge contect (i.e: function in calc) was very slow because animation performed on all the elements of the same class but needed to perform it on the sblings only Change-Id: I1db86492cc3ee7513efa44ccf08a0d15853364fd Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102350 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 853dfe333..f5677ee73 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -178,7 +178,7 @@ L.Control.MobileWizard = L.Control.extend({ $('#mobile-wizard-tabs').hide(); } - var titles = '.ui-header.level-' + this.getCurrentLevel() + '.mobile-wizard'; + var titles = '.ui-header.level-' + this.getCurrentLevel() + '.mobile-wizard:visible'; if (animate) $(titles).hide('slide', { direction: 'left' }, 'fast'); @@ -227,11 +227,18 @@ L.Control.MobileWizard = L.Control.extend({ else this._setTitle(this._mainTitle); - $('.ui-content.level-' + this._currentDepth + '.mobile-wizard').siblings().show('slide', { direction: 'left' }, 'fast'); - $('.ui-content.level-' + this._currentDepth + '.mobile-wizard').hide(); + var headers; + if (this._currentDepth === 0) { + headers = $('.ui-header.level-' + this._currentDepth + '.mobile-wizard'); + } else { + headers = $('.ui-content.level-' + this._currentDepth + '.mobile-wizard:visible').siblings() + .not('.ui-content.level-' + this._currentDepth + '.mobile-wizard'); + } + + $('.ui-content.level-' + this._currentDepth + '.mobile-wizard:visible').hide(); $('#mobile-wizard.funcwizard div#mobile-wizard-content').removeClass('showHelpBG'); $('#mobile-wizard.funcwizard div#mobile-wizard-content').addClass('hideHelpBG'); - $('.ui-header.level-' + this._currentDepth + '.mobile-wizard').show('slide', { direction: 'left' }, 'fast'); + headers.show('slide', { direction: 'left' }, 'fast'); if (this._currentDepth == 0 || (this._isTabMode && this._currentDepth == 1)) { this._inMainMenu = true; ___ 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/src
loleaflet/src/control/Control.Toolbar.js |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 0c76dcde35d52b273476ac9347f2fcd85482cd2f Author: Andras Timar AuthorDate: Mon Sep 14 16:15:30 2020 +0200 Commit: Andras Timar CommitDate: Mon Sep 14 16:21:26 2020 +0200 change shape category names to match to core (and have l10n) Change-Id: I3ab05a3b771af15de5091eea8bb7f2b5a4153c9d Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102681 Tested-by: Andras Timar Reviewed-by: Andras Timar (cherry picked from commit 917b0de6b771923249cf468a4224b0266905598d) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102641 diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 1595be0b0..3562e57fb 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -332,7 +332,7 @@ var shapes = { {img: 'basicshapes_frame', uno: 'BasicShapes.frame'} ], - 'Symbols': [ + 'Symbol Shapes': [ {img: 'symbolshapes', uno: 'SymbolShapes.smiley'}, {img: 'symbolshapes_sun', uno: 'SymbolShapes.sun'}, {img: 'symbolshapes_moon', uno: 'SymbolShapes.moon'}, @@ -388,7 +388,7 @@ var shapes = { {img: 'arrowshapes_s-sharped-arrow', uno: 'ArrowShapes.s-sharped-arrow'} ], - 'Stars': [ + 'Stars and Banners': [ {img: 'starshapes_bang', uno: 'StarShapes.bang'}, {img: 'starshapes_star4', uno: 'StarShapes.star4'}, {img: 'starshapes_star5', uno: 'StarShapes.star5'}, ___ 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/src
loleaflet/src/control/Control.JSDialogBuilder.js |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 9f9fdfbb9c32570d07ce58986279dbcc64501bd8 Author: Pedro Pinto Silva AuthorDate: Fri Sep 11 16:49:51 2020 +0200 Commit: Pedro Silva CommitDate: Mon Sep 14 14:37:04 2020 +0200 Add missing class (selected) to _unoToolButton Change-Id: Ia7a5cdb840240ffbbe3f73c23264750b5d8e9d82 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102486 Reviewed-by: Pranam Lashkari Tested-by: Pedro Silva Tested-by: Jenkins CollaboraOffice (cherry picked from commit 8a20b74e36cc12f24b92105f8b20929d9f172bca) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102637 Reviewed-by: Pedro Silva diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 87fe1060d..e0b2f17be 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1648,10 +1648,14 @@ L.Control.JSDialogBuilder = L.Control.extend({ var items = builder.map['stateChangeHandler']; var state = items.getItemValue(data.command); - if (state && state === 'true') + if (state && state === 'true') { $(button).addClass('selected'); - else + $(div).addClass('selected'); + } + else { $(button).removeClass('selected'); + $(div).removeClass('selected'); + } if (state && state === 'disabled') $(div).addClass('disabled'); ___ 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/src
loleaflet/src/control/Control.JSDialogBuilder.js |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit a201d0f5903032d02b5a3bfc034b278643307688 Author: Pedro Pinto Silva AuthorDate: Fri Sep 11 11:07:28 2020 +0200 Commit: Andras Timar CommitDate: Fri Sep 11 13:46:14 2020 +0200 Mobile: set icon for watermark transparency spinfield Reuse lc_settransparency icon used on objects instead of duplicating file Change-Id: Iec2393aa43edcf5907f3ae401811414cdb4682f3 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102421 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 1422a71b6..87fe1060d 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -46,6 +46,8 @@ L.Control.JSDialogBuilder = L.Control.extend({ builder._fixedtextControl(parentContainer, fixedTextData, builder); } + console.debug('baseSpinField: ' + data.id); + var div = L.DomUtil.create('div', 'spinfieldcontainer', parentContainer); div.id = data.id; controls['container'] = div; @@ -53,7 +55,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var commandName = data.id ? data.id.substring('.uno:'.length) : data.id; if (commandName && commandName.length && L.LOUtil.existsIconForCommand(commandName, builder.map.getDocType())) { var image = L.DomUtil.create('img', 'spinfieldimage', div); - var icon = builder._createIconURL(data.id); + var icon = (data.id === 'Transparency') ? builder._createIconURL('settransparency') : builder._createIconURL(data.id); image.src = icon; icon.alt = ''; } ___ 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/src
loleaflet/src/layer/tile/TileLayer.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5c3d842f4ce7dd341b3a13ec70ae054efbb2b30c Author: Andras Timar AuthorDate: Fri Sep 11 09:41:04 2020 +0200 Commit: Andras Timar CommitDate: Fri Sep 11 10:04:24 2020 +0200 make the label 'Functions' localizable Change-Id: If3a952e229bccdb2ff5c6d6a7e582e1ba3066c57 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102419 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 7e46e112b..79b936ada 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -814,7 +814,7 @@ L.TileLayer = L.GridLayer.extend({ var data = { id: 'funclist', type: '', - text: 'Functions', + text: _('Functions'), enabled: true, children: [] }; ___ 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/src
loleaflet/src/control/Control.PartsPreview.js |8 1 file changed, 8 deletions(-) New commits: commit 83b2af7108dd85fd4371f254210af58d045482da Author: Tamás Zolnai AuthorDate: Thu Sep 10 12:45:37 2020 +0200 Commit: Aron Budea CommitDate: Thu Sep 10 16:45:02 2020 +0200 Revert "loleaflet: Hide portrait view previews on layout view." Leads to "TypeError: Cannot read property 'style' of null". This reverts commit aca07fec869117589a7b81b64328f39e02fc882d. Change-Id: I63678f735f698012ca89d5d0ef0ee9c1c8a1d6a2 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102372 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tamás Zolnai (cherry picked from commit 617dd6de0557085f957425e27711eb31052c7ac1) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102312 Reviewed-by: Aron Budea diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index dfc37beaf..6d7b6c3da 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -184,14 +184,6 @@ L.Control.PartsPreview = L.Control.extend({ $(this._partsPreviewCont).mCustomScrollbar('destroy'); this.createScrollbar(); } - - // Hide portrait view's previews when layout view is used. - if (this._direction === 'x' && window.mode.isMobile()) { - document.getElementById('mobile-slide-sorter').style.display = 'block'; - } - else if (this._direction === 'y' && window.mode.isMobile()) { - document.getElementById('mobile-slide-sorter').style.display = 'none'; - } } }, ___ 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/src
loleaflet/src/layer/tile/ImpressTileLayer.js |2 +- loleaflet/src/map/Map.js | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-) New commits: commit 833ad93687c8a3d7a2a1dcdc9938ec9f5b43ff7f Author: Pranam Lashkari AuthorDate: Tue Sep 8 06:30:46 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 9 14:18:57 2020 +0200 leaflet: fixed annotation getting out of screen problem: annotations in impress were overlapped by controls sometimes which makes kabab menu inaccessible on the reloading or opening doc if annotation, half annotation is out of the screen on right Change-Id: I830df8a393dae93db571fb999cb649bc87126d4a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102213 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index 577c078dc..9f9a3389f 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -312,7 +312,7 @@ L.ImpressTileLayer = L.TileLayer.extend({ var topAnnotation; var annotations = this._annotations[this._partHashes[this._selectedPart]]; var topRight = this._map.latLngToLayerPoint(this._map.options.docBounds.getNorthEast()) - .add(L.point((this._selectedAnnotation ? 3 : 2) * this.options.marginX, this.options.marginY)); + .add(L.point(5, this.options.marginY)); var bounds, annotation; for (var index in annotations) { annotation = annotations[index]; diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 1d941f5de..1a0e1e988 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -1105,6 +1105,16 @@ L.Map = L.Evented.extend({ } this.fire('moveend', {hard: !preserveMapOffset}); + + if (this.getDocType() === 'presentation') { + if (this._docLayer._selectedParts !== undefined) { + var parHash = this._docLayer._partHashes[this._docLayer._selectedPart]; + var annotations = this._docLayer._annotations[parHash]; + for (var i in annotations) { + annotations[i].update(); + } + } + } }, _rawPanBy: function (offset) { ___ 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/src
loleaflet/src/layer/tile/ImpressTileLayer.js |3 +++ 1 file changed, 3 insertions(+) New commits: commit a8cefd617ff203a0e35fe5143f97e69c461fa820 Author: Ezinne Nnamani AuthorDate: Fri Sep 4 16:04:13 2020 +0100 Commit: Andras Timar CommitDate: Tue Sep 8 13:13:52 2020 +0200 A fix to display the avatar on the comments in Impress slides Change-Id: I1ba699d5e8583253ec9d14502629218d8714e5aa Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102141 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102118 diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index b4e77f167..577c078dc 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -405,6 +405,9 @@ L.ImpressTileLayer = L.TileLayer.extend({ _onMessage: function (textMsg, img) { if (textMsg.startsWith('comment:')) { var obj = JSON.parse(textMsg.substring('comment:'.length + 1)); + if (obj.comment.author in this._map._viewInfoByUserName) { + obj.comment.avatar = this._map._viewInfoByUserName[obj.comment.author].userextrainfo.avatar; + } if (obj.comment.action === 'Add') { if (!this._annotations[obj.comment.parthash]) { this._annotations[obj.comment.parthash] = []; ___ 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/src
loleaflet/src/layer/tile/TileLayer.js | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) New commits: commit dd9f07ec09ee8417ea14460ee71a33e1c158e263 Author: Pranam Lashkari AuthorDate: Sun Aug 9 23:50:30 2020 +0530 Commit: Andras Timar CommitDate: Wed Sep 2 20:36:18 2020 +0200 leaflet: hyperlink popup will not displace the view hyperlink popups always opend above the links when it did not fit into the view it would scroll this scrolling caused problem in calc by messing the grid now popup will not trigger the scroll and would be adjusted to fit in view Change-Id: I6c886e0dc57b010db16f51baed0e7a0465e52d4f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101863 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index cba7cf179..ba0157ac7 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1207,13 +1207,42 @@ L.TileLayer = L.GridLayer.extend({ _showURLPopUp: function(position, url) { // # for internal links if (!url.startsWith('#')) { - this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) + this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false, autoPan: false}) .setContent('' + url + '') .setLatLng(position) .openOn(this._map); + var offsetDiffTop = $('.hyperlink-popup').offset().top - $('#map').offset().top; + var offsetDiffLeft = $('.hyperlink-popup').offset().left - $('#map').offset().left; + if (offsetDiffTop < 10) this._movePopUpBelow(); + if (offsetDiffLeft < 10) this._movePopUpRight(); } }, + _movePopUpBelow: function() { + var popUp = $('.hyperlink-popup').first(); + var pixBounds = L.bounds(this._map.latLngToLayerPoint(this._visibleCursor.getSouthWest()), + this._map.latLngToLayerPoint(this._visibleCursor.getNorthEast())); + var cursorSize = pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())); + var bottom = cursorSize.y + popUp.height(); + + popUp.css({ + 'bottom': bottom ? -bottom + 'px': '', + 'display': 'flex', + 'flex-direction': 'column-reverse' + }); + $('.leaflet-popup-tip-container').first().css('transform', 'rotate(180deg)'); + }, + + _movePopUpRight: function() { + $('.leaflet-popup-content-wrapper').first().css({ + 'position': 'relative', + 'left': this._map.hyperlinkPopup._containerLeft * -1 + }); + $('.leaflet-popup-tip-container').first().css({ + 'left': '25px' + }); + }, + _closeURLPopUp: function() { this._map.closePopup(this._map.hyperlinkPopup); this._map.hyperlinkPopup = null; ___ 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/src
loleaflet/src/control/Control.JSDialogBuilder.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 638c91af677d2034f31815d56840a460e495b790 Author: Pedro Pinto Silva AuthorDate: Wed Sep 2 16:25:25 2020 +0200 Commit: Andras Timar CommitDate: Wed Sep 2 17:24:32 2020 +0200 Mobile: menu entries with icon missing extra class .flex-fullwidth This was causing elements (without arrow) in the insert mobilewizard to have its labels misaligned Change-Id: I0472a5d39a2691b48d7920a75821447622cc1801 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101873 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index a925b0a1f..1422a71b6 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -2104,7 +2104,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var titleSpan = L.DomUtil.create('span', '', menuEntry); titleSpan.innerHTML = title; - var paddingClass = icon ? 'menu-entry-with-icon' : 'menu-entry-no-icon'; + var paddingClass = icon ? 'menu-entry-with-icon flex-fullwidth' : 'menu-entry-no-icon'; L.DomUtil.addClass(titleSpan, paddingClass); if (builder.wizard) { ___ 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/src
loleaflet/src/control/Control.UserList.js |5 +++-- loleaflet/src/layer/marker/Cursor.js |2 +- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit 68f844bad43cefccd70833078354822df5bf2044 Author: Szymon Kłos AuthorDate: Wed Sep 2 09:36:52 2020 +0200 Commit: Andras Timar CommitDate: Wed Sep 2 10:25:15 2020 +0200 Fix name formatting Change-Id: I2aed56cf362c0e68918955340d35013179a54ad1 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101868 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.UserList.js b/loleaflet/src/control/Control.UserList.js index 47a259eca..ed902a7c7 100644 --- a/loleaflet/src/control/Control.UserList.js +++ b/loleaflet/src/control/Control.UserList.js @@ -96,7 +96,7 @@ L.Control.UserList = L.Control.extend({ $(img).css({'background-color': color}); } - nameTd.innerHTML = userName; + nameTd.textContent = userName; return content; }, @@ -211,10 +211,11 @@ L.Control.UserList = L.Control.extend({ onRemoveView: function(e) { var that = this; + var username = this.escapeHtml(e.username); $('#tb_actionbar_item_userlist') .w2overlay({ class: 'loleaflet-font', - html: this.options.userLeftPopupMessage.replace('%user', e.username), + html: this.options.userLeftPopupMessage.replace('%user', username), style: 'padding: 5px' }); clearTimeout(this.options.userPopupTimeout); diff --git a/loleaflet/src/layer/marker/Cursor.js b/loleaflet/src/layer/marker/Cursor.js index 4e415b620..348356fc1 100644 --- a/loleaflet/src/layer/marker/Cursor.js +++ b/loleaflet/src/layer/marker/Cursor.js @@ -93,7 +93,7 @@ L.Cursor = L.Layer.extend({ if (this.options.header) { this._cursorHeader = L.DomUtil.create('div', 'leaflet-cursor-header', this._container); - this._cursorHeader.innerHTML = this.options.headerName; + this._cursorHeader.textContent = this.options.headerName; clearTimeout(this._blinkTimeout); this._blinkTimeout = setTimeout(L.bind(function() { ___ 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/src
loleaflet/src/layer/tile/TileLayer.js | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) New commits: commit d8dacec1e1e22df3595b72ae96dcb1b26674d296 Author: Henry Castro AuthorDate: Thu Jul 16 15:51:06 2020 -0400 Commit: Aron Budea CommitDate: Wed Sep 2 08:10:54 2020 +0200 loleaflet: no scroll if editing a cell formula Change-Id: I2b1bca30c795043c7172dd080e51cfe37c0dc008 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98931 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro (cherry picked from commit f6667cfea18fb3aa6bc8a5769da5994a7e06e322) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101817 Reviewed-by: Aron Budea diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 726a5a5b2..eb030a2e6 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -781,6 +781,10 @@ L.TileLayer = L.GridLayer.extend({ } }, + _isEditFormula: function () { + return this._lastFormula && this._map._isCursorVisible; + }, + _onCellAddressMsg: function (textMsg) { // When the user moves the focus to a different cell, a 'cellformula' // message is received from lowsd, *then* a 'celladdress' message. @@ -2235,7 +2239,8 @@ L.TileLayer = L.GridLayer.extend({ center.y = Math.round(center.y < 0 ? 0 : center.y); if (!(this._selectionHandles.start && this._selectionHandles.start.isDragged) && !(this._selectionHandles.end && this._selectionHandles.end.isDragged) && - !(docLayer._followEditor || docLayer._followUser)) { + !(docLayer._followEditor || docLayer._followUser) && + !this._isEditFormula()) { this._map.fire('scrollto', {x: center.x, y: center.y, calledFromInvalidateCursorMsg: scroll !== undefined}); } } @@ -2929,7 +2934,8 @@ L.TileLayer = L.GridLayer.extend({ this._map.dialog._updateTextSelection(inputBarId); } var mapBounds = this._map.getBounds(); - if (!mapBounds.contains(this._cellCursor) && !this._cellCursorXY.equals(this._prevCellCursorXY)) { + if (!mapBounds.contains(this._cellCursor) && !this._cellCursorXY.equals(this._prevCellCursorXY) && + !this._isEditFormula()) { var scrollX = 0, scrollY = 0; if (onPgUpDn) { var mapHalfHeight = (mapBounds.getNorth() - mapBounds.getSouth()) / 2; ___ 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/src
loleaflet/src/core/Util.js| 17 loleaflet/src/map/Clipboard.js| 41 -- loleaflet/src/map/handler/Map.Keyboard.js | 25 ++ 3 files changed, 65 insertions(+), 18 deletions(-) New commits: commit 8f509a4b509e3e870bdcc121086b25104e72d706 Author: Pranam Lashkari AuthorDate: Tue Aug 18 19:33:13 2020 +0530 Commit: Andras Timar CommitDate: Tue Sep 1 21:56:13 2020 +0200 clipboard: leaflet: unformatted paste shortcut changed Problems: 1: Browsers hard-code ctrl+shift+v as "paste without formatting" - ie. plain text We need access to the clipboard to get the rich data needed for paste-special, which we can only get security context / access to with a ctrl-v keypress 2: we cannot directly access the clipboard data with ctrl+shift+alt+v Solution: Externally copied data could not be pasted directly with paste special and unformatted paste due to no access to the clipboard data To access the data copied externally we rely on user to trigger paste event We use default browser shortcut for unformatted paste(ctrl+shift+v) this triggers a paste event for paste special we ask user to press ctrl+v with a popup and then if that popup is open and paste event is triggered we trigger paste special New shortcuts: Paste: ctrl+v unformatted Paste: ctrl+shift+v Paste special: ctrl+shift+alt+v Change-Id: Ib15c701f5e03123cb91e36d1c1d64f0c12aa9cfb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100927 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks (cherry picked from commit 457fc3d538aed7bc2bc41fd022399749f4c5a3e4) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101861 Reviewed-by: Andras Timar diff --git a/loleaflet/src/core/Util.js b/loleaflet/src/core/Util.js index 596dfa756..b2900b62b 100644 --- a/loleaflet/src/core/Util.js +++ b/loleaflet/src/core/Util.js @@ -207,6 +207,23 @@ L.Util = { context.font = font; var metrics = context.measureText(text); return Math.floor(metrics.width); + }, + + replaceCtrlInMac: function(msg) { + if (navigator.appVersion.indexOf('Mac') != -1 || navigator.userAgent.indexOf('Mac') != -1) { + var ctrl = /Ctrl/g; + if (String.locale.startsWith('de') || String.locale.startsWith('dsb') || String.locale.startsWith('hsb')) { + ctrl = /Strg/g; + } + if (String.locale.startsWith('lt')) { + ctrl = /Vald/g; + } + if (String.locale.startsWith('sl')) { + ctrl = /Krmilka/g; + } + return msg.replace(ctrl, '⌘'); + } + return msg; } }; diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index 8043a1a98..c0204266a 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -264,8 +264,15 @@ L.Clipboard = L.Class.extend({ that._doAsyncDownload( 'POST', dest, formData, function() { - console.log('up-load done, now paste'); - that._map._socket.sendMessage('uno .uno:Paste'); + if (this.pasteSpecialVex && this.pasteSpecialVex.isOpen) { + vex.close(this.pasteSpecialVex); + console.log('up-load done, now paste special'); + that.map._socket.sendMessage('uno .uno:PasteSpecial'); + } else { + console.log('up-load done, now paste'); + that._map._socket.sendMessage('uno .uno:Paste'); + } + }, function(progress) { return 50 + progress/2; } ); @@ -292,8 +299,15 @@ L.Clipboard = L.Class.extend({ that._doAsyncDownload( 'POST', dest, formData, function() { - console.log('up-load of fallback done, now paste'); - that._map._socket.sendMessage('uno .uno:Paste'); + if
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Control.PartsPreview.js |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 40fb94207e34d46aaba073b09667f53286d0ef0a Author: Pranam Lashkari AuthorDate: Mon Aug 31 18:45:45 2020 +0530 Commit: Pranam Lashkari CommitDate: Mon Aug 31 19:21:48 2020 +0200 leaflet: fixed js error in slide reordering with touch screen Change-Id: I7e1c864640f5829166616e5bf40b95646d913b23 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101736 Tested-by: Jenkins CollaboraOffice Reviewed-by: Pranam Lashkari diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index 718d65b50..af553f552 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -585,7 +585,7 @@ L.Control.PartsPreview = L.Control.extend({ e.preventDefault(); } - this.currentNode = document.elementFromPoint(e.touches[0].clientX, e.touches[0].clientY); + this.currentNode = document.elementFromPoint(e.originalEvent.touches[0].clientX, e.originalEvent.touches[0].clientY); if (this.currentNode !== this.previousNode && this.previousNode !== null) { $('.preview-frame').removeClass('preview-img-dropsite'); @@ -597,8 +597,8 @@ L.Control.PartsPreview = L.Control.extend({ this.previousNode = this.currentNode; - $(this.draggedSlide).css('left', e.touches[0].clientX - (e.target.width/2)); - $(this.draggedSlide).css('top', e.touches[0].clientY - e.target.height); + $(this.draggedSlide).css('left', e.originalEvent.touches[0].clientX - (e.target.width/2)); + $(this.draggedSlide).css('top', e.originalEvent.touches[0].clientY - e.target.height); return 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/src
loleaflet/src/control/Control.Menubar.js |1 + 1 file changed, 1 insertion(+) New commits: commit 5f90ab70e95a036ef13edd1a4062b3f91c013c0c Author: Andras Timar AuthorDate: Fri Aug 28 08:37:55 2020 +0200 Commit: Andras Timar CommitDate: Fri Aug 28 12:06:16 2020 +0200 Revert "Disable insert comment on spreadsheet for mobile" This reverts commit 0cc4977abdbb0225c8c1a5f59b5bc00891463775. Reason for revert: after Pranam's fixes viewing/hiding/modifying comments work as expected, therefore we can have this option back. Change-Id: I299f33552ae26d29ea2078c286bc5c785ebdb7a9 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101463 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 4fe7ba101..92d84430b 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -693,6 +693,7 @@ L.Control.Menubar = L.Control.extend({ {name: _('Local Image...'), id: 'insertgraphic', type: 'action'}, {name: _UNO('.uno:InsertGraphic', 'spreadsheet'), id: 'insertgraphicremote', type: 'action'}, {uno: '.uno:InsertObjectChart'}, + {name: _UNO('.uno:InsertAnnotation', 'spreadsheet'), id: 'insertcomment', type: 'action'}, {type: 'separator'}, {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'}, {name: _UNO('.uno:ShapesMenu'), id: 'insertshape', type: 'action'}, ___ 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/src
loleaflet/src/layer/tile/CalcTileLayer.js |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) New commits: commit c568472cc47ebb333aaf064d54e39526a8ed7fc7 Author: Pranam Lashkari AuthorDate: Fri Aug 28 02:03:29 2020 +0530 Commit: Andras Timar CommitDate: Fri Aug 28 12:05:44 2020 +0200 leaflet: use vex dialog to modify comments in calc mobile Change-Id: I7c76c3cb9b5438f010752933db45f30899068d4c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101460 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 11d0a4709..371e344bc 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -72,8 +72,13 @@ L.CalcTileLayer = L.TileLayer.extend({ }, onAnnotationModify: function (annotation) { - annotation.edit(); - annotation.focus(); + if (window.mode.isMobile() || window.mode.isTablet()) { + var that = this; + this.newAnnotationVex(annotation, function(annotation) { that._onAnnotationSave(annotation); }, /* isMod */ true); + } else { + annotation.edit(); + annotation.focus(); + } }, onAnnotationRemove: function (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/src
loleaflet/src/control/Control.ContextMenu.js |1 - loleaflet/src/control/Control.JSDialogBuilder.js |4 loleaflet/src/layer/tile/CalcTileLayer.js|2 +- 3 files changed, 5 insertions(+), 2 deletions(-) New commits: commit bafef9a83cb9d7113dfdb854ade7f064d5634aa5 Author: Pranam Lashkari AuthorDate: Wed Aug 26 04:06:24 2020 +0530 Commit: Andras Timar CommitDate: Fri Aug 28 12:05:24 2020 +0200 leaflet: fixed show/hide comment in context menu Change-Id: Ia18c92832c0dd0de5a09b6e434b4afe4ca9afb26 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101458 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index db34a5600..3f0a4c035 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -78,7 +78,6 @@ L.Control.ContextMenu = L.Control.extend({ 'SpellingAndGrammarDialog', 'FontDialog', 'FontDialogForParagraph', // spreadsheet 'FormatCellDialog', - 'ShowNote', 'HideNote', 'DeleteNote', ] }, diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index fc3cf6644..a925b0a1f 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -2129,6 +2129,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ data.command.startsWith('.uno:InsertPageFooter')) && data.checked && data.checked === true) { return; + } else if (data.command === '.uno:ShowNote') { + builder.map._docLayer.showAnnotationFromCurrentCell(); + } else if (data.command === '.uno:HideNote') { + builder.map._docLayer.hideAnnotationFromCurrentCell(); } builder.map.sendUnoCommand(data.command); } diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 8960ddaf5..11d0a4709 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -109,7 +109,7 @@ L.CalcTileLayer = L.TileLayer.extend({ var annotations = this._annotations[this._selectedPart]; for (var key in annotations) { var annotation = annotations[key]._annotation; - if (this._cellCursor.contains(annotation._data.cellPos)) { + if (this._cellCursor.intersects(annotation._data.cellPos)) { this._map.addLayer(annotation); annotation.show(); } ___ 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/src
loleaflet/src/control/Toolbar.js | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) New commits: commit 5f34991930e2805be9b11634e032579aeab78a48 Author: gokaysatir AuthorDate: Wed Jul 29 18:00:44 2020 +0300 Commit: Andras Timar CommitDate: Fri Aug 28 10:19:12 2020 +0200 loleaflet: Hyperlink textbox focus & content. Change-Id: I08db18c98fc43861cc8783700b28cbeb6f9b5a74 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99710 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101501 Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index e873cf2b1..80c1d3bbd 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -596,7 +596,9 @@ L.Map.include({ text = this.hyperlinkUnderCursor.text; link = this.hyperlinkUnderCursor.link; } else if (this._clip && this._clip._selectionType == 'text') { - text = this.extractContent(this._clip._selectionContent); + if (map['stateChangeHandler'].getItemValue('.uno:Copy') === 'enabled') { + text = this.extractContent(this._clip._selectionContent); + } } else if (this._docLayer._selectedTextContent) { text = this.extractContent(this._docLayer._selectedTextContent); } @@ -605,8 +607,8 @@ L.Map.include({ contentClassName: 'hyperlink-dialog', message: _('Insert hyperlink'), input: [ - _('Text') + '', - _('Link') + '' + _('Text') + '', + _('Link') + '' ].join(''), buttons: [ $.extend({}, vex.dialog.buttons.YES, { text: _('OK') }), @@ -627,6 +629,19 @@ L.Map.include({ map.sendUnoCommand('.uno:SetHyperlink', command); map.focus(); } + else { + map.focus(); + } + }, + afterOpen: function() { + setTimeout(function() { + if (document.getElementById('hyperlink-text-box').value.trim() !== '') { + document.getElementById('hyperlink-link-box').focus(); + } + else { + document.getElementById('hyperlink-text-box').focus(); + } + }, 0); } }); } ___ 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/src
loleaflet/src/core/Socket.js |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit 39c778e0cf4e37b5621a06798cd5147604505bc5 Author: Henry Castro AuthorDate: Thu Jul 23 19:33:02 2020 -0400 Commit: Andras Timar CommitDate: Fri Aug 28 08:37:14 2020 +0200 loleaflet: fix the "vex" dialog that throw an uncaught type error This happens when a dialog related to saving a document conflict Change-Id: I37c4840ef09f421a16c0313891b75a61be9c881d Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99342 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro (cherry picked from commit e98459439e405896bc7f36178bbaf07c40033bbc) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101461 Reviewed-by: Andras Timar diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index a5f8ee5ed..95588578e 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -550,6 +550,7 @@ L.Socket = L.Class.extend({ } else if (command.errorKind === 'documentconflict') { + var that = this; storageError = errorMessages.storage.documentconflict; vex.closeAll(); @@ -578,15 +579,15 @@ L.Socket = L.Class.extend({ callback: function(value) { if (value === 'discard') { // They want to refresh the page and load document again for all - this.sendMessage('closedocument'); + that.sendMessage('closedocument'); } else if (value === 'overwrite') { // They want to overwrite - this.sendMessage('savetostorage force=1'); + that.sendMessage('savetostorage force=1'); } else if (value === 'saveas') { - var filename = this._map['wopi'].BaseFileName; + var filename = that._map['wopi'].BaseFileName; if (filename) { filename = L.LOUtil.generateNewFileName(filename, '_new'); - this._map.saveAs(filename); + that._map.saveAs(filename); } } }, ___ 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/src
loleaflet/src/layer/marker/TextInput.js | 87 +++- 1 file changed, 86 insertions(+), 1 deletion(-) New commits: commit e2e0727be7b546d81f2f12bd84de06f72bad6cca Author: Tor Lillqvist AuthorDate: Wed Aug 19 11:19:35 2020 +0300 Commit: Andras Timar CommitDate: Thu Aug 27 21:13:32 2020 +0200 Use CollaboraOnlineWebViewKeyboardManager if available If loleaflet is embedded in an iOS app that uses CollaboraOnlineWebViewKeyboardManager, then we can use that to reliably display and hide the on-screen keyboard. (Such iOS apps are Collabora Office or Nextcloud.) This is optional as we can't be sure whether the version of the iOS app we are embedded in uses CollaboraOnlineWebViewKeyboardManager or not. If not, work as before. I.e. hope that calling the focus()/blur() methods of a textarea object will show/hide the on-screen keyboard. Change-Id: Idddedcb4a83588c622067cdbeadb02ecdbd4fc72 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100980 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101441 Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/marker/TextInput.js b/loleaflet/src/layer/marker/TextInput.js index 9fe093ce7..418ffd7d1 100644 --- a/loleaflet/src/layer/marker/TextInput.js +++ b/loleaflet/src/layer/marker/TextInput.js @@ -1,4 +1,4 @@ -/* -*- js-indent-level: 8 -*- */ +/* -*- js-indent-level: 8; fill-column: 100 -*- */ /* * L.TextInput is the hidden textarea, which handles text input events * @@ -171,6 +171,81 @@ L.TextInput = L.Layer.extend({ return; } + // Are we running in a WebView under an iOS app that uses + // CollaboraOnlineWebViewKeyboardManager? + if (window.webkit && + window.webkit.messageHandlers && + window.webkit.messageHandlers.CollaboraOnlineWebViewKeyboardManager) { + + if (!acceptInput) { + window.webkit.messageHandlers.CollaboraOnlineWebViewKeyboardManager.postMessage({command: 'hide'}); + return; + } + + // Define the function that CollaboraOnlineWebViewKeyboardManager will call. + // This is a hardcoded name that CollaboraOnlineWebViewKeyboardManager + // knows. This is not a problem as we can keep both codebases in sync. + + var that = this; + window.COKbdMgrCallback = function(message) { + var errorMessage; + if (typeof message !== 'object') { + errorMessage = 'COKbdMgrCallback called with non-object of type ' + typeof message; + console.log(errorMessage); + throw errorMessage; + } + + if (message.id !== 'COKbdMgr') { + errorMessage = 'COKbdMgrCallback called with object with unknown id: ' + message.id; + console.log(errorMessage); + throw errorMessage; + } + + if (message.command === undefined || typeof message.command !== 'string') { + errorMessage = 'COKbdMgrCallback called without command'; + console.log(errorMessage); + throw errorMessage; + } + + if (message.command === 'replaceText') { + if (message.text === undefined || typeof message.text !== 'string') { + errorMessage = 'COKbdMgrCallback called for replaceText without text'; + console.log(errorMessage); + throw errorMessage; + } + + if (message.location === undefined || typeof message.location !== 'number') { + errorMessage = 'COKbdMgrCallback called for replaceText without location'; + console.log(errorMessage); + throw errorMessage; + } + + if (message.length === undefined || typeof message.length !== 'number') { + errorMessage = 'COKbdMgrCallback called for replaceText without
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Control.LokDialog.js |7 --- 1 file changed, 7 deletions(-) New commits: commit fbead0febeef17092286f8252ee2241fee8172ee Author: Michael Meeks AuthorDate: Tue Aug 18 19:54:41 2020 +0100 Commit: Michael Meeks CommitDate: Thu Aug 20 14:41:54 2020 +0200 We no longer need to mess with focus during sidebar paint. TextInput.js sends keyboard events to the right dialog window now by referring to Map.js - rather than needing several different places that can be focused. Change-Id: I044bc858a80379b68838d64d1987a1dbd9007195 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100981 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 117ae0873..b46fa91c4 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -1629,13 +1629,6 @@ L.Control.LokDialog = L.Control.extend({ this._resizeCalcInputBar(deckOffset); this._adjustTabsBar(width); - // If we didn't have the focus, don't steal it form the editor. - if ($('#' + this._currentDeck.strId + '-cursor').css('display') === 'none') { - if (this._map.editorHasFocus()) { - this._map.fire('editorgotfocus'); - this._map.focus(); - } - } }, _resizeCalcInputBar: function(offset) { ___ 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/src
loleaflet/src/control/Control.UserList.js | 32 +++--- 1 file changed, 17 insertions(+), 15 deletions(-) New commits: commit 4d821065b93d3c2de0f610fe4def6e3b896c5cd4 Author: Andras Timar AuthorDate: Wed Aug 19 11:19:08 2020 +0200 Commit: Andras Timar CommitDate: Thu Aug 20 09:56:24 2020 +0200 do not show broken images instead of avatars Change-Id: I6babd0a892dccc2ca5d6d1bf6ac6e6007411b1e2 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100977 Tested-by: Andras Timar Reviewed-by: Andras Timar (cherry picked from commit 449dc691d2d2ebcc6d81410f536b0fc04ff8b0bd) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100943 Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/src/control/Control.UserList.js b/loleaflet/src/control/Control.UserList.js index 9a7c27386..47a259eca 100644 --- a/loleaflet/src/control/Control.UserList.js +++ b/loleaflet/src/control/Control.UserList.js @@ -88,14 +88,16 @@ L.Control.UserList = L.Control.extend({ if (extraInfo !== undefined && extraInfo.avatar !== undefined) { var img = L.DomUtil.create('img', 'avatar-img', iconTd); img.src = extraInfo.avatar; + var altImg = L.LOUtil.getImageURL('user.svg'); + img.setAttribute('onerror', 'this.onerror=null;this.src=\'' + altImg + '\';'); $(img).css({'border-color': color}); } else { img = L.DomUtil.create('div', 'user-info', iconTd); $(img).css({'background-color': color}); } - + nameTd.innerHTML = userName; - + return content; }, @@ -105,7 +107,7 @@ L.Control.UserList = L.Control.extend({ if (userlistItem == null) { return; } - + var count = $(userlistItem.html).find('#userlist_table tbody tr').length; if (count > 1) { userlistItem.text = this.options.nUsers.replace('%n', count); @@ -114,9 +116,9 @@ L.Control.UserList = L.Control.extend({ } else { userlistItem.text = this.options.noUser; } - + w2ui['actionbar'].refresh(); - + var hideUserList = window.ThisIsAMobileApp || (this.map['wopi'].HideUserList !== null && this.map['wopi'].HideUserList !== undefined && @@ -124,7 +126,7 @@ L.Control.UserList = L.Control.extend({ (window.mode.isMobile() && $.inArray('mobile', this.map['wopi'].HideUserList) >= 0) || (window.mode.isTablet() && $.inArray('tablet', this.map['wopi'].HideUserList) >= 0) || (window.mode.isDesktop() && $.inArray('desktop', this.map['wopi'].HideUserList) >= 0)); - + if (!hideUserList && count > 1) { actionbar.show('userlist'); actionbar.show('userlistbreak'); @@ -139,7 +141,7 @@ L.Control.UserList = L.Control.extend({ if (userlistItem === null) { return; } - + $('#user-' + e.viewId).removeClass('selected-user'); }, @@ -169,10 +171,10 @@ L.Control.UserList = L.Control.extend({ var userlistItem = w2ui['actionbar'].get('userlist'); var username = this.escapeHtml(e.username); var showPopup = false; - + if (userlistItem !== null) showPopup = $(userlistItem.html).find('#userlist_table tbody tr').length > 0; - + if (showPopup) { $('#tb_actionbar_item_userlist') .w2overlay({ @@ -188,18 +190,18 @@ L.Control.UserList = L.Control.extend({ that.options.userPopupTimeout = null; }, 3000); } - + var color = L.LOUtil.rgbToHex(this.map.getViewColor(e.viewId)); if (e.viewId === this.map._docLayer._viewId) { username = _('You'); color = '#000'; } - + // Mention readonly sessions in userlist if (e.readonly) { username += ' (' + _('Readonly') + ')'; } - + if (userlistItem !== null) { var newhtml = $(userlistItem.html).find('#userlist_table tbody').append(this.getUserItem(e.viewId, username, e.extraInfo, color)).parent().parent()[0].outerHTML; userlistItem.html = newhtml; @@ -221,12 +223,12 @@ L.Control.UserList = L.Control.extend({ clearTimeout(that.
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/layer/tile/CalcTileLayer.js |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) New commits: commit 2195dea8819c7b47c90862e448cc8300cb17fd3b Author: Michael Meeks AuthorDate: Tue Aug 18 10:39:05 2020 +0100 Commit: Andras Timar CommitDate: Wed Aug 19 09:25:24 2020 +0200 Fix annoying exception on calc close with annotations. Change-Id: Ic9fbdd443419365470137858dac2e5b3de71c9b7 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100906 Tested-by: Jenkins Reviewed-by: Michael Meeks (cherry picked from commit 6c161540a9ba5942ba052e6c2b8aebed7ec5ef1b) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100806 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 4bf197b85..8960ddaf5 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -55,9 +55,11 @@ L.CalcTileLayer = L.TileLayer.extend({ }, clearAnnotations: function () { - for (var tab in this._annotations) { - this.hideAnnotations(tab); - } + if (this._map) { + for (var tab in this._annotations) { + this.hideAnnotations(tab); + } + } // else during shutdown. this._annotations = {}; }, ___ 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/src
loleaflet/src/control/Control.LokDialog.js |5 + 1 file changed, 5 insertions(+) New commits: commit e07f47d2486a07826bfa025cd2d47b267474848c Author: gokaysatir AuthorDate: Wed Aug 12 17:20:54 2020 +0300 Commit: Aron Budea CommitDate: Tue Aug 18 21:49:03 2020 +0200 loleaflet: Prevent sidebar from opening when file is on read only mode. This patch is for preventing sidebar from being launched when: * Document is on read only mode (No need for an editor bar when doc is read-only). * Also the main reason for this patch was to hide Sidebar when revision history is open (NC). Change-Id: I4d78c65a7e8f39b0827b9e23ecc24fcd9520fef8 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100601 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro (cherry picked from commit eb8e075ce02e54da4f5eca86157919001978cda0) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100933 Reviewed-by: Aron Budea diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 57b5fdc95..117ae0873 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -1009,6 +1009,11 @@ L.Control.LokDialog = L.Control.extend({ }, _launchSidebar: function(id, width, height) { + // In read-only mode, we don't need to show sidebar. This if clause prevents sidebar from opening also when revision history is open. + if (this._map.isPermissionReadOnly()) { + return; + } + console.log('_launchSidebar: start: id: ' + id + ', width: ' + width + ', height: ' + height); if ((window.mode.isMobile() || window.mode.isTablet()) && !this._map.isPermissionEdit()) ___ 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/src
loleaflet/src/control/Control.Menubar.js | 10 ++ 1 file changed, 10 insertions(+) New commits: commit 9fcd0ec196a3acfbb5486566878bcf7eac6e8839 Author: Andras Timar AuthorDate: Tue Aug 18 14:17:38 2020 +0200 Commit: Andras Timar CommitDate: Tue Aug 18 15:22:04 2020 +0200 polyfill endsWidth for IE11 Change-Id: I4a2d3af2ccffdc7dcd79ff24e00c909bc57d365e Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100807 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index bb868473f..4fe7ba101 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -1387,6 +1387,16 @@ L.Control.Menubar = L.Control.extend({ if (menuItem.drawing === false && this._map.getDocType() === 'drawing') return false; + // polyfill endsWidth for IE11 + if (!String.prototype.endsWith) { + String.prototype.endsWith = function(search, thisLen) { + if (thisLen === undefined || thisLen > this.length) { + thisLen = this.length; + } + return this.substring(thisLen - search.length, thisLen) === search; + }; + } + if (menuItem.id === 'downloadas-odg' && !this._map['wopi'].BaseFileName.endsWith('.odg')) return 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/src
loleaflet/src/control/Control.JSDialogBuilder.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b4ea674a998bf28186d57cd83e6b108cc7ceb917 Author: Tor Lillqvist AuthorDate: Tue Aug 18 13:46:44 2020 +0300 Commit: Tor Lillqvist CommitDate: Tue Aug 18 13:08:22 2020 +0200 Guard against TypeError: null is not an object Change-Id: I9a7c708bf753891d54ce8da91b2e9aaeb352cd45 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100913 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tor Lillqvist diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 7f515566d..fc3cf6644 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -480,7 +480,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ if (builder.wizard && data.enabled !== 'false') { $(sectionTitle).click(function(event, data) { builder.wizard.goLevelDown(contentDiv, data); - if (contentNode.onshow) + if (contentNode && contentNode.onshow) contentNode.onshow(); }); } else { ___ 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/src
loleaflet/src/layer/marker/TextInput.js | 52 +- loleaflet/src/map/handler/Map.TouchGesture.js |4 ++ 2 files changed, 47 insertions(+), 9 deletions(-) New commits: commit 9cc07c8ea0ceadd44557ce0a612ee07121f6e788 Author: Tor Lillqvist AuthorDate: Wed Aug 12 17:02:56 2020 +0300 Commit: Andras Timar CommitDate: Mon Aug 17 18:40:48 2020 +0200 Stopgap fix to make the on-screen keyboard behave a bit better on iPhone Our focus and blur back-and-forth dance does not seem to work on iOS like it does on Android. So for now, never call the textarea element's blur() function explicitly on iOS. Also don't play with the readonly attribute on iPhone. Probably whether the calls to the textarea's focus() and blur() functions actually do anything or not might depend on whether the call stack originates in a user input event handler or not, for security reasons. Change-Id: I442f0c26ae5b36913235a7ef96820bff83535b76 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100642 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/marker/TextInput.js b/loleaflet/src/layer/marker/TextInput.js index 8e7196e96..801c9d368 100644 --- a/loleaflet/src/layer/marker/TextInput.js +++ b/loleaflet/src/layer/marker/TextInput.js @@ -158,6 +158,11 @@ L.TextInput = L.Layer.extend({ // @acceptInput (only on "mobile" (= mobile phone) or on iOS and Android in general) true if we want to // accept key input, and show the virtual keyboard. focus: function(acceptInput) { + // console.trace('L.TextInput.focus(' + acceptInput + ')'); + + // Note that the acceptInput parameter intentionally + // is a tri-state boolean: undefined, false, or true. + // Clicking or otherwise focusing the map should focus on the clipboard // container in order for the user to input text (and on-screen keyboards // to pop-up), unless the document is read only. @@ -168,23 +173,52 @@ L.TextInput = L.Layer.extend({ // Trick to avoid showing the software keyboard: Set the textarea // read-only before focus() and reset it again after the blur() - if ((window.ThisIsAMobileApp || window.mode.isMobile()) && acceptInput !== true) - this._textArea.setAttribute('readonly', true); + if (navigator.platform !== 'iPhone') { + if ((window.ThisIsAMobileApp || window.mode.isMobile()) && acceptInput !== true) + this._textArea.setAttribute('readonly', true); + } - this._textArea.focus(); + if (navigator.platform !== 'iPhone') { + this._textArea.focus(); + } else if (acceptInput === true) { + // On the iPhone, only call the textarea's focus() when we get an explicit + // true parameter. On the other hand, never call the textarea's blur(). - if ((window.ThisIsAMobileApp || window.mode.isMobile()) && acceptInput !== true) { - this._setAcceptInput(false); - this._textArea.blur(); - this._textArea.removeAttribute('readonly'); - } else { + // Calling blur() leads to so confusing behaviour with the keyboard not + // showing up when we want. Better to have it show up a bit too long that + // strictly needed. + + // Probably whether the calls to the textarea's focus() and blur() functions + // actually do anything or not might depend on whether the call stack + // originates in a user input event handler or not, for security reasons. + + // To investigate, uncomment the call to console.trace() at the start of + // this function, and check when the topmost slot in the stack trace is + // "(anonymous function)" in hammer.js (an event handler), and when it is + // _onMessage (the WebSocket message handler in Socket.js). + + this._textArea.focus(); + } + + if (navigator.platform !== 'iPhone') { + if ((window.ThisIsAMobileApp || window.mode.isMobile()) && acceptInput !== true) { + this._setAcceptInput(false); + this._textArea.blur(); + this._textArea.removeAttribute('readonly'); + } else { + this._setAcceptInput(true); + } + } else if (acceptInput !== false) { this._setAcceptInput
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/map/handler/Map.TouchGesture.js |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit 091eca0ae421ca436ba95ea1e478909f2a18d0a7 Author: Henry Castro AuthorDate: Fri Aug 14 09:43:08 2020 -0400 Commit: Andras Timar CommitDate: Mon Aug 17 18:24:20 2020 +0200 mobile: pre-condition if they are numbers The hammer library sometimes or random when consecutively pinch events, the center and scale has infinity values Change-Id: Ide6605bcbc0c7b4818fd27b7b44706fb8122d80a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100744 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 15bb932d4..27792560d 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -511,6 +511,9 @@ L.Map.TouchGesture = L.Handler.extend({ }, _onPinchStart: function (e) { + if (isNaN(e.center.x) || isNaN(e.center.y)) + return; + this._pinchStartCenter = {x: e.center.x, y: e.center.y}; if (this._map._docLayer.isCursorVisible()) { this._map._docLayer._cursorMarker.setOpacity(0); @@ -533,7 +536,7 @@ L.Map.TouchGesture = L.Handler.extend({ }, _onPinch: function (e) { - if (!this._pinchStartCenter) + if (!this._pinchStartCenter || isNaN(e.center.x) || isNaN(e.center.y)) return; // we need to invert the offset or the map is moved in the opposite direction @@ -550,6 +553,9 @@ L.Map.TouchGesture = L.Handler.extend({ }, _onPinchEnd: function () { + if (!this._pinchStartCenter) + return; + var oldZoom = this._map.getZoom(), zoomDelta = this._zoom - oldZoom, finalZoom = this._map._limitZoom(zoomDelta > 0 ? Math.ceil(this._zoom) : Math.floor(this._zoom)); ___ 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/src
loleaflet/src/control/Control.Menubar.js | 10 --- loleaflet/src/control/Control.MobileWizard.js | 25 +++--- loleaflet/src/control/Control.Toolbar.js | 35 +++--- loleaflet/src/control/Control.UIManager.js| 25 +- 4 files changed, 61 insertions(+), 34 deletions(-) New commits: commit fbfc1f4d2c5fb9e0383cfb681efe7bbe82211f03 Author: Szymon Kłos AuthorDate: Thu Aug 6 12:32:55 2020 +0200 Commit: Jan Holesovsky CommitDate: Fri Aug 14 21:50:38 2020 +0200 Handle back button on mobile This patch created states in history when using mobilewizard, allows to use back button which navigates back in the menu. Used History API and popstate event. Also unified onClose handler to close the app. Change-Id: Id9da9bf71ee6183525ea20d43a416d3ddabec7c2 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100301 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index f08d5d966..bb868473f 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -1218,15 +1218,7 @@ L.Control.Menubar = L.Control.extend({ this._map.fire('postMessage', {msgId: 'rev-history', args: {Deprecated: true}}); this._map.fire('postMessage', {msgId: 'UI_FileVersions'}); } else if (id === 'closedocument') { - if (window.ThisIsAMobileApp) { - window.postMobileMessage('BYE'); - } else { - this._map.fire('postMessage', {msgId: 'close', args: {EverModified: this._map._everModified, Deprecated: true}}); - this._map.fire('postMessage', {msgId: 'UI_Close', args: {EverModified: this._map._everModified}}); - } - if (!this._map._disableDefaultAction['UI_Close']) { - this._map.remove(); - } + window.onClose(); } else if (id === 'repair') { this._map._socket.sendMessage('commandvalues command=.uno:DocumentRepair'); } else if (id === 'searchdialog') { diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 4a4a1eba2..853dfe333 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -11,6 +11,7 @@ L.Control.MobileWizard = L.Control.extend({ _inMainMenu: true, _isActive: false, + _inBuilding: false, _currentDepth: 0, _mainTitle: '', _isTabMode: false, @@ -57,10 +58,9 @@ L.Control.MobileWizard = L.Control.extend({ }, _setupBackButton: function() { - var that = this; this.content = $('#mobile-wizard-content'); this.backButton = $('#mobile-wizard-back'); - this.backButton.click(function() { that.goLevelUp(); }); + this.backButton.click(function() { history.back(); }); $(this.backButton).addClass('close-button'); }, @@ -130,6 +130,10 @@ L.Control.MobileWizard = L.Control.extend({ this._updateMapSize(); }, + isOpen: function() { + return $('#mobile-wizard').is(':visible'); + }, + _hideKeyboard: function() { document.activeElement.blur(); }, @@ -191,6 +195,8 @@ L.Control.MobileWizard = L.Control.extend({ $(contentToShow).show(); this._currentDepth++; + if (!this._inBuilding) + history.pushState({context: 'mobile-wizard', level: this._currentDepth}, 'mobile-wizard-level-' + this._currentDepth); this._setTitle(contentToShow.title); this._inMainMenu = false; @@ -314,6 +320,8 @@ L.Control.MobileWizard = L.Control.extend({ _onMobileWizard: function(data) { if (data) { + this._inBuilding = true; + var isSidebar = (data.children && data.children.length >= 1 && data.children[0].type == 'deck'); @@ -325,14 +333,15 @@ L.Control.MobileWizard = L.Control.extend({ return; } - if (data.id && !isNaN(data.id) && !isSidebar) { + var isMobileDialog = data.id && !isNaN(data.id) && !isSidebar; + if (isMobileDialog) { // id is a number - remember window id for interaction window.mobileDialogId = data.id; } /
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/layer/marker/Annotation.js |1 + 1 file changed, 1 insertion(+) New commits: commit c0851b0c46676be86017bc3f14f6b212d999421e Author: Szymon Kłos AuthorDate: Thu Aug 13 09:41:05 2020 +0200 Commit: Jan Holesovsky CommitDate: Fri Aug 14 13:53:17 2020 +0200 When avatar fails to load use generic image Change-Id: I03659a75ed168b15483ef46677eae4989b734933 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100643 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 05c9b59a2..2d1986ef6 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -207,6 +207,7 @@ L.Annotation = L.Layer.extend({ imgAuthor.setAttribute('src', L.LOUtil.getImageURL('user.svg')); imgAuthor.setAttribute('width', this.options.imgSize.x); imgAuthor.setAttribute('height', this.options.imgSize.y); + imgAuthor.onerror = function () { imgAuthor.setAttribute('src', L.LOUtil.getImageURL('user.svg')); }; this._authorAvatarImg = imgAuthor; this._authorAvatartdImg = tdImg; this._contentAuthor = L.DomUtil.create(tagDiv, 'loleaflet-annotation-content-author', tdAuthor); ___ 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/src
loleaflet/src/control/Control.LokDialog.js | 14 ++ loleaflet/src/control/Toolbar.js | 10 +++--- 2 files changed, 17 insertions(+), 7 deletions(-) New commits: commit c93a1caf3d8afd5d158bf6a71515e119fee47088 Author: Szymon Kłos AuthorDate: Wed Aug 12 15:49:43 2020 +0200 Commit: Jan Holesovsky CommitDate: Fri Aug 14 13:48:22 2020 +0200 Make dialogs modal, block sidebar actions when opened This change prevents user from creating multiple instances of dialogs eg. by using sidebar. Dialogs are modal now. Child dialogs still can be created from existing dialog and used. Change-Id: I388006d8857d0196d2884598e150f7bf5948ed47 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100598 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index b69c0e446..57b5fdc95 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -144,6 +144,14 @@ L.Control.LokDialog = L.Control.extend({ return Object.keys(this._dialogs).length > nonDialogEntries; }, + // method used to warn user about dialog modality + blinkOpenDialog: function() { + $('.lokdialog_container').addClass('lokblink'); + setTimeout(function () { + $('.lokdialog_container').removeClass('lokblink'); + }, 600); + }, + _docLoaded: function(e) { if (!e.status) { $('.lokdialog_container').remove(); @@ -1159,6 +1167,12 @@ L.Control.LokDialog = L.Control.extend({ L.DomEvent.on(canvas, 'mousedown mouseup', function(e) { L.DomEvent.stop(e); + + if ((this._isSidebar(id) || this.isCalcInputBar(id)) && this.hasOpenedDialog()) { + this.blinkOpenDialog(); + return; + } + if (this._isSelectionHandleDragged() && e.type === 'mouseup') { this._onSelectionHandleDrag(e); return; diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 4bf98dc0e..e873cf2b1 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -170,13 +170,9 @@ L.Map.include({ sendUnoCommand: function (command, json) { var isAllowedInReadOnly = command == '.uno:WordCountDialog'; - var hasOpenedDialog = this.dialog.hasOpenedDialog(); - if (hasOpenedDialog) { - $('.lokdialog_container').addClass('lokblink'); - setTimeout(function () { - $('.lokdialog_container').removeClass('lokblink'); - }, 600); - } else if (this.isPermissionEdit() || isAllowedInReadOnly) { + if (this.dialog.hasOpenedDialog()) + this.dialog.blinkOpenDialog(); + else if (this.isPermissionEdit() || isAllowedInReadOnly) { if (!this.messageNeedsToBeRedirected(command)) this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : '')); } ___ 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/src
loleaflet/src/layer/tile/CalcTileLayer.js |3 +++ 1 file changed, 3 insertions(+) New commits: commit ad13235f446368a3150efdedb42659429116e07b Author: Szymon Kłos AuthorDate: Wed Aug 12 10:16:54 2020 +0200 Commit: Jan Holesovsky CommitDate: Wed Aug 12 13:23:25 2020 +0200 Show avatar for newly inserted comments in calc Change-Id: If602901982e8084856ca5361ab256a93e1045e45 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100581 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index c636d04ca..4bf197b85 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -237,6 +237,9 @@ L.CalcTileLayer = L.TileLayer.extend({ var obj = JSON.parse(textMsg.substring('comment:'.length + 1)); obj.comment.tab = parseInt(obj.comment.tab); if (obj.comment.action === 'Add') { + if (obj.comment.author in this._map._viewInfoByUserName) { + obj.comment.avatar = this._map._viewInfoByUserName[obj.comment.author].userextrainfo.avatar; + } obj.comment.cellPos = L.LOUtil.stringToBounds(obj.comment.cellPos); obj.comment.cellPos = L.latLngBounds(this._twipsToLatLng(obj.comment.cellPos.getBottomLeft()), this._twipsToLatLng(obj.comment.cellPos.getTopRight())); ___ 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/src
loleaflet/src/layer/tile/TileLayer.js |1 + 1 file changed, 1 insertion(+) New commits: commit 53ef2d33d00b51d44ab3370771ec8f23c69d760e Author: gokaysatir AuthorDate: Fri Jul 10 23:36:10 2020 +0300 Commit: Aron Budea CommitDate: Tue Aug 11 22:58:44 2020 +0200 loleaflet: Remove carret marker when text selected. Change-Id: Ifc055f852857188e4d35b9db1db62638ad5a27a5 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98546 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks Reviewed-by: Henry Castro (cherry picked from commit e5dfd6a2f27450007f11ff017d919ab69422c665) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100363 Reviewed-by: Aron Budea diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 0e1845706..726a5a5b2 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1668,6 +1668,7 @@ L.TileLayer = L.GridLayer.extend({ weight: 2, opacity: 0.25}); this._selections.addLayer(selection); + this._map.removeLayer(this._map._textInput._cursorHandler); // User selected a text, we remove the carret marker. if (this._selectionContentRequest) { clearTimeout(this._selectionContentRequest); } ___ 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/src
loleaflet/src/control/Control.PartsPreview.js |1 - 1 file changed, 1 deletion(-) New commits: commit 0c7e678cbe07e866a764de2b65a246e1aac83eb1 Author: Henry Castro AuthorDate: Tue Aug 11 15:47:36 2020 -0400 Commit: Henry Castro CommitDate: Tue Aug 11 22:16:44 2020 +0200 Revert "Keep slide sorter in line on mobile devices" This is no longer need it because the orientation is manual changed, adding or removing class styles and the patches below were added to adapt the new changes This reverts commit 69c21d5bb4d084cb8abc38b4176c8b40f12c8490. Change-Id: I70aee6b569f78795487cbff736130e0e74165432 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100564 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index da01e151d..7d4648f7d 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -111,7 +111,6 @@ L.Control.PartsPreview = L.Control.extend({ }, this); this._scrollContainer = $(this._partsPreviewCont).find('.mCSB_container').get(0); - $(this._scrollContainer).css('display', 'inline-table'); // Add a special frame just as a drop-site for reordering. var frameClass = 'preview-frame ' + this.options.frameClass; ___ 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/src
loleaflet/src/control/Control.PartsPreview.js | 20 loleaflet/src/layer/tile/ImpressTileLayer.js | 10 -- 2 files changed, 24 insertions(+), 6 deletions(-) New commits: commit 1b7d5cf92779aa3506c5ac2e9f8526de682dbab7 Author: Henry Castro AuthorDate: Fri Jul 3 16:10:18 2020 -0400 Commit: Henry Castro CommitDate: Tue Aug 11 21:46:10 2020 +0200 loleaflet: fix the orientation only on main custom scroll Since we are manually changing the CSS class names when orientation changes, this is only valid for main custom scrollbar because the mobile wizard scrollbar is always in portrait mode. Change-Id: I0b9e7156dac0e33a6e793c7f6caae2021068f252 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97900 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100552 diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index e6006a8f3..6143ee28b 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -8,6 +8,10 @@ L.Control.PartsPreview = L.Control.extend({ options: { fetchThumbnail: true, autoUpdate: true, + imageClass: '', + frameClass: '', + axis: '', + allowOrientation: true, maxWidth: (window.mode.isMobile() || window.mode.isTablet()) ? 60 : 180, maxHeight: (window.mode.isMobile() || window.mode.isTablet()) ? 60 : 180 }, @@ -31,7 +35,9 @@ L.Control.PartsPreview = L.Control.extend({ onAdd: function (map) { this._previewInitialized = false; this._previewTiles = []; - this._direction = window.mode.isMobile() && L.DomUtil.isPortrait() ? 'x' : 'y'; + this._direction = this.options.allowOrientation ? + (!window.mode.isDesktop() && L.DomUtil.isPortrait() ? 'x' : 'y') : + this.options.axis; this._scrollY = 0; map.on('updateparts', this._updateDisabled, this); @@ -108,7 +114,8 @@ L.Control.PartsPreview = L.Control.extend({ $(this._scrollContainer).css('display', 'inline-table'); // Add a special frame just as a drop-site for reordering. - var frame = L.DomUtil.create('div', 'preview-frame', this._scrollContainer); + var frameClass = 'preview-frame ' + this.options.frameClass; + var frame = L.DomUtil.create('div', frameClass, this._scrollContainer); this._addDnDHandlers(frame); frame.setAttribute('draggable', false); frame.setAttribute('id', 'first-drop-site'); @@ -142,6 +149,10 @@ L.Control.PartsPreview = L.Control.extend({ } } + if (!this.options.allowOrientation) { + return; + } + // update portrait / landscape var removePreviewImg = 'preview-img-portrait'; var addPreviewImg = 'preview-img-landscape'; @@ -185,11 +196,12 @@ L.Control.PartsPreview = L.Control.extend({ }, _createPreview: function (i, hashCode, bottomBound) { - var frame = L.DomUtil.create('div', 'preview-frame', this._scrollContainer); + var frameClass = 'preview-frame ' + this.options.frameClass; + var frame = L.DomUtil.create('div', frameClass, this._scrollContainer); this._addDnDHandlers(frame); L.DomUtil.create('span', 'preview-helper', frame); - var imgClassName = 'preview-img'; + var imgClassName = 'preview-img ' + this.options.imageClass; var img = L.DomUtil.create('img', imgClassName, frame); img.hash = hashCode; img.src = L.Icon.Default.imagePath + '/preview_placeholder.png'; diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index dc7573d28..b4e77f167 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -59,7 +59,13 @@ L.ImpressTileLayer = L.TileLayer.extend({ var container = L.DomUtil.createWithId('div', 'mobile-wizard-header', mobileWizard); var preview = L.DomUtil.createWithId('div', 'mobile-slide-sorter', container); L.DomUtil.toBack(container); - map.addControl(L.control.partsPreview(container, preview, {fetchThumbnail: false})); +
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Control.PartsPreview.js |9 ++--- loleaflet/src/control/Parts.js|7 +-- 2 files changed, 11 insertions(+), 5 deletions(-) New commits: commit b47e5a670270fcf72dbec330099c20c17fbcd807 Author: Henry Castro AuthorDate: Fri Jul 3 15:59:32 2020 -0400 Commit: Henry Castro CommitDate: Tue Aug 11 21:45:45 2020 +0200 loleaflet: fix the bounding rectangle when not visible The preview thumbnail in mobile wizard are not visible yet, so assume the map container rectangle bounds to properly calculate the aspect ratio of the image Change-Id: Iacc387b92e326965c86fb60d1acfde5b49365ad3 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97899 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100551 diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index 3468d8e2e..e6006a8f3 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -232,6 +232,11 @@ L.Control.PartsPreview = L.Control.extend({ var previewContBB = this._partsPreviewCont.getBoundingClientRect(); var bottomBound; + // is not visible yet, assume map bounds + if (previewContBB.right === 0 && previewContBB.bottom === 0) { + previewContBB = this._map._container.getBoundingClientRect(); + } + if (this._direction === 'x') { this._previewContTop = previewContBB.left; bottomBound = previewContBB.right + previewContBB.width / 2; @@ -270,9 +275,7 @@ L.Control.PartsPreview = L.Control.extend({ var imgSize; if (i === 0 || (previewFrameTop >= topBound && previewFrameTop <= bottomBound) || (previewFrameBottom >= topBound && previewFrameBottom <= bottomBound)) { - imgSize = this.options.fetchThumbnail ? - this._map.getPreview(i, i, this.options.maxWidth, this.options.maxHeight, {autoUpdate: this.options.autoUpdate}) : - { width: this.options.maxWidth, height: this.options.maxHeight }; + imgSize = this._map.getPreview(i, i, this.options.maxWidth, this.options.maxHeight, {autoUpdate: this.options.autoUpdate, fetchThumbnail: this.options.fetchThumbnail}); img.fetched = true; if (this._direction === 'x') { diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js index 18ba9084d..d112557f7 100644 --- a/loleaflet/src/control/Parts.js +++ b/loleaflet/src/control/Parts.js @@ -103,6 +103,7 @@ L.Map.include({ } var autoUpdate = options ? !!options.autoUpdate : false; var forAllClients = options ? !!options.broadcast : false; + var fetchThumbnail = options && options.fetchThumbnail ? options.fetchThumbnail : true; this._docPreviews[id] = {id: id, index: index, maxWidth: maxWidth, maxHeight: maxHeight, autoUpdate: autoUpdate, invalid: false}; var docLayer = this._docLayer; @@ -131,7 +132,8 @@ L.Map.include({ dpiscale = 2; // some may be hidpi, and it is fine to send the hi-dpi slide preview to non-hpi clients } - this._socket.sendMessage('tile ' + + if (fetchThumbnail) { + this._socket.sendMessage('tile ' + 'nviewid=0' + ' ' + 'part=' + part + ' ' + 'width=' + maxWidth * dpiscale + ' ' + @@ -141,7 +143,8 @@ L.Map.include({ 'tilewidth=' + tileWidth + ' ' + 'tileheight=' + tileHeight + ' ' + 'id=' + id + ' ' + - 'broadcast=' + (forAllClients ? 'yes' : 'no')); +'broadcast=' + (forAllClients ? 'yes' : 'no')); + } return {width: maxWidth, height: maxHeight}; }, ___ 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/src
loleaflet/src/control/Control.PartsPreview.js | 13 +++ loleaflet/src/layer/tile/ImpressTileLayer.js | 30 -- loleaflet/src/map/Map.js |6 - 3 files changed, 9 insertions(+), 40 deletions(-) New commits: commit 2ca01188531d6ff499c5c1c19157903287a06317 Author: Henry Castro AuthorDate: Fri Jul 3 15:42:09 2020 -0400 Commit: Henry Castro CommitDate: Tue Aug 11 21:45:23 2020 +0200 loleaflet: re-creates the scrollbar when orientation changes We are manually changing the orientation CSS class name for preview thumbnails, so it requires to destroy and create again the custom scroll with the new axis to show a vertical or horizontal scroll bar Change-Id: Ib341025da66db05f6feddbbb32a286da107cd8df Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97898 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100550 diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index 934b4b179..3468d8e2e 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -42,11 +42,8 @@ L.Control.PartsPreview = L.Control.extend({ map.on('docsize', this._updateAllPreview, this); }, - createScrollbar: function (axis) { + createScrollbar: function () { var control = this; - if (axis) { - this._direction = axis; - } $(this._partsPreviewCont).mCustomScrollbar({ axis: this._direction, @@ -165,6 +162,14 @@ L.Control.PartsPreview = L.Control.extend({ var previewFrame = $(this._partsPreviewCont).find('.preview-frame'); previewFrame.removeClass(removePreviewFrame); previewFrame.addClass(addPreviewFrame); + + // re-create scrollbar with new direction + var direction = this._direction; + this._direction = !window.mode.isDesktop() && L.DomUtil.isPortrait() ? 'x' : 'y'; + if (direction !== this._direction) { + $(this._partsPreviewCont).mCustomScrollbar('destroy'); + this.createScrollbar(); + } } }, diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js index cc02e444d..dc7573d28 100644 --- a/loleaflet/src/layer/tile/ImpressTileLayer.js +++ b/loleaflet/src/layer/tile/ImpressTileLayer.js @@ -48,7 +48,6 @@ L.ImpressTileLayer = L.TileLayer.extend({ map.on('AnnotationSave', this.onAnnotationSave, this); map.on('AnnotationScrollUp', this.onAnnotationScrollUp, this); map.on('AnnotationScrollDown', this.onAnnotationScrollDown, this); - map.on('orientationchange', this.onOrientationChange, this); map.on('resize', this.onResize, this); map.uiManager.initializeSpecializedUI('presentation'); @@ -255,35 +254,6 @@ L.ImpressTileLayer = L.TileLayer.extend({ } }, - onOrientationChange: function () { - var container = L.DomUtil.get('presentation-controls-wrapper'); - var preview = L.DomUtil.get('slide-sorter'); - - if (!container || !preview) { - return; - } - - // Android change the orientation if the keyboard is visible - if (L.Browser.android) { - if (window.innerHeight < 2 * screen.height / 3) { - L.DomUtil.addClass(this._map.options.documentContainer, 'keyboard'); - $(preview).hide(); - } else { - L.DomUtil.removeClass(this._map.options.documentContainer, 'keyboard'); - $(preview).show(); - } - } - - if (L.DomUtil.isPortrait() && $(preview).data('mCS').opt.axis !== 'x') { - $(preview).mCustomScrollbar('destroy'); - this._preview.createScrollbar('x'); - } else if (L.DomUtil.isLandscape() && $(preview).data('mCS').opt.axis !== 'y') { - $(preview).mCustomScrollbar('destroy'); - this._preview.createScrollbar('y'); - } - - }, - onUpdatePermission: function (e) { if (window.mode.isMobile()) { if (e.perm === 'edit') { diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 5fdc1520d..37e703de9 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Control.PartsPreview.js | 32 +++--- 1 file changed, 29 insertions(+), 3 deletions(-) New commits: commit dcbea7d8ede6bed202fb48ce4a449dc6ef9209fc Author: Henry Castro AuthorDate: Thu Jul 2 10:59:56 2020 -0400 Commit: Henry Castro CommitDate: Tue Aug 11 21:44:42 2020 +0200 loleaflet: update preview images when the doc size changes The unit test checks the aspect ratio of the preview thumbnails, this happens when the document size changes (i.e changing paper format) Change-Id: I0267e797327b73d714947258e004fe64cce9d1dd Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97775 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100548 diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index f7f11e348..84b8a1579 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -39,6 +39,7 @@ L.Control.PartsPreview = L.Control.extend({ map.on('tilepreview', this._updatePreview, this); map.on('insertpage', this._insertPreview, this); map.on('deletepage', this._deletePreview, this); + map.on('docsize', this._updateAllPreview, this); }, createScrollbar: function (axis) { @@ -176,6 +177,27 @@ L.Control.PartsPreview = L.Control.extend({ } }, + _updateAllPreview: function () { + if (this._previewTiles.length === 0) { + return; + } + + var previewContBB = this._partsPreviewCont.getBoundingClientRect(); + var bottomBound; + + if (this._direction === 'x') { + this._previewContTop = previewContBB.left; + bottomBound = previewContBB.right + previewContBB.width / 2; + } else { + this._previewContTop = previewContBB.top; + bottomBound = previewContBB.bottom + previewContBB.height / 2; + } + + for (var prev = 0; prev < this._previewTiles.length; prev++) { + this._layoutPreview(prev, this._previewTiles[prev], bottomBound); + } + }, + _createPreview: function (i, hashCode, bottomBound) { var frame = L.DomUtil.create('div', 'preview-frame', this._scrollContainer); this._addDnDHandlers(frame); @@ -215,6 +237,12 @@ L.Control.PartsPreview = L.Control.extend({ } }, this); + this._layoutPreview(i, img, bottomBound); + + return img; + }, + + _layoutPreview: function (i, img, bottomBound) { var topBound = this._previewContTop; var previewFrameTop = 0; var previewFrameBottom = 0; @@ -260,7 +288,7 @@ L.Control.PartsPreview = L.Control.extend({ var imgWidth = imgSize.width; if (imgSize.width < previewImgMinWidth) imgHeight = Math.round(imgHeight * previewImgMinWidth / imgSize.width); - var previewFrameBB = frame.getBoundingClientRect(); + var previewFrameBB = img.parentElement.getBoundingClientRect(); if (this._direction === 'x') { this._previewFrameMargin = previewFrameBB.left - this._previewContTop; this._previewImgHeight = imgWidth; @@ -271,8 +299,6 @@ L.Control.PartsPreview = L.Control.extend({ this._previewFrameHeight = imgHeight + 2 * previewImgBorder; } } - - return img; }, _setPart: function (e) { ___ 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/src
loleaflet/src/control/Control.PartsPreview.js | 38 +++--- 1 file changed, 17 insertions(+), 21 deletions(-) New commits: commit 7bf6c0604376bb0f1a33fdcc81e67ccf9b84c6f6 Author: Henry Castro AuthorDate: Thu Jul 2 15:13:12 2020 -0400 Commit: Henry Castro CommitDate: Tue Aug 11 21:45:04 2020 +0200 loleafet: simplify to compute the bottom bound of the preview thumbnails Change-Id: I5ee8c5b4182b2752821fcd3bba022bc4b3db42d1 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97778 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100549 diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index 84b8a1579..934b4b179 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -86,18 +86,9 @@ L.Control.PartsPreview = L.Control.extend({ $('.scroll-container').mCustomScrollbar('update'); }, this), 500); } - var previewContBB = this._partsPreviewCont.getBoundingClientRect(); - var bottomBound; this.createScrollbar(); - - if (this._direction === 'x') { - this._previewContTop = previewContBB.left; - bottomBound = previewContBB.right + previewContBB.width / 2; - } else { - this._previewContTop = previewContBB.top; - bottomBound = previewContBB.bottom + previewContBB.height / 2; - } + var bottomBound = this._getBottomBound(); this._map.on('click', function() { this.partsFocused = false; @@ -182,17 +173,7 @@ L.Control.PartsPreview = L.Control.extend({ return; } - var previewContBB = this._partsPreviewCont.getBoundingClientRect(); - var bottomBound; - - if (this._direction === 'x') { - this._previewContTop = previewContBB.left; - bottomBound = previewContBB.right + previewContBB.width / 2; - } else { - this._previewContTop = previewContBB.top; - bottomBound = previewContBB.bottom + previewContBB.height / 2; - } - + var bottomBound = this._getBottomBound(); for (var prev = 0; prev < this._previewTiles.length; prev++) { this._layoutPreview(prev, this._previewTiles[prev], bottomBound); } @@ -242,6 +223,21 @@ L.Control.PartsPreview = L.Control.extend({ return img; }, + _getBottomBound: function () { + var previewContBB = this._partsPreviewCont.getBoundingClientRect(); + var bottomBound; + + if (this._direction === 'x') { + this._previewContTop = previewContBB.left; + bottomBound = previewContBB.right + previewContBB.width / 2; + } else { + this._previewContTop = previewContBB.top; + bottomBound = previewContBB.bottom + previewContBB.height / 2; + } + + return bottomBound; + }, + _layoutPreview: function (i, img, bottomBound) { var topBound = this._previewContTop; var previewFrameTop = 0; ___ 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/src
loleaflet/src/control/Control.AlertDialog.js | 12 loleaflet/src/control/Control.ContextMenu.js |2 +- loleaflet/src/control/Toolbar.js | 15 ++- loleaflet/src/unocommands.js |1 + 4 files changed, 16 insertions(+), 14 deletions(-) New commits: commit 0c84261a2a915d2b1e1601d0b77646033c8f2da7 Author: gokaysatir AuthorDate: Sat Aug 8 20:32:27 2020 +0300 Commit: Jan Holesovsky CommitDate: Tue Aug 11 19:12:24 2020 +0200 loleaflet: remove edit button from open hyperlink modal. Change-Id: I597281b136a41c49954c66f50fd546a209bba75a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100534 Reviewed-by: Szymon Kłos Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/src/control/Control.AlertDialog.js b/loleaflet/src/control/Control.AlertDialog.js index c73d87d92..67224907a 100644 --- a/loleaflet/src/control/Control.AlertDialog.js +++ b/loleaflet/src/control/Control.AlertDialog.js @@ -68,18 +68,6 @@ L.Control.AlertDialog = L.Control.extend({ }); } - if (this._map.getDocType() != 'presentation') { - buttonsList.push({ - text: _('Edit'), - type: 'button', - className: 'vex-dialog-button-secondary', - click: function editClick () { - vex.closeAll(); - e.map.showHyperlinkDialog(); - } - }); - } - vex.dialog.open({ message: messageText, showCloseButton: true, diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index c4449340e..107da8ba0 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -22,7 +22,7 @@ L.Control.ContextMenu = L.Control.extend({ */ general: ['Cut', 'Copy', 'Paste', 'Delete', 'NumberingStart', 'ContinueNumbering', 'IncrementLevel', 'DecrementLevel', - 'OpenHyperlinkOnCursor', 'CopyHyperlinkLocation', 'RemoveHyperlink', + 'OpenHyperlinkOnCursor', 'EditHyperlink', 'CopyHyperlinkLocation', 'RemoveHyperlink', 'AnchorMenu', 'SetAnchorToPage', 'SetAnchorToPara', 'SetAnchorAtChar', 'SetAnchorToChar', 'SetAnchorToFrame', 'WrapMenu', 'WrapOff', 'WrapOn', 'WrapIdeal', 'WrapLeft', 'WrapRight', 'WrapThrough', diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 19b899d75..4bf98dc0e 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -156,8 +156,20 @@ L.Map.include({ this._socket.sendMessage(msg); }, + messageNeedsToBeRedirected: function(command) { + if (command === '.uno:EditHyperlink') { + var that = this; + setTimeout(function () { that.showHyperlinkDialog(); }, 500); + return true; + } + else { + return false; + } + }, + sendUnoCommand: function (command, json) { var isAllowedInReadOnly = command == '.uno:WordCountDialog'; + var hasOpenedDialog = this.dialog.hasOpenedDialog(); if (hasOpenedDialog) { $('.lokdialog_container').addClass('lokblink'); @@ -165,7 +177,8 @@ L.Map.include({ $('.lokdialog_container').removeClass('lokblink'); }, 600); } else if (this.isPermissionEdit() || isAllowedInReadOnly) { - this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : '')); + if (!this.messageNeedsToBeRedirected(command)) + this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : '')); } }, diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js index 449880c74..50434e965 100644 --- a/loleaflet/src/unocommands.js +++ b/loleaflet/src/unocommands.js @@ -221,6 +221,7 @@ var unoCommandsArray = { ObjectForwardOne:{global:{menu:_('Forward One'),},}, OnlineAutoFormat:{text:{menu:_('~While Typing'),},}, OpenHyperlinkOnCursor:{global:{menu:_('Open Hyperlink'),},}, + EditHyperlink:{global:{menu:_('
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/layer/tile/CalcTileLayer.js |3 +++ 1 file changed, 3 insertions(+) New commits: commit 7fe69e2c193c4f7fd736f1a7e69b78e806cfc97e Author: Szymon Kłos AuthorDate: Mon Aug 10 14:43:44 2020 +0200 Commit: Jan Holesovsky CommitDate: Tue Aug 11 13:37:43 2020 +0200 Show availible user avatars in comments in calc Shows only for users which are present in the session as oly for them we have available data. Change-Id: I26b7c7f4358873216dba9fbf69a2608b1bf0803f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100430 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js index 1e82f2598..c636d04ca 100644 --- a/loleaflet/src/layer/tile/CalcTileLayer.js +++ b/loleaflet/src/layer/tile/CalcTileLayer.js @@ -465,6 +465,9 @@ L.CalcTileLayer = L.TileLayer.extend({ for (var index in values.comments) { comment = values.comments[index]; comment.tab = parseInt(comment.tab); + if (comment.author in this._map._viewInfoByUserName) { + comment.avatar = this._map._viewInfoByUserName[comment.author].userextrainfo.avatar; + } comment.cellPos = L.LOUtil.stringToBounds(comment.cellPos); comment.cellPos = L.latLngBounds(this._twipsToLatLng(comment.cellPos.getBottomLeft()), this._twipsToLatLng(comment.cellPos.getTopRight())); ___ 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/src
loleaflet/src/control/Control.JSDialogBuilder.js | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) New commits: commit 97fe8ac3209f952262e515ec05eac655a44f00c9 Author: Szymon Kłos AuthorDate: Mon Aug 10 13:24:15 2020 +0200 Commit: Jan Holesovsky CommitDate: Tue Aug 11 13:35:44 2020 +0200 Don't ignore 'transparent' value for color Change-Id: Ie843e85fca76b5aad875426c661e9305c954d627 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100429 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 6a2f8e0aa..980ba21e7 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1722,6 +1722,13 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, + parseHexColor: function(color) { + if (color === 'transparent') + return -1; + else + return parseInt('0x' + color); + }, + _sendColorCommand: function(builder, data, color) { var gradientItem; @@ -1752,7 +1759,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ var params = {}; params[data.id] = { type : 'long', - value : parseInt('0x' + color) + value : builder.parseHexColor(color) }; builder.map['stateChangeHandler'].setItemValue(data.command, params[data.id].value); @@ -1764,7 +1771,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ // update the item state as we send var items = builder.map['stateChangeHandler']; - items.setItemValue(data.command, parseInt('0x' + color)); + items.setItemValue(data.command, builder.parseHexColor(color)); builder.map.sendUnoCommand(command); }, ___ 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/src
loleaflet/src/core/Socket.js |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 6b05c81ffed4496586705c8c825d93b45d0f2257 Author: Szymon Kłos AuthorDate: Tue Aug 4 09:27:00 2020 +0200 Commit: Aron Budea CommitDate: Tue Aug 11 05:43:15 2020 +0200 Don't show [object Window] in about dialog Change-Id: I4ba1ab2fa443a46dd205411da558980ddee44865 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100043 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Szymon Kłos (cherry picked from commit d6bfb8867495f34010620b68a8d298e96cb51d56) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100359 Reviewed-by: Aron Budea diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 41b173209..a5f8ee5ed 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -283,7 +283,7 @@ L.Socket = L.Class.extend({ this.WSDServer = JSON.parse(textMsg.substring(textMsg.indexOf('{'))); var h = this.WSDServer.Hash; if (parseInt(h,16).toString(16) === h.toLowerCase().replace(/^0+/, '')) { - h = 'https://hub.libreoffice.org/git-online/' + h + '\');">' + h + ''; + h = 'https://hub.libreoffice.org/git-online/' + h + '\'));">' + h + ''; $('#loolwsd-version').html(this.WSDServer.Version + ' (git hash: ' + h + ')'); } else { @@ -306,7 +306,7 @@ L.Socket = L.Class.extend({ var lokitVersionObj = JSON.parse(textMsg.substring(textMsg.indexOf('{'))); h = lokitVersionObj.BuildId.substring(0, 7); if (parseInt(h,16).toString(16) === h.toLowerCase().replace(/^0+/, '')) { - h = 'https://hub.libreoffice.org/git-core/' + h + '\');">' + h + ''; + h = 'https://hub.libreoffice.org/git-core/' + h + '\'));">' + h + ''; } $('#lokit-version').html(lokitVersionObj.ProductName + ' ' + lokitVersionObj.ProductVersion + lokitVersionObj.ProductExtension.replace('.10.','-') + ___ 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/src
loleaflet/src/control/Control.Menubar.js |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit 22649095ea1f0bace04c78766052915242097001 Author: Szymon Kłos AuthorDate: Thu Aug 6 11:42:35 2020 +0200 Commit: Jan Holesovsky CommitDate: Mon Aug 10 21:15:48 2020 +0200 Add missing table operations to menu in Impress Change-Id: I1f644b0a69ee2eb17edf4c64f7de3e13b39e6192 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100207 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index d888a0740..f08d5d966 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -338,7 +338,12 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:InsertColumnsAfter'}]}, {name: _UNO('.uno:TableDeleteMenu', 'text'/*HACK should be 'presentation', but not in xcu*/), type: 'menu', menu: [ {uno: '.uno:DeleteRows'}, - {uno: '.uno:DeleteColumns'}]}, + {uno: '.uno:DeleteColumns'}, + {uno: '.uno:DeleteTable'}]}, + {name: _UNO('.uno:TableSelectMenu', 'text'), type: 'menu', menu: [ + {uno: '.uno:SelectTable'}, + {uno: '.uno:EntireRow'}, + {uno: '.uno:EntireColumn'}]}, {uno: '.uno:MergeCells'}] }, {name: _UNO('.uno:SlideMenu', 'presentation'), type: 'menu', menu: [ ___ 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/src
loleaflet/src/control/Control.StatusBar.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c41bb0f40c5b71eda323544f3d246b7053cdf07e Author: gokaysatir AuthorDate: Thu Jul 16 12:57:37 2020 +0300 Commit: Aron Budea CommitDate: Mon Aug 10 02:11:22 2020 +0200 loleaflet: Status bar quick views don't work. Change-Id: I68253955a97a79f7ccfecff9d3e26cb5e4a2032b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/9 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro (cherry picked from commit bd28756cde488747bac8f2d1e08d100f974468e9) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100355 Reviewed-by: Aron Budea diff --git a/loleaflet/src/control/Control.StatusBar.js b/loleaflet/src/control/Control.StatusBar.js index 59f567ad7..e9696243d 100644 --- a/loleaflet/src/control/Control.StatusBar.js +++ b/loleaflet/src/control/Control.StatusBar.js @@ -169,7 +169,7 @@ L.Control.StatusBar = L.Control.extend({ } }; this.map.sendUnoCommand('.uno:StatusBarFunc', command); - }); + }.bind(this)); } else if (id === 'userlist') { this.map.fire('openuserlist'); ___ 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/src
loleaflet/src/core/Socket.js |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 8409f1ce2f6585aa82b0b21c7e9bb791f48b6a1b Author: Szymon Kłos AuthorDate: Thu Aug 6 14:27:59 2020 +0200 Commit: Szymon Kłos CommitDate: Thu Aug 6 15:22:25 2020 +0200 Fix resuming after idle In other apps than Calc there was an error when trying to resume after idle: Uncaught TypeError: Cannot set property 'id' of null at HTMLDivElement.restartConnectionFn (Socket.js:490) Change-Id: I0b3c8d907aa220a3b9504ff62b0437c121bd3619 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100241 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 77c813232..41b173209 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -487,7 +487,8 @@ L.Socket = L.Class.extend({ console.debug('idleness: reactivating'); map._documentIdle = false; // force reinitialization of calcInputBar(formulabar) - map.dialog._calcInputBar.id = null; + if (map.dialog._calcInputBar) + map.dialog._calcInputBar.id = null; return map._activate(); } return 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/src
loleaflet/src/control/Control.ColumnHeader.js |4 ++-- loleaflet/src/control/Control.ContextMenu.js|2 +- loleaflet/src/control/Control.Header.js |2 +- loleaflet/src/control/Control.LokDialog.js |2 +- loleaflet/src/control/Control.Menubar.js| 14 +++--- loleaflet/src/control/Control.MobileTopBar.js |2 +- loleaflet/src/control/Control.MobileWizard.js |2 +- loleaflet/src/control/Control.NotebookbarBuilder.js |2 +- loleaflet/src/control/Control.PresentationBar.js|2 +- loleaflet/src/control/Control.RowHeader.js |4 ++-- loleaflet/src/control/Control.SearchBar.js |4 ++-- loleaflet/src/control/Control.Tabs.js |2 +- loleaflet/src/control/Control.Toolbar.js| 12 ++-- loleaflet/src/control/Parts.js |2 +- loleaflet/src/control/Permission.js | 14 +++--- loleaflet/src/control/Ruler.js |4 ++-- loleaflet/src/control/Toolbar.js| 12 ++-- loleaflet/src/layer/marker/Annotation.js|2 +- loleaflet/src/layer/marker/TextInput.js |2 +- loleaflet/src/layer/tile/GridLayer.js |2 +- loleaflet/src/layer/tile/TileLayer.TableOverlay.js |2 +- loleaflet/src/layer/tile/TileLayer.js | 18 +- loleaflet/src/map/Map.js|4 ++-- loleaflet/src/map/handler/Map.Keyboard.js |4 ++-- loleaflet/src/map/handler/Map.Mouse.js |2 +- loleaflet/src/map/handler/Map.TouchGesture.js |4 ++-- loleaflet/src/map/handler/Map.WOPI.js |4 ++-- 27 files changed, 69 insertions(+), 61 deletions(-) New commits: commit 2f9b1bdc54a3e47bc1944cc50d89e4865287c8ec Author: Tomaž Vajngerl AuthorDate: Sun Jul 12 12:44:09 2020 +0200 Commit: Pranam Lashkari CommitDate: Thu Aug 6 08:15:35 2020 +0200 Add functions for getting edit or readonly permission, refactor Instead of always checking the map._permission value, use the isPermissionReadOnly and isPermissionEdit functions. Refactor the code to use those. Change-Id: I77ccd278b98a9318344c9b80c17be7cda09f00f8 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98592 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100193 Reviewed-by: Pranam Lashkari diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index 8c049fd93..a18b707bd 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -101,7 +101,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ var menuData = L.Control.JSDialogBuilder.getMenuStructureForMobileWizard(this._menuItem, true, ''); (new Hammer(this._canvas, {recognizers: [[Hammer.Press]]})) .on('press', L.bind(function () { - if (this._map._permission === 'edit') { + if (this._map.isPermissionEdit()) { window.contextMenuWizard = true; this._map.fire('mobilewizard', menuData); } @@ -440,7 +440,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({ this.mouseInit(canvas); if ($('.spreadsheet-header-columns').length > 0) { - $('.spreadsheet-header-columns').contextMenu(this._map._permission === 'edit'); + $('.spreadsheet-header-columns').contextMenu(this._map.isPermissionEdit()); } }, diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 82bd501c5..c4449340e 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -113,7 +113,7 @@ L.Control.ContextMenu = L.Control.extend({ _onContextMenu: function(obj) { var map = this._map; - if (map._permission !== 'edit') { + if (!map.isPermissionEdit()) { return; } diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index 5aeac06da..0980c1f2b 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -266,7 +266,7 @@ L.Control.Header = L.Control.extend({ }, _onPan: function (event) { - if (event.pointerType !== 'touch' || this._map._permission !== 'edit') + if (event.pointerType !== 'touch' || !this._map.isPermissionEdit()) return; if (event.type
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Control.SheetsBar.js |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 0b37aa3f7f2f5b86b37af28ea10bbd962d1df8fb Author: Andras Timar AuthorDate: Tue Aug 4 15:38:27 2020 +0200 Commit: Andras Timar CommitDate: Tue Aug 4 23:28:43 2020 +0200 Related tdf#95138 loleaflet: change tooltips for sheet navigation buttons Change-Id: I2bc363058cb67a3d32851b3d90b9db39d5f45a03 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100060 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.SheetsBar.js b/loleaflet/src/control/Control.SheetsBar.js index 1a9696a09..eeddb0538 100644 --- a/loleaflet/src/control/Control.SheetsBar.js +++ b/loleaflet/src/control/Control.SheetsBar.js @@ -25,10 +25,10 @@ L.Control.SheetsBar = L.Control.extend({ tooltip: 'bottom', hidden: true, items: [ - {type: 'button', hidden: !this.options.shownavigation, id: 'firstrecord', img: 'firstrecord', hint: _('First sheet')}, - {type: 'button', hidden: !this.options.shownavigation, id: 'prevrecord', img: 'prevrecord', hint: _('Previous sheet')}, - {type: 'button', hidden: !this.options.shownavigation, id: 'nextrecord', img: 'nextrecord', hint: _('Next sheet')}, - {type: 'button', hidden: !this.options.shownavigation, id: 'lastrecord', img: 'lastrecord', hint: _('Last sheet')}, + {type: 'button', hidden: !this.options.shownavigation, id: 'firstrecord', img: 'firstrecord', hint: _('Scroll to the first sheet')}, + {type: 'button', hidden: !this.options.shownavigation, id: 'prevrecord', img: 'prevrecord', hint: _('Scroll left')}, + {type: 'button', hidden: !this.options.shownavigation, id: 'nextrecord', img: 'nextrecord', hint: _('Scroll right')}, + {type: 'button', hidden: !this.options.shownavigation, id: 'lastrecord', img: 'lastrecord', hint: _('Scroll to the last sheet')}, {type: 'button', id: 'insertsheet', img: 'insertsheet', hint: _('Insert sheet')} ], onClick: function (e) { ___ 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/src
loleaflet/src/layer/marker/ProgressOverlay.js | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) New commits: commit 20ad87f6cb426076cbb4d5eb5162cd09f97f3797 Author: Szymon Kłos AuthorDate: Wed Jul 29 20:57:18 2020 +0200 Commit: Andras Timar CommitDate: Fri Jul 31 00:51:55 2020 +0200 Add progressbar on demand This fixes bug in Android app where progressbar was added without any condition. Change-Id: I535001fce4ae37da4f5dc87031d9c15db043d655 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99750 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/marker/ProgressOverlay.js b/loleaflet/src/layer/marker/ProgressOverlay.js index 82306cbda..cec7ee489 100644 --- a/loleaflet/src/layer/marker/ProgressOverlay.js +++ b/loleaflet/src/layer/marker/ProgressOverlay.js @@ -3,7 +3,7 @@ * L.ProgressOverlay is used to overlay progress images over the map. */ - /* global brandProductName */ + /* global brandProductName $ */ L.ProgressOverlay = L.Layer.extend({ options: { @@ -17,8 +17,9 @@ L.ProgressOverlay = L.Layer.extend({ this.intervalTimer = undefined; }, + // create layout but don't add to the DOM yet. _initLayout: function () { - this._container = L.DomUtil.create('div', 'leaflet-progress-layer', L.DomUtil.get('document-container')); + this._container = L.DomUtil.create('div', 'leaflet-progress-layer'); this._spinner = L.DomUtil.create('div', 'leaflet-progress-spinner', this._container); this._spinnerCanvas = L.DomUtil.create('canvas', 'leaflet-progress-spinner-canvas', this._spinner); @@ -51,6 +52,16 @@ L.ProgressOverlay = L.Layer.extend({ this._spinnerInterval = undefined; }, + showSpinner: function() { + L.DomUtil.get('document-container').appendChild(this._container); + this._spinnerInterval = L.LOUtil.startSpinner(this._spinnerCanvas, this.options.spinnerSpeed); + }, + + hideSpinner: function() { + if (this._container) + $(this._container).remove(); + }, + // Show the progress bar, but only if things seem slow delayedStart: function(map, label, bar) { this.setLabel(label); @@ -67,7 +78,7 @@ L.ProgressOverlay = L.Layer.extend({ switch (self.state) { // 0.5s -> start the spinner case 1: - self._spinnerInterval = L.LOUtil.startSpinner(self._spinnerCanvas, self.options.spinnerSpeed); + self.showSpinner(); break; // 2s -> enable the progress bar if we have one & it's low case 4: @@ -85,10 +96,7 @@ L.ProgressOverlay = L.Layer.extend({ // Hide ourselves if there is anything to hide end: function() { this.shutdownTimer(); - - if (this._container) - L.DomUtil.get('document-container').removeChild(this._container); - this._container = undefined; + this.hideSpinner(); }, setLabel: function (label) { ___ 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/src
loleaflet/src/layer/marker/ProgressOverlay.js | 58 +- 1 file changed, 22 insertions(+), 36 deletions(-) New commits: commit 487be77dc433be99ae28937f9e55973185106a21 Author: Szymon Kłos AuthorDate: Wed Jul 29 16:48:39 2020 +0200 Commit: Szymon Kłos CommitDate: Wed Jul 29 17:34:57 2020 +0200 More cleanup in the progressbar code Change-Id: I8bb27f9ef989e01ecf29d4ee7b9753ed10fb0483 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99708 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/loleaflet/src/layer/marker/ProgressOverlay.js b/loleaflet/src/layer/marker/ProgressOverlay.js index fe6286279..82306cbda 100644 --- a/loleaflet/src/layer/marker/ProgressOverlay.js +++ b/loleaflet/src/layer/marker/ProgressOverlay.js @@ -17,21 +17,6 @@ L.ProgressOverlay = L.Layer.extend({ this.intervalTimer = undefined; }, - onAdd: function () { - this._spinnerInterval = L.LOUtil.startSpinner(this._spinnerCanvas, this.options.spinnerSpeed); - }, - - onRemove: function () { - if (this._container) { - L.DomUtil.get('document-container').removeChild(this._container); - this._container = null; - } - - if (this._spinnerInterval) { - clearInterval(this._spinnerInterval); - } - }, - _initLayout: function () { this._container = L.DomUtil.create('div', 'leaflet-progress-layer', L.DomUtil.get('document-container')); this._spinner = L.DomUtil.create('div', 'leaflet-progress-spinner', this._container); @@ -60,6 +45,10 @@ L.ProgressOverlay = L.Layer.extend({ if (this.intervalTimer) clearInterval(this.intervalTimer); this.intervalTimer = undefined; + + if (this._spinnerInterval) + clearInterval(this._spinnerInterval); + this._spinnerInterval = undefined; }, // Show the progress bar, but only if things seem slow @@ -78,8 +67,7 @@ L.ProgressOverlay = L.Layer.extend({ switch (self.state) { // 0.5s -> start the spinner case 1: - if (!map.hasLayer(self)) - map.addLayer(self); + self._spinnerInterval = L.LOUtil.startSpinner(self._spinnerCanvas, self.options.spinnerSpeed); break; // 2s -> enable the progress bar if we have one & it's low case 4: @@ -91,43 +79,41 @@ L.ProgressOverlay = L.Layer.extend({ self.setBar(bar); break; } - if (!map.hasLayer(self)) { - map.addLayer(self); - } }, 500 /* ms */); }, // Hide ourselves if there is anything to hide - end: function(map) { + end: function() { this.shutdownTimer(); - if (map.hasLayer(this)) { - map.removeLayer(this); - } - if (this._container) { + + if (this._container) L.DomUtil.get('document-container').removeChild(this._container); - this._container = null; - } + this._container = undefined; }, setLabel: function (label) { - if (this._label.innerHTML !== label) { + if (this._container && this._label.innerHTML !== label) { this._label.innerHTML = label; } }, setBar: function (bar) { - if (bar) { - this._progress.style.visibility = ''; - } - else { - this._progress.style.visibility = 'hidden'; + if (this._container) { + if (bar) { + this._progress.style.visibility = ''; + } + else { + this._progress.style.visibility = 'hidden'; + } } }, setValue: function (value) { - this._percent = value; - this._bar.style.width = value + '%'; - this._value.innerHTML = value + '%'; + if (this._container) { + this._percent = value; + this._bar.style.width = value + '%'; + this._value.innerHTML = value + '%'; + } }
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Control.PartsPreview.js |7 --- 1 file changed, 7 deletions(-) New commits: commit dd48c6eac20a5ce1a40ac15aae5d22daa17945c6 Author: Pranam Lashkari AuthorDate: Tue Jul 28 17:23:11 2020 +0530 Commit: Andras Timar CommitDate: Wed Jul 29 11:27:07 2020 +0200 leaflet: resolved error in the drop of slide preview error: Control.PartsPreview.js:633 Uncaught TypeError: Cannot read property 'maxWidth' of undefined Change-Id: I618238339187d24312fce4f8eb74f8d331f0d8b4 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99625 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index 2a0efecdd..860ad6bb7 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -539,13 +539,6 @@ L.Control.PartsPreview = L.Control.extend({ if (partId < 0) partId = -1; // First item is -1. this.partsPreview._map._socket.sendMessage('moveselectedclientparts position=' + partId); - // Update previews, after a second, since we only get the dragged one invalidated. - var that = this.partsPreview; - setTimeout(function () { - for (var i = 0; i < that._previewTiles.length; ++i) { - that._map.getPreview(i, this.options.maxWidth, this.options.maxHeight, {autoUpdate: that.options.autoUpdate, broadcast: true}); - } - }, 1000); } this.classList.remove('preview-img-dropsite'); ___ 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/src
loleaflet/src/control/Control.DocumentNameInput.js | 36 - loleaflet/src/core/Util.js |9 + 2 files changed, 37 insertions(+), 8 deletions(-) New commits: commit 9091114121aa52f4112625d2a66ec357eba58d6c Author: Marco Cecchetti AuthorDate: Mon Jul 20 18:53:18 2020 +0200 Commit: Andras Timar CommitDate: Wed Jul 29 10:17:49 2020 +0200 leaflet: setup document name input field width Change-Id: I654bdea578c8768c62db08bd488613f983336d43 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99140 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99512 diff --git a/loleaflet/src/control/Control.DocumentNameInput.js b/loleaflet/src/control/Control.DocumentNameInput.js index a01a974f1..16dd68dbd 100644 --- a/loleaflet/src/control/Control.DocumentNameInput.js +++ b/loleaflet/src/control/Control.DocumentNameInput.js @@ -11,6 +11,7 @@ L.Control.DocumentNameInput = L.Control.extend({ map.on('doclayerinit', this.onDocLayerInit, this); map.on('wopiprops', this.onWopiProps, this); + map.on('resize', this.onResize, this); $('#document-title-pencil').addClass('editable'); }, @@ -42,11 +43,13 @@ L.Control.DocumentNameInput = L.Control.extend({ documentNameCancel: function() { $('#document-name-input').val(this.map['wopi'].BreadcrumbDocName); + this._setNameInputWidth(); this.map._onGotFocus(); }, onDocumentNameKeyPress: function(e) { - $('#document-name-input').css('width',(($('#document-name-input').val().length + 1) * 10) + 'px'); + var tail = (e.keyCode !== 13 && e.keyCode !== 27) ? 'X' : null; + this._setNameInputWidth(tail); if (e.keyCode === 13) { // Enter key this.documentNameConfirm(); } else if (e.keyCode === 27) { // Escape key @@ -66,13 +69,7 @@ L.Control.DocumentNameInput = L.Control.extend({ }, onDocLayerInit: function() { - var value = $('#document-name-input').val(); - if (value.length < 27) { - $('#document-name-input').attr('size', value.length); - } - else { - $('#document-name-input').attr('size', '25'); - } + this._setNameInputWidth(); // FIXME: Android app would display a temporary filename, not the actual filename if (window.ThisIsTheAndroidApp) { @@ -114,6 +111,29 @@ L.Control.DocumentNameInput = L.Control.extend({ $('#document-title-pencil').removeClass('editable'); $('#document-name-input').off('keypress', this.onDocumentNameKeyPress); } + }, + + onResize: function() { + this._setNameInputWidth(); + }, + + _getMaxAvailableWidth: function() { + var x = $('#document-titlebar').prop('offsetLeft') + $('.document-title').prop('offsetLeft') + $('#document-name-input').prop('offsetLeft'); + var containerWidth = parseInt($('.main-nav').css('width')); + var maxWidth = Math.max(containerWidth - x - 30, 0); + maxWidth = Math.max(maxWidth, 300); // input field at least 300px + return maxWidth; + }, + + _setNameInputWidth: function(tail) { + var documentNameInput = $('#document-name-input'); + var content = (typeof tail === 'string') ? documentNameInput.val() + tail : documentNameInput.val(); + var font = documentNameInput.css('font'); + var textWidth = L.getTextWidth(content, font) + 10; + var maxWidth = this._getMaxAvailableWidth(); + //console.log('_setNameInputWidth: textWidth: ' + textWidth + ', maxWidth: ' + maxWidth); + textWidth = Math.min(textWidth, maxWidth); + documentNameInput.css('width', textWidth + 'px'); } }); diff --git a/loleaflet/src/core/Util.js b/loleaflet/src/core/Util.js index 0ea2b0ff6..596dfa756 100644 --- a/loleaflet/src/core/Util.js +++ b/loleaflet/src/core/Util.js @@ -199,6 +199,14 @@ L.Util = { mm100thToInch: function(mm) { return mm / 2540; + }, + + getTextWidth: function(text, font) { + var canvas = L.Util.getTextWidth._canvas || (L.Util.getTextWidth._canvas = document.createElement('canvas')); + var context = canvas.getContext('2d'); + context.font = font; + var metrics = context.measureText(text); + return Math.floor(metrics.width); } }; @@ -261,3 +269,4 @@ L.getDpiScaleFactor = L.Util.getDpiScaleFactor; L.toggleFullScreen = L.Util.toggleFullScreen;
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Control.PartsPreview.js |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 8a4b48dd770badce2d597f9a3548b18bfe4d2e41 Author: Pranam Lashkari AuthorDate: Mon Jun 29 15:03:05 2020 +0530 Commit: Andras Timar CommitDate: Wed Jul 29 10:16:12 2020 +0200 leaflet: prevent losing selection while dragging multiple slides Change-Id: Ia7dca36495d802f2c55648cf0a33ae8d71124d64 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99598 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index ff510b7c2..2a0efecdd 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -497,8 +497,11 @@ L.Control.PartsPreview = L.Control.extend({ var part = $(this.partsPreview._partsPreviewCont).find('.mCSB_container .preview-frame').index(e.target.parentNode); if (part !== null) { var partId = parseInt(part) - 1; // The first part is just a drop-site for reordering. - this.partsPreview._map.setPart(partId); - this.partsPreview._map.selectPart(partId, 1, false); // And select. + if (this.partsPreview._map._docLayer && !this.partsPreview._map._docLayer._selectedParts.includes(partId)) + { + this.partsPreview._map.setPart(partId); + this.partsPreview._map.selectPart(partId, 1, false); // And select. + } } // By default we move when dragging, but can // support duplication with ctrl in the future. ___ 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/src
loleaflet/src/layer/marker/Annotation.js |2 ++ 1 file changed, 2 insertions(+) New commits: commit 8b5cc4c00e899df68acb0635c12f07dbbd832a11 Author: Pranam Lashkari AuthorDate: Thu Jul 16 01:49:58 2020 +0530 Commit: Andras Timar CommitDate: Wed Jul 29 10:15:05 2020 +0200 tdf#132125 leaflet: setting annotations active and inactive on focus adding these classes help in pasting text in comments in calc and impress Change-Id: Id94e6017d1db5f024f4ebfa287051c799c225ec9 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99532 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 4766687a3..423089011 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -127,6 +127,7 @@ L.Annotation = L.Layer.extend({ }, focus: function () { + $(this._container).addClass('annotation-active'); this._nodeModifyText.focus(); this._nodeReplyText.focus(); }, @@ -295,6 +296,7 @@ L.Annotation = L.Layer.extend({ }, _onLostFocus: function (e) { + $(this._container).removeClass('annotation-active'); if (this._contentText.origText !== this._nodeModifyText.value) { this._onSaveComment(e); } ___ 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/src
loleaflet/src/map/Clipboard.js |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 45c1818bdf2711aca00d91e9935690251688b758 Author: Pranam Lashkari AuthorDate: Thu Jun 25 16:42:19 2020 +0530 Commit: Andras Timar CommitDate: Wed Jul 29 10:14:36 2020 +0200 tdf#132125: leaflet: Pasting text into comments pastes into the document instead Change-Id: Ibfc3a4519da13dfbe12082a4cd98b7a0060d3838 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99531 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index ce8ccb195..8043a1a98 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -3,7 +3,7 @@ * L.Clipboard is used to abstract our storage and management of * local & remote clipboard data. */ -/* global _ vex brandProductName isAnyVexDialogActive */ +/* global _ vex brandProductName isAnyVexDialogActive $ */ // Get all interesting clipboard related events here, and handle // download logic in one place ... @@ -681,6 +681,9 @@ L.Clipboard = L.Class.extend({ if (isAnyVexDialogActive() && !this._map.hasFocus()) return; + if ($('.annotation-active').length > 0 && !this._map.hasFocus()) + return; + // If the focus is in the search box, paste there. if (this._map.isSearching()) return; ___ 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/src
loleaflet/src/control/Control.Toolbar.js |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 49e19c2baebf593d6873f207f1a4829b9d98979a Author: Szymon Kłos AuthorDate: Tue Jul 28 10:08:37 2020 +0200 Commit: Henry Castro CommitDate: Tue Jul 28 17:06:30 2020 +0200 Use more reliable approach to show close button Sometimes using Chrome browser close button is not shown after calling show(): replace it with css modification which seems to be more reliable. Also don't show close button on mobile devices where we have hamburger menu. Change-Id: Id354374f18e24fcbdd9afb3894c40cccfe2811ea Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99573 Tested-by: Jenkins CollaboraOffice Reviewed-by: Henry Castro diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index bb7776109..634e8bf32 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -1054,12 +1054,12 @@ function setupToolbar(e) { map.on('commandresult', onCommandResult); map.on('updateparts pagenumberchanged', onUpdateParts); - if (map.options.wopi && L.Params.closeButtonEnabled) { - $('#closebuttonwrapper').show(); + if (map.options.wopi && L.Params.closeButtonEnabled && !window.mode.isMobile()) { + $('#closebuttonwrapper').css('display', 'block'); } else if (!L.Params.closeButtonEnabled) { $('#closebuttonwrapper').hide(); } else if (L.Params.closeButtonEnabled && !window.mode.isMobile()) { - $('#closebuttonwrapper').show(); + $('#closebuttonwrapper').css('display', 'block'); } $('#closebutton').click(function() { ___ 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/src
loleaflet/src/layer/tile/TileLayer.js | 88 +++--- 1 file changed, 50 insertions(+), 38 deletions(-) New commits: commit ed652b6a25ca613d2155b320db1deec476d96119 Author: Pranam Lashkari AuthorDate: Tue Jul 21 13:59:27 2020 +0530 Commit: Tamás Zolnai CommitDate: Tue Jul 28 13:27:45 2020 +0200 leaflet: fixed selection handler lagging behind Change-Id: Ic89a6827bac4511a8f9cd9afbcc2594cdc2046f3 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97897 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Tested-by: Tamás Zolnai Reviewed-by: Tamás Zolnai Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99528 diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 7df2df248..c31d2a896 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1810,6 +1810,7 @@ L.TileLayer = L.GridLayer.extend({ this._twipsToLatLng(bottomRightTwips, this._map.getZoom())); this._updateScrollOnCellSelection(oldSelection, this._textSelectionEnd); + this._updateMarkers(); } else { this._textSelectionEnd = null; @@ -3133,44 +3134,7 @@ L.TileLayer = L.GridLayer.extend({ this._isEmptyRectangle(this._textSelectionEnd)) { return; } - - var startPos = this._map.project(this._textSelectionStart.getSouthWest()); - var endPos = this._map.project(this._textSelectionEnd.getSouthWest()); - var startMarkerPos = this._map.project(startMarker.getLatLng()); - if (startMarkerPos.distanceTo(endPos) < startMarkerPos.distanceTo(startPos) && startMarker._icon && endMarker._icon) { - // if the start marker is actually closer to the end of the selection - // reverse icons and markers - L.DomUtil.removeClass(startMarker._icon, 'leaflet-selection-marker-start'); - L.DomUtil.removeClass(endMarker._icon, 'leaflet-selection-marker-end'); - L.DomUtil.addClass(startMarker._icon, 'leaflet-selection-marker-end'); - L.DomUtil.addClass(endMarker._icon, 'leaflet-selection-marker-start'); - var tmp = startMarker; - startMarker = endMarker; - endMarker = tmp; - } - else if (startMarker._icon && endMarker._icon) { - // normal markers and normal icons - L.DomUtil.removeClass(startMarker._icon, 'leaflet-selection-marker-end'); - L.DomUtil.removeClass(endMarker._icon, 'leaflet-selection-marker-start'); - L.DomUtil.addClass(startMarker._icon, 'leaflet-selection-marker-start'); - L.DomUtil.addClass(endMarker._icon, 'leaflet-selection-marker-end'); - } - - if (!startMarker.isDragged) { - var pos = this._map.project(this._textSelectionStart.getSouthWest()); - pos = pos.subtract(new L.Point(0, 2)); - pos = this._map.unproject(pos); - startMarker.setLatLng(pos); - this._map.addLayer(startMarker); - } - - if (!endMarker.isDragged) { - pos = this._map.project(this._textSelectionEnd.getSouthEast()); - pos = pos.subtract(new L.Point(0, 2)); - pos = this._map.unproject(pos); - endMarker.setLatLng(pos); - this._map.addLayer(endMarker); - } + this._updateMarkers(); } else { this._textSelectionStart = null; @@ -3183,6 +3147,54 @@ L.TileLayer = L.GridLayer.extend({ } }, + _updateMarkers: function() { + var startMarker, endMarker; + for (var key in this._selectionHandles) { + if (key === 'start') { + startMarker = this._selectionHandles[key]; + } + else if (key === 'end') { + endMarker = this._selectionHandles[key]; + } + } + + var startPos = this._map.project(this._textSelectionStart.getSouthWest()); +
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/core/Socket.js |2 ++ 1 file changed, 2 insertions(+) New commits: commit 40cf3253bbeb63369954bfda58cb7614aac68565 Author: Pranam Lashkari AuthorDate: Mon Jul 20 22:53:52 2020 +0530 Commit: Pranam Lashkari CommitDate: Mon Jul 27 17:16:04 2020 +0200 leaflet: resolved Formula bar disappears after session timeout calcinputbar used to disappear because of no proper initialization after sassion timeout and that set the wrong width which caused this problem this makes sure that when reconnecting after session timeout, first inputbar is unloaded and reloaded properly like first time (when doc was opened) Change-Id: Ifbf856d0e565e14b2ef697f342ef6d8e63a5fbd2 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96953 Reviewed-by: Ashod Nakashian Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice (cherry picked from commit 91dc50696655a56c312f08f7fbf06eb57ce0f258) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99291 Reviewed-by: Pranam Lashkari diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index f950194cc..b26fd758b 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -484,6 +484,8 @@ L.Socket = L.Class.extend({ { console.debug('idleness: reactivating'); map._documentIdle = false; + // force reinitialization of calcInputBar(formulabar) + map.dialog._calcInputBar.id = null; return map._activate(); } return 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/src
loleaflet/src/control/Toolbar.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 47f2d5453699116345be74aa9b4d92f2a3f37910 Author: Andras Timar AuthorDate: Fri Jul 24 11:32:37 2020 +0200 Commit: Andras Timar CommitDate: Fri Jul 24 13:59:23 2020 +0200 fix localization of Online Help TOC Change-Id: I2bdeeec3a24c15f6c881590f9cd11d9b13aaa011 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99360 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index fe67909f0..26f8463c6 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -310,7 +310,7 @@ L.Map.include({ for (i = 0, max = translatableContent.length; i < max; i++) { translatableContent[i].innerHTML = translatableContent[i].innerHTML.toLocaleString(); } - translatableContent = $vexContent.find('a'); // TOC + translatableContent = $vexContent.find('button'); // TOC for (i = 0, max = translatableContent.length; i < max; i++) { translatableContent[i].innerHTML = translatableContent[i].innerHTML.toLocaleString(); } ___ 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/src
loleaflet/src/core/Socket.js |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 018264f03f0b7d0b456c6153da8593d9f8f22ba0 Author: Gary Kim AuthorDate: Mon May 18 23:14:07 2020 +0800 Commit: Jan Holesovsky CommitDate: Thu Jul 23 19:38:52 2020 +0200 fix: remove target="_blank" on javascript open links Using target="_blank" on these links cause them to not work in browsers. This commit removes the attribute to fix the issue. Change-Id: I157f15589b17722aa5c0ef5eada02084fe5b2a5e Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94435 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Jan Holesovsky (cherry picked from commit 6d7128e79301c73557f65968b2f46740977e6364) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99301 Tested-by: Jan Holesovsky diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 9f48d3145..80decbee2 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -283,7 +283,7 @@ L.Socket = L.Class.extend({ this.WSDServer = JSON.parse(textMsg.substring(textMsg.indexOf('{'))); var h = this.WSDServer.Hash; if (parseInt(h,16).toString(16) === h.toLowerCase().replace(/^0+/, '')) { - h = 'https://hub.libreoffice.org/git-online/' + h + '\');">' + h + ''; + h = 'https://hub.libreoffice.org/git-online/' + h + '\');">' + h + ''; $('#loolwsd-version').html(this.WSDServer.Version + ' (git hash: ' + h + ')'); } else { @@ -306,7 +306,7 @@ L.Socket = L.Class.extend({ var lokitVersionObj = JSON.parse(textMsg.substring(textMsg.indexOf('{'))); h = lokitVersionObj.BuildId.substring(0, 7); if (parseInt(h,16).toString(16) === h.toLowerCase().replace(/^0+/, '')) { - h = 'https://hub.libreoffice.org/git-core/' + h + '\');">' + h + ''; + h = 'https://hub.libreoffice.org/git-core/' + h + '\');">' + h + ''; } $('#lokit-version').html(lokitVersionObj.ProductName + ' ' + lokitVersionObj.ProductVersion + lokitVersionObj.ProductExtension.replace('.10.','-') + ___ 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/src
loleaflet/src/control/Control.PartsPreview.js |1 + 1 file changed, 1 insertion(+) New commits: commit 69c21d5bb4d084cb8abc38b4176c8b40f12c8490 Author: Szymon Kłos AuthorDate: Fri Jul 17 14:45:48 2020 +0200 Commit: Andras Timar CommitDate: Tue Jul 21 20:49:05 2020 +0200 Keep slide sorter in line on mobile devices This prevents us from multi line slide sorter on mobile devices after new slide was added. Change-Id: Ibf0e7784e1f58f2706e1595f1cb0d66eb2373410 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98972 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99027 Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js index c7250de7f..ff510b7c2 100644 --- a/loleaflet/src/control/Control.PartsPreview.js +++ b/loleaflet/src/control/Control.PartsPreview.js @@ -116,6 +116,7 @@ L.Control.PartsPreview = L.Control.extend({ }, this); this._scrollContainer = $(this._partsPreviewCont).find('.mCSB_container').get(0); + $(this._scrollContainer).css('display', 'inline-table'); // Add a special frame just as a drop-site for reordering. var frame = L.DomUtil.create('div', 'preview-frame', this._scrollContainer); ___ 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/src wsd/DocumentBroker.cpp wsd/Storage.cpp wsd/Storage.hpp
loleaflet/src/control/Control.DocumentNameInput.js |7 +++ loleaflet/src/map/handler/Map.WOPI.js |4 wsd/DocumentBroker.cpp |2 ++ wsd/Storage.cpp|4 +++- wsd/Storage.hpp|6 ++ 5 files changed, 18 insertions(+), 5 deletions(-) New commits: commit be15790e24d628ccaf5dc722d432c1829d6767ba Author: Michael Meeks AuthorDate: Tue Jun 9 17:43:58 2020 +0100 Commit: Andras Timar CommitDate: Tue Jul 21 20:47:43 2020 +0200 Add support for BreadcrumbDocName. Change-Id: I06c56e92dd3acf9269140ecefb0c8bc731191260 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95960 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98193 Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.DocumentNameInput.js b/loleaflet/src/control/Control.DocumentNameInput.js index 28db57f41..cfc4e5998 100644 --- a/loleaflet/src/control/Control.DocumentNameInput.js +++ b/loleaflet/src/control/Control.DocumentNameInput.js @@ -40,7 +40,7 @@ L.Control.DocumentNameInput = L.Control.extend({ }, documentNameCancel: function() { - $('#document-name-input').val(this.map['wopi'].BaseFileName); + $('#document-name-input').val(this.map['wopi'].BreadcrumbDocName); this.map._onGotFocus(); }, @@ -97,10 +97,9 @@ L.Control.DocumentNameInput = L.Control.extend({ }, onWopiProps: function(e) { - if (e.BaseFileName !== null) { + if (e.BaseFileName !== null) // set the document name into the name field - $('#document-name-input').val(e.BaseFileName); - } + $('#document-name-input').val(e.BreadcrumbDocName !== undefined ? e.BreadcrumbDocName : e.BaseFileName); if (e.UserCanNotWriteRelative === false) { // Save As allowed diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js index da79219e8..3e41b7fae 100644 --- a/loleaflet/src/map/handler/Map.WOPI.js +++ b/loleaflet/src/map/handler/Map.WOPI.js @@ -10,6 +10,7 @@ L.Map.WOPI = L.Handler.extend({ // wouldn't be possible otherwise. PostMessageOrigin: '*', BaseFileName: '', + BreadcrumbDocName: '', DocumentLoadedTime: false, HidePrintOption: false, HideSaveOption: false, @@ -76,6 +77,9 @@ L.Map.WOPI = L.Handler.extend({ } this.BaseFileName = wopiInfo['BaseFileName']; + this.BreadcrumbDocName = wopiInfo['BreadcrumbDocName']; + if (this.BreadcrumbDocName === undefined) + this.BreadcrumbDocName = this.BaseFileName; this.HidePrintOption = !!wopiInfo['HidePrintOption']; this.HideSaveOption = !!wopiInfo['HideSaveOption']; this.HideExportOption = !!wopiInfo['HideExportOption']; diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 2c0ec41c2..086ad1699 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -663,6 +663,8 @@ bool DocumentBroker::load(const std::shared_ptr& session, const s wopifileinfo->setHideExportOption(true); wopiInfo->set("BaseFileName", wopiStorage->getFileInfo().getFilename()); +if (wopifileinfo->getBreadcrumbDocName().size()) +wopiInfo->set("BreadcrumbDocName", wopifileinfo->getBreadcrumbDocName()); if (!wopifileinfo->getTemplateSaveAs().empty()) wopiInfo->set("TemplateSaveAs", wopifileinfo->getTemplateSaveAs()); diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp index a27240bf1..3acbccbc4 100644 --- a/wsd/Storage.cpp +++ b/wsd/Storage.cpp @@ -613,6 +613,7 @@ std::unique_ptr WopiStorage::getWOPIFileInfo(const Au std::string watermarkText; std::string templateSaveAs; std::string templateSource; +std::string breadcrumbDocName; bool canWrite = false; bool enableOwnerTermination = false; std::string postMessageOrigin; @@ -719,6 +720,7 @@ std::unique_ptr WopiStorage::getWOPIFileInfo(const Au JsonUtil::findJSONValue(object, "SupportsLocks", supportsLocks); JsonUtil::findJSONValue(object, "SupportsRename", supportsRename); JsonUtil::findJSONValue(object, "UserCanRename", userCanRename); +JsonUtil::findJSONValue(object, "BreadcrumbDocName", breadcrumbDocName); bool booleanFlag = false; if (JsonUtil::findJSONValue(object, "DisableChangeTrackingRecord", booleanFlag)) disableChangeTrackingRecord = (booleanFlag ? WOPIFileInfo::TriState::True : WOPIFileInfo::TriState::False); @@ -750,7 +752,7 @@ std::unique_ptr WopiStorage::getWOPIFileInfo(const Au watermarkTe
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/map/Clipboard.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0c40427b0f6c039be784fd530a24f58ba79f82a4 Author: Szymon Kłos AuthorDate: Thu Jul 16 10:47:05 2020 +0200 Commit: Aron Budea CommitDate: Tue Jul 21 10:41:44 2020 +0200 clipboard: paste in dialog if open This fixes the issue where 'complex' content was copied and then when dialog was opened and user used Ctrl+V, internal paste into document was performed instead od pasting into dialog. Change-Id: I540a98484610916ff7c246f08a9772fbff40b3ec Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98877 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98942 Reviewed-by: Aron Budea diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index 18678b389..ce8ccb195 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -336,7 +336,7 @@ L.Clipboard = L.Class.extend({ { // Home from home: short-circuit internally. console.log('short-circuit, internal paste'); - this._map._socket.sendMessage('uno .uno:Paste'); + this._doInternalPaste(this._map, usePasteKeyEvent); return; } ___ 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/src
loleaflet/src/map/Clipboard.js | 57 + 1 file changed, 36 insertions(+), 21 deletions(-) New commits: commit 4a0676f16f030bae7a39e02f5defd422d666b06f Author: Szymon Kłos AuthorDate: Thu Jul 16 10:29:39 2020 +0200 Commit: Aron Budea CommitDate: Tue Jul 21 10:41:00 2020 +0200 clipboard: when disabled use only internal commands When external copy/paste is disabled: - always use internal copy/paste - don't ask user to use keyboard shortcut (it's possible to paste from menu) - content of a system clipboard is not modified at all Change-Id: I5645ad68bbf9364124ae721ea0e889d877a4ed23 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98876 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98941 Reviewed-by: Aron Budea diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index 3e03f973b..18678b389 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -139,16 +139,6 @@ L.Clipboard = L.Class.extend({ )); }, - // put in the clipboard if copy is disabled - _getCopyDisabledHtml: function() { - var lang = 'en_US'; // FIXME: l10n - return this._substProductName(this._originWrapBody( - ' \n' + - '\n' + - ' \n', false - )); - }, - _getMetaOrigin: function (html) { var match = 'https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/map/Clipboard.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f7741910a487869cfa1c76b6c7884b2a645a9ea8 Author: Szymon Kłos AuthorDate: Mon Jul 13 10:39:54 2020 +0200 Commit: Aron Budea CommitDate: Tue Jul 21 10:40:31 2020 +0200 When copy disabled use empty content in clipboard Don't use 'Stub HTML Message' title... Change-Id: I24953f1513fb5432e614958787b9d127ffa531a7 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98620 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos (cherry picked from commit 073efadc16d1f27809b119c9b261fabce85d1cac) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98750 Reviewed-by: Michael Meeks Tested-by: Michael Meeks (cherry picked from commit dbc1d87699e04f03890d45d7ee8a7e73027976bf) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98751 Reviewed-by: Aron Budea diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index 160b664f4..3e03f973b 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -145,7 +145,7 @@ L.Clipboard = L.Class.extend({ return this._substProductName(this._originWrapBody( ' \n' + '\n' + - ' \n', true + ' \n', 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/src
loleaflet/src/control/Ruler.js |3 +++ 1 file changed, 3 insertions(+) New commits: commit 58457e5c5f75dd84b532dbd85da0491908fc72fb Author: Szymon Kłos AuthorDate: Thu Jun 18 14:27:27 2020 +0200 Commit: Aron Budea CommitDate: Mon Jul 20 14:40:33 2020 +0200 Avoid usage of undefined when no margin set Change-Id: Ie922448e37e4414f054fa0404ea5787212c446dd Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96679 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos (cherry picked from commit 91d2e967461f5bb4552c8332faa393ba97e59f11) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98969 Reviewed-by: Aron Budea diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index 011b16488..e717d84e3 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -211,6 +211,9 @@ L.Control.Ruler = L.Control.extend({ var items = this._map['stateChangeHandler']; var state = items.getItemValue('.uno:LeftRightParaMargin'); + if (!state) + return; + this.options.firstLineIndent = parseFloat(state.firstline.replace(',', '.')); this.options.leftParagraphIndent = parseFloat(state.left.replace(',', '.')); this.options.rightParagraphIndent = parseFloat(state.right.replace(',', '.')); ___ 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/src
loleaflet/src/map/Map.js | 10 ++ 1 file changed, 10 insertions(+) New commits: commit a16e845a239b93093a5190986cdd2b5804334453 Author: Jan Holesovsky AuthorDate: Wed Jul 15 23:24:55 2020 +0200 Commit: Jan Holesovsky CommitDate: Thu Jul 16 11:52:21 2020 +0200 android: Hide sidebar on Chromebooks early. This is a hack - but I fear the best we can do just now. The problem is that the sidebar is always initialized at the startup, just for mobile phones and tablets, we don't show it thanks to an early exit in _launchSidebar() when the app starts in read-only mode (which it does for phones and tablets). Now when we have switched the Chromebook UI to the desktop one, we need to explicitly turn the sidebar off on start, because otherwise it occupies too much screen. Of course - much better would be not to initialize the sidebar at all when it is not necessary - but there's no easy way to do that :-( Change-Id: I0340d125181285dcebda4ff78971182a7072dddb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98864 Tested-by: Jan Holesovsky Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 5f9882a53..0368915e3 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -304,6 +304,16 @@ L.Map = L.Evented.extend({ if (window.mode.isDesktop() && !window.ThisIsAMobileApp) { map._socket.sendMessage('uno .uno:SidebarShow'); } + else if (window.mode.isChromebook()) { + // HACK - currently the sidebar shows when loaded, + // with the exception of mobile phones & tablets - but + // there, it does not show only because they start + // with read/only mode which hits an early exit in + // _launchSidebar() in Control.LokDialog.js + // So for the moment, let's just hide it on + // Chromebooks early + map._socket.sendMessage('uno .uno:SidebarHide'); + } }, 200); } ___ 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/src
loleaflet/src/control/Control.Menubar.js | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) New commits: commit d69350013c0960560a45a14a055081d2930fdf78 Author: Pranam Lashkari AuthorDate: Thu Jul 2 16:00:14 2020 +0530 Commit: Andras Timar CommitDate: Sun Jul 5 21:08:36 2020 +0200 leaflet: Removed impress download options from drawing doc Change-Id: Iaddc3f8330733ec89af0cb0ec6ed14d1f51999ff Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97740 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit 32185682de346c9a729a2ef2efb0d66713a6a84d) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97799 diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 63278bf62..3eea9a713 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -257,9 +257,11 @@ L.Control.Menubar = L.Control.extend({ {name: _('See revision history'), id: 'rev-history', type: 'action'}, {name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id: 'downloadas', type: 'menu', menu: [ {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, - {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action'}, - {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action'}, - {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action'}]}, + {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action', drawing: false}, + {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action', drawing: false}, + {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action', drawing: false}, + {name: _('ODF Drawing (.odg)'), id: 'downloadas-odg', type: 'action'} + ]}, {type: 'separator'}, {name: _('Close document'), id: 'closedocument', type: 'action'} ]}, @@ -538,9 +540,10 @@ L.Control.Menubar = L.Control.extend({ ]}, {name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id:'downloadas', type: 'menu', menu: [ {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, - {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action'}, - {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action'}, - {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action'}, + {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action', drawing: false}, + {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action', drawing: false}, + {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action', drawing: false}, + {name: _('ODF Drawing (.odg)'), id: 'downloadas-odg', type: 'action'} ]}, {name: _UNO('.uno:EditMenu', 'presentation'), id: 'editmenu', type: 'menu', menu: [ {uno: '.uno:Undo'}, @@ -1384,6 +1387,12 @@ L.Control.Menubar = L.Control.extend({ if (menuItem.id === 'changesmenu' && this._map['wopi'].HideChangeTrackingControls) return false; + if (menuItem.drawing === false && this._map.getDocType() === 'drawing') + return false; + + if (menuItem.id === 'downloadas-odg' && !this._map['wopi'].BaseFileName.endsWith('.odg')) + return false; + // Keep track of all 'downloadas-' options and register them as // export formats with docLayer which can then be publicly accessed unlike // this Menubar control for which there doesn't seem to be any easy way ___ 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/src
loleaflet/src/control/Control.Menubar.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6e8fc1544b95f81dacbf88b74947db3d56907f74 Author: Pranam Lashkari AuthorDate: Fri Jul 3 17:24:11 2020 +0530 Commit: Andras Timar CommitDate: Sun Jul 5 10:41:55 2020 +0200 leaflet: allow download as odg in readonly mode(view mdoe) Change-Id: I5bb1f9288280ffc18beaa893402752291c7d8507 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97801 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 283318f2e..63278bf62 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -724,7 +724,7 @@ L.Control.Menubar = L.Control.extend({ allowedViewModeActions: [ 'shareas', 'print', // file menu 'downloadas-pdf', 'downloadas-odt', 'downloadas-doc', 'downloadas-docx', 'downloadas-rtf', 'downloadas-epub', // file menu - 'downloadas-odp', 'downloadas-ppt', 'downloadas-pptx', 'print', // file menu + 'downloadas-odp', 'downloadas-ppt', 'downloadas-pptx', 'downloadas-odg', 'print', // file menu 'downloadas-ods', 'downloadas-xls', 'downloadas-xlsx', 'closedocument', // file menu 'fullscreen', 'zoomin', 'zoomout', 'zoomreset', 'showresolved', // view menu 'about', 'keyboard-shortcuts', 'latest-updates', 'online-help', 'report-an-issue' // help menu ___ 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/src
loleaflet/src/control/Toolbar.js | 53 --- 1 file changed, 22 insertions(+), 31 deletions(-) New commits: commit d4841aef011f8bb6dd1e07989fbbb8a95347 Author: Muhammet Kara AuthorDate: Mon Jun 29 14:24:32 2020 +0300 Commit: Muhammet Kara CommitDate: Mon Jun 29 16:20:11 2020 +0200 Welcome: Use localStorage instead of cookies Change-Id: I0ab431f065dbe8d76d1e7ff18023be744c590dc8 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97380 Tested-by: Jenkins CollaboraOffice Reviewed-by: Muhammet Kara diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 6f76e0540..fe67909f0 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -415,13 +415,7 @@ L.Map.include({ }, beforeClose: function () { if (!calledFromMenu) { - var WSDVerCookie = 'WSDWelcomeVersion=' + map._socket.WSDServer.Version; - // Cookie will not expire for a year, and it will not be sent to other domains - var cookiePath = '/loleaflet'; - if (window.socketProxy) - cookiePath = window.host + window.serviceRoot + cookiePath; - WSDVerCookie += '; max-age=31536000; SameSite=Lax; path=' + cookiePath; - document.cookie = WSDVerCookie; + localStorage.setItem('WSDWelcomeVersion', map._socket.WSDServer.Version); } map.focus(); map.enable(true); @@ -449,41 +443,38 @@ L.Map.include({ map._showWelcomeDialogVex(data, calledFromMenu); }) .fail(function() { - // Welcome dialog disabled in loolwsd.xml or nonexistant for some other reason - // Let's check back in a day (60 x 60 x 24 = 86400 seconds) - var cookiePath = '/loleaflet'; - if (window.socketProxy) - cookiePath = window.host + window.serviceRoot + cookiePath; - var welcomeDisabledCookie = 'WSDWelcomeDisabled=true; max-age=86400; SameSite=Lax; path=' + cookiePath; - document.cookie = welcomeDisabledCookie; + var currentDate = new Date(); + localStorage.setItem('WSDWelcomeDisabled', 'true'); + localStorage.setItem('WSDWelcomeDisabledDate', currentDate.toDateString()); if (calledFromMenu) map._showWelcomeDialogVex(_('We are sorry, the information about the latest updates is not available.')); }); }, - getCookie: function(name) { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = cookies[i].trim(); - if (cookie.indexOf(name) === 0) { - return cookie; - } - } - - return ''; - }, - shouldWelcome: function() { if (!window.enableWelcomeMessage || L.Browser.cypressTest) return false; - var currentVerCookie = this.getCookie('WSDWelcomeVersion'); - var newVerCookie = 'WSDWelcomeVersion=' + this._socket.WSDServer.Version; - var welcomeDisabledCookie = this.getCookie('WSDWelcomeDisabled'); - var isWelcomeDisabled = welcomeDisabledCookie === 'WSDWelcomeDisabled=true'; + var storedVersion = localStorage.getItem('WSDWelcomeVersion'); + var currentVersion = this._socket.WSDServer.Version; + var welcomeDisabledCookie = localStorage.getItem('WSDWelcomeDisabled'); + var welcomeDisabledDate = localStorage.getItem('WSDWelcomeDisabledDate'); + var isWelcomeDisabled = false; + + if (welcomeDisabledCookie && welcomeDisabledDate) { + // Check if we are stil in the same day + var currentDate = new Date(); + if (welcomeDisabledDate === currentDate.toDateString()) + isWelcomeDisabled = true; + else { + //Values expired. Clear the local values + localStorage.removeItem('WSDWelcomeDisabled'); + localStorag
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src wsd/DocumentBroker.cpp
loleaflet/src/map/Map.js |5 + wsd/DocumentBroker.cpp |4 2 files changed, 9 insertions(+) New commits: commit 3383b13085178342adfe6781e30d88c3ad5cb248 Author: Mike Kaganski AuthorDate: Fri Jun 26 14:47:37 2020 +0300 Commit: Andras Timar CommitDate: Fri Jun 26 21:16:45 2020 +0200 Don't show last modification indicator when data is unavailable E.g., SharePoint 2013 and 2016 don't support LastModifiedTime field in CheckFileInfo [1]. [1] https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-wopi/e2e91eab-4c6d-4f00-9c3f-3a1962135626#Appendix_A_30 Change-Id: Icdcf9f82758b4bd34be25f553e9d756ab76b8bfa Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97221 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit ec1bc5807090dea9f28ef25c6211785c7fa1a00f) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97144 diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 67bac9bfd..5f9882a53 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -386,6 +386,11 @@ L.Map = L.Evented.extend({ if (lastModButton !== null && lastModButton !== undefined && lastModButton.firstChild.innerHTML !== null && lastModButton.firstChild.childElementCount == 0) { + if (this._lastmodtime == null) { + // No modification time -> hide the indicator + lastModButton.innerHTML = ''; + return; + } var mainSpan = document.createElement('span'); var label = document.createTextNode(_('Last modification')); var separator = document.createTextNode(': '); diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 55e921295..5e647ec76 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -74,6 +74,10 @@ void sendLastModificationTime(const std::shared_ptr& session, if (!session) return; +if (documentLastModifiedTime == std::chrono::system_clock::time_point()) +// No time from the storage (e.g., SharePoint 2013 and 2016) -> don't send +return; + std::stringstream stream; stream << "lastmodtime: " << documentLastModifiedTime; const std::string message = stream.str(); ___ 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/src
loleaflet/src/control/Toolbar.js |9 + 1 file changed, 9 insertions(+) New commits: commit 2440b6209ed4934ee6af71ef8f5a87b1af71fd30 Author: mert AuthorDate: Thu Jun 25 18:53:39 2020 +0300 Commit: Andras Timar CommitDate: Fri Jun 26 10:28:09 2020 +0200 Fix images are not shown in online help page on proxy Relative urls must be replaced for proxy Change-Id: Ia1d888941c33736c4eb19070aec73c5bdd6fa197 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97166 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit 29c92b5c8db5b470facf09b19811805a9ea69192) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97138 diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 1ce90a3ba..6f76e0540 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -254,6 +254,15 @@ L.Map.include({ } } else /* id === 'online-help' */ { document.getElementById('keyboard-shortcuts').style.display='none'; + if (window.socketProxy) { + var helpdiv = document.getElementById('online-help'); + var imgList = helpdiv.querySelectorAll('img'); + for (var p = 0; p < imgList.length; p++) { + var imgSrc = imgList[p].src; + imgSrc = imgSrc.substring(imgSrc.indexOf('/images')); + imgList[p].src = window.host + window.serviceRoot + '/loleaflet/dist'+ imgSrc; + } + } // Display help according to document opened if (map.getDocType() === 'text') { var x = document.getElementsByClassName('text'); ___ 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/src
loleaflet/src/control/Control.Menubar.js |2 +- loleaflet/src/map/handler/Map.Keyboard.js |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit b7a5a8b003cc317947cf02b8e6e4040c217fdc5c Author: Andras Timar AuthorDate: Thu Jun 25 12:18:36 2020 +0200 Commit: Andras Timar CommitDate: Thu Jun 25 22:06:44 2020 +0200 Fix: when help was invoked with F1 %productName was not replaced Change-Id: I2f0255e0aedbe70116b2fb7423b0d077c14fa7b4 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97068 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index c8d12a868..283318f2e 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -1295,7 +1295,7 @@ L.Control.Menubar = L.Control.extend({ // handle help - F1 if (e.type === 'keydown' && !e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode == 112) { - self._map.showHelp(); + self._map.showHelp('online-help'); } }, diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js index 6ba2dc165..6ea10c40e 100644 --- a/loleaflet/src/map/handler/Map.Keyboard.js +++ b/loleaflet/src/map/handler/Map.Keyboard.js @@ -308,7 +308,7 @@ L.Map.Keyboard = L.Handler.extend({ // handle help - F1 if (ev.type === 'keydown' && !shift && !ctrl && !alt && !cmd && keyCode === 112) { - this._map.showHelp(); + this._map.showHelp('online-help'); ev.preventDefault(); return; } ___ 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/src
loleaflet/src/control/Control.MobileBottomBar.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 966746958337c7e0ff0df1330f1216429b4f5cbf Author: Andras Timar AuthorDate: Tue Jun 23 13:32:35 2020 +0200 Commit: Andras Timar CommitDate: Wed Jun 24 12:17:09 2020 +0200 typo: .uno:RigthPara -> .uno:RightPara Change-Id: I1de80ac3fe0625571bfa5c4e4165fb2b1e4114af Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96879 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.MobileBottomBar.js b/loleaflet/src/control/Control.MobileBottomBar.js index 8a11179b9..340e8d1ab 100644 --- a/loleaflet/src/control/Control.MobileBottomBar.js +++ b/loleaflet/src/control/Control.MobileBottomBar.js @@ -94,7 +94,7 @@ L.Control.MobileBottomBar = L.Control.extend({ uno: {textCommand: 'LeftPara', objectCommand: 'ObjectAlignLeft'}}, {type: 'button', id: 'centerpara', img: 'alignhorizontal', hint: _UNO('.uno:CenterPara', '', true), uno: {textCommand: 'CenterPara', objectCommand: 'AlignCenter'}}, - {type: 'button', id: 'rightpara', img: 'alignright', hint: _UNO('.uno:RigthPara', '', true), + {type: 'button', id: 'rightpara', img: 'alignright', hint: _UNO('.uno:RightPara', '', true), uno: {textCommand: 'RightPara', objectCommand: 'ObjectAlignRight'}}, {type: 'button', id: 'justifypara', img: 'alignblock', hint: _UNO('.uno:JustifyPara', '', true), uno: 'JustifyPara'}, {type: 'break'}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits