From 8d12028374543bd4bb0525e03a72a6d9d858aead Mon Sep 17 00:00:00 2001 From: nameanyone Date: Mon, 27 Apr 2015 15:23:41 -0700 Subject: [PATCH 01/14] Update Latest.tid --- editions/tw5.com/tiddlers/community/Latest.tid | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editions/tw5.com/tiddlers/community/Latest.tid b/editions/tw5.com/tiddlers/community/Latest.tid index b4e1f2cb7..3b754ab53 100644 --- a/editions/tw5.com/tiddlers/community/Latest.tid +++ b/editions/tw5.com/tiddlers/community/Latest.tid @@ -21,3 +21,5 @@ The latest news, articles, resources and examples. + + From 29829bb68a06ed65b6da1d333f08ef1f8d92e3fd Mon Sep 17 00:00:00 2001 From: nameanyone Date: Mon, 27 Apr 2015 15:24:38 -0700 Subject: [PATCH 02/14] Update Latest.tid --- editions/fr-FR/tiddlers/Latest.tid | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editions/fr-FR/tiddlers/Latest.tid b/editions/fr-FR/tiddlers/Latest.tid index 44886901c..83d34f54e 100644 --- a/editions/fr-FR/tiddlers/Latest.tid +++ b/editions/fr-FR/tiddlers/Latest.tid @@ -24,3 +24,5 @@ Les informations, articles, ressources et exemples les plus récents. + + From f9c50d9a6d65cbf731abb481fd8b5dc307940efd Mon Sep 17 00:00:00 2001 From: Roma Hicks Date: Mon, 27 Apr 2015 21:31:18 -0500 Subject: [PATCH 03/14] Added text notifying users of issue #1434 --- .../tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid b/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid index bc5a164ac..0c0f53bb2 100644 --- a/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid +++ b/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid @@ -19,3 +19,9 @@ type: text/vnd.tiddlywiki ## Try editing and creating tiddlers The `-g` flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it. + +If you are using Debian or Debian-based Linux and you are reciving a `node: command not found` error though node.js package is installed, you may need to create a symbolic link between `nodejs` and `node`. See github [[issue 1434|http://github.com/Jermolene/TiddlyWiki5/issues/1434]] + +Example Debian v8.0: `sudo ln -s /usr/bin/nodejs /usr/bin/node` + +Consult your distro's manual and `whereis` to correctly create a link. \ No newline at end of file From 5b7a7268d83e78f94b407d19405c928a6541da0e Mon Sep 17 00:00:00 2001 From: Roma Hicks Date: Mon, 27 Apr 2015 21:40:20 -0500 Subject: [PATCH 04/14] Changed structure to use less space. --- .../tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid b/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid index 0c0f53bb2..9f51cc4bb 100644 --- a/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid +++ b/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid @@ -20,8 +20,6 @@ type: text/vnd.tiddlywiki The `-g` flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it. -If you are using Debian or Debian-based Linux and you are reciving a `node: command not found` error though node.js package is installed, you may need to create a symbolic link between `nodejs` and `node`. See github [[issue 1434|http://github.com/Jermolene/TiddlyWiki5/issues/1434]] +If you are using Debian or Debian-based Linux and you are reciving a `node: command not found` error though node.js package is installed, you may need to create a symbolic link between `nodejs` and `node`. Consult your distro's manual and `whereis` to correctly create a link. See github [[issue 1434|http://github.com/Jermolene/TiddlyWiki5/issues/1434]] -Example Debian v8.0: `sudo ln -s /usr/bin/nodejs /usr/bin/node` - -Consult your distro's manual and `whereis` to correctly create a link. \ No newline at end of file +Example Debian v8.0: `sudo ln -s /usr/bin/nodejs /usr/bin/node` \ No newline at end of file From 9693f97b16038ba350ea6ef4bdb55337370c2774 Mon Sep 17 00:00:00 2001 From: Felix Hayashi Date: Wed, 15 Apr 2015 23:02:11 +0200 Subject: [PATCH 05/14] upgrading the navigator widget Motivation / Agenda * https://github.com/Jermolene/TiddlyWiki5/issues/1651 * https://github.com/Jermolene/TiddlyWiki5/issues/1650 Summary * Changed the NavigatorWidget (primarily `addToStory()`) * Applied lingo to settings * Applied lingo to selectbox options --- core/language/en-GB/ControlPanel.multids | 7 +++ core/modules/widgets/navigator.js | 62 ++++++++++++++----- .../ControlPanel/Settings/LinkToBehaviour.tid | 21 +++++++ core/wiki/config/OpenLinkFromInsideRiver.tid | 2 + core/wiki/config/OpenLinkFromOutsideRiver.tid | 2 + 5 files changed, 77 insertions(+), 17 deletions(-) create mode 100644 core/ui/ControlPanel/Settings/LinkToBehaviour.tid create mode 100644 core/wiki/config/OpenLinkFromInsideRiver.tid create mode 100644 core/wiki/config/OpenLinkFromOutsideRiver.tid diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index f9ea31ff8..cfa5e34f4 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -88,6 +88,13 @@ Settings/ToolbarButtons/Icons/Description: Include icon Settings/ToolbarButtons/Text/Description: Include text Settings/DefaultSidebarTab/Caption: Default Sidebar Tab Settings/DefaultSidebarTab/Hint: Specify which sidebar tab is displayed by default +Settings/LinkToBehaviour/Caption: Internal link opening behaviour +Settings/LinkToBehaviour/InsideRiver/Hint: Click occurred //within// the story river +Settings/LinkToBehaviour/OutsideRiver/Hint: Click occurred //outside// the story river +Settings/LinkToBehaviour/OpenAbove: Open above the current tiddler +Settings/LinkToBehaviour/OpenBelow: Open below the current tiddler +Settings/LinkToBehaviour/OpenAtTop: Open at the top of the river +Settings/LinkToBehaviour/OpenAtBottom: Open at the bottom of the river StoryView/Caption: Story View StoryView/Prompt: Current view: Theme/Caption: Theme diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 7809df383..865a12108 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -85,11 +85,6 @@ NavigatorWidget.prototype.saveStoryList = function(storyList) { )); }; -NavigatorWidget.prototype.findTitleInStory = function(storyList,title,defaultIndex) { - var p = storyList.indexOf(title); - return p === -1 ? defaultIndex : p; -}; - NavigatorWidget.prototype.removeTitleFromStory = function(storyList,title) { var p = storyList.indexOf(title); while(p !== -1) { @@ -112,22 +107,55 @@ NavigatorWidget.prototype.replaceFirstTitleInStory = function(storyList,oldTitle storyList.splice(0,0,newTitle); } }; - + NavigatorWidget.prototype.addToStory = function(title,fromTitle) { var storyList = this.getStoryList(); - if(storyList) { - // See if the tiddler is already there - var slot = this.findTitleInStory(storyList,title,-1); - // If not we need to add it - if(slot === -1) { - // First we try to find the position of the story element we navigated from - slot = this.findTitleInStory(storyList,fromTitle,-1) + 1; - // Add the tiddler - storyList.splice(slot,0,title); - // Save the story - this.saveStoryList(storyList); + // Quit if we cannot get hold of the story list + if(!storyList) { + return; + } + // See if the tiddler is already there + var slot = storyList.indexOf(title); + // Quit if it already exists in the story river + if(slot >= 0) { + return; + } + // First we try to find the position of the story element we navigated from + var fromIndex = storyList.indexOf(fromTitle); + if(fromIndex >= 0) { + // How to open internal links that were clicked from *within* the story river? + var openLinkFromInsideRiver = $tw.wiki.getTiddlerText("$:/config/Navigation/openLinkFromInsideRiver", "below"); + // The tiddler is added from inside the river + // Determine where to insert the tiddler; Fallback is "below" + switch(openLinkFromInsideRiver) { + case "top": + slot = 0; + break; + case "bottom": + slot = storyList.length; + break; + case "above": + slot = fromIndex; + break; + default: + slot = fromIndex + 1; + } + } else { + // The tiddler is opened from outside the river. + var openLinkFromOutsideRiver = $tw.wiki.getTiddlerText("$:/config/Navigation/openLinkFromOutsideRiver", "top"); + // Determine where to insert the tiddler; Default is "top" + if(openLinkFromOutsideRiver === "bottom") { + // Insert at bottom + slot = storyList.length; + } else { + // Insert at top + slot = 0; } } + // Add the tiddler + storyList.splice(slot,0,title); + // Save the story + this.saveStoryList(storyList); }; /* diff --git a/core/ui/ControlPanel/Settings/LinkToBehaviour.tid b/core/ui/ControlPanel/Settings/LinkToBehaviour.tid new file mode 100644 index 000000000..0dbd1973c --- /dev/null +++ b/core/ui/ControlPanel/Settings/LinkToBehaviour.tid @@ -0,0 +1,21 @@ +title: $:/core/ui/ControlPanel/Settings/LinkToBehaviour +tags: $:/tags/ControlPanel/Settings +caption: {{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}} + +\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/ + +<$link to="$:/config/Navigation/openLinkFromInsideRiver"><> + +<$select tiddler="$:/config/Navigation/openLinkFromInsideRiver"> + + + + + + +<$link to="$:/config/Navigation/openLinkFromOutsideRiver"><> + +<$select tiddler="$:/config/Navigation/openLinkFromOutsideRiver"> + + + diff --git a/core/wiki/config/OpenLinkFromInsideRiver.tid b/core/wiki/config/OpenLinkFromInsideRiver.tid new file mode 100644 index 000000000..3beb24053 --- /dev/null +++ b/core/wiki/config/OpenLinkFromInsideRiver.tid @@ -0,0 +1,2 @@ +title: $:/config/Navigation/openLinkFromInsideRiver +text: below \ No newline at end of file diff --git a/core/wiki/config/OpenLinkFromOutsideRiver.tid b/core/wiki/config/OpenLinkFromOutsideRiver.tid new file mode 100644 index 000000000..07577385e --- /dev/null +++ b/core/wiki/config/OpenLinkFromOutsideRiver.tid @@ -0,0 +1,2 @@ +title: $:/config/Navigation/openLinkFromOutsideRiver +text: top \ No newline at end of file From 48dcf959ffb866ecb0025ccbcec3ee22a25c132d Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 3 May 2015 16:23:35 +0100 Subject: [PATCH 06/14] Refactor browser unload task handling Make it possible to register multiple task functions that will be called when the window is unloaded --- boot/boot.js | 26 +++++++++++++++++++++++++- core/modules/saver-handler.js | 4 ++-- core/modules/syncer.js | 4 ++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 7161da3bd..bc974c6d5 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1738,7 +1738,8 @@ $tw.boot.startup = function(options) { languagesEnvVar: "TIDDLYWIKI_LANGUAGE_PATH", editionsEnvVar: "TIDDLYWIKI_EDITION_PATH" }, - log: {} // Log flags + log: {}, // Log flags + unloadTasks: [] }); if(!$tw.boot.tasks.readBrowserTiddlers) { // For writable tiddler files, a hashmap of title to {filepath:,type:,hasMetaFile:} @@ -1797,6 +1798,20 @@ $tw.boot.startup = function(options) { // Install the tiddler deserializer modules $tw.Wiki.tiddlerDeserializerModules = Object.create(null); $tw.modules.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerModules); + // Call unload handlers in the browser + if($tw.browser) { + window.onbeforeunload = function(event) { + event = event || {}; + var result; + $tw.utils.each($tw.unloadTasks,function(task) { + var r = task(event); + if(r) { + result = r; + } + }); + return result; + } + } // Load tiddlers if($tw.boot.tasks.readBrowserTiddlers) { $tw.loadTiddlersBrowser(); @@ -1833,6 +1848,15 @@ $tw.boot.startup = function(options) { $tw.boot.executeNextStartupTask(); }; +/* +Add another unload task +*/ +$tw.addUnloadTask = function(task) { + if($tw.unloadTasks.indexOf(task) === -1) { + $tw.unloadTasks.push(task); + } +} + /* Execute the remaining eligible startup tasks */ diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js index 3344495c7..78e0598a6 100644 --- a/core/modules/saver-handler.js +++ b/core/modules/saver-handler.js @@ -75,14 +75,14 @@ function SaverHandler(options) { } }); // Set up our beforeunload handler - window.onbeforeunload = function(event) { + $tw.addUnloadTask(function(event) { var confirmationMessage; if(self.isDirty()) { confirmationMessage = $tw.language.getString("UnsavedChangesWarning"); event.returnValue = confirmationMessage; // Gecko } return confirmationMessage; - }; + }); } // Install the save action handlers if($tw.browser) { diff --git a/core/modules/syncer.js b/core/modules/syncer.js index 617c54155..223998e1c 100644 --- a/core/modules/syncer.js +++ b/core/modules/syncer.js @@ -39,14 +39,14 @@ function Syncer(options) { // Browser event handlers if($tw.browser) { // Set up our beforeunload handler - window.onbeforeunload = function(event) { + $tw.addUnloadTask(function(event) { var confirmationMessage; if(self.isDirty()) { confirmationMessage = $tw.language.getString("UnsavedChangesWarning"); event.returnValue = confirmationMessage; // Gecko } return confirmationMessage; - }; + }); // Listen out for login/logout/refresh events in the browser $tw.rootWidget.addEventListener("tm-login",function() { self.handleLoginEvent(); From 3f26492ac8a187ea8f16802b84452677d5078200 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 3 May 2015 16:24:02 +0100 Subject: [PATCH 07/14] Close subwindows when closing main window --- core/modules/startup/windows.js | 15 ++++++++++++++- themes/tiddlywiki/vanilla/base.tid | 11 +++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/core/modules/startup/windows.js b/core/modules/startup/windows.js index 14920061b..16a878b88 100644 --- a/core/modules/startup/windows.js +++ b/core/modules/startup/windows.js @@ -18,7 +18,11 @@ exports.platforms = ["browser"]; exports.after = ["startup"]; exports.synchronous = true; +// Global to keep track of open windows (hashmap by title) +var windows = {}; + exports.startup = function() { + // Handle open window message $tw.rootWidget.addEventListener("tm-open-window",function(event) { // Get the parameters var refreshHandler, @@ -30,6 +34,7 @@ exports.startup = function() { // Open the window var srcWindow = window.open("","external-" + title,"width=" + width + ",height=" + height), srcDocument = srcWindow.document; + windows[title] = srcWindow; // Check for reopening the same window if(srcWindow.haveInitialisedWindow) { return; @@ -39,6 +44,7 @@ exports.startup = function() { srcDocument.close(); srcDocument.title = title; srcWindow.addEventListener("beforeunload",function(event) { + delete windows[title]; $tw.wiki.removeEventListener("change",refreshHandler); },false); // Set up the styles @@ -50,7 +56,7 @@ exports.startup = function() { srcDocument.head.insertBefore(styleElement,srcDocument.head.firstChild); // Render the text of the tiddler var parser = $tw.wiki.parseTiddler(template), - widgetNode = $tw.wiki.makeWidget(parser,{document: srcDocument, variables: {currentTiddler: title}}); + widgetNode = $tw.wiki.makeWidget(parser,{document: srcDocument, parentWidget: $tw.rootWidget, variables: {currentTiddler: title}}); widgetNode.render(srcDocument.body,null); // Function to handle refreshes refreshHandler = function(changes) { @@ -62,6 +68,13 @@ exports.startup = function() { $tw.wiki.addEventListener("change",refreshHandler); srcWindow.haveInitialisedWindow = true; }); + // Close open windows when unloading main window + $tw.addUnloadTask(function() { + $tw.utils.each(windows,function(win) { + win.close(); + }); + }); + }; })(); diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index b47476a9b..cf8848d3b 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -66,10 +66,6 @@ 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; @@ -345,6 +341,7 @@ button svg, button img { height: 2em; width: 2em; vertical-align: middle; + fill: <>; } .tc-sidebar-lists input { @@ -821,6 +818,11 @@ canvas.tc-edit-bitmapeditor { overflow: hidden; /* https://github.com/Jermolene/TiddlyWiki5/issues/282 */ } +html body.tc-body.tc-single-tiddler-window { + margin: 1em; + background-color: <>; +} + /* ** Toolbar buttons */ @@ -1740,6 +1742,7 @@ body.tc-dirty span.tc-dirty-indicator, body.tc-dirty span.tc-dirty-indicator svg opacity: 1; min-width: 100%; min-height: 100%; + max-width: 100%; } .tc-thumbnail-wrapper:hover .tc-thumbnail-image svg, From 0932c15e5c0c1beb1f7d14f895be800b1f52770e Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 3 May 2015 16:56:27 +0100 Subject: [PATCH 08/14] Clarify rendering parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit srcDocument.body.firstChild will in fact be null, but it’s clearer to write it out --- core/modules/startup/windows.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/startup/windows.js b/core/modules/startup/windows.js index 16a878b88..d2a5517e3 100644 --- a/core/modules/startup/windows.js +++ b/core/modules/startup/windows.js @@ -57,7 +57,7 @@ exports.startup = function() { // Render the text of the tiddler var parser = $tw.wiki.parseTiddler(template), widgetNode = $tw.wiki.makeWidget(parser,{document: srcDocument, parentWidget: $tw.rootWidget, variables: {currentTiddler: title}}); - widgetNode.render(srcDocument.body,null); + widgetNode.render(srcDocument.body,srcDocument.body.firstChild); // Function to handle refreshes refreshHandler = function(changes) { if(styleWidgetNode.refresh(changes,styleContainer,null)) { From 403a4600020969cb8447f4cc8f790e58c57eed47 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 3 May 2015 16:56:37 +0100 Subject: [PATCH 09/14] Check for dom node not found --- core/modules/widgets/widget.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index bbcf5b025..53c5ea46b 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -434,7 +434,9 @@ if(index === -1) { var grandParent = parent.parentWidget; if(grandParent && parent.parentDomNode === this.parentDomNode) { index = grandParent.children.indexOf(parent); - return parent.findNextSiblingDomNode(index); + if(index !== -1) { + return parent.findNextSiblingDomNode(index); + } } return null; }; From ef971bb521f50a7bbe2f6020d793241f7864897d Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 3 May 2015 17:05:34 +0100 Subject: [PATCH 10/14] Correct tiddler background colour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bitmap backgrounds won’t get overridden unless we override the entire background property. --- themes/tiddlywiki/vanilla/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index cf8848d3b..77656b363 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -820,7 +820,7 @@ canvas.tc-edit-bitmapeditor { html body.tc-body.tc-single-tiddler-window { margin: 1em; - background-color: <>; + background: <>; } /* From b51603f3e2f68bc2f962d20d855c36987c8fbc40 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 4 May 2015 19:19:40 +0100 Subject: [PATCH 11/14] Introduce fluid story/fixed sidebar mode A new mode where the sidebar width is fixed and the story river expands to fill the remaining space. --- .../system/TiddlyWiki Pre-release.tid | 12 +++++ themes/tiddlywiki/vanilla/ThemeTweaks.tid | 2 + themes/tiddlywiki/vanilla/base.tid | 48 ++++++++++++++++++- themes/tiddlywiki/vanilla/metrics.multids | 1 + themes/tiddlywiki/vanilla/options.multids | 1 + 5 files changed, 63 insertions(+), 1 deletion(-) diff --git a/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid b/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid index 3de79fc5a..fe203f8f9 100644 --- a/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid +++ b/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid @@ -11,6 +11,18 @@ It is provided for testing purposes. Please don't try to use it for anything imp ! Features for 5.1.9 +!! New "Fluid story, fixed sidebar" mode + +In response to popular demand, it is now possible to arrange the main window so that the sidebar has a fixed width and the story river expands to fill the remaining space. + +To switch it on, visit ''Theme Tweaks'' in the $:/ControlPanel ''Appearance'' tab and use the following options: + +* Sidebar layout: +** ''Fixed story, fluid sidebar'' (default) - the story river has a fixed width and the sidebar fills the remaining space +** ''Fluid story, fixed sidebar'' - the story river expands to fill horizontal space remaining after the fixed width sidebar +* Sidebar width: +** The width of the sidebar. Can be specified in pixels (eg ''350px''), a percentage (eg ''25%'') or other [[CSS unit|https://developer.mozilla.org/en/docs/Web/CSS/length]] + !! New Tiddler Toolbar Button: "Open in new window" An experimental new tiddler toolbar button opens a single tiddler in a separate pop-up browser window. The tiddler will be dynamically updated just as in the main window. There are several uses: diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 129e3c12b..bfc4075b0 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -42,6 +42,7 @@ You can tweak certain aspects of the ''Vanilla'' theme. ! Options +|[[Sidebar layout|$:/themes/tiddlywiki/vanilla/options/sidebarlayout]] |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarlayout"> | |[[Sticky titles|$:/themes/tiddlywiki/vanilla/options/stickytitles]]
//Causes tiddler titles to "stick" to the top of the browser window. Caution: Does not work at all with Chrome, and causes some layout issues in Firefox// |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/stickytitles"> | ! Settings @@ -64,3 +65,4 @@ You can tweak certain aspects of the ''Vanilla'' theme. |[[Story width|$:/themes/tiddlywiki/vanilla/metrics/storywidth]]
//the overall width of the story river// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" default="" tag="input"/> | |[[Tiddler width|$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth]]
//within the story river//
|^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" default="" tag="input"/> | |[[Sidebar breakpoint|$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint]]
//the minimum page width at which the story
river and sidebar will appear side by side// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint" default="" tag="input"/> | +|[[Sidebar width|$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth]]
//the width of the sidebar in fluid-fixed layout// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" default="" tag="input"/> | diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 77656b363..3e14ff38b 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -21,7 +21,16 @@ background-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}` \end -\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline +\define if-fluid-fixed(text,hiddenSidebarText) +<$reveal state="$:/themes/tiddlywiki/vanilla/options/sidebarlayout" type="match" text="fluid-fixed"> +$text$ +<$reveal state="$:/state/sidebar" type="nomatch" text="yes" default="yes"> +$hiddenSidebarText$ + + +\end + +\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock /* ** Start with the normalize CSS reset, and then belay some of its effects @@ -823,6 +832,43 @@ html body.tc-body.tc-single-tiddler-window { background: <>; } +/* +** Adjustments for fluid-fixed mode +*/ + +@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) { + +<> + +} + /* ** Toolbar buttons */ diff --git a/themes/tiddlywiki/vanilla/metrics.multids b/themes/tiddlywiki/vanilla/metrics.multids index 174c0b00f..3607bd6c9 100644 --- a/themes/tiddlywiki/vanilla/metrics.multids +++ b/themes/tiddlywiki/vanilla/metrics.multids @@ -10,3 +10,4 @@ storyright: 770px storywidth: 770px tiddlerwidth: 686px sidebarbreakpoint: 960px +sidebarwidth: 350px diff --git a/themes/tiddlywiki/vanilla/options.multids b/themes/tiddlywiki/vanilla/options.multids index e8189b8c2..036092379 100644 --- a/themes/tiddlywiki/vanilla/options.multids +++ b/themes/tiddlywiki/vanilla/options.multids @@ -1,3 +1,4 @@ title: $:/themes/tiddlywiki/vanilla/options/ stickytitles: no +sidebarlayout: fixed-fluid From a79e7a1c57d9a47bc2e7af834bb0495f60b39180 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 4 May 2015 20:29:00 +0100 Subject: [PATCH 12/14] Tweaks for #1662 Coding style and ui copy --- core/language/en-GB/ControlPanel.multids | 10 +++++----- core/modules/widgets/navigator.js | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index cfa5e34f4..6b291ebf6 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -88,13 +88,13 @@ Settings/ToolbarButtons/Icons/Description: Include icon Settings/ToolbarButtons/Text/Description: Include text Settings/DefaultSidebarTab/Caption: Default Sidebar Tab Settings/DefaultSidebarTab/Hint: Specify which sidebar tab is displayed by default -Settings/LinkToBehaviour/Caption: Internal link opening behaviour -Settings/LinkToBehaviour/InsideRiver/Hint: Click occurred //within// the story river -Settings/LinkToBehaviour/OutsideRiver/Hint: Click occurred //outside// the story river +Settings/LinkToBehaviour/Caption: Tiddler Opening Behaviour +Settings/LinkToBehaviour/InsideRiver/Hint: Navigation from //within// the story river +Settings/LinkToBehaviour/OutsideRiver/Hint: Navigation from //outside// the story river Settings/LinkToBehaviour/OpenAbove: Open above the current tiddler Settings/LinkToBehaviour/OpenBelow: Open below the current tiddler -Settings/LinkToBehaviour/OpenAtTop: Open at the top of the river -Settings/LinkToBehaviour/OpenAtBottom: Open at the bottom of the river +Settings/LinkToBehaviour/OpenAtTop: Open at the top of the story river +Settings/LinkToBehaviour/OpenAtBottom: Open at the bottom of the story river StoryView/Caption: Story View StoryView/Prompt: Current view: Theme/Caption: Theme diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 865a12108..1a66990be 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -107,7 +107,7 @@ NavigatorWidget.prototype.replaceFirstTitleInStory = function(storyList,oldTitle storyList.splice(0,0,newTitle); } }; - + NavigatorWidget.prototype.addToStory = function(title,fromTitle) { var storyList = this.getStoryList(); // Quit if we cannot get hold of the story list @@ -124,7 +124,7 @@ NavigatorWidget.prototype.addToStory = function(title,fromTitle) { var fromIndex = storyList.indexOf(fromTitle); if(fromIndex >= 0) { // How to open internal links that were clicked from *within* the story river? - var openLinkFromInsideRiver = $tw.wiki.getTiddlerText("$:/config/Navigation/openLinkFromInsideRiver", "below"); + var openLinkFromInsideRiver = $tw.wiki.getTiddlerText("$:/config/Navigation/openLinkFromInsideRiver","below"); // The tiddler is added from inside the river // Determine where to insert the tiddler; Fallback is "below" switch(openLinkFromInsideRiver) { @@ -142,11 +142,11 @@ NavigatorWidget.prototype.addToStory = function(title,fromTitle) { } } else { // The tiddler is opened from outside the river. - var openLinkFromOutsideRiver = $tw.wiki.getTiddlerText("$:/config/Navigation/openLinkFromOutsideRiver", "top"); + var openLinkFromOutsideRiver = $tw.wiki.getTiddlerText("$:/config/Navigation/openLinkFromOutsideRiver","top"); // Determine where to insert the tiddler; Default is "top" if(openLinkFromOutsideRiver === "bottom") { // Insert at bottom - slot = storyList.length; + slot = storyList.length; } else { // Insert at top slot = 0; From 1e2514f0a8a6acc05ca5ec3391b317db2f9a74af Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 4 May 2015 21:34:42 +0100 Subject: [PATCH 13/14] Default to fluid-fixed for the prerelease MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maybe we should change the default for tiddlywiki.com, but let’s hear some views on that. --- themes/tiddlywiki/vanilla/options.multids | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/options.multids b/themes/tiddlywiki/vanilla/options.multids index 036092379..d06b052aa 100644 --- a/themes/tiddlywiki/vanilla/options.multids +++ b/themes/tiddlywiki/vanilla/options.multids @@ -1,4 +1,4 @@ title: $:/themes/tiddlywiki/vanilla/options/ stickytitles: no -sidebarlayout: fixed-fluid +sidebarlayout: fluid-fixed From 5528906a6b00c194bb4a816c824618e28688f96d Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 4 May 2015 21:35:11 +0100 Subject: [PATCH 14/14] Fixes for zoomin storyview and fluid-fixed mode --- themes/tiddlywiki/vanilla/base.tid | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 3e14ff38b..5a282ed27 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -841,6 +841,7 @@ html body.tc-body.tc-single-tiddler-window { <> }