1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-07-01 09:33:03 +00:00
This commit is contained in:
Jeremy Ruston 2013-07-05 22:37:55 +01:00
parent 68a87f368a
commit b51fb9cfa9
15 changed files with 21 additions and 20 deletions

View File

@ -198,7 +198,7 @@ var Command = function(params,commander,callback) {
]; ];
if(tiddler) { if(tiddler) {
$tw.utils.each(tiddler.fields,function(field,name) { $tw.utils.each(tiddler.fields,function(field,name) {
var value = tiddler.getFieldString(name) var value = tiddler.getFieldString(name);
if(knownFields.indexOf(name) !== -1) { if(knownFields.indexOf(name) !== -1) {
tiddlerFields[name] = value; tiddlerFields[name] = value;
} else { } else {

View File

@ -20,7 +20,7 @@ exports.backlinks = function(source,operator,options) {
// Function to check an individual title // Function to check an individual title
function checkTiddler(title) { function checkTiddler(title) {
$tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title)); $tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title));
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -29,7 +29,7 @@ exports.field = function(source,operator,options) {
results.push(title); results.push(title);
} }
} }
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -29,7 +29,7 @@ exports.has = function(source,operator,options) {
results.push(title); results.push(title);
} }
} }
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -20,7 +20,7 @@ exports.links = function(source,operator,options) {
// Function to check an individual title // Function to check an individual title
function checkTiddler(title) { function checkTiddler(title) {
$tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title)); $tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title));
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -26,7 +26,7 @@ exports.list = function(source,operator,options) {
if(match) { if(match) {
results.push(title); results.push(title);
} }
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -26,7 +26,7 @@ exports.prefix = function(source,operator,options) {
if(match) { if(match) {
results.push(title); results.push(title);
} }
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -29,7 +29,7 @@ exports.sameday = function(source,operator,options) {
results.push(title); results.push(title);
} }
} }
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -29,7 +29,7 @@ exports.tag = function(source,operator,options) {
results.push(title); results.push(title);
} }
} }
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -20,7 +20,7 @@ exports.tagging = function(source,operator,options) {
// Function to check an individual title // Function to check an individual title
function checkTiddler(title) { function checkTiddler(title) {
$tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title)); $tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title));
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -23,7 +23,7 @@ exports.tags = function(source,operator,options) {
if(tiddler && tiddler.fields.tags) { if(tiddler && tiddler.fields.tags) {
$tw.utils.pushTop(results,tiddler.fields.tags); $tw.utils.pushTop(results,tiddler.fields.tags);
} }
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -29,7 +29,7 @@ exports.title = function(source,operator,options) {
results.push(title); results.push(title);
} }
} }
}; }
// Iterate through the source tiddlers // Iterate through the source tiddlers
if($tw.utils.isArray(source)) { if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) { $tw.utils.each(source,function(title) {

View File

@ -160,7 +160,7 @@ exports.parseMacroParameter = function(source,pos) {
var node = { var node = {
type: "macro-parameter", type: "macro-parameter",
start: pos start: pos
} };
// Define our regexp // Define our regexp
var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^\s>"'=]+)))/g; var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^\s>"'=]+)))/g;
// Skip whitespace // Skip whitespace
@ -197,7 +197,7 @@ exports.parseMacroInvocation = function(source,pos) {
type: "macrocall", type: "macrocall",
start: pos, start: pos,
params: [] params: []
} };
// Define our regexps // Define our regexps
var reMacroName = /([^\s>"'=]+)/g; var reMacroName = /([^\s>"'=]+)/g;
// Skip whitespace // Skip whitespace

View File

@ -122,7 +122,7 @@ exports.parse = function() {
} }
// Consume any whitespace following the list item // Consume any whitespace following the list item
this.parser.skipWhitespace(); this.parser.skipWhitespace();
}; }
// Return the root element of the list // Return the root element of the list
return [listStack[0]]; return [listStack[0]];
}; };

View File

@ -130,14 +130,15 @@ WikiRenderTree.prototype.checkContextRecursion = function(renderer,newContext) {
WikiRenderTree.prototype.getContextScopeId = function(renderer) { WikiRenderTree.prototype.getContextScopeId = function(renderer) {
var guidBits = [], var guidBits = [],
scopeComponents = ["tiddlerTitle","templateTitle"]; scopeComponents = ["tiddlerTitle","templateTitle"],
while(renderer) { processContext = function(field,name) {
if(renderer.context) {
$tw.utils.each(renderer.context,function(field,name) {
if(scopeComponents.indexOf(name) !== -1) { if(scopeComponents.indexOf(name) !== -1) {
guidBits.push(name + ":" + field + ";"); guidBits.push(name + ":" + field + ";");
} }
}); };
while(renderer) {
if(renderer.context) {
$tw.utils.each(renderer.context,processContext);
guidBits.push("-"); guidBits.push("-");
} }
renderer = renderer.parentRenderer; renderer = renderer.parentRenderer;