mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-10-01 13:41:42 +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:
+18
-11
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user