218 changes: 171 additions & 47 deletions core/modules/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,32 +538,13 @@ exports.findListingsOfTiddler = function(targetTitle,fieldName) {
Sorts an array of tiddler titles according to an ordered list
*/
exports.sortByList = function(array,listTitle) {
var list = this.getTiddlerList(listTitle);
if(!array || array.length === 0) {
return [];
} else {
var titles = [], t, title;
// First place any entries that are present in the list
for(t=0; t<list.length; t++) {
title = list[t];
if(array.indexOf(title) !== -1) {
titles.push(title);
}
}
// Then place any remaining entries
for(t=0; t<array.length; t++) {
title = array[t];
if(list.indexOf(title) === -1) {
titles.push(title);
}
}
// Finally obey the list-before and list-after fields of each tiddler in turn
var sortedTitles = titles.slice(0);
for(t=0; t<sortedTitles.length; t++) {
title = sortedTitles[t];
var currPos = titles.indexOf(title),
newPos = -1,
tiddler = this.getTiddler(title);
var self = this,
replacedTitles = Object.create(null);
function replaceItem(title) {
if(!$tw.utils.hop(replacedTitles, title)) {
replacedTitles[title] = true;
var newPos = -1,
tiddler = self.getTiddler(title);
if(tiddler) {
var beforeTitle = tiddler.fields["list-before"],
afterTitle = tiddler.fields["list-after"];
Expand All @@ -572,25 +553,54 @@ exports.sortByList = function(array,listTitle) {
} else if(afterTitle === "") {
newPos = titles.length;
} else if(beforeTitle) {
replaceItem(beforeTitle);
newPos = titles.indexOf(beforeTitle);
} else if(afterTitle) {
replaceItem(afterTitle);
newPos = titles.indexOf(afterTitle);
if(newPos >= 0) {
++newPos;
}
}
// We get the currPos //after// figuring out the newPos, because recursive replaceItem calls might alter title's currPos
var currPos = titles.indexOf(title);
if(newPos === -1) {
newPos = currPos;
}
if(newPos !== currPos) {
if(currPos >= 0 && newPos !== currPos) {
titles.splice(currPos,1);
if(newPos >= currPos) {
newPos--;
}
titles.splice(newPos,0,title);
}
}

}
}
var list = this.getTiddlerList(listTitle);
if(!array || array.length === 0) {
return [];
} else {
var titles = [], t, title;
// First place any entries that are present in the list
for(t=0; t<list.length; t++) {
title = list[t];
if(array.indexOf(title) !== -1) {
titles.push(title);
}
}
// Then place any remaining entries
for(t=0; t<array.length; t++) {
title = array[t];
if(list.indexOf(title) === -1) {
titles.push(title);
}
}
// Finally obey the list-before and list-after fields of each tiddler in turn
var sortedTitles = titles.slice(0);
for(t=0; t<sortedTitles.length; t++) {
title = sortedTitles[t];
replaceItem(title);
}
return titles;
}
Expand Down Expand Up @@ -623,6 +633,22 @@ exports.getTiddlerAsJson = function(title) {
}
};

exports.getTiddlersAsJson = function(filter) {
var tiddlers = this.filterTiddlers(filter),
data = [];
for(var t=0;t<tiddlers.length; t++) {
var tiddler = this.getTiddler(tiddlers[t]);
if(tiddler) {
var fields = new Object();
for(var field in tiddler.fields) {
fields[field] = tiddler.getFieldString(field);
}
data.push(fields);
}
}
return JSON.stringify(data,null,$tw.config.preferences.jsonSpaces);
};

/*
Get the content of a tiddler as a JavaScript object. How this is done depends on the type of the tiddler:
Expand Down Expand Up @@ -785,6 +811,14 @@ exports.initParsers = function(moduleType) {
}
}
});
// Use the generic binary parser for any binary types not registered so far
if($tw.Wiki.parsers["application/octet-stream"]) {
Object.keys($tw.config.contentTypeInfo).forEach(function(type) {
if(!$tw.utils.hop($tw.Wiki.parsers,type) && $tw.config.contentTypeInfo[type].encoding === "base64") {
$tw.Wiki.parsers[type] = $tw.Wiki.parsers["application/octet-stream"];
}
});
}
};

/*
Expand Down Expand Up @@ -847,7 +881,7 @@ exports.parseTextReference = function(title,field,index,options) {
}
if(field === "text" || (!field && !index)) {
if(tiddler && tiddler.fields) {
return this.parseText(tiddler.fields.type || "text/vnd.tiddlywiki",tiddler.fields.text,options);
return this.parseText(tiddler.fields.type,tiddler.fields.text,options);
} else {
return null;
}
Expand Down Expand Up @@ -1013,8 +1047,13 @@ Options available:
exclude: An array of tiddler titles to exclude from the search
invert: If true returns tiddlers that do not contain the specified string
caseSensitive: If true forces a case sensitive search
literal: If true, searches for literal string, rather than separate search terms
field: If specified, restricts the search to the specified field
field: If specified, restricts the search to the specified field, or an array of field names
excludeField: If true, the field options are inverted to specify the fields that are not to be searched
The search mode is determined by the first of these boolean flags to be true
literal: searches for literal string
whitespace: same as literal except runs of whitespace are treated as a single space
regexp: treats the search term as a regular expression
words: (default) treats search string as a list of tokens, and matches if all tokens are found, regardless of adjacency or ordering
*/
exports.search = function(text,options) {
options = options || {};
Expand All @@ -1030,6 +1069,21 @@ exports.search = function(text,options) {
} else {
searchTermsRegExps = [new RegExp("(" + $tw.utils.escapeRegExp(text) + ")",flags)];
}
} else if(options.whitespace) {
terms = [];
$tw.utils.each(text.split(/\s+/g),function(term) {
if(term) {
terms.push($tw.utils.escapeRegExp(term));
}
});
searchTermsRegExps = [new RegExp("(" + terms.join("\\s+") + ")",flags)];
} else if(options.regexp) {
try {
searchTermsRegExps = [new RegExp("(" + text + ")",flags)];
} catch(e) {
searchTermsRegExps = null;
console.log("Regexp error parsing /(" + text + ")/" + flags + ": ",e);
}
} else {
terms = text.split(/ +/);
if(terms.length === 1 && terms[0] === "") {
Expand All @@ -1041,6 +1095,25 @@ exports.search = function(text,options) {
}
}
}
// Accumulate the array of fields to be searched or excluded from the search
var fields = [];
if(options.field) {
if($tw.utils.isArray(options.field)) {
$tw.utils.each(options.field,function(fieldName) {
if(fieldName) {
fields.push(fieldName);
}
});
} else {
fields.push(options.field);
}
}
// Use default fields if none specified and we're not excluding fields (excluding fields with an empty field array is the same as searching all fields)
if(fields.length === 0 && !options.excludeField) {
fields.push("title");
fields.push("tags");
fields.push("text");
}
// Function to check a given tiddler for the search term
var searchTiddler = function(title) {
if(!searchTermsRegExps) {
Expand All @@ -1051,24 +1124,63 @@ exports.search = function(text,options) {
tiddler = new $tw.Tiddler({title: title, text: "", type: "text/vnd.tiddlywiki"});
}
var contentTypeInfo = $tw.config.contentTypeInfo[tiddler.fields.type] || $tw.config.contentTypeInfo["text/vnd.tiddlywiki"],
match;
for(var t=0; t<searchTermsRegExps.length; t++) {
match = false;
if(options.field) {
match = searchTermsRegExps[t].test(tiddler.getFieldString(options.field));
} else {
// Search title, tags and body
if(contentTypeInfo.encoding === "utf8") {
match = match || searchTermsRegExps[t].test(tiddler.fields.text);
searchFields;
// Get the list of fields we're searching
if(options.excludeField) {
searchFields = Object.keys(tiddler.fields);
$tw.utils.each(fields,function(fieldName) {
var p = searchFields.indexOf(fieldName);
if(p !== -1) {
searchFields.splice(p,1);
}
});
} else {
searchFields = fields;
}
for(var fieldIndex=0; fieldIndex<searchFields.length; fieldIndex++) {
// Don't search the text field if the content type is binary
var fieldName = searchFields[fieldIndex];
if(fieldName === "text" && contentTypeInfo.encoding !== "utf8") {
break;
}
var matches = true,
str = tiddler.fields[fieldName],
t;
if(str) {
if($tw.utils.isArray(str)) {
// If the field value is an array, test each regexp against each field array entry and fail if each regexp doesn't match at least one field array entry
for(t=0; t<searchTermsRegExps.length; t++) {
var thisRegExpMatches = false
for(var s=0; s<str.length; s++) {
if(searchTermsRegExps[t].test(str[s])) {
thisRegExpMatches = true;
break;
}
}
// Bail if the current search expression doesn't match any entry in the current field array
if(!thisRegExpMatches) {
matches = false;
break;
}
}
} else {
// If the field isn't an array, force it to a string and test each regexp against it and fail if any do not match
str = tiddler.getFieldString(fieldName);
for(t=0; t<searchTermsRegExps.length; t++) {
if(!searchTermsRegExps[t].test(str)) {
matches = false;
break;
}
}
}
var tags = tiddler.fields.tags ? tiddler.fields.tags.join("\0") : "";
match = match || searchTermsRegExps[t].test(tags) || searchTermsRegExps[t].test(tiddler.fields.title);
} else {
matches = false;
}
if(!match) {
return false;
if(matches) {
return true;
}
}
return true;
};
return false;
};
// Loop through all the tiddlers doing the search
var results = [],
Expand Down Expand Up @@ -1146,7 +1258,7 @@ exports.readFiles = function(files,options) {
}
};
for(var f=0; f<files.length; f++) {
this.readFile(files[f],Object.assign({},options,{callback: readFileCallback}));
this.readFile(files[f],$tw.utils.extend({},options,{callback: readFileCallback}));
}
return files.length;
};
Expand Down Expand Up @@ -1269,6 +1381,18 @@ exports.addToHistory = function(title,fromPageRect,historyTitle) {
story.addToHistory(title,fromPageRect);
};

/*
Add a new tiddler to the story river
title: a title string or an array of title strings
fromTitle: the title of the tiddler from which the navigation originated
storyTitle: title of story tiddler (defaults to $:/StoryList)
options: see story.js
*/
exports.addToStory = function(title,fromTitle,storyTitle,options) {
var story = new $tw.Story({wiki: this, storyTitle: storyTitle});
story.addToStory(title,fromTitle,options);
};

/*
Invoke the available upgrader modules
titles: array of tiddler titles to be processed
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/Blanca.tid
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ page-background: #ffffff
pre-background: #f5f5f5
pre-border: #cccccc
primary: #7897f3
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #ccc
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/Blue.tid
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ page-background: #ddddff
pre-background: #f5f5f5
pre-border: #cccccc
primary: #5778d8
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #ffffff
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/BrightMute.tid
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ page-background: #6f6f70
pre-background: #f5f5f5
pre-border: #cccccc
primary: #29a6ee
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #c2c1c2
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/ContrastDark.tid
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ page-background: <<colour background>>
pre-background: <<colour background>>
pre-border: <<colour foreground>>
primary: #00f
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: <<colour background>>
sidebar-controls-foreground: <<colour foreground>>
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/ContrastLight.tid
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ page-background: <<colour background>>
pre-background: <<colour background>>
pre-border: <<colour foreground>>
primary: #00f
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: <<colour background>>
sidebar-controls-foreground: <<colour foreground>>
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/DarkPhotos.tid
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ page-background: #336438
pre-background: #f5f5f5
pre-border: #cccccc
primary: #5778d8
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #ccf
sidebar-controls-foreground: #fff
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/Rocker.tid
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ page-background: #000
pre-background: #f5f5f5
pre-border: #cccccc
primary: #cc0000
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #ffffff
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/SolarFlare.tid
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ external-link-background: inherit
external-link-foreground-hover: inherit
message-border: #cfd6e6
modal-border: #999999
select-tag-background:
select-tag-foreground:
sidebar-controls-foreground-hover:
sidebar-muted-foreground-hover:
sidebar-tab-background: #ded8c5
Expand Down
2 changes: 2 additions & 0 deletions core/palettes/Vanilla.tid
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ page-background: #f4f4f4
pre-background: #f5f5f5
pre-border: #cccccc
primary: #5778d8
select-tag-background:
select-tag-foreground:
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #aaaaaa
Expand Down
3 changes: 1 addition & 2 deletions core/templates/exporters/StaticRiverContent.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ title: $:/core/templates/exporters/StaticRiver/Content
\define renderContent()
{{{ $(exportFilter)$ ||$:/core/templates/static-tiddler}}}
\end
<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
<<renderContent>>
</$importvariables>
3 changes: 2 additions & 1 deletion core/templates/exporters/TidFile.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ extension: .tid
\define renderContent()
{{{ $(exportFilter)$ +[limit[1]] ||$:/core/templates/tid-tiddler}}}
\end
<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]"><<renderContent>></$importvariables>
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
<<renderContent>>
6 changes: 6 additions & 0 deletions core/templates/external-js/save-all-external-js.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: $:/core/save/all-external-js

\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
\end
{{$:/core/templates/tiddlywiki5-external-js.html}}
15 changes: 15 additions & 0 deletions core/templates/external-js/tiddlywiki.js.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: $:/core/templates/tiddlywiki5.js

\rules only filteredtranscludeinline transcludeinline codeinline

/*
{{ $:/core/copyright.txt ||$:/core/templates/plain-text-tiddler}}
`*/
`<!--~~ Library modules ~~-->
{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/plain-text-tiddler}}}
<!--~~ Boot prefix ~~-->
{{ $:/boot/bootprefix.js ||$:/core/templates/plain-text-tiddler}}
<!--~~ Core plugin ~~-->
{{$:/core/templates/tiddlywiki5.js/tiddlers}}
<!--~~ Boot kernel ~~-->
{{ $:/boot/boot.js ||$:/core/templates/plain-text-tiddler}}
9 changes: 9 additions & 0 deletions core/templates/external-js/tiddlywiki.js.tiddlers.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: $:/core/templates/tiddlywiki5.js/tiddlers

`
$tw.preloadTiddlerArray(`<$text text=<<jsontiddlers "[[$:/core]]">>/>`);
$tw.preloadTiddlerArray([{
title: "$:/config/SaveWikiButton/Template",
text: "$:/core/save/all-external-js"
}]);
`
41 changes: 41 additions & 0 deletions core/templates/external-js/tiddlywiki5-external-js.html.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
title: $:/core/templates/tiddlywiki5-external-js.html

\rules only filteredtranscludeinline transcludeinline
<!doctype html>
{{$:/core/templates/MOTW.html}}<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="application-name" content="TiddlyWiki" />
<meta name="generator" content="TiddlyWiki" />
<meta name="tiddlywiki-version" content="{{$:/core/templates/version}}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="mobile-web-app-capable" content="yes"/>
<meta name="format-detection" content="telephone=no" />
<meta name="copyright" content="{{$:/core/copyright.txt}}" />
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
<title>{{$:/core/wiki/title}}</title>
<!--~~ This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ~~-->

<!--~~ Raw markup ~~-->
{{{ [all[shadows+tiddlers]tag[$:/core/wiki/rawmarkup]] [all[shadows+tiddlers]tag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}}
{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified]] ||$:/core/templates/raw-static-tiddler}}}
</head>
<body class="tc-body">
<!--~~ Static styles ~~-->
<div id="styleArea">
{{$:/boot/boot.css||$:/core/templates/css-tiddler}}
</div>
<!--~~ Static content for Google and browsers without JavaScript ~~-->
<noscript>
<div id="splashArea">
{{$:/core/templates/static.area}}
</div>
</noscript>
<!--~~ Ordinary tiddlers ~~-->
{{$:/core/templates/store.area.template.html}}
</body>
<script src="%24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js" onerror="alert('Error: Cannot load tiddlywiki.js');"></script>
</html>
30 changes: 30 additions & 0 deletions core/templates/server/static.sidebar.wikitext.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
title: $:/core/templates/server/static.sidebar.wikitext

\whitespace trim
<div class="tc-sidebar-scrollable" style="overflow: auto;">
<div class="tc-sidebar-header">
<h1 class="tc-site-title">
<$transclude tiddler="$:/SiteTitle"/>
</h1>
<div class="tc-site-subtitle">
<$transclude tiddler="$:/SiteSubtitle"/>
</div>
<h2>
</h2>
<div class="tc-sidebar-lists">
<$list filter={{$:/DefaultTiddlers}}>
<div class="tc-menu-list-subitem">
<$link><$text text=<<currentTiddler>>/></$link>
</div>
</$list>
</div>
<!-- Currently disabled the recent list as it is unweildy when the responsive narrow view kicks in
<h2>
{{$:/language/SideBar/Recent/Caption}}
</h2>
<div class="tc-sidebar-lists">
<$macrocall $name="timeline" format={{$:/language/RecentChanges/DateFormat}}/>
</div>
</div>
</div>
-->
28 changes: 28 additions & 0 deletions core/templates/server/static.tiddler.html.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
title: $:/core/templates/server/static.tiddler.html

\whitespace trim
\define tv-wikilink-template() $uri_encoded$
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="TiddlyWiki" />
<meta name="tiddlywiki-version" content={{$:/core/templates/version}} />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="mobile-web-app-capable" content="yes"/>
<meta name="format-detection" content="telephone=no">
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="%24%3A%2Fcore%2Ftemplates%2Fstatic.template.css">
<title><$view field="caption" format="plainwikified"><$view field="title"/></$view>: <$view tiddler="$:/core/wiki/title" format="plainwikified"/></title>
</head>
<body class="tc-body">
<$transclude tiddler="$:/core/templates/server/static.sidebar.wikitext" mode="inline"/>
<section class="tc-story-river">
<div class="tc-tiddler-frame">
<$transclude tiddler="$:/core/templates/server/static.tiddler.wikitext" mode="inline"/>
</div>
</section>
</body>
</html>
23 changes: 23 additions & 0 deletions core/templates/server/static.tiddler.wikitext.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
title: $:/core/templates/server/static.tiddler.wikitext

\whitespace trim
<div class="tc-tiddler-title">
<div class="tc-titlebar">
<h2><$text text=<<currentTiddler>>/></h2>
</div>
</div>
<div class="tc-subtitle">
<$link to={{!!modifier}}>
<$view field="modifier"/>
</$link> <$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>
</div>
<div class="tc-tags-wrapper">
<$list filter="[all[current]tags[]sort[title]]">
<a href={{{ [<currentTiddler>encodeuricomponent[]] }}}>
<$macrocall $name="tag-pill" tag=<<currentTiddler>>/>
</a>
</$list>
</div>
<div class="tc-tiddler-body">
<$transclude mode="block"/>
</div>
5 changes: 2 additions & 3 deletions core/templates/static.tiddler.html.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: $:/core/templates/static.tiddler.html
\define tv-config-toolbar-icons() no
\define tv-config-toolbar-text() no
\define tv-config-toolbar-class() tc-btn-invisible
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
`<!doctype html>
<html>
<head>
Expand All @@ -22,9 +23,7 @@ title: $:/core/templates/static.tiddler.html
<body class="tc-body">
`{{$:/StaticBanner||$:/core/templates/html-tiddler}}`
<section class="tc-story-river">
`<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
<$view tiddler="$:/core/ui/ViewTemplate" format="htmlwikified"/>
</$importvariables>`
`<$view tiddler="$:/core/ui/ViewTemplate" format="htmlwikified"/>`
</section>
</body>
</html>
Expand Down
8 changes: 7 additions & 1 deletion core/templates/tiddlywiki5.html.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ title: $:/core/templates/tiddlywiki5.html
<!doctype html>
{{$:/core/templates/MOTW.html}}<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!--~~ Raw markup for the top of the head section ~~-->
{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}}
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta name="application-name" content="TiddlyWiki" />
<meta name="generator" content="TiddlyWiki" />
<meta name="tiddlywiki-version" content="{{$:/core/templates/version}}" />
Expand All @@ -24,6 +26,8 @@ title: $:/core/templates/tiddlywiki5.html
{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified]] ||$:/core/templates/raw-static-tiddler}}}
</head>
<body class="tc-body">
<!--~~ Raw markup for the top of the body section ~~-->
{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/TopBody]] ||$:/core/templates/raw-static-tiddler}}}
<!--~~ Static styles ~~-->
<div id="styleArea">
{{$:/boot/boot.css||$:/core/templates/css-tiddler}}
Expand All @@ -48,5 +52,7 @@ title: $:/core/templates/tiddlywiki5.html
<div id="bootKernel" style="display:none;">
{{ $:/boot/boot.js ||$:/core/templates/javascript-tiddler}}
</div>
<!--~~ Raw markup for the bottom of the body section ~~-->
{{{ [all[shadows+tiddlers]tag[$:/tags/RawMarkupWikified/BottomBody]] ||$:/core/templates/raw-static-tiddler}}}
</body>
</html>
10 changes: 10 additions & 0 deletions core/ui/Actions/new-image.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: $:/core/ui/Actions/new-image
tags: $:/tags/Actions
description: create a new image tiddler

