From fdeb8a925f8fd56147e1f84788ded3a08d833537 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 3 May 2015 14:58:33 +0100 Subject: [PATCH 1/2] Introduce template for single tiddler windows Lets us include global macros etc. --- core/modules/startup/windows.js | 2 +- core/templates/single.tiddler.window.tid | 32 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 core/templates/single.tiddler.window.tid diff --git a/core/modules/startup/windows.js b/core/modules/startup/windows.js index 2528a51b0..f27dc8d48 100644 --- a/core/modules/startup/windows.js +++ b/core/modules/startup/windows.js @@ -24,7 +24,7 @@ exports.startup = function() { var refreshHandler, title = event.param || event.tiddlerTitle, paramObject = event.paramObject || {}, - template = paramObject.template || "$:/core/ui/ViewTemplate/body", + template = paramObject.template || "$:/core/templates/single.tiddler.window", width = paramObject.width || "700", height = paramObject.height || "600"; // Open the window diff --git a/core/templates/single.tiddler.window.tid b/core/templates/single.tiddler.window.tid new file mode 100644 index 000000000..a0a8b078e --- /dev/null +++ b/core/templates/single.tiddler.window.tid @@ -0,0 +1,32 @@ +title: $:/core/templates/single.tiddler.window + +<$set name="themeTitle" value={{$:/view}}> + +<$set name="tempCurrentTiddler" value=<>> + +<$set name="currentTiddler" value={{$:/language}}> + +<$set name="languageTitle" value={{!!name}}> + +<$set name="currentTiddler" value=<>> + +<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]"> + +<$navigator story="$:/StoryList" history="$:/HistoryList"> + +<$transclude mode="block"/> + + + + + + + + + + + + + + + From d23f174d014d8dbe68987791d0d4d3b10e8f6a19 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 3 May 2015 15:05:26 +0100 Subject: [PATCH 2/2] Add a margin for single tiddler windows --- core/modules/startup/windows.js | 2 +- themes/tiddlywiki/vanilla/base.tid | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/modules/startup/windows.js b/core/modules/startup/windows.js index f27dc8d48..14920061b 100644 --- a/core/modules/startup/windows.js +++ b/core/modules/startup/windows.js @@ -35,7 +35,7 @@ exports.startup = function() { return; } // Initialise the document - srcDocument.write(""); + srcDocument.write(""); srcDocument.close(); srcDocument.title = title; srcWindow.addEventListener("beforeunload",function(event) { diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 30fc16f06..b47476a9b 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -66,6 +66,10 @@ body.tc-body { <> } +body.tc-body.tc-single-tiddler-window { + margin: 1em; +} + h1, h2, h3, h4, h5, h6 { line-height: 1.2; font-weight: 300;