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

pull/1/head
ansuz 7 years ago
commit 4afc04f64c

@ -68,7 +68,7 @@ define(function() {
config.displayCreationScreen = false; config.displayCreationScreen = false;
config.disableAnonymousStore = true; config.disableAnonymousStore = false;
return config; return config;
}); });

@ -377,7 +377,7 @@ define([
var isAvailableType = function (x) { var isAvailableType = function (x) {
if (!Array.isArray(AppConfig.availablePadTypes)) { return true; } if (!Array.isArray(AppConfig.availablePadTypes)) { return true; }
return AppConfig.availablePadTypes.some(function (type, i) { return AppConfig.availablePadTypes.some(function (type) {
return x.indexOf(type) > -1; return x.indexOf(type) > -1;
}); });
}; };
@ -570,6 +570,19 @@ define([
'name': 'password', 'name': 'password',
placeholder: Msg.login_password, placeholder: Msg.login_password,
}), }),
h('div.checkbox-container', [
h('input#import-recent', {
name: 'import-recent',
type: 'checkbox',
checked: true
}),
// hscript doesn't generate for on label for some
// reason... use jquery as a temporary fallback
setHTML($('<label for="import-recent"></label>')[0], Msg.register_importRecent)
/*h('label', {
'for': 'import-recent',
}, Msg.register_importRecent),*/
]),
h('div.extra', [ h('div.extra', [
h('button.login.first.btn', Msg.login_login) h('button.login.first.btn', Msg.login_login)
]) ])

@ -496,6 +496,7 @@ define([
UI.removeLoadingScreen = function (cb) { UI.removeLoadingScreen = function (cb) {
// Release the test blocker, hopefully every test has been registered. // Release the test blocker, hopefully every test has been registered.
// This test is created in sframe-boot2.js // This test is created in sframe-boot2.js
cb = cb || function () {};
if (Test.__ASYNC_BLOCKER__) { Test.__ASYNC_BLOCKER__.pass(); } if (Test.__ASYNC_BLOCKER__) { Test.__ASYNC_BLOCKER__.pass(); }
$('#' + LOADING).addClass("cp-loading-hidden"); $('#' + LOADING).addClass("cp-loading-hidden");
@ -508,9 +509,9 @@ define([
'opacity': 0, 'opacity': 0,
'pointer-events': 'none', 'pointer-events': 'none',
}); });
setTimeout(function () { window.setTimeout(function () {
$tip.remove(); $tip.remove();
}, 3750); }, 3750);
// jquery.fadeout can get stuck // jquery.fadeout can get stuck
}; };
UI.errorLoadingScreen = function (error, transparent) { UI.errorLoadingScreen = function (error, transparent) {

@ -12,6 +12,7 @@ define([
], function ($, Cryptpad, Login, UI, Realtime, Feedback, LocalStore, Test) { ], function ($, Cryptpad, Login, UI, Realtime, Feedback, LocalStore, Test) {
$(function () { $(function () {
var $main = $('#mainBlock'); var $main = $('#mainBlock');
var $checkImport = $('#import-recent');
var Messages = Cryptpad.Messages; var Messages = Cryptpad.Messages;
// main block is hidden in case javascript is disabled // main block is hidden in case javascript is disabled
@ -59,6 +60,7 @@ define([
if (hashing) { return void console.log("hashing is already in progress"); } if (hashing) { return void console.log("hashing is already in progress"); }
hashing = true; hashing = true;
var shouldImport = $checkImport[0].checked;
// setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up // setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up
window.setTimeout(function () { window.setTimeout(function () {
@ -96,6 +98,9 @@ define([
test.pass(); test.pass();
return; return;
} }
if (shouldImport) {
sessionStorage.migrateAnonDrive = 1;
}
if (sessionStorage.redirectTo) { if (sessionStorage.redirectTo) {
var h = sessionStorage.redirectTo; var h = sessionStorage.redirectTo;
var parser = document.createElement('a'); var parser = document.createElement('a');

Loading…
Cancel
Save