Refactored parameter names for renderTiddler()

print-window-tiddler
Jeremy Ruston 2012-01-14 17:24:07 +00:00
rodzic b26bf8e278
commit 7c4d5b76ef
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -340,18 +340,18 @@ Render a tiddler to a particular MIME type. Optionally render it with a differen
as the context. This option is used to render a tiddler through a template eg as the context. This option is used to render a tiddler through a template eg
store.renderTiddler("text/html",templateTitle,tiddlerTitle) store.renderTiddler("text/html",templateTitle,tiddlerTitle)
*/ */
WikiStore.prototype.renderTiddler = function(type,title,asTitle) { WikiStore.prototype.renderTiddler = function(targetType,title,asTitle) {
var tiddler = this.getTiddler(title), var tiddler = this.getTiddler(title),
fn = this.compileTiddler(title,type); fn = this.compileTiddler(title,targetType);
if(tiddler) { if(tiddler) {
if(asTitle) { if(asTitle) {
var asTiddler = this.getTiddler(asTitle); var asTiddler = this.getTiddler(asTitle);
return fn(asTiddler,this,utils); return fn(asTiddler,this,utils);
} else { } else {
if(!tiddler.renditions[type]) { if(!tiddler.renditions[targetType]) {
tiddler.renditions[type] = fn(tiddler,this,utils); tiddler.renditions[targetType] = fn(tiddler,this,utils);
} }
return tiddler.renditions[type]; return tiddler.renditions[targetType];
} }
} }
return null; return null;