From a773bcbc984373c65bf1661e930cbfab5ad82498 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Thu, 14 Aug 2014 12:38:26 +0200 Subject: [PATCH 01/14] translation for german CoreReadMe --- languages/de-DE/CoreReadMe.tid | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/languages/de-DE/CoreReadMe.tid b/languages/de-DE/CoreReadMe.tid index 571421d0e..9fdc3c906 100644 --- a/languages/de-DE/CoreReadMe.tid +++ b/languages/de-DE/CoreReadMe.tid @@ -1,5 +1,9 @@ title: $:/core/de-DE/readme - +Dieses Plugin enthält die TiddlyWiki Basis Komponenten, bestehend aus: + +* JavaScript Code Module. +* Piktogramme (icons). +* Vorlagen, die benötigt werden um die TiddlyWiki Oberfläche zu erstellen. +* British English (''en-GB'') übersetzbare Texte, die von der TW Basis Software verwendet werden. -{{$:/core/readme}} From 3e281bc35ed8b8c7a27e14d0791a9693c79ecadc Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sun, 24 Aug 2014 12:59:41 +0200 Subject: [PATCH 02/14] german translations including Aug 20, 2014 --- languages/de-DE/Buttons.multids | 8 +++++--- languages/de-DE/ControlPanel.multids | 6 ++++++ languages/de-DE/CoreReadMe.tid | 1 - languages/de-DE/Import.multids | 1 + languages/de-DE/Misc.multids | 2 ++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/languages/de-DE/Buttons.multids b/languages/de-DE/Buttons.multids index 2fbde2f6f..020d25308 100644 --- a/languages/de-DE/Buttons.multids +++ b/languages/de-DE/Buttons.multids @@ -31,7 +31,7 @@ Import/Hint: Importiere Dateien Info/Caption: info Info/Hint: Informationen zu diesem Tiddler anzeigen Home/Caption: home -Home/Hint: Seite neu laden und öffne die standard (default) Tiddler +Home/Hint: Öffnen der standard (default) Tiddler Language/Caption: sprache Language/Hint: Auswahl Dialog für die System Sprache NewTiddler/Caption: neuer Tiddler @@ -42,6 +42,8 @@ Permalink/Caption: permalink Permalink/Hint: Die Browser Address Leiste enthält einen Link zu diesem Tiddler Permaview/Caption: permaview Permaview/Hint: Die Browser Address Leiste enthält einen Link zu allen offenen Tiddlern in dieser "Story" +Refresh/Caption: aktualisieren +Refresh/Hint: Die Seite wird neu in den Browser geladen Save/Caption: speichern Save/Hint: Speichere diesen Tiddler SaveWiki/Caption: speichere Änderungen @@ -52,7 +54,7 @@ HideSideBar/Caption: Sidebar ausblenden HideSideBar/Hint: Sidebar ausblenden ShowSideBar/Caption: Sidebar einblenden ShowSideBar/Hint: Sidebar eiblenden -TagManager/Caption: tag manager -TagManager/Hint: Öffne das "Tag Manager" +TagManager/Caption: Tag Manager +TagManager/Hint: Öffne den "Tag Manager" Theme/Caption: Thema Theme/Hint: Thema auswählen diff --git a/languages/de-DE/ControlPanel.multids b/languages/de-DE/ControlPanel.multids index 77d7e80c8..637211c76 100644 --- a/languages/de-DE/ControlPanel.multids +++ b/languages/de-DE/ControlPanel.multids @@ -64,6 +64,12 @@ Basics/Title/Prompt: Titel dieses ~TiddlyWikis: Basics/Username/Prompt: Benutzer Signatur zum editieren: Basics/Version/Prompt: ~TiddlyWiki Version: Plugins/Caption: Plugins +Plugins/Disable/Caption: deaktivieren +Plugins/Disable/Hint: Deaktivieren sie dieses Plugin beim nächsten Laden der Seite. +Plugins/Disabled/Status: (deaktiviert) +Plugins/Empty/Hint: keine +Plugins/Enable/Caption: aktivieren +Plugins/Enable/Hint: Aktivieren sie dieses Plugin beim nächsten Laden der Seite. Plugins/Language/Prompt: Sprachen Plugins/Plugin/Prompt: Plugins Plugins/Theme/Prompt: Themen diff --git a/languages/de-DE/CoreReadMe.tid b/languages/de-DE/CoreReadMe.tid index 9fdc3c906..7cee41961 100644 --- a/languages/de-DE/CoreReadMe.tid +++ b/languages/de-DE/CoreReadMe.tid @@ -6,4 +6,3 @@ Dieses Plugin enthält die TiddlyWiki Basis Komponenten, bestehend aus: * Piktogramme (icons). * Vorlagen, die benötigt werden um die TiddlyWiki Oberfläche zu erstellen. * British English (''en-GB'') übersetzbare Texte, die von der TW Basis Software verwendet werden. - diff --git a/languages/de-DE/Import.multids b/languages/de-DE/Import.multids index f91f92263..14da4af87 100644 --- a/languages/de-DE/Import.multids +++ b/languages/de-DE/Import.multids @@ -9,5 +9,6 @@ Listing/Title/Caption: Titel Upgrader/Plugins/Suppressed/Incompatible: Unterdrückte, inkompatible oder veraltete "plugins" Upgrader/Plugins/Suppressed/Version: Einige "plugins" weden unterdrückt! Importierte plugins: <> sind älter als existierende: <>. Upgrader/Plugins/Upgraded: Aktualisieren der plugins von: <> nach: <> +Upgrader/State/Suppressed: Unterdrückte temporäre Status Tiddler Upgrader/System/Suppressed: Unterdrückte "System Tiddler" Upgrader/ThemeTweaks/Created: Migrieren der "theme tweaks" von: <$text text=<>/> diff --git a/languages/de-DE/Misc.multids b/languages/de-DE/Misc.multids index beb3d139e..4cb319c26 100644 --- a/languages/de-DE/Misc.multids +++ b/languages/de-DE/Misc.multids @@ -8,6 +8,7 @@ ConfirmCancelTiddler: Wollen sie die Änderungen im Tiddler: "<$text text=<>/>" löschen? ConfirmOverwriteTiddler: Tiddler: "<$text text=<>/>" existiert! OK überschreibt den tiddler! ConfirmEditShadowTiddler: Sie sind dabei, einen Schatten-Tiddler zu verändern. Zukünftige, automatische Anpassungen werden dadurch unterdrückt. Sie können ihre Änderungen rückgängig machen, indem sie diesen Tiddler wieder löschen. Wollen sie den Tiddler: "<$text text=<<title>>/>" ändern? +DropMessage: Hierher ziehen (oder Escape um abzubrechen) InvalidFieldName: Das Feld: "<$text text=<<fieldName>>/>" enthält illegale Zeichen. Felder müssen klein geschrieben werden. Erlaubte Sonderzeichen sind: Zahlen, Unterstrich (`_`), Minus (`-`) und Punkt (`.`). MissingTiddler/Hint: Fehlender Tiddler "<$text text=<<currentTiddler>>/>" - klicken sie {{$:/core/images/edit-button}} um ihn zu erzeugen. RecentChanges/DateFormat: DDth MMM YYYY @@ -30,3 +31,4 @@ TagManager/Colour/Heading: Farbe TagManager/Count/Heading: Anzahl TagManager/Icon/Heading: Symbol TagManager/Tag/Heading: Tag +UnsavedChangesWarning: TiddlyWiki wurde geändert, aber noch nicht gespeichert! \ No newline at end of file From a24516be2ae383a15003249ac002fc0a82f05dc5 Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Sun, 24 Aug 2014 13:14:36 +0200 Subject: [PATCH 03/14] some cosmetic changes --- languages/de-DE/Buttons.multids | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/languages/de-DE/Buttons.multids b/languages/de-DE/Buttons.multids index 020d25308..97c3b3ee5 100644 --- a/languages/de-DE/Buttons.multids +++ b/languages/de-DE/Buttons.multids @@ -24,15 +24,15 @@ Encryption/ClearPassword/Caption: lösche Passwort Encryption/ClearPassword/Hint: Lösche das Passwort und speichere ohne Verschlüsselung Encryption/SetPassword/Caption: ativiere Passwort Encryption/SetPassword/Hint: Definiert ein Passwort, um dieses Wiki zu verschlüsseln -FullScreen/Caption: vollbild +FullScreen/Caption: Vollbild FullScreen/Hint: Aktivieren oder deaktivieren des Vollbild modus -Import/Caption: import +Import/Caption: Import Import/Hint: Importiere Dateien Info/Caption: info Info/Hint: Informationen zu diesem Tiddler anzeigen Home/Caption: home Home/Hint: Öffnen der standard (default) Tiddler -Language/Caption: sprache +Language/Caption: Sprache Language/Hint: Auswahl Dialog für die System Sprache NewTiddler/Caption: neuer Tiddler NewTiddler/Hint: Erstelle einen neuen Tiddler @@ -46,9 +46,9 @@ Refresh/Caption: aktualisieren Refresh/Hint: Die Seite wird neu in den Browser geladen Save/Caption: speichern Save/Hint: Speichere diesen Tiddler -SaveWiki/Caption: speichere Änderungen -SaveWiki/Hint: Speichere Änderungen -StoryView/Caption: story Modus +SaveWiki/Caption: Speichern +SaveWiki/Hint: Das Wiki speichern +StoryView/Caption: Story Modus StoryView/Hint: Auswahl des Anzeige Modus für die "Story" HideSideBar/Caption: Sidebar ausblenden HideSideBar/Hint: Sidebar ausblenden From 372fa040c54cee3e9b9cfdfa06c90331a6353b02 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Tue, 26 Aug 2014 14:17:41 +0100 Subject: [PATCH 04/14] Preparing for 5.0.16 --- .../tw5.com/tiddlers/Release 5.0.16beta.tid | 27 +++++++++++++++++++ package.json | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 editions/tw5.com/tiddlers/Release 5.0.16beta.tid diff --git a/editions/tw5.com/tiddlers/Release 5.0.16beta.tid b/editions/tw5.com/tiddlers/Release 5.0.16beta.tid new file mode 100644 index 000000000..14f997b58 --- /dev/null +++ b/editions/tw5.com/tiddlers/Release 5.0.16beta.tid @@ -0,0 +1,27 @@ +caption: 5.0.16-beta +created: 20140826131615798 +modified: 20140826131615798 +tags: releasenote +title: Release 5.0.16-beta +type: text/vnd.tiddlywiki + +//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.15-beta...v5.0.16-beta]]// + +!! Usability Improvements + +* + +!! Hackability Improvements + +* + +!! Bug Fixes + +* + +!! Contributors + +[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki: + +* [[@BramChen|https://github.com/BramChen]] +* [[@xcazin|https://github.com/xcazin]] diff --git a/package.json b/package.json index 2982f7fbc..3ec76bd3c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tiddlywiki", "preferGlobal": "true", - "version": "5.0.15-beta", + "version": "5.0.16-prerelease", "author": "Jeremy Ruston <jeremy@jermolene.com>", "description": "a non-linear personal web notebook", "contributors": [ From ba087c96c2a37bf0d3a9d176becb7dfd0cd50ea5 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Tue, 26 Aug 2014 14:17:57 +0100 Subject: [PATCH 05/14] Sorry @xcazin I missed you off the last release note --- 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 5b5445a58..1a139541a 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -40,3 +40,4 @@ released: 201408202255 [[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki: * [[@BramChen|https://github.com/BramChen]] +* [[@xcazin|https://github.com/xcazin]] From e47852cb141b384ad2a9097eca795545cb5b2494 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Tue, 26 Aug 2014 14:19:12 +0100 Subject: [PATCH 06/14] Stop clearing the location hash for tw-browser-refresh --- core/modules/startup/story.js | 1 - .../tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index fb23b2191..18197f367 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -51,7 +51,6 @@ exports.startup = function() { },false) // Listen for the tw-browser-refresh message $tw.rootWidget.addEventListener("tw-browser-refresh",function(event) { - window.location.hash = ""; window.location.reload(true); }); // Listen for the tw-home message diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid index f4eb53295..225396934 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-browser-refresh.tid @@ -1,9 +1,9 @@ created: 20140819110529062 -modified: 20140819110529062 +modified: 20140826110529062 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 `tw-browser-refresh` message refreshes the page, causing the 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 ab41462af3df6bdf80f637f9c3e516a476b7850a Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 27 Aug 2014 09:59:01 +0100 Subject: [PATCH 07/14] Ensure that savers invoke the callback --- core/modules/savers/download.js | 2 ++ core/modules/savers/fsosaver.js | 8 +++++--- core/modules/savers/manualdownload.js | 2 ++ core/modules/savers/msdownload.js | 2 ++ core/modules/savers/tiddlyie.js | 3 ++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/core/modules/savers/download.js b/core/modules/savers/download.js index b84347723..ad23ecd11 100644 --- a/core/modules/savers/download.js +++ b/core/modules/savers/download.js @@ -38,6 +38,8 @@ DownloadSaver.prototype.save = function(text,method,callback) { document.body.appendChild(link); link.click(); document.body.removeChild(link); + // Callback that we succeeded + callback(null); return true; }; diff --git a/core/modules/savers/fsosaver.js b/core/modules/savers/fsosaver.js index d61235a95..37224e42a 100644 --- a/core/modules/savers/fsosaver.js +++ b/core/modules/savers/fsosaver.js @@ -33,14 +33,16 @@ FSOSaver.prototype.save = function(text,method,callback) { pathname = pathname.substr(1); // reconstruct UNC path pathname = "\\\\" + document.location.hostname + pathname; - } else return false; - + } else { + return false; + } // Save the file (as UTF-16) var fso = new ActiveXObject("Scripting.FileSystemObject"); var file = fso.OpenTextFile(pathname,2,-1,-1); - file.Write(text); file.Close(); + // Callback that we succeeded + callback(null); return true; }; diff --git a/core/modules/savers/manualdownload.js b/core/modules/savers/manualdownload.js index ae451d455..af9bcd743 100644 --- a/core/modules/savers/manualdownload.js +++ b/core/modules/savers/manualdownload.js @@ -25,6 +25,8 @@ ManualDownloadSaver.prototype.save = function(text,method,callback) { $tw.modal.display(downloadInstructionsTitle,{ downloadLink: "data:text/html," + encodeURIComponent(text) }); + // Callback that we succeeded + callback(null); return true; }; diff --git a/core/modules/savers/msdownload.js b/core/modules/savers/msdownload.js index 78fa9c140..6cb55c334 100644 --- a/core/modules/savers/msdownload.js +++ b/core/modules/savers/msdownload.js @@ -28,6 +28,8 @@ MsDownloadSaver.prototype.save = function(text,method,callback) { // Set up the link var blob = new Blob([text], {type: "text/html"}); window.navigator.msSaveBlob(blob,filename); + // Callback that we succeeded + callback(null); return true; }; diff --git a/core/modules/savers/tiddlyie.js b/core/modules/savers/tiddlyie.js index c04f8ec94..d6d49db45 100644 --- a/core/modules/savers/tiddlyie.js +++ b/core/modules/savers/tiddlyie.js @@ -35,9 +35,10 @@ TiddlyIESaver.prototype.save = function(text,method,callback) { // reconstruct UNC path pathname = "\\\\" + document.location.hostname + pathname; } else return false; - // Prompt the user to save the file window.TiddlyIE.save(pathname, text); + // Callback that we succeeded + callback(null); return true; } else { return false; From 9d871309c2d88deb98e8f0bada09863f65eac84e Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 27 Aug 2014 09:59:15 +0100 Subject: [PATCH 08/14] Remove stray console.log --- core/modules/savers/tiddlyfox.js | 1 - 1 file changed, 1 deletion(-) diff --git a/core/modules/savers/tiddlyfox.js b/core/modules/savers/tiddlyfox.js index 542b61e40..6f06d72bf 100644 --- a/core/modules/savers/tiddlyfox.js +++ b/core/modules/savers/tiddlyfox.js @@ -43,7 +43,6 @@ TiddlyFoxSaver.prototype.save = function(text,method,callback) { } // Create the message element and put it in the message box var message = document.createElement("div"); -console.log("Pathname",pathname); message.setAttribute("data-tiddlyfox-path",decodeURIComponent(pathname)); message.setAttribute("data-tiddlyfox-content",text); messageBox.appendChild(message); From 13c4e028b16ba32b3cd320eebbdd86c6742d2e4d Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 27 Aug 2014 10:04:54 +0100 Subject: [PATCH 09/14] Refactored autosave mechanism Previously we were using a message `tw-auto-save-wiki` to trigger an autosave. The message was generated by certain UI actions such as saving a tiddler. The trouble was that the message was being processed before the wiki change event for the accompanying change had had a chance to percolate. The end result was that the dirty indicator was staying lit when using autosave. The new approach abandons the autosave message and instead triggers the autosave in the wiki change event when a relevant change occurs. One happy side effect of these changes is that the dirty indicator now works as expected with the client server edition - ie, when typing in a draft tiddler the dirty indicator will flash briefly, and then clear when the sync mechanism has completed saving the draft. --- core/modules/saver-handler.js | 26 ++++++++----------- core/modules/utils/pluginmaker.js | 2 -- core/modules/widgets/navigator.js | 13 +--------- core/wiki/config/SaverFilter.tid | 3 +++ editions/tw5.com/tiddlers/TableOfContents.tid | 1 - .../WidgetMessage_ tw-auto-save-wiki.tid | 11 -------- .../messages/WidgetMessage_ tw-save-wiki.tid | 2 +- 7 files changed, 16 insertions(+), 42 deletions(-) create mode 100644 core/wiki/config/SaverFilter.tid delete mode 100644 editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-auto-save-wiki.tid diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js index 98ff08bdb..2c7fc968e 100644 --- a/core/modules/saver-handler.js +++ b/core/modules/saver-handler.js @@ -28,7 +28,7 @@ function SaverHandler(options) { this.initSavers(); } // Only do dirty tracking if required - if(this.dirtyTracking) { + if($tw.browser && 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 @@ -43,6 +43,9 @@ function SaverHandler(options) { }); self.numTasksInQueue += filteredChanges.length; self.updateDirtyStatus(); + if(self.numTasksInQueue > 0) { + self.saveWiki({method: "autosave"}); + } }); // Browser event handlers if($tw.browser) { @@ -65,13 +68,6 @@ function SaverHandler(options) { 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", @@ -82,7 +78,7 @@ function SaverHandler(options) { } } -SaverHandler.prototype.titleSyncFilter = "$:/config/SyncFilter"; +SaverHandler.prototype.titleSyncFilter = "$:/config/SaverFilter"; SaverHandler.prototype.titleAutoSave = "$:/config/AutoSave"; SaverHandler.prototype.titleSavedNotification = "$:/language/Notifications/Save/Done"; @@ -115,7 +111,7 @@ SaverHandler.prototype.initSavers = function(moduleType) { /* Save the wiki contents. Options are: - method: "save" or "download" + method: "save", "autosave" or "download" template: the tiddler containing the template to save downloadType: the content type for the saved file */ @@ -130,6 +126,11 @@ SaverHandler.prototype.saveWiki = function(options) { if(err) { alert("Error while saving:\n\n" + err); } else { + // Clear the task queue if we're saving (rather than downloading) + if(method !== "download") { + self.numTasksInQueue = 0; + self.updateDirtyStatus(); + } $tw.notifier.display(self.titleSavedNotification); if(options.callback) { options.callback(); @@ -145,11 +146,6 @@ SaverHandler.prototype.saveWiki = function(options) { 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; } } diff --git a/core/modules/utils/pluginmaker.js b/core/modules/utils/pluginmaker.js index eadef8e43..5cce747a0 100644 --- a/core/modules/utils/pluginmaker.js +++ b/core/modules/utils/pluginmaker.js @@ -71,8 +71,6 @@ exports.repackPlugin = function(title,additionalTiddlers,excludeTiddlers) { $tw.wiki.deleteTiddler(title); } }); - // Trigger an autosave - $tw.rootWidget.dispatchEvent({type: "tw-auto-save-wiki"}); // Return a heartwarming confirmation return "Plugin " + title + " successfully saved"; } diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 71a49ff2f..8b06289ad 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -243,8 +243,6 @@ NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) { // Remove the closed tiddler from the story this.removeTitleFromStory(storyList,title); this.saveStoryList(storyList); - // Send a notification event - this.dispatchEvent({type: "tw-auto-save-wiki"}); return false; }; @@ -333,8 +331,6 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) { if(draftTitle !== this.storyTitle) { this.saveStoryList(storyList); } - // Send a notification event - this.dispatchEvent({type: "tw-auto-save-wiki"}); } } } @@ -376,13 +372,8 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) { var storyList = this.getStoryList(); // Get the template tiddler if there is one var templateTiddler = this.wiki.getTiddler(event.param); - // Create the new tiddler + // Title the new tiddler var title = this.wiki.generateNewTitle((templateTiddler && templateTiddler.fields.title) || "New Tiddler"); - var tiddler = new $tw.Tiddler(this.wiki.getCreationFields(),{ - text: "Newly created tiddler", - title: title - },this.wiki.getModificationFields()); - this.wiki.addTiddler(tiddler); // Create the draft tiddler var draftTitle = this.generateDraftTitle(title), draftTiddler = new $tw.Tiddler({ @@ -487,8 +478,6 @@ NavigatorWidget.prototype.handlePerformImportEvent = function(event) { })); // Navigate to the $:/Import tiddler this.addToHistory([IMPORT_TITLE]); - // Send a notification event - this.dispatchEvent({type: "tw-auto-save-wiki"}); }; exports.navigator = NavigatorWidget; diff --git a/core/wiki/config/SaverFilter.tid b/core/wiki/config/SaverFilter.tid new file mode 100644 index 000000000..872fc8744 --- /dev/null +++ b/core/wiki/config/SaverFilter.tid @@ -0,0 +1,3 @@ +title: $:/config/SaverFilter + +[!is[shadow]] -[[$:/HistoryList]] -[[$:/StoryList]] -[[$:/Import]] -[[$:/isEncrypted]] -[prefix[$:/status]] -[prefix[$:/state]] -[prefix[$:/temp]] -[has[draft.of]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/TableOfContents.tid b/editions/tw5.com/tiddlers/TableOfContents.tid index c30ab83a9..52161d843 100644 --- a/editions/tw5.com/tiddlers/TableOfContents.tid +++ b/editions/tw5.com/tiddlers/TableOfContents.tid @@ -183,7 +183,6 @@ $body$ ">> ## <<toc-heading "Widget Messages" " ## WidgetMessages -## [[tw-auto-save-wiki|WidgetMessage: tw-auto-save-wiki]] ## [[tw-cancel-tiddler|WidgetMessage: tw-cancel-tiddler]] ## [[tw-clear-password|WidgetMessage: tw-clear-password]] ## [[tw-close-all-tiddlers|WidgetMessage: tw-close-all-tiddlers]] 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 deleted file mode 100644 index d5b99be0c..000000000 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-auto-save-wiki.tid +++ /dev/null @@ -1,11 +0,0 @@ -created: 20140811112343634 -modified: 20140811114420597 -tags: message -title: WidgetMessage: tw-auto-save-wiki -type: text/vnd.tiddlywiki - -The autosave wiki message causes the current saver module to perform a background save if it is required. - -The autosave wiki message should be generated whenever changes are made to the store. For example, the navigator widget generates the autosave wiki message as part of its handling of the [[WidgetMessage: tw-save-tiddler]], [[WidgetMessage: tw-delete-tiddler]] and [[WidgetMessage: tw-perform-import]]. - -The autosave wiki message is handled by the TiddlyWiki core SyncMechanism which invokes the current [[SaverModule|SaverModules]]. Not all SaverModules can handle autosaving. 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 bff780fe0..44d39e628 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-save-wiki.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tw-save-wiki.tid @@ -4,7 +4,7 @@ tags: message title: WidgetMessage: tw-save-wiki 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]]/ +The save wiki message causes the current saver module to perform a full save operation. The save operation can involve user interaction. The save wiki message is usually generated by the ButtonWidget. From 32b795452ff07a886776f71ac75117c859cc2189 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 27 Aug 2014 11:09:59 +0100 Subject: [PATCH 10/14] Allow Markdown dialect to be configured --- editions/markdowndemo/tiddlers/HelloThere.tid | 30 ++++++++++++++----- plugins/tiddlywiki/markdown/dialect.tid | 3 ++ plugins/tiddlywiki/markdown/wrapper.js | 6 +++- 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 plugins/tiddlywiki/markdown/dialect.tid diff --git a/editions/markdowndemo/tiddlers/HelloThere.tid b/editions/markdowndemo/tiddlers/HelloThere.tid index d3722582c..b3b4aea0b 100644 --- a/editions/markdowndemo/tiddlers/HelloThere.tid +++ b/editions/markdowndemo/tiddlers/HelloThere.tid @@ -1,13 +1,34 @@ title: HelloThere -This is a demo of TiddlyWiki5 incorporating a plugin for the [[markdown-js|https://github.com/evilstreak/markdown-js]] Markdown parser from Dominic Baggott. +This is a demo of TiddlyWiki5 incorporating a plugin for the [[markdown-js|https://github.com/evilstreak/markdown-js]] Markdown parser from Dominic Baggott. The MarkdownExample tiddler below is written in Markdown. -The MarkdownExample tiddler below is written in Markdown. Create wiki links with the usual Markdown link syntax targeting `#` and the target tiddler title: +! Installation + +To add the plugin to your own TiddlyWiki5, just drag this link to the browser window: + +[[$:/plugins/tiddlywiki/markdown]] + +! Markdown Dialects + +By default the markdown parser recognises the original dialect of Markdown [[as described by John Gruber|http://daringfireball.net/projects/markdown/]]. An extended dialect called "Maruku" is also included that provides table support and other advanced features. The syntax extensions are modelled on those of [[PHP Markdown Extra|https://michelf.ca/projects/php-markdown/extra/]]. + +The configuration tiddler [[$:/config/markdown/dialect]] determines which dialect is used: + +|!Dialect |!Description | +|Gruber |Standard Markdown | +|Maruku |Extended Maruku Markdown | + + +! Creating ~WikiLinks + +Create wiki links with the usual Markdown link syntax targeting `#` and the target tiddler title: ``` [link text](#TiddlerTitle) ``` +! Images + Markdown image syntax can be used to reference images by tiddler title or an external URI. For example: ``` @@ -15,8 +36,3 @@ Markdown image syntax can be used to reference images by tiddler title or an ext ![alt text](Motovun Jack.jpg "Title") ``` - -To add the plugin to your own TiddlyWiki5, just drag this link to the browser window: - -[[$:/plugins/tiddlywiki/markdown]] - diff --git a/plugins/tiddlywiki/markdown/dialect.tid b/plugins/tiddlywiki/markdown/dialect.tid new file mode 100644 index 000000000..342ace8ff --- /dev/null +++ b/plugins/tiddlywiki/markdown/dialect.tid @@ -0,0 +1,3 @@ +title: $:/config/markdown/dialect + +Gruber \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/wrapper.js b/plugins/tiddlywiki/markdown/wrapper.js index f16456077..2920da1f1 100644 --- a/plugins/tiddlywiki/markdown/wrapper.js +++ b/plugins/tiddlywiki/markdown/wrapper.js @@ -14,6 +14,9 @@ Wraps up the markdown-js parser for use in TiddlyWiki5 var markdown = require("$:/plugins/tiddlywiki/markdown/markdown.js"); +var CONFIG_DIALECT_TIDDLER = "$:/config/markdown/dialect", + DEFAULT_DIALECT = "Gruber"; + function transformNodes(nodes) { var results = []; for(var index=0; index<nodes.length; index++) { @@ -52,7 +55,8 @@ function transformNode(node) { } var MarkdownParser = function(type,text,options) { - var markdownTree = markdown.toHTMLTree(text); + var dialect = options.wiki.getTiddlerText(CONFIG_DIALECT_TIDDLER,DEFAULT_DIALECT), + markdownTree = markdown.toHTMLTree(text,dialect); this.tree = transformNodes(markdownTree.slice(1)); }; From 8ca709f664d19e3f46bdfad813abad84aecba0d7 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Wed, 27 Aug 2014 11:10:06 +0100 Subject: [PATCH 11/14] Release note update --- editions/tw5.com/tiddlers/Release 5.0.16beta.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/Release 5.0.16beta.tid b/editions/tw5.com/tiddlers/Release 5.0.16beta.tid index 14f997b58..f44ab9168 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.16beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.16beta.tid @@ -9,7 +9,7 @@ type: text/vnd.tiddlywiki !! Usability Improvements -* +* [[Amended|https://github.com/Jermolene/TiddlyWiki5/commit/e47852cb141b384ad2a9097eca795545cb5b2494]] behaviour of the [[tw-browser-refresh|WidgetMessage: tw-browser-refresh]] message so that it no longer clears the location hash !! Hackability Improvements From d2a5a12f2d6b6ccc36dd22a70ac2def08d1d3722 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Thu, 28 Aug 2014 08:58:53 +0100 Subject: [PATCH 12/14] Extend TOC macros to use caption field Now the `caption` field is used for the text of each entry, if present, falling back to the `title` field. --- core/wiki/macros/toc.tid | 6 ++++++ editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/wiki/macros/toc.tid b/core/wiki/macros/toc.tid index 08204c334..8edfbec93 100644 --- a/core/wiki/macros/toc.tid +++ b/core/wiki/macros/toc.tid @@ -6,7 +6,9 @@ tags: $:/tags/Macro <$list filter="[tag[$tag$]$sort$]"> <li> <$link> +<$view field="caption"> <$view field="title"/> +</$view> </$link> <$macrocall $name="toc" tag=<<currentTiddler>>/> </li> @@ -28,7 +30,9 @@ tags: $:/tags/Macro {{$:/core/images/down-arrow}} </$button> </$reveal> +<$view field="caption"> <$view field="title"/> +</$view> </$link> <$reveal type="match" state=<<toc-state>> text="open"> <$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="$sort$"/> @@ -61,7 +65,9 @@ tags: $:/tags/Macro </$button> </$reveal> </$list> +<$view field="caption"> <$view field="title"/> +</$view> </$link> <$reveal type="match" state=<<toc-state>> text="open"> <$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="$sort$"/> diff --git a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid index 73e56ff38..e31760db1 100644 --- a/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid +++ b/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid @@ -1,10 +1,10 @@ title: TableOfContentsMacro tags: macros -modified: 20140818180307785 +modified: 20140828080307785 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. +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. The text for each entry is taken from the ''caption'' field if it is present, otherwise the ''title'' is used. There are several variants of the macro: From b437f1b450f5f2a3104a9086f7c674299b53b9bc Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Thu, 28 Aug 2014 09:12:00 +0100 Subject: [PATCH 13/14] Allow default tiddler info tab to be configured --- core/ui/TiddlerInfo.tid | 2 +- core/wiki/config/TiddlerInfoDefault.tid | 3 +++ .../Configuring the default TiddlerInfo tab.tid | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 core/wiki/config/TiddlerInfoDefault.tid create mode 100644 editions/tw5.com/tiddlers/Configuring the default TiddlerInfo tab.tid diff --git a/core/ui/TiddlerInfo.tid b/core/ui/TiddlerInfo.tid index 1156b7d07..894cd7c0c 100644 --- a/core/ui/TiddlerInfo.tid +++ b/core/ui/TiddlerInfo.tid @@ -1,3 +1,3 @@ title: $:/core/ui/TiddlerInfo -<<tabs "[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo]!has[draft.of]]" "$:/core/ui/TiddlerInfo/Tools">> +<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo]!has[draft.of]]" default="$:/core/ui/TiddlerInfo/References"/> \ No newline at end of file diff --git a/core/wiki/config/TiddlerInfoDefault.tid b/core/wiki/config/TiddlerInfoDefault.tid new file mode 100644 index 000000000..b9b2bdf78 --- /dev/null +++ b/core/wiki/config/TiddlerInfoDefault.tid @@ -0,0 +1,3 @@ +title: $:/config/TiddlerInfo/Default + +$:/core/ui/TiddlerInfo/Tools \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/Configuring the default TiddlerInfo tab.tid b/editions/tw5.com/tiddlers/Configuring the default TiddlerInfo tab.tid new file mode 100644 index 000000000..8f5d12f6b --- /dev/null +++ b/editions/tw5.com/tiddlers/Configuring the default TiddlerInfo tab.tid @@ -0,0 +1,17 @@ +created: 20140828080837703 +modified: 20140828081120491 +tags: howto +title: Configuring the default TiddlerInfo tab +type: text/vnd.tiddlywiki + +The configuration tiddler [[$:/config/TiddlerInfo/Default]] contains the title of the tiddler containing the default tiddler info tab. + +The default value is `$:/core/ui/TiddlerInfo/Tools` corresponding to the ''Tools'' tab. Other possible values are: + +<ul> +<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo]!has[draft.of]]"> +<li> +<$view field="title"/> +</li> +</$list> +</ul> From 347d5c01485033f485698bbc93c5b02cfa1bd1c5 Mon Sep 17 00:00:00 2001 From: Jermolene <jeremy@osmosoft.com> Date: Thu, 28 Aug 2014 09:32:19 +0100 Subject: [PATCH 14/14] Update link widget docs --- editions/tw5.com/tiddlers/widgets/LinkWidget.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/widgets/LinkWidget.tid b/editions/tw5.com/tiddlers/widgets/LinkWidget.tid index f67d44520..f23fbade6 100644 --- a/editions/tw5.com/tiddlers/widgets/LinkWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/LinkWidget.tid @@ -1,9 +1,9 @@ title: LinkWidget created: 201310241419 -modified: 201406170837 +modified: 201408280837 tags: widget -The `link` widget generates links to tiddlers. +The `link` widget generates links to tiddlers. (Use the HTML `<a>` element to generate external links). ! Content and Attributes