diff --git a/js/Main.js b/js/Main.js index 015fb8f8f..95f003b3f 100644 --- a/js/Main.js +++ b/js/Main.js @@ -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, diff --git a/js/Navigators.js b/js/Navigators.js index 87d4d9ef8..f5193f176 100644 --- a/js/Navigators.js +++ b/js/Navigators.js @@ -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) { diff --git a/js/Recipe.js b/js/Recipe.js index 7509d36ad..8c4161faf 100755 --- a/js/Recipe.js +++ b/js/Recipe.js @@ -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(""); } } diff --git a/js/StoryNavigator.js b/js/StoryNavigator.js index 8b9b2b690..c8d229ff5 100644 --- a/js/StoryNavigator.js +++ b/js/StoryNavigator.js @@ -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) { - $("
").html(tiddlerHtml).appendTo("body"); + $("
").html(tiddlerHtml).appendTo("body"); return false; } else { return true; } -} +}; exports.StoryNavigator = StoryNavigator; diff --git a/js/Tiddler.js b/js/Tiddler.js index 627378bfc..616bfc37d 100755 --- a/js/Tiddler.js +++ b/js/Tiddler.js @@ -58,7 +58,7 @@ Tiddler.standardFields = { tags: { type: "tags"}, type: { type: "string"}, text: { type: "string"} -} +}; Tiddler.isStandardField = function(name) { return name in Tiddler.standardFields; diff --git a/js/WikiStore.js b/js/WikiStore.js index b7da6a086..8f74fe911 100755 --- a/js/WikiStore.js +++ b/js/WikiStore.js @@ -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; }