\define get-type()
image/$(imageType)$
\end
<$vars imageType={{$:/config/NewImageType}}>
<$action-sendmessage $message="tm-new-tiddler" type=<<get-type>>/>
</$vars>
14 changes: 14 additions & 0 deletions core/ui/Actions/new-journal.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: $:/core/ui/Actions/new-journal
tags: $:/tags/Actions
description: create a new journal tiddler

<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} journalTags={{$:/config/NewJournal/Tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text={{{ [<journalTitle>get[]] }}}/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text=<<journalText>>/>
</$reveal>
</$wikify>
</$vars>
5 changes: 5 additions & 0 deletions core/ui/Actions/new-tiddler.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: $:/core/ui/Actions/new-tiddler
tags: $:/tags/Actions
description: create a new empty tiddler

<$action-sendmessage $message="tm-new-tiddler"/>
2 changes: 2 additions & 0 deletions core/ui/AdvancedSearch/FilterButtons/dropdown.tid
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags: $:/tags/AdvancedSearch/FilterButton
</span>

<$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes">
<$set name="tv-show-missing-links" value="yes">
<$linkcatcher to="$:/temp/advancedsearch">
<div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown">
Expand All @@ -16,4 +17,5 @@ tags: $:/tags/AdvancedSearch/FilterButton
</div>
</div>
</$linkcatcher>
</$set>
</$reveal>
2 changes: 1 addition & 1 deletion core/ui/ControlPanel/KeyboardShortcuts.tid
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}

\define shortcut-list(caption,prefix)
<tr>
<$list filter="[all[tiddlers+shadows][$prefix$$(shortcutName)$]]" variable="shortcutTitle">
<$list filter="[[$prefix$$(shortcutName)$]]" variable="shortcutTitle">
<<shortcut-list-item "$caption$">>
</$list>
</tr>
Expand Down
4 changes: 1 addition & 3 deletions core/ui/ControlPanel/Modals/AddPlugins.tid
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
</$list>
\end

<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]

