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

pull/1/head
yflory 7 years ago
commit bafa401473

@ -215,9 +215,10 @@ define([
force = opt.force || false; force = opt.force || false;
} else if (typeof(opt) === 'boolean') { } else if (typeof(opt) === 'boolean') {
force = opt; force = opt;
}
if (typeof(opt) !== 'object') {
opt = {}; opt = {};
} }
cb = cb || function () {}; cb = cb || function () {};
var message; var message;
@ -278,22 +279,25 @@ define([
]); ]);
var listener; var listener;
var close = Util.once(function () { var close = Util.once(function (result, ev) {
$(frame).fadeOut(150, function () { $(this).remove(); }); var $frame = $(frame).fadeOut(150, function () {
stopListening(listener); stopListening(listener);
$frame.remove();
cb(result, ev);
});
}); });
var $ok = $(ok).click(function (ev) { cb(input.value, ev); }); var $ok = $(ok).click(function (ev) { close(input.value, ev); });
var $cancel = $(cancel).click(function (ev) { cb(null, ev); }); var $cancel = $(cancel).click(function (ev) { close(null, ev); });
listener = listenForKeys(function () { // yes listener = listenForKeys(function () { // yes
close(); $ok.click(); $ok.click();
}, function () { // no }, function () { // no
close(); $cancel.click(); $cancel.click();
}); });
document.body.appendChild(frame); document.body.appendChild(frame);
setTimeout(function () { setTimeout(function () {
input.select().focus(); $(input).select().focus();
UI.notify(); UI.notify();
}); });
}; };
@ -321,13 +325,14 @@ define([
]); ]);
var listener; var listener;
var close = Util.once(function () { var close = Util.once(function (bool, ev) {
$(frame).fadeOut(150, function () { $(this).remove(); }); $(frame).fadeOut(150, function () { $(this).remove(); });
stopListening(listener); stopListening(listener);
cb(bool, ev);
}); });
var $ok = $(ok).click(function (ev) { close(); cb(true, ev); }); var $ok = $(ok).click(function (ev) { close(true, ev); });
var $cancel = $(cancel).click(function (ev) { close(); cb(false, ev); }); var $cancel = $(cancel).click(function (ev) { close(false, ev); });
if (opt.cancelClass) { $cancel.addClass(opt.cancelClass); } if (opt.cancelClass) { $cancel.addClass(opt.cancelClass); }
if (opt.okClass) { $ok.addClass(opt.okClass); } if (opt.okClass) { $ok.addClass(opt.okClass); }

@ -251,8 +251,8 @@ define([
Test(function () { Test(function () {
$uname.val('test' + Math.random()); $uname.val('test' + Math.random());
$passwd.val('test'); $passwd.val('testtest');
$confirm.val('test'); $confirm.val('testtest');
$checkImport[0].checked = true; $checkImport[0].checked = true;
$checkAcceptTerms[0].checked = true; $checkAcceptTerms[0].checked = true;
$register.click(); $register.click();

Loading…
Cancel
Save