From ff57b4084a5285878dcb4b7a3d684f706e8b8090 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 3 Jul 2016 14:55:41 +0100 Subject: [PATCH] Extend notification handler to accept variables Now we can provide variables to be passed to the rendering of the notification text --- core/modules/startup/rootwidget.js | 2 +- .../tw5.com/tiddlers/messages/WidgetMessage_ tm-notify.tid | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/startup/rootwidget.js b/core/modules/startup/rootwidget.js index fdc6c738e..2b5111aff 100644 --- a/core/modules/startup/rootwidget.js +++ b/core/modules/startup/rootwidget.js @@ -28,7 +28,7 @@ exports.startup = function() { // Install the notification mechanism $tw.notifier = new $tw.utils.Notifier($tw.wiki); $tw.rootWidget.addEventListener("tm-notify",function(event) { - $tw.notifier.display(event.param); + $tw.notifier.display(event.param,{variables: event.paramObject}); }); // Install the scroller $tw.pageScroller = new $tw.utils.PageScroller(); diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-notify.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-notify.tid index 6d28adf70..f44839f45 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-notify.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-notify.tid @@ -1,5 +1,5 @@ created: 20140811112304772 -modified: 20140811120248738 +modified: 20160701140248738 tags: Messages title: WidgetMessage: tm-notify type: text/vnd.tiddlywiki @@ -9,5 +9,6 @@ The notify message briefly displays a specified tiddler as a small alert in the |!Name |!Description | |param |Title of the tiddler to be displayed | +|paramObject |Hashmap of variables to be provided to the notification | The notify message is handled by the TiddlyWiki core.