Add a default pad in CryptDrive after signing up
parent
85fe67618c
commit
550c65aae0
|
@ -121,5 +121,9 @@ define(['/customize/languageSelector.js',
|
||||||
'</p>',
|
'</p>',
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
|
messages.driveReadme = '["BODY",{"class":"cke_editable cke_editable_themed cke_contents_ltr cke_show_borders","contenteditable":"true","spellcheck":"false","style":"color: rgb(51, 51, 51);"},' +
|
||||||
|
'[["H1",{},["' + messages.driveReadme_h1 + '",["BR",{},[]]]],["UL",{},[["LI",{},["' + messages.driveReadme_li1 + '",["BR",{},[]],["UL",{},[["LI",{},["' + messages.driveReadme_li1_1 + '",["BR",{},[]]]]]]]]]]],' +
|
||||||
|
'{"metadata":{"defaultTitle":"' + messages.driveReadmeTitle + '","title":"' + messages.driveReadmeTitle + '"}}]';
|
||||||
|
|
||||||
return messages;
|
return messages;
|
||||||
});
|
});
|
||||||
|
|
|
@ -448,5 +448,10 @@ define(function () {
|
||||||
' - Your slides are updated in realtime'
|
' - Your slides are updated in realtime'
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
|
out.driveReadmeTitle = "What is CryptDrive?";
|
||||||
|
out.driveReadme_h1 = "Welcome to CryptPad";
|
||||||
|
out.driveReadme_li1 = "CryptDrive : all your pads sorted in one place";
|
||||||
|
out.driveReadme_li1_1 = "Tree, trash, unsorted files, etc.";
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1871,6 +1871,27 @@ define([
|
||||||
if (typeof(cb) === "function") { cb(); }
|
if (typeof(cb) === "function") { cb(); }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
var createReadme = function (proxy, cb) {
|
||||||
|
if (proxy.initializing) {
|
||||||
|
console.log('test');
|
||||||
|
var hash = Cryptpad.createRandomHash();
|
||||||
|
Get.put(hash, Messages.driveReadme, function (e) {
|
||||||
|
if (e) { console.error(e); }
|
||||||
|
var href = '/pad/#' + hash;
|
||||||
|
proxy.drive[UNSORTED].push(href);
|
||||||
|
proxy.drive[FILES_DATA].push({
|
||||||
|
href: href,
|
||||||
|
title: Messages.driveReadmeTitle,
|
||||||
|
atime: new Date().toISOString(),
|
||||||
|
ctime: new Date().toISOString()
|
||||||
|
});
|
||||||
|
if (typeof(cb) === "function") { cb(); }
|
||||||
|
});
|
||||||
|
delete proxy.initializing;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (typeof(cb) === "function") { cb(); }
|
||||||
|
};
|
||||||
|
|
||||||
// don't initialize until the store is ready.
|
// don't initialize until the store is ready.
|
||||||
Cryptpad.ready(function () {
|
Cryptpad.ready(function () {
|
||||||
|
@ -1966,11 +1987,13 @@ define([
|
||||||
module.files = proxy;
|
module.files = proxy;
|
||||||
if (!proxy.drive || typeof(proxy.drive) !== 'object') { proxy.drive = {}; }
|
if (!proxy.drive || typeof(proxy.drive) !== 'object') { proxy.drive = {}; }
|
||||||
migrateAnonDrive(proxy, function () {
|
migrateAnonDrive(proxy, function () {
|
||||||
|
createReadme(proxy, function () {
|
||||||
initLocalStorage();
|
initLocalStorage();
|
||||||
init(proxy);
|
init(proxy);
|
||||||
APP.userList.onChange();
|
APP.userList.onChange();
|
||||||
Cryptpad.removeLoadingScreen();
|
Cryptpad.removeLoadingScreen();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
var onDisconnect = function (info) {
|
var onDisconnect = function (info) {
|
||||||
setEditable(false);
|
setEditable(false);
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
define([
|
define([
|
||||||
'/common/login.js',
|
'/common/login.js',
|
||||||
'/common/cryptpad-common.js',
|
'/common/cryptpad-common.js',
|
||||||
|
'/common/cryptget.js',
|
||||||
'/common/credential.js',
|
'/common/credential.js',
|
||||||
'/bower_components/jquery/dist/jquery.min.js',
|
'/bower_components/jquery/dist/jquery.min.js',
|
||||||
], function (Login, Cryptpad) {
|
], function (Login, Cryptpad, Crypt) {
|
||||||
var $ = window.jQuery;
|
var $ = window.jQuery;
|
||||||
|
|
||||||
var APP = window.APP = {
|
var APP = window.APP = {
|
||||||
|
@ -118,6 +119,7 @@ define([
|
||||||
|
|
||||||
proxy.login_name = uname;
|
proxy.login_name = uname;
|
||||||
proxy[Cryptpad.displayNameKey] = uname;
|
proxy[Cryptpad.displayNameKey] = uname;
|
||||||
|
proxy.initializing = true;
|
||||||
|
|
||||||
Cryptpad.whenRealtimeSyncs(result.realtime, function () {
|
Cryptpad.whenRealtimeSyncs(result.realtime, function () {
|
||||||
Cryptpad.login(result.userHash, result.userName, function () {
|
Cryptpad.login(result.userHash, result.userName, function () {
|
||||||
|
|
Loading…
Reference in New Issue