Skip to content

Commit

Permalink
Merge branch 'master' into colour-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Jermolene committed Dec 5, 2024
2 parents 9efcad9 + a994050 commit fc695e7
Show file tree
Hide file tree
Showing 39 changed files with 291 additions and 172 deletions.
18 changes: 8 additions & 10 deletions boot/boot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/modules/server/routes/get-login-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports.handler = function(request,response,state) {
response.end();
} else {
// Redirect to the root wiki if login worked
var location = ($tw.syncadaptor && $tw.syncadaptor.host)? $tw.syncadaptor.host: "/";
var location = ($tw.syncadaptor && $tw.syncadaptor.host)? $tw.syncadaptor.host: `${state.pathPrefix}/`;
response.writeHead(302,{
Location: location
});
Expand Down
5 changes: 4 additions & 1 deletion core/modules/widgets/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
}
// Get the current value of the tiddler we're editing
var tiddler = this.wiki.getTiddler(targetTitle);
var defaultType = this.wiki.getTiddlerText("$:/config/DefaultMissingType", "").trim();
var defaultFields = { type: defaultType };
// Save the initial value of the draft tiddler
draftTitle = this.generateDraftTitle(targetTitle);
var draftTiddler = new $tw.Tiddler({
Expand All @@ -288,7 +290,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
"draft.title": targetTitle,
"draft.of": targetTitle
},
this.wiki.getModificationFields()
this.wiki.getModificationFields(),
tiddler === null || tiddler === undefined ? defaultFields : {}
);
this.wiki.addTiddler(draftTiddler);
return draftTiddler;
Expand Down
2 changes: 2 additions & 0 deletions core/modules/widgets/testcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
this.execute();
// Create container DOM node
var domNode = this.document.createElement("div");
domNode.setAttribute("class", "tc-test-case " + this.testcaseClass);
this.domNodes.push(domNode);
parent.insertBefore(domNode,nextSibling);
// Render the children into a hidden DOM node
Expand Down Expand Up @@ -145,6 +146,7 @@ TestCaseWidget.prototype.execute = function() {
this.testcaseTestActions = this.getAttribute("testActions");
this.testcaseTestExpectedResult = this.getAttribute("testExpectedResult");
this.testcaseHideIfPass = this.getAttribute("testHideIfPass");
this.testcaseClass = this.getAttribute("class","");
};

