From 7723529d3170d33951f1ae5caf6ebd5c87cea1b8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Jun 2020 16:42:45 +0200 Subject: [PATCH 1/4] Fix modal support for vue apps Signed-off-by: Joas Schilling --- core/src/jquery/ocdialog.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/jquery/ocdialog.js b/core/src/jquery/ocdialog.js index 518a28f75d3..8c4a7602a78 100644 --- a/core/src/jquery/ocdialog.js +++ b/core/src/jquery/ocdialog.js @@ -210,9 +210,14 @@ $.widget('oc.ocdialog', { } const self = this + let contentDiv = $('#content') + if (contentDiv.length === 0) { + // nextcloud-vue compatibility + contentDiv = $('.content') + } this.overlay = $('
') .addClass('oc-dialog-dim') - .appendTo($('#content')) + .appendTo(contentDiv) this.overlay.on('click keydown keyup', function(event) { if (event.target !== self.$dialog.get(0) && self.$dialog.find($(event.target)).length === 0) { event.preventDefault() From cf700c7ab40c658598e94d63d6e0ad53fdb9bfef Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Jun 2020 16:43:18 +0200 Subject: [PATCH 2/4] Make the confirm dialog modal by default Signed-off-by: Joas Schilling --- core/src/OC/dialogs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index 380aeb3a76b..2c8ecc54e32 100644 --- a/core/src/OC/dialogs.js +++ b/core/src/OC/dialogs.js @@ -107,7 +107,7 @@ const Dialogs = { 'none', buttons, callback, - modal + modal === undefined ? true : modal ) }, /** @@ -1245,7 +1245,7 @@ const Dialogs = { dir: '', name: '' // Ugly but works ;) }, { escapeFunction: null }).prependTo(this.$dirTree) - + }, /** * handle selection made in the tree list From dc62eb086d42d578a85fd4bc912d7514f878325b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 16 Jun 2020 12:21:10 +0200 Subject: [PATCH 3/4] Darker background for dark mode Signed-off-by: Joas Schilling --- core/src/jquery/css/jquery.ocdialog.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/jquery/css/jquery.ocdialog.scss b/core/src/jquery/css/jquery.ocdialog.scss index 89653ae181a..51efe3a00f8 100644 --- a/core/src/jquery/css/jquery.ocdialog.scss +++ b/core/src/jquery/css/jquery.ocdialog.scss @@ -72,6 +72,10 @@ height: 100%; } +body.dark .oc-dialog-dim { + opacity: .8; +} + .oc-dialog-content { width: 100%; max-width: 550px; From 1230916274c058eeff76960c7f34430c3337fdcf Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Jun 2020 16:44:59 +0200 Subject: [PATCH 4/4] Rebuild JS files Signed-off-by: Joas Schilling --- core/js/dist/login.js | 2 +- core/js/dist/login.js.map | 2 +- core/js/dist/main.js | 6 +++--- core/js/dist/main.js.map | 2 +- core/js/dist/maintenance.js | 2 +- core/js/dist/maintenance.js.map | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/js/dist/login.js b/core/js/dist/login.js index 5f60e308758..9b03a909e69 100644 --- a/core/js/dist/login.js +++ b/core/js/dist/login.js @@ -44,7 +44,7 @@ function(e){var t,n,r,i,o,a,s,u,c,l,d,f,p,h,m,_,v,y,g,M="sizzle"+1*new Date,L=e. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . - */var $={YES_NO_BUTTONS:70,OK_BUTTONS:71,FILEPICKER_TYPE_CHOOSE:1,FILEPICKER_TYPE_MOVE:2,FILEPICKER_TYPE_COPY:3,FILEPICKER_TYPE_COPY_MOVE:4,FILEPICKER_TYPE_CUSTOM:5,dialogsCounter:0,alert:function(e,t,n,r){this.message(e,t,"alert",$.OK_BUTTON,n,r)},info:function(e,t,n,r){this.message(e,t,"info",$.OK_BUTTON,n,r)},confirm:function(e,t,n,r){return this.message(e,t,"notice",$.YES_NO_BUTTONS,n,r)},confirmDestructive:function(e,t,n,r,i){return this.message(e,t,"none",n,r,i)},confirmHtml:function(e,t,n,r){return this.message(e,t,"notice",$.YES_NO_BUTTONS,n,r,!0)},prompt:function(e,n,r,i,o,a){return s.a.when(this._getMessageTemplate()).then((function(u){var c="oc-dialog-"+$.dialogsCounter+"-content",d="#"+c,f=u.octemplate({dialog_name:c,title:n,message:e,type:"notice"}),p=s()("");p.attr("type",a?"password":"text").attr("id",c+"-input").attr("placeholder",o);var h=s()("