1
0
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:
Jeremy Ruston 2013-10-13 22:46:45 +01:00
parent ccd5eeebfd
commit ce4a6ffa49
2 changed files with 4 additions and 2 deletions

View File

@ -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();
};

View File

@ -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>