From fd61814a7d563dcb01e506ce3c4a6693950ac211 Mon Sep 17 00:00:00 2001 From: Bram Chen Date: Thu, 14 Aug 2014 15:20:45 +0800 Subject: [PATCH 01/61] Add chinese translations of unsaved changes message --- languages/zh-Hans/Misc.multids | 1 + languages/zh-Hant/Misc.multids | 1 + 2 files changed, 2 insertions(+) diff --git a/languages/zh-Hans/Misc.multids b/languages/zh-Hans/Misc.multids index 29a47c4df..548b50dce 100644 --- a/languages/zh-Hans/Misc.multids +++ b/languages/zh-Hans/Misc.multids @@ -30,3 +30,4 @@ TagManager/Colour/Heading: 颜色 TagManager/Count/Heading: 数量 TagManager/Icon/Heading: 图标 TagManager/Tag/Heading: 标签 +UnsavedChangesWarning: 在此 TiddlyWiki 您有尚未保存的变更 diff --git a/languages/zh-Hant/Misc.multids b/languages/zh-Hant/Misc.multids index 0c9fdf941..bdd26cfd6 100644 --- a/languages/zh-Hant/Misc.multids +++ b/languages/zh-Hant/Misc.multids @@ -30,3 +30,4 @@ TagManager/Colour/Heading: 顏色 TagManager/Count/Heading: 數量 TagManager/Icon/Heading: 圖示 TagManager/Tag/Heading: 標籤 +UnsavedChangesWarning: 在此 TiddlyWiki 您有尚未儲存的變更 From d57446f1e4f440cb7403a8a0b46a89f8e5ae112d Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 14 Aug 2014 08:54:31 +0100 Subject: [PATCH 02/61] Remove $tw.syncer global from syncer.js --- core/modules/syncer.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/modules/syncer.js b/core/modules/syncer.js index 4d9fa6c5b..03680573c 100644 --- a/core/modules/syncer.js +++ b/core/modules/syncer.js @@ -58,30 +58,30 @@ function Syncer(options) { }); // Listen out for login/logout/refresh events in the browser $tw.rootWidget.addEventListener("tw-login",function() { - $tw.syncer.handleLoginEvent(); + self.handleLoginEvent(); }); $tw.rootWidget.addEventListener("tw-logout",function() { - $tw.syncer.handleLogoutEvent(); + self.handleLogoutEvent(); }); $tw.rootWidget.addEventListener("tw-server-refresh",function() { - $tw.syncer.handleRefreshEvent(); + self.handleRefreshEvent(); }); // Install the save action handlers $tw.rootWidget.addEventListener("tw-save-wiki",function(event) { - $tw.syncer.saveWiki({ + self.saveWiki({ template: event.param, downloadType: "text/plain" }); }); $tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) { - $tw.syncer.saveWiki({ + self.saveWiki({ method: "autosave", template: event.param, downloadType: "text/plain" }); }); $tw.rootWidget.addEventListener("tw-download-file",function(event) { - $tw.syncer.saveWiki({ + self.saveWiki({ method: "download", template: event.param, downloadType: "text/plain" From 82860aea33ff1a9ea482c8bcbc693388bb8d756a Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 14 Aug 2014 11:10:55 +0100 Subject: [PATCH 03/61] Tweaked tag button --- core/images/tag-button.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/images/tag-button.tid b/core/images/tag-button.tid index b93180dd7..7d53a8a70 100644 --- a/core/images/tag-button.tid +++ b/core/images/tag-button.tid @@ -3,7 +3,7 @@ tags: $:/tags/Image - + From 27f1f82a70564432f3adb7b87c364c9489eff169 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 14 Aug 2014 11:12:25 +0100 Subject: [PATCH 04/61] Rejigging syncer structuring The goal is to separate out the saver handling from the syncadaptor handling; it will take a few steps to get there --- core/modules/startup/startup.js | 11 ++++++++++- core/modules/syncer.js | 11 ++++------- .../moduletypes/SyncAdaptorModules.tid | 13 +++++++++---- .../filesystem/filesystemadaptor.js | 14 +++++++------- .../tiddlywiki/tiddlyweb/tiddlywebadaptor.js | 19 ++++++++++--------- 5 files changed, 40 insertions(+), 28 deletions(-) diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index 6facee2c4..b60e1fcb4 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -62,8 +62,17 @@ exports.startup = function() { document: document }); } + // Find a working syncadaptor + $tw.syncadaptor = undefined; + $tw.modules.forEachModuleOfType("syncadaptor",function(title,module) { + if(!$tw.syncadaptor && module.adaptorClass) { + $tw.syncadaptor = new module.adaptorClass({wiki: $tw.wiki}); + } + }); // Set up the syncer object - $tw.syncer = new $tw.Syncer({wiki: $tw.wiki}); + if($tw.syncadaptor) { + $tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor}); + } // Host-specific startup if($tw.browser) { // Install the popup manager diff --git a/core/modules/syncer.js b/core/modules/syncer.js index 03680573c..66e84b8dc 100644 --- a/core/modules/syncer.js +++ b/core/modules/syncer.js @@ -14,20 +14,15 @@ The syncer tracks changes to the store. If a syncadaptor is used then individual /* Instantiate the syncer with the following options: +syncadaptor: reference to syncadaptor to be used wiki: wiki to be synced */ function Syncer(options) { var self = this; this.wiki = options.wiki; + this.syncadaptor = options.syncadaptor // Make a logger this.logger = new $tw.utils.Logger("syncer" + ($tw.browser ? "-browser" : "") + ($tw.node ? "-server" : "")); - // Find a working syncadaptor - this.syncadaptor = undefined; - $tw.modules.forEachModuleOfType("syncadaptor",function(title,module) { - if(!self.syncadaptor && module.adaptorClass) { - self.syncadaptor = new module.adaptorClass(self); - } - }); // Initialise our savers if($tw.browser) { this.initSavers(); @@ -603,6 +598,8 @@ Syncer.prototype.dispatchTask = function(task,callback) { } // Invoke the callback callback(null); + },{ + tiddlerInfo: self.tiddlerInfo[task.title] }); } }; diff --git a/editions/tw5.com/tiddlers/moduletypes/SyncAdaptorModules.tid b/editions/tw5.com/tiddlers/moduletypes/SyncAdaptorModules.tid index 3ec089631..5396f2081 100644 --- a/editions/tw5.com/tiddlers/moduletypes/SyncAdaptorModules.tid +++ b/editions/tw5.com/tiddlers/moduletypes/SyncAdaptorModules.tid @@ -1,5 +1,5 @@ created: 20130825162100000 -modified: 20131129094907624 +modified: 20140814094907624 tags: dev moduletypes title: SyncAdaptorModules type: text/vnd.tiddlywiki @@ -27,12 +27,16 @@ Nothing should be exported if the adaptor detects that it isn't capable of opera Adaptor modules must handle the following methods. -!! `Constructor(syncer)` +!! `Constructor(options)` Initialises a new adaptor instance. |!Parameter |!Description | -|syncer |Syncer object that is using this adaptor | +|options |See below | + +Options include: + +* ''options.wiki'': reference to wiki to use with this syncadaptor !! `getTiddlerInfo(tiddler)` @@ -91,10 +95,11 @@ Loads a tiddler from the server. |title |Title of tiddler to be retrieved | |callback |Callback function invoked with parameter `err,tiddlerFields` | -!! `deleteTiddler(title,callback)` +!! `deleteTiddler(title,callback,tiddlerInfo)` Delete a tiddler from the server. |!Parameter |!Description | |title |Title of tiddler to be deleted | |callback |Callback function invoked with parameter `err` | +|tiddlerInfo |The tiddlerInfo maintained by the syncer for this tiddler | diff --git a/plugins/tiddlywiki/filesystem/filesystemadaptor.js b/plugins/tiddlywiki/filesystem/filesystemadaptor.js index 3410490ef..eff03be1b 100644 --- a/plugins/tiddlywiki/filesystem/filesystemadaptor.js +++ b/plugins/tiddlywiki/filesystem/filesystemadaptor.js @@ -3,7 +3,7 @@ title: $:/plugins/tiddlywiki/filesystem/filesystemadaptor.js type: application/javascript module-type: syncadaptor -A sync adaptor module for synchronising with the local filesystem via node.js APIs +A sync adaptor module for synchronising with the local filesystem via node.js APIs \*/ (function(){ @@ -16,9 +16,9 @@ A sync adaptor module for synchronising with the local filesystem via node.js AP var fs = !$tw.browser ? require("fs") : null, path = !$tw.browser ? require("path") : null; -function FileSystemAdaptor(syncer) { +function FileSystemAdaptor(options) { var self = this; - this.syncer = syncer; + this.wiki = options.wiki; this.watchers = {}; this.pending = {}; this.logger = new $tw.utils.Logger("FileSystem"); @@ -31,7 +31,7 @@ function FileSystemAdaptor(syncer) { var tiddlers = $tw.loadTiddlersFromFile(filename).tiddlers; for(var t in tiddlers) { if(tiddlers[t].title) { - $tw.wiki.addTiddler(tiddlers[t]); + self.wiki.addTiddler(tiddlers[t]); } } } @@ -152,7 +152,7 @@ FileSystemAdaptor.prototype.saveTiddler = function(tiddler,callback) { if(err) { return callback(err); } - content = $tw.wiki.renderTiddler("text/plain","$:/core/templates/tiddler-metadata",{variables: {currentTiddler: tiddler.fields.title}}); + content = self.wiki.renderTiddler("text/plain","$:/core/templates/tiddler-metadata",{variables: {currentTiddler: tiddler.fields.title}}); fs.writeFile(fileInfo.filepath + ".meta",content,{encoding: "utf8"},function (err) { if(err) { return callback(err); @@ -164,7 +164,7 @@ FileSystemAdaptor.prototype.saveTiddler = function(tiddler,callback) { } else { // Save the tiddler as a self contained templated file template = $tw.config.typeTemplates[fileInfo.type]; - content = $tw.wiki.renderTiddler("text/plain",template,{variables: {currentTiddler: tiddler.fields.title}}); + content = self.wiki.renderTiddler("text/plain",template,{variables: {currentTiddler: tiddler.fields.title}}); fs.writeFile(fileInfo.filepath,content,{encoding: "utf8"},function (err) { if(err) { return callback(err); @@ -188,7 +188,7 @@ FileSystemAdaptor.prototype.loadTiddler = function(title,callback) { /* Delete a tiddler and invoke the callback with (err) */ -FileSystemAdaptor.prototype.deleteTiddler = function(title,callback) { +FileSystemAdaptor.prototype.deleteTiddler = function(title,callback,options) { var self = this, fileInfo = $tw.boot.files[title]; // Only delete the tiddler if we have writable information for the file diff --git a/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js b/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js index 73c733502..e87db5b0b 100644 --- a/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js +++ b/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js @@ -3,7 +3,7 @@ title: $:/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js type: application/javascript module-type: syncadaptor -A sync adaptor module for synchronising with TiddlyWeb compatible servers +A sync adaptor module for synchronising with TiddlyWeb compatible servers \*/ (function(){ @@ -15,15 +15,15 @@ A sync adaptor module for synchronising with TiddlyWeb compatible servers var CONFIG_HOST_TIDDLER = "$:/config/tiddlyweb/host", DEFAULT_HOST_TIDDLER = "$protocol$//$host$/"; -function TiddlyWebAdaptor(syncer) { - this.syncer = syncer; +function TiddlyWebAdaptor(options) { + this.wiki = options.wiki; this.host = this.getHost(); this.recipe = undefined; this.logger = new $tw.utils.Logger("TiddlyWebAdaptor"); } TiddlyWebAdaptor.prototype.getHost = function() { - var text = this.syncer.wiki.getTiddlerText(CONFIG_HOST_TIDDLER,DEFAULT_HOST_TIDDLER), + var text = this.wiki.getTiddlerText(CONFIG_HOST_TIDDLER,DEFAULT_HOST_TIDDLER), substitutions = [ {name: "protocol", value: document.location.protocol}, {name: "host", value: document.location.host} @@ -46,8 +46,7 @@ Get the current status of the TiddlyWeb connection */ TiddlyWebAdaptor.prototype.getStatus = function(callback) { // Get status - var self = this, - wiki = self.syncer.wiki; + var self = this; this.logger.log("Getting status"); $tw.utils.httpRequest({ url: this.host + "status", @@ -174,7 +173,7 @@ TiddlyWebAdaptor.prototype.saveTiddler = function(tiddler,callback) { // Invoke the callback callback(null,{ bag: etagInfo.bag - }, etagInfo.revision); + }, etagInfo.revision); } }); }; @@ -198,10 +197,12 @@ TiddlyWebAdaptor.prototype.loadTiddler = function(title,callback) { /* Delete a tiddler and invoke the callback with (err) +options include: +tiddlerInfo: the syncer's tiddlerInfo for this tiddler */ -TiddlyWebAdaptor.prototype.deleteTiddler = function(title,callback) { +TiddlyWebAdaptor.prototype.deleteTiddler = function(title,callback,options) { var self = this, - bag = this.syncer.tiddlerInfo[title].adaptorInfo.bag; + bag = options.tiddlerInfo.adaptorInfo.bag; // If we don't have a bag it means that the tiddler hasn't been seen by the server, so we don't need to delete it if(!bag) { return callback(null); From f75af2c983e10e8a82639890b993fb5cf042d610 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 14 Aug 2014 11:43:07 +0100 Subject: [PATCH 05/61] Separate the saver handling out of the syncer --- core/modules/saver-handler.js | 170 ++++++++++++++++++++++++++++++++ core/modules/startup/startup.js | 4 +- core/modules/syncer.js | 111 +-------------------- 3 files changed, 177 insertions(+), 108 deletions(-) create mode 100644 core/modules/saver-handler.js diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js new file mode 100644 index 000000000..9d5f9a973 --- /dev/null +++ b/core/modules/saver-handler.js @@ -0,0 +1,170 @@ +/*\ +title: $:/core/modules/saver-handler.js +type: application/javascript +module-type: global + +The saver handler tracks changes to the store and handles saving the entire wiki via saver modules. + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +/* +Instantiate the saver handler with the following options: +wiki: wiki to be synced +*/ +function SaverHandler(options) { + var self = this; + this.wiki = options.wiki; + // Make a logger + this.logger = new $tw.utils.Logger("saver-handler"); + // Initialise our savers + if($tw.browser) { + this.initSavers(); + } + // Compile the dirty tiddler filter + this.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter)); + // Count of tiddlers that have been changed but not yet saved + this.numTasksInQueue = 0; + // Listen out for changes to tiddlers + this.wiki.addEventListener("change",function(changes) { + var filteredChanges = self.filterFn.call(self.wiki,function(callback) { + $tw.utils.each(changes,function(change,title) { + var tiddler = self.wiki.getTiddler(title); + callback(tiddler,title); + }); + }); + self.numTasksInQueue += filteredChanges.length; + self.updateDirtyStatus(); + }); + // Browser event handlers + if($tw.browser) { + // Set up our beforeunload handler + window.addEventListener("beforeunload",function(event) { + var confirmationMessage = undefined; + if(self.isDirty()) { + confirmationMessage = $tw.language.getString("UnsavedChangesWarning"); + event.returnValue = confirmationMessage; // Gecko + } + return confirmationMessage; + }); + // Install the save action handlers + $tw.rootWidget.addEventListener("tw-save-wiki",function(event) { + self.saveWiki({ + template: event.param, + downloadType: "text/plain" + }); + }); + $tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) { + self.saveWiki({ + method: "autosave", + template: event.param, + downloadType: "text/plain" + }); + }); + $tw.rootWidget.addEventListener("tw-download-file",function(event) { + self.saveWiki({ + method: "download", + template: event.param, + downloadType: "text/plain" + }); + }); + } +} + +SaverHandler.prototype.titleSyncFilter = "$:/config/SyncFilter"; +SaverHandler.prototype.titleAutoSave = "$:/config/AutoSave"; +SaverHandler.prototype.titleSavedNotification = "$:/language/Notifications/Save/Done"; + +/* +Select the appropriate saver modules and set them up +*/ +SaverHandler.prototype.initSavers = function(moduleType) { + moduleType = moduleType || "saver"; + // Instantiate the available savers + this.savers = []; + var self = this; + $tw.modules.forEachModuleOfType(moduleType,function(title,module) { + if(module.canSave(self)) { + self.savers.push(module.create(self.wiki)); + } + }); + // Sort the savers into priority order + this.savers.sort(function(a,b) { + if(a.info.priority < b.info.priority) { + return -1; + } else { + if(a.info.priority > b.info.priority) { + return +1; + } else { + return 0; + } + } + }); +}; + +/* +Save the wiki contents. Options are: + method: "save" or "download" + template: the tiddler containing the template to save + downloadType: the content type for the saved file +*/ +SaverHandler.prototype.saveWiki = function(options) { + options = options || {}; + var self = this, + method = options.method || "save", + template = options.template || "$:/core/save/all", + downloadType = options.downloadType || "text/plain", + text = this.wiki.renderTiddler(downloadType,template), + callback = function(err) { + if(err) { + alert("Error while saving:\n\n" + err); + } else { + $tw.notifier.display(self.titleSavedNotification); + if(options.callback) { + options.callback(); + } + } + }; + // Ignore autosave if disabled + if(method === "autosave" && this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes") { + return false; + } + // Call the highest priority saver that supports this method + for(var t=this.savers.length-1; t>=0; t--) { + var saver = this.savers[t]; + if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback)) { + this.logger.log("Saving wiki with method",method,"through saver",saver.info.name); + // Clear the task queue if we're saving (rather than downloading) + if(method !== "download") { + this.numTasksInQueue = 0; + this.updateDirtyStatus(); + } + return true; + } + } + return false; +}; + +/* +Checks whether the wiki is dirty (ie the window shouldn't be closed) +*/ +SaverHandler.prototype.isDirty = function() { + return this.numTasksInQueue > 0; +}; + +/* +Update the document body with the class "tw-dirty" if the wiki has unsaved/unsynced changes +*/ +SaverHandler.prototype.updateDirtyStatus = function() { + if($tw.browser) { + $tw.utils.toggleClass(document.body,"tw-dirty",this.isDirty()); + } +}; + +exports.SaverHandler = SaverHandler; + +})(); diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index b60e1fcb4..67c3415c1 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -69,9 +69,11 @@ exports.startup = function() { $tw.syncadaptor = new module.adaptorClass({wiki: $tw.wiki}); } }); - // Set up the syncer object + // Set up the syncer object if we've got a syncadaptor, otherwise setup the saverhandler if($tw.syncadaptor) { $tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor}); + } else { + $tw.saverHandler = new $tw.SaverHandler({wiki: $tw.wiki}); } // Host-specific startup if($tw.browser) { diff --git a/core/modules/syncer.js b/core/modules/syncer.js index 66e84b8dc..b92d7a478 100644 --- a/core/modules/syncer.js +++ b/core/modules/syncer.js @@ -23,10 +23,6 @@ function Syncer(options) { this.syncadaptor = options.syncadaptor // Make a logger this.logger = new $tw.utils.Logger("syncer" + ($tw.browser ? "-browser" : "") + ($tw.node ? "-server" : "")); - // Initialise our savers - if($tw.browser) { - this.initSavers(); - } // Compile the dirty tiddler filter this.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter)); // Record information for known tiddlers @@ -61,34 +57,11 @@ function Syncer(options) { $tw.rootWidget.addEventListener("tw-server-refresh",function() { self.handleRefreshEvent(); }); - // Install the save action handlers - $tw.rootWidget.addEventListener("tw-save-wiki",function(event) { - self.saveWiki({ - template: event.param, - downloadType: "text/plain" - }); - }); - $tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) { - self.saveWiki({ - method: "autosave", - template: event.param, - downloadType: "text/plain" - }); - }); - $tw.rootWidget.addEventListener("tw-download-file",function(event) { - self.saveWiki({ - method: "download", - template: event.param, - downloadType: "text/plain" - }); - }); } // Listen out for lazyLoad events - if(this.syncadaptor) { - this.wiki.addEventListener("lazyLoad",function(title) { - self.handleLazyLoadEvent(title); - }); - } + this.wiki.addEventListener("lazyLoad",function(title) { + self.handleLazyLoadEvent(title); + }); // Get the login status this.getStatus(function (err,isLoggedIn) { // Do a sync from the server @@ -102,7 +75,6 @@ Constants Syncer.prototype.titleIsLoggedIn = "$:/status/IsLoggedIn"; Syncer.prototype.titleUserName = "$:/status/UserName"; Syncer.prototype.titleSyncFilter = "$:/config/SyncFilter"; -Syncer.prototype.titleAutoSave = "$:/config/AutoSave"; Syncer.prototype.titleSavedNotification = "$:/language/Notifications/Save/Done"; Syncer.prototype.taskTimerInterval = 1 * 1000; // Interval for sync timer Syncer.prototype.throttleInterval = 1 * 1000; // Defer saving tiddlers if they've changed in the last 1s... @@ -129,79 +101,6 @@ Syncer.prototype.readTiddlerInfo = function() { }); }; -/* -Select the appropriate saver modules and set them up -*/ -Syncer.prototype.initSavers = function(moduleType) { - moduleType = moduleType || "saver"; - // Instantiate the available savers - this.savers = []; - var self = this; - $tw.modules.forEachModuleOfType(moduleType,function(title,module) { - if(module.canSave(self)) { - self.savers.push(module.create(self.wiki)); - } - }); - // Sort the savers into priority order - this.savers.sort(function(a,b) { - if(a.info.priority < b.info.priority) { - return -1; - } else { - if(a.info.priority > b.info.priority) { - return +1; - } else { - return 0; - } - } - }); -}; - -/* -Save the wiki contents. Options are: - method: "save" or "download" - template: the tiddler containing the template to save - downloadType: the content type for the saved file -*/ -Syncer.prototype.saveWiki = function(options) { - options = options || {}; - var self = this, - method = options.method || "save", - template = options.template || "$:/core/save/all", - downloadType = options.downloadType || "text/plain", - text = this.wiki.renderTiddler(downloadType,template), - callback = function(err) { - if(err) { - alert("Error while saving:\n\n" + err); - } else { - $tw.notifier.display(self.titleSavedNotification); - if(options.callback) { - options.callback(); - } - } - }; - // Ignore autosave if we've got a syncadaptor or autosave is disabled - if(method === "autosave") { - if(this.syncadaptor || this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes") { - return false; - } - } - // Call the highest priority saver that supports this method - for(var t=this.savers.length-1; t>=0; t--) { - var saver = this.savers[t]; - if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback)) { - this.logger.log("Saving wiki with method",method,"through saver",saver.info.name); - // Clear the task queue if we're saving (rather than downloading) - if(method !== "download") { - this.readTiddlerInfo(); - this.taskQueue = {}; - this.updateDirtyStatus(); - } - return true; - } - } - return false; -}; - /* Checks whether the wiki is dirty (ie the window shouldn't be closed) */ @@ -453,9 +352,7 @@ Syncer.prototype.enqueueSyncTask = function(task) { this.updateDirtyStatus(); } // Process the queue - if(this.syncadaptor) { - $tw.utils.nextTick(function() {self.processTaskQueue.call(self);}); - } + $tw.utils.nextTick(function() {self.processTaskQueue.call(self);}); }; /* From 9e85ddfec78dd8df71e6173100dce659417551f4 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 14 Aug 2014 12:00:07 +0100 Subject: [PATCH 06/61] Ensure we have a default language in empty.html --- core/wiki/language.tid | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 core/wiki/language.tid diff --git a/core/wiki/language.tid b/core/wiki/language.tid new file mode 100644 index 000000000..a8a74ee23 --- /dev/null +++ b/core/wiki/language.tid @@ -0,0 +1,3 @@ +title: $:/language + +$:/languages/en-GB \ No newline at end of file From 837f36aa86edf792b185e652b3155c305f02ed75 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 14 Aug 2014 12:00:12 +0100 Subject: [PATCH 07/61] Docs update --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 6cba062fc..56a2544a6 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -

