1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Extend control panel plugins tab

Now we display plugin icons, and an accordion containing information
tabs exposed by the plugin.
This commit is contained in:
Jermolene 2014-08-07 15:48:38 +01:00
parent c5b941dc1a
commit 2c4e9a64e9
2 changed files with 56 additions and 0 deletions

View File

@ -3,11 +3,24 @@ tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Plugins/Caption}}
\define lingo-base() $:/language/ControlPanel/Plugins/
\define popup-state-macro()
$(qualified-state)$-$(currentTiddler)$
\end
\define tabs-state-macro()
$(popup-state)$-$(pluginInfoType)$
\end
\define plugin-icon-title()
$(currentTiddler)$/icon
\end
\define plugin-table(type)
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
<table>
<tbody>
<tr>
<th>
&nbsp;
</th>
<th>
<<lingo Fields/Description>>
</th>
<th>
@ -15,9 +28,23 @@ caption: {{$:/language/ControlPanel/Plugins/Caption}}
</th>
</tr>
<$list filter="[!has[draft.of]plugin-type[$type$]sort[description]]">
<$set name="popup-state" value=<<popup-state-macro>>>
<tr>
<td>
<$reveal type="nomatch" state=<<popup-state>> text="yes">
<$button class="btn-invisible btn-dropdown" set=<<popup-state>> setTo="yes">
{{$:/core/images/right-arrow}}
</$button>
</$reveal>
<$reveal type="match" state=<<popup-state>> text="yes">
<$button class="btn-invisible btn-dropdown" set=<<popup-state>> setTo="no">
{{$:/core/images/down-arrow}}
</$button>
</$reveal>
</td>
<td>
<$link to={{!!title}}>
<$transclude tiddler=<<currentTiddler>> subtiddler=<<plugin-icon-title>>/>
''<$view field="description"><$view field="title"/></$view>''<br>
<$view field="title"/>
</$link>
@ -26,9 +53,23 @@ caption: {{$:/language/ControlPanel/Plugins/Caption}}
<$view field="version"/>
</td>
</tr>
<tr>
<td colspan="3">
<$reveal type="match" text="yes" state=<<popup-state>>>
<$reveal type="nomatch" text="" state="!!list">
<$macrocall $name="tabs" state=<<tabs-state-macro>> tabsList={{!!list}} default="readme" template="$:/core/ui/PluginInfo"/>
</$reveal>
<$reveal type="match" text="" state="!!list">
<$transclude tiddler="$:/core/ui/TiddlerInfo/Advanced/PluginInfo"/>
</$reveal>
</$reveal>
</td>
</tr>
</$set>
</$list>
</tbody>
</table>
</$set>
\end
! <<lingo Plugin/Prompt>>

15
core/ui/PluginInfo.tid Normal file
View File

@ -0,0 +1,15 @@
title: $:/core/ui/PluginInfo
\define localised-info-tiddler-title()
$(currentTiddler)$/$(languageTitle)$/$(currentTab)$
\end
\define info-tiddler-title()
$(currentTiddler)$/$(currentTab)$
\end
<$transclude tiddler=<<localised-info-tiddler-title>> mode="block">
<$transclude tiddler=<<currentTiddler>> subtiddler=<<localised-info-tiddler-title>> mode="block">
<$transclude tiddler=<<currentTiddler>> subtiddler=<<info-tiddler-title>> mode="block">
No ''"<$text text=<<currentTab>>/>"'' found
</$transclude>
</$transclude>
</$transclude>