More useful class variables for tiddler status

print-window-tiddler
Jeremy Ruston 2013-10-13 22:46:45 +01:00
rodzic ccd5eeebfd
commit ce4a6ffa49
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

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

Wyświetl plik

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