<div>
<<plugin-library-listing>>
</div>

</$importvariables>
10 changes: 10 additions & 0 deletions core/ui/ControlPanel/Settings/NavigationPermalinkviewMode.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: $:/core/ui/ControlPanel/Settings/NavigationPermalinkviewMode
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/NavigationPermalinkviewMode/Caption}}

\define lingo-base() $:/language/ControlPanel/Settings/NavigationPermalinkviewMode/
<<lingo Hint>>

<$checkbox tiddler="$:/config/Navigation/Permalinkview/CopyToClipboard" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/Navigation/Permalinkview/CopyToClipboard"><<lingo CopyToClipboard/Description>></$link> </$checkbox>

<$checkbox tiddler="$:/config/Navigation/Permalinkview/UpdateAddressBar" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/Navigation/Permalinkview/UpdateAddressBar"><<lingo UpdateAddressBar/Description>></$link> </$checkbox>
2 changes: 2 additions & 0 deletions core/ui/EditTemplate/body-toolbar-button.tid
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ title: $:/core/ui/EditTemplate/body/toolbar/button

class="tc-btn-invisible $(buttonClasses)$"
tooltip=<<tooltip-text>>
actions={{!!actions}}

><span

Expand All @@ -65,6 +66,7 @@ title: $:/core/ui/EditTemplate/body/toolbar/button
class="tc-popup-keep tc-btn-invisible $(buttonClasses)$"
selectedClass="tc-selected"
tooltip=<<tooltip-text>>
actions={{!!actions}}

><span

Expand Down
4 changes: 2 additions & 2 deletions core/ui/EditTemplate/body.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags: $:/tags/EditTemplate
\define config-visibility-title()
$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
\end
<$list filter="[is[current]has[_canonical_uri]]">
<$list filter="[all[current]has[_canonical_uri]]">

<div class="tc-message-box">

Expand All @@ -19,7 +19,7 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$

</$list>

<$list filter="[is[current]!has[_canonical_uri]]">
<$list filter="[all[current]!has[_canonical_uri]]">

<$reveal state="$:/state/showeditpreview" type="match" text="yes">

Expand Down
2 changes: 2 additions & 0 deletions core/ui/EditTemplate/fields.tid
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ $value={{$:/temp/newfieldvalue}}/>
<$button popup=<<qualify "$:/state/popup/field-dropdown">> class="tc-btn-invisible tc-btn-dropdown" 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="">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$set name="tv-show-missing-links" value="yes">
<$linkcatcher to="$:/temp/newfieldname">
<div class="tc-dropdown-item">
<<lingo Fields/Add/Dropdown/User>>
Expand All @@ -83,6 +84,7 @@ $value={{$:/temp/newfieldvalue}}/>
</$link>
</$list>
</$linkcatcher>
</$set>
</div>
</$reveal>
<span class="tc-edit-field-add-value">
Expand Down
15 changes: 9 additions & 6 deletions core/ui/EditTemplate/tags.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
title: $:/core/ui/EditTemplate/tags
tags: $:/tags/EditTemplate

\whitespace trim

\define lingo-base() $:/language/EditTemplate/

\define tag-styles()
Expand All @@ -9,17 +11,18 @@ fill:$(foregroundColor)$;
color:$(foregroundColor)$;
\end

\define tag-body-inner(colour,fallbackTarget,colourA,colourB)
\define tag-body-inner(colour,fallbackTarget,colourA,colourB,icon)
\whitespace trim
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<span style=<<tag-styles>> class="tc-tag-label">
<$view field="title" format="text" />
<span style=<<tag-styles>> class="tc-tag-label tc-tag-list-item">
<$transclude tiddler="""$icon$"""/>&nbsp;<$view field="title" format="text" />
<$button message="tm-remove-tag" param={{!!title}} class="tc-btn-invisible tc-remove-tag-button">&times;</$button>
</span>
</$vars>
\end

\define tag-body(colour,palette)
<$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}}/>
\define tag-body(colour,palette,icon)
<$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} icon="""$icon$"""/>
\end

\define tag-picker-actions()
Expand All @@ -33,7 +36,7 @@ color:$(foregroundColor)$;
<div class="tc-edit-tags">
<$fieldmangler>
<$list filter="[all[current]tags[]sort[title]]" storyview="pop">
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/>
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}} icon={{!!icon}}/>
</$list>
</$fieldmangler>
<$macrocall $name="tag-picker" actions=<<tag-picker-actions>>/>
Expand Down
23 changes: 20 additions & 3 deletions core/ui/EditTemplate/title.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tags: $:/tags/EditTemplate

<$vars pattern="""[\|\[\]{}]""" bad-chars="""`| [ ] { }`""">

<$list filter="[is[current]regexp:draft.title<pattern>]" variable="listItem">
<$list filter="[all[current]regexp:draft.title<pattern>]" variable="listItem">

<div class="tc-message-box">

Expand Down Expand Up @@ -35,10 +35,27 @@ tags: $:/tags/EditTemplate

<$checkbox tiddler="$:/config/RelinkOnRename" field="text" checked="yes" unchecked="no" default="no"> {{$:/language/EditTemplate/Title/Relink/Prompt}}</$checkbox>

</$vars>
<$vars stateTiddler=<<qualify "$:/state/edit/references">> >

</$list>
<$reveal type="nomatch" state=<<stateTiddler>> text="show">
<$button set=<<stateTiddler>> setTo="show" class="tc-btn-invisible">{{$:/core/images/right-arrow}}
<<lingo EditTemplate/Title/References/Prompt>></$button>
</$reveal>
<$reveal type="match" state=<<stateTiddler>> text="show">
<$button set=<<stateTiddler>> setTo="hide" class="tc-btn-invisible">{{$:/core/images/down-arrow}}
<<lingo EditTemplate/Title/References/Prompt>></$button>
</$reveal>

<$reveal type="match" state=<<stateTiddler>> text="show">
<$tiddler tiddler=<<fromTitle>> >
<$transclude tiddler="$:/core/ui/TiddlerInfo/References"/>
</$tiddler>
</$reveal>

</$vars>

</$vars>

</$list>

</$reveal>
4 changes: 3 additions & 1 deletion core/ui/EditTemplate/type.tid
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tags: $:/tags/EditTemplate
</$fieldmangler></div>

<div class="tc-block-dropdown-wrapper">
<$set name="tv-show-missing-links" value="yes">
<$reveal state=<<qualify "$:/state/popup/type-dropdown">> type="nomatch" text="" default="">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$linkcatcher to="!!type">
Expand All @@ -20,4 +21,5 @@ tags: $:/tags/EditTemplate
</$linkcatcher>
</div>
</$reveal>
</div>
</$set>
</div>
2 changes: 1 addition & 1 deletion core/ui/EditorToolbar/excise.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ tags: $:/tags/EditorToolbar
icon: $:/core/images/excise
caption: {{$:/language/Buttons/Excise/Caption}}
description: {{$:/language/Buttons/Excise/Hint}}
condition: [<targetTiddler>type[]] [<targetTiddler>type[text/vnc.tiddlywiki]] +[first[]]
condition: [<targetTiddler>type[]] [<targetTiddler>type[text/vnd.tiddlywiki]] +[first[]]
shortcuts: ((excise))
dropdown: $:/core/ui/EditorToolbar/excise-dropdown

10 changes: 5 additions & 5 deletions core/ui/ImportListing.tid
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ $(currentTiddler)$!!popup-$(payloadTiddler)$
<$checkbox field=<<selectionField>> checked="checked" unchecked="unchecked" default="checked"/>
</td>
<td>
<$reveal type="nomatch" state=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="yes">
<$reveal type="nomatch" stateTitle=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" setTitle=<<previewPopupState>> setTo="yes">
{{$:/core/images/right-arrow}}&nbsp;<$text text=<<payloadTiddler>>/>
</$button>
</$reveal>
<$reveal type="match" state=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="no">
<$reveal type="match" stateTitle=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" setTitle=<<previewPopupState>> setTo="no">
{{$:/core/images/down-arrow}}&nbsp;<$text text=<<payloadTiddler>>/>
</$button>
</$reveal>
Expand All @@ -58,7 +58,7 @@ $(currentTiddler)$!!popup-$(payloadTiddler)$
</tr>
<tr>
<td colspan="3">
<$reveal type="match" text="yes" state=<<previewPopupState>> tag="div">
<$reveal type="match" text="yes" stateTitle=<<previewPopupState>> tag="div">
<$list filter="[{$:/state/importpreviewtype}has[text]]" variable="listItem" emptyMessage={{$:/core/ui/ImportPreviews/Text}}>
<$transclude tiddler={{$:/state/importpreviewtype}}/>
</$list>
Expand Down
17 changes: 14 additions & 3 deletions core/ui/ImportPreviews/Fields.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ title: $:/core/ui/ImportPreviews/Fields
tags: $:/tags/ImportPreview
caption: {{$:/language/Import/Listing/Preview/Fields}}