Welcome to TiddlyWiki

Welcome to TiddlyWiki, a complete interactive wiki in JavaScript. It can be used as a single HTML file in the browser or as a powerful Node.js application. It is highly customisable: the entire user interface is itself implemented in hackable WikiText.

This is version of TiddlyWiki, a major reboot designed for the next 25 years. It is currently in beta (see the detailed ReleaseHistory). There is a RoadMap for moving to the full release. It is a great time to get involved and support the future development of TiddlyWiki.

TiddlyWiki is a free, open source project that depends on your love and support for its survival.

TiddlyWikiClassic

The original "Classic" version of TiddlyWiki is still available at http://classic.tiddlywiki.com. Note that it is not fully backwards compatible: existing content will need massaging, while plugins and themes will have to be completely rewritten. The upgrade path will get smoother as the new version matures. +

Welcome to TiddlyWiki

Welcome to TiddlyWiki, a non-linear personal web notebook that anyone can use and keep forever, independently of any corporation.

TiddlyWiki is a complete interactive wiki in JavaScript. It can be used as a single HTML file in the browser or as a powerful Node.js application. It is highly customisable: the entire user interface is itself implemented in hackable WikiText.

This is version of TiddlyWiki, a major reboot designed for the next 25 years. It is currently in beta (see the detailed ReleaseHistory) with a RoadMap for moving to the full release. It is a great time to get involved and support the future development of TiddlyWiki.

TiddlyWiki is a free, open source project that depends on your love and support for its survival.

TiddlyWikiClassic

The original "Classic" version of TiddlyWiki is still available at http://classic.tiddlywiki.com. Note that it is not fully backwards compatible: existing content will need massaging, while plugins and themes will have to be completely rewritten. The upgrade path will get smoother as the new version matures.

Getting started with TiddlyWiki under Node.js

Running TiddlyWiki on Node.js brings several important benefits over and above the single file version:

  • You can edit your content on any suitably compatible HTML5 browser, including smartphones and tablets
  • Individual tiddlers are stored in separate files, which you can organise as you wish
  • The ability to build multiple wikis that blend different combinations of shared and unique content

Installation

  1. Install Node.js from http://nodejs.org
  2. Open a command line terminal and type:

    npm install -g tiddlywiki

    If it fails with an error you may need to re-run the command as an administrator:

    npm install -g tiddlywiki (Windows)

    sudo npm install -g tiddlywiki (Mac/Linux)

  3. Check TiddlyWiki is installed by typing:

    tiddlywiki --version

  4. In response, you should see TiddlyWiki report its current version (eg 5.0.8-beta; you may also see other debugging information reported)
  5. Try it out:
    1. tiddlywiki mynewwiki --init server to create a folder for a new wiki that includes server-related components
    2. tiddlywiki mynewwiki --server to start TiddlyWiki
    3. Visit http://127.0.0.1:8080/ in your browser
    4. Try editing and creating tiddlers

The -g flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it.

A slightly different method for installation is recommended if you plan on forking the source code in order to study it or contribute to it. See Working with the TiddlyWiki5 repository.

Usage

TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on TiddlyWikiFolders, TiddlerFiles and TiddlyWikiFiles.

For example, the following command loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in static HTML:

tiddlywiki --verbose --load mywiki.html --rendertiddler ReadMe ./readme.html

Running tiddlywiki from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.

The first argument is the optional path to the TiddlyWikiFolder to be loaded. If not present, then the current directory is used.

The commands and their individual arguments follow, each command being identified by the prefix --.

tiddlywiki [<wikipath>] [--<command> [<arg>[,<arg>]]]

The available commands are:

See also:

Upgrading

If you've installed TiddlyWiki on Node.js on the usual way, when a new version is released you can upgrade it with this command:

npm update -g tiddlywiki

On Mac or Linux you'll need to add sudo like this:

sudo npm update -g tiddlywiki

Working with the TiddlyWiki5 repository

Setting Up

If you plan on working with the TiddlyWiki5 source code then follow these steps:

  1. Fork the TiddlyWiki5 GitHub repository from https://github.com/Jermolene/TiddlyWiki5
  2. Clone a local copy of your fork
  3. Open a command line terminal and change the current working directory to the root of the repo
  4. Type npm link (Windows) or sudo npm link (Mac/Linux) to tell npm to use this copy of the repo as the globally installed one

After this procedure you can work with TiddlyWiki5 via npm as though it were installed in the usual way with npm install -g tiddlywiki.

See also Scripts for TiddlyWiki on Node.js.

This readme file was automatically generated by TiddlyWiki

