diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids index a58bf5bd5..58f07beff 100644 --- a/core/language/en-GB/Misc.multids +++ b/core/language/en-GB/Misc.multids @@ -30,3 +30,4 @@ TagManager/Colour/Heading: Colour TagManager/Count/Heading: Count TagManager/Icon/Heading: Icon TagManager/Tag/Heading: Tag +UnsavedChangesWarning: You have unsaved changes in TiddlyWiki diff --git a/core/modules/startup/password.js b/core/modules/startup/password.js index a6d586401..3ff7e26c7 100644 --- a/core/modules/startup/password.js +++ b/core/modules/startup/password.js @@ -15,7 +15,7 @@ Password handling // Export name and synchronous status exports.name = "password"; exports.platforms = ["browser"]; -exports.after = ["rootwidget"]; +exports.after = ["startup"]; exports.synchronous = true; exports.startup = function() { diff --git a/core/modules/startup/rootwidget.js b/core/modules/startup/rootwidget.js index 222950825..f28d5b776 100644 --- a/core/modules/startup/rootwidget.js +++ b/core/modules/startup/rootwidget.js @@ -15,21 +15,11 @@ Setup the root widget and the core root widget handlers // Export name and synchronous status exports.name = "rootwidget"; exports.platforms = ["browser"]; -exports.after = ["load-modules"]; +exports.after = ["startup"]; exports.before = ["story"]; exports.synchronous = true; -var widget = require("$:/core/modules/widgets/widget.js"); - exports.startup = function() { - // Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers - $tw.rootWidget = new widget.widget({ - type: "widget", - children: [] - },{ - wiki: $tw.wiki, - document: document - }); // Install the modal message mechanism $tw.modal = new $tw.utils.Modal($tw.wiki); $tw.rootWidget.addEventListener("tw-modal",function(event) { @@ -45,27 +35,6 @@ exports.startup = function() { $tw.rootWidget.addEventListener("tw-scroll",function(event) { $tw.pageScroller.handleEvent(event); }); - // Install the save action handlers - $tw.rootWidget.addEventListener("tw-save-wiki",function(event) { - $tw.syncer.saveWiki({ - template: event.param, - downloadType: "text/plain" - }); - }); - $tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) { - $tw.syncer.saveWiki({ - method: "autosave", - template: event.param, - downloadType: "text/plain" - }); - }); - $tw.rootWidget.addEventListener("tw-download-file",function(event) { - $tw.syncer.saveWiki({ - method: "download", - template: event.param, - downloadType: "text/plain" - }); - }); var fullscreen = $tw.utils.getFullScreenApis(); if(fullscreen) { $tw.rootWidget.addEventListener("tw-full-screen",function(event) { diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index a7f4c583f..6facee2c4 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -20,6 +20,8 @@ exports.synchronous = true; // Set to `true` to enable performance instrumentation var PERFORMANCE_INSTRUMENTATION = false; +var widget = require("$:/core/modules/widgets/widget.js"); + exports.startup = function() { var modules,n,m,f; if($tw.browser) { @@ -50,19 +52,20 @@ exports.startup = function() { }); // Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup $tw.wiki.clearTiddlerEventQueue(); + // Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers + if($tw.browser) { + $tw.rootWidget = new widget.widget({ + type: "widget", + children: [] + },{ + wiki: $tw.wiki, + document: document + }); + } // Set up the syncer object $tw.syncer = new $tw.Syncer({wiki: $tw.wiki}); // Host-specific startup if($tw.browser) { - // Set up our beforeunload handler - window.addEventListener("beforeunload",function(event) { - var confirmationMessage = undefined; - if($tw.syncer.isDirty()) { - confirmationMessage = "You have unsaved changes in TiddlyWiki"; - event.returnValue = confirmationMessage; // Gecko - } - return confirmationMessage; - }); // Install the popup manager $tw.popup = new $tw.utils.Popup({ rootElement: document.body diff --git a/core/modules/startup/syncer-browser.js b/core/modules/startup/syncer-browser.js deleted file mode 100644 index a79c5e631..000000000 --- a/core/modules/startup/syncer-browser.js +++ /dev/null @@ -1,34 +0,0 @@ -/*\ -title: $:/core/modules/startup/syncer-browser.js -type: application/javascript -module-type: startup - -Startup handling - -\*/ -(function(){ - -/*jslint node: true, browser: true */ -/*global $tw: false */ -"use strict"; - -// Export name and synchronous status -exports.name = "syncer-browser"; -exports.platforms = ["browser"]; -exports.after = ["rootwidget"]; -exports.synchronous = true; - -exports.startup = function() { - // Listen out for login/logout/refresh events in the browser - $tw.rootWidget.addEventListener("tw-login",function() { - $tw.syncer.handleLoginEvent(); - }); - $tw.rootWidget.addEventListener("tw-logout",function() { - $tw.syncer.handleLogoutEvent(); - }); - $tw.rootWidget.addEventListener("tw-server-refresh",function() { - $tw.syncer.handleRefreshEvent(); - }); -}; - -})(); diff --git a/core/modules/syncer.js b/core/modules/syncer.js index 6600573fb..4d9fa6c5b 100644 --- a/core/modules/syncer.js +++ b/core/modules/syncer.js @@ -45,6 +45,49 @@ function Syncer(options) { this.wiki.addEventListener("change",function(changes) { self.syncToServer(changes); }); + // 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; + }); + // Listen out for login/logout/refresh events in the browser + $tw.rootWidget.addEventListener("tw-login",function() { + $tw.syncer.handleLoginEvent(); + }); + $tw.rootWidget.addEventListener("tw-logout",function() { + $tw.syncer.handleLogoutEvent(); + }); + $tw.rootWidget.addEventListener("tw-server-refresh",function() { + $tw.syncer.handleRefreshEvent(); + }); + // Install the save action handlers + $tw.rootWidget.addEventListener("tw-save-wiki",function(event) { + $tw.syncer.saveWiki({ + template: event.param, + downloadType: "text/plain" + }); + }); + $tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) { + $tw.syncer.saveWiki({ + method: "autosave", + template: event.param, + downloadType: "text/plain" + }); + }); + $tw.rootWidget.addEventListener("tw-download-file",function(event) { + $tw.syncer.saveWiki({ + method: "download", + template: event.param, + downloadType: "text/plain" + }); + }); + } // Listen out for lazyLoad events if(this.syncadaptor) { this.wiki.addEventListener("lazyLoad",function(title) { @@ -498,7 +541,7 @@ Syncer.prototype.chooseNextTask = function() { // Exclude the task if it is a save and the tiddler has been modified recently, but not hit the fallback time if(task.type === "save" && (now - task.lastModificationTime) < self.throttleInterval && (now - task.queueTime) < self.fallbackInterval) { - return; + return; } // Exclude the task if it is newer than the current best candidate if(candidateTask && candidateTask.queueTime < task.queueTime) { diff --git a/editions/tw5.com/tiddlers/HelloThere.tid b/editions/tw5.com/tiddlers/HelloThere.tid index 550d3db39..92bce4cf5 100644 --- a/editions/tw5.com/tiddlers/HelloThere.tid +++ b/editions/tw5.com/tiddlers/HelloThere.tid @@ -1,5 +1,5 @@ created: 20130822170200000 -modified: 20140811224027280 +modified: 20140813164027280 tags: introduction title: HelloThere type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/Release 5.0.14beta.tid b/editions/tw5.com/tiddlers/Release 5.0.14beta.tid index 7750bf099..0a4c13d43 100644 --- a/editions/tw5.com/tiddlers/Release 5.0.14beta.tid +++ b/editions/tw5.com/tiddlers/Release 5.0.14beta.tid @@ -1,9 +1,10 @@ caption: 5.0.14-beta -created: 20140518150234142 -modified: 20140811153116300 +created: 20140718150234142 +modified: 20140813153116300 tags: releasenote title: Release 5.0.14-beta type: text/vnd.tiddlywiki +released: 201408131731 //[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.13-beta...v5.0.14-beta]]// diff --git a/editions/tw5.com/tiddlers/Release 5.0.15beta.tid b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid new file mode 100644 index 000000000..11c642e42 --- /dev/null +++ b/editions/tw5.com/tiddlers/Release 5.0.15beta.tid @@ -0,0 +1,28 @@ +caption: 5.0.15-beta +created: 20140818150234142 +modified: 20140813153116300 +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]]// + +!! Major Changes + +!! 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]] diff --git a/editions/tw5.com/tiddlers/ReleaseHistory.tid b/editions/tw5.com/tiddlers/ReleaseHistory.tid index d11e924d0..d7076c5c1 100644 --- a/editions/tw5.com/tiddlers/ReleaseHistory.tid +++ b/editions/tw5.com/tiddlers/ReleaseHistory.tid @@ -5,4 +5,4 @@ type: text/vnd.tiddlywiki Here are the details of recent releases of TiddlyWiki5. See [[TiddlyWiki5 Versioning]] for details of how releases are named. -<> +<> diff --git a/package.json b/package.json index 7caec6065..144290fba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tiddlywiki", "preferGlobal": "true", - "version": "5.0.14-prerelease", + "version": "5.0.15-prerelease", "author": "Jeremy Ruston ", "description": "a non-linear personal web notebook", "contributors": [ diff --git a/plugins/tiddlywiki/upgrade/UpgradeWizard.tid b/plugins/tiddlywiki/upgrade/UpgradeWizard.tid index 130ee2ce6..30f955b3f 100644 --- a/plugins/tiddlywiki/upgrade/UpgradeWizard.tid +++ b/plugins/tiddlywiki/upgrade/UpgradeWizard.tid @@ -15,10 +15,6 @@ Drag a ~TiddlyWiki file here to upgrade it or click to pick a file <$browse/> ---- - -//Your data will not leave your browser. [[Download|http://tiddlywiki.com/upgrade.html]] this upgrader to use it offline// - <$reveal state="$:/Import!!status" type="match" text="pending"> @@ -49,8 +45,10 @@ For help and support, visit [[the TiddlyWiki discussion forum|http://groups.goog -//(version <>)// - +version <> + +//Your data will not leave your browser. Download this upgrader to use it offline// + diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 2edfe36e0..6203bd19e 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1135,8 +1135,8 @@ canvas.tw-edit-bitmapeditor { padding-top: 0; padding-left: 14px; border-left: 1px solid <>; - -webkit-flex: 0 0 84%; - flex: 0 0 84%; + -webkit-flex: 1 0 70%; + flex: 1 0 70%; } .tw-sidebar-lists .tw-tab-buttons button.tw-tab-selected {