Add icon and message handler for print button

I’m inclined to think it’s not worth adding a corresponding page
control button because it’ll require a lot of tiddlers for the
translation etc.
print-window-tiddler
Jermolene 2016-10-08 10:10:54 +01:00
rodzic ee66d1a1af
commit c4e13bc94a
3 zmienionych plików z 26 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,12 @@
title: $:/core/images/print-button
tags: $:/tags/Image
<svg class="tc-image-print-button tc-image-button" viewBox="0 0 128 128" width="22pt" height="22pt">
<g fill-rule="evenodd">
<path d="M112,71 L112,30.5 L111.96811,30.5 L111.96811,30.5 C111.932942,28.4998414 111.151676,26.510538 109.625176,24.9840387 L86.9982489,2.35711116 C85.3482153,0.707077645 83.1589869,-0.071534047 81,0.0201838424 L81,0 L23.9992458,0 C19.5808867,0 16,3.58213437 16,8.00092105 L16,71 L24,71 L24,8 L81,8 L81,22.4996539 C81,26.9216269 84.5818769,30.5 89.0003461,30.5 L104,30.5 L104,71 L112,71 Z"></path>
<rect x="32" y="36" width="64" height="8" rx="4"></rect>
<rect x="32" y="52" width="64" height="8" rx="4"></rect>
<rect x="32" y="20" width="40" height="8" rx="4"></rect>
<path d="M0,80.0054195 C0,71.1658704 7.15611005,64 16.0008841,64 L111.999116,64 C120.83616,64 128,71.1553215 128,80.0054195 L128,111.99458 C128,120.83413 120.84389,128 111.999116,128 L16.0008841,128 C7.16383982,128 0,120.844679 0,111.99458 L0,80.0054195 Z M104,96 C108.418278,96 112,92.418278 112,88 C112,83.581722 108.418278,80 104,80 C99.581722,80 96,83.581722 96,88 C96,92.418278 99.581722,96 104,96 Z"></path>
</g>
</svg>

Wyświetl plik

@ -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 = "";

Wyświetl plik

@ -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.