Allow tm-open-window to specify a page title

fix-syncer
Jeremy Ruston 2019-07-04 15:59:34 +01:00
rodzic 3edaa652ee
commit 2a4c60b23d
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -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);

Wyświetl plik

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