More improvements to control panel plugin formatting

This commit is contained in:
Jermolene 2014-08-08 17:19:48 +01:00
parent 5e06ef871a
commit 2ff2092615
3 changed files with 17 additions and 15 deletions

View File

@ -56,7 +56,11 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
// Create our element
var domNode = this.document.createElement("a");
// Assign classes
var classes = ["tw-tiddlylink"];
var classes = [];
if(this.linkClasses) {
classes.push(this.linkClasses);
}
classes.push("tw-tiddlylink");
if(this.isShadow) {
classes.push("tw-tiddlylink-shadow");
}
@ -182,6 +186,8 @@ LinkWidget.prototype.execute = function() {
// Get the link title and aria label
this.tooltip = this.getAttribute("tooltip");
this["aria-label"] = this.getAttribute("aria-label");
// Get the link classes
this.linkClasses = this.getAttribute("class");
// Determine the link characteristics
this.isMissing = !this.wiki.tiddlerExists(this.to);
this.isShadow = this.wiki.isShadowTiddler(this.to);

View File

@ -16,8 +16,8 @@ $(currentTiddler)$/icon
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
<$list filter="[!has[draft.of]plugin-type[$type$]sort[description]]">
<$set name="popup-state" value=<<popup-state-macro>>>
<div class="tw-plugin-info">
<div class="tw-plugin-info-dropdown-button">
<$link to={{!!title}} class="tw-plugin-info">
<div class="tw-plugin-info-chunk">
<$reveal type="nomatch" state=<<popup-state>> text="yes">
<$button class="btn-invisible btn-dropdown" set=<<popup-state>> setTo="yes">
{{$:/core/images/right-arrow}}
@ -29,14 +29,12 @@ $(currentTiddler)$/icon
</$button>
</$reveal>
</div>
<$link to={{!!title}} class="tw-plugin-info-link">
<div>
<div style="display:inline-block;vertical-align:middle;">
<div class="tw-plugin-info-chunk">
<$transclude tiddler=<<currentTiddler>> subtiddler=<<plugin-icon-title>>>
<$transclude tiddler="$:/core/images/plugin-generic-$type$"/>
</$transclude>
</div>
<div style="display:inline-block;vertical-align:middle;">
<div class="tw-plugin-info-chunk">
<div>
''<$view field="description"><$view field="title"/></$view>''
</div>
@ -47,7 +45,6 @@ $(currentTiddler)$/icon
<$view field="version"/>
</div>
</div>
</div>
</$link>
<$reveal type="match" text="yes" state=<<popup-state>>>
<$reveal type="nomatch" text="" state="!!list">
@ -61,7 +58,6 @@ No information provided
</div>
</$reveal>
</$reveal>
</div>
</$set>
</$list>
</$set>

View File

@ -1239,20 +1239,20 @@ canvas.tw-edit-bitmapeditor {
}
.tw-plugin-info {
display: block;
border: 1px solid <<colour muted-foreground>>;
margin: 1em 0 1em 0;
padding: 8px;
}
.tw-plugin-info-chunk {
display: inline-block;
vertical-align: middle;
}
.tw-plugin-info img, .tw-plugin-info svg {
width: 3em;
height: 3em;
}
.tw-plugin-info .tw-plugin-info-dropdown-button,
.tw-plugin-info .tw-tiddlylink {
display: inline-block;
vertical-align: middle;
}
/*