diff --git a/boot/boot.js b/boot/boot.js index 57400121a..60d00798d 100644 --- a/boot/boot.js +++ b/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) { - $tw.passwordPrompt = new $tw.utils.PasswordPrompt(); + $tw.boot.boot(); } -// Preload any encrypted tiddlers -$tw.boot.decryptEncryptedTiddlers(function() { - // Startup - $tw.boot.startup(); -}); - })(); diff --git a/tiddlywiki.js b/tiddlywiki.js index b53581984..666f0979c 100755 --- a/tiddlywiki.js +++ b/tiddlywiki.js @@ -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"); + +// Boot the TW5 app +$tw.boot.boot();