diff --git a/core/images/print-button.tid b/core/images/print-button.tid new file mode 100644 index 000000000..5e7c1d8e0 --- /dev/null +++ b/core/images/print-button.tid @@ -0,0 +1,12 @@ +title: $:/core/images/print-button +tags: $:/tags/Image + + + + + + + + + + \ No newline at end of file diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index 987bee216..20eb5e71a 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -53,6 +53,10 @@ exports.startup = function() { $tw.rootWidget.addEventListener("tm-browser-refresh",function(event) { window.location.reload(true); }); + // Listen for the tm-print message + $tw.rootWidget.addEventListener("tm-print",function(event) { + window.print(); + }); // Listen for the tm-home message $tw.rootWidget.addEventListener("tm-home",function(event) { window.location.hash = ""; diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-print.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-print.tid new file mode 100644 index 000000000..c114811ef --- /dev/null +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-print.tid @@ -0,0 +1,10 @@ +created: 20161008085627406 +modified: 20161008085627406 +tags: Messages +title: WidgetMessage: tm-print +type: text/vnd.tiddlywiki +caption: tm-print + +<<.from-version "5.1.14">> The `tm-print` message causes the browser to display the print dialog for the current page. It does not require any properties on the `event` object. + +The print message is usually generated with the ButtonWidget and is handled by the core.