mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-24 02:27:19 +00:00
More useful class variables for tiddler status
This commit is contained in:
parent
ccd5eeebfd
commit
ce4a6ffa49
@ -44,7 +44,9 @@ TiddlerWidget.prototype.execute = function() {
|
|||||||
this.tiddlerTitle = this.getAttribute("title","");
|
this.tiddlerTitle = this.getAttribute("title","");
|
||||||
// Set context variables
|
// Set context variables
|
||||||
this.setVariable("tiddlerTitle",this.tiddlerTitle);
|
this.setVariable("tiddlerTitle",this.tiddlerTitle);
|
||||||
this.setVariable("tiddlerMissing",this.wiki.tiddlerExists(this.tiddlerTitle) ? "tw-tiddler-exists" : "tw-tiddler-missing");
|
this.setVariable("missingTiddlerClass",(this.wiki.tiddlerExists(this.tiddlerTitle) || this.wiki.isShadowTiddler(this.tiddlerTitle)) ? "tw-tiddler-exists" : "tw-tiddler-missing");
|
||||||
|
this.setVariable("shadowTiddlerClass",this.wiki.isShadowTiddler(this.tiddlerTitle) ? "tw-tiddler-shadow" : "");
|
||||||
|
this.setVariable("systemTiddlerClass",this.wiki.isSystemTiddler(this.tiddlerTitle) ? "tw-tiddler-system" : "");
|
||||||
// Construct the child widgets
|
// Construct the child widgets
|
||||||
this.makeChildWidgets();
|
this.makeChildWidgets();
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@ title: $:/core/ui/ViewTemplate
|
|||||||
modifier: JeremyRuston
|
modifier: JeremyRuston
|
||||||
|
|
||||||
\define frame-classes()
|
\define frame-classes()
|
||||||
tw-tiddler-frame $(tiddlerMissing)$
|
tw-tiddler-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
|
||||||
\end
|
\end
|
||||||
<div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]]" hackTemplate=true/>
|
<div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]]" hackTemplate=true/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user