diff --git a/plugins/tiddlywiki/internals/editpreviews/widget-tree.tid b/plugins/tiddlywiki/internals/editpreviews/widget-tree.tid
index 36a2b437c..457ca7e96 100644
--- a/plugins/tiddlywiki/internals/editpreviews/widget-tree.tid
+++ b/plugins/tiddlywiki/internals/editpreviews/widget-tree.tid
@@ -3,8 +3,14 @@ tags: $:/tags/EditPreview
caption: widget tree
list-after: $:/plugins/tiddlywiki/internals/EditTemplate/body/preview/parse-tree
-\define preview(mode,output)
-<$widget-tree mode="$mode$" output="$output$"/>
+\define preview(mode)
+<$wikify name="preview-text" text={{!!text}} type={{!!type}} mode="$mode$" output="widgettree">
+
+
+<$text text=<>/>
+
+
+$wikify>
\end
{{||$:/plugins/tiddlywiki/internals/EditTemplate/body/preview/shared}}
diff --git a/plugins/tiddlywiki/internals/widgets/parse-tree.js b/plugins/tiddlywiki/internals/widgets/parse-tree.js
deleted file mode 100644
index c2e1c780f..000000000
--- a/plugins/tiddlywiki/internals/widgets/parse-tree.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/*\
-title: $:/$:/plugins/tiddlywiki/internals/widgets/parse-tree.js
-type: application/javascript
-module-type: widget
-
-Widget to render the parse tree of a tiddler
-
-\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
-"use strict";
-
-var Widget = require("$:/core/modules/widgets/widget.js").widget;
-
-var ParseTreeWidget = function(parseTreeNode,options) {
- this.initialise(parseTreeNode,options);
-};
-
-/*
-Inherit from the base widget class
-*/
-ParseTreeWidget.prototype = new Widget();
-
-/*
-Render this widget into the DOM
-*/
-ParseTreeWidget.prototype.render = function(parent,nextSibling) {
- var self = this;
- this.parentDomNode = parent;
- this.computeAttributes();
- this.execute();
- this.renderChildren(parent,nextSibling);
-};
-
-/*
-Compute the internal state of the widget
-*/
-ParseTreeWidget.prototype.execute = function() {
- // Get our parameters
- this.parseTreeTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
- this.parseTreeInlineMode = this.getAttribute("mode","block") === "inline";
- // Compute the parse tree
- var parser = this.wiki.parseTiddler(this.parseTreeTitle,{parseAsInline: this.parseTreeInlineMode}),
- parseTreeNodes = [];
- if(parser) {
- parseTreeNodes = [{
- type: "codeblock",
- attributes: {
- code: {type: "string", value: JSON.stringify(parser.tree,0,$tw.config.preferences.jsonSpaces)},
- language: {type: "string", value: "json"}
- }
- }];
- }
- // Make the child widgets
- this.makeChildWidgets(parseTreeNodes);
-};
-
-/*
-Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
-*/
-ParseTreeWidget.prototype.refresh = function(changedTiddlers) {
- var changedAttributes = this.computeAttributes();
- // Completely rerender if any of our attributes have changed
- if(changedAttributes.tiddler || changedAttributes.mode || changedTiddlers[this.parseTreeTitle]) {
- this.refreshSelf();
- return true;
- }
- return false;
-};
-
-exports["parse-tree"] = ParseTreeWidget;
-
-})();
diff --git a/plugins/tiddlywiki/internals/widgets/widget-tree.js b/plugins/tiddlywiki/internals/widgets/widget-tree.js
deleted file mode 100644
index bc812482f..000000000
--- a/plugins/tiddlywiki/internals/widgets/widget-tree.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*\
-title: $:/plugins/tiddlywiki/internals/widgets/widget-tree.js
-type: application/javascript
-module-type: widget
-
-Widget to render the widget tree of a tiddler
-
-\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
-"use strict";
-
-var Widget = require("$:/core/modules/widgets/widget.js").widget;
-
-var WidgetTreeWidget = function(parseTreeNode,options) {
- this.initialise(parseTreeNode,options);
-};
-
-/*
-Inherit from the base widget class
-*/
-WidgetTreeWidget.prototype = new Widget();
-
-/*
-Render this widget into the DOM
-*/
-WidgetTreeWidget.prototype.render = function(parent,nextSibling) {
- var self = this;
- this.parentDomNode = parent;
- this.computeAttributes();
- this.execute();
- this.renderChildren(parent,nextSibling);
-};
-
-/*
-Compute the internal state of the widget
-*/
-WidgetTreeWidget.prototype.execute = function() {
- // Get our parameters
- this.widgetTreeTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
- this.widgetTreeInlineMode = this.getAttribute("mode","block") === "inline";
- // Compute the widget tree
- var parser = this.wiki.parseTiddler(this.widgetTreeTitle,{parseAsInline: this.widgetTreeInlineMode}),
- results;
- if(parser) {
- var widgetNode = this.wiki.makeWidget(parser,{
- parentWidget: this
- }),
- container = $tw.fakeDocument.createElement("div"),
- copyNode = function(widgetNode,resultNode) {
- var type = widgetNode.parseTreeNode.type;
- resultNode.type = type;
- switch(type) {
- case "element":
- resultNode.tag = widgetNode.parseTreeNode.tag;
- break;
- case "text":
- resultNode.text = widgetNode.parseTreeNode.text;
- break;
- }
- if(Object.keys(widgetNode.attributes || {}).length > 0) {
- resultNode.attributes = {};
- $tw.utils.each(widgetNode.attributes,function(attr,attrName) {
- resultNode.attributes[attrName] = widgetNode.getAttribute(attrName);
- });
- }
- if(Object.keys(widgetNode.children || {}).length > 0) {
- resultNode.children = [];
- $tw.utils.each(widgetNode.children,function(widgetChildNode) {
- var node = {};
- resultNode.children.push(node);
- copyNode(widgetChildNode,node);
- });
- }
- };
- widgetNode.render(container,null);
- results = {};
- copyNode(widgetNode,results);
- }
- // Make the child widgets
- this.makeChildWidgets([{
- type: "codeblock",
- attributes: {
- code: {type: "string", value: (results && results.children) ? JSON.stringify(results.children,0,$tw.config.preferences.jsonSpaces) : ""},
- language: {type: "string", value: "json"}
- }
- }]);
-};
-
-/*
-Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
-*/
-WidgetTreeWidget.prototype.refresh = function(changedTiddlers) {
- var changedAttributes = this.computeAttributes();
- // Completely rerender if any of our attributes have changed
- if(changedAttributes.tiddler || changedAttributes.mode || changedTiddlers[this.widgetTreeTitle]) {
- this.refreshSelf();
- return true;
- }
- return false;
-};
-
-exports["widget-tree"] = WidgetTreeWidget;
-
-})();
diff --git a/plugins/tiddlywiki/markdown/dialect.tid b/plugins/tiddlywiki/markdown/dialect.tid
old mode 100644
new mode 100755
diff --git a/plugins/tiddlywiki/markdown/docs_type_markdown.tid b/plugins/tiddlywiki/markdown/docs_type_markdown.tid
old mode 100644
new mode 100755
diff --git a/plugins/tiddlywiki/markdown/files/markdown.js b/plugins/tiddlywiki/markdown/files/markdown.js
old mode 100644
new mode 100755
diff --git a/plugins/tiddlywiki/markdown/files/tiddlywiki.files b/plugins/tiddlywiki/markdown/files/tiddlywiki.files
old mode 100644
new mode 100755
diff --git a/plugins/tiddlywiki/markdown/plugin.info b/plugins/tiddlywiki/markdown/plugin.info
old mode 100644
new mode 100755
diff --git a/plugins/tiddlywiki/markdown/readme.tid b/plugins/tiddlywiki/markdown/readme.tid
old mode 100644
new mode 100755
diff --git a/plugins/tiddlywiki/markdown/usage.tid b/plugins/tiddlywiki/markdown/usage.tid
old mode 100644
new mode 100755
diff --git a/plugins/tiddlywiki/markdown/wrapper.js b/plugins/tiddlywiki/markdown/wrapper.js
old mode 100644
new mode 100755
diff --git a/plugins/tiddlywiki/translators/templates/snippet-tid.tid b/plugins/tiddlywiki/translators/templates/snippet-tid.tid
new file mode 100644
index 000000000..6b3578a33
--- /dev/null
+++ b/plugins/tiddlywiki/translators/templates/snippet-tid.tid
@@ -0,0 +1,11 @@
+title: $:/plugins/tiddlywiki/translators/templates/snippet-tid
+
+\define generateTid(title)
+title: $:/language/Snippets/$title$
+tags: $:/tags/TextEditor/Snippet
+mode: wikified
+caption: <$text text={{$:/language/Snippets/$title$!!caption}}/>
+
+<$text text={{$:/language/Snippets/$title$}}/>
+\end
+<$macrocall $name="generateTid" title=<
>/>
\ No newline at end of file
diff --git a/plugins/tiddlywiki/translators/ui/editorTag.tid b/plugins/tiddlywiki/translators/ui/editorTag.tid
index 81f163abc..02b3c8ce3 100644
--- a/plugins/tiddlywiki/translators/ui/editorTag.tid
+++ b/plugins/tiddlywiki/translators/ui/editorTag.tid
@@ -1,3 +1,3 @@
title: $:/plugins/tiddlywiki/translators/editorTag
-input
\ No newline at end of file
+textarea
\ No newline at end of file
diff --git a/plugins/tiddlywiki/translators/ui/group/Snippets.tid b/plugins/tiddlywiki/translators/ui/group/Snippets.tid
new file mode 100644
index 000000000..6880c58a1
--- /dev/null
+++ b/plugins/tiddlywiki/translators/ui/group/Snippets.tid
@@ -0,0 +1,16 @@
+title: $:/plugins/tiddlywiki/translators/ui/group/Snippets
+caption: Snippets
+tags: $:/tags/TranslationGroup
+
+\define translatableTiddlerTitles()
+[all[tiddlers+shadows]prefix[$:/language/Snippets/]sort[title]]
+\end
+\define shortenTitle()
+[all[current]removeprefix[$:/language/Snippets/]]
+\end
+
+! Snippets
+
+Text snippets for use by the stamp text editor toolbar button.
+
+<>
diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid
index 360c4b978..e1e42d0ed 100644
--- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid
+++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid
@@ -2,22 +2,23 @@ title: $:/themes/tiddlywiki/vanilla/themetweaks
tags: $:/tags/ControlPanel/Appearance
caption: Theme Tweaks
+\define replacement-text()
+[img[$(imageTitle)$]]
+\end
+
\define backgroundimage-dropdown()
<$button popup=<
> class="tc-btn-invisible tc-btn-dropdown">{{$:/core/images/down-arrow}}$button>
<$reveal state=<> type="popup" position="belowleft" text="" default="">
-<$linkcatcher to="$:/themes/tiddlywiki/vanilla/settings/backgroundimage">
-<$link to="">
-(none)
-$link>
-
-<$list filter="[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[sort[title]]">
-<$link to={{!!title}}>
-<$transclude/> <$view field="title"/>
-$link>
-$list>
-$linkcatcher>
+<$macrocall $name="image-picker" actions="""
+
+<$action-setfield
+ $tiddler="$:/themes/tiddlywiki/vanilla/settings/backgroundimage"
+ $value=<>
+/>
+
+"""/>
$reveal>
diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid
index 324afee29..8107ecdbe 100644
--- a/themes/tiddlywiki/vanilla/base.tid
+++ b/themes/tiddlywiki/vanilla/base.tid
@@ -320,7 +320,7 @@ a.tc-tiddlylink-external:hover {
** Buttons
*/
-button svg, button img {
+button svg, button img, label svg, label img {
vertical-align: middle;
}
@@ -893,13 +893,18 @@ button.tc-untagged-label {
color: <>;
}
-.tc-tiddler-frame input.tc-edit-texteditor, .tc-tiddler-frame textarea.tc-edit-texteditor {
+.tc-tiddler-frame .tc-edit-texteditor {
width: 100%;
+ margin: 4px 0 4px 0;
+}
+
+.tc-tiddler-frame input.tc-edit-texteditor,
+.tc-tiddler-frame textarea.tc-edit-texteditor,
+.tc-tiddler-frame iframe.tc-edit-texteditor {
padding: 3px 3px 3px 3px;
border: 1px solid <>;
line-height: 1.3em;
-webkit-appearance: none;
- margin: 4px 0 4px 0;
}
.tc-tiddler-frame .tc-binary-warning {
@@ -959,6 +964,53 @@ html body.tc-body.tc-single-tiddler-window {
max-width: 100%;
}
+/*
+** Editor
+*/
+
+.tc-editor-toolbar {
+ margin-top: 8px;
+}
+
+.tc-editor-toolbar button {
+ vertical-align: middle;
+ background-color: <>;
+ fill: <>;
+ border-radius: 4px;
+ padding: 3px;
+ margin: 2px 0;
+}
+
+.tc-editor-toolbar button.tc-text-editor-toolbar-item-adjunct {
+ margin-left: -4px;
+ width: 1em;
+ border-radius: 8px;
+}
+
+.tc-editor-toolbar button.tc-selected {
+ background-color: <>;
+}
+
+.tc-editor-toolbar button svg {
+ width: 1.6em;
+ height: 1.2em;
+}
+
+.tc-editor-toolbar button:hover {
+ background-color: <>;
+ fill: <>;
+}
+
+.tc-editor-toolbar .tc-text-editor-toolbar-more {
+ white-space: normal;
+}
+
+.tc-editor-toolbar .tc-text-editor-toolbar-more button {
+ display: inline-block;
+ padding: 3px;
+ width: auto;
+}
+
/*
** Adjustments for fluid-fixed mode
*/
@@ -1092,14 +1144,18 @@ html body.tc-body.tc-single-tiddler-window {
.tc-tiddler-preview-preview {
float: right;
- width: 48%;
+ width: 49%;
border: 1px solid <>;
margin: 4px 3px 3px 3px;
padding: 3px 3px 3px 3px;
}
-.tc-tiddler-preview-edit {
- width: 48%;
+.tc-tiddler-frame .tc-tiddler-preview .tc-edit-texteditor {
+ width: 49%;
+}
+
+.tc-tiddler-frame .tc-tiddler-preview canvas.tc-edit-bitmapeditor {
+ max-width: 49%;
}
.tc-edit-fields {
@@ -1335,6 +1391,55 @@ html body.tc-body.tc-single-tiddler-window {
padding: 0 7px 0 7px;
}
+.tc-image-chooser, .tc-colour-chooser {
+ white-space: normal;
+}
+
+.tc-image-chooser a,
+.tc-colour-chooser a {
+ display: inline-block;
+ vertical-align: top;
+ text-align: center;
+ position: relative;
+}
+
+.tc-image-chooser a {
+ border: 1px solid <>;
+ padding: 2px;
+ margin: 2px;
+ width: 4em;
+ height: 4em;
+}
+
+.tc-colour-chooser a {
+ padding: 3px;
+ width: 2em;
+ height: 2em;
+ vertical-align: middle;
+}
+
+.tc-image-chooser a:hover,
+.tc-colour-chooser a:hover {
+ background: <>;
+ padding: 0px;
+ border: 3px solid <>;
+}
+
+.tc-image-chooser a svg,
+.tc-image-chooser a img {
+ display: inline-block;
+ width: auto;
+ height: auto;
+ max-width: 3.5em;
+ max-height: 3.5em;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+}
+
/*
** Modals
*/