/*
Expand Down
6 changes: 3 additions & 3 deletions core/palettes/GruvBoxDark.tid
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ diff-delete-foreground: <<colour foreground>>
diff-equal-background:
diff-equal-foreground: <<colour foreground>>
diff-insert-background: #b8bb26
diff-insert-foreground: <<colour foreground>>
diff-invisible-background:
diff-invisible-foreground: <<colour muted-foreground>>
diff-insert-foreground: <<colour background>>
diff-invisible-background: #ffff97
diff-invisible-foreground: #444347
dirty-indicator: #fb4934
download-background: #b8bb26
download-foreground: <<colour background>>
Expand Down
4 changes: 2 additions & 2 deletions core/palettes/Nord.tid
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ diff-delete-foreground: <<colour foreground>>
diff-equal-background:
diff-equal-foreground: <<colour foreground>>
diff-insert-background: #A3BE8C
diff-insert-foreground: <<colour foreground>>
diff-invisible-background:
diff-insert-foreground: <<colour background>>
diff-invisible-background: #f9f3b5
diff-invisible-foreground: <<colour muted-foreground>>
dirty-indicator: #BF616A
download-background: #A3BE8C
Expand Down
8 changes: 8 additions & 0 deletions core/palettes/SolarFlare.tid
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ foreground: #657b83
tiddler-link-foreground: <<colour primary>>

alert-border: #b99e2f
diff-delete-background: <<colour red>>
diff-delete-foreground: <<colour background>>
diff-equal-background: inherit
diff-equal-foreground: inherit
diff-insert-background: <<colour green>>
diff-insert-foreground: <<colour background>>
diff-invisible-background: <<colour yellow>>
diff-invisible-foreground: <<colour background>>
dirty-indicator: #ff0000
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover: inherit
Expand Down
8 changes: 8 additions & 0 deletions core/palettes/SolarizedDark.tid
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ button-foreground: #93a1a1
code-background: #073642
code-border: #586e75
code-foreground: #93a1a1
diff-delete-background: #dc322f
diff-delete-foreground: #eee8d5
diff-equal-background: inherit
diff-equal-foreground: inherit
diff-insert-background: #859900
diff-insert-foreground: #073642
diff-invisible-background: #b58900
diff-invisible-foreground: #eee8d5
dirty-indicator: #dc322f
download-background: #859900
download-foreground: #073642
Expand Down
8 changes: 8 additions & 0 deletions core/palettes/SolarizedLight.tid
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ button-foreground: #586e75
code-background: #eee8d5
code-border: #93a1a1
code-foreground: #586e75
diff-delete-background: #dc322f
diff-delete-foreground: #eee8d5
diff-equal-background: inherit
diff-equal-foreground: inherit
diff-insert-background: #859900
diff-insert-foreground: #eee8d5
diff-invisible-background: #b58900
diff-invisible-foreground: #eee8d5
dirty-indicator: #dc322f
download-background: #859900
download-foreground: #eee8d5
Expand Down
8 changes: 4 additions & 4 deletions core/palettes/Twilight.tid
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ code-background: rgba(0,0,0,0.03)
code-border: rgba(0,0,0,0.08)
code-foreground: rgb(255, 94, 94)
diff-delete-background: #ffc9c9
diff-delete-foreground: <<colour foreground>>
diff-delete-foreground: <<colour background>>
diff-equal-background:
diff-equal-foreground: <<colour foreground>>
diff-insert-background: #aaefad
diff-insert-foreground: <<colour foreground>>
diff-invisible-background:
diff-invisible-foreground: <<colour muted-foreground>>
diff-insert-foreground: <<colour background>>
diff-invisible-background: #fdfcbd
diff-invisible-foreground: <<colour background>>
dirty-indicator: rgb(255, 94, 94)
download-background: #19a974
download-foreground: rgb(38, 38, 38)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: $:/core/ui/ViewTemplate/body/rendered-plain-text
code-body: yes

\whitespace trim
\parameters (language:"css")
<$wikify name="text" text={{!!text}} type={{!!type}}>
<$codeblock code=<<text>> language="css"/>
<$codeblock code=<<text>> language=<<language>>/>
</$wikify>
4 changes: 4 additions & 0 deletions core/ui/ViewTemplate/body/rendered-plain-text/html.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: $:/core/ui/ViewTemplate/body/rendered-plain-text/html
code-body: yes

{{||$:/core/ui/ViewTemplate/body/rendered-plain-text|html}}
1 change: 1 addition & 0 deletions core/wiki/config/ViewTemplateBodyFilters.multids
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ tags: $:/tags/ViewTemplateBodyFilter

testcase: [tag[$:/tags/wiki-test-spec]type[text/vnd.tiddlywiki-multiple]] [tag[$:/tags/wiki-test-spec-failing]type[text/vnd.tiddlywiki-multiple]] :then[[$:/core/ui/TestCaseTemplate]]
stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]]
html: [tag[$:/tags/RawMarkupWikified]] [tag[$:/tags/RawMarkupWikified/TopHead]] [tag[$:/tags/RawMarkupWikified/TopBody]] [tag[$:/tags/RawMarkupWikified/BottomBody]] :then[[$:/core/ui/ViewTemplate/body/rendered-plain-text/html]]
core-ui-tags: [tag[$:/tags/PageTemplate]] [tag[$:/tags/EditTemplate]] [tag[$:/tags/ViewTemplate]] [tag[$:/tags/KeyboardShortcut]] [tag[$:/tags/ImportPreview]] [tag[$:/tags/EditPreview]] [tag[$:/tags/EditorToolbar]] [tag[$:/EditorTools]] [tag[$:/tags/Actions]] [tag[$:/tags/ToolbarButtonStyle]] :then[[$:/core/ui/ViewTemplate/body/code]]
system: [prefix[$:/boot/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/config/]] [prefix[$:/core/config/]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/info/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/temp/]] :and[!is[image]] :then[[$:/core/ui/ViewTemplate/body/code]]
code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]]
Expand Down
41 changes: 19 additions & 22 deletions core/wiki/macros/colour-picker.tid
Original file line number Diff line number Diff line change
@@ -1,58 +1,55 @@
title: $:/core/macros/colour-picker
tags: $:/tags/Macro

\define colour-picker-update-recent()
\procedure colour-picker-update-recent()
<$action-listops
$tiddler="$:/config/ColourPicker/Recent"
$subfilter="$(colour-picker-value)$ [list[$:/config/ColourPicker/Recent]remove[$(colour-picker-value)$]] +[limit[8]]"
$subfilter="[<colour-picker-value>] [list[$:/config/ColourPicker/Recent]remove<colour-picker-value>] +[limit[8]]"
/>
\end

\define colour-picker-inner(actions)
<$button tag="a" tooltip="""$(colour-picker-value)$""">
$(colour-picker-update-recent)$
<$transclude $variable="__actions__"/>

<span style="display:inline-block; background-color: $(colour-picker-value)$; width: 100%; height: 100%; border-radius: 50%;"/>

\procedure colour-picker-inner(actions)
<$button tag="a" tooltip=<<colour-picker-value>>>
<<colour-picker-update-recent>>
<$transclude $variable="actions"/>
<span style.display="inline-block" style.backgroundColor=<<colour-picker-value>> style.width="100%" style.height="100%" style.borderRadius="50%"/>
</$button>
\end

\define colour-picker-recent-inner(actions)
\whitespace trim
<$set name="colour-picker-value" value="$(recentColour)$">
<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/>
\procedure colour-picker-recent-inner(actions)
<$set name="colour-picker-value" value=<<recentColour>>>
<$transclude $variable="colour-picker-inner" actions=<<actions>>/>
</$set>
\end

\define colour-picker-recent(actions)
\whitespace trim
\procedure colour-picker-recent(actions)
{{$:/language/ColourPicker/Recent}}<$list filter="[list[$:/config/ColourPicker/Recent]]" variable="recentColour">
&#32;
<$macrocall $name="colour-picker-recent-inner" actions=<<__actions__>>/>
<$transclude $variable="colour-picker-recent-inner" actions=<<actions>>/>
</$list>
\end

\define colour-picker(actions)
\whitespace trim
\procedure colour-picker(actions)
<div class="tc-colour-chooser">

<$macrocall $name="colour-picker-recent" actions=<<__actions__>>/>
<$transclude $variable="colour-picker-recent" actions=<<actions>>/>

---

<$list filter="LightPink Pink Crimson LavenderBlush PaleVioletRed HotPink DeepPink MediumVioletRed Orchid Thistle Plum Violet Magenta Fuchsia DarkMagenta Purple MediumOrchid DarkViolet DarkOrchid Indigo BlueViolet MediumPurple MediumSlateBlue SlateBlue DarkSlateBlue Lavender GhostWhite Blue MediumBlue MidnightBlue DarkBlue Navy RoyalBlue CornflowerBlue LightSteelBlue LightSlateGrey SlateGrey DodgerBlue AliceBlue SteelBlue LightSkyBlue SkyBlue DeepSkyBlue LightBlue PowderBlue CadetBlue Azure LightCyan PaleTurquoise Cyan Aqua DarkTurquoise DarkSlateGrey DarkCyan Teal MediumTurquoise LightSeaGreen Turquoise Aquamarine MediumAquamarine MediumSpringGreen MintCream SpringGreen MediumSeaGreen SeaGreen Honeydew LightGreen PaleGreen DarkSeaGreen LimeGreen Lime ForestGreen Green DarkGreen Chartreuse LawnGreen GreenYellow DarkOliveGreen YellowGreen OliveDrab Beige LightGoldenrodYellow Ivory LightYellow Yellow Olive DarkKhaki LemonChiffon PaleGoldenrod Khaki Gold Cornsilk Goldenrod DarkGoldenrod FloralWhite OldLace Wheat Moccasin Orange PapayaWhip BlanchedAlmond NavajoWhite AntiqueWhite Tan BurlyWood Bisque DarkOrange Linen Peru PeachPuff SandyBrown Chocolate SaddleBrown Seashell Sienna LightSalmon Coral OrangeRed DarkSalmon Tomato MistyRose Salmon Snow LightCoral RosyBrown IndianRed Red Brown FireBrick DarkRed Maroon White WhiteSmoke Gainsboro LightGrey Silver DarkGrey Grey DimGrey Black" variable="colour-picker-value">
&#32;
<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/>
<$transclude $variable="colour-picker-inner" actions=<<actions>>/>
</$list>

---

<$edit-text tiddler="$:/config/ColourPicker/New" tag="input" default="" placeholder=""/>
&#32;
<$edit-text tiddler="$:/config/ColourPicker/New" tag="input" default="" placeholder="" class="tc-tiny-gap-right"/>
<$edit-text tiddler="$:/config/ColourPicker/New" type="color" tag="input"/>
<$set name="colour-picker-value" value={{$:/config/ColourPicker/New}}>
<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/>
<%if [{$:/config/ColourPicker/New}!is[blank]] %>
<$transclude $variable="colour-picker-inner" actions=<<actions>>/>
<%endif%>
</$set>

</div>
Expand Down
2 changes: 1 addition & 1 deletion core/wiki/macros/dumpvariables.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: $:/core/macros/dumpvariables
tags: $:/tags/Macro

\define dumpvariables()
\procedure dumpvariables()
\whitespace trim
<ul>
<$list filter="[variables[]]" variable="varname">
Expand Down
29 changes: 13 additions & 16 deletions core/wiki/macros/image-picker.tid
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
created: 20170715180840889
modified: 20170715180914005
tags: $:/tags/Macro
title: $:/core/macros/image-picker
type: text/vnd.tiddlywiki

\define image-picker-thumbnail(actions)
<$button tag="a" tooltip="""$(imageTitle)$"""><$transclude $variable="__actions__"/><$transclude tiddler=<<imageTitle>>/></$button>
\procedure image-picker-thumbnail(actions)
<$button tag="a" tooltip=<<imageTitle>>><$transclude $variable="actions"/><$transclude tiddler=<<imageTitle>>/></$button>
\end

\define image-picker-list(filter,actions)
\procedure image-picker-list(filter,actions)
\whitespace trim
<$list filter="""$filter$""" variable="imageTitle">
<$macrocall $name="image-picker-thumbnail" actions=<<__actions__>>/>
<$list filter=<<filter>> variable="imageTitle">
<$transclude $variable="image-picker-thumbnail" actions=<<actions>>/>
&#32;
</$list>
\end

\define image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]$subfilter$sort[title]]",subfilter:"")
\procedure image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] -[type[application/pdf]] +[!has[draft.of]$subfilter$sort[title]]",subfilter:"")
\whitespace trim
<div class="tc-image-chooser">
<$vars state-system=<<qualify "$:/state/image-picker/system">>>
<$let state-system=<<qualify "$:/state/image-picker/system">> tv-filter={{{ [<filter>search-replace[$subfilter$],<subfilter>] }}}>
<$checkbox tiddler=<<state-system>> field="text" checked="show" unchecked="hide" default="hide">
&#32;
{{$:/language/SystemTiddlers/Include/Prompt}}
<span class="tc-tiny-gap-left">{{$:/language/SystemTiddlers/Include/Prompt}}</span>
</$checkbox>
<$reveal state=<<state-system>> type="match" text="hide" default="hide" tag="div">
<$macrocall $name="image-picker-list" filter="""$filter$ +[!is[system]]""" actions=<<__actions__>>/>
<$transclude $variable="image-picker-list" filter=`$(tv-filter)$ +[!is[system]]` actions=<<actions>>/>
</$reveal>
<$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div">
<$macrocall $name="image-picker-list" filter="""$filter$""" actions=<<__actions__>>/>
<$transclude $variable="image-picker-list" filter=<<tv-filter>> actions=<<actions>>/>
</$reveal>
</$vars>
</$let>
</div>
\end

\define image-picker-include-tagged-images(actions)
<$macrocall $name="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions=<<__actions__>>/>
\procedure image-picker-include-tagged-images(actions)
<$transclude $variable="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions=<<actions>>/>
\end
Loading

0 comments on commit fc695e7

Please sign in to comment.