diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 83598f410..e1b2b1372 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -32,6 +32,8 @@ ExportTiddler/Caption: export tiddler ExportTiddler/Hint: Export tiddler ExportTiddlers/Caption: export tiddlers ExportTiddlers/Hint: Export tiddlers +ExportTiddlyWikiCore/Caption: export TiddlyWiki core +ExportTiddlyWikiCore/Hint: Export the ~TiddlyWiki core code for running with external ~JavaScript SidebarSearch/Hint: Select the sidebar search field Fold/Caption: fold tiddler Fold/Hint: Fold the body of this tiddler diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js index e2ac21361..119c3e67a 100644 --- a/core/modules/saver-handler.js +++ b/core/modules/saver-handler.js @@ -157,7 +157,8 @@ SaverHandler.prototype.saveWiki = function(options) { return false; } var variables = options.variables || {}, - template = options.template || "$:/core/save/all", + template = (options.template || + this.wiki.getTiddlerText("$:/config/SaveWikiButton/Template","$:/core/save/all")).trim(), downloadType = options.downloadType || "text/plain", text = this.wiki.renderTiddler(downloadType,template,options), callback = function(err) { diff --git a/core/templates/external-js/save-all-external-js.tid b/core/templates/external-js/save-all-external-js.tid index 51f6d6508..a41cc0682 100644 --- a/core/templates/external-js/save-all-external-js.tid +++ b/core/templates/external-js/save-all-external-js.tid @@ -4,4 +4,5 @@ title: $:/core/save/all-external-js \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)$ \end +\define coreURL() %24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js {{$:/core/templates/tiddlywiki5-external-js.html}} diff --git a/core/templates/external-js/save-offline-external-js.tid b/core/templates/external-js/save-offline-external-js.tid new file mode 100644 index 000000000..7175f7eea --- /dev/null +++ b/core/templates/external-js/save-offline-external-js.tid @@ -0,0 +1,8 @@ +title: $:/core/save/offline-external-js + +\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)$ +\end +\define coreURL() tiddlywikicore-$(version)$.js +{{$:/core/templates/tiddlywiki5-external-js.html}} diff --git a/core/templates/external-js/tiddlywiki.js.tiddlers.tid b/core/templates/external-js/tiddlywiki.js.tiddlers.tid index 322e7ae5e..3b5d1bfe6 100644 --- a/core/templates/external-js/tiddlywiki.js.tiddlers.tid +++ b/core/templates/external-js/tiddlywiki.js.tiddlers.tid @@ -2,4 +2,8 @@ title: $:/core/templates/tiddlywiki5.js/tiddlers ` $tw.preloadTiddlerArray(`<$text text=<>/>`); +$tw.preloadTiddlerArray([{ + title: "$:/config/SaveWikiButton/Template", + text: "$:/core/save/offline-external-js" +}]); ` diff --git a/core/templates/external-js/tiddlywiki5-external-js.html.tid b/core/templates/external-js/tiddlywiki5-external-js.html.tid index 31e583c6c..6a5c4c1bb 100644 --- a/core/templates/external-js/tiddlywiki5-external-js.html.tid +++ b/core/templates/external-js/tiddlywiki5-external-js.html.tid @@ -2,7 +2,7 @@ title: $:/core/templates/tiddlywiki5-external-js.html \rules only filteredtranscludeinline transcludeinline -{{$:/core/templates/MOTW.html}} +{{$:/core/templates/MOTW.html}} @@ -43,5 +43,6 @@ title: $:/core/templates/tiddlywiki5-external-js.html {{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/BottomBody]] ||$:/core/templates/raw-static-tiddler}}} - + + diff --git a/core/ui/PageControls/export-tiddlywikicore.tid b/core/ui/PageControls/export-tiddlywikicore.tid new file mode 100644 index 000000000..77436dc9e --- /dev/null +++ b/core/ui/PageControls/export-tiddlywikicore.tid @@ -0,0 +1,25 @@ +title: $:/core/ui/Buttons/export-tiddlywikicore +tags: $:/tags/PageControls +caption: {{$:/core/images/star-filled}} {{$:/language/Buttons/ExportTiddlyWikiCore/Caption}} +description: {{$:/language/Buttons/ExportTiddlyWikiCore/Hint}} + +\whitespace trim +\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 `