diff --git a/core/templates/external-js/save-all-external-js.tid b/core/templates/external-js/save-all-external-js.tid index cd15cedc3..2616fed20 100644 --- a/core/templates/external-js/save-all-external-js.tid +++ b/core/templates/external-js/save-all-external-js.tid @@ -1,5 +1,6 @@ title: $:/core/save/all-external-js +\whitespace trim \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] \define saveTiddlerFilter() [is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ diff --git a/core/templates/external-js/save-offline-external-js.tid b/core/templates/external-js/save-offline-external-js.tid index 2dfca5d52..01ae88aa0 100644 --- a/core/templates/external-js/save-offline-external-js.tid +++ b/core/templates/external-js/save-offline-external-js.tid @@ -1,5 +1,6 @@ title: $:/core/save/offline-external-js +\whitespace trim \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] \define saveTiddlerFilter() [is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ diff --git a/core/templates/external-js/tiddlywiki.js.load.tid b/core/templates/external-js/tiddlywiki.js.load.tid new file mode 100644 index 000000000..496d6ed04 --- /dev/null +++ b/core/templates/external-js/tiddlywiki.js.load.tid @@ -0,0 +1,3 @@ +title: $:/core/templates/tiddlywiki.js/load-tiddler + +_load(window,<$macrocall $name="jsontiddler" $output="text/raw"/>); \ No newline at end of file diff --git a/core/templates/external-js/tiddlywiki.js.tid b/core/templates/external-js/tiddlywiki.js.tid index a8170663f..f962569a2 100644 --- a/core/templates/external-js/tiddlywiki.js.tid +++ b/core/templates/external-js/tiddlywiki.js.tid @@ -1,15 +1,48 @@ + title: $:/core/templates/tiddlywiki5.js \rules only filteredtranscludeinline transcludeinline codeinline -/* -{{ $:/core/copyright.txt ||$:/core/templates/plain-text-tiddler}} -`*/ -` -{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/plain-text-tiddler}}} - -{{ $:/boot/bootprefix.js ||$:/core/templates/plain-text-tiddler}} - -{{$:/core/templates/tiddlywiki5.js/tiddlers}} - -{{ $:/boot/boot.js ||$:/core/templates/plain-text-tiddler}} +`/* +`{{ $:/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}}` diff --git a/core/templates/external-js/tiddlywiki5-external-js.html.tid b/core/templates/external-js/tiddlywiki5-external-js.html.tid index 6a5c4c1bb..b161584d7 100644 --- a/core/templates/external-js/tiddlywiki5-external-js.html.tid +++ b/core/templates/external-js/tiddlywiki5-external-js.html.tid @@ -1,48 +1,50 @@ title: $:/core/templates/tiddlywiki5-external-js.html -\rules only filteredtranscludeinline transcludeinline - -{{$:/core/templates/MOTW.html}} +<$set name="saveTiddlerAndShadowsFilter" filter="[subfilter] [subfilterplugintiddlers[]]"> +` +`{{$:/core/templates/MOTW.html}}` -{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}} +`{{{ [enlisttag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}}` - + - + -{{$:/core/wiki/title}} +`{{$:/core/wiki/title}}` -{{{ [all[shadows+tiddlers]tag[$:/core/wiki/rawmarkup]] [all[shadows+tiddlers]tag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}} -{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified]] ||$:/core/templates/raw-static-tiddler}}} +`{{{ [enlisttag[$:/core/wiki/rawmarkup]] ||$:/core/templates/plain-text-tiddler}}}` +`{{{ [enlisttag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}}` +`{{{ [enlisttag[$:/tags/RawMarkupWikified]] ||$:/core/templates/raw-static-tiddler}}}` -{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/TopBody]] ||$:/core/templates/raw-static-tiddler}}} +`{{{ [enlisttag[$:/tags/RawMarkupWikified/TopBody]] ||$:/core/templates/raw-static-tiddler}}}`
-{{$:/boot/boot.css||$:/core/templates/css-tiddler}} +`{{$:/boot/boot.css||$:/core/templates/css-tiddler}}`
-{{$:/core/templates/store.area.template.html}} +`{{$:/core/templates/store.area.template.html}}` -{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/BottomBody]] ||$:/core/templates/raw-static-tiddler}}} +`{{{ [enlisttag[$:/tags/RawMarkupWikified/BottomBody]] ||$:/core/templates/raw-static-tiddler}}}` + + - - - +` + \ No newline at end of file diff --git a/core/ui/DownloadFullWiki.tid b/core/ui/DownloadFullWiki.tid new file mode 100644 index 000000000..bfae2ceb6 --- /dev/null +++ b/core/ui/DownloadFullWiki.tid @@ -0,0 +1,18 @@ +title: $:/core/ui/DownloadFullWiki + +\whitespace trim +\rules except wikilink + +To download the standard single-file version of your wiki: + +<$wikify name="site-title" text={{$:/config/SaveWikiButton/Filename}}> +<$let publishFilter="""-[[$:/config/SaveWikiButton/Template]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]]"""> +<$button tooltip="Download fully standalone wiki" aria-label="download full wiki" class="tc-btn-big-green"> +<$action-sendmessage $message="tm-download-file" $param="$:/core/save/all" publishFilter=<> filename=<>/> +{{$:/core/images/download-button}} + +Download full wiki + + + + \ No newline at end of file diff --git a/core/ui/ExportTiddlyWikiCore.tid b/core/ui/ExportTiddlyWikiCore.tid index 8c85c87a4..4b913a020 100644 --- a/core/ui/ExportTiddlyWikiCore.tid +++ b/core/ui/ExportTiddlyWikiCore.tid @@ -1,11 +1,6 @@ title: $:/core/ui/ExportTiddlyWikiCore \define jsFileName() tiddlywikicore-$(version)$.js -\define noExportMsg() -It appears that you have a wiki with an external ~TiddlyWiki core. The export action cannot be performed. -

You will need to view the page source in your browser. Then go to the very bottom the the source, find the last `