\ No newline at end of file From 592cdc4617efb0c0269781ec30493563bf28cb2a Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 09:36:36 +0100 Subject: [PATCH 08/61] Release note updates --- editions/tw5.com/tiddlers/Release 5.0.15beta.tid | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid index 11c642e42..c0bdc906e 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -7,19 +7,20 @@ type: text/vnd.tiddlywiki //[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.14-beta...v5.0.15-beta]]// -!! Major Changes +This is a small release to resolve some minor issues with [[Release 5.0.14-beta]]. !! Usability Improvements -* +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/4b05608ad5e77043b01495825ea0f0e76c378760]] page control button for invoking the [[tag manager|$:/TagManager]] !! Hackability Improvements -* +* [[Refactored|https://github.com/Jermolene/TiddlyWiki5/commit/f75af2c983e10e8a82639890b993fb5cf042d610]] `saver-handler.js` out of `syncer.js` !! Bug Fixes -* +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/34461cb2fe554331a0269fd7795b1d6a879fcba9]] unclickable link in upgrade wizard +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/9e85ddfec78dd8df71e6173100dce659417551f4]] missing language flag in ''empty.html'' !! Contributors From c8830d32f74b8c228553f11f7f55b5be45ae6471 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 09:40:22 +0100 Subject: [PATCH 09/61] Fixed problem with building TW under Windows Fixes #717 The issue was that under Windows we generate text nodes that contained CRLF as a linebreak (rather than just LF as usual). The subtle problem is that when these strings are placed in the DOM via createTextNode(), the CR character is treated as a printable character, not whitespace. When creating DOM notes with innerHTML or as part of a static HTML document the HTML parser will strip out the CR characters. The hacky solution is to manually remove CRs before building the text node. --- core/modules/widgets/text.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/text.js b/core/modules/widgets/text.js index 4da2119ac..e3ebc4f70 100755 --- a/core/modules/widgets/text.js +++ b/core/modules/widgets/text.js @@ -30,8 +30,9 @@ TextNodeWidget.prototype.render = function(parent,nextSibling) { this.parentDomNode = parent; this.computeAttributes(); this.execute(); - var text = this.getAttribute("text",this.parseTreeNode.text), - textNode = this.document.createTextNode(text); + var text = this.getAttribute("text",this.parseTreeNode.text); + text = text.replace(/\r/mg,""); + var textNode = this.document.createTextNode(text); parent.insertBefore(textNode,nextSibling); this.domNodes.push(textNode); }; From e88dcfacd6fab9747edb68f1c394ed492e02ef1a Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 09:42:54 +0100 Subject: [PATCH 10/61] More release note updates --- editions/tw5.com/tiddlers/Release 5.0.15beta.tid | 1 + 1 file changed, 1 insertion(+) diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid index c0bdc906e..739c6c319 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -19,6 +19,7 @@ This is a small release to resolve some minor issues with [[Release 5.0.14-beta] !! Bug Fixes +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/c8830d32f74b8c228553f11f7f55b5be45ae6471]] problem with building TiddlyWiki under Windows * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/34461cb2fe554331a0269fd7795b1d6a879fcba9]] unclickable link in upgrade wizard * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/9e85ddfec78dd8df71e6173100dce659417551f4]] missing language flag in ''empty.html'' From c0c52f5bcb6441b80bde53f3c4c1fae785b4c60c Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 09:50:33 +0100 Subject: [PATCH 11/61] Revert to putting the version number in the corner ribbon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on two bits of feedback: 1. The version number should be displayed prominently on the page 2. Ordinary users don’t know what “Find me on GitHub” means --- editions/tw5.com/tiddlers/system/github-fork-ribbon.tid | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/system/github-fork-ribbon.tid b/editions/tw5.com/tiddlers/system/github-fork-ribbon.tid index 22fddf73b..efd6c8c18 100644 --- a/editions/tw5.com/tiddlers/system/github-fork-ribbon.tid +++ b/editions/tw5.com/tiddlers/system/github-fork-ribbon.tid @@ -3,5 +3,4 @@ tags: $:/tags/PageControls caption: ~GitHub ribbon description: ~GitHub ribbon for tw5.com - \ No newline at end of file +
<$link to="ReleaseHistory"><>
\ No newline at end of file From ea83149746127125a6c971ea89cfab2dc308db34 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 09:52:57 +0100 Subject: [PATCH 12/61] Release note updates --- editions/tw5.com/tiddlers/Release 5.0.15beta.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid index 739c6c319..a0954b6c9 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -1,5 +1,5 @@ caption: 5.0.15-beta -created: 20140818150234142 +created: 20140812150234142 modified: 20140813153116300 tags: releasenote title: Release 5.0.15-beta @@ -20,7 +20,7 @@ This is a small release to resolve some minor issues with [[Release 5.0.14-beta] !! Bug Fixes * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/c8830d32f74b8c228553f11f7f55b5be45ae6471]] problem with building TiddlyWiki under Windows -* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/34461cb2fe554331a0269fd7795b1d6a879fcba9]] unclickable link in upgrade wizard +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/34461cb2fe554331a0269fd7795b1d6a879fcba9]] unclickable download ink in upgrade wizard * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/9e85ddfec78dd8df71e6173100dce659417551f4]] missing language flag in ''empty.html'' !! Contributors From 95926b85b96b69b23d12ba63dd7807b718528f6b Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 10:06:05 +0100 Subject: [PATCH 13/61] Move editor type mappings into a single file --- core/config/editor-type-mappings/image-gif.tid | 3 --- core/config/editor-type-mappings/image-jpeg.tid | 3 --- core/config/editor-type-mappings/image-jpg.tid | 3 --- core/config/editor-type-mappings/image-png.tid | 3 --- core/config/editor-type-mappings/image-x-icon.tid | 3 --- core/config/editor-type-mappings/text-vnd-tiddlywiki.tid | 3 --- core/wiki/config/EditorTypeMappings.multids | 8 ++++++++ 7 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 core/config/editor-type-mappings/image-gif.tid delete mode 100644 core/config/editor-type-mappings/image-jpeg.tid delete mode 100644 core/config/editor-type-mappings/image-jpg.tid delete mode 100644 core/config/editor-type-mappings/image-png.tid delete mode 100644 core/config/editor-type-mappings/image-x-icon.tid delete mode 100644 core/config/editor-type-mappings/text-vnd-tiddlywiki.tid create mode 100644 core/wiki/config/EditorTypeMappings.multids diff --git a/core/config/editor-type-mappings/image-gif.tid b/core/config/editor-type-mappings/image-gif.tid deleted file mode 100644 index 7f66c8434..000000000 --- a/core/config/editor-type-mappings/image-gif.tid +++ /dev/null @@ -1,3 +0,0 @@ -title: $:/config/EditorTypeMappings/image/gif - -bitmap \ No newline at end of file diff --git a/core/config/editor-type-mappings/image-jpeg.tid b/core/config/editor-type-mappings/image-jpeg.tid deleted file mode 100644 index 02a0943ca..000000000 --- a/core/config/editor-type-mappings/image-jpeg.tid +++ /dev/null @@ -1,3 +0,0 @@ -title: $:/config/EditorTypeMappings/image/jpeg - -bitmap \ No newline at end of file diff --git a/core/config/editor-type-mappings/image-jpg.tid b/core/config/editor-type-mappings/image-jpg.tid deleted file mode 100644 index d1eda17c7..000000000 --- a/core/config/editor-type-mappings/image-jpg.tid +++ /dev/null @@ -1,3 +0,0 @@ -title: $:/config/EditorTypeMappings/image/jpg - -bitmap \ No newline at end of file diff --git a/core/config/editor-type-mappings/image-png.tid b/core/config/editor-type-mappings/image-png.tid deleted file mode 100644 index 4c4f613cd..000000000 --- a/core/config/editor-type-mappings/image-png.tid +++ /dev/null @@ -1,3 +0,0 @@ -title: $:/config/EditorTypeMappings/image/png - -bitmap \ No newline at end of file diff --git a/core/config/editor-type-mappings/image-x-icon.tid b/core/config/editor-type-mappings/image-x-icon.tid deleted file mode 100644 index d2b4d0d99..000000000 --- a/core/config/editor-type-mappings/image-x-icon.tid +++ /dev/null @@ -1,3 +0,0 @@ -title: $:/config/EditorTypeMappings/image/x-icon - -bitmap \ No newline at end of file diff --git a/core/config/editor-type-mappings/text-vnd-tiddlywiki.tid b/core/config/editor-type-mappings/text-vnd-tiddlywiki.tid deleted file mode 100644 index fee2a2a62..000000000 --- a/core/config/editor-type-mappings/text-vnd-tiddlywiki.tid +++ /dev/null @@ -1,3 +0,0 @@ -title: $:/config/EditorTypeMappings/text/vnd.tiddlywiki - -text \ No newline at end of file diff --git a/core/wiki/config/EditorTypeMappings.multids b/core/wiki/config/EditorTypeMappings.multids new file mode 100644 index 000000000..f39a6e397 --- /dev/null +++ b/core/wiki/config/EditorTypeMappings.multids @@ -0,0 +1,8 @@ +title: $:/config/EditorTypeMappings/ + +image/gif: bitmap +image/jpeg: bitmap +image/jpg: bitmap +image/png: bitmap +image/x-icon: bitmap +text/vnd.tiddlywiki: text From 0aeb9d36a09670177fe83893e40f8bf1e7af541f Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 10:06:19 +0100 Subject: [PATCH 14/61] Fix content type typo --- .../tiddlers/messages/WidgetMessage_ tw-auto-save-wiki.tid | 2 +- .../tiddlers/messages/WidgetMessage_ tw-download-file.tid | 2 +- .../tw5.com/tiddlers/messages/WidgetMessage_ tw-full-screen.tid | 2 +- editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-login.tid | 2 +- editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-logout.tid | 2 +- editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-modal.tid | 2 +- editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-notify.tid | 2 +- .../tw5.com/tiddlers/messages/WidgetMessage_ tw-save-wiki.tid | 2 +- .../tiddlers/messages/WidgetMessage_ tw-server-refresh.tid | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-auto-save-wiki.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-auto-save-wiki.tid index b76722d2d..d5b99be0c 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-auto-save-wiki.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-auto-save-wiki.tid @@ -2,7 +2,7 @@ created: 20140811112343634 modified: 20140811114420597 tags: message title: WidgetMessage: tw-auto-save-wiki -type: application/x-tiddler +type: text/vnd.tiddlywiki The autosave wiki message causes the current saver module to perform a background save if it is required. diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-download-file.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-download-file.tid index 43dd238ad..2b14dd92e 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-download-file.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-download-file.tid @@ -2,7 +2,7 @@ created: 20140811112201235 modified: 20140811115140378 tags: message title: WidgetMessage: tw-download-file -type: application/x-tiddler +type: text/vnd.tiddlywiki The download file message causes the current saver module to prompt the user to download the result of parsing a specified template tiddler as a file. It requires the following properties on the `event` object: diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-full-screen.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-full-screen.tid index 7b34d9dae..305b8c778 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-full-screen.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-full-screen.tid @@ -2,7 +2,7 @@ created: 20140811112400855 modified: 20140811113627373 tags: message title: WidgetMessage: tw-full-screen -type: application/x-tiddler +type: text/vnd.tiddlywiki The fullscreen message toggles the "fullscreen" mode of the browser, if it supports it. diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-login.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-login.tid index c6c827a0b..38eda7164 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-login.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-login.tid @@ -2,7 +2,7 @@ created: 20140811112445887 modified: 20140811113336694 tags: message title: WidgetMessage: tw-login -type: application/x-tiddler +type: text/vnd.tiddlywiki The login message prompts the user for a username and password and attempts to login to the current serverside host. The tiddler [[$:/status/IsLoggedIn]] reflects the current login status with the values "yes" or "no", and [[$:/status/UserName]] reflects the current username. diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-logout.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-logout.tid index b09941aa8..a499fdb25 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-logout.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-logout.tid @@ -2,7 +2,7 @@ created: 20140811112457311 modified: 20140811113344084 tags: message title: WidgetMessage: tw-logout -type: application/x-tiddler +type: text/vnd.tiddlywiki The logout message attempts to log the user out of the current serverside host. The tiddler [[$:/status/IsLoggedIn]] reflects the current login status with the values "yes" or "no", and [[$:/status/UserName]] reflects the current username. diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-modal.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-modal.tid index 16a10be2a..84decfc1f 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-modal.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-modal.tid @@ -2,7 +2,7 @@ created: 20140811112133701 modified: 20140811120203685 tags: message title: WidgetMessage: tw-modal -type: application/x-tiddler +type: text/vnd.tiddlywiki The modal message displays a specified tiddler in a modal overlay that dims the main page. It requires the following properties on the `event` object: diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-notify.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-notify.tid index c4fba1496..97c72408d 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-notify.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-notify.tid @@ -2,7 +2,7 @@ created: 20140811112304772 modified: 20140811120248738 tags: message title: WidgetMessage: tw-notify -type: application/x-tiddler +type: text/vnd.tiddlywiki The notify message briefly displays a specified tiddler as a small alert in the upper right corner of the page. It requires the following properties on the `event` object: diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-save-wiki.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-save-wiki.tid index 5b0e9b830..bff780fe0 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-save-wiki.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-save-wiki.tid @@ -2,7 +2,7 @@ created: 20140811112325641 modified: 20140811115149288 tags: message title: WidgetMessage: tw-save-wiki -type: application/x-tiddler +type: text/vnd.tiddlywiki The save wiki message causes the current saver module to perform a full save operation. The save operation can involve user interaction, unlike the [[WidgetMessage: tw-auto-save-wiki]]/ diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-server-refresh.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-server-refresh.tid index c22248691..fcf56e28e 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-server-refresh.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-server-refresh.tid @@ -2,7 +2,7 @@ created: 20140811112435281 modified: 20140811113453568 tags: message title: WidgetMessage: tw-server-refresh -type: application/x-tiddler +type: text/vnd.tiddlywiki The server refresh message attempts to synchronise the latest changes to the current serverside host. From 18592fe8f810d1858ca040da1a7c4a81fb74cfed Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 10:06:52 +0100 Subject: [PATCH 15/61] Fix problem with edit widget not refreshing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One symptom of this problem was that changing the type field of a tiddler didn’t immediately switch to the bitmap editor --- core/modules/widgets/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/widgets/edit.js b/core/modules/widgets/edit.js index 0782d5118..39f4c39c2 100644 --- a/core/modules/widgets/edit.js +++ b/core/modules/widgets/edit.js @@ -83,7 +83,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ EditWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index) { + if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedTiddlers[this.editTitle]) { this.refreshSelf(); return true; } else { From 04e049df97fe2702b9d37e3ae4b03e1a6a434344 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 16:48:02 +0100 Subject: [PATCH 16/61] Add message for empty plugin lists --- core/language/en-GB/ControlPanel.multids | 1 + core/ui/ControlPanel/Plugins.tid | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index c58e34f12..911b2633f 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -64,6 +64,7 @@ Basics/Title/Prompt: Title of this ~TiddlyWiki: Basics/Username/Prompt: Username for signing edits: Basics/Version/Prompt: ~TiddlyWiki version: Plugins/Caption: Plugins +Plugins/Empty/Hint: None Plugins/Language/Prompt: Languages Plugins/Plugin/Prompt: Plugins Plugins/Theme/Prompt: Themes diff --git a/core/ui/ControlPanel/Plugins.tid b/core/ui/ControlPanel/Plugins.tid index 654c34502..dfb8ad6f4 100644 --- a/core/ui/ControlPanel/Plugins.tid +++ b/core/ui/ControlPanel/Plugins.tid @@ -14,7 +14,7 @@ $(currentTiddler)$/icon \end \define plugin-table(type) <$set name="qualified-state" value=<>> -<$list filter="[!has[draft.of]plugin-type[$type$]sort[description]]"> +<$list filter="[!has[draft.of]plugin-type[$type$]sort[description]]" emptyMessage=<>> <$set name="popup-state" value=<>> <$link to={{!!title}} class="tw-plugin-info">
From 850378ceb2f48e866d99b04602af4f9c3370a816 Mon Sep 17 00:00:00 2001 From: Xavier Cazin Date: Fri, 15 Aug 2014 19:07:31 +0200 Subject: [PATCH 17/61] fr-FR translation for Unsaved Changes Warning --- languages/fr-FR/Misc.multids | 1 + 1 file changed, 1 insertion(+) diff --git a/languages/fr-FR/Misc.multids b/languages/fr-FR/Misc.multids index c4aa25925..83c842546 100644 --- a/languages/fr-FR/Misc.multids +++ b/languages/fr-FR/Misc.multids @@ -30,3 +30,4 @@ TagManager/Colour/Heading: Couleur TagManager/Count/Heading: Quantité TagManager/Icon/Heading: Icone TagManager/Tag/Heading: Tag +UnsavedChangesWarning: Vos dernières modifications n'ont pas été sauvegardées dans votre TiddlyWiki From 9e86dd07bcdd645b7530c0b2224e06bf8d46e531 Mon Sep 17 00:00:00 2001 From: Xavier Cazin Date: Fri, 15 Aug 2014 19:20:21 +0200 Subject: [PATCH 18/61] fr-FR translation of the Readme file for the core plugin --- languages/fr-FR/CoreReadMe.tid | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/languages/fr-FR/CoreReadMe.tid b/languages/fr-FR/CoreReadMe.tid index f02ac37a2..3e75a631a 100644 --- a/languages/fr-FR/CoreReadMe.tid +++ b/languages/fr-FR/CoreReadMe.tid @@ -1,5 +1,8 @@ title: $:/core/fr-FR/readme - +Ce plugin contient les principaux composants de TiddlyWiki, notamment : -{{$:/core/readme}} +* Les modules du code JavaScript ; +* Les icones ; +* Les //templates// nécessaires à l'élaboration de l'interface utilisateur de TiddlyWiki ; +* Les traductions en anglais britannique (''en-GB'') des chaînes de caractères utilisées par le cœur de l'application et susceptibles d'être traduites dans d'autres langues. From 32a7ee2683ace619599f0ab73028307ca33f4e4c Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 21:10:40 +0100 Subject: [PATCH 19/61] Make it possible to disable plugins --- boot/boot.js | 13 +++--- core/language/en-GB/ControlPanel.multids | 5 +++ core/ui/ControlPanel/Plugins.tid | 45 ++++++++++++++----- .../tiddlers/mechanisms/PluginMechanism.tid | 12 ++++- themes/tiddlywiki/vanilla/base.tid | 12 ++++- 5 files changed, 70 insertions(+), 17 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 5cfc5409b..d417f3ae1 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -967,19 +967,22 @@ $tw.Wiki = function(options) { this.registerPluginTiddlers = function(pluginType,titles) { var self = this, registeredTitles = [], - checkTiddler = function(tiddler) { + checkTiddler = function(tiddler,title) { if(tiddler && tiddler.fields.type === "application/json" && tiddler.fields["plugin-type"] === pluginType) { - pluginTiddlers.push(tiddler); - registeredTitles.push(tiddler.fields.title); + var disablingTiddler = self.getTiddler("$:/config/Plugins/Disabled/" + title); + if(title === "$:/core" || !disablingTiddler || (disablingTiddler.fields.text || "").trim() !== "yes") { + pluginTiddlers.push(tiddler); + registeredTitles.push(tiddler.fields.title); + } } }; if(titles) { $tw.utils.each(titles,function(title) { - checkTiddler(self.getTiddler(title)); + checkTiddler(self.getTiddler(title),title); }); } else { this.each(function(tiddler,title) { - checkTiddler(tiddler); + checkTiddler(tiddler,title); }); } return registeredTitles; diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index 911b2633f..e35f38f1b 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -64,7 +64,12 @@ Basics/Title/Prompt: Title of this ~TiddlyWiki: Basics/Username/Prompt: Username for signing edits: Basics/Version/Prompt: ~TiddlyWiki version: Plugins/Caption: Plugins +Plugins/Disable/Caption: disable +Plugins/Disable/Hint: Disable this plugin when reloading page +Plugins/Disabled/Status: (disabled) Plugins/Empty/Hint: None +Plugins/Enable/Caption: enable +Plugins/Enable/Hint: Enable this plugin when reloading page Plugins/Language/Prompt: Languages Plugins/Plugin/Prompt: Plugins Plugins/Theme/Prompt: Themes diff --git a/core/ui/ControlPanel/Plugins.tid b/core/ui/ControlPanel/Plugins.tid index dfb8ad6f4..a476a9290 100644 --- a/core/ui/ControlPanel/Plugins.tid +++ b/core/ui/ControlPanel/Plugins.tid @@ -12,11 +12,10 @@ $(popup-state)$-$(pluginInfoType)$ \define plugin-icon-title() $(currentTiddler)$/icon \end -\define plugin-table(type) -<$set name="qualified-state" value=<>> -<$list filter="[!has[draft.of]plugin-type[$type$]sort[description]]" emptyMessage=<>> -<$set name="popup-state" value=<>> -<$link to={{!!title}} class="tw-plugin-info"> +\define plugin-disable-title() +$:/config/Plugins/Disabled/$(currentTiddler)$ +\end +\define plugin-table-body(type,disabledMessage)
<$reveal type="nomatch" state=<> text="yes"> <$button class="btn-invisible btn-dropdown" set=<> setTo="yes"> @@ -36,7 +35,7 @@ $(currentTiddler)$/icon
-''<$view field="description"><$view field="title"/>'' +''<$view field="description"><$view field="title"/>'' $disabledMessage$
<$view field="title"/> @@ -45,18 +44,44 @@ $(currentTiddler)$/icon <$view field="version"/>
+\end +\define plugin-table(type) +<$set name="qualified-state" value=<>> +<$list filter="[!has[draft.of]plugin-type[$type$]sort[description]]" emptyMessage=<>> +<$set name="popup-state" value=<>> +<$reveal type="nomatch" state=<> text="yes"> +<$link to={{!!title}} class="tw-plugin-info"> +<> + +<$reveal type="match" state=<> text="yes"> +<$link to={{!!title}} class="tw-plugin-info tw-plugin-info-disabled"> +<">> + + <$reveal type="match" text="yes" state=<>> -<$reveal type="nomatch" text="" state="!!list">
-<$macrocall $name="tabs" state=<> tabsList={{!!list}} default="readme" template="$:/core/ui/PluginInfo"/> +<$list filter="[all[current]] -[[$:/core]]"> +
+<$reveal type="nomatch" state=<> text="yes"> +<$button set=<> setTo="yes" title={{$:/language/ControlPanel/Plugins/Disable/Hint}} aria-label={{$:/language/ControlPanel/Plugins/Disable/Caption}}> +<> + + +<$reveal type="match" state=<> text="yes"> +<$button set=<> setTo="no" title={{$:/language/ControlPanel/Plugins/Enable/Hint}} aria-label={{$:/language/ControlPanel/Plugins/Enable/Caption}}> +<> + +
+ +<$reveal type="nomatch" text="" state="!!list"> +<$macrocall $name="tabs" state=<> tabsList={{!!list}} default="readme" template="$:/core/ui/PluginInfo"/> <$reveal type="match" text="" state="!!list"> -
No information provided -
+
diff --git a/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid b/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid index c329f2adf..d271885e8 100644 --- a/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid +++ b/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid @@ -1,5 +1,5 @@ created: 20130826122000000 -modified: 20140807094840608 +modified: 20140815094840608 tags: mechanism title: PluginMechanism type: text/vnd.tiddlywiki @@ -87,6 +87,16 @@ The wiki object keeps track of all of the currently loaded plugins. If a request In the browser, any constituent tiddlers that are JavaScript modules (ie shadow tiddlers of content type `application/javascript` and possessing the field `module-type`) are executed during startup processing. +!! Disabling Plugins + +Plugins can be disabled by creating a tiddler titled `$:/config/Plugins/Disabled/` concatenated with the plugin title, and setting its text to `yes`. + +For example, to disable the plugin `$:/plugins/tiddlywiki/highlight`, the title would be: + +``` +$:/config/Plugins/Disabled/$:/plugins/tiddlywiki/highlight +``` + ! Information Tiddlers for Plugins Plugin authors are encouraged to provide special information and documentation tiddlers that TiddlyWiki can include as plugin information tabs in the [[control panel|$:/ControlPanel]]. diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 6203bd19e..8094731b1 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1251,6 +1251,16 @@ canvas.tw-edit-bitmapeditor { padding: 8px; } +.tw-plugin-info-disabled { + background: -webkit-repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px); + background: repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px); +} + +.tw-plugin-info-disabled:hover { + background: -webkit-repeating-linear-gradient(45deg, #aa0, #aa0 10px, #888 10px, #888 20px); + background: repeating-linear-gradient(45deg, #aa0, #aa0 10px, #888 10px, #888 20px); +} + a.tw-tiddlylink.tw-plugin-info:hover { text-decoration: none; background-color: <>; @@ -1273,7 +1283,7 @@ a.tw-tiddlylink.tw-plugin-info:hover { .tw-plugin-info-dropdown { border: 1px solid <>; - padding: 1em; + padding: 1em 1em 0 1em; margin-top: -1em; } From 87b7677a0fa6e9cc7794e161efb8c5c660662648 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 15 Aug 2014 21:15:28 +0100 Subject: [PATCH 20/61] Release note update --- editions/tw5.com/tiddlers/Release 5.0.15beta.tid | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid index a0954b6c9..e0b77b9b4 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -11,6 +11,7 @@ This is a small release to resolve some minor issues with [[Release 5.0.14-beta] !! Usability Improvements +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/32a7ee2683ace619599f0ab73028307ca33f4e4c]] the ability to disable plugins (see PluginMechanism) with a user interface in [[control panel|$:/ControlPanel]] * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/4b05608ad5e77043b01495825ea0f0e76c378760]] page control button for invoking the [[tag manager|$:/TagManager]] !! Hackability Improvements @@ -22,6 +23,7 @@ This is a small release to resolve some minor issues with [[Release 5.0.14-beta] * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/c8830d32f74b8c228553f11f7f55b5be45ae6471]] problem with building TiddlyWiki under Windows * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/34461cb2fe554331a0269fd7795b1d6a879fcba9]] unclickable download ink in upgrade wizard * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/9e85ddfec78dd8df71e6173100dce659417551f4]] missing language flag in ''empty.html'' +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/18592fe8f810d1858ca040da1a7c4a81fb74cfed]] problem with switching the type of a tiddler between the bitmap and text editor !! Contributors From 7ff7f5508ce0ff3226ea8d332f33f8cf9710f157 Mon Sep 17 00:00:00 2001 From: Xavier Cazin Date: Fri, 15 Aug 2014 22:54:58 +0200 Subject: [PATCH 21/61] More fr-FR translations for Plugins-related strings in ControlPanel --- languages/fr-FR/ControlPanel.multids | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/languages/fr-FR/ControlPanel.multids b/languages/fr-FR/ControlPanel.multids index 270af2c16..aa50e0de1 100644 --- a/languages/fr-FR/ControlPanel.multids +++ b/languages/fr-FR/ControlPanel.multids @@ -64,6 +64,12 @@ Basics/Title/Prompt: Titre de ce ~TiddlyWiki Basics/Username/Prompt: Signer les modifications avec ce nom d'utilisateur Basics/Version/Prompt: Numéro de version : Plugins/Caption: Plugins +Plugins/Disable/Caption: désactiver +Plugins/Disable/Hint: Désactive ce plugin au prochain rechargement de la page +Plugins/Disabled/Status: (désactivé) +Plugins/Empty/Hint: Aucun +Plugins/Enable/Caption: activer +Plugins/Enable/Hint: Active ce plugin au prochain rechargement de la page Plugins/Language/Prompt: Langues Plugins/Plugin/Prompt: Plugins Plugins/Theme/Prompt: Thèmes From f8ad9fd590bc3124e3ca46ecc16f8fcebf7df538 Mon Sep 17 00:00:00 2001 From: Bram Chen Date: Sat, 16 Aug 2014 09:05:45 +0800 Subject: [PATCH 22/61] Add chinese translations for the new functionality of enable/disable plugins in control panel --- languages/zh-Hans/ControlPanel.multids | 8 +++++++- languages/zh-Hant/ControlPanel.multids | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/languages/zh-Hans/ControlPanel.multids b/languages/zh-Hans/ControlPanel.multids index 022f17aad..1a0cdede4 100644 --- a/languages/zh-Hans/ControlPanel.multids +++ b/languages/zh-Hans/ControlPanel.multids @@ -64,11 +64,17 @@ Basics/Title/Prompt: 标题: Basics/Username/Prompt: 编辑者署名: Basics/Version/Prompt: ~TiddlyWiki 版本: Plugins/Caption: 插件 +Plugins/Disable/Caption: 禁用 +Plugins/Disable/Hint: 重新加载页面时禁用此插件 +Plugins/Disabled/Status: (已禁用) +Plugins/Empty/Hint: 无 +Plugins/Enable/Caption: 启用 +Plugins/Enable/Hint: 重新加载页面时启用此插件 Plugins/Language/Prompt: 语言 Plugins/Plugin/Prompt: 插件 Plugins/Theme/Prompt: 布景主题 Saving/AutoSave/Disabled/Button: 启用 -Saving/AutoSave/Disabled/Prompt: 自动保存已停用 +Saving/AutoSave/Disabled/Prompt: 自动保存已禁用 Saving/AutoSave/Enabled/Button: 停用 Saving/AutoSave/Enabled/Prompt: 自动保存已启用 Saving/AutoSave: 自动保存 diff --git a/languages/zh-Hant/ControlPanel.multids b/languages/zh-Hant/ControlPanel.multids index 9febb47c8..946da8ea8 100644 --- a/languages/zh-Hant/ControlPanel.multids +++ b/languages/zh-Hant/ControlPanel.multids @@ -64,6 +64,12 @@ Basics/Title/Prompt: 標題: Basics/Username/Prompt: 編輯者署名: Basics/Version/Prompt: ~TiddlyWiki 版本: Plugins/Caption: 插件 +Plugins/Disable/Caption: 停用 +Plugins/Disable/Hint: 重新載入頁面時停用此插件 +Plugins/Disabled/Status: (已停用) +Plugins/Empty/Hint: 無 +Plugins/Enable/Caption: 啟用 +Plugins/Enable/Hint: 重新載入頁面時啟用此插件 Plugins/Language/Prompt: 語言 Plugins/Plugin/Prompt: 插件 Plugins/Theme/Prompt: 佈景主題 From 4044ba0d2d8d98d4f6da7093586aea2566fd1730 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 16 Aug 2014 14:44:11 +0100 Subject: [PATCH 23/61] Add full download link to GettingStarted --- editions/tw5.com/tiddlers/GettingStarted.tid | 1 + 1 file changed, 1 insertion(+) diff --git a/editions/tw5.com/tiddlers/GettingStarted.tid b/editions/tw5.com/tiddlers/GettingStarted.tid index 71647398c..797c4df58 100644 --- a/editions/tw5.com/tiddlers/GettingStarted.tid +++ b/editions/tw5.com/tiddlers/GettingStarted.tid @@ -17,3 +17,4 @@ See also: * [[Saving on TiddlySpot]], a free service that lets you use TiddlyWiki online * Running [[TiddlyWiki on node-webkit]], turning a single TiddlyWiki into a native application on your desktop * [[Using TiddlyWiki on TiddlyDesktop]], a custom desktop application for working with TiddlyWiki +* You can also download this full TiddlyWiki including all the documentation: ~http://tiddlywiki.com/index.html From bba3fe586bed1853f56895ab39e1e6abaa87e654 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 16 Aug 2014 14:44:46 +0100 Subject: [PATCH 24/61] Fix padding for plugin dropdown --- themes/tiddlywiki/vanilla/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 8094731b1..21869d358 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1283,7 +1283,7 @@ a.tw-tiddlylink.tw-plugin-info:hover { .tw-plugin-info-dropdown { border: 1px solid <>; - padding: 1em 1em 0 1em; + padding: 1em 1em 1em 1em; margin-top: -1em; } From bea83bfe55c3b3be7445e83fe0d2e984082eded9 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 16 Aug 2014 15:01:04 +0100 Subject: [PATCH 25/61] Fix problem with refreshing the edit widget --- core/modules/widgets/edit.js | 46 ++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/core/modules/widgets/edit.js b/core/modules/widgets/edit.js index 39f4c39c2..38b676e57 100644 --- a/core/modules/widgets/edit.js +++ b/core/modules/widgets/edit.js @@ -46,28 +46,11 @@ EditWidget.prototype.execute = function() { this.editIndex = this.getAttribute("index"); this.editClass = this.getAttribute("class"); this.editPlaceholder = this.getAttribute("placeholder"); - // Get the content type of the thing we're editing - var type; - if(this.editField === "text") { - var tiddler = this.wiki.getTiddler(this.editTitle); - if(tiddler) { - type = tiddler.fields.type; - } - } - type = type || "text/vnd.tiddlywiki"; // Choose the appropriate edit widget - var editorType = this.wiki.getTiddlerText(EDITOR_MAPPING_PREFIX + type); - if(!editorType) { - var typeInfo = $tw.config.contentTypeInfo[type]; - if(typeInfo && typeInfo.encoding === "base64") { - editorType = "binary"; - } else { - editorType = "text"; - } - } + this.editorType = this.getEditorType(); // Make the child widgets this.makeChildWidgets([{ - type: "edit-" + editorType, + type: "edit-" + this.editorType, attributes: { tiddler: {type: "string", value: this.editTitle}, field: {type: "string", value: this.editField}, @@ -78,12 +61,35 @@ EditWidget.prototype.execute = function() { }]); }; +EditWidget.prototype.getEditorType = function() { + // Get the content type of the thing we're editing + var type; + if(this.editField === "text") { + var tiddler = this.wiki.getTiddler(this.editTitle); + if(tiddler) { + type = tiddler.fields.type; + } + } + type = type || "text/vnd.tiddlywiki"; + var editorType = this.wiki.getTiddlerText(EDITOR_MAPPING_PREFIX + type); + if(!editorType) { + var typeInfo = $tw.config.contentTypeInfo[type]; + if(typeInfo && typeInfo.encoding === "base64") { + editorType = "binary"; + } else { + editorType = "text"; + } + } + return editorType; +}; + /* Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering */ EditWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedTiddlers[this.editTitle]) { + // Refresh if an attribute has changed, or the type associated with the target tiddler has changed + if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || (changedTiddlers[this.editTitle] && this.getEditorType() !== this.editorType)) { this.refreshSelf(); return true; } else { From d7cb82d65dda51546f23427e73bf061980824f2b Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 17 Aug 2014 15:10:43 +0100 Subject: [PATCH 26/61] Add GuerillaWiki docs --- editions/tw5.com/tiddlers/GuerillaWiki.tid | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 editions/tw5.com/tiddlers/GuerillaWiki.tid diff --git a/editions/tw5.com/tiddlers/GuerillaWiki.tid b/editions/tw5.com/tiddlers/GuerillaWiki.tid new file mode 100644 index 000000000..2bc7ea3e3 --- /dev/null +++ b/editions/tw5.com/tiddlers/GuerillaWiki.tid @@ -0,0 +1,11 @@ +created: 20140817140917462 +modified: 20140817141027417 +tags: definitions +title: GuerillaWiki +type: text/vnd.tiddlywiki + +TiddlyWiki makes a great GuerillaWiki in situations where it is not practical to use a traditional wiki. + +For instance, in a corporate setting, persuading an over-worked IT department to install a Wiki server for you is seldom going to be possible overnight. And if your PC is locked down you can't install a conventional Wiki yourself. Equally, you can't go and use one of the public hosted Wiki services because your Information Security department would not allow all that corporate data to flow into an outside server. + +TiddlyWiki slices through those barriers by being usable on virtually all PCs. From a637af022d2975e541a4553accb08296c6e4107e Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 10:13:30 +0100 Subject: [PATCH 27/61] Fix problem with parseTextReference not recognising missing indices --- core/modules/wiki.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 730bf35b7..1cc2c2fb8 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -830,7 +830,7 @@ exports.parseTextReference = function(title,field,index,options) { } return this.parseText("text/vnd.tiddlywiki",text.toString(),options); } else if(index) { - text = this.extractTiddlerDataItem(tiddler,index,""); + text = this.extractTiddlerDataItem(tiddler,index,undefined); if(text === undefined) { return null; } From 727638c12d4bd482f3d9635f206ef05f399e24ff Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 10:14:19 +0100 Subject: [PATCH 28/61] Clean up CSS macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the CSS macros into global macros, and allow the colour macro to fallback to the vanilla palette if the required colour isn’t found in the current palette. --- core/ui/PageStylesheet.tid | 56 ++------------------------------------ core/wiki/macros/CSS.tid | 56 +++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 54 deletions(-) diff --git a/core/ui/PageStylesheet.tid b/core/ui/PageStylesheet.tid index 3162f9378..b20c7670e 100644 --- a/core/ui/PageStylesheet.tid +++ b/core/ui/PageStylesheet.tid @@ -1,59 +1,9 @@ title: $:/core/ui/PageStylesheet -\define colour(name) -<$transclude tiddler={{$:/palette}} index="$name$"/> -\end -\define color(name) -<> -\end -\define box-shadow(shadow) -``` - -webkit-box-shadow: $shadow$; - -moz-box-shadow: $shadow$; - box-shadow: $shadow$; -``` -\end -\define filter(filter) -``` - -webkit-filter: $filter$; - -moz-filter: $filter$; - filter: $filter$; -``` -\end -\define transition(transition) -``` - -webkit-transition: $transition$; - -moz-transition: $transition$; - transition: $transition$; -``` -\end -\define transform-origin(origin) -``` - -webkit-transform-origin: $origin$; - -moz-transform-origin: $origin$; - transform-origin: $origin$; -``` -\end -\define background-linear-gradient(gradient) -``` -background-image: linear-gradient($gradient$); -background-image: -o-linear-gradient($gradient$); -background-image: -moz-linear-gradient($gradient$); -background-image: -webkit-linear-gradient($gradient$); -background-image: -ms-linear-gradient($gradient$); -``` -\end -\define datauri(title) -<$macrocall $name="makedatauri" type={{$title$!!type}} text={{$title$}}/> -\end -\define if-sidebar(text) -<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes">$text$ -\end -\define if-no-sidebar(text) -<$reveal state="$:/state/sidebar" type="nomatch" text="yes" default="yes">$text$ -\end - +<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/stylesheet]!has[draft.of]]"> <$transclude/> + + diff --git a/core/wiki/macros/CSS.tid b/core/wiki/macros/CSS.tid index 58b0252a2..4c4e3fd4f 100644 --- a/core/wiki/macros/CSS.tid +++ b/core/wiki/macros/CSS.tid @@ -2,9 +2,63 @@ title: $:/core/macros/CSS tags: $:/tags/Macro \define colour(name) -<$transclude tiddler={{$:/palette}} index="$name$"/> +<$transclude tiddler={{$:/palette}} index="$name$"><$transclude tiddler="$:/palettes/Vanilla" index="$name$"/> \end \define color(name) <> \end + +\define box-shadow(shadow) +``` + -webkit-box-shadow: $shadow$; + -moz-box-shadow: $shadow$; + box-shadow: $shadow$; +``` +\end + +\define filter(filter) +``` + -webkit-filter: $filter$; + -moz-filter: $filter$; + filter: $filter$; +``` +\end + +\define transition(transition) +``` + -webkit-transition: $transition$; + -moz-transition: $transition$; + transition: $transition$; +``` +\end + +\define transform-origin(origin) +``` + -webkit-transform-origin: $origin$; + -moz-transform-origin: $origin$; + transform-origin: $origin$; +``` +\end + +\define background-linear-gradient(gradient) +``` +background-image: linear-gradient($gradient$); +background-image: -o-linear-gradient($gradient$); +background-image: -moz-linear-gradient($gradient$); +background-image: -webkit-linear-gradient($gradient$); +background-image: -ms-linear-gradient($gradient$); +``` +\end + +\define datauri(title) +<$macrocall $name="makedatauri" type={{$title$!!type}} text={{$title$}}/> +\end + +\define if-sidebar(text) +<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes">$text$ +\end + +\define if-no-sidebar(text) +<$reveal state="$:/state/sidebar" type="nomatch" text="yes" default="yes">$text$ +\end From c57b00996855f10d9b7fa2aa4e9deb2a2a607d7f Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 10:27:48 +0100 Subject: [PATCH 29/61] Simpler default defaulttiddlers --- core/wiki/DefaultTiddlers.tid | 1 - 1 file changed, 1 deletion(-) diff --git a/core/wiki/DefaultTiddlers.tid b/core/wiki/DefaultTiddlers.tid index 7c4f151ff..02614643f 100644 --- a/core/wiki/DefaultTiddlers.tid +++ b/core/wiki/DefaultTiddlers.tid @@ -1,4 +1,3 @@ title: $:/DefaultTiddlers GettingStarted -[!is[system]has[modified]!sort[modified]limit[25]] \ No newline at end of file From a3d0f84ff79b05fcf00b2bb4ab011151d10e4d99 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 10:45:27 +0100 Subject: [PATCH 30/61] Update startup modules diagram --- editions/tw5.com/tiddlers/images/Startup Modules.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/images/Startup Modules.svg b/editions/tw5.com/tiddlers/images/Startup Modules.svg index 5343ece9c..2d809d46a 100644 --- a/editions/tw5.com/tiddlers/images/Startup Modules.svg +++ b/editions/tw5.com/tiddlers/images/Startup Modules.svg @@ -1,3 +1,3 @@ - Produced by OmniGraffle 6.0.5 2014-05-05 16:00ZStartup TasksLayer 2browserbrowser+serverserverLayer 1load-modulesstartupfaviconstoryrenderfull-screengoogle-analyticsafterafterbeforeafteraftercommandsaftersyncer-browserafterrootwidgetafterafterpasswordafter + Produced by OmniGraffle 6.0.5 2014-08-14 08:00ZStartup TasksLayer 2browserbrowser+serverserverLayer 1load-modulesstartupfaviconstoryrenderinfogoogle-analyticsafterafterbeforeafteraftercommandsafterrootwidgetafterafterpasswordafterbefore From fe6623d7feed1a9068e15bfac57be0b0924e8915 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 13:22:38 +0100 Subject: [PATCH 31/61] Restore foreground colour for sidebar tag pills --- themes/tiddlywiki/vanilla/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 21869d358..3e0dbf575 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -312,7 +312,7 @@ button svg.tw-image-button, button .tw-image-button img { vertical-align: baseline; } -.tw-tag-label { +button.tw-tag-label { display: inline-block; padding: 2px 9px; font-size: 0.9em; From a2acb1462b37f95ced5a3363adc518189621bcf0 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 20:43:16 +0100 Subject: [PATCH 32/61] Update release note --- editions/tw5.com/tiddlers/Release 5.0.15beta.tid | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid index e0b77b9b4..718804597 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -1,14 +1,12 @@ caption: 5.0.15-beta created: 20140812150234142 -modified: 20140813153116300 +modified: 20140818153116300 tags: releasenote title: Release 5.0.15-beta type: text/vnd.tiddlywiki //[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.14-beta...v5.0.15-beta]]// -This is a small release to resolve some minor issues with [[Release 5.0.14-beta]]. - !! Usability Improvements * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/32a7ee2683ace619599f0ab73028307ca33f4e4c]] the ability to disable plugins (see PluginMechanism) with a user interface in [[control panel|$:/ControlPanel]] From 8cf726275c19ed5b4a0ed1cf8354d64d1bc29da5 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 20:52:36 +0100 Subject: [PATCH 33/61] First pass at table of contents macros Introduce macros for automatically generating table of contents --- core/wiki/macros/toc.tid | 46 +++++++++++++++++++ .../tiddlers/macros/TableOfContentsMacro.tid | 33 +++++++++++++ .../samples/TableOfContents/First.tid | 4 ++ .../samples/TableOfContents/FirstOne.tid | 4 ++ .../samples/TableOfContents/FirstThree.tid | 4 ++ .../samples/TableOfContents/FirstTwo.tid | 4 ++ .../samples/TableOfContents/Fourth.tid | 4 ++ .../samples/TableOfContents/Second.tid | 4 ++ .../samples/TableOfContents/SecondOne.tid | 4 ++ .../samples/TableOfContents/SecondThree.tid | 4 ++ .../TableOfContents/SecondThreeOne.tid | 4 ++ .../TableOfContents/SecondThreeThree.tid | 4 ++ .../TableOfContents/SecondThreeTwo.tid | 4 ++ .../samples/TableOfContents/SecondTwo.tid | 4 ++ .../samples/TableOfContents/Third.tid | 4 ++ .../samples/TableOfContents/ThirdOne.tid | 4 ++ .../samples/TableOfContents/ThirdThree.tid | 4 ++ .../samples/TableOfContents/ThirdTwo.tid | 4 ++ 18 files changed, 143 insertions(+) create mode 100644 core/wiki/macros/toc.tid create mode 100644 editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/First.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/FirstOne.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/FirstThree.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/FirstTwo.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/Fourth.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/Second.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/SecondOne.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeOne.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeThree.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeTwo.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/SecondTwo.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/ThirdOne.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/ThirdThree.tid create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/ThirdTwo.tid diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid new file mode 100644 index 000000000..736bea91b --- /dev/null +++ b/core/wiki/macros/toc.tid @@ -0,0 +1,46 @@ +title: $:/core/macros/toc +tags: $:/tags/Macro + +\define toc(tag) +
    +<$list filter="[tag[$tag$]]"> +
  1. +<$link> +<$view field="title"/> + +<$macrocall $name="toc" tag=<>/> +
  2. + +
+\end + +\define toc-body(tag,show-button-filter) +<$set name="toc-state" value=<>> +
  • +<$link> +<$reveal type="nomatch" state=<> text="open"> +<$button set=<> setTo="open" class="btn-invisible"> +{{$:/core/images/right-arrow}} + + +<$reveal type="match" state=<> text="open"> +<$button set=<> setTo="close" class="btn-invisible"> +{{$:/core/images/down-arrow}} + + +<$view field="title"/> + +<$reveal type="match" state=<> text="open"> +<$macrocall $name="toc-expandable" tag=<>/> + +
  • + +\end + +\define toc-expandable(tag) +
      +<$list filter="[tag[$tag$]]"> +<> + +
    +\end diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid new file mode 100644 index 000000000..38625ebaa --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid @@ -0,0 +1,33 @@ +title: TableOfContentsMacro +tags: macros +modified: 20140818180307785 + +The table of contents macro produces a hierarchical tree of tiddlers based on their tags. + +There are several variants of the macro: + +* `<>` produces a simple hierarchical tree of links +* `<>` produces an expandable tree of links + +! Parameters + +|!Position |!Name |!Description |!Default | +|1st |tag |The tag that identifies the top level of the hierarchy | | + +! Examples + +!! Simple Table of Contents + +<$macrocall $name="wikitext-example-without-html" +src="
    +<> +
    +"/> + +!! Expandable Table of Contents + +<$macrocall $name="wikitext-example-without-html" +src="
    +<> +
    +"/> diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/First.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/First.tid new file mode 100644 index 000000000..f48ff0815 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/First.tid @@ -0,0 +1,4 @@ +title: First +tags: Contents + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/FirstOne.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/FirstOne.tid new file mode 100644 index 000000000..238aeda27 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/FirstOne.tid @@ -0,0 +1,4 @@ +title: FirstOne +tags: First + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/FirstThree.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/FirstThree.tid new file mode 100644 index 000000000..4a5fcb683 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/FirstThree.tid @@ -0,0 +1,4 @@ +title: FirstThree +tags: First + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/FirstTwo.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/FirstTwo.tid new file mode 100644 index 000000000..a30891722 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/FirstTwo.tid @@ -0,0 +1,4 @@ +title: FirstTwo +tags: First + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/Fourth.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/Fourth.tid new file mode 100644 index 000000000..a09fe0467 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/Fourth.tid @@ -0,0 +1,4 @@ +title: Fourth +tags: Contents + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/Second.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/Second.tid new file mode 100644 index 000000000..c87c88a7a --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/Second.tid @@ -0,0 +1,4 @@ +title: Second +tags: Contents + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/SecondOne.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondOne.tid new file mode 100644 index 000000000..2d9898b33 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondOne.tid @@ -0,0 +1,4 @@ +title: SecondOne +tags: Second + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid new file mode 100644 index 000000000..f87e1ac09 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid @@ -0,0 +1,4 @@ +title: SecondThree +tags: Second + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeOne.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeOne.tid new file mode 100644 index 000000000..22d2e83c9 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeOne.tid @@ -0,0 +1,4 @@ +title: SecondThreeOne +tags: SecondThree + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeThree.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeThree.tid new file mode 100644 index 000000000..7b632ad4b --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeThree.tid @@ -0,0 +1,4 @@ +title: SecondThreeThree +tags: SecondThree + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeTwo.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeTwo.tid new file mode 100644 index 000000000..4578ff7d0 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThreeTwo.tid @@ -0,0 +1,4 @@ +title: SecondThreeTwo +tags: SecondThree + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/SecondTwo.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondTwo.tid new file mode 100644 index 000000000..302838c89 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondTwo.tid @@ -0,0 +1,4 @@ +title: SecondTwo +tags: Second + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid new file mode 100644 index 000000000..6b2c4db1d --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid @@ -0,0 +1,4 @@ +title: Third +tags: Contents + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdOne.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdOne.tid new file mode 100644 index 000000000..e090c269f --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdOne.tid @@ -0,0 +1,4 @@ +title: ThirdOne +tags: Third + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdThree.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdThree.tid new file mode 100644 index 000000000..ec781f15f --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdThree.tid @@ -0,0 +1,4 @@ +title: ThirdThree +tags: Third + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdTwo.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdTwo.tid new file mode 100644 index 000000000..cbbdb7aab --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/ThirdTwo.tid @@ -0,0 +1,4 @@ +title: ThirdTwo +tags: Third + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file From bd56e4b96056b3156a8b424e52cceb4e0c8a74ed Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 21:44:22 +0100 Subject: [PATCH 34/61] Fix ordering for the table of contents example --- editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid | 2 ++ editions/tw5.com/tiddlers/samples/TableOfContents/First.tid | 1 + .../tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid | 1 + editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid | 1 + 4 files changed, 5 insertions(+) create mode 100644 editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid new file mode 100644 index 000000000..dd8e3b769 --- /dev/null +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid @@ -0,0 +1,2 @@ +title: Contents +list: First Second Third Fourth diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/First.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/First.tid index f48ff0815..72650711c 100644 --- a/editions/tw5.com/tiddlers/samples/TableOfContents/First.tid +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/First.tid @@ -1,4 +1,5 @@ title: First tags: Contents +list: FirstOne FirstTwo FirstThree Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid index f87e1ac09..f1b0f1268 100644 --- a/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/SecondThree.tid @@ -1,4 +1,5 @@ title: SecondThree tags: Second +list: SecondThreeOne SecondThreeTwo SecondThreeThree Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid index 6b2c4db1d..8d5f734e8 100644 --- a/editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/Third.tid @@ -1,4 +1,5 @@ title: Third tags: Contents +list: ThirdOne ThirdTwo ThirdThree Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file From 1e1622273b3b09a90008a78f9c1df28182dd0a00 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 21:44:31 +0100 Subject: [PATCH 35/61] More table of content macro docs --- editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid index 38625ebaa..9efcdee39 100644 --- a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid @@ -4,6 +4,8 @@ modified: 20140818180307785 The table of contents macro produces a hierarchical tree of tiddlers based on their tags. +The top level entries of the table of contents are defined by a root tag. The subentries under each of those entries are tagged with the title of the entry. Entries can be ordered using the `list` field as described in TiddlerTags. + There are several variants of the macro: * `<>` produces a simple hierarchical tree of links @@ -12,7 +14,7 @@ There are several variants of the macro: ! Parameters |!Position |!Name |!Description |!Default | -|1st |tag |The tag that identifies the top level of the hierarchy | | +|1st |tag |The root tag that identifies the top level of the hierarchy | | ! Examples From 074cbf2606c3381080bf557d4fc1dc1be07d9c2b Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 18 Aug 2014 21:48:03 +0100 Subject: [PATCH 36/61] Release note update --- editions/tw5.com/tiddlers/Release 5.0.15beta.tid | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid index 718804597..c17d8a829 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -9,12 +9,15 @@ type: text/vnd.tiddlywiki !! Usability Improvements +* [[Simplified|https://github.com/Jermolene/TiddlyWiki5/commit/c57b00996855f10d9b7fa2aa4e9deb2a2a607d7f]] shadow default tiddlers * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/32a7ee2683ace619599f0ab73028307ca33f4e4c]] the ability to disable plugins (see PluginMechanism) with a user interface in [[control panel|$:/ControlPanel]] * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/4b05608ad5e77043b01495825ea0f0e76c378760]] page control button for invoking the [[tag manager|$:/TagManager]] !! Hackability Improvements * [[Refactored|https://github.com/Jermolene/TiddlyWiki5/commit/f75af2c983e10e8a82639890b993fb5cf042d610]] `saver-handler.js` out of `syncer.js` +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/8cf726275c19ed5b4a0ed1cf8354d64d1bc29da5]] TableOfContentsMacro support +* Simplified startup module organisation (see [[Startup Modules.svg]]) !! Bug Fixes @@ -22,6 +25,7 @@ type: text/vnd.tiddlywiki * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/34461cb2fe554331a0269fd7795b1d6a879fcba9]] unclickable download ink in upgrade wizard * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/9e85ddfec78dd8df71e6173100dce659417551f4]] missing language flag in ''empty.html'' * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/18592fe8f810d1858ca040da1a7c4a81fb74cfed]] problem with switching the type of a tiddler between the bitmap and text editor +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/fe6623d7feed1a9068e15bfac57be0b0924e8915]] foreground colour for tag pills in the sidebar !! Contributors From 920e11e7921f777170aa2f9e1836c000fec2e26d Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 19 Aug 2014 12:12:36 +0100 Subject: [PATCH 37/61] Introduce refresh button and revert home button Now the home button behaves as it did in 5.0.13, and the new refresh button does a full page refresh. --- core/images/refresh-button.tid | 8 ++++++++ core/language/en-GB/Buttons.multids | 4 +++- core/modules/startup/story.js | 9 ++++++++- core/ui/PageControls/refresh.tid | 13 +++++++++++++ core/wiki/config/PageControlButtons.multids | 1 + core/wiki/tags/PageControls.tid | 2 +- .../tiddlers/messages/WidgetMessage_ tw-home.tid | 6 +++--- .../tiddlers/messages/WidgetMessage_ tw-refresh.tid | 9 +++++++++ 8 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 core/images/refresh-button.tid create mode 100644 core/ui/PageControls/refresh.tid create mode 100644 editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-refresh.tid diff --git a/core/images/refresh-button.tid b/core/images/refresh-button.tid new file mode 100644 index 000000000..31575e31c --- /dev/null +++ b/core/images/refresh-button.tid @@ -0,0 +1,8 @@ +title: $:/core/images/refresh-button +tags: $:/tags/Image + + + + + + diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 8074b51fb..dac85e315 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -31,7 +31,7 @@ Import/Hint: Import files Info/Caption: info Info/Hint: Show information for this tiddler Home/Caption: home -Home/Hint: Refresh the page and open the home tiddlers +Home/Hint: Open the default tiddlers Language/Caption: language Language/Hint: Choose the user interface language NewTiddler/Caption: new tiddler @@ -42,6 +42,8 @@ Permalink/Caption: permalink Permalink/Hint: Set browser address bar to a direct link to this tiddler Permaview/Caption: permaview Permaview/Hint: Set browser address bar to a direct link to all the tiddlers in this story +Refresh/Caption: refresh +Refresh/Hint: Perform a full refresh of the wiki Save/Caption: save Save/Hint: Save this tiddler SaveWiki/Caption: save changes diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index c74c5f03b..59024fc71 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -49,10 +49,17 @@ exports.startup = function() { openStartupTiddlers({defaultToCurrentStory: true}); } },false) + // Listen for the tw-refresh message + $tw.rootWidget.addEventListener("tw-refresh",function(event) { + window.location.hash = ""; + window.location.reload(true); + }); // Listen for the tw-home message $tw.rootWidget.addEventListener("tw-home",function(event) { window.location.hash = ""; - window.location.reload(true); + var storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE), + storyList = $tw.wiki.filterTiddlers(storyFilter); + $tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: "", list: storyList},$tw.wiki.getModificationFields()); }); // Listen for the tw-permalink message $tw.rootWidget.addEventListener("tw-permalink",function(event) { diff --git a/core/ui/PageControls/refresh.tid b/core/ui/PageControls/refresh.tid new file mode 100644 index 000000000..6acb1bcb2 --- /dev/null +++ b/core/ui/PageControls/refresh.tid @@ -0,0 +1,13 @@ +title: $:/core/ui/Buttons/refresh +tags: $:/tags/PageControls +caption: {{$:/core/images/refresh-button}} {{$:/language/Buttons/Refresh/Caption}} +description: {{$:/language/Buttons/Refresh/Hint}} + +<$button message="tw-refresh" title={{$:/language/Buttons/Refresh/Hint}} aria-label={{$:/language/Buttons/Refresh/Caption}} class=<>> +<$list filter="[prefix[yes]]"> +{{$:/core/images/refresh-button}} + +<$list filter="[prefix[yes]]"> +<$text text={{$:/language/Buttons/Refresh/Caption}}/> + + diff --git a/core/wiki/config/PageControlButtons.multids b/core/wiki/config/PageControlButtons.multids index df29cd1f0..164c454e3 100644 --- a/core/wiki/config/PageControlButtons.multids +++ b/core/wiki/config/PageControlButtons.multids @@ -4,6 +4,7 @@ core/ui/Buttons/close-all: hide core/ui/Buttons/encryption: hide core/ui/Buttons/full-screen: hide core/ui/Buttons/home: hide +core/ui/Buttons/refresh: hide core/ui/Buttons/import: hide core/ui/Buttons/language: hide core/ui/Buttons/tag-manager: hide diff --git a/core/wiki/tags/PageControls.tid b/core/wiki/tags/PageControls.tid index 080bb82d8..233ef5443 100644 --- a/core/wiki/tags/PageControls.tid +++ b/core/wiki/tags/PageControls.tid @@ -1,2 +1,2 @@ title: $:/tags/PageControls -list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/more-page-actions]] +list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]] diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-home.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-home.tid index 12c16291c..ffb5084f4 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-home.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-home.tid @@ -1,9 +1,9 @@ -created: 20140312223013470 -modified: 20140729223134387 +created: 20140819110529062 +modified: 20140819110529062 tags: message title: WidgetMessage: tw-home type: text/vnd.tiddlywiki -The `tw-home` message refreshes the current page by removing any [[permalink|PermaLinks]] from the browser address bar, causing the re-display of the [[$:/DefaultTiddlers]], and re-initialisation of any plugin tiddlers. It does not require any properties on the `event` object. +The `tw-home` message closes any open tiddlers and re-opens the default tiddlers set in [[$:/DefaultTiddlers]]. It also remove any [[permalink|PermaLinks]] from the browser address bar. It does not require any properties on the `event` object. The home message is usually generated with the ButtonWidget and is handled by the core. diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-refresh.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-refresh.tid new file mode 100644 index 000000000..8f641ed97 --- /dev/null +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-refresh.tid @@ -0,0 +1,9 @@ +created: 20140819110529062 +modified: 20140819110529062 +tags: message +title: WidgetMessage: tw-refresh +type: text/vnd.tiddlywiki + +The `tw-refresh` message refreshes the current page by removing any [[permalink|PermaLinks]] from the browser address bar, causing the re-display of the [[$:/DefaultTiddlers]], and re-initialisation of any plugin tiddlers. It does not require any properties on the `event` object. + +The refresh message is usually generated with the ButtonWidget and is handled by the core. From c4b76ceb0bc786bcceb12fc3417bb8c4bfde27a9 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 19 Aug 2014 12:20:26 +0100 Subject: [PATCH 38/61] Improve offline saving with TiddlyWeb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now the usual “save changes” button in the sidebar will save an offline copy of the wiki that excludes the TiddlyWeb plugin. Previously, this functionality was only available in the control panel, leading to several problems such as that discussed here: https://groups.google.com/d/topic/tiddlywikidev/U61pO-TR854/discussion --- plugins/tiddlywiki/tiddlyweb/ServerControlPanel.tid | 6 ------ plugins/tiddlywiki/tiddlyweb/download-offline-button.tid | 3 --- .../tiddlyweb/{download-offline.tid => save-all.tid} | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 plugins/tiddlywiki/tiddlyweb/download-offline-button.tid rename plugins/tiddlywiki/tiddlyweb/{download-offline.tid => save-all.tid} (87%) diff --git a/plugins/tiddlywiki/tiddlyweb/ServerControlPanel.tid b/plugins/tiddlywiki/tiddlyweb/ServerControlPanel.tid index e5aa83d1e..1a8da7155 100644 --- a/plugins/tiddlywiki/tiddlyweb/ServerControlPanel.tid +++ b/plugins/tiddlywiki/tiddlyweb/ServerControlPanel.tid @@ -18,9 +18,3 @@ Host configuration: <$edit-text tiddler="$:/config/tiddlyweb/host" tag="input" d ---- <$button message="tw-server-refresh" class="btn btn-warning">Refresh to fetch changes from the server immediately - ----- - -Download an offline copy of this wiki: - -{{$:/editions/server/download-offline-button}} \ No newline at end of file diff --git a/plugins/tiddlywiki/tiddlyweb/download-offline-button.tid b/plugins/tiddlywiki/tiddlyweb/download-offline-button.tid deleted file mode 100644 index 8006f501a..000000000 --- a/plugins/tiddlywiki/tiddlyweb/download-offline-button.tid +++ /dev/null @@ -1,3 +0,0 @@ -title: $:/editions/server/download-offline-button - -<$button message="tw-download-file" param="$:/editions/server/download-offline" class="btn-big-green">Download Offline Snapshot {{$:/core/images/save-button}} \ No newline at end of file diff --git a/plugins/tiddlywiki/tiddlyweb/download-offline.tid b/plugins/tiddlywiki/tiddlyweb/save-all.tid similarity index 87% rename from plugins/tiddlywiki/tiddlyweb/download-offline.tid rename to plugins/tiddlywiki/tiddlyweb/save-all.tid index a5b1e67f9..497db85a5 100644 --- a/plugins/tiddlywiki/tiddlyweb/download-offline.tid +++ b/plugins/tiddlywiki/tiddlyweb/save-all.tid @@ -1,4 +1,4 @@ -title: $:/editions/server/download-offline +title: $:/core/save/all \define saveTiddlerFilter() [is[tiddler]] -[[$:/boot/boot.css]] -[[$:/HistoryList]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] +[sort[title]] From 58730b74526c056ff0206fdc3469354c3fe21d24 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 19 Aug 2014 12:30:22 +0100 Subject: [PATCH 39/61] Add selective expandable table of contents macro And improve the layout of the examples --- core/wiki/macros/toc.tid | 37 ++++++++++++++++++- ...ableOfContentsMacro Expandable Example.tid | 11 ++++++ ...entsMacro Selective Expandable Example.tid | 11 ++++++ .../TableOfContentsMacro Simple Example.tid | 11 ++++++ .../tiddlers/macros/TableOfContentsMacro.tid | 17 +-------- 5 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 editions/tw5.com/tiddlers/macros/TableOfContentsMacro Expandable Example.tid create mode 100644 editions/tw5.com/tiddlers/macros/TableOfContentsMacro Selective Expandable Example.tid create mode 100644 editions/tw5.com/tiddlers/macros/TableOfContentsMacro Simple Example.tid diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 736bea91b..6db9512ce 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -14,7 +14,7 @@ tags: $:/tags/Macro \end -\define toc-body(tag,show-button-filter) +\define toc-expandable-body(tag,show-button-filter) <$set name="toc-state" value=<>>
  • <$link> @@ -40,7 +40,40 @@ tags: $:/tags/Macro \define toc-expandable(tag)
      <$list filter="[tag[$tag$]]"> -<> +<> + +
    +\end + +\define toc-selective-expandable-body(tag,show-button-filter) +<$set name="toc-state" value=<>> +
  • +<$link> +<$list filter="[all[current]tagging[]limit[1]]"> +<$reveal type="nomatch" state=<> text="open"> +<$button set=<> setTo="open" class="btn-invisible"> +{{$:/core/images/right-arrow}} + + +<$reveal type="match" state=<> text="open"> +<$button set=<> setTo="close" class="btn-invisible"> +{{$:/core/images/down-arrow}} + + + +<$view field="title"/> + +<$reveal type="match" state=<> text="open"> +<$macrocall $name="toc-selective-expandable" tag=<>/> + +
  • + +\end + +\define toc-selective-expandable(tag) +
      +<$list filter="[tag[$tag$]]"> +<>
    \end diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Expandable Example.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Expandable Example.tid new file mode 100644 index 000000000..41f1e473c --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Expandable Example.tid @@ -0,0 +1,11 @@ +title: TableOfContentsMacro Expandable Example +caption: Expandable +tags: table-of-contents-example + +!! Expandable Table of Contents + +<$macrocall $name="wikitext-example-without-html" +src="
    +<> +
    +"/> diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Selective Expandable Example.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Selective Expandable Example.tid new file mode 100644 index 000000000..a42be8291 --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Selective Expandable Example.tid @@ -0,0 +1,11 @@ +title: TableOfContentsMacro Selective Expandable Example +caption: Selective Expandable +tags: table-of-contents-example + +!! Selective Expandable Table of Contents + +<$macrocall $name="wikitext-example-without-html" +src="
    +<> +
    +"/> diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Simple Example.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Simple Example.tid new file mode 100644 index 000000000..385aa4c33 --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Simple Example.tid @@ -0,0 +1,11 @@ +title: TableOfContentsMacro Simple Example +caption: Simple +tags: table-of-contents-example + +!! Simple Table of Contents + +<$macrocall $name="wikitext-example-without-html" +src="
    +<> +
    +"/> diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid index 9efcdee39..39f324ae6 100644 --- a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid @@ -10,6 +10,7 @@ There are several variants of the macro: * `<>` produces a simple hierarchical tree of links * `<>` produces an expandable tree of links +* `<>` produces an expandable tree of links where the expand/contract buttons are only shown for entries that possess child nodes ! Parameters @@ -18,18 +19,4 @@ There are several variants of the macro: ! Examples -!! Simple Table of Contents - -<$macrocall $name="wikitext-example-without-html" -src="
    -<> -
    -"/> - -!! Expandable Table of Contents - -<$macrocall $name="wikitext-example-without-html" -src="
    -<> -
    -"/> +<> From 25777b147fa4ed2f915150aec503ad1e094e6043 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 19 Aug 2014 13:07:57 +0100 Subject: [PATCH 40/61] Make dropzone text translateable Also make the text sticky for browsers that support it, ensuring that it is always visible even after scrolling --- core/language/en-GB/Misc.multids | 1 + themes/tiddlywiki/vanilla/base.tid | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids index 58f07beff..ad8f3543c 100644 --- a/core/language/en-GB/Misc.multids +++ b/core/language/en-GB/Misc.multids @@ -8,6 +8,7 @@ ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<>/>"? ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"? ConfirmEditShadowTiddler: You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit "<$text text=<<title>>/>"? +DropMessage: Drop here (or click escape to cancel) InvalidFieldName: Illegal characters in field name "<$text text=<<fieldName>>/>". Fields can only contain lowercase letters, digits and the characters underscore (`_`), hyphen (`-`) and period (`.`) MissingTiddler/Hint: Missing tiddler "<$text text=<<currentTiddler>>/>" - click {{$:/core/images/edit-button}} to create RecentChanges/DateFormat: DDth MMM YYYY diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 3e0dbf575..7a1175d9e 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -226,12 +226,17 @@ a.tw-tiddlylink-external:hover { z-index: 10000; display: block; position: absolute; + position: -webkit-sticky; + position: -moz-sticky; + position: -o-sticky; + position: -ms-sticky; + position: sticky; top: 0; left: 0; right: 0; background: <<colour dropzone-background>>; text-align: center; - content: "Drop here"; + content: "<<lingo DropMessage>>"; } /* From 0dfe23e0db16ce5d3201551e1d5272f793a3c08f Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Tue, 19 Aug 2014 13:11:18 +0100 Subject: [PATCH 41/61] Rename tw-refresh message to tw-browser-refresh --- core/modules/startup/story.js | 4 ++-- core/ui/PageControls/refresh.tid | 2 +- .../messages/WidgetMessage_ tw-browser-refresh.tid | 9 +++++++++ .../tiddlers/messages/WidgetMessage_ tw-refresh.tid | 9 --------- 4 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid delete mode 100644 editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-refresh.tid diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index 59024fc71..fb23b2191 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -49,8 +49,8 @@ exports.startup = function() { openStartupTiddlers({defaultToCurrentStory: true}); } },false) - // Listen for the tw-refresh message - $tw.rootWidget.addEventListener("tw-refresh",function(event) { + // Listen for the tw-browser-refresh message + $tw.rootWidget.addEventListener("tw-browser-refresh",function(event) { window.location.hash = ""; window.location.reload(true); }); diff --git a/core/ui/PageControls/refresh.tid b/core/ui/PageControls/refresh.tid index 6acb1bcb2..00789a1d5 100644 --- a/core/ui/PageControls/refresh.tid +++ b/core/ui/PageControls/refresh.tid @@ -3,7 +3,7 @@ tags: $:/tags/PageControls caption: {{$:/core/images/refresh-button}} {{$:/language/Buttons/Refresh/Caption}} description: {{$:/language/Buttons/Refresh/Hint}} -<$button message="tw-refresh" title={{$:/language/Buttons/Refresh/Hint}} aria-label={{$:/language/Buttons/Refresh/Caption}} class=<<tw-config-toolbar-class>>> +<$button message="tw-browser-refresh" title={{$:/language/Buttons/Refresh/Hint}} aria-label={{$:/language/Buttons/Refresh/Caption}} class=<<tw-config-toolbar-class>>> <$list filter="[<tw-config-toolbar-icons>prefix[yes]]"> {{$:/core/images/refresh-button}} </$list> diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid new file mode 100644 index 000000000..f4eb53295 --- /dev/null +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid @@ -0,0 +1,9 @@ +created: 20140819110529062 +modified: 20140819110529062 +tags: message +title: WidgetMessage: tw-browser-refresh +type: text/vnd.tiddlywiki + +The `tw-browser-refresh` message removs any [[permalink|PermaLinks]] from the browser address bar and refreshes the page, causing the re-display of the [[$:/DefaultTiddlers]], and re-initialisation of any plugin tiddlers. It does not require any properties on the `event` object. + +The refresh message is usually generated with the ButtonWidget and is handled by the core. diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-refresh.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-refresh.tid deleted file mode 100644 index 8f641ed97..000000000 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-refresh.tid +++ /dev/null @@ -1,9 +0,0 @@ -created: 20140819110529062 -modified: 20140819110529062 -tags: message -title: WidgetMessage: tw-refresh -type: text/vnd.tiddlywiki - -The `tw-refresh` message refreshes the current page by removing any [[permalink|PermaLinks]] from the browser address bar, causing the re-display of the [[$:/DefaultTiddlers]], and re-initialisation of any plugin tiddlers. It does not require any properties on the `event` object. - -The refresh message is usually generated with the ButtonWidget and is handled by the core. From 12f894df7cb92e23c0fba1dda6ff6affe3c912fb Mon Sep 17 00:00:00 2001 From: Xavier Cazin <xcazin@immateriel.fr> Date: Tue, 19 Aug 2014 16:51:34 +0200 Subject: [PATCH 42/61] fr-FR translation for Refresh and Home button strings --- languages/fr-FR/Buttons.multids | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/languages/fr-FR/Buttons.multids b/languages/fr-FR/Buttons.multids index 9af347c03..4b0a59ca7 100644 --- a/languages/fr-FR/Buttons.multids +++ b/languages/fr-FR/Buttons.multids @@ -31,7 +31,7 @@ Import/Hint: Importer des fichiers Info/Caption: informations Info/Hint: Afficher les informations sur ce tiddler Home/Caption: accueil -Home/Hint: Rafraîchit la page et ouvre les tiddlers de la page d'accueil +Home/Hint: Ouvre les tiddlers par défaut Language/Caption: langue Language/Hint: Choix de la langue pour l'interface utilisateur NewTiddler/Caption: nouveau tiddler @@ -42,6 +42,8 @@ Permalink/Caption: permalink Permalink/Hint: Remplacer l'URL dans la barre d'adresse du navigateur par un lien direct vers ce tiddler Permaview/Caption: permaview Permaview/Hint: Remplacer l'URL dans la barre d'adresse du navigateur par un lien direct vers l'ensemble des tiddlers présents dans le déroulé +Refresh/Caption: rafraîchir +Refresh/Hint: Rafraîchit la totalité du wiki Save/Caption: enregistrer Save/Hint: Enregistrer ce tiddler SaveWiki/Caption: enregistrer les modifications From a0e61b89a3866dba9e4e81531d38a960f6ef81f9 Mon Sep 17 00:00:00 2001 From: Xavier Cazin <xcazin@immateriel.fr> Date: Tue, 19 Aug 2014 16:52:19 +0200 Subject: [PATCH 43/61] fr-FR translation for the Drop message --- languages/fr-FR/Misc.multids | 1 + 1 file changed, 1 insertion(+) diff --git a/languages/fr-FR/Misc.multids b/languages/fr-FR/Misc.multids index 83c842546..890bc6644 100644 --- a/languages/fr-FR/Misc.multids +++ b/languages/fr-FR/Misc.multids @@ -8,6 +8,7 @@ ConfirmCancelTiddler: Souhaitez-vous annuler les modifications apportées au tid ConfirmDeleteTiddler: Souhaitez-vous supprimer le tiddler « <$text text=<<title>>/> » ? ConfirmOverwriteTiddler: Souhaitez-vous supplanter le tiddler « <$text text=<<title>>/> » ? ConfirmEditShadowTiddler: Vous êtes sur le point d'éditer un ShadowTiddler. Toute modification supplantera la version par défaut du système, rendant les prochaines mises à jour non-triviales. Êtes-vous sûr(e) de vouloir éditer "<$text text=<<title>>/>"? +DropMessage: Lâcher ici (ou appuyer sur « escape » pour annuler) InvalidFieldName: Caractères illicites dans le nom du champ « <$text text=<<fieldName>>/> ». Les champs ne peuvent contenir que des lettres minuscules non accentuées et les caractères souligné (`_`), tiret (`-`) et point (`.`) MissingTiddler/Hint: Le tiddler « <$text text=<<currentTiddler>>/> » est manquant - cliquez sur {{$:/core/images/edit-button}} pour le créer RecentChanges/DateFormat: DD MMM YYYY From 1973df0809013442c17daae10f7eaf2a6f764bba Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Tue, 19 Aug 2014 16:03:31 +0100 Subject: [PATCH 44/61] Update release note --- editions/tw5.com/tiddlers/Release 5.0.15beta.tid | 3 +++ 1 file changed, 3 insertions(+) diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid index c17d8a829..1328d5aed 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -12,12 +12,15 @@ type: text/vnd.tiddlywiki * [[Simplified|https://github.com/Jermolene/TiddlyWiki5/commit/c57b00996855f10d9b7fa2aa4e9deb2a2a607d7f]] shadow default tiddlers * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/32a7ee2683ace619599f0ab73028307ca33f4e4c]] the ability to disable plugins (see PluginMechanism) with a user interface in [[control panel|$:/ControlPanel]] * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/4b05608ad5e77043b01495825ea0f0e76c378760]] page control button for invoking the [[tag manager|$:/TagManager]] +* [[Simplified|https://github.com/Jermolene/TiddlyWiki5/commit/c4b76ceb0bc786bcceb12fc3417bb8c4bfde27a9]] downloading an offline copy of a client-server wiki !! Hackability Improvements * [[Refactored|https://github.com/Jermolene/TiddlyWiki5/commit/f75af2c983e10e8a82639890b993fb5cf042d610]] `saver-handler.js` out of `syncer.js` * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/8cf726275c19ed5b4a0ed1cf8354d64d1bc29da5]] TableOfContentsMacro support * Simplified startup module organisation (see [[Startup Modules.svg]]) +* [[Changed|https://github.com/Jermolene/TiddlyWiki5/commit/25777b147fa4ed2f915150aec503ad1e094e6043]] the overlay text for the DropzoneWidget to make it translateable +* [[Introduced|https://github.com/Jermolene/TiddlyWiki5/commit/920e11e7921f777170aa2f9e1836c000fec2e26d]] a new [[refresh button|WidgetMessage: tw-browser-refresh]] and reverted [[home button|WidgetMessage: tw-home]] behaviour !! Bug Fixes From c16f5b6b67353f208be36e5eb88f6bc58515d48a Mon Sep 17 00:00:00 2001 From: Xavier Cazin <xcazin@immateriel.fr> Date: Tue, 19 Aug 2014 17:08:15 +0200 Subject: [PATCH 45/61] Typo in RevealWidget documentation --- editions/tw5.com/tiddlers/widgets/RevealWidget.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/widgets/RevealWidget.tid b/editions/tw5.com/tiddlers/widgets/RevealWidget.tid index fe6d73333..18ecb168c 100644 --- a/editions/tw5.com/tiddlers/widgets/RevealWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/RevealWidget.tid @@ -21,7 +21,7 @@ The content of the `<$reveal>` widget is displayed according to the rules given |type |The type of matching performed: ''match'', ''nomatch'' or ''popup'' | |text |The text to match when the type is ''match'' and ''nomatch'' | |position |The position used for the popup when the type is ''popup''. Can be ''left'', ''above'', ''aboveright'', ''right'', ''belowleft'' or ''below'' | -|default |Default value to use when the state tiddler | +|default |Default value to use when the state tiddler is missing | |animate |Set to "yes" to animate opening and closure (defaults to "no") | |retain |Set to "yes" to force the content to be retained even when hidden (defaults to "no")| From fbf307c648ae0e92679c54f7d03f197a75b4e101 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 10:00:34 +0100 Subject: [PATCH 46/61] Add alt attribute to image widget --- core/modules/widgets/image.js | 4 ++++ editions/tw5.com/tiddlers/widgets/ImageWidget.tid | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/image.js b/core/modules/widgets/image.js index be2ea8b6f..1c4ba494e 100644 --- a/core/modules/widgets/image.js +++ b/core/modules/widgets/image.js @@ -105,6 +105,9 @@ ImageWidget.prototype.render = function(parent,nextSibling) { if(this.imageTooltip) { domNode.setAttribute("title",this.imageTooltip); } + if(this.imageAlt) { + domNode.setAttribute("alt",this.imageAlt); + } // Insert element parent.insertBefore(domNode,nextSibling); this.domNodes.push(domNode); @@ -120,6 +123,7 @@ ImageWidget.prototype.execute = function() { this.imageHeight = this.getAttribute("height"); this.imageClass = this.getAttribute("class"); this.imageTooltip = this.getAttribute("tooltip"); + this.imageAlt = this.getAttribute("alt"); }; /* diff --git a/editions/tw5.com/tiddlers/widgets/ImageWidget.tid b/editions/tw5.com/tiddlers/widgets/ImageWidget.tid index 6f1e1a694..d766732aa 100644 --- a/editions/tw5.com/tiddlers/widgets/ImageWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/ImageWidget.tid @@ -1,6 +1,6 @@ title: ImageWidget created: 20140416160234142 -modified: 20140611160234142 +modified: 20140820100234142 tags: widget ! Introduction @@ -16,6 +16,7 @@ Any content of the `<$image>` widget is ignored. |width |The width of the image as a number | |height |The height of the image | |tooltip |The tooltip to be displayed over the image | +|alt |The alternative text to be associated with the image | |class |CSS classes to be assigned to the `<img>` element | ! External Images and the ''_canonical_uri'' field From a105b52399b0668c7dec9c54352f62656f3f7f28 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 10:02:44 +0100 Subject: [PATCH 47/61] Refactor saver handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixing problems caused by c4b76ceb0bc786bcceb12fc3417bb8c4bfde27a9: * We still need to initialise the saver-handler even when syncing to a server, otherwise offline snapshots can’t be saved * We need to override the default save template a bit further up the stack, to avoid the server side serving the offline version of the wiki at `/` --- core/modules/saver-handler.js | 55 +++++++++++-------- core/modules/startup/startup.js | 8 +-- .../PageControls/SaveWikiButtonTemplate.tid | 3 + core/ui/PageControls/savewiki.tid | 2 +- .../tiddlyweb/SaveWikiButtonTemplate.tid | 3 + .../{save-all.tid => save-offline.tid} | 2 +- 6 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 core/ui/PageControls/SaveWikiButtonTemplate.tid create mode 100644 plugins/tiddlywiki/tiddlyweb/SaveWikiButtonTemplate.tid rename plugins/tiddlywiki/tiddlyweb/{save-all.tid => save-offline.tid} (85%) diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js index 9d5f9a973..98ff08bdb 100644 --- a/core/modules/saver-handler.js +++ b/core/modules/saver-handler.js @@ -15,43 +15,50 @@ The saver handler tracks changes to the store and handles saving the entire wiki /* Instantiate the saver handler with the following options: wiki: wiki to be synced +dirtyTracking: true if dirty tracking should be performed */ function SaverHandler(options) { var self = this; this.wiki = options.wiki; + this.dirtyTracking = options.dirtyTracking; // Make a logger this.logger = new $tw.utils.Logger("saver-handler"); // Initialise our savers if($tw.browser) { this.initSavers(); } - // Compile the dirty tiddler filter - this.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter)); - // Count of tiddlers that have been changed but not yet saved - this.numTasksInQueue = 0; - // Listen out for changes to tiddlers - this.wiki.addEventListener("change",function(changes) { - var filteredChanges = self.filterFn.call(self.wiki,function(callback) { - $tw.utils.each(changes,function(change,title) { - var tiddler = self.wiki.getTiddler(title); - callback(tiddler,title); + // Only do dirty tracking if required + if(this.dirtyTracking) { + // Compile the dirty tiddler filter + this.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter)); + // Count of tiddlers that have been changed but not yet saved + this.numTasksInQueue = 0; + // Listen out for changes to tiddlers + this.wiki.addEventListener("change",function(changes) { + var filteredChanges = self.filterFn.call(self.wiki,function(callback) { + $tw.utils.each(changes,function(change,title) { + var tiddler = self.wiki.getTiddler(title); + callback(tiddler,title); + }); }); + self.numTasksInQueue += filteredChanges.length; + self.updateDirtyStatus(); }); - self.numTasksInQueue += filteredChanges.length; - self.updateDirtyStatus(); - }); - // Browser event handlers + // Browser event handlers + if($tw.browser) { + // Set up our beforeunload handler + window.addEventListener("beforeunload",function(event) { + var confirmationMessage = undefined; + if(self.isDirty()) { + confirmationMessage = $tw.language.getString("UnsavedChangesWarning"); + event.returnValue = confirmationMessage; // Gecko + } + return confirmationMessage; + }); + } + } + // Install the save action handlers if($tw.browser) { - // Set up our beforeunload handler - window.addEventListener("beforeunload",function(event) { - var confirmationMessage = undefined; - if(self.isDirty()) { - confirmationMessage = $tw.language.getString("UnsavedChangesWarning"); - event.returnValue = confirmationMessage; // Gecko - } - return confirmationMessage; - }); - // Install the save action handlers $tw.rootWidget.addEventListener("tw-save-wiki",function(event) { self.saveWiki({ template: event.param, diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index 67c3415c1..377974ad6 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -69,12 +69,12 @@ exports.startup = function() { $tw.syncadaptor = new module.adaptorClass({wiki: $tw.wiki}); } }); - // Set up the syncer object if we've got a syncadaptor, otherwise setup the saverhandler + // Set up the syncer object if we've got a syncadaptor if($tw.syncadaptor) { $tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor}); - } else { - $tw.saverHandler = new $tw.SaverHandler({wiki: $tw.wiki}); - } + } + // Setup the saver handler + $tw.saverHandler = new $tw.SaverHandler({wiki: $tw.wiki, dirtyTracking: !$tw.syncadaptor}); // Host-specific startup if($tw.browser) { // Install the popup manager diff --git a/core/ui/PageControls/SaveWikiButtonTemplate.tid b/core/ui/PageControls/SaveWikiButtonTemplate.tid new file mode 100644 index 000000000..1daafaaed --- /dev/null +++ b/core/ui/PageControls/SaveWikiButtonTemplate.tid @@ -0,0 +1,3 @@ +title: $:/config/SaveWikiButton/Template + +$:/core/save/all \ No newline at end of file diff --git a/core/ui/PageControls/savewiki.tid b/core/ui/PageControls/savewiki.tid index a463b0034..b41a18921 100644 --- a/core/ui/PageControls/savewiki.tid +++ b/core/ui/PageControls/savewiki.tid @@ -3,7 +3,7 @@ tags: $:/tags/PageControls caption: {{$:/core/images/save-button}} {{$:/language/Buttons/SaveWiki/Caption}} description: {{$:/language/Buttons/SaveWiki/Hint}} -<$button message="tw-save-wiki" title={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tw-config-toolbar-class>>> +<$button message="tw-save-wiki" param={{$:/config/SaveWikiButton/Template}} title={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tw-config-toolbar-class>>> <span class="tw-dirty-indicator"> <$list filter="[<tw-config-toolbar-icons>prefix[yes]]"> {{$:/core/images/save-button}} diff --git a/plugins/tiddlywiki/tiddlyweb/SaveWikiButtonTemplate.tid b/plugins/tiddlywiki/tiddlyweb/SaveWikiButtonTemplate.tid new file mode 100644 index 000000000..d44f09031 --- /dev/null +++ b/plugins/tiddlywiki/tiddlyweb/SaveWikiButtonTemplate.tid @@ -0,0 +1,3 @@ +title: $:/config/SaveWikiButton/Template + +$:/plugins/tiddlywiki/tiddlyweb/save/offline \ No newline at end of file diff --git a/plugins/tiddlywiki/tiddlyweb/save-all.tid b/plugins/tiddlywiki/tiddlyweb/save-offline.tid similarity index 85% rename from plugins/tiddlywiki/tiddlyweb/save-all.tid rename to plugins/tiddlywiki/tiddlyweb/save-offline.tid index 497db85a5..af6709d43 100644 --- a/plugins/tiddlywiki/tiddlyweb/save-all.tid +++ b/plugins/tiddlywiki/tiddlyweb/save-offline.tid @@ -1,4 +1,4 @@ -title: $:/core/save/all +title: $:/plugins/tiddlywiki/tiddlyweb/save/offline \define saveTiddlerFilter() [is[tiddler]] -[[$:/boot/boot.css]] -[[$:/HistoryList]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] +[sort[title]] From 1075bd20841455178bec19252a92e3785862769d Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 10:03:40 +0100 Subject: [PATCH 48/61] Add content to "Contents" tiddler Leaving it with no text content means that it triggers a lazy load with the client server edition --- .../tw5.com/tiddlers/samples/TableOfContents/Contents.tid | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid b/editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid index dd8e3b769..62d806068 100644 --- a/editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid +++ b/editions/tw5.com/tiddlers/samples/TableOfContents/Contents.tid @@ -1,2 +1,6 @@ title: Contents list: First Second Third Fourth + +Sample data for TableOfContentsMacro. + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file From c912fed55d94c9bef2d541cd55f458b12172941c Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 10:11:40 +0100 Subject: [PATCH 49/61] Use a JSON tiddler for $:/config/OriginalTiddlerPaths Otherwise things go wrong when we have tiddler titles containing colons --- boot/boot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index d417f3ae1..a28aab306 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1593,11 +1593,11 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) { // Save the original tiddler file locations if requested var config = wikiInfo.config || {}; if(config["retain-original-tiddler-path"]) { - var output = []; + var output = {}; for(var title in $tw.boot.files) { - output.push(title + ": " + path.relative(resolvedWikiPath,$tw.boot.files[title].filepath) + "\n"); + output[title] = path.relative(resolvedWikiPath,$tw.boot.files[title].filepath); } - $tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/x-tiddler-dictionary", text: output.join("")}); + $tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/json", text: JSON.stringify(output)}); } // Save the path to the tiddlers folder for the filesystemadaptor $tw.boot.wikiTiddlersPath = path.resolve($tw.boot.wikiPath,config["default-tiddler-location"] || $tw.config.wikiTiddlersSubDir); From 4e65bbc4057281472ec489e731dba856119ecabd Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 11:25:30 +0100 Subject: [PATCH 50/61] Add star image --- core/images/star-filled.tid | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 core/images/star-filled.tid diff --git a/core/images/star-filled.tid b/core/images/star-filled.tid new file mode 100644 index 000000000..1ca7ad3b2 --- /dev/null +++ b/core/images/star-filled.tid @@ -0,0 +1,8 @@ +title: $:/core/images/star-filled +tags: $:/tags/Image + +<svg class="tw-image-star-filled tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128"> + <g fill-rule="evenodd"> + <path d="M62.3192234,96.8228569 L99.9374795,124.110219 C102.679795,126.099427 106.366514,123.420868 105.322087,120.198072 L90.9949441,75.9887263 L89.7248325,79.8977279 L127.301336,52.5528988 C130.040608,50.5595011 128.632406,46.2255025 125.244599,46.2229134 L78.7716818,46.1873965 L82.0968772,48.6032923 L67.7021774,4.41589688 C66.652825,1.19470104 62.0957892,1.19470104 61.0464369,4.41589688 L46.6517371,48.6032923 L49.9769325,46.1873965 L3.50401521,46.2229134 C0.116208212,46.2255025 -1.2919933,50.5595011 1.44727829,52.5528988 L39.0237818,79.8977279 L37.7536702,75.9887263 L23.4265276,120.198072 C22.3821,123.420868 26.0688195,126.099427 28.8111347,124.110219 L66.4293909,96.8228569 L62.3192234,96.8228569 Z"></path> + </g> +</svg> \ No newline at end of file From b0c6babd8d2a28b27f3c80be665a25569766ea1b Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 11:25:56 +0100 Subject: [PATCH 51/61] Add banner soliciting documentation improvements A first pass --- .../tiddlers/system/ViewTemplateSources.tid | 14 ++++++++++++++ .../tw5.com/tiddlers/system/tw5.com-styles.tid | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 editions/tw5.com/tiddlers/system/ViewTemplateSources.tid diff --git a/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid b/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid new file mode 100644 index 000000000..516ad7699 --- /dev/null +++ b/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid @@ -0,0 +1,14 @@ +title: $:/editions/tw5.com/ViewTemplate/Sources +tags: $:/tags/ViewTemplate + +\define makeGitHubLink() +https://github.com/Jermolene/TiddlyWiki5/blob/master/editions/tw5.com/tiddlers/$(githubLink)$ +\end +\define outerMakeGitHubLink(linkText) +<$set name="githubLink" value={{$:/config/OriginalTiddlerPaths##$(currentTiddler)$}}> +<a href=<<makeGitHubLink>> class="tw-tiddlylink-external" target="_blank">$linkText$</a> +</$set> +\end +<div class="tw-improvement-banner"> +{{$:/core/images/star-filled}} Can you help improve this documentation? [[Find out how|Improving TiddlyWiki Documentation]] to edit <<outerMakeGitHubLink "this tiddler">> +</div> diff --git a/editions/tw5.com/tiddlers/system/tw5.com-styles.tid b/editions/tw5.com/tiddlers/system/tw5.com-styles.tid index c3cc7dfad..3ab55cf12 100644 --- a/editions/tw5.com/tiddlers/system/tw5.com-styles.tid +++ b/editions/tw5.com/tiddlers/system/tw5.com-styles.tid @@ -41,3 +41,12 @@ tags: $:/tags/stylesheet padding: 1em; height: 400px; } + +.tw-improvement-banner { + font-size: 0.7em; +} + +.tw-improvement-banner svg { + width: 1em; + height: 1em; +} From 2bbe9f76ecf8fc89c789e72be00ac19e811195ee Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 13:52:59 +0100 Subject: [PATCH 52/61] Block temporary state tiddlers from import/upgrade --- core/language/en-GB/Import.multids | 1 + core/modules/upgraders/system.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/language/en-GB/Import.multids b/core/language/en-GB/Import.multids index d5dea4680..536ace2aa 100644 --- a/core/language/en-GB/Import.multids +++ b/core/language/en-GB/Import.multids @@ -9,5 +9,6 @@ Listing/Title/Caption: Title Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>) Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>> +Upgrader/State/Suppressed: Blocked temporary state tiddler Upgrader/System/Suppressed: Blocked system tiddler Upgrader/ThemeTweaks/Created: Migrated theme tweak from <$text text=<<from>>/> diff --git a/core/modules/upgraders/system.js b/core/modules/upgraders/system.js index bed53b47b..3dae00422 100644 --- a/core/modules/upgraders/system.js +++ b/core/modules/upgraders/system.js @@ -12,7 +12,8 @@ Upgrader module that suppresses certain system tiddlers that shouldn't be import /*global $tw: false */ "use strict"; -var DONT_IMPORT_LIST = ["$:/StoryList","$:/HistoryList"]; +var DONT_IMPORT_LIST = ["$:/StoryList","$:/HistoryList"], + DONT_IMPORT_PREFIX_LIST = ["$:/temp/","$:/state/"]; exports.upgrade = function(wiki,titles,tiddlers) { var self = this, @@ -22,6 +23,14 @@ exports.upgrade = function(wiki,titles,tiddlers) { if(DONT_IMPORT_LIST.indexOf(title) !== -1) { tiddlers[title] = Object.create(null); messages[title] = $tw.language.getString("Import/Upgrader/System/Suppressed"); + } else { + for(var t=0; t<DONT_IMPORT_PREFIX_LIST.length; t++) { + var prefix = DONT_IMPORT_PREFIX_LIST[t]; + if(title.substr(0,prefix.length) === prefix) { + tiddlers[title] = Object.create(null); + messages[title] = $tw.language.getString("Import/Upgrader/State/Suppressed"); + } + } } }); return messages; From 56bf3924f5b72370db618e063674a0b7791cb66b Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 17:06:39 +0100 Subject: [PATCH 53/61] Tweaks to the improvement banner I think it looks pretty terrible, and am minded not to include it in 5.0.15. Interested in other views. --- .../Improving TiddlyWiki Documentation.tid | 7 ++++ .../tiddlers/system/ViewTemplateSources.tid | 2 +- .../tiddlers/system/tw5.com-styles.tid | 35 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid diff --git a/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid b/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid new file mode 100644 index 000000000..c1097b3a5 --- /dev/null +++ b/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid @@ -0,0 +1,7 @@ +title: Improving TiddlyWiki Documentation +tags: howto +created: 20140820151051019 +modified: 20140820151051019 + +Anyone can submit improvements to the TiddlyWiki documentation that appears on http://tiddlywiki.com. + diff --git a/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid b/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid index 516ad7699..3697492cd 100644 --- a/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid +++ b/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid @@ -10,5 +10,5 @@ https://github.com/Jermolene/TiddlyWiki5/blob/master/editions/tw5.com/tiddlers/$ </$set> \end <div class="tw-improvement-banner"> -{{$:/core/images/star-filled}} Can you help improve this documentation? [[Find out how|Improving TiddlyWiki Documentation]] to edit <<outerMakeGitHubLink "this tiddler">> +{{$:/core/images/star-filled}} Can you help us improve this documentation? [[Find out how|Improving TiddlyWiki Documentation]] to edit <<outerMakeGitHubLink "this tiddler on ~GitHub">> </div> diff --git a/editions/tw5.com/tiddlers/system/tw5.com-styles.tid b/editions/tw5.com/tiddlers/system/tw5.com-styles.tid index 3ab55cf12..87b8f766e 100644 --- a/editions/tw5.com/tiddlers/system/tw5.com-styles.tid +++ b/editions/tw5.com/tiddlers/system/tw5.com-styles.tid @@ -44,6 +44,41 @@ tags: $:/tags/stylesheet .tw-improvement-banner { font-size: 0.7em; + background: #fcc; + padding-left: 5px; + <<box-shadow "2px 2px 2px rgba(0,0,0,0.4)">> +} + +@media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) { + + .tw-improvement-banner { + margin-top: 15px; + } + +} + +@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) { + + .tw-improvement-banner { + margin-right: -23px; + margin-bottom: -20px; + margin-left: -53px; + } + + .tw-improvement-banner:before { + display: block; + position: absolute; + width: 0; + height: 0; + content: " "; + margin-left: -5px; + margin-top: -10px; + border-top: 5px solid transparent; + border-left: 5px solid transparent; + border-right: 5px solid #C07E7E; + border-bottom: 5px solid #C07E7E; + } + } .tw-improvement-banner svg { From 73ef104b113dd6bd3f44d3b31a25a9f8d847a42a Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 20:46:24 +0100 Subject: [PATCH 54/61] Fix regression with tag label styling in edit template --- themes/tiddlywiki/vanilla/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 7a1175d9e..9a0701138 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -317,7 +317,7 @@ button svg.tw-image-button, button .tw-image-button img { vertical-align: baseline; } -button.tw-tag-label { +button.tw-tag-label, span.tw-tag-label { display: inline-block; padding: 2px 9px; font-size: 0.9em; From 34d22f631da0a5f6b4482a710c95b16c95c886c8 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 20:46:59 +0100 Subject: [PATCH 55/61] Temporarily disable the improvement banner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should perhaps discuss this at the next hangout… --- editions/tw5.com/tiddlers/system/ViewTemplateSources.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid b/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid index 3697492cd..409fa299d 100644 --- a/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid +++ b/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid @@ -1,5 +1,5 @@ title: $:/editions/tw5.com/ViewTemplate/Sources -tags: $:/tags/ViewTemplate +tags: not-$:/tags/ViewTemplate \define makeGitHubLink() https://github.com/Jermolene/TiddlyWiki5/blob/master/editions/tw5.com/tiddlers/$(githubLink)$ From 085e60c0f79986770ba76a3fe1233263c3ebaa5a Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 22:07:12 +0100 Subject: [PATCH 56/61] Improved documentation on improving the documentation --- .../howtos/Improving TiddlyWiki Documentation.tid | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid b/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid index c1097b3a5..1fd13a76a 100644 --- a/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid +++ b/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid @@ -5,3 +5,15 @@ modified: 20140820151051019 Anyone can submit improvements to the TiddlyWiki documentation that appears on http://tiddlywiki.com. +# Create an account on https://github.com if you don't already have one +# On http://tiddlywiki.com, click "edit" on the tiddler you want to improve +# You should see a pink banner with the text: //Can you help us improve this documentation? Find out how to edit this tiddler on GitHub// +# Click on the external link ...''this tiddler on ~GitHub'' +# A new browser tab should open ready to edit the tiddler on github.com +# Below the edit box for the tiddler text you should see a box labelled ''Propose file change'' +# Enter a brief title to explain the change (eg, "Clarify attribute syntax instability") +# If necessary, enter a longer description too +# Click the green button labelled ''Propose file change'' +# On the following screen, click the green button labelled ''Create pull request'' + +[[Jermolene|https://github.com/Jermolene]] or one of the other core developers will then have the opportunity to merge your pull request so that it is incorporated into the next build of http://tiddlywiki.com. From bbd0f7841b4ffb768cffefecf17d40a4e445a125 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 22:07:39 +0100 Subject: [PATCH 57/61] Move improvement banner to the edit template Thanks to @xcazin for the most excellent suggestion. --- ...mplateSources.tid => EditTemplateSources.tid} | 16 +++++++++++----- .../tw5.com/tiddlers/system/tw5.com-styles.tid | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) rename editions/tw5.com/tiddlers/system/{ViewTemplateSources.tid => EditTemplateSources.tid} (57%) diff --git a/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid b/editions/tw5.com/tiddlers/system/EditTemplateSources.tid similarity index 57% rename from editions/tw5.com/tiddlers/system/ViewTemplateSources.tid rename to editions/tw5.com/tiddlers/system/EditTemplateSources.tid index 409fa299d..0ce4e58b5 100644 --- a/editions/tw5.com/tiddlers/system/ViewTemplateSources.tid +++ b/editions/tw5.com/tiddlers/system/EditTemplateSources.tid @@ -1,12 +1,18 @@ -title: $:/editions/tw5.com/ViewTemplate/Sources -tags: not-$:/tags/ViewTemplate +title: $:/editions/tw5.com/EditTemplate/Sources +tags: $:/tags/EditTemplate +list-after: $:/core/ui/EditTemplate/title \define makeGitHubLink() -https://github.com/Jermolene/TiddlyWiki5/blob/master/editions/tw5.com/tiddlers/$(githubLink)$ +https://github.com/Jermolene/TiddlyWiki5/edit/master/editions/tw5.com/tiddlers/$(githubLink)$ +\end +\define innerMakeGitHubLink(linkText) +<$set name="githubLink" value={{$:/config/OriginalTiddlerPaths##$(draftOfTiddler)$}}> +<a href=<<makeGitHubLink>> class="tw-tiddlylink-external" target="_blank">$linkText$</a> +</$set> \end \define outerMakeGitHubLink(linkText) -<$set name="githubLink" value={{$:/config/OriginalTiddlerPaths##$(currentTiddler)$}}> -<a href=<<makeGitHubLink>> class="tw-tiddlylink-external" target="_blank">$linkText$</a> +<$set name="draftOfTiddler" value={{$(currentTiddler)$!!draft.of}}> +<<innerMakeGitHubLink "$linkText$">> </$set> \end <div class="tw-improvement-banner"> diff --git a/editions/tw5.com/tiddlers/system/tw5.com-styles.tid b/editions/tw5.com/tiddlers/system/tw5.com-styles.tid index 87b8f766e..8a49e0349 100644 --- a/editions/tw5.com/tiddlers/system/tw5.com-styles.tid +++ b/editions/tw5.com/tiddlers/system/tw5.com-styles.tid @@ -46,13 +46,14 @@ tags: $:/tags/stylesheet font-size: 0.7em; background: #fcc; padding-left: 5px; + margin-top: 6px; + margin-bottom: 12px; <<box-shadow "2px 2px 2px rgba(0,0,0,0.4)">> } @media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) { .tw-improvement-banner { - margin-top: 15px; } } @@ -61,7 +62,6 @@ tags: $:/tags/stylesheet .tw-improvement-banner { margin-right: -23px; - margin-bottom: -20px; margin-left: -53px; } From 7c3bac478099ca6a3cd2fbd09be2bd009ac73e38 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 22:25:33 +0100 Subject: [PATCH 58/61] Fix fill star icon --- core/images/star-filled.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/images/star-filled.tid b/core/images/star-filled.tid index 1ca7ad3b2..11b43c2e4 100644 --- a/core/images/star-filled.tid +++ b/core/images/star-filled.tid @@ -2,7 +2,7 @@ title: $:/core/images/star-filled tags: $:/tags/Image <svg class="tw-image-star-filled tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128"> - <g fill-rule="evenodd"> - <path d="M62.3192234,96.8228569 L99.9374795,124.110219 C102.679795,126.099427 106.366514,123.420868 105.322087,120.198072 L90.9949441,75.9887263 L89.7248325,79.8977279 L127.301336,52.5528988 C130.040608,50.5595011 128.632406,46.2255025 125.244599,46.2229134 L78.7716818,46.1873965 L82.0968772,48.6032923 L67.7021774,4.41589688 C66.652825,1.19470104 62.0957892,1.19470104 61.0464369,4.41589688 L46.6517371,48.6032923 L49.9769325,46.1873965 L3.50401521,46.2229134 C0.116208212,46.2255025 -1.2919933,50.5595011 1.44727829,52.5528988 L39.0237818,79.8977279 L37.7536702,75.9887263 L23.4265276,120.198072 C22.3821,123.420868 26.0688195,126.099427 28.8111347,124.110219 L66.4293909,96.8228569 L62.3192234,96.8228569 Z"></path> + <g fill-rule="nonzero"> + <path d="M61.8361286,96.8228569 L99.1627704,124.110219 C101.883827,126.099427 105.541968,123.420868 104.505636,120.198072 L90.2895569,75.9887263 L89.0292911,79.8977279 L126.314504,52.5528988 C129.032541,50.5595011 127.635256,46.2255025 124.273711,46.2229134 L78.1610486,46.1873965 L81.4604673,48.6032923 L67.1773543,4.41589688 C66.1361365,1.19470104 61.6144265,1.19470104 60.5732087,4.41589688 L46.2900957,48.6032923 L49.5895144,46.1873965 L3.47685231,46.2229134 C0.115307373,46.2255025 -1.28197785,50.5595011 1.43605908,52.5528988 L38.7212719,79.8977279 L37.4610061,75.9887263 L23.2449266,120.198072 C22.2085954,123.420868 25.8667356,126.099427 28.5877926,124.110219 L65.9144344,96.8228569 L61.8361286,96.8228569 Z"></path> </g> </svg> \ No newline at end of file From 81a426659e014013225fd4434bf3baeeb0be48ed Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 22:25:55 +0100 Subject: [PATCH 59/61] Extraneous wikilink in docs --- .../tiddlers/howtos/Improving TiddlyWiki Documentation.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid b/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid index 1fd13a76a..3dd1a9bdf 100644 --- a/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid +++ b/editions/tw5.com/tiddlers/howtos/Improving TiddlyWiki Documentation.tid @@ -7,7 +7,7 @@ Anyone can submit improvements to the TiddlyWiki documentation that appears on h # Create an account on https://github.com if you don't already have one # On http://tiddlywiki.com, click "edit" on the tiddler you want to improve -# You should see a pink banner with the text: //Can you help us improve this documentation? Find out how to edit this tiddler on GitHub// +# You should see a pink banner with the text: //Can you help us improve this documentation? Find out how to edit this tiddler on ~GitHub// # Click on the external link ...''this tiddler on ~GitHub'' # A new browser tab should open ready to edit the tiddler on github.com # Below the edit box for the tiddler text you should see a box labelled ''Propose file change'' From 8041e3bef2e59cb077b962c1314c0f454d653ed2 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 22:48:07 +0100 Subject: [PATCH 60/61] Add a sort parameter to the TOC macro As requested by @giffmex --- core/wiki/macros/toc.tid | 24 +++++++++---------- ...ontentsMacro Sorted Expandable Example.tid | 11 +++++++++ .../tiddlers/macros/TableOfContentsMacro.tid | 7 ++++++ 3 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 editions/tw5.com/tiddlers/macros/TableOfContentsMacro Sorted Expandable Example.tid diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 6db9512ce..08204c334 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -1,9 +1,9 @@ title: $:/core/macros/toc tags: $:/tags/Macro -\define toc(tag) +\define toc(tag,sort:"") <ol> -<$list filter="[tag[$tag$]]"> +<$list filter="[tag[$tag$]$sort$]"> <li> <$link> <$view field="title"/> @@ -14,7 +14,7 @@ tags: $:/tags/Macro </ol> \end -\define toc-expandable-body(tag,show-button-filter) +\define toc-expandable-body(tag,sort:"") <$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>> <li> <$link> @@ -31,21 +31,21 @@ tags: $:/tags/Macro <$view field="title"/> </$link> <$reveal type="match" state=<<toc-state>> text="open"> -<$macrocall $name="toc-expandable" tag=<<currentTiddler>>/> +<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="$sort$"/> </$reveal> </li> </$set> \end -\define toc-expandable(tag) +\define toc-expandable(tag,sort:"") <ol> -<$list filter="[tag[$tag$]]"> -<<toc-expandable-body tag:"$tag$">> +<$list filter="[tag[$tag$]$sort$]"> +<<toc-expandable-body tag:"$tag$" sort:"$sort$">> </$list> </ol> \end -\define toc-selective-expandable-body(tag,show-button-filter) +\define toc-selective-expandable-body(tag,sort:"") <$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>> <li> <$link> @@ -64,16 +64,16 @@ tags: $:/tags/Macro <$view field="title"/> </$link> <$reveal type="match" state=<<toc-state>> text="open"> -<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>>/> +<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="$sort$"/> </$reveal> </li> </$set> \end -\define toc-selective-expandable(tag) +\define toc-selective-expandable(tag,sort:"") <ol> -<$list filter="[tag[$tag$]]"> -<<toc-selective-expandable-body tag:"$tag$">> +<$list filter="[tag[$tag$]$sort$]"> +<<toc-selective-expandable-body tag:"$tag$" sort:"$sort$">> </$list> </ol> \end diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Sorted Expandable Example.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Sorted Expandable Example.tid new file mode 100644 index 000000000..ec3a50dfa --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro Sorted Expandable Example.tid @@ -0,0 +1,11 @@ +title: TableOfContentsMacro Sorted Expandable Example +caption: Sorted Expandable +tags: table-of-contents-example + +!! Sorted Expandable Table of Contents + +<$macrocall $name="wikitext-example-without-html" +src="<div class='tw-table-of-contents'> +<<toc-expandable 'Contents' 'sort[title]'>> +</div> +"/> diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid index 39f324ae6..73e56ff38 100644 --- a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid @@ -16,6 +16,13 @@ There are several variants of the macro: |!Position |!Name |!Description |!Default | |1st |tag |The root tag that identifies the top level of the hierarchy | | +|2nd |sort |Optional sorting subfilter (eg `sort[title]`) | | + +The ''tag'' and ''sort'' parameters are combined to make a filter expression of the form: + +``` +[tag[$tag$]$sort$] +``` ! Examples From d0654c3211288f841c93cf4cfadc56c5cd1998ef Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 20 Aug 2014 22:56:25 +0100 Subject: [PATCH 61/61] Docs updates for 5.0.15 --- editions/tw5.com/tiddlers/HelloThere.tid | 2 +- editions/tw5.com/tiddlers/Release 5.0.15beta.tid | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/HelloThere.tid b/editions/tw5.com/tiddlers/HelloThere.tid index 92bce4cf5..69c5191a8 100644 --- a/editions/tw5.com/tiddlers/HelloThere.tid +++ b/editions/tw5.com/tiddlers/HelloThere.tid @@ -1,5 +1,5 @@ created: 20130822170200000 -modified: 20140813164027280 +modified: 20140820153116300 tags: introduction title: HelloThere type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid index 1328d5aed..5b5445a58 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -1,9 +1,10 @@ caption: 5.0.15-beta created: 20140812150234142 -modified: 20140818153116300 +modified: 20140820153116300 tags: releasenote title: Release 5.0.15-beta type: text/vnd.tiddlywiki +released: 201408202255 //[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.14-beta...v5.0.15-beta]]// @@ -13,14 +14,17 @@ type: text/vnd.tiddlywiki * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/32a7ee2683ace619599f0ab73028307ca33f4e4c]] the ability to disable plugins (see PluginMechanism) with a user interface in [[control panel|$:/ControlPanel]] * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/4b05608ad5e77043b01495825ea0f0e76c378760]] page control button for invoking the [[tag manager|$:/TagManager]] * [[Simplified|https://github.com/Jermolene/TiddlyWiki5/commit/c4b76ceb0bc786bcceb12fc3417bb8c4bfde27a9]] downloading an offline copy of a client-server wiki +* [[Blocked|https://github.com/Jermolene/TiddlyWiki5/commit/2bbe9f76ecf8fc89c789e72be00ac19e811195ee]] temporary state tiddlers from import/upgrade !! Hackability Improvements +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/c912fed55d94c9bef2d541cd55f458b12172941c]] a banner to the edit template encouraging improvements to the documentation * [[Refactored|https://github.com/Jermolene/TiddlyWiki5/commit/f75af2c983e10e8a82639890b993fb5cf042d610]] `saver-handler.js` out of `syncer.js` * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/8cf726275c19ed5b4a0ed1cf8354d64d1bc29da5]] TableOfContentsMacro support * Simplified startup module organisation (see [[Startup Modules.svg]]) * [[Changed|https://github.com/Jermolene/TiddlyWiki5/commit/25777b147fa4ed2f915150aec503ad1e094e6043]] the overlay text for the DropzoneWidget to make it translateable * [[Introduced|https://github.com/Jermolene/TiddlyWiki5/commit/920e11e7921f777170aa2f9e1836c000fec2e26d]] a new [[refresh button|WidgetMessage: tw-browser-refresh]] and reverted [[home button|WidgetMessage: tw-home]] behaviour +* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/fbf307c648ae0e92679c54f7d03f197a75b4e101]] ''alt'' attribute to the ImageWidget !! Bug Fixes @@ -29,6 +33,7 @@ type: text/vnd.tiddlywiki * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/9e85ddfec78dd8df71e6173100dce659417551f4]] missing language flag in ''empty.html'' * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/18592fe8f810d1858ca040da1a7c4a81fb74cfed]] problem with switching the type of a tiddler between the bitmap and text editor * [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/fe6623d7feed1a9068e15bfac57be0b0924e8915]] foreground colour for tag pills in the sidebar +* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/c912fed55d94c9bef2d541cd55f458b12172941c]] problem with github source links for tiddlywiki.com not working for titles containing colons !! Contributors