mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-27 02:20:28 +00:00
aa8f7f77d6
* Allow boot code to remain as tiddlers * Sync up with tiddlywiki5.html * Add \whitespace trim * Add download-full-wiki button * Simplify ExportTiddlyWikiCore code No longer needs the if-boot-code-is-missing part of the code. * Replace space btw icon and button text with CSS
49 lines
1.2 KiB
Plaintext
49 lines
1.2 KiB
Plaintext
|
|
title: $:/core/templates/tiddlywiki5.js
|
|
|
|
\rules only filteredtranscludeinline transcludeinline codeinline
|
|
|
|
`/*
|
|
`{{ $:/core/copyright.txt ||$:/core/templates/plain-text-tiddler}}`
|
|
*/
|
|
|
|
$tw = (typeof $tw === 'undefined') ? Object.create(null) : $tw;
|
|
|
|
$tw.preloadTiddlers = $tw.preloadTiddlers || [];
|
|
|
|
_load = function(window,tiddler) {
|
|
"use strict";
|
|
var f;
|
|
$tw.preloadTiddlers.push(tiddler);
|
|
if(tiddler.library === "yes") {
|
|
var module = { exports:{} };
|
|
var moduleName = function moduleName(path) {
|
|
var word = path.split("/").pop();
|
|
word = word.substring(0,word.indexOf(".")) || word;
|
|
return word;
|
|
}
|
|
f = new Function("module",tiddler.text);
|
|
f(module);
|
|
window[moduleName(tiddler.title)] = module.exports;
|
|
} else {
|
|
f = new Function("window",tiddler.text);
|
|
f(window);
|
|
}
|
|
}
|
|
|
|
/* ~~ Library modules ~~ */
|
|
|
|
`{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/tiddlywiki.js/load-tiddler}}}`
|
|
|
|
/* ~~ Boot kernel prologue ~~ */
|
|
|
|
`{{ $:/boot/bootprefix.js ||$:/core/templates/tiddlywiki.js/load-tiddler}}`
|
|
|
|
/* ~~ Core tiddlers ~~ */
|
|
|
|
`{{$:/core/templates/tiddlywiki5.js/tiddlers}}`
|
|
|
|
/* ~~ Boot kernel ~~ */
|
|
|
|
`{{ $:/boot/boot.js ||$:/core/templates/tiddlywiki.js/load-tiddler}}`
|