JSHint makes a hard task master...

print-window-tiddler
Jeremy Ruston 2011-12-14 14:11:11 +00:00
rodzic 5d16050e24
commit 00f8021749
6 zmienionych plików z 13 dodań i 10 usunięć

Wyświetl plik

@ -6,7 +6,7 @@ This is the main() function in the browser
\*/
(function(){
/*jslint node: true */
/*jslint node: true, browser: true */
"use strict";
var WikiStore = require("./WikiStore.js").WikiStore,

Wyświetl plik

@ -31,7 +31,7 @@ Navigators.prototype.install = function(selector,navname) {
this.document.addEventListener("click",function(e) {
var el = e.target,
matchesSelector = el.matchesSelector || el.mozMatchesSelector ||
el.webkitMatchesSelector || el.oMatchesSelector || el.msMatchesSelector
el.webkitMatchesSelector || el.oMatchesSelector || el.msMatchesSelector;
if(matchesSelector && matchesSelector.call(el,selector)) {
var r = nav.navigateTo(el.getAttribute("href"));
if(!r) {

Wyświetl plik

@ -281,7 +281,7 @@ Recipe.tiddlerOutputter = {
out.push("<" + "script type=\"application/javascript\">");
out.push("define(\"" + title + "\",function(require,exports) {");
out.push(tid.fields.text);
out.push("});")
out.push("});");
out.push("</" + "script>");
}
}

Wyświetl plik

@ -6,22 +6,22 @@ This browser component manages navigating to new tiddlers in a TiddlyWiki classi
\*/
(function(){
/*jslint node: true */
/*jslint node: true, jquery: true */
"use strict";
var StoryNavigator = function(navigators) {
this.navigators = navigators;
}
};
StoryNavigator.prototype.navigateTo = function(title) {
var tiddlerHtml = this.navigators.store.renderTiddler("text/html",title);
if(tiddlerHtml) {
$("<div/>").html(tiddlerHtml).appendTo("body");
$("<article/>").html(tiddlerHtml).appendTo("body");
return false;
} else {
return true;
}
}
};
exports.StoryNavigator = StoryNavigator;

Wyświetl plik

@ -58,7 +58,7 @@ Tiddler.standardFields = {
tags: { type: "tags"},
type: { type: "string"},
text: { type: "string"}
}
};
Tiddler.isStandardField = function(name) {
return name in Tiddler.standardFields;

Wyświetl plik

@ -97,10 +97,13 @@ WikiStore.prototype.parseTiddler = function(title) {
}
};
WikiStore.prototype.renderTiddler = function(type,title) {
/*
Render a tiddler to a particular MIME type. Optionally render it with a different tiddler as the context. This option is used to render a tiddler through a template as store.renderTiddler("text/html",tiddler,template)
*/
WikiStore.prototype.renderTiddler = function(type,title,asTitle) {
var parser = this.parseTiddler(title);
if(parser) {
return parser.render(type,parser.children,this,title);
return parser.render(type,parser.children,this,asTitle ? asTitle : title);
} else {
return null;
}