<$tiddler tiddler=<<payloadTiddler>>>
<$transclude tiddler="$:/core/ui/TiddlerFields"/>
</$tiddler>
<table class="tc-view-field-table">
<tbody>
<$list filter="[<payloadTiddler>subtiddlerfields<currentTiddler>sort[]] -text" variable="fieldName">
<tr class="tc-view-field">
<td class="tc-view-field-name">
<$text text=<<fieldName>>/>
</td>
<td class="tc-view-field-value">
<$view field=<<fieldName>> tiddler=<<currentTiddler>> subtiddler=<<payloadTiddler>>/>
</td>
</tr>
</$list>
</tbody>
</table>
2 changes: 1 addition & 1 deletion core/ui/ImportPreviews/Text.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ title: $:/core/ui/ImportPreviews/Text
tags: $:/tags/ImportPreview
caption: {{$:/language/Import/Listing/Preview/Text}}

<$transclude tiddler=<<payloadTiddler>> mode="block"/>
<$transclude tiddler=<<currentTiddler>> subtiddler=<<payloadTiddler>> mode="block"/>
2 changes: 1 addition & 1 deletion core/ui/ImportPreviews/TextRaw.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ title: $:/core/ui/ImportPreviews/TextRaw
tags: $:/tags/ImportPreview
caption: {{$:/language/Import/Listing/Preview/TextRaw}}

<pre><code><$view tiddler=<<payloadTiddler>>/></code></pre>
<pre><code><$view tiddler=<<currentTiddler>> subtiddler=<<payloadTiddler>> /></code></pre>
7 changes: 7 additions & 0 deletions core/ui/KeyboardShortcuts/new-image.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: $:/core/ui/KeyboardShortcuts/new-image
tags: $:/tags/KeyboardShortcut
key: ((new-image))

<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
{{$:/core/ui/Actions/new-image}}
</$navigator>
7 changes: 7 additions & 0 deletions core/ui/KeyboardShortcuts/new-journal.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: $:/core/ui/KeyboardShortcuts/new-journal
tags: $:/tags/KeyboardShortcut
key: ((new-journal))

<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
{{$:/core/ui/Actions/new-journal}}
</$navigator>
7 changes: 7 additions & 0 deletions core/ui/KeyboardShortcuts/new-tiddler.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: $:/core/ui/KeyboardShortcuts/new-tiddler
tags: $:/tags/KeyboardShortcut
key: ((new-tiddler))

<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
{{$:/core/ui/Actions/new-tiddler}}
</$navigator>
2 changes: 1 addition & 1 deletion core/ui/Manager/ItemSidebarTags.tid
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ caption: {{$:/language/Manager/Item/Tags}}
\end

<p>
<$list filter="[is[current]tags[]] [list[$:/config/Manager/RecentTags]] +[sort[title]] " variable="tag">
<$list filter="[all[current]tags[]] [list[$:/config/Manager/RecentTags]] +[sort[title]] " variable="tag">
<div>
<$checkbox tiddler=<<currentTiddler>> tag=<<tag>> actions=<<tag-checkbox-actions>>>
<$macrocall $name="tag-pill" tag=<<tag>>/>
Expand Down
3 changes: 1 addition & 2 deletions core/ui/PageControls/new-image.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/new-image-button}} {{$:/language/Buttons/NewImage/Caption}}
description: {{$:/language/Buttons/NewImage/Hint}}

<$button tooltip={{$:/language/Buttons/NewImage/Hint}} aria-label={{$:/language/Buttons/NewImage/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" type="image/jpeg"/>
<$button tooltip={{$:/language/Buttons/NewImage/Hint}} aria-label={{$:/language/Buttons/NewImage/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-image}}>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-image-button}}
</$list>
Expand Down
14 changes: 1 addition & 13 deletions core/ui/PageControls/new-journal.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,13 @@ caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/
description: {{$:/language/Buttons/NewJournal/Hint}}

\define journalButton()
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>>>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text={{{ [<journalTitle>get[]] }}}/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text=<<journalText>>/>
</$reveal>
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-journal}}>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-journal-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewJournal/Caption}}/></span>
</$list>
</$wikify>
</$button>
\end
<$set name="journalTitleTemplate" value={{$:/config/NewJournal/Title}}>
<$set name="journalTags" value={{$:/config/NewJournal/Tags}}>
<$set name="journalText" value={{$:/config/NewJournal/Text}}>
<<journalButton>>
</$set></$set></$set>
4 changes: 2 additions & 2 deletions core/ui/PageControls/newtiddler.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/new-button}} {{$:/language/Buttons/NewTiddler/Caption}}
description: {{$:/language/Buttons/NewTiddler/Hint}}

<$button message="tm-new-tiddler" tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>
<$button actions={{$:/core/ui/Actions/new-tiddler}} tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>
</$list>
</$button>
</$button>
5 changes: 4 additions & 1 deletion core/ui/PageControls/savewiki.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/save-button}} {{$:/language/Buttons/SaveWiki/Caption}}
description: {{$:/language/Buttons/SaveWiki/Hint}}

<$button message="tm-save-wiki" param={{$:/config/SaveWikiButton/Template}} tooltip={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tv-config-toolbar-class>>>
<$button tooltip={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tv-config-toolbar-class>>>
<$wikify name="site-title" text="{{$:/SiteTitle}}.html">
<$action-sendmessage $message="tm-save-wiki" $param={{$:/config/SaveWikiButton/Template}} filename=<<site-title>>/>
</$wikify>
<span class="tc-dirty-indicator">
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/save-button}}
Expand Down
4 changes: 1 addition & 3 deletions core/ui/PageStylesheet.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: $:/core/ui/PageStylesheet

<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]

<$set name="currentTiddler" value={{$:/language}}>

Expand All @@ -13,5 +13,3 @@ title: $:/core/ui/PageStylesheet
</$set>

</$set>

</$importvariables>
11 changes: 6 additions & 5 deletions core/ui/PageTemplate.tid
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
title: $:/core/ui/PageTemplate

\define containerClasses()
tc-page-container tc-page-view-$(themeTitle)$ tc-language-$(languageTitle)$
tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$
\end

<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]

<$set name="tv-config-toolbar-icons" value={{$:/config/Toolbar/Icons}}>

<$set name="tv-config-toolbar-text" value={{$:/config/Toolbar/Text}}>

<$set name="tv-config-toolbar-class" value={{$:/config/Toolbar/ButtonClass}}>

<$set name="themeTitle" value={{$:/view}}>
<$set name="tv-show-missing-links" value={{$:/config/MissingLinks}}>

<$set name="storyviewTitle" value={{$:/view}}>

<$set name="currentTiddler" value={{$:/language}}>

Expand Down Expand Up @@ -52,4 +53,4 @@ tc-page-container tc-page-view-$(themeTitle)$ tc-language-$(languageTitle)$

</$set>

</$importvariables>
</$set>
11 changes: 11 additions & 0 deletions core/ui/PageTemplate/drafts.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: $:/core/ui/PageTemplate/drafts
tags: $:/tags/PageTemplate

\whitespace trim
<$reveal state="$:/status/IsReadOnly" type="nomatch" text="yes" tag="div" class="tc-drafts-list">
<$list filter="[has[draft.of]!sort[modified]] -[list[$:/StoryList]]">
<$link>
{{$:/core/images/edit-button}} <$text text=<<currentTiddler>>/>
</$link>
</$list>
</$reveal>
20 changes: 9 additions & 11 deletions core/ui/PageTemplate/sidebar.tid
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
title: $:/core/ui/PageTemplate/sidebar
tags: $:/tags/PageTemplate

\define config-title()
$:/config/SideBarSegments/Visibility/$(listItem)$
\end

<$scrollable fallthrough="no" class="tc-sidebar-scrollable">

<div class="tc-sidebar-header">

<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes" retain="yes" animate="yes">

<h1 class="tc-site-title">

<$transclude tiddler="$:/SiteTitle" mode="inline"/>

</h1>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SideBarSegment]!has[draft.of]]" variable="listItem">

<div class="tc-site-subtitle">
<$reveal type="nomatch" state=<<config-title>> text="hide" tag="div">

<$transclude tiddler="$:/SiteSubtitle" mode="inline"/>
<$transclude tiddler=<<listItem>> mode="block"/>

</div>

{{||$:/core/ui/PageTemplate/pagecontrols}}
</$reveal>

<$transclude tiddler="$:/core/ui/SideBarLists" mode="inline"/>
</$list>

</$reveal>

Expand Down
1 change: 1 addition & 0 deletions core/ui/SideBar/Open.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ title: $:/core/ui/SideBar/Open
tags: $:/tags/SideBar
caption: {{$:/language/SideBar/Open/Caption}}

\whitespace trim
\define lingo-base() $:/language/CloseAll/

\define drop-actions()
Expand Down
51 changes: 2 additions & 49 deletions core/ui/SideBarLists.tid
Original file line number Diff line number Diff line change
@@ -1,53 +1,6 @@
title: $:/core/ui/SideBarLists

<div class="tc-sidebar-lists">
<$transclude tiddler="$:/core/ui/SideBarSegments/search"/>

<$set name="searchTiddler" value="$:/temp/search">
<div class="tc-search">
<$edit-text tiddler="$:/temp/search" type="search" tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify "$:/state/popup/search-dropdown">> class="tc-popup-handle"/>
<$reveal state="$:/temp/search" type="nomatch" text="">
<$button tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/advancedsearch" text={{$:/temp/search}}/>
<$action-setfield $tiddler="$:/temp/search" text=""/>
<$action-navigate $to="$:/AdvancedSearch"/>
{{$:/core/images/advanced-search-button}}
</$button>
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/search" text="" />
{{$:/core/images/close-button}}
</$button>
<$button popup=<<qualify "$:/state/popup/search-dropdown">> class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
<$list filter="[{$:/temp/search}minlength{$:/config/Search/MinLength}limit[1]]" variable="listItem">
<$set name="resultCount" value="""<$count filter="[!is[system]search{$(searchTiddler)$}]"/>""">
{{$:/language/Search/Matches}}
</$set>
</$list>
</$button>
</$reveal>
<$reveal state="$:/temp/search" type="match" text="">
<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="tc-btn-invisible">
{{$:/core/images/advanced-search-button}}
</$button>
</$reveal>
</div>
<$transclude tiddler="$:/core/ui/SideBarSegments/tabs"/>

