mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-07 22:33:50 +00:00
Make the tw-home message refresh the page
This commit is contained in:
parent
c4c4c3d270
commit
18f1634802
@ -51,9 +51,8 @@ exports.startup = function() {
|
|||||||
},false)
|
},false)
|
||||||
// Listen for the tw-home message
|
// Listen for the tw-home message
|
||||||
$tw.rootWidget.addEventListener("tw-home",function(event) {
|
$tw.rootWidget.addEventListener("tw-home",function(event) {
|
||||||
var storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE),
|
window.location.hash = "";
|
||||||
storyList = $tw.wiki.filterTiddlers(storyFilter);
|
window.location.reload(true);
|
||||||
$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: "", list: storyList},$tw.wiki.getModificationFields());
|
|
||||||
});
|
});
|
||||||
// Listen for the tw-permalink message
|
// Listen for the tw-permalink message
|
||||||
$tw.rootWidget.addEventListener("tw-permalink",function(event) {
|
$tw.rootWidget.addEventListener("tw-permalink",function(event) {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
created: 20140312223013470
|
created: 20140312223013470
|
||||||
modified: 20140312223134387
|
modified: 20140729223134387
|
||||||
tags: message
|
tags: message
|
||||||
title: WidgetMessage: tw-home
|
title: WidgetMessage: tw-home
|
||||||
type: text/vnd.tiddlywiki
|
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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user