mirror of
https://gitlab.com/octtspacc/OcttKB
synced 2025-06-06 00:29:12 +02:00
[Manual] Add scripts and raw wiki
This commit is contained in:
65
Wiki/tiddlers/$__core_macros_tabs.tid
Normal file
65
Wiki/tiddlers/$__core_macros_tabs.tid
Normal file
@@ -0,0 +1,65 @@
|
||||
code-body: yes
|
||||
created: 20220922134412096
|
||||
modified: 20220922135318874
|
||||
tags: $:/tags/Macro
|
||||
title: $:/core/macros/tabs
|
||||
|
||||
\define tabs-button()
|
||||
\whitespace trim
|
||||
<$button set=<<tabsState>> setTo=<<currentTab>> default=<<__default__>> selectedClass="tc-tab-selected" tooltip={{!!tooltip}} role="switch">
|
||||
<$tiddler tiddler=<<save-currentTiddler>>>
|
||||
<$set name="tv-wikilinks" value="no">
|
||||
<$transclude tiddler=<<__buttonTemplate__>> mode="inline">
|
||||
<$transclude tiddler=<<currentTab>> field="caption">
|
||||
<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
|
||||
</$transclude>
|
||||
</$transclude>
|
||||
</$set>
|
||||
</$tiddler>
|
||||
<<__actions__>>
|
||||
</$button>
|
||||
\end
|
||||
|
||||
\define tabs-tab()
|
||||
\whitespace trim
|
||||
<$set name="save-currentTiddler" value=<<currentTiddler>>>
|
||||
<$tiddler tiddler=<<currentTab>>>
|
||||
<<tabs-button>>
|
||||
</$tiddler>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
\define tabs-tab-list()
|
||||
\whitespace trim
|
||||
<$list filter=<<__tabsList__>> variable="currentTab" storyview="pop">
|
||||
<<tabs-tab>>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define tabs-tab-body()
|
||||
\whitespace trim
|
||||
<$list filter=<<__tabsList__>> variable="currentTab">
|
||||
<$reveal type="match" state=<<tabsState>> text=<<currentTab>> default=<<__default__>> retain=<<__retain__>> tag="div">
|
||||
<$transclude tiddler=<<__template__>> mode="block">
|
||||
<$transclude tiddler=<<currentTab>> mode="block"/>
|
||||
</$transclude>
|
||||
</$reveal>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define tabs(tabsList,default,state:"$:/state/tab",class,template,buttonTemplate,retain,actions,explicitState)
|
||||
\whitespace trim
|
||||
<$qualify title=<<__state__>> name="qualifiedState">
|
||||
<$let tabsState={{{ [<__explicitState__>minlength[1]] ~[<qualifiedState>] }}}>
|
||||
<div class={{{ [[tc-tab-set]addsuffix[ ]addsuffix<__class__>] }}}>
|
||||
<div class={{{ [[tc-tab-buttons]addsuffix[ ]addsuffix<__class__>] }}}>
|
||||
<<tabs-tab-list>>
|
||||
</div>
|
||||
<div class={{{ [[tc-tab-divider]addsuffix[ ]addsuffix<__class__>] }}}/>
|
||||
<div class={{{ [[tc-tab-content]addsuffix[ ]addsuffix<__class__>] }}}>
|
||||
<<tabs-tab-body>>
|
||||
</div>
|
||||
</div>
|
||||
</$let>
|
||||
</$qualify>
|
||||
\end
|
Reference in New Issue
Block a user