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

Merge branch 'master' into colour-improvements

This commit is contained in:
Jeremy Ruston 2024-10-30 20:38:58 +00:00
commit 4445111a08
35 changed files with 555 additions and 351 deletions

View File

@ -175,6 +175,8 @@ Settings/NavigationPermalinkviewMode/UpdateAddressBar/Description: Update addres
Settings/PerformanceInstrumentation/Caption: Performance Instrumentation
Settings/PerformanceInstrumentation/Hint: Displays performance statistics in the browser developer console. Requires reload to take effect
Settings/PerformanceInstrumentation/Description: Enable performance instrumentation
Settings/RecentLimit/Caption: Recent Tab Limit
Settings/RecentLimit/Hint: Maximum number of tiddlers to be displayed under the sidebar "Recent" tab
Settings/ToolbarButtonStyle/Caption: Toolbar Button Style
Settings/ToolbarButtonStyle/Hint: Choose the style for toolbar buttons:
Settings/ToolbarButtonStyle/Styles/Borderless: Borderless

View File

@ -56,36 +56,64 @@ Object.defineProperty(TW_TextNode.prototype, "formattedTextContent", {
}
});
var TW_Element = function(tag,namespace) {
var TW_Style = function(el) {
// Define the internal style object
var styleObject = {
// Method to get the entire style object
get: function() {
return el._style;
},
// Method to set styles using a string (e.g. "color:red; background-color:blue;")
set: function(str) {
var self = this;
str = str || "";
$tw.utils.each(str.split(";"),function(declaration) {
var parts = declaration.split(":"),
name = $tw.utils.trim(parts[0]),
value = $tw.utils.trim(parts[1]);
if(name && value) {
el._style[$tw.utils.convertStyleNameToPropertyName(name)] = value;
}
});
},
// Method to set a specific property without transforming the property name, such as a custom property
setProperty: function(name, value) {
el._style[name] = value;
}
};
// Return a Proxy to handle direct access to individual style properties
return new Proxy(styleObject, {
get: function(target, property) {
// If the property exists on styleObject, return it (get, set, setProperty methods)
if (property in target) {
return target[property];
}
// Otherwise, return the corresponding property from _style
return el._style[$tw.utils.convertStyleNameToPropertyName(property)] || "";
},
set: function(target, property, value) {
// Set the property in _style
el._style[$tw.utils.convertStyleNameToPropertyName(property)] = value;
return true;
}
});
};
var TW_Element = function(tag, namespace) {
bumpSequenceNumber(this);
this.isTiddlyWikiFakeDom = true;
this.tag = tag;
this.attributes = {};
this.isRaw = false;
this.children = [];
this._style = {};
this._style = {}; // Internal style object
this.style = new TW_Style(this); // Proxy for style management
this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml";
};
Object.setPrototypeOf(TW_Element.prototype,TW_Node.prototype);
Object.defineProperty(TW_Element.prototype, "style", {
get: function() {
return this._style;
},
set: function(str) {
var self = this;
str = str || "";
$tw.utils.each(str.split(";"),function(declaration) {
var parts = declaration.split(":"),
name = $tw.utils.trim(parts[0]),
value = $tw.utils.trim(parts[1]);
if(name && value) {
self._style[$tw.utils.convertStyleNameToPropertyName(name)] = value;
}
});
}
});
Object.setPrototypeOf(TW_Element.prototype,TW_Node.prototype);
Object.defineProperty(TW_Element.prototype, "nodeType", {
get: function() {
@ -105,7 +133,7 @@ TW_Element.prototype.setAttribute = function(name,value) {
throw "Cannot setAttribute on a raw TW_Element";
}
if(name === "style") {
this.style = value;
this.style.set(value);
} else {
this.attributes[name] = value + "";
}

View File

@ -125,11 +125,23 @@ DroppableWidget.prototype.handleDropEvent = function(event) {
// Remove highlighting
$tw.utils.removeClass(this.domNodes[0],"tc-dragover");
// Try to import the various data types we understand
$tw.utils.importDataTransfer(dataTransfer,null,function(fieldsArray) {
fieldsArray.forEach(function(fields) {
self.performActions(fields.title || fields.text,event);
if(this.droppableActions) {
$tw.utils.importDataTransfer(dataTransfer,null,function(fieldsArray) {
fieldsArray.forEach(function(fields) {
self.performActions(fields.title || fields.text,event);
});
});
});
}
// Send a TitleList to performListActions
if(this.droppableListActions) {
$tw.utils.importDataTransfer(dataTransfer,null,function(fieldsArray) {
var titleList = [];
fieldsArray.forEach(function(fields) {
titleList.push(fields.title || fields.text);
});
self.performListActions($tw.utils.stringifyList(titleList),event);
});
}
// Tell the browser that we handled the drop
event.preventDefault();
// Stop the drop ripple up to any parent handlers
@ -137,6 +149,13 @@ DroppableWidget.prototype.handleDropEvent = function(event) {
return false;
};
DroppableWidget.prototype.performListActions = function(titleList,event) {
if(this.droppableListActions) {
var modifierKey = $tw.keyboardManager.getEventModifierKeyDescriptor(event);
this.invokeActionString(this.droppableListActions,this,event,{actionTiddlerList: titleList, modifier: modifierKey});
}
};
DroppableWidget.prototype.performActions = function(title,event) {
if(this.droppableActions) {
var modifierKey = $tw.keyboardManager.getEventModifierKeyDescriptor(event);
@ -149,6 +168,7 @@ Compute the internal state of the widget
*/
DroppableWidget.prototype.execute = function() {
this.droppableActions = this.getAttribute("actions");
this.droppableListActions = this.getAttribute("listActions");
this.droppableEffect = this.getAttribute("effect","copy");
this.droppableTag = this.getAttribute("tag");
this.droppableEnable = (this.getAttribute("enable") || "yes") === "yes";
@ -168,7 +188,8 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
DroppableWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tag || changedAttributes.enable || changedAttributes.disabledClass || changedAttributes.actions || changedAttributes.effect) {
if(changedAttributes.tag || changedAttributes.enable || changedAttributes.disabledClass ||
changedAttributes.actions|| changedAttributes.listActions || changedAttributes.effect) {
this.refreshSelf();
return true;
} else {

View File

@ -65,6 +65,16 @@ GenesisWidget.prototype.execute = function() {
children: this.parseTreeNode.children || [],
isNotRemappable: !this.genesisRemappable
}];
// Apply attributes in $names/$values
this.attributeNames = [];
this.attributeValues = [];
if(this.genesisNames && this.genesisValues) {
this.attributeNames = this.wiki.filterTiddlers(self.genesisNames,this);
this.attributeValues = this.wiki.filterTiddlers(self.genesisValues,this);
$tw.utils.each(this.attributeNames,function(varname,index) {
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],varname,self.attributeValues[index] || "");
});
}
// Apply explicit attributes
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) {
var name = attribute.name;
@ -79,16 +89,6 @@ GenesisWidget.prototype.execute = function() {
}
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],$tw.utils.extend({},attribute,{name: name}));
});
// Apply attributes in $names/$values
this.attributeNames = [];
this.attributeValues = [];
if(this.genesisNames && this.genesisValues) {
this.attributeNames = this.wiki.filterTiddlers(self.genesisNames,this);
this.attributeValues = this.wiki.filterTiddlers(self.genesisValues,this);
$tw.utils.each(this.attributeNames,function(varname,index) {
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],varname,self.attributeValues[index] || "");
});
}
// Construct the child widgets
this.makeChildWidgets(parseTreeNodes);
};

View File

@ -440,6 +440,11 @@ Widget.prototype.assignAttributes = function(domNode,options) {
destPrefix = options.destPrefix || "",
EVENT_ATTRIBUTE_PREFIX = "on";
var assignAttribute = function(name,value) {
// Process any CSS custom properties
if(name.substr(0,2) === "--" && name.length > 2) {
domNode.style.setProperty(name,value);
return;
}
// Process any style attributes before considering sourcePrefix and destPrefix
if(name.substr(0,6) === "style." && name.length > 6) {
domNode.style[$tw.utils.unHyphenateCss(name.substr(6))] = value;

View File

@ -2,18 +2,28 @@ title: $:/core/ui/AdvancedSearch/Filter
tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Filter/Caption}}
\define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after")
<$macrocall $name="change-input-tab"
\procedure lingo-base() $:/language/Search/
\procedure set-next-input-tab()
<$transclude $variable="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
beforeafter="after"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"
/>
\end
\define cancel-search-actions()
\procedure set-previous-input-tab()
<$transclude $variable="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="before"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"
/>
\end
\procedure cancel-search-actions()
\whitespace trim
<$list filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]">
<$list-empty>
@ -24,30 +34,30 @@ caption: {{$:/language/Search/Filter/Caption}}
</$list>
\end
\define input-accept-actions()
\procedure input-accept-actions()
\whitespace trim
<$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]">
<$list-empty>
<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
<$list filter="[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]">
<$action-navigate $to={{{ [<tiddler>get[text]] }}}/>
</$list>
<$/list-empty>
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
<$action-navigate $to={{{ [<tiddler>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions()
\procedure input-accept-variant-actions()
\whitespace trim
<$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]">
<$list-empty>
<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]">
<$list filter="[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<tiddler>get[text]] }}}/>
</$list>
</$list>
</$list-empty>
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
<$list filter="[<tiddler>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<tiddler>get[text]] }}}/>
</$list>
</$list>
\end
@ -58,8 +68,8 @@ caption: {{$:/language/Search/Filter/Caption}}
<div class="tc-search tc-advanced-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>> class="tc-small-gap-right">
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input"
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>>>
<$transclude $variable="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
@ -84,7 +94,7 @@ caption: {{$:/language/Search/Filter/Caption}}
<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>">
<p><<lingo Filter/Matches>></p>
<$list filter={{$:/temp/advancedsearch}}>
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}>
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] :and[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span>
</$list>

View File

@ -3,18 +3,27 @@ tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Shadows/Caption}}
first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]
\define lingo-base() $:/language/Search/
\procedure lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after")
<$macrocall $name="change-input-tab"
\procedure set-next-input-tab()
<$transclude $variable="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
beforeafter="after"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\define cancel-search-actions()
\procedure set-previous-input-tab()
<$transclude $variable="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="before"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\procedure cancel-search-actions()
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]"
@ -25,22 +34,22 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\end
\define input-accept-actions()
\procedure input-accept-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<tiddler>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions()
\procedure input-accept-variant-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$list filter='[<tiddler>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<tiddler>get[text]] }}}/></$list></$list>">
<$list filter="[<tiddler>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<tiddler>get[text]] }}}/>
</$list></$list>
\end
@ -50,8 +59,8 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
<div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input"
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>>>
<$transclude $variable="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
@ -79,7 +88,7 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
<$set name="resultCount" value={{{ [all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] +[count[]]}}}>
<$set name="resultCount" value={{{ [all[shadows]search{$:/temp/advancedsearch}] :except[[$:/temp/advancedsearch]] :except[[$:/temp/advancedsearch/input]] :and[count[]]}}}>
<div class="tc-search-results">
@ -89,8 +98,8 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
<<lingo Shadows/Matches>>
<%endif%>
<$list filter="[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]">
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$list filter="[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]] :else[[$:/temp/advancedsearch]] :else[[$:/temp/advancedsearch/input]]">
<span class={{{[<currentTiddler>addsuffix[-primaryList]] :else[[$:/temp/advancedsearch/selected-item]get[text]] :and[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span>
</$list>

View File

@ -2,16 +2,20 @@ title: $:/core/ui/AdvancedSearch/Standard
tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Standard/Caption}}
\define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\procedure lingo-base() $:/language/Search/
\procedure set-next-input-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="after" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<nextTab>>/>"/>
\procedure set-previous-input-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="before" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />"><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\procedure next-search-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="after" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<nextTab>>/>"/>
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\procedure previous-search-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="before" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<nextTab>>/>"/>
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\procedure cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />"><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\procedure input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>"><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>
\procedure input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$list filter='[<tiddler>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<tiddler>get[text]] }}}/></$list></$list>"><$list filter="[<tiddler>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<tiddler>get[text]] }}}/></$list></$list>
\whitespace trim
@ -19,10 +23,10 @@ caption: {{$:/language/Search/Standard/Caption}}
<div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>>>
<$keyboard key="shift-alt-Right" actions=<<next-search-tab>>>
<$keyboard key="shift-alt-Left" actions=<<next-search-tab "before">>>
<$macrocall $name="keyboard-driven-input"
<$keyboard key="shift-alt-Left" actions=<<previous-search-tab>>>
<$transclude $variable="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
@ -33,7 +37,7 @@ caption: {{$:/language/Search/Standard/Caption}}
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]"
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard>
</$keyboard>
@ -55,13 +59,13 @@ caption: {{$:/language/Search/Standard/Caption}}
variable="listItem">
<$vars
userInput={{{ [[$:/temp/advancedsearch]get[text]] }}}
configTiddler={{{ [[$:/state/advancedsearch/standard/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}
configTiddler={{{ [[$:/state/advancedsearch/standard/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}] }}}
searchListState="$:/temp/advancedsearch/selected-item">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]">
<$list-empty>
<$list filter='[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]'><$transclude mode="block"/></$list>
</$list-empty>
<$macrocall $name="tabs"
<$transclude $variable="tabs"
tabsList="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"
default={{$:/config/SearchResults/Default}}
actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<currentTab>>/>"

View File

@ -1,19 +1,28 @@
title: $:/core/ui/AdvancedSearch/System
tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/System/Caption}}
first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]
first-search-filter: [is[system]search<userInput>sort[title]limit[250]] :except[[$:/temp/advancedsearch]] :except[[$:/temp/advancedsearch/input]] :except[[$:/temp/advancedsearch/selected-item]]
\define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after",stateTitle,tag,defaultState,currentTabTiddler)
<$macrocall $name="change-input-tab"
\procedure lingo-base() $:/language/Search/
\procedure set-next-input-tab()
<$transclude $variable="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
beforeafter="after"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\define cancel-search-actions()
\procedure set-previous-input-tab()
<$transclude $variable="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="before"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\procedure cancel-search-actions()
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]"
@ -24,22 +33,22 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\end
\define input-accept-actions()
\procedure input-accept-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<tiddler>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions()
\procedure input-accept-variant-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
emptyMessage="<$list filter='[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]'><$list filter='[<tiddler>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<tiddler>get[text]] }}}/></$list></$list>">
<$list filter="[<tiddler>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<tiddler>get[text]] }}}/>
</$list></$list>
\end
@ -49,8 +58,8 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
<div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input"
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>>>
<$transclude $variable="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
@ -78,7 +87,7 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
<$set name="resultCount" value={{{ [is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]] +[count[]] }}}>
<$set name="resultCount" value={{{ [is[system]search{$:/temp/advancedsearch}] :except[[$:/temp/advancedsearch]] :except[[$:/temp/advancedsearch/input]] :except[[$:/temp/advancedsearch/selected-item]] +[count[]] }}}>
<div class="tc-search-results">
@ -88,8 +97,8 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
<<lingo System/Matches>>
<%endif%>
<$list filter="[is[system]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]">
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$list filter="[is[system]search{$:/temp/advancedsearch}sort[title]limit[250]] :except[[$:/temp/advancedsearch]] :except[[$:/temp/advancedsearch/input]] :except[[$:/temp/advancedsearch/selected-item]]">
<span class={{{[<currentTiddler>addsuffix[-primaryList]] :except[[$:/temp/advancedsearch/selected-item]get[text]] :and[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span>
</$list>

View File

@ -0,0 +1,10 @@
title: $:/core/ui/ControlPanel/Settings/RecentLimit
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/RecentLimit/Caption}}
\whitespace trim
\procedure lingo-base() $:/language/ControlPanel/Settings/RecentLimit/
<<lingo Hint>>
|tc-table-no-border|k
|<$link to="$:/config/RecentLimit"><<lingo Caption>></$link> |<$edit-text tiddler="$:/config/RecentLimit" tag="input" type="number"/> |

View File

@ -1,35 +1,32 @@
title: $:/core/ui/EditTemplate/fields
tags: $:/tags/EditTemplate
\define lingo-base() $:/language/EditTemplate/
\define config-title()
$:/config/EditTemplateFields/Visibility/$(currentField)$
\end
\procedure lingo-base() $:/language/EditTemplate/
\function tf.config-title() [[$:/config/EditTemplateFields/Visibility/]addsuffix[$(currentField)$]substitute[]get[text]]
\define config-filter()
[[hide]] -[title{$(config-title)$}]
\end
\function tf.config-filter() [[hide]] :except[title<tf.config-title>]
<!-- Beware this is duplicated from EditTemplate.tid. For details see bug #7054 -->
\define get-field-value-tiddler-filter() [subfilter<get-field-editor-filter>sha256[16]addprefix[/]addprefix<newFieldValueTiddlerPrefix>]
\define get-field-editor-filter() [<newFieldNameTiddler>get[text]else[]] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}]
\procedure get-field-value-tiddler-filter() [subfilter<get-field-editor-filter>sha256[16]addprefix[/]addprefix<newFieldValueTiddlerPrefix>]
\procedure get-field-editor-filter() [<newFieldNameTiddler>get[text]else[]] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}]
\define current-tiddler-new-field-selector()
[data-tiddler-title="$(currentTiddlerCSSescaped)$"] .tc-edit-field-add-name-wrapper input
\end
\procedure prefix.bracket() [
\procedure suffix.bracket() ]
\define new-field-actions()
\function tf.current-tiddler-new-field-selector() [[data-tiddler-title=]addprefix[$(prefix.bracket)$]substitute[]addsuffix<currentTiddlerCSSescaped>addsuffix[$(suffix.bracket)$]substitute[]] .tc-edit-field-add-name-wrapper input :and[join[ ]]
\procedure new-field-actions()
\whitespace trim
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldNameTiddler>get[text]] :map[subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
<$set name="safeNewFieldValueTiddlerPrefix" value=<<newFieldValueTiddlerPrefix>> emptyValue=<<qualify "$:/temp/NewFieldValue">> >
<$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix[$:/temp/NewFieldValue]prefix<safeNewFieldValueTiddlerPrefix>] [<storeTitle>] [<searchListState>]"/>
</$set>
<$action-sendmessage $message="tm-focus-selector" $param=<<current-tiddler-new-field-selector>>/>
<$action-sendmessage $message="tm-focus-selector" $param=<<tf.current-tiddler-new-field-selector>>/>
\end
\define delete-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<storeTitle>] [<searchListState>]"/>
\procedure delete-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<storeTitle>] [<searchListState>]"/>
\define cancel-search-actions-inner()
\procedure cancel-search-actions-inner()
\whitespace trim
<$list
filter="[<storeTitle>has[text]] [<newFieldNameTiddler>has[text]]"
@ -39,7 +36,7 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
</$list>
\end
\define cancel-search-actions()
\procedure cancel-search-actions()
\whitespace trim
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
<$list
@ -50,7 +47,7 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
</$set>
\end
\define new-field()
\procedure new-field()
\whitespace trim
<$vars name={{{ [<newFieldNameTiddler>get[text]] }}}>
<$reveal type="nomatch" text="" default=<<name>>>
@ -75,15 +72,15 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
<$set name="newFieldValueTiddlerPrefix" value=<<newFieldValueTiddlerPrefix>> emptyValue=<<qualify "$:/temp/NewFieldValue">> >
<div class="tc-edit-fields">
<table class={{{ [all[current]fields[]] :filter[lookup[$:/config/EditTemplateFields/Visibility/]!match[hide]] +[count[]!match[0]] +[then[tc-edit-fields]] ~[[tc-edit-fields tc-edit-fields-small]] }}}>
<table class={{{ [all[current]fields[]] :filter[lookup[$:/config/EditTemplateFields/Visibility/]!match[hide]] :and[count[]!match[0]] :and[then[tc-edit-fields]] :else[[tc-edit-fields tc-edit-fields-small]] }}}>
<tbody>
<$list filter="[all[current]fields[]] +[sort[title]]" variable="currentField" storyview="pop">
<$list filter=<<config-filter>> variable="temp">
<$list filter="[all[current]fields[]] :and[sort[title]]" variable="currentField" storyview="pop">
<$list filter=<<tf.config-filter>> variable="temp">
<tr class="tc-edit-field">
<td class="tc-edit-field-name">
<$text text=<<currentField>>/>:</td>
<td class="tc-edit-field-value">
<$keyboard key="((delete-field))" actions="""<$action-deletefield $field=<<currentField>>/><$set name="currentTiddlerCSSescaped" value={{{ [<currentTiddler>escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<<current-tiddler-new-field-selector>>/></$set>""">
<$keyboard key="((delete-field))" actions="""<$action-deletefield $field=<<currentField>>/><$set name="currentTiddlerCSSescaped" value={{{ [<currentTiddler>escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<<tf.current-tiddler-new-field-selector>>/></$set>""">
<$transclude tiddler={{{ [<currentField>] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}] }}} />
</$keyboard>
</td>
@ -107,10 +104,10 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
</em>
<$vars refreshTitle=<<qualify "$:/temp/fieldname/refresh">> storeTitle=<<newFieldNameInputTiddler>> searchListState=<<newFieldNameSelectionTiddler>>>
<div class="tc-edit-field-add-name-wrapper">
<$macrocall $name="keyboard-driven-input" tiddler=<<newFieldNameTiddler>> storeTitle=<<storeTitle>> refreshTitle=<<refreshTitle>>
<$transclude $variable="keyboard-driven-input" tiddler=<<newFieldNameTiddler>> storeTitle=<<storeTitle>> refreshTitle=<<refreshTitle>>
selectionStateTitle=<<searchListState>> tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Name/Placeholder}}
focusPopup=<<qualify "$:/state/popup/field-dropdown">> class="tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}}
focus={{{ [{$:/config/AutoFocus}match[fields]then[true]] ~[[false]] }}} cancelPopups="yes"
focus={{{ [{$:/config/AutoFocus}match[fields]then[true]] :else[[false]] }}} cancelPopups="yes"
configTiddlerFilter="[[$:/config/EditMode/fieldname-filter]]" inputCancelActions=<<cancel-search-actions>> />
<$button popup=<<qualify "$:/state/popup/field-dropdown">> class="tc-btn-invisible tc-btn-dropdown tc-small-gap" tooltip={{$:/language/EditTemplate/Field/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Field/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button>
<$reveal state=<<qualify "$:/state/popup/field-dropdown">> type="nomatch" text="" default="">
@ -121,8 +118,8 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
<<lingo Fields/Add/Dropdown/User>>
</div>
<$set name="newFieldName" value={{{ [<storeTitle>get[text]] }}}>
<$list filter="[!is[shadow]!is[system]fields[]search:title<newFieldName>sort[]] -created -creator -draft.of -draft.title -modified -modifier -tags -text -title -type" variable="currentField">
<$list filter="[<currentField>addsuffix[-primaryList]] -[<searchListState>get[text]]" emptyMessage="""<$link to=<<currentField>> class="tc-list-item-selected"><$text text=<<currentField>>/></$link>""">
<$list filter="[!is[shadow]!is[system]fields[]search:title<newFieldName>sort[]] :except[[created]] :except[[creator]] :except[[draft.of]] :except[[draft.title]] :except[[modified]] :except[[modifier]] :except[[tags]] :except[[text]] :except[[title]] :except[[type]]" variable="currentField">
<$list filter="[<currentField>addsuffix[-primaryList]] :except[<searchListState>get[text]]" emptyMessage="""<$link to=<<currentField>> class="tc-list-item-selected"><$text text=<<currentField>>/></$link>""">
<$link to=<<currentField>>>
<$text text=<<currentField>>/>
</$link>
@ -131,8 +128,8 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
<div class="tc-dropdown-item">
<<lingo Fields/Add/Dropdown/System>>
</div>
<$list filter="[fields[]search:title<newFieldName>sort[]] -[!is[shadow]!is[system]fields[]]" variable="currentField">
<$list filter="[<currentField>addsuffix[-secondaryList]] -[<searchListState>get[text]]" emptyMessage="""<$link to=<<currentField>> class="tc-list-item-selected"><$text text=<<currentField>>/></$link>""">
<$list filter="[fields[]search:title<newFieldName>sort[]] :except[!is[shadow]!is[system]fields[]]" variable="currentField">
<$list filter="[<currentField>addsuffix[-secondaryList]] :except[<searchListState>get[text]]" emptyMessage="""<$link to=<<currentField>> class="tc-list-item-selected"><$text text=<<currentField>>/></$link>""">
<$link to=<<currentField>>>
<$text text=<<currentField>>/>
</$link>
@ -151,7 +148,7 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
</$keyboard>
</span>
<span class="tc-edit-field-add-button">
<$macrocall $name="new-field"/>
<$transclude $variable="new-field"/>
</span>
</$let>
</$vars>

View File

@ -2,15 +2,15 @@ title: $:/core/ui/EditTemplate/type
tags: $:/tags/EditTemplate
first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[description]sort[group-sort]removeprefix[$:/language/Docs/Types/]search<userInput>]
\define lingo-base() $:/language/EditTemplate/
\define input-cancel-actions() <$list filter="[<storeTitle>get[text]] [<currentTiddler>get[type]] +[limit[1]]" emptyMessage="""<<cancel-delete-tiddler-actions "cancel">>"""><$action-sendmessage $message="tm-remove-field" $param="type"/><$action-deletetiddler $filter="[<typeInputTiddler>] [<refreshTitle>] [<typeSelectionTiddler>]"/></$list>
\procedure lingo-base() $:/language/EditTemplate/
\procedure input-cancel-actions() <$list filter="[<storeTitle>get[text]] [<currentTiddler>get[type]] :and[limit[1]]" emptyMessage="""<<cancel-delete-tiddler-actions "cancel">>"""><$action-sendmessage $message="tm-remove-field" $param="type"/><$action-deletetiddler $filter="[<typeInputTiddler>] [<refreshTitle>] [<typeSelectionTiddler>]"/></$list>
\whitespace trim
<$set name="refreshTitle" value=<<qualify "$:/temp/type-search/refresh">>>
<div class="tc-edit-type-selector-wrapper">
<em class="tc-edit tc-small-gap-right"><<lingo Type/Prompt>></em>
<div class="tc-type-selector-dropdown-wrapper">
<div class="tc-type-selector"><$fieldmangler>
<$macrocall $name="keyboard-driven-input" tiddler=<<currentTiddler>> storeTitle=<<typeInputTiddler>> refreshTitle=<<refreshTitle>> selectionStateTitle=<<typeSelectionTiddler>> field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[type]then[true]] ~[[false]] }}} cancelPopups="yes" configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]" inputCancelActions=<<input-cancel-actions>>/><$button popup=<<qualify "$:/state/popup/type-dropdown">> class="tc-btn-invisible tc-btn-dropdown tc-small-gap" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$button message="tm-remove-field" param="type" class="tc-btn-invisible tc-btn-icon" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}<$action-deletetiddler $filter="[<typeInputTiddler>] [<storeTitle>] [<refreshTitle>] [<selectionStateTitle>]"/></$button>
<$transclude $variable="keyboard-driven-input" tiddler=<<currentTiddler>> storeTitle=<<typeInputTiddler>> refreshTitle=<<refreshTitle>> selectionStateTitle=<<typeSelectionTiddler>> field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[type]then[true]] :else[[false]] }}} cancelPopups="yes" configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]" inputCancelActions=<<input-cancel-actions>>/><$button popup=<<qualify "$:/state/popup/type-dropdown">> class="tc-btn-invisible tc-btn-dropdown tc-small-gap" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$button message="tm-remove-field" param="type" class="tc-btn-invisible tc-btn-icon" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}<$action-deletetiddler $filter="[<typeInputTiddler>] [<storeTitle>] [<refreshTitle>] [<selectionStateTitle>]"/></$button>
</$fieldmangler></div>
<div class="tc-block-dropdown-wrapper">
@ -23,7 +23,7 @@ first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[d
<$text text={{!!group}}/>
</div>
<$set name="userInput" value={{{ [<typeInputTiddler>get[text]] }}}>
<$list filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]] +[removeprefix[$:/language/Docs/Types/]] +[search<userInput>]"><span class={{{ [<currentTiddler>addsuffix[-primaryList]] -[<typeSelectionTiddler>get[text]] +[then[]else[tc-list-item-selected]] }}}><$link to={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]get[name]] }}}><$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="description"/><$text text=" "/>(<$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="name"/>)</$link></span>
<$list filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] :and[sort[description]] :and[removeprefix[$:/language/Docs/Types/]] :and[search<userInput>]"><span class={{{ [<currentTiddler>addsuffix[-primaryList]] :except[<typeSelectionTiddler>get[text]] :and[then[]else[tc-list-item-selected]] }}}><$link to={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]get[name]] }}}><$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="description"/><$text text=" "/>(<$view tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}} field="name"/>)</$link></span>
</$list>
</$set>
</$list>

