mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +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","");
|
||||
// Set context variables
|
||||
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
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ title: $:/core/ui/ViewTemplate
|
||||
modifier: JeremyRuston
|
||||
|
||||
\define frame-classes()
|
||||
tw-tiddler-frame $(tiddlerMissing)$
|
||||
tw-tiddler-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
|
||||
\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>
|
||||
|
Loading…
Reference in New Issue
Block a user