From c3ca72ebe21fc0a024d938866ee213dc01f9fff7 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Sun, 12 Mar 2023 16:05:45 +0000 Subject: [PATCH] Add new safe mode layout --- boot/boot.js | 2 ++ core/modules/startup/story.js | 2 +- core/ui/SafeModeLayout.tid | 37 +++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 core/ui/SafeModeLayout.tid diff --git a/boot/boot.js b/boot/boot.js index 89fafce6a..9da1d7f60 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1542,6 +1542,8 @@ $tw.Wiki.prototype.processSafeMode = function() { this.addTiddler(new $tw.Tiddler({title: titleReportTiddler, text: report.join("\n\n")})); // Set $:/DefaultTiddlers to point to our report this.addTiddler(new $tw.Tiddler({title: "$:/DefaultTiddlers", text: "[[" + titleReportTiddler + "]]"})); + // Switch to the safe mode layout + this.addTiddler({title: "$:/layout", text: "$:/core/ui/SafeLayout"}); }; /* diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index 734f6ae76..aad3f3c71 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -214,7 +214,7 @@ function updateLocationHash(options) { break; } // Only change the location hash if we must, thus avoiding unnecessary onhashchange events - if($tw.utils.getLocationHash() !== $tw.locationHash) { + if($tw.utils.getLocationHash() !== $tw.locationHash && !$tw.safeMode) { if(options.updateHistory === "yes") { // Assign the location hash so that history is updated window.location.hash = $tw.locationHash; diff --git a/core/ui/SafeModeLayout.tid b/core/ui/SafeModeLayout.tid new file mode 100644 index 000000000..af13cc9e3 --- /dev/null +++ b/core/ui/SafeModeLayout.tid @@ -0,0 +1,37 @@ +title: $:/core/ui/SafeLayout +tags: $:/tags/Layout +name: Safe Mode Layout +description: Safe Mode Layout +icon: $:/core/images/list + +\whitespace trim + +\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] + +\define tv-config-toolbar-class() tc-btn-invisible +\define tv-config-toolbar-icons() yes +\define tv-config-toolbar-text() no + +
+ +<$navigator story="$:/StoryList" history="$:/HistoryList"> + +

Layout

+ +{{$:/snippets/LayoutSwitcher}} + +

Controls

+ +
+<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]"> +<$transclude mode="inline"/> + +
+ +

Tiddlers

+ +<$transclude tiddler="$:/Manager" mode="block"/> + + + +
\ No newline at end of file