mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-26 19:47:20 +00:00
Minor tweaks to boot kernel for AWS
Part of the upcoming AWS integration work is a custom build of TiddlyWiki that can run as an Amazon Lambda function. These tweaks enable the new build to control the loading of SJCL, the package info, and any preloaded tiddlers.
This commit is contained in:
parent
64b916bb43
commit
ad1793c8f5
12
boot/boot.js
12
boot/boot.js
@ -590,7 +590,7 @@ Crypto helper object for encrypted content. It maintains the password text in a
|
|||||||
the password, and to encrypt/decrypt a block of text
|
the password, and to encrypt/decrypt a block of text
|
||||||
*/
|
*/
|
||||||
$tw.utils.Crypto = function() {
|
$tw.utils.Crypto = function() {
|
||||||
var sjcl = $tw.node ? require("./sjcl.js") : window.sjcl,
|
var sjcl = $tw.node ? (global.sjcl || require("./sjcl.js")) : window.sjcl,
|
||||||
currentPassword = null,
|
currentPassword = null,
|
||||||
callSjcl = function(method,inputText,password) {
|
callSjcl = function(method,inputText,password) {
|
||||||
password = password || currentPassword;
|
password = password || currentPassword;
|
||||||
@ -1399,10 +1399,6 @@ $tw.loadTiddlersBrowser = function() {
|
|||||||
for(var t=0; t<containerIds.length; t++) {
|
for(var t=0; t<containerIds.length; t++) {
|
||||||
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById(containerIds[t])));
|
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById(containerIds[t])));
|
||||||
}
|
}
|
||||||
// Load any preloaded tiddlers
|
|
||||||
if($tw.preloadTiddlers) {
|
|
||||||
$tw.wiki.addTiddlers($tw.preloadTiddlers);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -1808,7 +1804,7 @@ $tw.boot.startup = function(options) {
|
|||||||
$tw.boot.wikiPath = process.cwd();
|
$tw.boot.wikiPath = process.cwd();
|
||||||
}
|
}
|
||||||
// Read package info
|
// Read package info
|
||||||
$tw.packageInfo = require("../package.json");
|
$tw.packageInfo = $tw.packageInfo || require("../package.json");
|
||||||
// Check node version number
|
// Check node version number
|
||||||
if(!$tw.utils.checkVersions(process.version.substr(1),$tw.packageInfo.engines.node.substr(2))) {
|
if(!$tw.utils.checkVersions(process.version.substr(1),$tw.packageInfo.engines.node.substr(2))) {
|
||||||
$tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engines.node);
|
$tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engines.node);
|
||||||
@ -1866,6 +1862,10 @@ $tw.boot.startup = function(options) {
|
|||||||
} else {
|
} else {
|
||||||
$tw.loadTiddlersNode();
|
$tw.loadTiddlersNode();
|
||||||
}
|
}
|
||||||
|
// Load any preloaded tiddlers
|
||||||
|
if($tw.preloadTiddlers) {
|
||||||
|
$tw.wiki.addTiddlers($tw.preloadTiddlers);
|
||||||
|
}
|
||||||
// Unpack plugin tiddlers
|
// Unpack plugin tiddlers
|
||||||
$tw.wiki.readPluginInfo();
|
$tw.wiki.readPluginInfo();
|
||||||
$tw.wiki.registerPluginTiddlers("plugin",$tw.safeMode ? ["$:/core"] : undefined);
|
$tw.wiki.registerPluginTiddlers("plugin",$tw.safeMode ? ["$:/core"] : undefined);
|
||||||
|
@ -99,7 +99,14 @@ $tw.preloadTiddler = function(fields) {
|
|||||||
$tw.preloadTiddlers.push(fields);
|
$tw.preloadTiddlers.push(fields);
|
||||||
};
|
};
|
||||||
|
|
||||||
return $tw
|
/*
|
||||||
|
Convenience function for pushing an array of tiddlers onto the preloading array
|
||||||
|
*/
|
||||||
|
$tw.preloadTiddlerArray = function(fieldsArray) {
|
||||||
|
$tw.preloadTiddlers.push.apply($tw.preloadTiddlers,fieldsArray);
|
||||||
|
};
|
||||||
|
|
||||||
|
return $tw;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user