1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Add new safe mode layout

This commit is contained in:
jeremy@jermolene.com 2023-03-12 16:05:45 +00:00
parent 1ed3217239
commit c3ca72ebe2
3 changed files with 40 additions and 1 deletions

View File

@ -1542,6 +1542,8 @@ $tw.Wiki.prototype.processSafeMode = function() {
this.addTiddler(new $tw.Tiddler({title: titleReportTiddler, text: report.join("\n\n")})); this.addTiddler(new $tw.Tiddler({title: titleReportTiddler, text: report.join("\n\n")}));
// Set $:/DefaultTiddlers to point to our report // Set $:/DefaultTiddlers to point to our report
this.addTiddler(new $tw.Tiddler({title: "$:/DefaultTiddlers", text: "[[" + titleReportTiddler + "]]"})); this.addTiddler(new $tw.Tiddler({title: "$:/DefaultTiddlers", text: "[[" + titleReportTiddler + "]]"}));
// Switch to the safe mode layout
this.addTiddler({title: "$:/layout", text: "$:/core/ui/SafeLayout"});
}; };
/* /*

View File

@ -214,7 +214,7 @@ function updateLocationHash(options) {
break; break;
} }
// Only change the location hash if we must, thus avoiding unnecessary onhashchange events // 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") { if(options.updateHistory === "yes") {
// Assign the location hash so that history is updated // Assign the location hash so that history is updated
window.location.hash = $tw.locationHash; window.location.hash = $tw.locationHash;

View File

@ -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
<div style="margin: 1em;">
<$navigator story="$:/StoryList" history="$:/HistoryList">
<h2>Layout</h2>
{{$:/snippets/LayoutSwitcher}}
<h2>Controls</h2>
<div class="tc-page-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]">
<$transclude mode="inline"/>
</$list>
</div>
<h2>Tiddlers</h2>
<$transclude tiddler="$:/Manager" mode="block"/>
</$navigator>
</div>