From c8f7c96cfc1527386d54a9dd1d2caf513edfc7da Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 5 Jun 2020 13:25:22 -0400 Subject: [PATCH 1/8] preserve formatting when displaying multi-line team invite messages --- www/teams/app-team.less | 1 + 1 file changed, 1 insertion(+) diff --git a/www/teams/app-team.less b/www/teams/app-team.less index eb49ec21f..c59d0dcb9 100644 --- a/www/teams/app-team.less +++ b/www/teams/app-team.less @@ -220,6 +220,7 @@ width: 100%; padding: 12px; margin-bottom: 20px; + white-space: pre; } .cp-teams-invite-password { margin-bottom: 20px; From 154a0b1e6e8ff0c6d4e82745df368a3f212815e8 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 5 Jun 2020 13:32:56 -0400 Subject: [PATCH 2/8] hide the drive's contextmenu when you hit escape --- www/common/drive-ui.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 413b2624f..8c8d7f5f1 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -526,6 +526,8 @@ define([ } }); }); + + return $(menu); }; @@ -919,6 +921,11 @@ define([ if (e.ctrlKey) { ev.ctrlKey = true; } if (e.shiftKey) { ev.shiftKey = true; } + // ESC + if (e.which === 27) { + return void APP.hideMenu(); + } + // Enter if (e.which === 13) { var $allSelected = $content.find('.cp-app-drive-element.cp-app-drive-element-selected'); From b419ead7fefdb2891f99dc915be19f3220041457 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 5 Jun 2020 14:25:24 -0400 Subject: [PATCH 3/8] implement more intuitive keyboard controls for the tag prompt --- www/common/common-interface.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 79951c3c5..6ddf0a320 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -377,6 +377,14 @@ define([ field.focus(); }); + var $field = field.tokenfield.closest('.tokenfield').find('.token-input'); + $field.on('keypress', function (e) { + if (!$field.val() && e.which === 13) { return void $ok.click(); } + }); + $field.on('keydown', function (e) { + if (!$field.val() && e.which === 27) { return void $cancel.click(); } + }); + return tagger; }; From 1ef79d44b4312f76148ec29d3e31b4b4e75f3d35 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 8 Jun 2020 11:47:09 -0400 Subject: [PATCH 4/8] display a disabled upload button to logged out users in the filepicker modal --- www/secureiframe/inner.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/secureiframe/inner.js b/www/secureiframe/inner.js index a42cd5e7a..1aa94d9cd 100644 --- a/www/secureiframe/inner.js +++ b/www/secureiframe/inner.js @@ -177,7 +177,7 @@ define([ }); // If file, display the upload button - if (types.indexOf('file') !== -1 && common.isLoggedIn()) { + if (types.indexOf('file') !== -1) { var f = (filters && filters.filter) || {}; delete data.accept; if (Array.isArray(f.fileType)) { @@ -188,7 +188,13 @@ define([ return val; }); } - $filter.append(common.createButton('upload', false, data)); + } + + var $uploadButton = common.createButton('upload', false, data); + $filter.append($uploadButton); + if (!common.isLoggedIn()) { + $uploadButton.prop('disabled', true) + .prop('title', Messages.upload_mustLogin); } var $container = $(h('span.cp-filepicker-content', [ From ce5bcc0022bc840fecb6e33d0b9c5275725f68cd Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 8 Jun 2020 11:57:05 -0400 Subject: [PATCH 5/8] add an XXX for the upload button's tooltip --- www/common/common-ui-elements.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 70b0d25ed..3a032b36f 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1364,6 +1364,7 @@ define([ case 'import': button = $('