mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-02 16:43:00 +00:00
Lots of improvements to the plugin library
* Moved “add new plugin” into a modal wizard * Adopt big friendly buttons * Add plugin icons and readmes to “add new plugin” modal * Use tabs for splitting plugins/themes/languages * Consistent styling between the “add new plugin” modal and the “installed plugins” control panel tab * Behind the scenes, moved from addressing the library as `recipes/defaults/tiddlers/<etc>` to `recipes/library/tiddlers<etc>`
This commit is contained in:
@@ -1,88 +0,0 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Add
|
||||
tags: $:/tags/ControlPanel/Plugins
|
||||
caption: {{$:/language/ControlPanel/Plugins/Add/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Plugins/
|
||||
|
||||
\define install-plugin-button()
|
||||
<$button>
|
||||
<$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/>
|
||||
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion" emptyMessage="""install""">
|
||||
reinstall
|
||||
</$list>
|
||||
</$button>
|
||||
\end
|
||||
|
||||
\define display-plugin-info()
|
||||
<tr>
|
||||
<td>
|
||||
<<install-plugin-button>>
|
||||
<br>
|
||||
</td>
|
||||
<td>
|
||||
''<$view tiddler=<<assetInfo>> field="description"/>''
|
||||
<br>
|
||||
<$view tiddler=<<assetInfo>> field="original-title"/>
|
||||
</td>
|
||||
<td>
|
||||
<$view tiddler=<<assetInfo>> field="version"/>
|
||||
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion">
|
||||
<br>
|
||||
<em>
|
||||
Installed:
|
||||
<br>
|
||||
<$text text=<<installedVersion>>/>
|
||||
</em>
|
||||
</$list>
|
||||
</td>
|
||||
</tr>
|
||||
\end
|
||||
|
||||
\define load-plugin-library-button()
|
||||
<$button>
|
||||
<$action-sendmessage $message="tm-load-plugin-library" url={{!!url}} infoTitlePrefix="$:/temp/RemoteAssetInfo/"/>
|
||||
open plugin library
|
||||
</$button>
|
||||
\end
|
||||
|
||||
\define display-server-connection()
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/ServerConnection]suffix{!!url}]" variable="connectionTiddler" emptyMessage=<<load-plugin-library-button>>>
|
||||
|
||||
Search: <$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input" focus="true"/>
|
||||
<$select tiddler="$:/temp/RemoteAssetCategory/$(currentTiddler)$" default="plugin">
|
||||
<option value="plugin">Plugins</option>
|
||||
<option value="theme">Themes</option>
|
||||
<option value="language">Languages</option>
|
||||
</$select>
|
||||
|
||||
<$set name="pluginType" filter="[[$:/temp/RemoteAssetCategory/$(currentTiddler)$]is[tiddler]]" value={{$:/temp/RemoteAssetCategory/$(currentTiddler)$}} emptyValue="plugin">
|
||||
<table class="tc-plugin-library-listing">
|
||||
<tbody>
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type<pluginType>search{$:/temp/RemoteAssetSearch/$(currentTiddler)$}sort[description]]" variable="assetInfo">
|
||||
<<display-plugin-info>>
|
||||
</$list>
|
||||
</tbody>
|
||||
</table>
|
||||
</$set>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define plugin-library-listing()
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/PluginLibrary]]">
|
||||
<div class="tc-plugin-library">
|
||||
|
||||
!! <$link><$transclude field="caption"><$view field="title"/></$transclude></$link>
|
||||
|
||||
//<$view field="url"/>//
|
||||
|
||||
<$transclude/>
|
||||
|
||||
<<display-server-connection>>
|
||||
</div>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
<div>
|
||||
<<plugin-library-listing>>
|
||||
</div>
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Installed
|
||||
tags: $:/tags/ControlPanel/Plugins
|
||||
caption: {{$:/language/ControlPanel/Plugins/Installed/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-disable-title()
|
||||
$:/config/Plugins/Disabled/$(currentTiddler)$
|
||||
\end
|
||||
\define plugin-table-body(type,disabledMessage)
|
||||
<div class="tc-plugin-info-chunk">
|
||||
<$reveal type="nomatch" state=<<popup-state>> text="yes">
|
||||
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<popup-state>> setTo="yes">
|
||||
{{$:/core/images/right-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<popup-state>> text="yes">
|
||||
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<popup-state>> setTo="no">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
</div>
|
||||
<div class="tc-plugin-info-chunk">
|
||||
<$transclude tiddler=<<currentTiddler>> subtiddler=<<plugin-icon-title>>>
|
||||
<$transclude tiddler="$:/core/images/plugin-generic-$type$"/>
|
||||
</$transclude>
|
||||
</div>
|
||||
<div class="tc-plugin-info-chunk">
|
||||
<div>
|
||||
''<$view field="description"><$view field="title"/></$view>'' $disabledMessage$
|
||||
</div>
|
||||
<div>
|
||||
<$view field="title"/>
|
||||
</div>
|
||||
<div>
|
||||
<$view field="version"/>
|
||||
</div>
|
||||
</div>
|
||||
\end
|
||||
\define plugin-table(type)
|
||||
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
|
||||
<$list filter="[!has[draft.of]plugin-type[$type$]sort[description]]" emptyMessage=<<lingo "Empty/Hint">>>
|
||||
<$set name="popup-state" value=<<popup-state-macro>>>
|
||||
<$reveal type="nomatch" state=<<plugin-disable-title>> text="yes">
|
||||
<$link to={{!!title}} class="tc-plugin-info">
|
||||
<<plugin-table-body type:"$type$">>
|
||||
</$link>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<plugin-disable-title>> text="yes">
|
||||
<$link to={{!!title}} class="tc-plugin-info tc-plugin-info-disabled">
|
||||
<<plugin-table-body type:"$type$" disabledMessage:"<$macrocall $name='lingo' title='Disabled/Status'/>">>
|
||||
</$link>
|
||||
</$reveal>
|
||||
<$reveal type="match" text="yes" state=<<popup-state>>>
|
||||
<div class="tc-plugin-info-dropdown">
|
||||
<$list filter="[all[current]] -[[$:/core]]">
|
||||
<div style="float:right;">
|
||||
<$reveal type="nomatch" state=<<plugin-disable-title>> text="yes">
|
||||
<$button set=<<plugin-disable-title>> setTo="yes" tooltip={{$:/language/ControlPanel/Plugins/Disable/Hint}} aria-label={{$:/language/ControlPanel/Plugins/Disable/Caption}}>
|
||||
<<lingo Disable/Caption>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<plugin-disable-title>> text="yes">
|
||||
<$button set=<<plugin-disable-title>> setTo="no" tooltip={{$:/language/ControlPanel/Plugins/Enable/Hint}} aria-label={{$:/language/ControlPanel/Plugins/Enable/Caption}}>
|
||||
<<lingo Enable/Caption>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
</div>
|
||||
</$list>
|
||||
<$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">
|
||||
No information provided
|
||||
</$reveal>
|
||||
</div>
|
||||
</$reveal>
|
||||
</$set>
|
||||
</$list>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
! <<lingo Plugin/Prompt>>
|
||||
|
||||
<<plugin-table plugin>>
|
||||
|
||||
! <<lingo Theme/Prompt>>
|
||||
|
||||
<<plugin-table theme>>
|
||||
|
||||
! <<lingo Language/Prompt>>
|
||||
|
||||
<<plugin-table language>>
|
||||
116
core/ui/ControlPanel/Modals/AddPlugins.tid
Normal file
116
core/ui/ControlPanel/Modals/AddPlugins.tid
Normal file
@@ -0,0 +1,116 @@
|
||||
title: $:/core/ui/ControlPanel/Modals/AddPlugins
|
||||
subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/Add/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Plugins/
|
||||
|
||||
\define install-plugin-button()
|
||||
<$button>
|
||||
<$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/>
|
||||
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion" emptyMessage="""install""">
|
||||
reinstall
|
||||
</$list>
|
||||
</$button>
|
||||
\end
|
||||
|
||||
\define popup-state-macro()
|
||||
$:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
|
||||
\end
|
||||
|
||||
\define display-plugin-info(type)
|
||||
<$set name="popup-state" value=<<popup-state-macro>>>
|
||||
<div class="tc-plugin-info">
|
||||
<div class="tc-plugin-info-chunk tc-small-icon">
|
||||
<$reveal type="nomatch" state=<<popup-state>> text="yes">
|
||||
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<popup-state>> setTo="yes">
|
||||
{{$:/core/images/right-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<popup-state>> text="yes">
|
||||
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<popup-state>> setTo="no">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
</div>
|
||||
<div class="tc-plugin-info-chunk">
|
||||
<$list filter="[<assetInfo>has[icon]]" emptyMessage="""<$transclude tiddler="$:/core/images/plugin-generic-$type$"/>""">
|
||||
<img src={{$(assetInfo)$!!icon}}/>
|
||||
</$list>
|
||||
</div>
|
||||
<div class="tc-plugin-info-chunk">
|
||||
<h1><$view tiddler=<<assetInfo>> field="description"/></h1>
|
||||
<h2><$view tiddler=<<assetInfo>> field="original-title"/></h2>
|
||||
<div><em><$view tiddler=<<assetInfo>> field="version"/></em></div>
|
||||
</div>
|
||||
<div class="tc-plugin-info-chunk">
|
||||
<<install-plugin-button>>
|
||||
</div>
|
||||
</div>
|
||||
<$reveal type="match" text="yes" state=<<popup-state>>>
|
||||
<div class="tc-plugin-info-dropdown">
|
||||
<div class="tc-plugin-info-dropdown-message">
|
||||
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion" emptyMessage="""This plugin is not currently installed""">
|
||||
<em>
|
||||
This plugin is already installed at version <$text text=<<installedVersion>>/>
|
||||
</em>
|
||||
</$list>
|
||||
</div>
|
||||
<div class="tc-plugin-info-dropdown-body">
|
||||
<$transclude tiddler=<<assetInfo>> field="readme" mode="block"/>
|
||||
</div>
|
||||
</div>
|
||||
</$reveal>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
\define load-plugin-library-button()
|
||||
<$button class="tc-btn-big-green">
|
||||
<$action-sendmessage $message="tm-load-plugin-library" url={{!!url}} infoTitlePrefix="$:/temp/RemoteAssetInfo/"/>
|
||||
{{$:/core/images/chevron-right}} open plugin library
|
||||
</$button>
|
||||
\end
|
||||
|
||||
\define display-server-assets(type)
|
||||
Search: <$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input" focus="true"/>
|
||||
<$reveal state="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" type="nomatch" text="">
|
||||
<$button class="tc-btn-invisible">
|
||||
<$action-setfield $tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" $field="text" $value=""/>
|
||||
{{$:/core/images/close-button}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
<div class="tc-plugin-library-listing">
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[$type$]search{$:/temp/RemoteAssetSearch/$(currentTiddler)$}sort[description]]" variable="assetInfo">
|
||||
<<display-plugin-info "$type$">>
|
||||
</$list>
|
||||
</div>
|
||||
\end
|
||||
|
||||
\define display-server-connection()
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/ServerConnection]suffix{!!url}]" variable="connectionTiddler" emptyMessage=<<load-plugin-library-button>>>
|
||||
|
||||
<<tabs "[[$:/core/ui/ControlPanel/Plugins/Add/Plugins]] [[$:/core/ui/ControlPanel/Plugins/Add/Themes]] [[$:/core/ui/ControlPanel/Plugins/Add/Languages]]" "$:/core/ui/ControlPanel/Plugins/Add/Plugins">>
|
||||
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define plugin-library-listing()
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/PluginLibrary]]">
|
||||
<div class="tc-plugin-library">
|
||||
|
||||
!! <$link><$transclude field="caption"><$view field="title"/></$transclude></$link>
|
||||
|
||||
//<$view field="url"/>//
|
||||
|
||||
<$transclude/>
|
||||
|
||||
<<display-server-connection>>
|
||||
</div>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
|
||||
|
||||
<div>
|
||||
<<plugin-library-listing>>
|
||||
</div>
|
||||
|
||||
</$importvariables>
|
||||
@@ -1,7 +0,0 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins
|
||||
tags: $:/tags/ControlPanel
|
||||
caption: {{$:/language/ControlPanel/Plugins/Caption}}
|
||||
|
||||
<div class="tc-control-panel">
|
||||
<<tabs "[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Plugins]!has[draft.of]]" "$:/core/ui/ControlPanel/Plugins/Installed">>
|
||||
</div>
|
||||
4
core/ui/ControlPanel/Plugins/Add/Languages.tid
Normal file
4
core/ui/ControlPanel/Plugins/Add/Languages.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Add/Languages
|
||||
caption: {{$:/language/ControlPanel/Plugins/Languages/Caption}} (<$count filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[language]]"/>)
|
||||
|
||||
<<display-server-assets language>>
|
||||
4
core/ui/ControlPanel/Plugins/Add/Plugins.tid
Normal file
4
core/ui/ControlPanel/Plugins/Add/Plugins.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Add/Plugins
|
||||
caption: {{$:/language/ControlPanel/Plugins/Plugins/Caption}} (<$count filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[plugin]]"/>)
|
||||
|
||||
<<display-server-assets plugin>>
|
||||
4
core/ui/ControlPanel/Plugins/Add/Themes.tid
Normal file
4
core/ui/ControlPanel/Plugins/Add/Themes.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Add/Themes
|
||||
caption: {{$:/language/ControlPanel/Plugins/Themes/Caption}} (<$count filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}original-plugin-type[theme]]"/>)
|
||||
|
||||
<<display-server-assets theme>>
|
||||
4
core/ui/ControlPanel/Plugins/Installed/Languages.tid
Normal file
4
core/ui/ControlPanel/Plugins/Installed/Languages.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Installed/Languages
|
||||
caption: {{$:/language/ControlPanel/Plugins/Languages/Caption}} (<$count filter="[!has[draft.of]plugin-type[language]]"/>)
|
||||
|
||||
<<plugin-table language>>
|
||||
4
core/ui/ControlPanel/Plugins/Installed/Plugins.tid
Normal file
4
core/ui/ControlPanel/Plugins/Installed/Plugins.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Installed/Plugins
|
||||
caption: {{$:/language/ControlPanel/Plugins/Plugins/Caption}} (<$count filter="[!has[draft.of]plugin-type[plugin]]"/>)
|
||||
|
||||
<<plugin-table plugin>>
|
||||
4
core/ui/ControlPanel/Plugins/Installed/Themes.tid
Normal file
4
core/ui/ControlPanel/Plugins/Installed/Themes.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Installed/Themes
|
||||
caption: {{$:/language/ControlPanel/Plugins/Themes/Caption}} (<$count filter="[!has[draft.of]plugin-type[theme]]"/>)
|
||||
|
||||
<<plugin-table theme>>
|
||||
Reference in New Issue
Block a user