From e59f97b9c572c0c51db249ac6fe2de1a3b09a571 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 12 Mar 2023 16:02:30 +0000
Subject: [PATCH 1/3] Add editor panel to tiddler manager
---
core/language/en-GB/Misc.multids | 1 +
core/ui/Manager/ItemMainEditor.tid | 5 +++++
core/wiki/config/ManagerItemState.multids | 3 ++-
3 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 core/ui/Manager/ItemMainEditor.tid
diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids
index 52545bd86..60febfe3c 100644
--- a/core/language/en-GB/Misc.multids
+++ b/core/language/en-GB/Misc.multids
@@ -56,6 +56,7 @@ Manager/Controls/Show/Option/Tiddlers: tiddlers
Manager/Controls/Show/Prompt: Show:
Manager/Controls/Sort/Prompt: Sort by:
Manager/Item/Colour: Colour
+Manager/Item/Editor: Editor
Manager/Item/Fields: Fields
Manager/Item/Icon/None: (none)
Manager/Item/Icon: Icon
diff --git a/core/ui/Manager/ItemMainEditor.tid b/core/ui/Manager/ItemMainEditor.tid
new file mode 100644
index 000000000..80e67519a
--- /dev/null
+++ b/core/ui/Manager/ItemMainEditor.tid
@@ -0,0 +1,5 @@
+title: $:/Manager/ItemMain/Editor
+tags: $:/tags/Manager/ItemMain
+caption: {{$:/language/Manager/Item/Editor}}
+
+<$edit-text tag="textarea" class="tc-edit-texteditor tc-edit-texteditor-body tc-max-width"/>
diff --git a/core/wiki/config/ManagerItemState.multids b/core/wiki/config/ManagerItemState.multids
index 845034ff6..e5cbd6269 100644
--- a/core/wiki/config/ManagerItemState.multids
+++ b/core/wiki/config/ManagerItemState.multids
@@ -1,3 +1,4 @@
title: $:/state/popup/manager/item/$:/Manager/
-ItemMain/RawText: hide
\ No newline at end of file
+ItemMain/RawText: hide
+ItemMain/Editor: hide
From 1ed32172392d1eb6bd7f1707dd7ce783b2629497 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 12 Mar 2023 16:02:49 +0000
Subject: [PATCH 2/3] Add delete button to tiddler manager
---
core/ui/Manager/ItemSidebarTools.tid | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/core/ui/Manager/ItemSidebarTools.tid b/core/ui/Manager/ItemSidebarTools.tid
index 8c46e1d90..2b6ad4a2e 100644
--- a/core/ui/Manager/ItemSidebarTools.tid
+++ b/core/ui/Manager/ItemSidebarTools.tid
@@ -13,3 +13,8 @@ caption: {{$:/language/Manager/Item/Tools}}
{{$:/core/images/edit-button}} edit
$button>
+
+<$button message="tm-delete-tiddler" param=<>>
+{{$:/core/images/delete-button}} delete
+$button>
+
From c3ca72ebe21fc0a024d938866ee213dc01f9fff7 Mon Sep 17 00:00:00 2001
From: "jeremy@jermolene.com"
Date: Sun, 12 Mar 2023 16:05:45 +0000
Subject: [PATCH 3/3] 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"/>
+$list>
+
+
+
Tiddlers
+
+<$transclude tiddler="$:/Manager" mode="block"/>
+
+$navigator>
+
+
\ No newline at end of file