diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js index f7790ad66..2320bf9af 100644 --- a/customize.dist/application_config.js +++ b/customize.dist/application_config.js @@ -68,7 +68,7 @@ define(function() { config.displayCreationScreen = false; - config.disableAnonymousStore = true; + config.disableAnonymousStore = false; return config; }); diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 6906de889..f120beef1 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -377,7 +377,7 @@ define([ var isAvailableType = function (x) { 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; }); }; @@ -570,6 +570,19 @@ define([ 'name': '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($('')[0], Msg.register_importRecent) + /*h('label', { + 'for': 'import-recent', + }, Msg.register_importRecent),*/ + ]), h('div.extra', [ h('button.login.first.btn', Msg.login_login) ]) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index f45d44380..14cb3e53a 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -496,6 +496,7 @@ define([ UI.removeLoadingScreen = function (cb) { // Release the test blocker, hopefully every test has been registered. // This test is created in sframe-boot2.js + cb = cb || function () {}; if (Test.__ASYNC_BLOCKER__) { Test.__ASYNC_BLOCKER__.pass(); } $('#' + LOADING).addClass("cp-loading-hidden"); @@ -508,9 +509,9 @@ define([ 'opacity': 0, 'pointer-events': 'none', }); - setTimeout(function () { - $tip.remove(); - }, 3750); + window.setTimeout(function () { + $tip.remove(); + }, 3750); // jquery.fadeout can get stuck }; UI.errorLoadingScreen = function (error, transparent) { diff --git a/www/login/main.js b/www/login/main.js index 408203d9b..f6a9cebb6 100644 --- a/www/login/main.js +++ b/www/login/main.js @@ -12,6 +12,7 @@ define([ ], function ($, Cryptpad, Login, UI, Realtime, Feedback, LocalStore, Test) { $(function () { var $main = $('#mainBlock'); + var $checkImport = $('#import-recent'); var Messages = Cryptpad.Messages; // 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"); } hashing = true; + var shouldImport = $checkImport[0].checked; // setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up window.setTimeout(function () { @@ -96,6 +98,9 @@ define([ test.pass(); return; } + if (shouldImport) { + sessionStorage.migrateAnonDrive = 1; + } if (sessionStorage.redirectTo) { var h = sessionStorage.redirectTo; var parser = document.createElement('a');