<$reveal tag="div" class="tc-block-dropdown-wrapper" state="$:/temp/search" type="nomatch" text="">

<$reveal tag="div" class="tc-block-dropdown tc-search-drop-down tc-popup-handle" state=<<qualify "$:/state/popup/search-dropdown">> type="nomatch" text="" default="">

<$list filter="[{$:/temp/search}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">

{{$:/core/ui/SearchResults}}

</$list>

</$reveal>

</$reveal>

</$set>

<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]" default={{$:/config/DefaultSidebarTab}} state="$:/state/tab/sidebar" />

</div>
4 changes: 4 additions & 0 deletions core/ui/SideBarSegments/page-controls.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: $:/core/ui/SideBarSegments/page-controls
tags: $:/tags/SideBarSegment

{{||$:/core/ui/PageTemplate/pagecontrols}}
54 changes: 54 additions & 0 deletions core/ui/SideBarSegments/search.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
title: $:/core/ui/SideBarSegments/search
tags: $:/tags/SideBarSegment

<div class="tc-sidebar-lists">

<$set name="searchTiddler" value="$:/temp/search">
<div class="tc-search">
<$edit-text tiddler="$:/temp/search" type="search" tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<<qualify "$:/state/popup/search-dropdown">> class="tc-popup-handle"/>
<$reveal state="$:/temp/search" type="nomatch" text="">
<$button tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/advancedsearch" text={{$:/temp/search}}/>
<$action-setfield $tiddler="$:/temp/search" text=""/>
<$action-navigate $to="$:/AdvancedSearch"/>
{{$:/core/images/advanced-search-button}}
</$button>
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/search" text="" />
{{$:/core/images/close-button}}
</$button>
<$button popup=<<qualify "$:/state/popup/search-dropdown">> class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
<$list filter="[{$:/temp/search}minlength{$:/config/Search/MinLength}limit[1]]" variable="listItem">
<$set name="searchTerm" value={{{ [<searchTiddler>get[text]] }}}>
<$set name="resultCount" value="""<$count filter="[!is[system]search<searchTerm>]"/>""">
{{$:/language/Search/Matches}}
</$set>
</$set>
</$list>
</$button>
</$reveal>
<$reveal state="$:/temp/search" type="match" text="">
<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="tc-btn-invisible">
{{$:/core/images/advanced-search-button}}
</$button>
</$reveal>
</div>

<$reveal tag="div" class="tc-block-dropdown-wrapper" state="$:/temp/search" type="nomatch" text="">

<$reveal tag="div" class="tc-block-dropdown tc-search-drop-down tc-popup-handle" state=<<qualify "$:/state/popup/search-dropdown">> type="nomatch" text="" default="">

<$list filter="[{$:/temp/search}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">

{{$:/core/ui/SearchResults}}

</$list>

</$reveal>

</$reveal>

</$set>

</div>
8 changes: 8 additions & 0 deletions core/ui/SideBarSegments/site-subtitle.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: $:/core/ui/SideBarSegments/site-subtitle
tags: $:/tags/SideBarSegment

<div class="tc-site-subtitle">

<$transclude tiddler="$:/SiteSubtitle" mode="inline"/>

</div>
8 changes: 8 additions & 0 deletions core/ui/SideBarSegments/site-title.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: $:/core/ui/SideBarSegments/site-title
tags: $:/tags/SideBarSegment

<h1 class="tc-site-title">

<$transclude tiddler="$:/SiteTitle" mode="inline"/>

</h1>
8 changes: 8 additions & 0 deletions core/ui/SideBarSegments/tabs.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: $:/core/ui/SideBarSegments/tabs
tags: $:/tags/SideBarSegment

<div class="tc-sidebar-lists">

<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]" default={{$:/config/DefaultSidebarTab}} state="$:/state/tab/sidebar" />

</div>
25 changes: 11 additions & 14 deletions core/ui/TagManager.tid
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ caption: {{$:/language/TagManager/Caption}}
\end
\define iconEditor(title)
<div class="tc-drop-down-wrapper">
<$button popup=<<qualify "$:/state/popup/icon/$title$">> class="tc-btn-invisible tc-btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<$reveal state=<<qualify "$:/state/popup/icon/$title$">> type="popup" position="belowleft" text="" default="">
<$button popupTitle={{{ [[$:/state/popup/icon/]addsuffix<__title__>] }}} class="tc-btn-invisible tc-btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<$reveal stateTitle={{{ [[$:/state/popup/icon/]addsuffix<__title__>] }}} type="popup" position="belowleft" text="" default="">
<div class="tc-drop-down">
<$linkcatcher to="$title$!!icon">
<$linkcatcher actions="""<$action-setfield $tiddler=<<__title__>> icon=<<navigateTo>>/>""">
<<iconEditorTab type:"!">>
<hr/>
<<iconEditorTab type:"">>
Expand All @@ -25,17 +25,14 @@ caption: {{$:/language/TagManager/Caption}}
</$reveal>
</div>
\end
\define qualifyTitle(title)
$title$$(currentTiddler)$
\end
\define toggleButton(state)
<$reveal state="$state$" type="match" text="closed" default="closed">
<$button set="$state$" setTo="open" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
<$reveal stateTitle=<<__state__>> type="match" text="closed" default="closed">
<$button setTitle=<<__state__>> setTo="open" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
{{$:/core/images/info-button}}
</$button>
</$reveal>
<$reveal state="$state$" type="match" text="open" default="closed">
<$button set="$state$" setTo="closed" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
<$reveal stateTitle=<<__state__>> type="match" text="open" default="closed">
<$button setTitle=<<__state__>> setTo="closed" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
{{$:/core/images/info-button}}
</$button>
</$reveal>
Expand All @@ -52,19 +49,19 @@ $title$$(currentTiddler)$
<$list filter="[tags[]!is[system]sort[title]]">
<tr>
<td><$edit-text field="color" tag="input" type="color"/></td>
<td><$macrocall $name="tag" tag=<<currentTiddler>>/></td>
<td>{{||$:/core/ui/TagTemplate}}</td>
<td><$count filter="[all[current]tagging[]]"/></td>
<td>
<$macrocall $name="iconEditor" title={{!!title}}/>
</td>
<td>
<$macrocall $name="toggleButton" state=<<qualifyTitle "$:/state/tag-manager/">> />
<$macrocall $name="toggleButton" state={{{ [[$:/state/tag-manager/]addsuffix<currentTiddler>] }}} />
</td>
</tr>
<tr>
<td></td>
<td colspan="4">
<$reveal state=<<qualifyTitle "$:/state/tag-manager/">> type="match" text="open" default="">
<$reveal stateTitle={{{ [[$:/state/tag-manager/]addsuffix<currentTiddler>] }}} type="match" text="open" default="">
<table>
<tbody>
<tr><td><<lingo Colour/Heading>></td><td><$edit-text field="color" tag="input" type="text" size="9"/></td></tr>
Expand All @@ -77,7 +74,7 @@ $title$$(currentTiddler)$
</$list>
<tr>
<td></td>
<td>
<td style="position:relative;">
{{$:/core/ui/UntaggedTemplate}}
</td>
<td>
Expand Down
3 changes: 3 additions & 0 deletions core/ui/TagTemplate.tid
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
title: $:/core/ui/TagTemplate

\whitespace trim
<span class="tc-tag-list-item">
<$set name="transclusion" value=<<currentTiddler>>>
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{!!icon}} colour={{!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]tagging[]]' tag='span'"""/>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
<$set name="tv-show-missing-links" value="yes">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</$set>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
Expand Down
2 changes: 1 addition & 1 deletion core/ui/TiddlerInfo/References.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ caption: {{$:/language/TiddlerInfo/References/Caption}}

\define lingo-base() $:/language/TiddlerInfo/
<$list filter="[all[current]backlinks[]sort[title]]" emptyMessage=<<lingo References/Empty>> template="$:/core/ui/ListItemTemplate">
</$list>
</$list>
4 changes: 2 additions & 2 deletions core/ui/ViewTemplate/body.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: $:/core/ui/ViewTemplate/body
tags: $:/tags/ViewTemplate

<$reveal tag="div" class="tc-tiddler-body" type="nomatch" state=<<folded-state>> text="hide" retain="yes" animate="yes">
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">

<$list filter="[all[current]!has[plugin-type]!field:hide-body[yes]]">

Expand All @@ -13,4 +13,4 @@ tags: $:/tags/ViewTemplate

</$list>

</$reveal>
</$reveal>
2 changes: 1 addition & 1 deletion core/ui/ViewTemplate/subtitle.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: $:/core/ui/ViewTemplate/subtitle
tags: $:/tags/ViewTemplate

<$reveal type="nomatch" state=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-subtitle">
<$link to={{!!modifier}}>
<$view field="modifier"/>
Expand Down
4 changes: 2 additions & 2 deletions core/ui/ViewTemplate/tags.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: $:/core/ui/ViewTemplate/tags
tags: $:/tags/ViewTemplate

<$reveal type="nomatch" state=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-tags-wrapper"><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
</$reveal>
</$reveal>
2 changes: 1 addition & 1 deletion core/ui/ViewTemplate/title.tid
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $:/config/ViewToolbarButtons/Visibility/$(listItem)$

<$reveal type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes">

<$transclude tiddler="$:/core/ui/TiddlerInfo"/>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem"><$transclude tiddler=<<listItem>> mode="block"/></$list>

</$reveal>
</div>
4 changes: 2 additions & 2 deletions core/ui/ViewTemplate/unfold.tid
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ title: $:/core/ui/ViewTemplate/unfold
tags: $:/tags/ViewTemplate

<$reveal tag="div" type="nomatch" state="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar" text="hide">
<$reveal tag="div" type="nomatch" state=<<folded-state>> text="hide" default="show" retain="yes" animate="yes">
<$reveal tag="div" type="nomatch" stateTitle=<<folded-state>> text="hide" default="show" retain="yes" animate="yes">
<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class="tc-fold-banner">
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
{{$:/core/images/chevron-up}}
</$button>
</$reveal>
<$reveal tag="div" type="nomatch" state=<<folded-state>> text="show" default="show" retain="yes" animate="yes">
<$reveal tag="div" type="nomatch" stateTitle=<<folded-state>> text="show" default="show" retain="yes" animate="yes">
<$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class="tc-unfold-banner">
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
{{$:/core/images/chevron-down}}
Expand Down
6 changes: 3 additions & 3 deletions core/ui/ViewToolbar/fold.tid
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ caption: {{$:/core/images/fold-button}} {{$:/language/Buttons/Fold/Caption}}
description: {{$:/language/Buttons/Fold/Hint}}

