dev/null |binary loleaflet/Makefile.am | 9 loleaflet/admin/main-admin.js | 7 loleaflet/archived-packages/bluebird-3.5.4-d6cc66159.tar |binary loleaflet/archived-packages/classlist-polyfill-1.2.0-935bc2dfd.tar |binary loleaflet/archived-packages/deep-clone-simple-1.1.1-0ec358dfc.tar |binary loleaflet/archived-packages/domify-1.4.0-11483617f.tar |binary loleaflet/archived-packages/es6-object-assign-1.1.0-c2c358265.tar |binary loleaflet/archived-packages/form-serialize-0.7.1-48f74e37d.tar |binary loleaflet/archived-packages/spdx-license-ids-3.0.4-75ecd1a88.tar |binary loleaflet/archived-packages/vex-dialog-1.1.0-8a2b57b70.tar |binary loleaflet/archived-packages/vex-js-4.1.0-88c996c7a.tar |binary loleaflet/css/loleaflet.css | 16 + loleaflet/package.json | 2 loleaflet/src/control/Control.AlertDialog.js | 13 - loleaflet/src/control/Toolbar.js | 32 +-- loleaflet/src/core/Socket.js | 91 ++-------- loleaflet/src/map/Map.js | 71 +++---- 18 files changed, 98 insertions(+), 143 deletions(-)
New commits: commit 37daa2ff4178807ad3aa7ff6d3b77fb56024a24a Author: Alexandru Vlăduţu <alexandru.vlad...@1and1.ro> AuthorDate: Tue Apr 2 09:42:01 2019 +0300 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Mon Aug 26 10:02:23 2019 +0200 loleaflet: remove npm dependency leftover from shrinkpack folder Change-Id: I70693d505ade3c465fc3bfec7a080197ef8cd37b Reviewed-on: https://gerrit.libreoffice.org/70115 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Reviewed-on: https://gerrit.libreoffice.org/77797 diff --git a/loleaflet/archived-packages/npm-3.10.10-5b1d577e4.tar b/loleaflet/archived-packages/npm-3.10.10-5b1d577e4.tar deleted file mode 100644 index 46264c050..000000000 Binary files a/loleaflet/archived-packages/npm-3.10.10-5b1d577e4.tar and /dev/null differ commit 1d58a7710b333f1ce8ce61e508458557ebe58dd3 Author: Alexandru Vlăduţu <alexandru.vlad...@1and1.ro> AuthorDate: Mon May 6 12:18:35 2019 +0300 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Mon Aug 26 10:02:13 2019 +0200 loleaflet: minor followup changes after vex upgrade Change-Id: I9cee6ee5b0592f067718399a4ccaf1c25203c01c Reviewed-on: https://gerrit.libreoffice.org/71851 Reviewed-by: Iván Sánchez Ortega <ivan.sanc...@collabora.com> Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Reviewed-on: https://gerrit.libreoffice.org/77802 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am index f23b46f7f..3435d8b20 100644 --- a/loleaflet/Makefile.am +++ b/loleaflet/Makefile.am @@ -78,7 +78,7 @@ LOLEAFLET_CSS =\ $(builddir)/node_modules/vex-js/dist/css/vex.css \ $(builddir)/node_modules/vex-js/dist/css/vex-theme-plain.css \ $(builddir)/node_modules/vex-js/dist/css/vex-theme-bottom-right-corner.css \ - $(builddir)/node_modules/select2/dist/css/select2.css \ + $(builddir)/node_modules/select2/dist/css/select2.css \ $(builddir)/node_modules/smartmenus/dist/css/sm-core-css.css \ $(builddir)/node_modules/smartmenus/dist/css/sm-simple/sm-simple.css \ $(srcdir)/css/menubar.css \ diff --git a/loleaflet/admin/main-admin.js b/loleaflet/admin/main-admin.js index f3d9a52ed..a2964bcd2 100644 --- a/loleaflet/admin/main-admin.js +++ b/loleaflet/admin/main-admin.js @@ -3,8 +3,8 @@ require('bootstrap/dist/css/bootstrap.css'); require('./bootstrap/ie10-viewport-bug-workaround.css'); require('./bootstrap/dashboard.css'); -require('vex-js/css/vex.css'); -require('vex-js/css/vex-theme-plain.css'); +require('vex-js/dist/css/vex.css'); +require('vex-js/dist/css/vex-theme-plain.css'); var $ = require('jquery'); global.$ = global.jQuery = $; @@ -12,8 +12,7 @@ global.$ = global.jQuery = $; require('json-js/json2'); require('l10n-for-node'); -var vex = require('vex-js'); -vex.dialog = require('vex-js/js/vex.dialog.js'); +var vex = require('vex-js/dist/js/vex.combined.js'); vex.defaultOptions.className = 'vex-theme-plain'; global.vex = vex; diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css index 03b6ea9f1..7be1d144f 100644 --- a/loleaflet/css/loleaflet.css +++ b/loleaflet/css/loleaflet.css @@ -437,14 +437,17 @@ body { } /* Vex dialogs */ .vex-open .vex-overlay { - z-index: 1001; /* required to be displayed over the document */ + /* TODO: remove specific z-index from our codebase + so that the following line can also be removed */ + z-index: 1001; } -.vex-open .vex-idle { /* dialog shown when user is idle */ +/* dialog shown when user is idle */ +.vex-open .loleaflet-user-idle { background: rgba(0, 0, 0, 0)!important; font-size: xx-large!important; color: #fff!important; text-align: center!important; } -.vex-open .vex-idle .vex-dialog-buttons { +.vex-open .loleaflet-user-idle .vex-dialog-buttons { display: none!important; } diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 6b3f33644..b245efbc8 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -409,7 +409,7 @@ L.Socket = L.Class.extend({ var dialogOpened = vex.dialog.open({ message: message, - contentClassName: 'vex-idle' + contentClassName: 'loleaflet-user-idle' }); if (textMsg === 'idle' || textMsg === 'oom') { diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index bb505bb95..047e91abc 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -4,18 +4,6 @@ */ /* global vex $ _ */ -function moveObjectVertically(obj, diff) { - if (obj) { - var prevTop = obj.css('top'); - if (prevTop) { - prevTop = parseInt(prevTop.slice(0, -2)) + diff; - } - else { - prevTop = 0 + diff; - } - obj.css({'top': String(prevTop) + 'px'}); - } -} function isAnyVexDialogActive() { var res = false; @@ -917,7 +905,7 @@ L.Map = L.Evented.extend({ } console.debug('_dim:'); - if (!this._socket.connected()) { + if (!this._socket.connected() || isAnyVexDialogActive()) { return; } @@ -932,7 +920,7 @@ L.Map = L.Evented.extend({ vex.open({ content: message, - contentClassName: 'vex-idle', + contentClassName: 'loleaflet-user-idle', afterOpen: function() { var $vexContent = $(this.contentEl); $vexContent.bind('click.vex', function() { commit 8887d253364344d6166a6224e6c2c3063d5747a5 Author: Alexandru Vlăduţu <alexandru.vlad...@1and1.ro> AuthorDate: Fri May 3 12:41:39 2019 +0300 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Mon Aug 26 10:02:08 2019 +0200 loleaflet: update vex.js library Change-Id: I6b32c6a60a27aa27eb32784bb73e40c979f67def Reviewed-on: https://gerrit.libreoffice.org/71726 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Reviewed-on: https://gerrit.libreoffice.org/77801 diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am index cc21b8cb4..f23b46f7f 100644 --- a/loleaflet/Makefile.am +++ b/loleaflet/Makefile.am @@ -75,10 +75,10 @@ LOLEAFLET_CSS =\ $(srcdir)/css/jquery.mCustomScrollbar.css \ $(srcdir)/plugins/draw-$(DRAW_VERSION)/dist/leaflet.draw.css \ $(builddir)/node_modules/jquery-contextmenu/dist/jquery.contextMenu.css \ - $(builddir)/node_modules/vex-js/css/vex.css \ - $(builddir)/node_modules/vex-js/css/vex-theme-plain.css \ - $(builddir)/node_modules/vex-js/css/vex-theme-bottom-right-corner.css \ - $(builddir)/node_modules/select2/dist/css/select2.css \ + $(builddir)/node_modules/vex-js/dist/css/vex.css \ + $(builddir)/node_modules/vex-js/dist/css/vex-theme-plain.css \ + $(builddir)/node_modules/vex-js/dist/css/vex-theme-bottom-right-corner.css \ + $(builddir)/node_modules/select2/dist/css/select2.css \ $(builddir)/node_modules/smartmenus/dist/css/sm-core-css.css \ $(builddir)/node_modules/smartmenus/dist/css/sm-simple/sm-simple.css \ $(srcdir)/css/menubar.css \ @@ -99,8 +99,7 @@ NODE_MODULES_JS =\ node_modules/autolinker/dist/Autolinker.js \ node_modules/json-js/json2.js \ node_modules/select2/dist/js/select2.js \ - node_modules/vex-js/js/vex.js \ - node_modules/vex-js/js/vex.dialog.js \ + node_modules/vex-js/dist/js/vex.combined.js \ node_modules/@braintree/sanitize-url/dist.js if !ENABLE_IOSAPP diff --git a/loleaflet/archived-packages/bluebird-3.5.3-7d01c6f96.tar b/loleaflet/archived-packages/bluebird-3.5.4-d6cc66159.tar similarity index 98% rename from loleaflet/archived-packages/bluebird-3.5.3-7d01c6f96.tar rename to loleaflet/archived-packages/bluebird-3.5.4-d6cc66159.tar index db26d55a5..b9fdaf3d0 100644 Binary files a/loleaflet/archived-packages/bluebird-3.5.3-7d01c6f96.tar and b/loleaflet/archived-packages/bluebird-3.5.4-d6cc66159.tar differ diff --git a/loleaflet/archived-packages/classlist-polyfill-1.2.0-935bc2dfd.tar b/loleaflet/archived-packages/classlist-polyfill-1.2.0-935bc2dfd.tar new file mode 100644 index 000000000..90ff124c8 Binary files /dev/null and b/loleaflet/archived-packages/classlist-polyfill-1.2.0-935bc2dfd.tar differ diff --git a/loleaflet/archived-packages/deep-clone-simple-1.1.1-0ec358dfc.tar b/loleaflet/archived-packages/deep-clone-simple-1.1.1-0ec358dfc.tar new file mode 100644 index 000000000..f1f200283 Binary files /dev/null and b/loleaflet/archived-packages/deep-clone-simple-1.1.1-0ec358dfc.tar differ diff --git a/loleaflet/archived-packages/domify-1.4.0-11483617f.tar b/loleaflet/archived-packages/domify-1.4.0-11483617f.tar new file mode 100644 index 000000000..b760f7cac Binary files /dev/null and b/loleaflet/archived-packages/domify-1.4.0-11483617f.tar differ diff --git a/loleaflet/archived-packages/es6-object-assign-1.1.0-c2c358265.tar b/loleaflet/archived-packages/es6-object-assign-1.1.0-c2c358265.tar new file mode 100644 index 000000000..be5e4d374 Binary files /dev/null and b/loleaflet/archived-packages/es6-object-assign-1.1.0-c2c358265.tar differ diff --git a/loleaflet/archived-packages/form-serialize-0.7.1-48f74e37d.tar b/loleaflet/archived-packages/form-serialize-0.7.1-48f74e37d.tar new file mode 100644 index 000000000..85403a30d Binary files /dev/null and b/loleaflet/archived-packages/form-serialize-0.7.1-48f74e37d.tar differ diff --git a/loleaflet/archived-packages/spdx-license-ids-3.0.3-81c0ce8f2.tar b/loleaflet/archived-packages/spdx-license-ids-3.0.4-75ecd1a88.tar similarity index 86% rename from loleaflet/archived-packages/spdx-license-ids-3.0.3-81c0ce8f2.tar rename to loleaflet/archived-packages/spdx-license-ids-3.0.4-75ecd1a88.tar index 54f10abfb..cbe4b48ff 100644 Binary files a/loleaflet/archived-packages/spdx-license-ids-3.0.3-81c0ce8f2.tar and b/loleaflet/archived-packages/spdx-license-ids-3.0.4-75ecd1a88.tar differ diff --git a/loleaflet/archived-packages/vex-dialog-1.1.0-8a2b57b70.tar b/loleaflet/archived-packages/vex-dialog-1.1.0-8a2b57b70.tar new file mode 100644 index 000000000..baecccc11 Binary files /dev/null and b/loleaflet/archived-packages/vex-dialog-1.1.0-8a2b57b70.tar differ diff --git a/loleaflet/archived-packages/vex-js-2.3.2-d352329a1.tar b/loleaflet/archived-packages/vex-js-4.1.0-88c996c7a.tar similarity index 91% rename from loleaflet/archived-packages/vex-js-2.3.2-d352329a1.tar rename to loleaflet/archived-packages/vex-js-4.1.0-88c996c7a.tar index be6ee6a32..f3b499dbf 100644 Binary files a/loleaflet/archived-packages/vex-js-2.3.2-d352329a1.tar and b/loleaflet/archived-packages/vex-js-4.1.0-88c996c7a.tar differ diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css index f53adfbbd..03b6ea9f1 100644 --- a/loleaflet/css/loleaflet.css +++ b/loleaflet/css/loleaflet.css @@ -435,3 +435,16 @@ body { bottom: 40px !important; right: 10px !important; } +/* Vex dialogs */ +.vex-open .vex-overlay { + z-index: 1001; /* required to be displayed over the document */ +} +.vex-open .vex-idle { /* dialog shown when user is idle */ + background: rgba(0, 0, 0, 0)!important; + font-size: xx-large!important; + color: #fff!important; + text-align: center!important; +} +.vex-open .vex-idle .vex-dialog-buttons { + display: none!important; +} diff --git a/loleaflet/package.json b/loleaflet/package.json index 7bd0fac80..2d995ff1f 100644 --- a/loleaflet/package.json +++ b/loleaflet/package.json @@ -25,7 +25,7 @@ "uglify-js": "2.4.24", "uglifycss": "0.0.27", "uglifyify": "3.0.2", - "vex-js": "2.3.2" + "vex-js": "4.1.0" }, "repository": { "type": "git", diff --git a/loleaflet/src/control/Control.AlertDialog.js b/loleaflet/src/control/Control.AlertDialog.js index 336c14dd7..5e1a77fe0 100644 --- a/loleaflet/src/control/Control.AlertDialog.js +++ b/loleaflet/src/control/Control.AlertDialog.js @@ -12,10 +12,10 @@ L.Control.AlertDialog = L.Control.extend({ }, _onError: function(e) { - if (vex.dialogID > 0 && !this._map._fatal) { + if (!this._map._fatal) { // TODO. queue message errors and pop-up dialogs // Close other dialogs before presenting a new one. - vex.close(vex.dialogID); + vex.closeAll(); } if (e.msg) { @@ -44,8 +44,7 @@ L.Control.AlertDialog = L.Control.extend({ className: 'vex-dialog-button-primary', click: function openClick () { window.open(url, '_blank'); - vex.close(vex.dialogID); - vex.dialogID = 0; + vex.closeAll(); } }); } @@ -56,8 +55,7 @@ L.Control.AlertDialog = L.Control.extend({ className: 'vex-dialog-button-secondary', click: function editClick () { e.map.toggleCommandState('HyperlinkDialog'); - vex.close(vex.dialogID); - vex.dialogID = 0; + vex.closeAll(); } }); @@ -77,9 +75,6 @@ L.Control.AlertDialog = L.Control.extend({ msg = msg.replace('%1', e.cmd); vex.dialog.alert(msg); } - - // Remember the current dialog ID to close it later. - vex.dialogID = vex.globalID - 1; } }); diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index ba3cbb0ca..26368999f 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -194,13 +194,15 @@ L.Map.include({ var map = this; $.get('loleaflet-help.html', function(data) { vex.open({ - content: data, + unsafeContent: data, showCloseButton: true, escapeButtonCloses: true, overlayClosesOnClick: true, - contentCSS: {width: w + 'px'}, buttons: {}, - afterOpen: function($vexContent) { + afterOpen: function() { + var that = this; + var $vexContent = $(this.contentEl); + this.contentEl.style.width = w + 'px' map.enable(false); // Display help according to document opened if (map.getDocType() === 'text') { @@ -232,14 +234,12 @@ L.Map.include({ translatableContent[i].firstChild.nodeValue = translatableContent[i].firstChild.nodeValue.toLocaleString(); } - $('.vex-content').attr('tabindex', -1); - $('.vex-content').focus(); + $vexContent.attr('tabindex', -1); + $vexContent.focus(); // workaround for https://github.com/HubSpot/vex/issues/43 $('.vex-overlay').css({ 'pointer-events': 'none'}); - $('.vex').click(function() { - vex.close($vexContent.data().vex.id); - }); - $('.vex-content').click(function(e) { + $vexContent.one('click', function(e) { + that.close(); e.stopPropagation(); }); }, @@ -277,21 +277,21 @@ L.Map.include({ } }; vex.open({ - content: content, + unsafeContent: content[0].outerHTML, showCloseButton: true, escapeButtonCloses: true, overlayClosesOnClick: true, - contentCSS: { width: w + 'px'}, buttons: {}, - afterOpen: function($vexContent) { + afterOpen: function() { + var that = this; + this.contentEl.style.width = w + 'px'; + var $vexContent = $(this.contentEl); map.enable(false); $(window).bind('keyup.vex', handler); // workaround for https://github.com/HubSpot/vex/issues/43 $('.vex-overlay').css({ 'pointer-events': 'none'}); - $('.vex').click(function() { - vex.close($vexContent.data().vex.id); - }); - $('.vex-content').click(function(e) { + $vexContent.one('click', function(e) { + that.close(); e.stopPropagation(); }); }, diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 1d66ce854..6b3f33644 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -309,11 +309,7 @@ L.Socket = L.Class.extend({ var commandresult = JSON.parse(textMsg.substring(textMsg.indexOf('{'))); if (commandresult['command'] === 'savetostorage' && commandresult['success']) { // Close any open confirmation dialogs - if (vex.dialogID > 0) { - var id = vex.dialogID; - vex.dialogID = -1; - vex.close(id); - } + vex.closeAll(); } return; } @@ -358,11 +354,7 @@ L.Socket = L.Class.extend({ if (socket.connected()) { // We're connected: cancel timer and dialog. clearTimeout(vex.timer); - if (vex.dialogID > 0) { - var id = vex.dialogID; - vex.dialogID = -1; - vex.close(id); - } + vex.closeAll(); return; } @@ -408,53 +400,27 @@ L.Socket = L.Class.extend({ } // Close any open dialogs first. - if (vex.dialogID > 0) { - id = vex.dialogID; - vex.dialogID = -1; - vex.close(id); - } + vex.closeAll(); var message = ''; if (!this._map['wopi'].DisableInactiveMessages) { message = msg; } - var options = $.extend({}, vex.defaultOptions, { - contentCSS: {'background':'rgba(0, 0, 0, 0)', - 'font-size': 'xx-large', - 'color': '#fff', - 'text-align': 'center'}, - content: message - }); - options.id = vex.globalID; - vex.dialogID = options.id; - vex.globalID += 1; - options.$vex = $('<div>').addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({ - vex: options - }); - options.$vexOverlay = $('<div>').addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({ - vex: options - }); - - options.$vex.append(options.$vexOverlay); - - options.$vexContent = $('<div>').addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).text(options.content).data({ - vex: options + var dialogOpened = vex.dialog.open({ + message: message, + contentClassName: 'vex-idle' }); - options.$vex.append(options.$vexContent); if (textMsg === 'idle' || textMsg === 'oom') { var map = this._map; - options.$vex.bind('click.vex', function() { + dialogOpened.contentEl.onclick = function() { console.debug('idleness: reactivating'); map._documentIdle = false; return map._activate(); - }); + }; } - $(options.appendLocation).append(options.$vex); - vex.setupBodyClassName(options.$vex); - if (postMsgData['Reason']) { // Tell WOPI host about it which should handle this situation this._map.fire('postMessage', {msgId: 'Session_Closed', args: postMsgData}); @@ -489,37 +455,30 @@ L.Socket = L.Class.extend({ { storageError = errorMessages.storage.documentconflict; - // TODO: We really really need to factor this out duplicate dialog code logic everywhere - // Close any open dialogs first. - if (vex.dialogID > 0) { - id = vex.dialogID; - vex.dialogID = -1; - vex.close(id); - } + vex.closeAll(); vex.dialog.open({ message: _('Document has been changed in storage. What would you like to do with your unsaved changes?'), escapeButtonCloses: false, overlayClosesOnClick: false, - contentCSS: { width: '600px' }, buttons: [ $.extend({}, vex.dialog.buttons.YES, { text: _('Discard'), - click: function($vexContent) { - $vexContent.data().vex.value = 'discard'; - vex.close($vexContent.data().vex.id); + click: function() { + this.value = 'discard'; + this.close(); }}), $.extend({}, vex.dialog.buttons.YES, { text: _('Overwrite'), - click: function($vexContent) { - $vexContent.data().vex.value = 'overwrite'; - vex.close($vexContent.data().vex.id); + click: function() { + this.value = 'overwrite'; + this.close(); }}), $.extend({}, vex.dialog.buttons.YES, { text: _('Save to new file'), - click: function($vexContent) { - $vexContent.data().vex.value = 'saveas'; - vex.close($vexContent.data().vex.id); + click: function() { + this.value = 'saveas'; + this.close(); }}) ], - callback: L.bind(function(value) { + callback: function(value) { if (value === 'discard') { // They want to refresh the page and load document again for all this.sendMessage('closedocument'); @@ -533,9 +492,11 @@ L.Socket = L.Class.extend({ this._map.saveAs(filename); } } - }, this) + }, + afterOpen: function() { + this.contentEl.style.width = '600px'; + } }); - vex.dialogID = vex.globalID - 1; return; } @@ -708,11 +669,7 @@ L.Socket = L.Class.extend({ // We're connected: cancel timer and dialog. this.ReconnectCount = 0; clearTimeout(vex.timer); - if (vex.dialogID > 0) { - id = vex.dialogID; - vex.dialogID = -1; - vex.close(id); - } + vex.closeAll(); } } else if (!textMsg.startsWith('tile:') && !textMsg.startsWith('renderfont:') && !textMsg.startsWith('windowpaint:')) { diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index e24b0205c..bb505bb95 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -4,6 +4,27 @@ */ /* global vex $ _ */ +function moveObjectVertically(obj, diff) { + if (obj) { + var prevTop = obj.css('top'); + if (prevTop) { + prevTop = parseInt(prevTop.slice(0, -2)) + diff; + } + else { + prevTop = 0 + diff; + } + obj.css({'top': String(prevTop) + 'px'}); + } +} + +function isAnyVexDialogActive() { + var res = false; + for (var vexId in vex.getAll()) { + res = res || vex.getById(vexId).isOpen; + } + return res; +} + L.Map = L.Evented.extend({ options: { @@ -80,8 +101,6 @@ L.Map = L.Evented.extend({ this._serverRecycling = false; this._documentIdle = false; - vex.dialogID = -1; - this.callInitHooks(); if (this.options.imagePath) { @@ -866,19 +885,19 @@ L.Map = L.Evented.extend({ this._docLayer._requestNewTiles(); } - if (vex.dialogID > 0) { - var id = vex.dialogID; - - var options = vex.getVexByID(id).data().vex; - if (!options.overlayClosesOnClick || !options.escapeButtonCloses) - return false; + if (isAnyVexDialogActive()) { + for (var vexId in vex.getAll()) { + var opts = vex.getById(vexId).options; + if (!opts.overlayClosesOnClick || !opts.escapeButtonCloses) { + return false; + } + } - vex.dialogID = -1; this._startInactiveTimer(); if (!L.Browser.mobile) { this.focus(); } - return vex.close(id); + return vex.closeAll(); } } else { this.loadDocument(); @@ -911,36 +930,18 @@ L.Map = L.Evented.extend({ message = _('Inactive document - please click to resume editing'); } - var options = $.extend({}, vex.defaultOptions, { - contentCSS: {'background':'rgba(0, 0, 0, 0)', - 'font-size': 'xx-large', - 'color': '#fff', - 'text-align': 'center'}, - content: message - }); - options.id = vex.globalID; - vex.dialogID = options.id; - vex.globalID += 1; - options.$vex = $('<div>').addClass(vex.baseClassNames.vex).addClass(options.className).css(options.css).data({ - vex: options - }); - options.$vexOverlay = $('<div>').addClass(vex.baseClassNames.overlay).addClass(options.overlayClassName).css(options.overlayCSS).data({ - vex: options - }); - - options.$vex.bind('click.vex', function() { - console.debug('_dim: click.vex function'); - return map._activate(); - }); - options.$vex.append(options.$vexOverlay); - - options.$vexContent = $('<div>').addClass(vex.baseClassNames.content).addClass(options.contentClassName).css(options.contentCSS).text(options.content).data({ - vex: options + vex.open({ + content: message, + contentClassName: 'vex-idle', + afterOpen: function() { + var $vexContent = $(this.contentEl); + $vexContent.bind('click.vex', function() { + console.debug('_dim: click.vex function'); + return map._activate(); + }); + }, + showCloseButton: false }); - options.$vex.append(options.$vexContent); - - $(options.appendLocation).append(options.$vex); - vex.setupBodyClassName(options.$vex); this._doclayer && this._docLayer._onMessage('textselection:', null); console.debug('_dim: sending userinactive'); @@ -979,7 +980,7 @@ L.Map = L.Evented.extend({ console.debug('_deactivate:'); clearTimeout(vex.timer); - if (!this._active || vex.dialogID > 0) { + if (!this._active || isAnyVexDialogActive()) { // A dialog is already dimming the screen and probably // shows an error message. Leave it alone. this._active = false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits