mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-30 05:19:57 +00:00
Refactor boot sequence
This is the start of making it possible to use TiddlyWiki5 as a library from a node.js application
This commit is contained in:
parent
1fd59a4bd3
commit
644d9f9405
29
boot/boot.js
29
boot/boot.js
@ -1374,19 +1374,26 @@ $tw.boot.startup = function() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/////////////////////////// Decrypt tiddlers and then startup
|
/////////////////////////// Main boot function to decrypt tiddlers and then startup
|
||||||
|
|
||||||
|
$tw.boot.boot = function() {
|
||||||
|
// Initialise crypto object
|
||||||
|
$tw.crypto = new $tw.utils.Crypto();
|
||||||
|
// Initialise password prompter
|
||||||
|
if($tw.browser) {
|
||||||
|
$tw.passwordPrompt = new $tw.utils.PasswordPrompt();
|
||||||
|
}
|
||||||
|
// Preload any encrypted tiddlers
|
||||||
|
$tw.boot.decryptEncryptedTiddlers(function() {
|
||||||
|
// Startup
|
||||||
|
$tw.boot.startup();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////// Autoboot in the browser
|
||||||
|
|
||||||
// Initialise crypto object
|
|
||||||
$tw.crypto = new $tw.utils.Crypto();
|
|
||||||
// Initialise password prompter
|
|
||||||
if($tw.browser) {
|
if($tw.browser) {
|
||||||
$tw.passwordPrompt = new $tw.utils.PasswordPrompt();
|
$tw.boot.boot();
|
||||||
}
|
}
|
||||||
// Preload any encrypted tiddlers
|
|
||||||
$tw.boot.decryptEncryptedTiddlers(function() {
|
|
||||||
// Startup
|
|
||||||
$tw.boot.startup();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -5,3 +5,6 @@ This is invoked as a shell script by NPM when the `tiddlywiki` command is typed
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var tiddlywiki = require("./boot/boot.js");
|
var tiddlywiki = require("./boot/boot.js");
|
||||||
|
|
||||||
|
// Boot the TW5 app
|
||||||
|
$tw.boot.boot();
|
||||||
|
Loading…
Reference in New Issue
Block a user