1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Changes to overridden shadow tiddlers to display fr-title when present instead of title

This commit is contained in:
Xavier Cazin 2014-11-28 18:00:19 +01:00 committed by Xavier Cazin
parent d4abd1722c
commit 156256afc7
6 changed files with 216 additions and 8 deletions

View File

@ -0,0 +1,23 @@
created: 20141127091159720
creator: 127.0.0.1
modified: 20141127091212193
modifier: 127.0.0.1
tags: $:/tags/Macro
title: $:/core/macros/list
type: text/vnd.tiddlywiki
\define list-links(filter,type:"ul",subtype:"li",class:"")
<$type$ class="$class$">
<$list filter="$filter$">
<$subtype$>
<$link to={{!!title}}>
<$transclude field="fr-title">
<$transclude field="caption">
<$view field="title"/>
</$transclude>
</$transclude>
</$link>
</$subtype$>
</$list>
</$type$>
\end

View File

@ -1,6 +1,6 @@
created: 20141119224138888
creator: 127.0.0.1
modified: 20141119224210297
modified: 20141127151713840
modifier: 127.0.0.1
tags: $:/tags/Macro
title: $:/core/macros/timeline
@ -15,8 +15,10 @@ type: text/vnd.tiddlywiki
<div class="tc-menu-list-subitem">
<$link to={{!!title}}>
<$view field="caption">
<$view field="fr-title">
<$view field="title"/>
</$view>
</$view>
</$link>
</div>
</$list>

View File

@ -0,0 +1,183 @@
created: 20141127152047697
creator: 127.0.0.1
modified: 20141127152823847
modifier: 127.0.0.1
tags: $:/tags/Macro
title: $:/core/macros/toc
type: text/vnd.tiddlywiki
\define title-unless-caption()
<$transclude field='fr-title'>
<$view field='caption'>
<$view field='title'/>
</$view>
</$transclude>
\end
\define toc-body(rootTag,tag,sort:"",itemClassFilter)
<ol class="tc-toc">
<$list filter="""[tag[$tag$]!has[draft.of]$sort$]""">
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
<li class=<<toc-item-class>>>
<$list filter="[is[current]toc-link[no]]" emptyMessage="<$link><<title-unless-caption>></$link>">
<<title-unless-caption>>
</$list>
<$list filter="""[all[current]] -[[$rootTag$]]""">
<$macrocall $name="toc-body" rootTag="""$rootTag$""" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
</$list>
</li>
</$set>
</$list>
</ol>
\end
\define toc(tag,sort:"",itemClassFilter)
<<toc-body rootTag:"""$tag$""" tag:"""$tag$""" sort:"""$sort$""" itemClassFilter:"""itemClassFilter""">>
\end
\define toc-linked-expandable-body(tag,sort:"",itemClassFilter)
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
<li class=<<toc-item-class>>>
<$link>
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
{{$:/core/images/right-arrow}}
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
</$button>
</$reveal>
<<title-unless-caption>>
</$link>
<$reveal type="match" state=<<toc-state>> text="open">
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
</$reveal>
</li>
</$set>
</$set>
\end
\define toc-unlinked-expandable-body(tag,sort:"",itemClassFilter)
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
<li class=<<toc-item-class>>>
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
{{$:/core/images/right-arrow}}
<<title-unless-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
<<title-unless-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
</$reveal>
</li>
</$set>
</$set>
\end
\define toc-expandable(tag,sort:"",itemClassFilter)
<ol class="tc-toc toc-expandable">
<$list filter="[tag[$tag$]!has[draft.of]$sort$]">
<$list filter="[is[current]toc-link[no]]" emptyMessage="<<toc-linked-expandable-body tag:'$tag$' sort:'$sort$' itemClassFilter:'$itemClassFilter$'>>">
<<toc-unlinked-expandable-body tag:"""$tag$""" sort:"""$sort$""" itemClassFilter:"""itemClassFilter""">>
</$list>
</$list>
</ol>
\end
\define toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter)
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
<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">
{{$:/core/images/right-arrow}}
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
</$button>
</$reveal>
</$list>
<<title-unless-caption>>
</$link>
<$reveal type="match" state=<<toc-state>> text="open">
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
</$reveal>
</li>
</$set>
</$set>
\end
\define toc-unlinked-selective-expandable-body(tag,sort:"",itemClassFilter)
<$set name="toc-state" value=<<qualify "$:/state/toc/$tag$-$(currentTiddler)$">>>
<$set name="toc-item-class" filter="""$itemClassFilter$""" value="toc-item-selected" emptyValue="toc-item">
<li class=<<toc-item-class>>>
<$list filter="[all[current]tagging[]limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <<title-unless-caption>>">
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible">
{{$:/core/images/right-arrow}}
<<title-unless-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
<<title-unless-caption>>
</$button>
</$reveal>
</$list>
<$reveal type="match" state=<<toc-state>> text="open">
<$macrocall $name="""toc-selective-expandable""" tag=<<currentTiddler>> sort="""$sort$""" itemClassFilter="""$itemClassFilter$"""/>
</$reveal>
</li>
</$set>
</$set>
\end
\define toc-selective-expandable(tag,sort:"",itemClassFilter)
<ol class="tc-toc toc-selective-expandable">
<$list filter="[tag[$tag$]!has[draft.of]$sort$]">
<$list filter="[is[current]toc-link[no]]" variable="ignore" emptyMessage="<<toc-linked-selective-expandable-body tag:'$tag$' sort:'$sort$' itemClassFilter:'$itemClassFilter$'>>">
<<toc-unlinked-selective-expandable-body tag:"""$tag$""" sort:"""$sort$""" itemClassFilter:"""$itemClassFilter$""">>
</$list>
</$list>
</ol>
\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)
<$tiddler tiddler={{$selectedTiddler$}}>
<div class="tc-tabbed-table-of-contents">
<$linkcatcher to="$selectedTiddler$">
<div class="tc-table-of-contents">
<$macrocall $name="toc-selective-expandable" tag="""$tag$""" sort="""$sort$""" itemClassFilter=<<toc-tabbed-selected-item-filter selectedTiddler:"""$selectedTiddler$""">>/>
</div>
</$linkcatcher>
<div class="tc-tabbed-table-of-contents-content">
<h1><<title-unless-caption>></h1>
<$transclude mode="block">$unselectedText$</$transclude>
</div>
</div>
</$tiddler>
\end
\define toc-tabbed-internal-nav(tag,sort:"",selectedTiddler:"$:/temp/toc/selectedTiddler",unselectedText)
<$linkcatcher to="""$selectedTiddler$""">
<$macrocall $name="toc-tabbed-external-nav" tag="""$tag$""" sort="""$sort$""" selectedTiddler="""$selectedTiddler$""" unselectedText="""$unselectedText$"""/>
</$linkcatcher>
\end

