1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00

Make the tw-home message refresh the page

This commit is contained in:
Jermolene 2014-07-30 22:31:15 +01:00
parent c4c4c3d270
commit 18f1634802
2 changed files with 5 additions and 6 deletions

View File

@ -51,9 +51,8 @@ exports.startup = function() {
},false)
// Listen for the tw-home message
$tw.rootWidget.addEventListener("tw-home",function(event) {
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());
window.location.hash = "";
window.location.reload(true);
});
// Listen for the tw-permalink message
$tw.rootWidget.addEventListener("tw-permalink",function(event) {

View File

@ -1,9 +1,9 @@
created: 20140312223013470
modified: 20140312223134387
modified: 20140729223134387
tags: message
title: WidgetMessage: tw-home
type: text/vnd.tiddlywiki
The `tw-home` message resets the story list to the tiddlers defined in [[$:/DefaultTiddlers]]. It does not require any properties on the `event` object.
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 cancel tiddler message is usually generated with the ButtonWidget and is handled by the core.
The home message is usually generated with the ButtonWidget and is handled by the core.