mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Allow tm-open-window to specify a page title
This commit is contained in:
parent
3edaa652ee
commit
2a4c60b23d
@ -28,6 +28,7 @@ exports.startup = function() {
|
||||
var refreshHandler,
|
||||
title = event.param || event.tiddlerTitle,
|
||||
paramObject = event.paramObject || {},
|
||||
windowTitle = paramObject.windowTitle || title,
|
||||
template = paramObject.template || "$:/core/templates/single.tiddler.window",
|
||||
width = paramObject.width || "700",
|
||||
height = paramObject.height || "600",
|
||||
@ -51,7 +52,7 @@ exports.startup = function() {
|
||||
// Initialise the document
|
||||
srcDocument.write("<html><head></head><body class='tc-body tc-single-tiddler-window'></body></html>");
|
||||
srcDocument.close();
|
||||
srcDocument.title = title;
|
||||
srcDocument.title = windowTitle;
|
||||
srcWindow.addEventListener("beforeunload",function(event) {
|
||||
delete windows[title];
|
||||
$tw.wiki.removeEventListener("change",refreshHandler);
|
||||
|
@ -1,6 +1,6 @@
|
||||
caption: tm-open-window
|
||||
created: 20160424181447704
|
||||
modified: 20160424182909036
|
||||
modified: 20190704145627537
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-open-window
|
||||
type: text/vnd.tiddlywiki
|
||||
@ -10,6 +10,7 @@ The `tm-open-window` message opens a tiddler in a new //browser// window. If no
|
||||
|!Name |!Description |
|
||||
|param |Title of the tiddler to be opened in a new browser window, defaults to <<.var "currentTiddler">> if empty |
|
||||
|template |Template in which the tiddler will be rendered in |
|
||||
|windowTitle |Title string for the opened window |
|
||||
|width |Width of the new browser window |
|
||||
|height |Height of the new browser window |
|
||||
|paramObject |Hashmap of variables that will be provided to the window |
|
||||
|
Loading…
Reference in New Issue
Block a user