Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
yflory 5 years ago
commit d9259d4658

@ -377,6 +377,14 @@ define([
field.focus(); 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; return tagger;
}; };

@ -1364,6 +1364,7 @@ define([
case 'import': case 'import':
button = $('<button>', { button = $('<button>', {
'class': 'fa fa-upload cp-toolbar-icon-import', 'class': 'fa fa-upload cp-toolbar-icon-import',
// XXX text is weird anywhere other than the drive
title: Messages.importButtonTitle, title: Messages.importButtonTitle,
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.importButton)); }).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.importButton));
/*if (data.types) { /*if (data.types) {
@ -1569,6 +1570,7 @@ define([
button = $('<button>', { button = $('<button>', {
title: Messages.printButtonTitle2, title: Messages.printButtonTitle2,
'class': "fa fa-print cp-toolbar-icon-print", 'class': "fa fa-print cp-toolbar-icon-print",
// XXX people don't realize this does PDF (https://github.com/xwiki-labs/cryptpad/issues/357#issuecomment-640711724)
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.printText)); }).append($('<span>', {'class': 'cp-toolbar-drawer-element'}).text(Messages.printText));
break; break;
case 'history': case 'history':

@ -526,6 +526,8 @@ define([
} }
}); });
}); });
return $(menu); return $(menu);
}; };
@ -919,6 +921,11 @@ define([
if (e.ctrlKey) { ev.ctrlKey = true; } if (e.ctrlKey) { ev.ctrlKey = true; }
if (e.shiftKey) { ev.shiftKey = true; } if (e.shiftKey) { ev.shiftKey = true; }
// ESC
if (e.which === 27) {
return void APP.hideMenu();
}
// Enter // Enter
if (e.which === 13) { if (e.which === 13) {
var $allSelected = $content.find('.cp-app-drive-element.cp-app-drive-element-selected'); var $allSelected = $content.find('.cp-app-drive-element.cp-app-drive-element-selected');

@ -376,6 +376,7 @@ define([
todo(); todo();
}); });
var $upButton = common.createButton('upload', false, data); var $upButton = common.createButton('upload', false, data);
$upButton.removeProp('title');
$upButton.text(Messages.profile_upload); $upButton.text(Messages.profile_upload);
$upButton.prepend($('<span>', {'class': 'fa fa-upload'})); $upButton.prepend($('<span>', {'class': 'fa fa-upload'}));
$block.append($upButton); $block.append($upButton);

@ -177,7 +177,7 @@ define([
}); });
// If file, display the upload button // If file, display the upload button
if (types.indexOf('file') !== -1 && common.isLoggedIn()) { if (types.indexOf('file') !== -1) {
var f = (filters && filters.filter) || {}; var f = (filters && filters.filter) || {};
delete data.accept; delete data.accept;
if (Array.isArray(f.fileType)) { if (Array.isArray(f.fileType)) {
@ -188,7 +188,13 @@ define([
return val; 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', [ var $container = $(h('span.cp-filepicker-content', [

@ -173,7 +173,7 @@ define([
classes: 'btn-danger' classes: 'btn-danger'
}, function() { }, function() {
if (typeof(onHide) !== "function") { return; } if (typeof(onHide) !== "function") { return; }
onHide(hide); // XXX onHide(hide);
}); });
$(answer).click(function () { $(answer).click(function () {

@ -220,6 +220,7 @@
width: 100%; width: 100%;
padding: 12px; padding: 12px;
margin-bottom: 20px; margin-bottom: 20px;
white-space: pre;
} }
.cp-teams-invite-password { .cp-teams-invite-password {
margin-bottom: 20px; margin-bottom: 20px;

@ -987,6 +987,7 @@ define([
}); });
}); });
var $upButton = common.createButton('upload', false, data); var $upButton = common.createButton('upload', false, data);
$upButton.removeProp('title');
$upButton.text(Messages.profile_upload); $upButton.text(Messages.profile_upload);
$upButton.prepend($('<span>', {'class': 'fa fa-upload'})); $upButton.prepend($('<span>', {'class': 'fa fa-upload'}));

Loading…
Cancel
Save