\whitespace trim
<$reveal type="nomatch" state=<<folded-state>> text="hide" default="show">
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" default="show">
<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
Expand All @@ -18,7 +18,7 @@ description: {{$:/language/Buttons/Fold/Hint}}
</$list>
</$button>
</$reveal>
<$reveal type="match" state=<<folded-state>> text="hide" default="show">
<$reveal type="match" stateTitle=<<folded-state>> text="hide" default="show">
<$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
Expand All @@ -31,4 +31,4 @@ description: {{$:/language/Buttons/Fold/Hint}}
</span>
</$list>
</$button>
</$reveal>
</$reveal>
3 changes: 3 additions & 0 deletions core/wiki/config/EditorTypeMappings.multids
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
title: $:/config/EditorTypeMappings/

image/gif: bitmap
image/webp: bitmap
image/heic: bitmap
image/heif: bitmap
image/jpeg: bitmap
image/jpg: bitmap
image/png: bitmap
Expand Down
2 changes: 2 additions & 0 deletions core/wiki/config/NewImageType.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title: $:/config/NewImageType
text: jpeg
2 changes: 1 addition & 1 deletion core/wiki/config/OfficialPluginLibrary.tid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: $:/config/OfficialPluginLibrary
tags: $:/tags/PluginLibrary
url: https://tiddlywiki.com/library/v5.1.17/index.html
url: https://tiddlywiki.com/library/v5.1.18/index.html
caption: {{$:/language/OfficialPluginLibrary}}

{{$:/language/OfficialPluginLibrary/Hint}}
3 changes: 3 additions & 0 deletions core/wiki/config/ShortcutInfo.multids
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ list-bullet: {{$:/language/Buttons/ListBullet/Hint}}
list-number: {{$:/language/Buttons/ListNumber/Hint}}
mono-block: {{$:/language/Buttons/MonoBlock/Hint}}
mono-line: {{$:/language/Buttons/MonoLine/Hint}}
new-image: {{$:/language/Buttons/NewImage/Hint}}
new-journal: {{$:/language/Buttons/NewJournal/Hint}}
new-tiddler: {{$:/language/Buttons/NewTiddler/Hint}}
picture: {{$:/language/Buttons/Picture/Hint}}
preview: {{$:/language/Buttons/Preview/Hint}}
quote: {{$:/language/Buttons/Quote/Hint}}
Expand Down
3 changes: 3 additions & 0 deletions core/wiki/config/shortcuts/shortcuts-mac.multids
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ title: $:/config/shortcuts-mac/
bold: meta-B
italic: meta-I
underline: meta-U
new-image: ctrl-I
new-journal: ctrl-J
new-tiddler: ctrl-N
3 changes: 3 additions & 0 deletions core/wiki/config/shortcuts/shortcuts-not-mac.multids
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ title: $:/config/shortcuts-not-mac/
bold: ctrl-B
italic: ctrl-I
underline: ctrl-U
new-image: alt-I
new-journal: alt-J
new-tiddler: alt-N
29 changes: 17 additions & 12 deletions core/wiki/macros/list.tid
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,33 @@ tags: $:/tags/Macro
</$vars>
\end

\define list-tagged-draggable-drop-actions()
\define list-tagged-draggable-drop-actions(tag)
<!-- Save the current ordering of the tiddlers with this tag -->
<$set name="order" filter="[<tag>tagging[]]">
<$set name="order" filter="[<__tag__>tagging[]]">
<!-- Remove any list-after or list-before fields from the tiddlers with this tag -->
<$list filter="[<tag>tagging[]]">
<$list filter="[<__tag__>tagging[]]">
<$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/>
</$list>
<!-- Assign the list field of the tag with the current ordering -->
<$action-setfield $tiddler=<<tag>> $field="list" $value=<<order>>/>
<!-- Add the newly inserted item to the list -->
<$action-listops $tiddler=<<tag>> $field="list" $subfilter="+[insertbefore:currentTiddler<actionTiddler>]"/>
<!-- Save the new order to the Tag Tiddler -->
<$action-listops $tiddler=<<__tag__>> $field="list" $filter="+[enlist<order>] +[insertbefore:currentTiddler<actionTiddler>]"/>
<!-- Make sure the newly added item has the right tag -->
<$action-listops $tiddler=<<actionTiddler>> $tags="[<tag>]"/>
<!-- Removing this line makes dragging tags within the dropdown work as intended -->
<!--<$action-listops $tiddler=<<actionTiddler>> $tags=<<__tag__>>/>-->
<!-- Using the following 5 lines as replacement makes dragging titles from outside into the dropdown apply the tag -->
<$list filter="[<actionTiddler>!contains:tags<__tag__>]">
<$fieldmangler tiddler=<<actionTiddler>>>
<$action-sendmessage $message="tm-add-tag" $param=<<__tag__>>/>
</$fieldmangler>
</$list>
</$set>
\end

\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div")
<$set name="tag" value="""$tag$""">
<$list filter="[<tag>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>>>
<$set name="tag" value=<<__tag__>>>
<$list filter="[<__tag__>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>>>
<$elementTag$ class="tc-menu-list-item">
<$droppable actions=<<list-tagged-draggable-drop-actions>>>
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""">
<$elementTag$ class="tc-droppable-placeholder">
&nbsp;
</$elementTag$>
Expand All @@ -86,7 +91,7 @@ tags: $:/tags/Macro
</$elementTag$>
</$list>
<$tiddler tiddler="">
<$droppable actions=<<list-tagged-draggable-drop-actions>>>
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""">
<$elementTag$ class="tc-droppable-placeholder">
&nbsp;
</$elementTag$>
Expand Down
6 changes: 3 additions & 3 deletions core/wiki/macros/tag.tid
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ color:$(foregroundColor)$;
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<$element-tag$ $element-attributes$ class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
$actions$<$transclude tiddler="""$icon$"""/> <$view tiddler="""$tag$""" field="title" format="text" />
$actions$<$transclude tiddler="""$icon$"""/> <$view tiddler=<<__tag__>> field="title" format="text" />
</$element-tag$>
</$vars>
\end

\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
<$macrocall $name="tag-pill-inner" tag="""$tag$""" icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
<$macrocall $name="tag-pill-inner" tag=<<__tag__>> icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
\end

