mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Add page print button
cc @silvyn
This commit is contained in:
parent
6dc90718f0
commit
0b76c327c2
@ -76,6 +76,8 @@ Permalink/Caption: permalink
|
||||
Permalink/Hint: Set browser address bar to a direct link to this tiddler
|
||||
Permaview/Caption: permaview
|
||||
Permaview/Hint: Set browser address bar to a direct link to all the tiddlers in this story
|
||||
Print/Caption: print page
|
||||
Print/Hint: Print the current page
|
||||
Refresh/Caption: refresh
|
||||
Refresh/Hint: Perform a full refresh of the wiki
|
||||
Save/Caption: ok
|
||||
|
@ -55,7 +55,7 @@ exports.startup = function() {
|
||||
});
|
||||
// Listen for the tm-print message
|
||||
$tw.rootWidget.addEventListener("tm-print",function(event) {
|
||||
window.print();
|
||||
(event.event.view || window).print();
|
||||
});
|
||||
// Listen for the tm-home message
|
||||
$tw.rootWidget.addEventListener("tm-home",function(event) {
|
||||
|
@ -78,7 +78,8 @@ SendMessageWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||
param: param,
|
||||
paramObject: paramObject,
|
||||
tiddlerTitle: this.getVariable("currentTiddler"),
|
||||
navigateFromTitle: this.getVariable("storyTiddler")
|
||||
navigateFromTitle: this.getVariable("storyTiddler"),
|
||||
event: event
|
||||
});
|
||||
return true; // Action was invoked
|
||||
};
|
||||
|
@ -131,12 +131,13 @@ ButtonWidget.prototype.navigateTo = function(event) {
|
||||
navigateFromNode: this,
|
||||
navigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height
|
||||
},
|
||||
navigateSuppressNavigation: event.metaKey || event.ctrlKey || (event.button === 1)
|
||||
navigateSuppressNavigation: event.metaKey || event.ctrlKey || (event.button === 1),
|
||||
event: event
|
||||
});
|
||||
};
|
||||
|
||||
ButtonWidget.prototype.dispatchMessage = function(event) {
|
||||
this.dispatchEvent({type: this.message, param: this.param, tiddlerTitle: this.getVariable("currentTiddler")});
|
||||
this.dispatchEvent({type: this.message, param: this.param, tiddlerTitle: this.getVariable("currentTiddler"), event: event});
|
||||
};
|
||||
|
||||
ButtonWidget.prototype.triggerPopup = function(event) {
|
||||
|
13
core/ui/PageControls/print.tid
Normal file
13
core/ui/PageControls/print.tid
Normal file
@ -0,0 +1,13 @@
|
||||
title: $:/core/ui/Buttons/print
|
||||
tags: $:/tags/PageControls
|
||||
caption: {{$:/core/images/print-button}} {{$:/language/Buttons/Print/Caption}}
|
||||
description: {{$:/language/Buttons/Print/Hint}}
|
||||
|
||||
<$button message="tm-print" tooltip={{$:/language/Buttons/Print/Hint}} aria-label={{$:/language/Buttons/Print/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
|
||||
{{$:/core/images/print-button}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Print/Caption}}/></span>
|
||||
</$list>
|
||||
</$button>
|
@ -16,6 +16,7 @@ core/ui/Buttons/new-journal: hide
|
||||
core/ui/Buttons/new-image: hide
|
||||
core/ui/Buttons/palette: hide
|
||||
core/ui/Buttons/permaview: hide
|
||||
core/ui/Buttons/print: hide
|
||||
core/ui/Buttons/storyview: hide
|
||||
core/ui/Buttons/theme: hide
|
||||
core/ui/Buttons/unfold-all: hide
|
||||
|
Loading…
Reference in New Issue
Block a user