1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00
TiddlyWiki5/core/templates/external-js/tiddlywiki.js.tid
cdruan aa8f7f77d6
External.js: Allow boot code to remain as tiddlers in tiddlywikicore.js (#7210)
* 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
2023-01-19 16:52:12 +00:00

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}}`