View File

@ -1,13 +1,13 @@
created: 20141117221740337
creator: 127.0.0.1
modified: 20141119225717026
modified: 20141127153644691
modifier: 127.0.0.1
title: $:/core/ui/ListItemTemplate
type: text/vnd.tiddlywiki
<div class="tc-menu-list-item">
<$link to={{!!title}}>
<$transclude field="caption">
<$transclude field="fr-title">
<$view field="title"/>
</$transclude>
</$link>

View File

@ -1,7 +1,7 @@
caption: {{$:/language/SideBar/Open/Caption}}
created: 20141119223515194
creator: 127.0.0.1
modified: 20141119230318907
modified: 20141127160706002
modifier: 127.0.0.1
tags: $:/tags/SideBar
title: $:/core/ui/SideBar/Open
@ -10,7 +10,7 @@ type: text/vnd.tiddlywiki
\define lingo-base() $:/language/CloseAll/
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" storyview="pop">
<$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}}><$transclude field="caption"><$view field="title"/></$transclude></$link>
<$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}}><$transclude field="fr-title"><$view field="title"/></$transclude></$link>
</$list>

View File

@ -1,6 +1,6 @@
created: 20141119191707140
creator: 127.0.0.1
modified: 20141119223956119
modified: 20141128165607841
modifier: 127.0.0.1
tags: $:/tags/ViewTemplate
title: $:/core/ui/ViewTemplate/title
@ -29,9 +29,9 @@ $:/config/ViewToolbarButtons/Visibility/$(listItem)$
</$list>
<$list filter="[all[current]!prefix[$:/]]">
<h2 class="tc-title">
<$transclude field="caption">
<$view field="fr-title">
<$view field="title"/>
</$transclude>
</$view>
</h2>
</$list>
</div>