\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
<span class="tc-tag-list-item">
<$macrocall $name="tag-pill-body" tag="""$tag$""" icon={{$tag$!!icon}} colour={{$tag$!!color}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
<$macrocall $name="tag-pill-body" tag=<<__tag__>> icon={{{ [<__tag__>get[icon]] }}} colour={{{ [<__tag__>get[color]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
</span>
\end

Expand Down
118 changes: 57 additions & 61 deletions core/wiki/macros/toc.tid
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ tags: $:/tags/Macro

\define toc-body(tag,sort:"",itemClassFilter,exclude,path)
<ol class="tc-toc">
<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$""">
<$vars item=<<currentTiddler>> path="""$path$/$tag$""" excluded="""$exclude$ -[[$tag$]]""">
<$set name="toc-item-class" filter="""$itemClassFilter$""" emptyValue="toc-item" value="toc-item-selected">
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
<$vars item=<<currentTiddler>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}} excluded="""[enlist<__exclude__>] -[<__tag__>]""">
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected">
<li class=<<toc-item-class>>>
<$list filter="[all[current]toc-link[no]]" emptyMessage="<$link><$view field='caption'><$view field='title'/></$view></$link>">
<<toc-caption>>
</$list>
<$macrocall $name="toc-body" tag=<<item>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" exclude=<<excluded>> path=<<path>>/>
<$macrocall $name="toc-body" tag=<<item>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
</li>
</$set>
</$vars>
Expand All @@ -27,165 +27,161 @@ tags: $:/tags/Macro
\end

\define toc(tag,sort:"",itemClassFilter:" ")
<<toc-body tag:"""$tag$""" sort:"""$sort$""" itemClassFilter:"""$itemClassFilter$""">>
<$macrocall $name="toc-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> />
\end

\define toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
<!-- helper function -->
<$set name="toc-state" value=<<qualify """$:/state/toc$path$-$(currentTiddler)$""">>>
<$set name="toc-item-class" filter="""$itemClassFilter$""" emptyValue="toc-item" value="toc-item-selected">
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected">
<li class=<<toc-item-class>>>
<$link>
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}
</$button>
</$reveal>
<<toc-caption>>
</$link>
<$reveal type="match" state=<<toc-state>> text="open">
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" exclude="""$exclude$""" path="""$path$"""/>
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$set>
</$qualify>
\end

\define toc-unlinked-expandable-body(tag,sort:"",itemClassFilter:" ",exclude,path)
<!-- helper function -->
<$set name="toc-state" value=<<qualify """$:/state/toc$path$-$(currentTiddler)$""">>>
<$set name="toc-item-class" filter="""$itemClassFilter$""" emptyValue="toc-item" value="toc-item-selected">
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected">
<li class=<<toc-item-class>>>
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}
<<toc-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}
<<toc-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" exclude="""$exclude$""" path="""$path$"""/>
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$set>
</$qualify>
\end

\define toc-expandable-empty-message()
<<toc-linked-expandable-body tag:"""$(tag)$""" sort:"""$(sort)$""" itemClassFilter:"""$(itemClassFilter)$""" exclude:"""$(excluded)$""" path:"""$(path)$""">>
<$macrocall $name="toc-linked-expandable-body" tag=<<tag>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<excluded>> path=<<path>>/>
\end

\define toc-expandable(tag,sort:"",itemClassFilter:" ",exclude,path)
<$vars tag="""$tag$""" sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" excluded="""$exclude$ -[[$tag$]]""" path="""$path$/$tag$""">
<$vars tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> excluded="""[enlist<__exclude__>] -[<__tag__>]""" path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
<ol class="tc-toc toc-expandable">
<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$""">
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
<$list filter="[all[current]toc-link[no]]" emptyMessage=<<toc-expandable-empty-message>> >
<$macrocall $name="toc-unlinked-expandable-body" tag="""$tag$""" sort="""$sort$""" itemClassFilter="""itemClassFilter""" exclude=<<excluded>> path=<<path>> />
<$macrocall $name="toc-unlinked-expandable-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter="""itemClassFilter""" exclude=<<excluded>> path=<<path>> />
</$list>
</$list>
</ol>
</$vars>
\end

\define toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter:" ",exclude,path)
<$set name="toc-state" value=<<qualify """$:/state/toc$path$-$(currentTiddler)$""">>>
<$set name="toc-item-class" filter="""$itemClassFilter$""" emptyValue="toc-item" value="toc-item-selected" >
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected" >
<li class=<<toc-item-class>>>
<$link>
<$list filter="[all[current]tagging[]limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>">
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}
</$button>
</$reveal>
</$list>
<<toc-caption>>
</$link>
<$reveal type="match" state=<<toc-state>> text="open">
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" exclude="""$exclude$""" path="""$path$"""/>
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$set>
</$qualify>
\end

\define toc-unlinked-selective-expandable-body(tag,sort:"",itemClassFilter:" ",exclude,path)
<$set name="toc-state" value=<<qualify """$:/state/toc$path$-$(currentTiddler)$""">>>
<$set name="toc-item-class" filter="""$itemClassFilter$""" emptyValue="toc-item" value="toc-item-selected">
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected">
<li class=<<toc-item-class>>>
<$list filter="[all[current]tagging[]limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>">
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}
<<toc-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}
<<toc-caption>>
</$button>
</$reveal>
</$list>
<$reveal type="match" state=<<toc-state>> text="open">
<$macrocall $name="""toc-selective-expandable""" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" exclude="""$exclude$""" path="""$path$"""/>
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$set>
</$qualify>
\end

\define toc-selective-expandable-empty-message()
<<toc-linked-selective-expandable-body tag:"""$(tag)$""" sort:"""$(sort)$""" itemClassFilter:"""$(itemClassFilter)$""" exclude:"""$(excluded)$""" path:"""$(path)$""">>
<$macrocall $name="toc-linked-selective-expandable-body" tag=<<tag>> sort=<<sort>> itemClassFilter=<<itemClassFilter>> exclude=<<excluded>> path=<<path>>/>
\end

\define toc-selective-expandable(tag,sort:"",itemClassFilter,exclude,path)
<$vars tag="""$tag$""" sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" excluded="""$exclude$ -[[$tag$]]""" path="""$path$/$tag$""">
<$vars tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> excluded="""[enlist<__exclude__>] -[<__tag__>]""" path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>
<ol class="tc-toc toc-selective-expandable">
<$list filter="""[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$] -[[$tag$]] $exclude$""">
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
<$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<<toc-selective-expandable-empty-message>> >
<$macrocall $name=toc-unlinked-selective-expandable-body tag="""$tag$""" sort="""$sort$""" itemClassFilter="""$itemClassFilter$""" exclude=<<excluded>> path=<<path>> >
<$macrocall $name="toc-unlinked-selective-expandable-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
</$list>
</$list>
</ol>
</$vars>
\end

\define toc-tabbed-selected-item-filter(selectedTiddler)
[all[current]field:title{$selectedTiddler$}]
\end

\define toc-tabbed-external-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
<$tiddler tiddler={{$selectedTiddler$}}>
<$tiddler tiddler={{{ [<__selectedTiddler__>get[text]] }}}>
<div class="tc-tabbed-table-of-contents">
<$linkcatcher to="$selectedTiddler$">
<$linkcatcher to=<<__selectedTiddler__>>>
<div class="tc-table-of-contents">
<$macrocall $name="toc-selective-expandable" tag="""$tag$""" sort="""$sort$""" itemClassFilter=<<toc-tabbed-selected-item-filter selectedTiddler:"""$selectedTiddler$""">>/>
<$macrocall $name="toc-selective-expandable" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter="[all[current]field:title<__selectedTiddler__>]"/>
</div>
</$linkcatcher>
<div class="tc-tabbed-table-of-contents-content">
<$reveal state="""$selectedTiddler$""" type="nomatch" text="">
<$transclude mode="block" tiddler="$template$">
<$reveal stateTitle=<<__selectedTiddler__>> type="nomatch" text="">
<$transclude mode="block" tiddler=<<__template__>>>
<h1><<toc-caption>></h1>
<$transclude mode="block">$missingText$</$transclude>
</$transclude>
</$reveal>
<$reveal state="""$selectedTiddler$""" type="match" text="">
<$reveal stateTitle=<<__selectedTiddler__>> type="match" text="">
$unselectedText$
</$reveal>
</div>
Expand All @@ -194,8 +190,8 @@ tags: $:/tags/Macro
\end

\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText,missingText,template:"")
<$linkcatcher to="""$selectedTiddler$""">
<$macrocall $name="toc-tabbed-external-nav" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$""" missingText="""$missingText$""" template="""$template$"""/>
<$linkcatcher to=<<__selectedTiddler__>>>
<$macrocall $name="toc-tabbed-external-nav" tag=<<__tag__>> sort=<<__sort__>> selectedTiddler=<<__selectedTiddler__>> unselectedText=<<__unselectedText__>> missingText=<<__missingText__>> template=<<__template__>>/>
</$linkcatcher>
\end

58 changes: 31 additions & 27 deletions core/wiki/macros/tree.tid
Original file line number Diff line number Diff line change
@@ -1,53 +1,57 @@
title: $:/core/macros/tree
tags: $:/tags/Macro

\define leaf-node(prefix)
\define leaf-link(full-title, chunk)
<$link to=<<__full-title__>>><$text text=<<__chunk__>>/></$link>
\end

\define leaf-node(prefix, chunk)
<li>
<$list filter="""[[$prefix$$(chunk)$]is[shadow]] [[$prefix$$(chunk)$]is[tiddler]] +[removeprefix[$prefix$]] +[limit[1]]"""
emptyMessage="""<$text text="$prefix$$(chunk)$"/>""">
<span>{{$:/core/images/file}}</span> <$link to="""$prefix$$(chunk)$""">
<$view field="title"/>
</$link>
<$list filter="[<__prefix__>addsuffix<__chunk__>is[shadow]] [<__prefix__>addsuffix<__chunk__>is[tiddler]]" variable="full-title">
<$list filter="[<full-title>removeprefix<__prefix__>]" variable="chunk">
<span>{{$:/core/images/file}}</span> <$macrocall $name="leaf-link" full-title=<<full-title>> chunk=<<chunk>>/>
</$list>
</$list>
</li>
\end

\define branch-node(prefix)
<$reveal type="nomatch" text="" default="""$(chunk)$""">
<li>
<$list filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]] +[limit[1]]""">
<$reveal type="nomatch" state="""$:/state/tree/$prefix$$(chunk)$""" text="show">
<$button set="""$:/state/tree/$prefix$$(chunk)$""" setTo="show" class="tc-btn-invisible">{{$:/core/images/folder}} <$text text="""$(chunk)$"""/></$button>
\define branch-node(prefix, chunk)
<li>
<$set name="reveal-state" value={{{ [[$:/state/tree/]addsuffix<__prefix__>addsuffix<__chunk__>] }}}>
<$reveal type="nomatch" stateTitle=<<reveal-state>> text="show">
<$button setTitle=<<reveal-state>> setTo="show" class="tc-btn-invisible">
{{$:/core/images/folder}} <$text text=<<__chunk__>>/>
</$button>
</$reveal>
<$reveal type="match" state="""$:/state/tree/$prefix$$(chunk)$""" text="show">
<$button set="""$:/state/tree/$prefix$$(chunk)$""" setTo="hide" class="tc-btn-invisible">{{$:/core/images/folder}} <$text text="""$(chunk)$"""/></$button>
<$reveal type="match" stateTitle=<<reveal-state>> text="show">
<$button setTitle=<<reveal-state>> setTo="hide" class="tc-btn-invisible">
{{$:/core/images/folder}} <$text text=<<__chunk__>>/>
</$button>
</$reveal>
</$list>
<$list filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]] +[limit[1]]"""><span>(<$count filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]]"""/>)</span>
<$reveal type="match" state="""$:/state/tree/$prefix$$(chunk)$""" text="show">
<$macrocall $name="tree-node" prefix="""$prefix$$(chunk)$"""/>
<span>(<$count filter="[all[shadows+tiddlers]removeprefix<__prefix__>removeprefix<__chunk__>] -[<__prefix__>addsuffix<__chunk__>]"/>)</span>
<$reveal type="match" stateTitle=<<reveal-state>> text="show">
<$macrocall $name="tree-node" prefix={{{ [<__prefix__>addsuffix<__chunk__>] }}}/>
</$reveal>
</$list>
</$set>
</li>
</$reveal>
\end

\define tree-node(prefix)
<ol>
<$list filter="[all[shadows+tiddlers]removeprefix[$prefix$]splitbefore[/]sort[title]] +[!suffix[/]]" variable="chunk">
<<leaf-node """$prefix$""">>
<$list filter="[all[shadows+tiddlers]removeprefix<__prefix__>splitbefore[/]sort[]!suffix[/]]" variable="chunk">
<$macrocall $name="leaf-node" prefix=<<__prefix__>> chunk=<<chunk>>/>
</$list>
<$list filter="[all[shadows+tiddlers]removeprefix[$prefix$]splitbefore[/]sort[title]] +[suffix[/]]" variable="chunk">
<<branch-node """$prefix$""">>
<$list filter="[all[shadows+tiddlers]removeprefix<__prefix__>splitbefore[/]sort[]suffix[/]]" variable="chunk">
<$macrocall $name="branch-node" prefix=<<__prefix__>> chunk=<<chunk>>/>
</$list>
</ol>
\end

\define tree(prefix)
\define tree(prefix: "$:/")
<div class="tc-tree">
<span><$text text="""$prefix$"""/></span>
<span><$text text=<<__prefix__>>/></span>
<div>
<$macrocall $name="tree-node" prefix="""$prefix$"""/>
<$macrocall $name="tree-node" prefix=<<__prefix__>>/>
</div>
</div>
\end
2 changes: 2 additions & 0 deletions core/wiki/tags/SideBarSegment.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title: $:/tags/SideBarSegment
list: [[$:/core/ui/SideBarSegments/site-title]] [[$:/core/ui/SideBarSegments/site-subtitle]] [[$:/core/ui/SideBarSegments/page-controls]] [[$:/core/ui/SideBarSegments/search]] [[$:/core/ui/SideBarSegments/tabs]]
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ Hook function parameters:
** Defined in core/modules/commands/server.js
* NodeJS HTTP Server instance
** See the NodeJS docs at [ext[https://nodejs.org/docs/latest-v8.x/api/http.html#http_class_http_server]]
* Name of server invoking this hook (for special handling of the NodeJS HTTP server instance argument).
** Current known values: `tiddlywiki`, `tiddlyserver`.

Return value is ignored.
114 changes: 114 additions & 0 deletions editions/dev/tiddlers/system/doc-macros.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
created: 20150117152607000
modified: 201804111739
tags: $:/tags/Macro
title: $:/editions/dev/doc-macros
type: text/vnd.tiddlywiki

\define .concat(1,2,3,4,5) $1$$2$$3$$4$$5$

\define .def(_) <dfn class="doc-def">$_$</dfn>
\define .em(_) <em class="doc-em">$_$</em>
\define .strong(_) <strong class="doc-strong">$_$</strong>
\define .place(_) <code class="doc-place">$_$</code>
\define .word(_) "$_$"

\define .preamble(_) :.doc-preamble $_$
\define .note(_)
@@.doc-note
;Note
: $_$
@@
\end

\define .tid(_) <code class="doc-tiddler">$_$</code>
\define .tag(_) <code class="doc-tag">$_$</code>
\define .field(_) <code class="doc-field">$_$</code>
\define .value(_) <code class="doc-value">$_$</code>
\define .op(_) <code class="doc-operator">$_$</code>
\define .var(_) <code class="doc-var">$_$</code>
\define .wid(_) <code class="doc-widget">$$_$</code>
\define .attr(_) <code class="doc-attr">$_$</code>
\define .param(_) <code class="doc-param">$_$</code>

\define .mtitle(_) $_$ Macro
\define .otitle(_) $_$ Operator
\define .vtitle(_) $_$ Variable

\define .link(_,to) <$link to="$to$">$_$</$link>
\define .clink(_,to) <span class="doc-clink"><<.link """$_$""" "$to$">></span>
\define .dlink(_,to) <$macrocall $name=".link" _=<<.def "$_$">> to="$to$">/>
\define .dlink-ex(_,to) <a href="$to$" class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><<.def "$_$">></a>
\define .flink(to) <$macrocall $name=".link" _=<<.field {{$to$!!caption}}>> to="$to$"/>
\define .mlink(_,to) <$macrocall $name=".link" _=<<.var "$_$">> to=<<.mtitle "$_$">>/>
\define .mlink2(_,to) <$macrocall $name=".link" _=<<.var "$_$">> to="$to$"/>
\define .olink(_) <$macrocall $name=".link" _=<<.op "$_$">> to=<<.otitle "$_$">>/>
\define .olink2(_,to) <$macrocall $name=".link" _=<<.op "$_$">> to=<<.otitle "$to$">>/>
\define .vlink(_,to) <$macrocall $name=".link" _=<<.var "$_$">> to=<<.vtitle "$_$">>/>
\define .vlink2(_,to) <$macrocall $name=".link" _=<<.var "$_$">> to="$to$"/>
\define .wlink(to) <$macrocall $name=".link" _=<<.wid {{$to$!!caption}}>> to="$to$"/>
\define .wlink2(_,to) <$macrocall $name=".link" _="$_$" to="$to$"/>

\define .key(_) <span class="doc-key">$_$</span>
\define .combokey(_) <$macrocall $name=".if" cond="$_$" then=<<.key '$_$'>>/>
\define .keycombo(1,2,3,4) <<.combokey "$1$">><<.if "$2$" +>><<.combokey "$2$">><<.if "$3$" +>><<.combokey "$3$">><<.if "$4$" +>><<.combokey "$4$">>

\define .tab(_) <span class="doc-tab">{{$_$!!caption}}</span>
\define .sidebar-tab(_) <<.tab "$:/core/ui/SideBar/$_$">>
\define .more-tab(_) <<.tab "$:/core/ui/MoreSideBar/$_$">>
\define .info-tab(_) <<.tab "$:/core/ui/TiddlerInfo/$_$">>
\define .controlpanel-tab(_) <<.tab "$:/core/ui/ControlPanel/$_$">>
\define .advancedsearch-tab(_) <<.tab "$:/core/ui/AdvancedSearch/$_$">>
\define .toc-tab() <<.tab "TableOfContents">>
\define .example-tab(_) <span class="doc-tab">$_$</span>

\define .button(_) <span class="doc-button">{{$:/core/ui/Buttons/$_$!!caption}}</span>

\define .tip(_) <div class="doc-icon-block"><div class="doc-block-icon">{{$:/core/images/tip}}</div> $_$</div>
\define .warning(_) <div class="doc-icon-block"><div class="doc-block-icon">{{$:/core/images/warning}}</div> $_$</div>

\define .state-prefix() $:/state/editions/tw5.com/

\define .lorem()
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end

\define .toc-lorem()
This is an example tiddler. See [[Table-of-Contents Macros (Examples)]].

<<.lorem>>
\end

\define .example(n,eg,egvar:NO-SUCH-VAR)
<div class="doc-example">
<$reveal default="$egvar$" type="match" text="NO-SUCH-VAR">
<$macrocall $name="copy-to-clipboard-above-right" src="""$eg$"""/>
<$codeblock code="""$eg$"""/>
</$reveal>
<$reveal default="$egvar$" type="nomatch" text="NO-SUCH-VAR">
<!-- allow an example to contain """ -->
<$macrocall $name="copy-to-clipboard-above-right" src=<<$egvar$>>/>
<$codeblock code=<<$egvar$>>/>
</$reveal>
<$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix[$n$]]" variable=".state">
<$reveal state=<<.state>> type="nomatch" text="show">
<dl>
<dd><$button set=<<.state>> setTo="show">Try it</$button></dd>
</dl>
</$reveal>
<$reveal state=<<.state>> type="match" text="show">
<dl>
<dd><$button set=<<.state>> setTo="">Hide</$button></dd>
</dl>
<blockquote class="doc-example-result">
<$reveal default="$egvar$" type="match" text="NO-SUCH-VAR">
$eg$
</$reveal>
<$reveal default="$egvar$" type="nomatch" text="NO-SUCH-VAR">
<<$egvar$>>
</$reveal>
</blockquote>
</$reveal>
</$list>
\end

<pre><$view field="text"/></pre>
5 changes: 5 additions & 0 deletions editions/dynaviewdemo/tiddlers/DefaultTiddlers.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: $:/DefaultTiddlers

HelloThere
$:/plugins/tiddlywiki/dynaview
[list[Alice in Wonderland:]]
11 changes: 11 additions & 0 deletions editions/dynaviewdemo/tiddlers/HelloThere.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: HelloThere

This edition demonstrates some of the capabilities of the ~DynaView plugin. See the [[plugin tiddler|$:/plugins/tiddlywiki/dynaview]] below for the plugin documentation and some simple examples.

This wiki demonstrates how to use DynaView's dynamic rendering features to customise the story river such that tiddlers are only rendered when they are scrolled into view.

The following customisations are made:

! $:/core/ui/ViewTemplate

<<compareTiddlerText sourceTiddlerTitle:"$:/core" sourceSubTiddlerTitle:"$:/core/ui/ViewTemplate" destTiddlerTitle:"$:/core/ui/ViewTemplate">>
2 changes: 2 additions & 0 deletions editions/dynaviewdemo/tiddlers/PerformanceInstrumentation.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
title: $:/config/Performance/Instrumentation
text: yes
36 changes: 36 additions & 0 deletions editions/dynaviewdemo/tiddlers/SideBar-Open.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
title: $:/core/ui/SideBar/Open
tags: $:/tags/SideBar
caption: {{$:/language/SideBar/Open/Caption}}

\define lingo-base() $:/language/CloseAll/

\define drop-actions()
<$action-listops $tiddler="$:/StoryList" $subfilter="+[insertbefore:currentTiddler<actionTiddler>]"/>
\end

<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" storyview="pop">
<div style="position: relative;">
<$droppable actions=<<drop-actions>>>
<div class="tc-droppable-placeholder">
&nbsp;
</div>
<div>
<$button message="tm-close-tiddler" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class="tc-btn-invisible tc-btn-mini">&times;</$button> <$link to={{!!title}}><$view field="title"/></$link>

<$set name="state" value={{{ [[$:/state/viewtemplate/visibility/]addsuffix<currentTiddler>] }}}>
<$set name="visibility" tiddler=<<state>>>
- <$text text=<<visibility>>/>
</$set>
</$set>
</div>
</$droppable>
</div>
</$list>
<$tiddler tiddler="">
<$droppable actions=<<drop-actions>>>
<div class="tc-droppable-placeholder">
&nbsp;
</div>
<$button message="tm-close-all-tiddlers" class="tc-btn-invisible tc-btn-mini"><<lingo Button>></$button>
</$droppable>
</$tiddler>
3 changes: 3 additions & 0 deletions editions/dynaviewdemo/tiddlers/SiteSubtitle.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: $:/SiteSubtitle

a demo of the ~DynaView plugin for TiddlyWiki5
3 changes: 3 additions & 0 deletions editions/dynaviewdemo/tiddlers/SiteTitle.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: $:/SiteTitle

~DynaView Demo
30 changes: 30 additions & 0 deletions editions/dynaviewdemo/tiddlers/ViewTemplate.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
title: $:/core/ui/ViewTemplate

\whitespace trim
\define frame-classes()
tc-tiddler-frame tc-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$ $(tiddlerTagClasses)$ $(userClass)$
\end
\define folded-state()
$:/state/folded/$(currentTiddler)$
\end
<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">> userClass={{!!class}}>
<$tiddler tiddler=<<currentTiddler>>>
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class=<<frame-classes>>>

<$set name="state" value={{{ [[$:/state/viewtemplate/visibility/]addsuffix<currentTiddler>] }}}>
<$reveal stateTitle=<<state>> type="match" text="true" tag="div">
<div class="tc-dynaview-set-tiddler-when-visible tc-dynaview-expand-viewport" data-dynaview-set-tiddler=<<state>> data-dynaview-set-value="true" data-dynaview-unset-tiddler=<<state>> data-dynaview-unset-value="false" data-dynaview-has-triggered={{{ [<state>get[text]] }}}>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
</div>
</$reveal>
<$reveal stateTitle=<<state>> type="nomatch" text="true" tag="div">
<div class="tc-dynaview-set-tiddler-when-visible tc-dynaview-expand-viewport" style="min-height: 5em;" data-dynaview-set-tiddler=<<state>> data-dynaview-set-value="true" data-dynaview-unset-tiddler=<<state>> data-dynaview-unset-value="false" data-dynaview-has-triggered={{{ [<state>get[text]] }}}>
</div>
</$reveal>
</$set>

</div>
</$tiddler>
</$vars>
7,311 changes: 7,311 additions & 0 deletions editions/dynaviewdemo/tiddlers/alice/Alice in Wonderland (sliced).json

Large diffs are not rendered by default.

Loading