View File

@ -1,44 +1,49 @@
title: $:/core/ui/EditorToolbar/link-dropdown
\define lingo-base() $:/language/Buttons/Link/
\procedure lingo-base() $:/language/Buttons/Link/
\define add-link-actions()
\procedure add-link-actions()
\whitespace trim
<$action-sendmessage $message="tm-edit-text-operation" $param="make-link" text={{$(linkTiddler)$}} />
<$action-sendmessage $message="tm-edit-text-operation" $param="make-link" text={{{ [<linkTiddler>get[text]] }}} />
<$action-deletetiddler $filter="[<dropdown-state>] [<searchTiddler>] [<linkTiddler>] [<storeTitle>] [<searchListState>]"/>
\end
\define get-focus-selector() [data-tiddler-title="$(cssEscapedTitle)$"] .tc-create-wikitext-link input
\procedure prefix.bracket() [
\procedure suffix.bracket() ]
\define cancel-search-actions-inner()
\function tf.get-focus-selector() [[data-tiddler-title=]addprefix[$(prefix.bracket)$]substitute[]addsuffix<cssEscapedTitle>addsuffix[$(suffix.bracket)$]substitute[]] .tc-create-wikitext-link input :and[join[ ]]
\procedure cancel-search-actions-inner()
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}><$list filter="[<searchTiddler>get[text]!match<userInput>]" emptyMessage="<$action-deletetiddler $filter='[<searchTiddler>] [<linkTiddler>] [<storeTitle>] [<searchListState>]'/>"><$action-setfield $tiddler=<<searchTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/></$list></$set>
\end
\define cancel-search-actions() <$list filter="[<storeTitle>!has[text]] +[<searchTiddler>!has[text]]" emptyMessage="<<cancel-search-actions-inner>>"><$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/></$list>
\procedure cancel-search-actions() <$list filter="[<storeTitle>!has[text]] :and[<searchTiddler>!has[text]]" emptyMessage="<<cancel-search-actions-inner>>"><$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/></$list>
\define external-link()
\procedure external-link()
\whitespace trim
<$button class="tc-btn-invisible tc-btn-mini" style="width: auto; display: inline-block; background-colour: inherit;" actions=<<add-link-actions>>>
{{$:/core/images/chevron-right}}
</$button>
\end
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/search/currentTab' text=<<nextTab>>/>"/>
\procedure set-next-input-tab() <$transclude $variable="change-input-tab-after" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/search/currentTab' text=<<nextTab>>/>"/>
\define body(config-title)
\procedure set-previous-input-tab() <$transclude $variable="change-input-tab-before" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/search/currentTab' text=<<nextTab>>/>"/>
\procedure body(config-title)
\whitespace trim
''<<lingo Hint>>''
<$vars searchTiddler="""$config-title$/search""" linkTiddler="""$config-title$/link""" linktext="" searchListState=<<qualify "$:/temp/link-search/selected-item">> refreshTitle=<<qualify "$:/temp/link-search/refresh">> storeTitle=<<qualify "$:/temp/link-search/input">>>
<$vars searchTiddler={{{ [<config-title>addsuffix[/search]] }}} linkTiddler={{{ [<config-title>addsuffix[/link]] }}} linktext="" searchListState=<<qualify "$:/temp/link-search/selected-item">> refreshTitle=<<qualify "$:/temp/link-search/refresh">> storeTitle=<<qualify "$:/temp/link-search/input">>>
<$vars linkTiddler=<<searchTiddler>>>
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">> class="tc-create-wikitext-link">
<$macrocall $name="keyboard-driven-input" tiddler=<<searchTiddler>> storeTitle=<<storeTitle>>
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>> class="tc-create-wikitext-link">
<$transclude $variable="keyboard-driven-input" tiddler=<<searchTiddler>> storeTitle=<<storeTitle>>
selectionStateTitle=<<searchListState>> refreshTitle=<<refreshTitle>> type="search" filterMinLength="1"
tag="input" focus="true" class="tc-popup-handle" inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<add-link-actions>> placeholder={{$:/language/Search/Search}} default=""
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" />
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]" />
</$keyboard>
</$keyboard>
&#32;
@ -46,7 +51,7 @@ title: $:/core/ui/EditorToolbar/link-dropdown
<<external-link>>
&#32;
<$button class="tc-btn-invisible tc-btn-mini" style="width: auto; display: inline-block; background-colour: inherit;">
<<cancel-search-actions>><$set name="cssEscapedTitle" value={{{ [<storyTiddler>escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<<get-focus-selector>>/></$set>
<<cancel-search-actions>><$set name="cssEscapedTitle" value={{{ [<storyTiddler>escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<<tf.get-focus-selector>>/></$set>
{{$:/core/images/close-button}}
</$button>
</$reveal>
@ -56,7 +61,7 @@ title: $:/core/ui/EditorToolbar/link-dropdown
<$linkcatcher actions=<<add-link-actions>> to=<<linkTiddler>>>
<$vars userInput={{{ [<storeTitle>get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}>
<$vars userInput={{{ [<storeTitle>get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}] }}}>
{{$:/core/ui/SearchResults}}
@ -70,4 +75,4 @@ title: $:/core/ui/EditorToolbar/link-dropdown
\end
<$macrocall $name="body" config-title=<<qualify "$:/state/Link/">>/>
<$transclude $variable="body" config-title=<<qualify "$:/state/Link/">>/>

View File

@ -2,4 +2,4 @@ title: $:/core/ui/SideBar/Recent
tags: $:/tags/SideBar
caption: {{$:/language/SideBar/Recent/Caption}}
<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}}/>
<$transclude $variable="timeline" format={{$:/language/RecentChanges/DateFormat}} limit={{$:/config/RecentLimit}}/>

View File

@ -3,12 +3,12 @@ tags: $:/tags/SideBarSegment
\whitespace trim
\define count-popup-button()
\procedure count-popup-button()
\whitespace trim
<$button popup=<<qualify "$:/state/popup/search-dropdown">> class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
<$list filter="[{$(searchTiddler)$}minlength{$:/config/Search/MinLength}limit[1]]" variable="listItem">
<$vars userInput={{{ [<searchTiddler>get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} replaceRegexp="limit\[\d+\]">
<$list filter="[<searchTiddler>get[text]minlength{$:/config/Search/MinLength}limit[1]]" variable="listItem">
<$vars userInput={{{ [<searchTiddler>get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}] }}} replaceRegexp="limit\[\d+\]">
<$vars primaryListFilter={{{ [<configTiddler>get[first-search-filter]search-replace:g:regexp<replaceRegexp>,[]] }}} secondaryListFilter={{{ [<configTiddler>get[second-search-filter]search-replace:g:regexp<replaceRegexp>,[]] }}}>
<$set name="resultCount" value="""<$count filter="[subfilter<primaryListFilter>] [subfilter<secondaryListFilter>]"/>""">
{{$:/language/Search/Matches}}
@ -19,9 +19,9 @@ tags: $:/tags/SideBarSegment
</$button>
\end
\define search-results-list()
\procedure search-results-list()
\whitespace trim
<$vars userInput={{$(searchTiddler)$}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}>
<$vars userInput={{{ [<searchTiddler>get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}] }}}>
<$list filter="[<userInput>minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$tiddler tiddler=<<configTiddler>>>
@ -34,30 +34,32 @@ tags: $:/tags/SideBarSegment
</$vars>
\end
\define cancel-search-actions() <$list filter="[<searchTiddler>get[text]!match{$:/temp/search}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/search]] [<searchTiddler>] [<searchListState>]"/>"""><$action-setfield $tiddler="$:/temp/search" text={{{ [<searchTiddler>get[text]] }}}/><$action-setfield $tiddler="$:/temp/search/refresh" text="yes"/></$list>
\procedure cancel-search-actions() <$list filter="[<searchTiddler>get[text]!match{$:/temp/search}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/search]] [<searchTiddler>] [<searchListState>]"/>"""><$action-setfield $tiddler="$:/temp/search" text={{{ [<searchTiddler>get[text]] }}}/><$action-setfield $tiddler="$:/temp/search/refresh" text="yes"/></$list>
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\procedure input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]"><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<tiddler>get[text]] }}}/></$list>
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\procedure input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<tiddler>get[text]!is[missing]] :else[<tiddler>get[text]is[shadow]]"><$list filter="[<tiddler>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<tiddler>get[text]] }}}/></$list></$list>"""><$list filter="[<tiddler>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<tiddler>get[text]] }}}/></$list></$list>
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/search/currentTab" text=<<nextTab>>/>"""/>
\procedure set-next-input-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="after" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/search/currentTab" text=<<nextTab>>/>"""/>
\define advanced-search-actions() <$action-setfield $tiddler="$:/temp/advancedsearch" text={{$:/temp/search/input}}/><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/search/input}}/><<delete-state-tiddlers>><$action-navigate $to="$:/AdvancedSearch"/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/><$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/><$action-deletetiddler $filter="$:/temp/search $:/temp/search/input $:/temp/search/refresh [<searchListState>]"/>
\procedure set-previous-input-tab() <$transclude $variable="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="before" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/search/currentTab" text=<<nextTab>>/>"""/>
\procedure advanced-search-actions() <$action-setfield $tiddler="$:/temp/advancedsearch" text={{$:/temp/search/input}}/><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/search/input}}/><<delete-state-tiddlers>><$action-navigate $to="$:/AdvancedSearch"/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/><$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/><$action-deletetiddler $filter="$:/temp/search $:/temp/search/input $:/temp/search/refresh [<searchListState>]"/>
<div class="tc-sidebar-lists tc-sidebar-search">
<$vars editTiddler="$:/temp/search" searchTiddler="$:/temp/search/input" searchListState=<<qualify "$:/state/search-list/selected-item">>>
<div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$keyboard key="((input-tab-left))" actions=<<set-previous-input-tab>>>
<$keyboard key="((advanced-search-sidebar))" actions=<<advanced-search-actions>>>
<form class="tc-form-inline">
<$macrocall $name="keyboard-driven-input" tiddler=<<editTiddler>> storeTitle=<<searchTiddler>>
<$transclude $variable="keyboard-driven-input" tiddler=<<editTiddler>> storeTitle=<<searchTiddler>>
selectionStateTitle=<<searchListState>> refreshTitle="$:/temp/search/refresh" type="search"
tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify "$:/state/popup/search-dropdown">>
class="tc-tiny-gap-right tc-popup-handle" filterMinLength={{$:/config/Search/MinLength}} inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>> cancelPopups="yes"
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"/>
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]"/>
</form>
</$keyboard>
</$keyboard>

View File

@ -0,0 +1,3 @@
title: $:/config/RecentLimit
100

View File

@ -1,105 +1,137 @@
title: $:/core/macros/keyboard-driven-input
tags: $:/tags/Macro
\define change-input-tab(stateTitle,tag,beforeafter,defaultState,actions)
\procedure prefix.bracket() [
\procedure suffix.bracket() ]
\function tf.change-input-tab.next-tab() [[all]addprefix<prefix.bracket>addsuffix<prefix.bracket>addsuffix[shadows+tiddlers]addsuffix<suffix.bracket>addsuffix[tag<tag>!has]addsuffix<prefix.bracket>addsuffix[draft.of]addsuffix<suffix.bracket>addsuffix<beforeafter>addsuffix[<currentState>]addsuffix<suffix.bracket>addsuffix[ :else]addsuffix<prefix.bracket>addsuffix<prefix.bracket>addsuffix<beforeafter>addsuffix<suffix.bracket>addsuffix[match]addsuffix<prefix.bracket>addsuffix[after]addsuffix<suffix.bracket>addsuffix[then<firstTab>]addsuffix<suffix.bracket>addsuffix[ :else]addsuffix<prefix.bracket>addsuffix<prefix.bracket>addsuffix<beforeafter>addsuffix<suffix.bracket>addsuffix[match]addsuffix<prefix.bracket>addsuffix[before]addsuffix<suffix.bracket>addsuffix[then<lastTab>]addsuffix<suffix.bracket>]
\procedure change-input-tab(stateTitle,tag,beforeafter,defaultState,actions)
\whitespace trim
<$set name="tabsList" filter="[all[shadows+tiddlers]tag<__tag__>!has[draft.of]]">
<$set name="tabsList" filter="[<explicitTabList>!is[blank]enlist-input[]] :else[all[shadows+tiddlers]tag<tag>!has[draft.of]]">
<$let
currentState={{{ [<__stateTitle__>!is[missing]get[text]] ~[<__defaultState__>] }}}
currentState={{{ [<stateTitle>!is[missing]get[text]] :else[<defaultState>] }}}
firstTab={{{ [enlist<tabsList>nth[1]] }}}
lastTab={{{ [enlist<tabsList>last[]] }}}
nextTab={{{ [all[shadows+tiddlers]tag<__tag__>!has[draft.of]$beforeafter$<currentState>] ~[[$beforeafter$]removeprefix[after]suffix[]addprefix<firstTab>] ~[[$beforeafter$]removeprefix[before]suffix[]addprefix<lastTab>] }}}
nextTabSubFilter=<<tf.change-input-tab.next-tab>>
nextTab={{{ [subfilter<nextTabSubFilter>] }}}
>
<$action-setfield $tiddler=<<__stateTitle__>> text=<<nextTab>>/>
$actions$
<$action-setfield $tiddler=<<stateTitle>> text=<<nextTab>>/>
<<actions>>
</$let>
</$set>
\end
\define keyboard-input-actions()
\procedure keyboard-input-actions()
\whitespace trim
<$list filter="[<__index__>match[]]">
<$action-setfield $tiddler=<<__storeTitle__>> text={{{ [<__tiddler__>get<__field__>] }}}/>
</$list>
<$list filter="[<__index__>!match[]]">
<$action-setfield $tiddler=<<__storeTitle__>> text={{{ [<__tiddler__>getindex<__index__>] }}}/>
</$list>
<%if [<index>match[]] %>
<$action-setfield $tiddler=<<storeTitle>> text={{{ [<tiddler>get<field>] }}}/>
<% endif %>
<%if [<index>!match[]] %>
<$action-setfield $tiddler=<<storeTitle>> text={{{ [<tiddler>getindex<index>] }}}/>
<% endif %>
\end
\define input-next-actions-inner()
\procedure input-next-actions-inner()
\whitespace trim
<$list filter="[<nextItem>minlength[1]]" variable="ignore">
<$action-setfield $tiddler=<<__selectionStateTitle__>> text=<<nextItem>>/>
<$list filter="[<__index__>match[]]">
<$action-setfield $tiddler=<<__tiddler__>> $field=<<__field__>> $value={{{ [<nextItem>] +[splitregexp[(?:.(?!-))+$]] }}}/>
</$list>
<$list filter="[<__index__>!match[]]">
<$action-setfield $tiddler=<<__tiddler__>> $index=<<__index__>> $value={{{ [<nextItem>] +[splitregexp[(?:.(?!-))+$]] }}}/>
</$list>
<$action-setfield $tiddler=<<__refreshTitle__>> text="yes"/>
</$list>
<%if [<nextItem>minlength[1]] %>
<$action-setfield $tiddler=<<selectionStateTitle>> text=<<nextItem>>/>
<%if [<index>match[]] %>
<$action-setfield $tiddler=<<tiddler>> $field=<<field>> $value={{{ [<nextItem>] :and[splitregexp[(?:.(?!-))+$]] }}}/>
<% endif %>
<%if [<index>!match[]] %>
<$action-setfield $tiddler=<<tiddler>> $index=<<index>> $value={{{ [<nextItem>] :and[splitregexp[(?:.(?!-))+$]] }}}/>
<% endif %>
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
<% endif %>
\end
\define input-next-actions(afterOrBefore:"after",reverse:"")
\procedure input-next-actions-after()
\whitespace trim
<$list
filter="[<__storeTitle__>get[text]minlength<__filterMinLength__>] [<__filterMinLength__>match[0]] +[limit[1]]"
variable="ignore"
>
<%if [<storeTitle>get[text]minlength<filterMinLength>] [<filterMinLength>match[0]] %>
<$let
userInput={{{ [<__storeTitle__>get[text]] }}}
selectedItem={{{ [<__selectionStateTitle__>get[text]] }}}
configTiddler={{{ [subfilter<__configTiddlerFilter__>] }}}
primaryListFilter={{{ [<configTiddler>get<__firstSearchFilterField__>] }}}
secondaryListFilter={{{ [<configTiddler>get<__secondSearchFilterField__>] }}}
userInput={{{ [<storeTitle>get[text]] }}}
selectedItem={{{ [<selectionStateTitle>get[text]] }}}
configTiddler={{{ [subfilter<configTiddlerFilter>] }}}
primaryListFilter={{{ [<configTiddler>get<firstSearchFilterField>] }}}
secondaryListFilter={{{ [<configTiddler>get<secondSearchFilterField>] }}}
>
<$set
name="filteredList"
filter="[subfilter<primaryListFilter>addsuffix[-primaryList]] =[subfilter<secondaryListFilter>addsuffix[-secondaryList]]"
filter="[subfilter<primaryListFilter>addsuffix[-primaryList]] :all[subfilter<secondaryListFilter>addsuffix[-secondaryList]]"
>
<$let
nextItem={{{ [enlist<filteredList>$afterOrBefore$<selectedItem>] ~[enlist<filteredList>$reverse$nth[1]] }}}
nextItem={{{ [enlist<filteredList>after<selectedItem>] :else[enlist<filteredList>nth[1]] }}}
firstItem={{{ [enlist<filteredList>nth[1]] }}}
lastItem={{{ [enlist<filteredList>last[]] }}}
>
<$list filter="[<selectedItem>match<firstItem>!match<lastItem>]" variable="ignore">
<$set name="nextItem" value={{{ [[$afterOrBefore$]match[before]then<userInput>addsuffix[-userInput]] ~[<nextItem>] }}}>
<<input-next-actions-inner>>
</$set>
</$list>
<$list filter="[<selectedItem>match<lastItem>!match<firstItem>]" variable="ignore">
<$set name="nextItem" value={{{ [[$afterOrBefore$]match[after]then<userInput>addsuffix[-userInput]] ~[<nextItem>] }}}>
<<input-next-actions-inner>>
</$set>
</$list>
<$list filter="[<selectedItem>match<firstItem>match<lastItem>]" variable="ignore">
<%if [<selectedItem>match<firstItem>!match<lastItem>] [<selectedItem>!match<firstItem>!match<lastItem>] %>
<<input-next-actions-inner>>
<%elseif [<selectedItem>match<lastItem>!match<firstItem>] %>
<$set name="nextItem" value={{{ [<userInput>addsuffix[-userInput]] }}}>
<<input-next-actions-inner>>
</$set>
</$list>
<$list filter="[<selectedItem>!match<firstItem>!match<lastItem>]" variable="ignore">
<<input-next-actions-inner>>
</$list>
<%elseif [<selectedItem>match<firstItem>match<lastItem>] %>
<$set name="nextItem" value={{{ [<userInput>addsuffix[-userInput]] }}}>
<<input-next-actions-inner>>
</$set>
<% endif %>
</$let>
</$set>
</$let>
</$list>
<% endif %>
\end
\define keyboard-driven-input(tiddler,storeTitle,field:"text",index:"",tag:"input",type,focus:"",inputAcceptActions,inputAcceptVariantActions,inputCancelActions,placeholder:"",default:"",class,focusPopup,rows,minHeight,tabindex,size,autoHeight,filterMinLength:"0",refreshTitle,selectionStateTitle,cancelPopups:"",configTiddlerFilter,firstSearchFilterField:"first-search-filter",secondSearchFilterField:"second-search-filter")
\procedure input-next-actions-before()
\whitespace trim
<$keyboard key="((input-accept))" actions=<<__inputAcceptActions__>>>
<$keyboard key="((input-accept-variant))" actions=<<__inputAcceptVariantActions__>>>
<$keyboard key="((input-up))" actions=<<input-next-actions "before" "reverse[]">>>
<$keyboard key="((input-down))" actions=<<input-next-actions>>>
<$keyboard key="((input-cancel))" actions=<<__inputCancelActions__>>>
<%if [<storeTitle>get[text]minlength<filterMinLength>] [<filterMinLength>match[0]] %>
<$let
userInput={{{ [<storeTitle>get[text]] }}}
selectedItem={{{ [<selectionStateTitle>get[text]] }}}
configTiddler={{{ [subfilter<configTiddlerFilter>] }}}
primaryListFilter={{{ [<configTiddler>get<firstSearchFilterField>] }}}
secondaryListFilter={{{ [<configTiddler>get<secondSearchFilterField>] }}}
>
<$set
name="filteredList"
filter="[subfilter<primaryListFilter>addsuffix[-primaryList]] :all[subfilter<secondaryListFilter>addsuffix[-secondaryList]]"
>
<$let
nextItem={{{ [enlist<filteredList>before<selectedItem>] :else[enlist<filteredList>reverse[]nth[1]] }}}
firstItem={{{ [enlist<filteredList>nth[1]] }}}
lastItem={{{ [enlist<filteredList>last[]] }}}
>
<%if [<selectedItem>match<firstItem>!match<lastItem>] %>
<$set name="nextItem" value={{{ [<userInput>addsuffix[-userInput]] }}}>
<<input-next-actions-inner>>
</$set>
<%elseif [<selectedItem>match<lastItem>!match<firstItem>] [<selectedItem>!match<firstItem>!match<lastItem>] %>
<<input-next-actions-inner>>
<%elseif [<selectedItem>match<firstItem>match<lastItem>] %>
<$set name="nextItem" value={{{ [<userInput>addsuffix[-userInput]] }}}>
<<input-next-actions-inner>>
</$set>
<% endif %>
</$let>
</$set>
</$let>
<% endif %>
\end
\procedure keyboard-driven-input(tiddler,storeTitle,field:"text",index:"",tag:"input",type,focus:"",inputAcceptActions,inputAcceptVariantActions,inputCancelActions,placeholder:"",default:"",class,focusPopup,rows,minHeight,tabindex,size,autoHeight,filterMinLength:"0",refreshTitle,selectionStateTitle,cancelPopups:"",configTiddlerFilter,firstSearchFilterField:"first-search-filter",secondSearchFilterField:"second-search-filter")
\whitespace trim
<$keyboard key="((input-accept))" actions=<<inputAcceptActions>>>
<$keyboard key="((input-accept-variant))" actions=<<inputAcceptVariantActions>>>
<$keyboard key="((input-up))" actions=<<input-next-actions-before>>>
<$keyboard key="((input-down))" actions=<<input-next-actions-after>>>
<$keyboard key="((input-cancel))" actions=<<inputCancelActions>>>
<$edit-text
tiddler=<<__tiddler__>> field=<<__field__>> index=<<__index__>>
inputActions=<<keyboard-input-actions>> tag=<<__tag__>> class=<<__class__>>
placeholder=<<__placeholder__>> default=<<__default__>> focusPopup=<<__focusPopup__>>
focus=<<__focus__>> type=<<__type__>> rows=<<__rows__>> minHeight=<<__minHeight__>>
tabindex=<<__tabindex__>> size=<<__size__>> autoHeight=<<__autoHeight__>>
refreshTitle=<<__refreshTitle__>> cancelPopups=<<__cancelPopups__>>
tiddler=<<tiddler>> field=<<field>> index=<<index>>
inputActions=<<keyboard-input-actions>> tag=<<tag>> class=<<class>>
placeholder=<<placeholder>> default=<<default>> focusPopup=<<focusPopup>>
focus=<<focus>> type=<<type>> rows=<<rows>> minHeight=<<minHeight>>
tabindex=<<tabindex>> size=<<size>> autoHeight=<<autoHeight>>
refreshTitle=<<refreshTitle>> cancelPopups=<<cancelPopups>>
/>
</$keyboard>
</$keyboard>

View File

@ -13,11 +13,11 @@ second-search-filter: [subfilter<tagListFilter>is[system]search:title<userInput>
<!-- tf.tagpicker-dropdown-id is needed if several tap-pickers are shown in one tiddler -->
\function tf.tagpicker-dropdown-id()
[<qualify $:/state/popup/tags-auto-complete>]
[[$(saveTiddler)$-[$(tagField)$-$(tagListFilter)$]substitute[]sha256[]] +[join[/]]
[[$(saveTiddler)$-[$(tagField)$-$(tagListFilter)$]substitute[]sha256[]] :and[join[/]]
\end
\function tf.tagpicker-dropdown-class() [<tf.tagpicker-dropdown-id>sha256[]addprefix[tc-]]
\function tf.get-tagpicker-focus-selector() [<tf.tagpicker-dropdown-class>addprefix[.]] .tc-popup-handle +[join[ ]]
\function tf.get-tagpicker-focus-selector() [<tf.tagpicker-dropdown-class>addprefix[.]] .tc-popup-handle :and[join[ ]]
<!-- clean up temporary tiddlers, so the next "pick" starts with a clean input -->
<!-- This could probably be optimized / removed if we would use different temp-tiddlers
@ -30,7 +30,7 @@ second-search-filter: [subfilter<tagListFilter>is[system]search:title<userInput>
<!-- trigger __toggle tag__ by keyboard -->
\procedure add-tag-actions()
<$let tag=<<_tf.getTag>> >
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter='+[toggle<tag>trim[]]'/>
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter=':and[toggle<tag>trim[]]'/>
<%if [<tag>] :intersection[<saveTiddler>get<tagField>enlist-input[]] %>
<!-- tag has been removed - do nothing -->
<%else%>
@ -46,7 +46,7 @@ second-search-filter: [subfilter<tagListFilter>is[system]search:title<userInput>
The second ESC tries to close the "draft tiddler"
-->
\procedure clear-tags-actions-inner()
<%if [<storeTitle>has[text]] ~[<newTagNameTiddler>has[text]] %>
<%if [<storeTitle>has[text]] :else[<newTagNameTiddler>has[text]] %>
<<delete-tag-state-tiddlers>>
<%else%>
<<cancel-delete-tiddler-actions "cancel">>
@ -90,7 +90,7 @@ The second ESC tries to close the "draft tiddler"
<!-- tf.get-tagpicker-focus-selector has to be resolved for $:/core/ui/TagPickerTagTemplate,
othwerwise qualify in tf.tagpicker-dropdown-id causes problems -->
<$let currentTiddler=<<tag>>
button-classes=`tc-btn-invisible ${[<tag>addsuffix<suffix>] -[<tagSelectionState>get[text]] :then[[]] ~tc-tag-button-selected }$`
button-classes=`tc-btn-invisible ${[<tag>addsuffix<suffix>] :except[<tagSelectionState>get[text]] :then[[]] ~tc-tag-button-selected }$`
get-tagpicker-focus-selector=`${[<tf.get-tagpicker-focus-selector>]}$`
>
{{||$:/core/ui/TagPickerTagTemplate}}
@ -102,10 +102,10 @@ The second ESC tries to close the "draft tiddler"
<!-- tag-picker-inner is the main function -->
\procedure tag-picker-inner()
<div class={{{ [[tc-edit-add-tag]] [<tf.tagpicker-dropdown-class>] +[join[ ]] }}}>
<div class={{{ [[tc-edit-add-tag]] [<tf.tagpicker-dropdown-class>] :and[join[ ]] }}}>
<div class="tc-edit-add-tag-ui">
<span class="tc-add-tag-name tc-small-gap-right">
<$macrocall $name="keyboard-driven-input"
<$transclude $variable="keyboard-driven-input"
tiddler=<<newTagNameTiddler>>
storeTitle=<<storeTitle>>
refreshTitle=<<refreshTitle>>
@ -117,7 +117,7 @@ The second ESC tries to close the "draft tiddler"
focusPopup=<<tf.tagpicker-dropdown-id>>
class="tc-edit-texteditor tc-popup-handle"
tabindex=<<tabIndex>>
focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}}
focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] :else[[false]] }}}
filterMinLength={{$:/config/Tags/MinLength}}
cancelPopups=<<cancelPopups>>
configTiddlerFilter="[[$:/core/macros/tag-picker]]"
@ -146,9 +146,9 @@ The second ESC tries to close the "draft tiddler"
<div class="tc-block-dropdown-wrapper">
<%if [<tf.tagpicker-dropdown-id>has[text]] %>
<div class="tc-block-dropdown tc-block-tags-dropdown">
<$macrocall $name="tag-picker-listTags" filter=<<nonSystemTagsFilter>> suffix="-primaryList" empty={{$:/language/EditTemplate/Tags/EmptyMessage}}/>
<$transclude $variable="tag-picker-listTags" filter=<<nonSystemTagsFilter>> suffix="-primaryList" empty={{$:/language/EditTemplate/Tags/EmptyMessage}}/>
<hr>
<$macrocall $name="tag-picker-listTags" filter=<<systemTagsFilter>> suffix="-secondaryList" empty={{$:/language/EditTemplate/Tags/EmptyMessage/System}}/>
<$transclude $variable="tag-picker-listTags" filter=<<systemTagsFilter>> suffix="-secondaryList" empty={{$:/language/EditTemplate/Tags/EmptyMessage/System}}/>
</div>
<%endif%>
</div>
@ -161,7 +161,7 @@ The second ESC tries to close the "draft tiddler"
\function _tf.getUserInput() [<storeTitle>get[text]]
\function _tf.getTag() [<newTagNameTiddler>get[text]]
<!-- Use this function if tag-picker is a stand alone macro. Otherwise use "newTagNameTiddler" defined for fieldmangler in EditTemplate -->
\function _tf.makeTagNameTiddler() [[$:/temp/NewTagName]] [<tagField>!match[tags]] +[join[/]] [<qualify>] +[join[]]
\function _tf.makeTagNameTiddler() [[$:/temp/NewTagName]] [<tagField>!match[tags]] :and[join[/]] [<qualify>] :and[join[]]
<!-- keep those variables because they may "bleed" into macros using old syntax -->
<!-- "nonSystemTagsFilter", "systemTagsFilter" __need to be the same__ as fields: "first-search-filter", "second-search-filter" -->
@ -174,10 +174,10 @@ The second ESC tries to close the "draft tiddler"
saveTiddler={{{ [<tiddler>is[blank]then<currentTiddler>else<tiddler>] }}}
newTagNameTiddler={{{ [[newTagNameTiddler]is[variable]then<newTagNameTiddler>] :else[<_tf.makeTagNameTiddler>] }}}
storeTitle={{{ [[$:/temp/NewTagName/input]] [<tagField>!match[tags]] +[join[/]] [<qualify>] +[join[]] }}}
storeTitle={{{ [[$:/temp/NewTagName/input]] [<tagField>!match[tags]] :and[join[/]] [<qualify>] :and[join[]] }}}
newTagNameSelectionTiddlerQualified=<<qualify "$:/temp/NewTagName/selected-item">>
tagSelectionState={{{ [<newTagNameSelectionTiddler>!match[]] ~[<newTagNameSelectionTiddlerQualified>] }}}
tagSelectionState={{{ [<newTagNameSelectionTiddler>!match[]] :else[<newTagNameSelectionTiddlerQualified>] }}}
refreshTitle=<<qualify "$:/temp/NewTagName/refresh">>
@ -186,6 +186,6 @@ The second ESC tries to close the "draft tiddler"
cancelPopups="yes"
>
<$macrocall $name="tag-picker-inner"/>
<$transclude $variable="tag-picker-inner"/>
</$let>
\end

View File

@ -37,7 +37,10 @@ tags: $:/tags/Macro
\end
\define toc(tag,sort:"",itemClassFilter:"", exclude)
<$macrocall $name="toc-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>>/>
\whitespace trim
<$let __tag__={{{ [<__tag__>is[blank]then<currentTiddler>else<__tag__>] }}} >
<$macrocall $name="toc-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>>/>
</$let>
\end
\define toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
@ -99,7 +102,7 @@ tags: $:/tags/Macro
\define toc-expandable(tag,sort:"",itemClassFilter:"",exclude,path)
\whitespace trim
<$let tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
<$let __tag__={{{ [<__tag__>is[blank]then<currentTiddler>else<__tag__>] }}} tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
<$set name="excluded" filter="[subfilter<__exclude__>] [<__tag__>]">
<ol class="tc-toc toc-expandable">
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[subfilter<__exclude__>]""">
@ -173,7 +176,7 @@ tags: $:/tags/Macro
\define toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path)
\whitespace trim
<$let tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
<$let __tag__={{{ [<__tag__>is[blank]then<currentTiddler>else<__tag__>] }}} tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
<$set name="excluded" filter="[subfilter<__exclude__>] [<__tag__>]">
<ol class="tc-toc toc-selective-expandable">
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[subfilter<__exclude__>]""">
@ -188,31 +191,35 @@ tags: $:/tags/Macro
\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"",exclude)
\whitespace trim
<$tiddler tiddler={{{ [<__selectedTiddler__>get[text]] }}}>
<div class="tc-tabbed-table-of-contents">
<$linkcatcher to=<<__selectedTiddler__>>>
<div class="tc-table-of-contents">
<$macrocall $name="toc-selective-expandable" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter="[all[current]] -[<__selectedTiddler__>get[text]]" exclude=<<__exclude__>>/>
<$let __tag__={{{ [<__tag__>is[blank]then<currentTiddler>else<__tag__>] }}}>
<$tiddler tiddler={{{ [<__selectedTiddler__>get[text]] }}}>
<div class="tc-tabbed-table-of-contents">
<$linkcatcher to=<<__selectedTiddler__>>>
<div class="tc-table-of-contents">
<$macrocall $name="toc-selective-expandable" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter="[all[current]] -[<__selectedTiddler__>get[text]]" exclude=<<__exclude__>>/>
</div>
</$linkcatcher>
<div class="tc-tabbed-table-of-contents-content">
<$reveal stateTitle=<<__selectedTiddler__>> type="nomatch" text="">
<$transclude mode="block" tiddler=<<__template__>>>
<h1><<toc-caption>></h1>
<$transclude mode="block">$missingText$</$transclude>
</$transclude>
</$reveal>
<$reveal stateTitle=<<__selectedTiddler__>> type="match" text="">
$unselectedText$
</$reveal>
</div>
</$linkcatcher>
<div class="tc-tabbed-table-of-contents-content">
<$reveal stateTitle=<<__selectedTiddler__>> type="nomatch" text="">
<$transclude mode="block" tiddler=<<__template__>>>
<h1><<toc-caption>></h1>
<$transclude mode="block">$missingText$</$transclude>
</$transclude>
</$reveal>
<$reveal stateTitle=<<__selectedTiddler__>> type="match" text="">
$unselectedText$
</$reveal>
</div>
</div>
</$tiddler>
</$tiddler>
</$let>
\end
\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"",exclude)
\whitespace trim
<$linkcatcher to=<<__selectedTiddler__>>>
<$macrocall $name="toc-tabbed-external-nav" tag=<<__tag__>> sort=<<__sort__>> selectedTiddler=<<__selectedTiddler__>> unselectedText=<<__unselectedText__>> missingText=<<__missingText__>> template=<<__template__>> exclude=<<__exclude__>> />
</$linkcatcher>
<$let __tag__={{{ [<__tag__>is[blank]then<currentTiddler>else<__tag__>] }}}>
<$linkcatcher to=<<__selectedTiddler__>>>
<$macrocall $name="toc-tabbed-external-nav" tag=<<__tag__>> sort=<<__sort__>> selectedTiddler=<<__selectedTiddler__>> unselectedText=<<__unselectedText__>> missingText=<<__missingText__>> template=<<__template__>> exclude=<<__exclude__>> />
</$linkcatcher>
</$let>
\end

View File

@ -11,4 +11,4 @@ title: Output
+
title: ExpectedResult
<p>(Kitten|Donkey)(Kitten|Donkey)</p>
<p>(Shark|Donkey)(Shark|Donkey)</p>

View File

@ -0,0 +1,15 @@
title: Widgets/ElementWidgetCSSCustomProps
description: Element widget should support CSS custom properties
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
<div class="hello" onclick="clicked" style.color="blue" style.color="red" style.background="yellow" --bg-color="purple">
TiddlyWiki
</div>
+
title: ExpectedResult
<p><div class="hello" style="color:red;background:yellow;--bg-color:purple;">TiddlyWiki</div></p>

View File

@ -13,7 +13,6 @@ Use this procedure if the language being submitted is not already present in the
# Copy the language files into the language folder
# Create a `plugin.info` file for the translation
# Create an appropriate flag image in `icon.tid`
# Change the title of the [[$:/core/readme]] tiddler to `$:/core/xx-XX/readme`
# Add the new language to tw5.com
# Submit a pull request

View File

@ -13,6 +13,7 @@
"de-DE",
"el-GR",
"en-US",
"en-PH",
"es-ES",
"fa-IR",
"fr-FR",
@ -44,32 +45,32 @@
],
"build": {
"index": [
"--rendertiddler","$:/core/save/all","index.html","text/plain"],
"--render","$:/core/save/all","index.html","text/plain"],
"output-files": [
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Buttons.multids","language/Buttons.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/ControlPanel.multids","language/ControlPanel.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/CoreReadMe.tid","language/CoreReadMe.tid","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Dates.multids","language/Dates.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/EditTemplate.multids","language/EditTemplate.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Exporters.multids","language/Exporters.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Fields.multids","language/Fields.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Filters.multids","language/Filters.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/GettingStarted.tid","language/GettingStarted.tid","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Import.multids","language/Import.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Misc.multids","language/Misc.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/ModuleTypes.multids","language/Docs/ModuleTypes.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/NewJournal.multids","language/NewJournal.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Notifications.multids","language/Notifications.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/PaletteColours.multids","language/Docs/PaletteColours.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/Search.multids","language/Search.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/SideBar.multids","language/SideBar.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/SiteSubtitle.tid","language/SiteSubtitle.tid","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/SiteTitle.tid","language/SiteTitle.tid","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/ThemeTweaks.multids","language/ThemeTweaks.multids","text/plain",
"--rendertiddler","$:/plugins/tiddlywiki/translators/templates/TiddlerInfo.multids","language/TiddlerInfo.multids","text/plain",
"--rendertiddlers","[prefix[$:/language/Docs/Types/]removeprefix[$:/language/Docs/Types/]]","$:/plugins/tiddlywiki/translators/templates/type-tid","language/Types","text/plain",".tid",
"--rendertiddlers","[prefix[$:/language/Help/]removeprefix[$:/language/Help/]]","$:/plugins/tiddlywiki/translators/templates/help-tid","language/Help","text/plain",".tid",
"--rendertiddlers","[prefix[$:/language/Modals/]removeprefix[$:/language/Modals/]]","$:/plugins/tiddlywiki/translators/templates/modal-tid","language/Modals","text/plain",".tid",
"--rendertiddlers","[prefix[$:/language/Snippets/]removeprefix[$:/language/Snippets/]]","$:/plugins/tiddlywiki/translators/templates/snippet-tid","language/Snippets","text/plain",".tid"]
"--render","$:/plugins/tiddlywiki/translators/templates/Buttons.multids","language/Buttons.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/ControlPanel.multids","language/ControlPanel.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/CoreReadMe.tid","language/CoreReadMe.tid","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/Dates.multids","language/Dates.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/EditTemplate.multids","language/EditTemplate.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/Exporters.multids","language/Exporters.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/Fields.multids","language/Fields.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/Filters.multids","language/Filters.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/GettingStarted.tid","language/GettingStarted.tid","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/Import.multids","language/Import.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/Misc.multids","language/Misc.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/ModuleTypes.multids","language/Docs/ModuleTypes.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/NewJournal.multids","language/NewJournal.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/Notifications.multids","language/Notifications.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/PaletteColours.multids","language/Docs/PaletteColours.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/Search.multids","language/Search.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/SideBar.multids","language/SideBar.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/SiteSubtitle.tid","language/SiteSubtitle.tid","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/SiteTitle.tid","language/SiteTitle.tid","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/ThemeTweaks.multids","language/ThemeTweaks.multids","text/plain",
"--render","$:/plugins/tiddlywiki/translators/templates/TiddlerInfo.multids","language/TiddlerInfo.multids","text/plain",
"--render","[prefix[$:/language/Docs/Types/]]","[removeprefix[$:/language/Docs/Types/]search-replace:g:regexp[/|\\\\],[_]addprefix[language/Types/]addsuffix[.tid]]","text/plain","$:/plugins/tiddlywiki/translators/templates/type-tid",
"--render","[prefix[$:/language/Help/]]","[removeprefix[$:/]addsuffix[.tid]]","text/plain","$:/plugins/tiddlywiki/translators/templates/help-tid",
"--render","[prefix[$:/language/Modals/]]","[removeprefix[$:/]addsuffix[.tid]]","text/plain","$:/plugins/tiddlywiki/translators/templates/modal-tid",
"--render","[prefix[$:/language/Snippets/]]","[removeprefix[$:/]addsuffix[.tid]]","text/plain","$:/plugins/tiddlywiki/translators/templates/snippet-tid"]
}
}

View File

@ -0,0 +1,9 @@
created: 20240612115323606
modified: 20240612115535069
tags: [[Core Variables]] Variables
title: actionTiddlerList Variable
type: text/vnd.tiddlywiki
The variable `actionTiddlerList` is used:
* Within the ''listActions'' string of the DroppableWidget, the <<.def actionTiddlerList>> [[variable|Variables]] contains a [[Title List]] of the tiddlers being dropped.

View File

@ -1,27 +1,31 @@
created: 20140919155729620
modified: 20230427125500432
modified: 20240624102502089
tags: Macros [[Core Macros]]
title: Table-of-Contents Macros
type: text/vnd.tiddlywiki
~TiddlyWiki provides several macros for generating a tree of tiddler links by analysing [[tags|Tagging]]:
;<<.var toc>>
; <<.var toc>>
: A simple tree
;<<.var toc-expandable>>
; <<.var toc-expandable>>
: A tree in which all the branches can be expanded and collapsed
;<<.var toc-selective-expandable>>
; <<.var toc-selective-expandable>>
: A tree in which the non-empty branches can be expanded and collapsed
;<<.var toc-tabbed-internal-nav>> and <<.var toc-tabbed-external-nav>>
; <<.var toc-tabbed-internal-nav>> and <<.var toc-tabbed-external-nav>>
: A two-panel browser:
:* on the left, a selectively expandable tree that behaves like a set of vertical tabs
:* on the right, the content of whichever tiddler the user selects in the tree
The difference between the last two has to do with what happens when the user clicks a link in the right-hand panel:
;<<.var toc-tabbed-internal-nav>>
; <<.var toc-tabbed-internal-nav>>
: The target tiddler appears in the right-hand panel, replacing the tiddler that contained the link
;<<.var toc-tabbed-external-nav>>
; <<.var toc-tabbed-external-nav>>
: The target tiddler appears in the normal way (which depends on the user's configured storyview)
!! Structure
@ -42,9 +46,11 @@ To make a table of contents appear in the sidebar, see [[How to add a new tab to
!! Parameters
;tag
; tag
: The root tag that identifies the top level of the tree
;sort
: <<.from-version "5.3.5">> If the <<.param tag>> parameter is "missing" or "an empty" string, the <<.var curretTiddler>> variable is used
; sort
: An optional extra [[filter step|Filter Step]], e.g. `sort[title]`
These two parameters are combined into a single [[filter expression|Filter Expression]] like this:

View File

@ -1,5 +1,5 @@
created: 20170406083917224
modified: 20190118084621046
modified: 20240612115232524
tags: Variables [[Core Variables]]
title: actionTiddler Variable
type: text/vnd.tiddlywiki
@ -7,4 +7,4 @@ type: text/vnd.tiddlywiki
The variable `actionTiddler` is used in subtly different ways by different widgets:
* Within the ''actions'' string of the DroppableWidget, the <<.def actionTiddler>> [[variable|Variables]] contains the title of the tiddler being dropped.
* Within the ''startactions'' and ''endactions'' string of the DroppableWidget, the <<.def actionTiddler>> [[variable|Variables]] contains a quoted [[Title List]] of all of the titles being dragged.
* Within the ''startactions'' and ''endactions'' string of the DraggableWidget, the <<.def actionTiddler>> [[variable|Variables]] contains a quoted [[Title List]] of all of the titles being dragged.

View File

@ -1,22 +1,27 @@
caption: droppable
created: 20170406082820317
modified: 20231121101447359
modified: 20240612125454153
tags: Widgets TriggeringWidgets
title: DroppableWidget
type: text/vnd.tiddlywiki
\define droppable-image-actions()
\procedure drop-on-tags-actions()
<$action-log actionTiddlerList=<<actionTiddlerList>>/>
<$action-setfield $tiddler="$:/temp/drop/TitleList" $field="text" text=<<actionTiddlerList>> type="text/plain"/>
\end
\procedure droppable-image-actions()
<$action-setfield $tiddler=<<actionTiddler>> $field="icon" $value=<<currentTiddler>>/>
\end
\define colour-demo-body()
\procedure colour-demo-body()
<$droppable actions=<<droppable-colour-actions>>>
<span style="display: inline-block; width: 1em; height: 1em;background-color: $(currentTiddler)$;">
<span style=`display: inline-block; width: 1em; height: 1em;background-color: $(currentTiddler)$;`>
</span>
</$droppable>
\end
\define droppable-colour-actions()
\procedure droppable-colour-actions()
<$action-setfield $tiddler=<<actionTiddler>> $field="color" $value=<<currentTiddler>>/>
\end
@ -26,22 +31,23 @@ See DragAndDropMechanism for an overview.
! Content and Attributes
|!Attribute |!Description |
|actions |Actions to be performed when items are dropped |
|! Attribute |! Description |
|actions |Actions to be performed when items are dropped. It activates ''1 action per item'' |
|listActions |<<.from-version "5.3.4">> Actions to be performed when items are dropped. It activates ''1 action for'' a the whole ''list of items'' |
|class |Optional CSS classes to assign to the draggable element. The class `tc-droppable` is added automatically, and the class `tc-dragover` is applied while an item is being dragged over the droppable element |
|tag |Optional tag to override the default of a "div" element when the widget is rendered in block mode, or a "span" element when it is rendered in inline mode |
|enable |<<.from-version "5.1.22">> Optional value "no" to disable the droppable functionality (defaults to "yes") |
|data-* |<<.from-version "5.3.2">> Optional [[data attributes|https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes]] to be assigned to the HTML element |
|style.* |<<.from-version "5.3.2">> Optional [[CSS properties|https://developer.mozilla.org/en-US/docs/Web/CSS/Reference]] to be assigned to the HTML element |
Within the action string, there are two Variables generated by the DroppableWidget:
''Within the action string'', the following variables are generated by the DroppableWidget:
* The [[actionTiddler Variable]] contains the title of the item being dropped
* The [[modifier Variable]] contains the Modifier Key held while dragging (can be normal, ctrl, shift or ctrl-shift)
|!Variables |!Description |
|`actionTiddler` |For parameter <<.param actions>>, the [[actionTiddler Variable]] contains the title of the item being dropped |
|`actionTiddlerList` |For parameter <<.param listActions>> the [[actionTiddlerList Variable]] contains a [[Title List]] of all the items being dropped |
|`modifier` |The [[modifier Variable]] contains the modifier key held while dragging (can be normal, ctrl, shift or ctrl-shift) |
If multiple items are dropped then the actions are performed repeatedly, once for each dropped item.
<<.tip """Note that the [[actionTiddler Variable]] holds a single, unquoted title. This is unlike the DraggableWidget which uses the same variable to pass a quoted [[Title List]].""">>
<<.note """Note that the <<.var actionTiddler>> variable holds a single, unquoted title. This is unlike the DraggableWidget which uses the same variable to pass a quoted [[Title List]].""">>
! Examples
@ -53,9 +59,22 @@ This example displays a palette of icons. Dragging a tiddler onto one of the ico
</$droppable>
</$list>
---
Similarly, this example shows a palette of colours. Dragging a tiddler onto one of the colours assigns that colour to be used for rendering the icon of the tiddler.
<$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">
<<colour-demo-body>>
</$list>
---
Drag the tag pill <<tag HelloThere>> or a single tiddler link [[HelloThere]] into the "Drop Area" below. It will show the "Title List" stored in $:/temp/drop/TitleList
<<.note title:""
_:"""<$droppable listActions=<<drop-on-tags-actions>> >
''Drop'' the tagpill or a link into this ''area''.<br>
~TitleList: <$transclude $tiddler="$:/temp/drop/TitleList"/>
</$droppable>""">>

View File

@ -25,7 +25,7 @@ The content of the <<.wid genesis>> widget is used as the content of the dynamic
<<.from-version "5.2.6">> If the `$type` attribute is missing or blank, the <<.wlink GenesisWidget>> widget does not render an intrinsic element, instead just rendering its children.
Note that attributes explicitly specified take precedence over attributes with the same name specified in the `$names` filter.
<<.from-version "5.3.6">> Note that attributes explicitly specified take precedence over attributes with the same name specified in the `$names` filter. This has always been the documented behaviour but prior to [[Release 5.3.6]] the implementation was reversed, and the `$names` attributes took precedence. This was fixed in [[Release 5.3.6]].
! Examples

View File

@ -1,6 +1,6 @@
caption: HTML
created: 20131205160816081
modified: 20230615060119987
modified: 20241025073517909
tags: WikiText
title: HTML in WikiText
type: text/vnd.tiddlywiki
@ -68,13 +68,13 @@ In an extension of conventional HTML syntax, attributes of elements and widgets
!! Style Attributes
<<.from-version "5.2.2">> TiddlyWiki supports the usual HTML ''style'' attribute for assigning CSS styles to elements:
TiddlyWiki supports the usual HTML ''style'' attribute for assigning CSS styles to elements:
```
<div style="color:red;">Hello</div>
```
In an extension to HTML, TiddlyWiki also supports accessing individual CSS styles as independent attributes. For example:
<<.from-version "5.2.2">> In an extension to HTML, TiddlyWiki also supports accessing individual CSS styles as independent attributes. For example:
```
<div style.color="red">Hello</div>
@ -86,10 +86,8 @@ The advantage of this syntax is that it simplifies assigning computed values to
<div style.color={{!!color}}>Hello</div>
```
<<.from-version "5.3.6">> TiddlyWiki also supports setting [[CSS custom properties|https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties]] as independent attributes. For example:
```
<div --bg-color={{{ [[red]] }}}>Hello</div>
```

View File

@ -15,6 +15,12 @@ title: $:/Translators
Number of translated tiddlers: <$count filter=<<allTheTranslatedTiddlerTitles>>/> of <$count filter=<<allTheTranslatableTiddlerTitles>>/>
<$wikify name="max" text="""<$count filter=<<allTheTranslatableTiddlerTitles>>/>""">
<$wikify name="value" text="""<$count filter=<<allTheTranslatedTiddlerTitles>>/>""">
<progress max=<<max>> value=<<value>>/>
</$wikify>
</$wikify>
{{$:/core/ui/PageTemplate/pagecontrols}}
<<tabs "[all[tiddlers+shadows]tag[$:/tags/TranslationGroup]sort[caption]]" "$:/plugins/tiddlywiki/translators/ui/group/Miscellaneous" "$:/state/translatorsTab" "tc-vertical">>

View File

@ -1,9 +1,9 @@
title: $:/plugins/tiddlywiki/translators/templates/help-tid
\define generateTid(title)
title: $:/language/Help/$title$
description: <$text text={{$:/language/Help/$title$!!description}}/>
\procedure generateTid(title)
title: <<title>>
description: <$text text={{!!description}}/>
<$text text={{$:/language/Help/$title$}}/>
<$text text={{!!text}}/>
\end
<$macrocall $name="generateTid" title=<<currentTiddler>>/>
<$transclude $variable="generateTid" title=<<currentTiddler>>/>

View File

@ -1,12 +1,12 @@
title: $:/plugins/tiddlywiki/translators/templates/modal-tid
\define generateTid(title)
title: $:/language/Modals/$title$
type: <$text text={{$:/language/Modals/$title$!!type}}/>
subtitle: <$text text={{$:/language/Modals/$title$!!subtitle}}/>
footer: <$text text={{$:/language/Modals/$title$!!footer}}/>
help: <$text text={{$:/language/Modals/$title$!!help}}/>
\procedure generateTid(title)
title: <<title>>
type: <$text text={{!!type}}/>
subtitle: <$text text={{!!subtitle}}/>
footer: <$text text={{!!footer}}/>
help: <$text text={{!!help}}/>
<$text text={{$:/language/Modals/$title$}}/>
<$text text={{!!text}}/>
\end
<$macrocall $name="generateTid" title=<<currentTiddler>>/>
<$transclude $variable="generateTid" title=<<currentTiddler>>/>

View File

@ -1,10 +1,10 @@
title: $:/plugins/tiddlywiki/translators/templates/snippet-tid
\define generateTid(title)
title: $:/language/Snippets/$title$
\procedure generateTid(title)
title: <<title>>
tags: $:/tags/TextEditor/Snippet
caption: <$text text={{$:/language/Snippets/$title$!!caption}}/>
caption: <$text text={{!!caption}}/>
<$text text={{$:/language/Snippets/$title$}}/>
<$text text={{!!text}}/>
\end
<$macrocall $name="generateTid" title=<<currentTiddler>>/>
<$transclude $variable="generateTid" title=<<currentTiddler>>/>

View File

@ -1,10 +1,10 @@
title: $:/plugins/tiddlywiki/translators/templates/type-tid
\define generateTid(title)
title: $:/language/Docs/Types/$title$
description: <$text text={{$:/language/Docs/Types/$title$!!description}}/>
name: <$text text={{$:/language/Docs/Types/$title$!!name}}/>
group: <$text text={{$:/language/Docs/Types/$title$!!group}}/>
\procedure generateTid(title)
title: <<title>>
description: <$text text={{!!description}}/>
name: <$text text={{!!name}}/>
group: <$text text={{!!group}}/>
\end
<$macrocall $name="generateTid" title=<<currentTiddler>>/>
<$transclude $variable="generateTid" title=<<currentTiddler>>/>

View File

@ -295,6 +295,13 @@ kbd {
color: <<colour highlight-foreground>>;
}
/* Markdown uses mark element to highlight */
mark {
background: <<colour highlight-background>>;
color: <<colour highlight-foreground>>;
}
form.tc-form-inline {
display: inline;
}