diff --git a/core/templates/external-js/tiddlywiki.js.tiddlers.tid b/core/templates/external-js/tiddlywiki.js.tiddlers.tid index 52b2c293f..322e7ae5e 100644 --- a/core/templates/external-js/tiddlywiki.js.tiddlers.tid +++ b/core/templates/external-js/tiddlywiki.js.tiddlers.tid @@ -2,8 +2,4 @@ title: $:/core/templates/tiddlywiki5.js/tiddlers ` $tw.preloadTiddlerArray(`<$text text=<>/>`); -$tw.preloadTiddlerArray([{ - title: "$:/config/SaveWikiButton/Template", - text: "$:/core/save/all-external-js" -}]); ` diff --git a/core/wiki/config/SyncFilter.tid b/core/wiki/config/SyncFilter.tid index 2c91f6e7b..c2c65e551 100644 --- a/core/wiki/config/SyncFilter.tid +++ b/core/wiki/config/SyncFilter.tid @@ -1,3 +1,3 @@ title: $:/config/SyncFilter -[is[tiddler]] -[[$:/HistoryList]] -[[$:/Import]] -[[$:/isEncrypted]] -[prefix[$:/status/]] -[prefix[$:/state/]] -[prefix[$:/temp/]] \ No newline at end of file +[is[tiddler]] -[[$:/core]] -[[$:/HistoryList]] -[[$:/Import]] -[[$:/isEncrypted]] -[prefix[$:/status/]] -[prefix[$:/state/]] -[prefix[$:/temp/]] \ No newline at end of file diff --git a/editions/server-external-js/tiddlywiki.info b/editions/server-external-js/tiddlywiki.info new file mode 100644 index 000000000..0f627e404 --- /dev/null +++ b/editions/server-external-js/tiddlywiki.info @@ -0,0 +1,23 @@ +{ + "description": "Client-server edition with external tiddlywiki.js", + "plugins": [ + "tiddlywiki/tiddlyweb", + "tiddlywiki/filesystem", + "tiddlywiki/highlight" + ], + "themes": [ + "tiddlywiki/vanilla", + "tiddlywiki/snowwhite" + ], + "build": { + "listen": [ + "--listen","root-tiddler=$:/core/save/all-external-js"], + "index": [ + "--rendertiddler","$:/plugins/tiddlywiki/tiddlyweb/save/offline","index.html","text/plain"], + "static": [ + "--rendertiddler","$:/core/templates/static.template.html","static.html","text/plain", + "--rendertiddler","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain", + "--rendertiddlers","[!is[system]]","$:/core/templates/static.tiddler.html","static","text/plain", + "--rendertiddler","$:/core/templates/static.template.css","static/static.css","text/plain"] + } +} \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid b/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid index 122a30629..be1e8cddd 100644 --- a/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid +++ b/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid @@ -1,18 +1,22 @@ created: 20180905075846391 -modified: 20180905080955513 +modified: 20200814110131083 tags: [[WebServer Guides]] title: Using the external JavaScript template type: text/vnd.tiddlywiki -Setting the [[root-tiddler|WebServer Parameter: root-tiddler]] parameter to `$:/core/save/all-external-js` switches to a special template that externalises TiddlyWiki's core JavaScript into a separate file. For example: +Setting the [[root-tiddler|WebServer Parameter: root-tiddler]] parameter to `$:/core/save/all-external-js` switches to a special template that externalises TiddlyWiki's core ~JavaScript into a separate file. For example: ``` tiddlywiki editions/tw5.com-server/ --listen host=0.0.0.0 "root-tiddler=$:/core/save/all-external-js" ``` +To ensure that the "save changes" button saves a full, standalone wiki, it is also necessary to set the tiddler $:/config/SaveWikiButton/Template to contain `$:/core/save/all-external-js`. + +The provided edition `server-external-js` contains all the configuration necessary to use the external ~JavaScript template. + !! Background -TiddlyWiki in the single file configuration ordinarily packs everything into a single file: your data, and the JavaScript, CSS and HTML comprising TiddlyWiki itself. This lack of dependencies is usually very convenient: it means that it is impossible for the parts of a TiddlyWiki to become separated, and enormously improves the chances of it still functioning in the future. +TiddlyWiki in the single file configuration ordinarily packs everything into a single file: your data, and the ~JavaScript, CSS and HTML comprising TiddlyWiki itself. This lack of dependencies is usually very convenient: it means that it is impossible for the parts of a TiddlyWiki to become separated, and enormously improves the chances of it still functioning in the future. However, there is some inefficiency in this arrangement because the core code is repeatedly loaded and saved every time the content of the wiki is saved. This inefficiency is partially ameliorated when working in the client server configuration because once the wiki is loaded by the browser the synchronisation process only transmits individual tiddlers back and forth to the server. diff --git a/plugins/tiddlywiki/tiddlyweb/config-tiddlers-filter.tid b/plugins/tiddlywiki/tiddlyweb/config-tiddlers-filter.tid index 04bf24613..4e5c951db 100644 --- a/plugins/tiddlywiki/tiddlyweb/config-tiddlers-filter.tid +++ b/plugins/tiddlywiki/tiddlyweb/config-tiddlers-filter.tid @@ -1,2 +1,2 @@ -title: $:/config/Server/ExternalFilters/[all[tiddlers]] -[[$:/isEncrypted]] -[prefix[$:/temp/]] -[prefix[$:/status/]] +title: $:/config/Server/ExternalFilters/[all[tiddlers]] -[[$:/isEncrypted]] -[prefix[$:/temp/]] -[prefix[$:/status/]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[[$:/library/sjcl.js]] -[[$:/core]] text: yes diff --git a/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js b/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js index 5bc4e502d..7566b6756 100644 --- a/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js +++ b/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js @@ -159,7 +159,7 @@ TiddlyWebAdaptor.prototype.getSkinnyTiddlers = function(callback) { $tw.utils.httpRequest({ url: this.host + "recipes/" + this.recipe + "/tiddlers.json", data: { - filter: "[all[tiddlers]] -[[$:/isEncrypted]] -[prefix[$:/temp/]] -[prefix[$:/status/]]" + filter: "[all[tiddlers]] -[[$:/isEncrypted]] -[prefix[$:/temp/]] -[prefix[$:/status/]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[[$:/library/sjcl.js]] -[[$:/core]]" }, callback: function(err,data) { // Check for errors