First pass at refactoring filter execution

This is the beginning of addressing #523.
print-window-tiddler
Jermolene 2014-04-03 20:49:16 +01:00
rodzic 14f90b9519
commit b7f674c51a
96 zmienionych plików z 536 dodań i 669 usunięć

Wyświetl plik

@ -3,7 +3,7 @@ title: $:/core/modules/filters.js
type: application/javascript
module-type: wikimethod
Adds tiddler filtering to the $tw.Wiki object.
Adds tiddler filtering methods to the $tw.Wiki object.
\*/
(function(){
@ -149,11 +149,16 @@ exports.getFilterOperators = function() {
return this.filterOperators;
};
exports.filterTiddlers = function(filterString,currTiddlerTitle,tiddlerList) {
exports.filterTiddlers = function(filterString,currTiddlerTitle,source) {
var fn = this.compileFilter(filterString);
return fn.call(this,tiddlerList,currTiddlerTitle);
return fn.call(this,source,currTiddlerTitle);
};
/*
Compile a filter into a function with the signature fn(source,currTiddlerTitle) where:
source: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)
currTiddlerTitle: the optional name of the current tiddler
*/
exports.compileFilter = function(filterString) {
var filterParseTree;
try {
@ -175,10 +180,15 @@ exports.compileFilter = function(filterString) {
var accumulator = source,
results = [];
$tw.utils.each(operation.operators,function(operator) {
var operatorFunction = filterOperators[operator.operator] || filterOperators.field || function(source,operator,operations) {
return ["Filter Error: unknown operator '" + operator.operator + "'"];
},
operand = operator.operand;
var operand = operator.operand,
operatorFunction;
if(!operator.operator) {
operatorFunction = filterOperators.title;
} else if(!filterOperators[operator.operator]) {
operatorFunction = filterOperators.field;
} else {
operatorFunction = filterOperators[operator.operator];
}
if(operator.indirect) {
operand = self.getTextReference(operator.operand,"",currTiddlerTitle);
}
@ -192,7 +202,7 @@ exports.compileFilter = function(filterString) {
wiki: self,
currTiddlerTitle: currTiddlerTitle
});
accumulator = results;
accumulator = self.makeTiddlerIterator(results);
});
return results;
};
@ -210,16 +220,20 @@ exports.compileFilter = function(filterString) {
case "+": // This operation is applied to the main results so far
return function(results,source,currTiddlerTitle) {
// This replaces all the elements of the array, but keeps the actual array so that references to it are preserved
source = results.slice(0);
source = self.makeTiddlerIterator(results);
results.splice(0,results.length);
$tw.utils.pushTop(results,operationSubFunction(source,currTiddlerTitle));
};
}
})());
});
// Return a function that applies the operations to a source array/hashmap of tiddler titles
// Return a function that applies the operations to a source iterator of tiddler titles
return $tw.perf.measure("filter",function filterFunction(source,currTiddlerTitle) {
source = source || self.getAllTitles();
if(!source) {
source = self.each;
} else if(typeof source === "object") { // Array or hashmap
source = self.makeTiddlerIterator(source);
}
var results = [];
$tw.utils.each(operationFunctions,function(operationFunction) {
operationFunction(results,source,currTiddlerTitle);

Wyświetl plik

@ -0,0 +1,45 @@
/*\
title: $:/core/modules/filters/all.js
type: application/javascript
module-type: filteroperator
Filter operator for selecting tiddlers
[all[tiddlers+shadows]]
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var allFilterOperators;
function getAllFilterOperators() {
if(!allFilterOperators) {
allFilterOperators = {};
$tw.modules.applyMethods("allfilteroperator",allFilterOperators);
}
return allFilterOperators;
}
/*
Export our filter function
*/
exports.all = function(source,operator,options) {
// Get our suboperators
var allFilterOperators = getAllFilterOperators();
// Cycle through the suboperators accumulating their results
var results = [],
subops = operator.operand.split("+");
for(var t=0; t<subops.length; t++) {
var subop = allFilterOperators[subops[t]];
if(subop) {
$tw.utils.pushTop(results,subop(source,operator.prefix,options));
}
}
return results;
};
})();

Wyświetl plik

@ -0,0 +1,26 @@
/*\
title: $:/core/modules/filters/all/current.js
type: application/javascript
module-type: allfilteroperator
Filter function for [all[current]]
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.current = function(source,prefix,options) {
if(options.currTiddlerTitle) {
return [options.currTiddlerTitle];
} else {
return [];
}
};
})();

Wyświetl plik

@ -0,0 +1,22 @@
/*\
title: $:/core/modules/filters/all/missing.js
type: application/javascript
module-type: allfilteroperator
Filter function for [all[missing]]
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.missing = function(source,prefix,options) {
return options.wiki.getMissingTitles();
};
})();

Wyświetl plik

@ -0,0 +1,22 @@
/*\
title: $:/core/modules/filters/all/orphans.js
type: application/javascript
module-type: allfilteroperator
Filter function for [all[orphans]]
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.orphans = function(source,prefix,options) {
return options.wiki.getOrphanTitles();
};
})();

Wyświetl plik

@ -0,0 +1,26 @@
/*\
title: $:/core/modules/filters/all/shadows.js
type: application/javascript
module-type: allfilteroperator
Filter function for [all[shadows]]
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.shadows = function(source,prefix,options) {
var results = [];
options.wiki.eachShadow(function(tiddler,title) {
results.push(title);
});
return results;
};
})();

Wyświetl plik

@ -0,0 +1,26 @@
/*\
title: $:/core/modules/filters/all/tiddlers.js
type: application/javascript
module-type: allfilteroperator
Filter function for [all[tiddlers]]
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.tiddlers = function(source,prefix,options) {
var results = [];
options.wiki.each(function(tiddler,title) {
results.push(title);
});
return results;
};
})();

Wyświetl plik

@ -17,20 +17,9 @@ Export our filter function
*/
exports.backlinks = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
source(function(tiddler,title) {
$tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title));
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -16,18 +16,9 @@ Filter operator that selects one tiddler for each unique value of the specified
Export our filter function
*/
exports.each = function(source,operator,options) {
// Convert the source to an array if necessary
if(!$tw.utils.isArray(source)) {
var copy = [];
$tw.utils.each(source,function(element,title) {
copy.push(title);
});
source = copy;
}
// Collect up the first tiddler with each unique value of the specified field
var results = [],values = {};
$tw.utils.each(source,function(title) {
var tiddler = options.wiki.getTiddler(title);
var results = [],
values = {};
source(function(tiddler,title) {
if(tiddler) {
var value = tiddler.getFieldString(operator.operand);
if(!$tw.utils.hop(values,value)) {

Wyświetl plik

@ -16,23 +16,14 @@ Filter operator that selects one tiddler for each unique day covered by the spec
Export our filter function
*/
exports.eachday = function(source,operator,options) {
var results = [],
values = [];
// Function to convert a date/time to a date integer
var toDate = function(value) {
value = (new Date(value)).setHours(0,0,0,0);
return value+0;
};
// Convert the source to an array if necessary
if(!$tw.utils.isArray(source)) {
var copy = [];
$tw.utils.each(source,function(element,title) {
copy.push(title);
});
source = copy;
}
// Collect up the first tiddler with each unique day value of the specified field
var results = [],values = [];
$tw.utils.each(source,function(title) {
var tiddler = options.wiki.getTiddler(title);
source(function(tiddler,title) {
if(tiddler && tiddler.fields[operator.operand]) {
var value = toDate(tiddler.fields[operator.operand]);
if(values.indexOf(value) === -1) {

Wyświetl plik

@ -17,36 +17,47 @@ Export our filter function
*/
exports.field = function(source,operator,options) {
var results = [],
fieldname = (operator.suffix || operator.operator).toLowerCase(),
isTitle = fieldname === "title";
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title),
text = tiddler ? tiddler.getFieldString(fieldname) : (isTitle ? title : null),
match;
if(text !== null) {
if(operator.regexp) {
match = !!operator.regexp.exec(text);
} else {
match = text === operator.operand;
}
if(operator.prefix === "!") {
match = !match;
}
if(match) {
results.push(title);
}
fieldname = (operator.suffix || operator.operator || "title").toLowerCase();
if(operator.prefix === "!") {
if(operator.regexp) {
source(function(tiddler,title) {
if(tiddler) {
var text = tiddler.getFieldString(fieldname);
if(text !== null && !operator.regexp.exec(text)) {
results.push(title);
}
}
});
} else {
source(function(tiddler,title) {
if(tiddler) {
var text = tiddler.getFieldString(fieldname);
if(text !== null && text !== operator.operand) {
results.push(title);
}
}
});
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
if(operator.regexp) {
source(function(tiddler,title) {
if(tiddler) {
var text = tiddler.getFieldString(fieldname);
if(text !== null && !!operator.regexp.exec(text)) {
results.push(title);
}
}
});
} else {
source(function(tiddler,title) {
if(tiddler) {
var text = tiddler.getFieldString(fieldname);
if(text !== null && text === operator.operand) {
results.push(title);
}
}
});
}
}
return results;
};

Wyświetl plik

@ -16,28 +16,14 @@ Filter operator for returning the names of the fields on the selected tiddlers
Export our filter function
*/
exports.fields = function(source,operator,options) {
var self = this,
results = [];
// Function to check an individual title
function checkTiddler(title) {
// Return the fields on the specified tiddler
var tiddler = options.wiki.getTiddler(title);
var results = [];
source(function(tiddler,title) {
if(tiddler) {
for(var fieldName in tiddler.fields) {
$tw.utils.pushTop(results,fieldName);
}
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -17,27 +17,17 @@ Export our filter function
*/
exports.has = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
if(tiddler) {
var match = $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== "";
if(operator.prefix === "!") {
match = !match;
}
if(match) {
if(operator.prefix === "!") {
source(function(tiddler,title) {
if(tiddler && (!$tw.utils.hop(tiddler.fields,operator.operand) || tiddler.fields[operator.operand] === "")) {
results.push(title);
}
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
source(function(tiddler,title) {
if(tiddler && $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== "") {
results.push(title);
}
});
}
return results;

Wyświetl plik

@ -16,26 +16,13 @@ Filter operator for returning the indexes of a data tiddler
Export our filter function
*/
exports.indexes = function(source,operator,options) {
var self = this,
results = [];
// Function to check an individual title
function checkTiddler(title) {
// Return the fields on the specified tiddler
var data = options.wiki.getTiddlerData(title,{});
var results = [];
source(function(tiddler,title) {
var data = options.wiki.getTiddlerData(title);
if(data) {
$tw.utils.pushTop(results,Object.keys(data));
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
results.sort();
return results;
};

Wyświetl plik

@ -17,31 +17,18 @@ Export our filter function
*/
exports.current = function(source,prefix,options) {
var results = [];
// Function to check a tiddler
function checkTiddler(title) {
if(title !== options.currTiddlerTitle) {
results.push(title);
}
};
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
if(prefix === "!") {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
if(source.indexOf(options.currTiddlerTitle) !== -1) {
results.push(options.currTiddlerTitle);
if(prefix === "!") {
source(function(tiddler,title) {
if(title !== options.currTiddlerTitle) {
results.push(title);
}
}
});
} else {
if(prefix === "!") {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
} else {
results.push(options.currTiddlerTitle);
}
source(function(tiddler,title) {
if(title === options.currTiddlerTitle) {
results.push(title);
}
});
}
return results;
};

Wyświetl plik

@ -17,24 +17,17 @@ Export our filter function
*/
exports.image = function(source,prefix,options) {
var results = [];
// Function to check a tiddler
function checkTiddler(title) {
var match = options.wiki.isImageTiddler(title);
if(prefix === "!") {
match = !match;
}
if(match) {
results.push(title);
}
};
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
if(prefix === "!") {
source(function(tiddler,title) {
if(!options.wiki.isImageTiddler(title)) {
results.push(title);
}
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
source(function(tiddler,title) {
if(options.wiki.isImageTiddler(title)) {
results.push(title);
}
});
}
return results;

Wyświetl plik

@ -16,31 +16,19 @@ Filter function for [is[missing]]
Export our filter function
*/
exports.missing = function(source,prefix,options) {
var results = [],
missingTitles;
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
missingTitles = options.wiki.getMissingTitles();
$tw.utils.each(source,function(title) {
var match = missingTitles.indexOf(title) !== -1;
if(prefix === "!") {
match = !match;
}
if(match) {
var results = [];
if(prefix === "!") {
source(function(tiddler,title) {
if(options.wiki.tiddlerExists(title)) {
results.push(title);
}
});
} else {
if(prefix !== "!") {
missingTitles = options.wiki.getMissingTitles();
$tw.utils.each(missingTitles,function(title) {
source(function(tiddler,title) {
if(!options.wiki.tiddlerExists(title)) {
results.push(title);
});
} else {
$tw.utils.each(source,function(element,title) {
results.push(title);
});
}
}
});
}
return results;
};

Wyświetl plik

@ -18,24 +18,15 @@ Export our filter function
exports.orphan = function(source,prefix,options) {
var results = [],
orphanTitles = options.wiki.getOrphanTitles();
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
var match = orphanTitles.indexOf(title) !== -1;
if(prefix === "!") {
match = !match;
}
if(match) {
if(prefix === "!") {
source(function(tiddler,title) {
if(orphanTitles.indexOf(title) === -1) {
results.push(title);
}
});
} else {
$tw.utils.each(source,function(element,title) {
var match = orphanTitles.indexOf(title) !== -1;
if(prefix === "!") {
match = !match;
}
if(match) {
source(function(tiddler,title) {
if(orphanTitles.indexOf(title) !== -1) {
results.push(title);
}
});

Wyświetl plik

@ -17,31 +17,18 @@ Export our filter function
*/
exports.shadow = function(source,prefix,options) {
var results = [];
// Function to check a tiddler
function checkTiddler(title) {
var match = options.wiki.isShadowTiddler(title);
if(prefix === "!") {
match = !match;
}
if(match) {
results.push(title);
}
};
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
if(prefix === "!") {
source(function(tiddler,title) {
if(!options.wiki.isShadowTiddler(title)) {
results.push(title);
}
});
} else {
if(prefix !== "!") {
options.wiki.eachShadow(function(tiddler,title) {
source(function(tiddler,title) {
if(options.wiki.isShadowTiddler(title)) {
results.push(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
}
});
}
return results;
};

Wyświetl plik

@ -17,24 +17,17 @@ Export our filter function
*/
exports.system = function(source,prefix,options) {
var results = [];
// Function to check a tiddler
function checkTiddler(title) {
var match = options.wiki.isSystemTiddler(title);
if(prefix === "!") {
match = !match;
}
if(match) {
results.push(title);
}
};
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
if(prefix === "!") {
source(function(tiddler,title) {
if(!options.wiki.isSystemTiddler(title)) {
results.push(title);
}
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
source(function(tiddler,title) {
if(options.wiki.isSystemTiddler(title)) {
results.push(title);
}
});
}
return results;

Wyświetl plik

@ -17,24 +17,17 @@ Export our filter function
*/
exports.tiddler = function(source,prefix,options) {
var results = [];
// Function to check a tiddler
function checkTiddler(title) {
var match = options.wiki.tiddlerExists(title);
if(prefix === "!") {
match = !match;
}
if(match) {
results.push(title);
}
};
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
if(prefix === "!") {
source(function(tiddler,title) {
if(!options.wiki.tiddlerExists(title)) {
results.push(title);
}
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
source(function(tiddler,title) {
if(options.wiki.tiddlerExists(title)) {
results.push(title);
}
});
}
return results;

Wyświetl plik

@ -17,20 +17,16 @@ Export our filter function
*/
exports.limit = function(source,operator,options) {
var results = [];
// Convert to an array if necessary
if(!$tw.utils.isArray(source)) {
var copy = [];
$tw.utils.each(source,function(element,title) {
copy.push(title);
});
source = copy;
}
// Convert to an array
source(function(tiddler,title) {
results.push(title);
});
// Slice the array if necessary
var limit = Math.min(source.length,parseInt(operator.operand,10));
var limit = Math.min(results.length,parseInt(operator.operand,10));
if(operator.prefix === "!") {
results = source.slice(source.length - limit);
results = results.slice(-limit);
} else {
results = source.slice(0,limit);
results = results.slice(0,limit);
}
return results;
};

Wyświetl plik

@ -17,20 +17,9 @@ Export our filter function
*/
exports.links = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
source(function(tiddler,title) {
$tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title));
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -19,28 +19,14 @@ exports.list = function(source,operator,options) {
var results = [],
tr = $tw.utils.parseTextReference(operator.operand),
list = options.wiki.getTiddlerList(tr.title || options.currTiddlerTitle,tr.field,tr.index);
function checkTiddler(title) {
var match = list.indexOf(title) !== -1;
if(operator.prefix === "!") {
match = !match;
}
if(match) {
results.push(title);
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
if(operator.prefix === "!") {
source(function(tiddler,title) {
if(list.indexOf(title) === -1) {
results.push(title);
}
});
} else {
if(operator.prefix !== "!") {
results = list;
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
results = list;
}
return results;
};

Wyświetl plik

@ -17,20 +17,9 @@ Export our filter function
*/
exports.listed = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
source(function(tiddler,title) {
$tw.utils.pushTop(results,options.wiki.findListingsOfTiddler(title));
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -17,10 +17,7 @@ Reverse list
*/
exports.reverse = function(source,operator,options) {
var results = [];
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
$tw.utils.each(source,function(title) {
source(function(tiddler,title) {
results.unshift(title);
});
return results;
@ -30,33 +27,36 @@ exports.reverse = function(source,operator,options) {
First entry/entries in list
*/
exports.first = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(0,Math.min(count,source.length));
var count = parseInt(operator.operand) || 1,
results = [];
source(function(tiddler,title) {
results.push(title);
});
return results.slice(0,count);
};
/*
Last entry/entries in list
*/
exports.last = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(-count);
var count = parseInt(operator.operand) || 1,
results = [];
source(function(tiddler,title) {
results.push(title);
});
return results.slice(-count);
};
/*
All but the first entry/entries of the list
*/
exports.rest = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(count);
var count = parseInt(operator.operand) || 1,
results = [];
source(function(tiddler,title) {
results.push(title);
});
return results.slice(count);
};
exports.butfirst = exports.rest;
exports.bf = exports.rest;
@ -65,11 +65,12 @@ exports.bf = exports.rest;
All but the last entry/entries of the list
*/
exports.butlast = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(0,-count);
var count = parseInt(operator.operand) || 1,
results = [];
source(function(tiddler,title) {
results.push(title);
});
return results.slice(0,-count);
};
exports.bl = exports.butlast;
@ -77,11 +78,12 @@ exports.bl = exports.butlast;
The nth member of the list
*/
exports.nth = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(count-1,count);
var count = parseInt(operator.operand) || 1,
results = [];
source(function(tiddler,title) {
results.push(title);
});
return results.slice(count - 1,count);
};
})();

Wyświetl plik

@ -16,22 +16,12 @@ Filter operator for returning the titles of the modules of a given type in this
Export our filter function
*/
exports.modules = function(source,operator,options) {
var results = [],
pushModules = function(type) {
$tw.utils.each($tw.modules.types[type],function(moduleInfo,moduleName) {
results.push(moduleName);
});
};
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
pushModules(title);
var results = [];
source(function(tiddler,title) {
$tw.utils.each($tw.modules.types[title],function(moduleInfo,moduleName) {
results.push(moduleName);
});
} else {
$tw.utils.each(source,function(element,title) {
pushModules(title);
});
}
});
results.sort();
return results;
};

Wyświetl plik

@ -18,25 +18,14 @@ Export our filter function
exports.next = function(source,operator,options) {
var results = [],
list = options.wiki.getTiddlerList(operator.operand);
function checkTiddler(title) {
source(function(tiddler,title) {
var match = list.indexOf(title);
// increment match and then test if result is in range
match++;
if(match > 0 && match < list.length) {
results.push(list[match]);
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -16,30 +16,15 @@ Filter operator for returning the titles of the shadow tiddlers within a plugin
Export our filter function
*/
exports.plugintiddlers = function(source,operator,options) {
var results = [],
pushShadows;
switch(operator.operand) {
default:
pushShadows = function(title) {
var pluginInfo = options.wiki.getPluginInfo(title);
if(pluginInfo) {
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
results.push(title);
});
}
};
break;
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
pushShadows(title);
});
} else {
$tw.utils.each(source,function(element,title) {
pushShadows(title);
});
}
var results = [];
source(function(tiddler,title) {
var pluginInfo = options.wiki.getPluginInfo(title);
if(pluginInfo) {
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
results.push(title);
});
}
});
results.sort();
return results;
};

Wyświetl plik

@ -17,24 +17,17 @@ Export our filter function
*/
exports.prefix = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
var match = title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase();
if(operator.prefix === "!") {
match = !match;
}
if(match) {
results.push(title);
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
if(operator.prefix === "!") {
source(function(tiddler,title) {
if(title.substr(0,operator.operand.length).toLowerCase() !== operator.operand.toLowerCase()) {
results.push(title);
}
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
source(function(tiddler,title) {
if(title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
results.push(title);
}
});
}
return results;

Wyświetl plik

@ -18,25 +18,14 @@ Export our filter function
exports.previous = function(source,operator,options) {
var results = [],
list = options.wiki.getTiddlerList(operator.operand);
function checkTiddler(title) {
source(function(tiddler,title) {
var match = list.indexOf(title);
// decrement match and then test if result is in range
// increment match and then test if result is in range
match--;
if( match >= 0 ) {
if(match >= 0) {
results.push(list[match]);
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -17,23 +17,11 @@ Export our filter function
*/
exports.removeprefix = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
var match = title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase();
if(match) {
source(function(tiddler,title) {
if(title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
results.push(title.substr(operator.operand.length));
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -17,34 +17,18 @@ Export our filter function
*/
exports.sameday = function(source,operator,options) {
var results = [],
isSameDay = function(dateField,dateString) {
var date1 = (new Date(dateField)).setHours(0,0,0,0),
date2 = (new Date($tw.utils.parseDate(dateString))).setHours(0,0,0,0);
return date1 === date2;
targetDate = (new Date($tw.utils.parseDate(operator.operand))).setHours(0,0,0,0);
// Function to convert a date/time to a date integer
var isSameDay = function(dateField) {
return (new Date(dateField)).setHours(0,0,0,0) === targetDate;
};
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
if(tiddler) {
var match = isSameDay(tiddler.fields.modified,operator.operand);
if(operator.prefix === "!") {
match = !match;
}
if(match) {
source(function(tiddler,title) {
if(tiddler && tiddler.fields.modified) {
if(isSameDay(tiddler.fields.modified)) {
results.push(title);
}
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -16,23 +16,13 @@ Filter operator for returning the source plugins for shadow tiddlers
Export our filter function
*/
exports.shadowsource = function(source,operator,options) {
var results = [],
pushShadowSource = function(title) {
var source = options.wiki.getShadowSource(title);
if(source) {
$tw.utils.pushTop(results,source);
}
};
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
pushShadowSource(title);
});
} else {
$tw.utils.each(source,function(element,title) {
pushShadowSource(title);
});
}
var results = [];
source(function(tiddler,title) {
var source = options.wiki.getShadowSource(title);
if(source) {
$tw.utils.pushTop(results,source);
}
});
results.sort();
return results;
};

Wyświetl plik

@ -40,15 +40,10 @@ exports.nsortcs = function(source,operator,options) {
};
var prepare_results = function (source) {
var results;
if($tw.utils.isArray(source)) {
results = source;
} else {
results = [];
$tw.utils.each(source,function(element,title) {
results.push(title);
});
}
var results = [];
source(function(tiddler,title) {
results.push(title);
});
return results;
}

Wyświetl plik

@ -17,31 +17,18 @@ Export our filter function
*/
exports.tag = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
if(tiddler) {
var match = tiddler.hasTag(operator.operand);
if(operator.prefix === "!") {
match = !match;
}
if(match) {
if(operator.prefix === "!") {
source(function(tiddler,title) {
if(tiddler && !tiddler.hasTag(operator.operand)) {
results.push(title);
}
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
source(function(tiddler,title) {
if(tiddler && tiddler.hasTag(operator.operand)) {
results.push(title);
}
});
}
// Sort the results if we are matching a tag
if(operator.prefix !== "!") {
results = options.wiki.sortByList(results,operator.operand);
}
return results;

Wyświetl plik

@ -17,20 +17,9 @@ Export our filter function
*/
exports.tagging = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
source(function(tiddler,title) {
$tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title));
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -17,23 +17,11 @@ Export our filter function
*/
exports.tags = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
source(function(tiddler,title) {
if(tiddler && tiddler.fields.tags) {
$tw.utils.pushTop(results,tiddler.fields.tags);
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
});
return results;
};

Wyświetl plik

@ -17,35 +17,14 @@ Export our filter function
*/
exports.title = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
if(tiddler) {
var match = tiddler.fields[operator.operator] === operator.operand;
if(operator.prefix === "!") {
match = !match;
}
if(match) {
if(operator.prefix === "!") {
source(function(tiddler,title) {
if(tiddler && tiddler.fields.title !== operator.operand) {
results.push(title);
}
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
// If we're filtering a hashmap we change the behaviour to pass through missing tiddlers
if(operator.prefix !== "!") {
results.push(operator.operand);
} else {
$tw.utils.each(source,function(element,title) {
if(title !== operator.operand) {
checkTiddler(title);
}
});
}
results.push(operator.operand);
}
return results;
};

Wyświetl plik

@ -17,25 +17,19 @@ Export our filter function
*/
exports.untagged = function(source,operator,options) {
var results = [];
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title),
match = tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0;
if(operator.prefix !== "!") {
match = !match;
}
if(match) {
$tw.utils.pushTop(results,title);
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
if(operator.prefix === "!") {
source(function(tiddler,title) {
if(tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0) {
$tw.utils.pushTop(results,title);
}
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
source(function(tiddler,title) {
if(tiddler) {
if(!tiddler.hasField("tags") || ($tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length === 0)) {
$tw.utils.pushTop(results,title);
}
}
});
}
return results;

Wyświetl plik

@ -13,7 +13,7 @@ This is the main application logic for both the client and server
"use strict";
// Set to `true` to enable performance instrumentation
var PERFORMANCE_INSTRUMENTATION = false;
var PERFORMANCE_INSTRUMENTATION = true;
var widget = require("$:/core/modules/widgets/widget.js");

Wyświetl plik

@ -268,7 +268,12 @@ Synchronise a set of changes to the server
Syncer.prototype.syncToServer = function(changes) {
var self = this,
now = new Date(),
filteredChanges = this.filterFn.call(this.wiki,changes);
filteredChanges = this.filterFn.call(this.wiki,function(callback) {
$tw.utils.each(changes,function(change,title) {
var tiddler = self.wiki.getTiddler(title);
callback(tiddler,title);
});
});
$tw.utils.each(changes,function(change,title,object) {
// Process the change if it is a deletion of a tiddler we're already syncing, or is on the filtered change list
if((change.deleted && $tw.utils.hop(self.tiddlerInfo,title)) || filteredChanges.indexOf(title) !== -1) {

Wyświetl plik

@ -274,6 +274,23 @@ exports.countTiddlers = function(excludeTag) {
return $tw.utils.count(tiddlers);
};
/*
Returns a function iterator(callback) that iterates through the specified titles, and invokes the callback with callback(tiddler,title)
*/
exports.makeTiddlerIterator = function(titles) {
var self = this;
if(!$tw.utils.isArray(titles)) {
titles = Object.keys(titles);
} else {
titles = titles.slice(0);
}
return function(callback) {
titles.forEach(function(title) {
callback(self.getTiddler(title),title);
});
};
};
/*
Sort an array of tiddler titles by a specified field
titles: array of titles (sorted in place)
@ -877,7 +894,7 @@ Return an array of tiddler titles that match a search string
text: The text string to search for
options: see below
Options available:
titles: Hashmap or array of tiddler titles to limit search
source: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)
exclude: An array of tiddler titles to exclude from the search
invert: If true returns tiddlers that do not contain the specified string
caseSensitive: If true forces a case sensitive search
@ -932,28 +949,13 @@ exports.search = function(text,options) {
return true;
};
// Loop through all the tiddlers doing the search
var results = [];
if($tw.utils.isArray(options.titles)) {
for(t=0; t<options.titles.length; t++) {
if(!!searchTiddler(options.titles[t]) === !options.invert) {
results.push(options.titles[t]);
}
var results = [],
source = options.source || this.each;
source(function(tiddler,title) {
if(!!searchTiddler(title) === !options.invert) {
results.push(title);
}
} else {
if(options.titles) {
for(var title in options.titles) {
if(!!searchTiddler(title) === !options.invert) {
results.push(title);
}
}
} else {
this.each(function(tiddler,title) {
if(!!searchTiddler(title) === !options.invert) {
results.push(title);
}
});
}
}
});
// Remove any of the results we have to exclude
if(options.exclude) {
for(t=0; t<options.exclude.length; t++) {

Wyświetl plik

@ -1,5 +1,5 @@
title: $:/AdvancedSearch
<div class="tw-advanced-search">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/AdvancedSearch]] [!is[shadow]!has[draft.of]tag[$:/tags/AdvancedSearch]] +[tag[$:/tags/AdvancedSearch]]" "$:/core/ui/AdvancedSearch/System">>
<<tabs "[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/AdvancedSearch]]" "$:/core/ui/AdvancedSearch/System">>
</div>

Wyświetl plik

@ -12,7 +12,7 @@ caption: {{$:/language/Search/Filter/Caption}}
<div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/filterDropdown">> type="nomatch" text="" default="">
<div class="tw-block-dropdown tw-edit-type-dropdown">
<$list filter="[is[shadow]tag[$:/tags/Filter]] [!is[shadow]tag[$:/tags/Filter]] +[sort[description]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
</$list>
</div>
</$reveal>

Wyświetl plik

@ -17,7 +17,7 @@ caption: {{$:/language/Search/Shadows/Caption}}
<<lingo Advanced/Matches>>
<$list filter="[is[shadow]search{$:/temp/advancedsearch}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
</div>

Wyświetl plik

@ -1,5 +1,5 @@
title: $:/ControlPanel
<div class="tw-control-panel">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/ControlPanel]] [!is[shadow]!has[draft.of]tag[$:/tags/ControlPanel]] +[tag[$:/tags/ControlPanel]]" "$:/core/ui/ControlPanel/Basics">>
<<tabs "[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/ControlPanel]]" "$:/core/ui/ControlPanel/Basics">>
</div>

Wyświetl plik

@ -5,5 +5,5 @@ caption: {{$:/language/ControlPanel/Advanced/Caption}}
{{$:/language/ControlPanel/Advanced/Hint}}
<div class="tw-control-panel">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/ControlPanel/Advanced]] [!is[shadow]!has[draft.of]tag[$:/tags/ControlPanel/Advanced]] +[tag[$:/tags/ControlPanel/Advanced]]" "$:/core/ui/ControlPanel/Advanced/TiddlerFields">>
<<tabs "[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/ControlPanel/Advanced]]" "$:/core/ui/ControlPanel/Advanced/TiddlerFields">>
</div>

Wyświetl plik

@ -5,5 +5,5 @@ caption: {{$:/language/ControlPanel/Appearance/Caption}}
{{$:/language/ControlPanel/Appearance/Hint}}
<div class="tw-control-panel">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/ControlPanel/Appearance]] [!is[shadow]!has[draft.of]tag[$:/tags/ControlPanel/Appearance]] +[tag[$:/tags/ControlPanel/Appearance]]" "$:/core/ui/ControlPanel/Appearance/Theme">>
<<tabs "[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/ControlPanel/Appearance]]" "$:/core/ui/ControlPanel/Appearance/Theme">>
</div>

Wyświetl plik

@ -13,5 +13,5 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
|<<lingo Tiddlers/Prompt>> |''<$count filter="[!is[system]]"/>'' |
|<<lingo Tags/Prompt>> |''<$count filter="[tags[]]"/>'' |
|<<lingo SystemTiddlers/Prompt>> |''<$count filter="[is[system]]"/>'' |
|<<lingo ShadowTiddlers/Prompt>> |''<$count filter="[is[shadow]]"/>'' |
|<<lingo ShadowTiddlers/Prompt>> |''<$count filter="[all[shadows]]"/>'' |
|<<lingo OverriddenShadowTiddlers/Prompt>> |''<$count filter="[is[tiddler]is[shadow]]"/>'' |

Wyświetl plik

@ -6,7 +6,7 @@ tw-tiddler-frame tw-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerCl
<div class=<<frame-classes>>>
<$set name="storyTiddler" value=<<currentTiddler>>>
<$keyboard key="ctrl+enter" message="tw-save-tiddler">
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] +[tag[$:/tags/EditTemplate]]" variable="listItem">
<$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/EditTemplate]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
</$keyboard>

Wyświetl plik

@ -1,4 +1,4 @@
title: $:/core/ui/EditTemplate/controls
tags: $:/tags/EditTemplate
<span class="tw-tiddler-controls titlebar"> <$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditToolbar]] [!is[shadow]!has[draft.of]tag[$:/tags/EditToolbar]] +[tag[$:/tags/EditToolbar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list> </span>
<span class="tw-tiddler-controls titlebar"> <$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/EditToolbar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list> </span>

Wyświetl plik

@ -3,7 +3,7 @@ tags: $:/tags/EditTemplate
\define lingo-base() $:/language/EditTemplate/
<$fieldmangler><div class="tw-edit-fields">
<table class="tw-edit-fields"><tbody><$list filter="[is[current]fields[]] -title -tags -text -creator -created -modified -modifier -type -[[draft.title]] -[[draft.of]]" variable="currentField"><tr class="tw-edit-field"><td class="tw-edit-field-name"><<currentField>>:</td><td class="tw-edit-field-value"><$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/></td><td class="tw-edit-field-remove"><$button message="tw-remove-field" param=<<currentField>> class="btn-invisible">{{$:/core/images/delete-button}}</$button></td>
<table class="tw-edit-fields"><tbody><$list filter="[all[current]fields[]] -title -tags -text -creator -created -modified -modifier -type -[[draft.title]] -[[draft.of]]" variable="currentField"><tr class="tw-edit-field"><td class="tw-edit-field-name"><<currentField>>:</td><td class="tw-edit-field-value"><$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/></td><td class="tw-edit-field-remove"><$button message="tw-remove-field" param=<<currentField>> class="btn-invisible">{{$:/core/images/delete-button}}</$button></td>
</tr>
</$list>
</tbody>

Wyświetl plik

@ -7,7 +7,7 @@ background-color:$(backgroundColor)$;
\end
<div class="tw-edit-tags">
<$fieldmangler>
<$list filter="[is[current]tags[]sort[title]]" storyview="pop" template="$:/core/ui/TagEditTemplate"/>
<$list filter="[all[current]tags[]sort[title]]" storyview="pop" template="$:/core/ui/TagEditTemplate"/>
<div class="tw-edit-add-tag">
<span class="tw-add-tag-name">

Wyświetl plik

@ -8,7 +8,7 @@ tags: $:/tags/EditTemplate
<$reveal state=<<qualify "$:/state/typeDropdown">> type="nomatch" text="" default="">
<div class="tw-block-dropdown tw-edit-type-dropdown">
<$linkcatcher to="!!type">
<$list filter="[is[shadow]prefix[$:/language/Docs/Types/]] [!is[shadow]prefix[$:/language/Docs/Types/]] +[sort[description]]"><$link to={{!!name}}><$view field="description"/> (<$view field="name"/>)</$link>
<$list filter="[all[tiddlers+shadows]prefix[$:/language/Docs/Types/]] +[sort[description]]"><$link to={{!!name}}><$view field="description"/> (<$view field="name"/>)</$link>
</$list>
</$linkcatcher>
</div>

Wyświetl plik

@ -1,5 +1,5 @@
title: $:/core/Filters/Missing
tags: $:/tags/Filter
filter: [is[missing]sort[title]]
filter: [all[missing]sort[title]]
description: {{$:/language/Filters/Missing}}

Wyświetl plik

@ -1,5 +1,5 @@
title: $:/core/Filters/Orphans
tags: $:/tags/Filter
filter: [is[orphan]sort[title]]
filter: [all[orphans]sort[title]]
description: {{$:/language/Filters/Orphans}}

Wyświetl plik

@ -1,5 +1,5 @@
title: $:/core/Filters/OverriddenShadowTiddlers
tags: $:/tags/Filter
filter: [is[tiddler]is[shadow]]
filter: [is[shadow]]
description: {{$:/language/Filters/OverriddenShadowTiddlers}}

Wyświetl plik

@ -1,5 +1,5 @@
title: $:/core/Filters/ShadowTiddlers
tags: $:/tags/Filter
filter: [is[shadow]sort[title]]
filter: [all[shadows]sort[title]]
description: {{$:/language/Filters/ShadowTiddlers}}

Wyświetl plik

@ -1,5 +1,5 @@
title: $:/core/Filters/SystemTags
tags: $:/tags/Filter
filter: [tags[]is[system]] [is[shadow]tags[]is[system]] +[sort[title]]
filter: [all[tiddlers+shadows]tags[]is[system]sort[title]]
description: {{$:/language/Filters/SystemTags}}

Wyświetl plik

@ -8,7 +8,7 @@ title: $:/core/ui/MissingTemplate
<div class="tw-drop-down">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr>
<$list filter="[is[current]backlinks[]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[current]backlinks[]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>
</div>

Wyświetl plik

@ -2,4 +2,4 @@ title: $:/core/ui/MoreSideBar/Missing
tags: $:/tags/MoreSideBar
caption: {{$:/language/SideBar/Missing/Caption}}
<$list filter="[is[missing]sort[title]]" template="$:/core/ui/MissingTemplate"/>
<$list filter="[all[missing]sort[title]]" template="$:/core/ui/MissingTemplate"/>

Wyświetl plik

@ -2,4 +2,4 @@ title: $:/core/ui/MoreSideBar/Orphans
tags: $:/tags/MoreSideBar
caption: {{$:/language/SideBar/Orphans/Caption}}
<$list filter="[is[orphan]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[orphans]sort[title]]" template="$:/core/ui/ListItemTemplate"/>

Wyświetl plik

@ -2,4 +2,4 @@ title: $:/core/ui/MoreSideBar/Shadows
tags: $:/tags/MoreSideBar
caption: {{$:/language/SideBar/Shadows/Caption}}
<$list filter="[is[shadow]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[shadows]sort[title]]" template="$:/core/ui/ListItemTemplate"/>

Wyświetl plik

@ -7,7 +7,7 @@ caption: {{$:/language/SideBar/Tags/Caption}}
<$list filter="[tags[]!is[system]sort[title]]">
<$transclude tiddler="$:/core/ui/TagTemplate"/> <small class="tw-menu-list-count"><$count filter="[is[current]tagging[]]"/></small>
<$transclude tiddler="$:/core/ui/TagTemplate"/> <small class="tw-menu-list-count"><$count filter="[all[current]tagging[]]"/></small>
</$list>

Wyświetl plik

@ -47,6 +47,6 @@ background-image: -ms-linear-gradient($gradient$);
<$macrocall $name="makedatauri" type={{$title$!!type}} text={{$title$}}/>
\end
<$list filter="[is[shadow]tag[$:/tags/stylesheet]] [!is[shadow]tag[$:/tags/stylesheet]]">
<$list filter="[all[tiddlers+shadows]tag[$:/tags/stylesheet]]">
<$transclude/>
</$list>

Wyświetl plik

@ -4,7 +4,7 @@ title: $:/core/ui/PageTemplate
<$dropzone>
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/PageTemplate]] +[tag[$:/tags/PageTemplate]]" variable="listItem">
<$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/PageTemplate]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>

Wyświetl plik

@ -3,6 +3,6 @@ tags: $:/tags/PageTemplate
<div class="tw-alerts">
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/Alert]] [!is[shadow]!has[draft.of]tag[$:/tags/Alert]] +[sort[modified]]" template="$:/core/ui/AlertTemplate" storyview="pop"/>
<$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/Alert]]" template="$:/core/ui/AlertTemplate" storyview="pop"/>
</div>

Wyświetl plik

@ -12,7 +12,7 @@ tags: $:/tags/PageTemplate
<div class="tw-page-controls">
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageControls]] [!is[shadow]!has[draft.of]tag[$:/tags/PageControls]] +[tag[$:/tags/PageControls]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/PageControls]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div>

Wyświetl plik

@ -2,5 +2,5 @@ title: $:/core/ui/PageTemplate/topleftbar
tags: $:/tags/PageTemplate
<span class="tw-topbar tw-topbar-left">
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/TopLeftBar]] [!is[shadow]!has[draft.of]tag[$:/tags/TopLeftBar]] +[tag[$:/tags/TopLeftBar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/TopLeftBar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</span>

Wyświetl plik

@ -2,5 +2,5 @@ title: $:/core/ui/PageTemplate/toprightbar
tags: $:/tags/PageTemplate
<span class="tw-topbar tw-topbar-right">
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/TopRightBar]] [!is[shadow]!has[draft.of]tag[$:/tags/TopRightBar]] +[tag[$:/tags/TopRightBar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/TopRightBar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</span>

Wyświetl plik

@ -3,5 +3,5 @@ tags: $:/tags/SideBar
caption: {{$:/language/SideBar/More/Caption}}
<div class="tw-more-sidebar">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]] +[tag[$:/tags/MoreSideBar]]" "$:/core/ui/MoreSideBar/Tags" "$:/state/tab/moresidebar">>
<<tabs "[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/MoreSideBar]]" "$:/core/ui/MoreSideBar/Tags" "$:/state/tab/moresidebar">>
</div>

Wyświetl plik

@ -26,7 +26,7 @@ title: $:/core/ui/SideBarLists
<$reveal state="$:/temp/search" type="match" text="">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/SideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/SideBar]] +[tag[$:/tags/SideBar]]" "$:/core/ui/SideBar/Open" "$:/state/tab/sidebar">>
<<tabs "[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/SideBar]]" "$:/core/ui/SideBar/Open" "$:/state/tab/sidebar">>
</$reveal>
</div>

Wyświetl plik

@ -11,6 +11,6 @@ background-color:$(backgroundColor)$;
</$set>
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr>
<$list filter="[is[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>

Wyświetl plik

@ -7,7 +7,7 @@ title: $:/TagManager
<$reveal state=<<qualify "$:/state/iconDropdown/$title$">> type="nomatch" text="" default="">
<$linkcatcher to="$title$!!icon">
<div class="tw-block-dropdown tw-edit-type-dropdown">
<$list filter="[is[shadow]is[image]] [!is[shadow]is[image]] [is[shadow]tag[$:/tags/Image]] [!is[shadow]tag[$:/tags/Image]] +[sort[title]]">
<$list filter="[all[tiddlers+shadows]is[image]] [all[tiddlers+shadows]tag[$:/tags/Image]] +[sort[title]]">
<$link to={{!!title}}>
<$view field="title"/>
</$link>
@ -28,7 +28,7 @@ title: $:/TagManager
<$list filter="[tags[]!is[system]sort[title]]">
<tr>
<td><$transclude tiddler="$:/core/ui/TagTemplate"/></td>
<td><$count filter="[is[current]tagging[]]"/></td>
<td><$count filter="[all[current]tagging[]]"/></td>
<td><$edit-text field="color" tag="input" type="color"/></td>
<td><$macrocall $name="iconEditor" title={{!!title}}/></td>
</tr>

Wyświetl plik

@ -11,7 +11,7 @@ background-color:$(backgroundColor)$;
</$set>
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr>
<$list filter="[is[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>
</span>

Wyświetl plik

@ -2,6 +2,6 @@ title: $:/core/ui/TiddlerFields
<table class="tw-view-field-table">
<tbody>
<$list filter="[is[current]fields[]sort[title]] -text" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
<$list filter="[all[current]fields[]sort[title]] -text" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
</tbody>
</table>

Wyświetl plik

@ -1,3 +1,3 @@
title: $:/core/ui/TiddlerInfo
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo]] [!is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo]] +[tag[$:/tags/TiddlerInfo]]" "$:/core/ui/TiddlerInfo/References">>
<<tabs "[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/TiddlerInfo]]" "$:/core/ui/TiddlerInfo/References">>

Wyświetl plik

@ -2,7 +2,7 @@ title: $:/core/ui/TiddlerInfo/Advanced
tags: $:/tags/TiddlerInfo
caption: {{$:/language/TiddlerInfo/Advanced/Caption}}
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo/Advanced]] [!is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo/Advanced]] +[tag[$:/tags/TiddlerInfo/Advanced]]" variable="listItem">
<$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/TiddlerInfo/Advanced]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>

Wyświetl plik

@ -2,13 +2,13 @@ title: $:/core/ui/TiddlerInfo/Advanced/PluginInfo
tags: $:/tags/TiddlerInfo/Advanced
\define lingo-base() $:/language/TiddlerInfo/Advanced/PluginInfo/
<$list filter="[is[current]has[plugin-type]]">
<$list filter="[all[current]has[plugin-type]]">
! <<lingo Heading>>
<<lingo Hint>>
<ul>
<$list filter="[is[current]plugintiddlers[]sort[title]]" emptyMessage=<<lingo Empty/Hint>>>
<$list filter="[all[current]plugintiddlers[]sort[title]]" emptyMessage=<<lingo Empty/Hint>>>
<li>
<$link to={{!!title}}>
<$view field="title"/>

Wyświetl plik

@ -6,17 +6,17 @@ tags: $:/tags/TiddlerInfo/Advanced
! <<lingo Heading>>
<$list filter="[is[current]!is[shadow]]">
<$list filter="[all[current]!is[shadow]]">
<<lingo NotShadow/Hint>>
</$list>
<$list filter="[is[current]is[shadow]]">
<$list filter="[all[current]is[shadow]]">
<<lingo Shadow/Hint>>
<$list filter="[is[current]shadowsource[]]">
<$list filter="[all[current]shadowsource[]]">
<$set name="pluginTiddler" value=<<currentTiddler>>>
<<lingo Shadow/Source>>
@ -24,7 +24,7 @@ tags: $:/tags/TiddlerInfo/Advanced
</$list>
<$list filter="[is[current]is[shadow]is[tiddler]]">
<$list filter="[all[current]is[shadow]is[tiddler]]">
<<lingo OverriddenShadow/Hint>>

Wyświetl plik

@ -3,4 +3,4 @@ tags: $:/tags/TiddlerInfo
caption: {{$:/language/TiddlerInfo/Listed/Caption}}
\define lingo-base() $:/language/TiddlerInfo/
<$list filter="[is[current]listed[]!is[system]]" emptyMessage=<<lingo Listed/Empty>> template="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[current]listed[]!is[system]]" emptyMessage=<<lingo Listed/Empty>> template="$:/core/ui/ListItemTemplate"/>

Wyświetl plik

@ -3,5 +3,5 @@ tags: $:/tags/TiddlerInfo
caption: {{$:/language/TiddlerInfo/References/Caption}}
\define lingo-base() $:/language/TiddlerInfo/
<$list filter="[is[current]backlinks[]sort[title]]" emptyMessage=<<lingo References/Empty>> template="$:/core/ui/ListItemTemplate">
<$list filter="[all[current]backlinks[]sort[title]]" emptyMessage=<<lingo References/Empty>> template="$:/core/ui/ListItemTemplate">
</$list>

Wyświetl plik

@ -3,4 +3,4 @@ tags: $:/tags/TiddlerInfo
caption: {{$:/language/TiddlerInfo/Tagging/Caption}}
\define lingo-base() $:/language/TiddlerInfo/
<$list filter="[is[current]tagging[]]" emptyMessage=<<lingo Tagging/Empty>> template="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[current]tagging[]]" emptyMessage=<<lingo Tagging/Empty>> template="$:/core/ui/ListItemTemplate"/>

Wyświetl plik

@ -3,6 +3,6 @@ title: $:/core/ui/ViewTemplate
\define frame-classes()
tw-tiddler-frame tw-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
\end
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] +[tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div>
</$tiddler></$set></$set>

Wyświetl plik

@ -2,7 +2,7 @@ title: $:/core/ui/ViewTemplate/classic
tags: $:/tags/ViewTemplate $:/tags/EditTemplate
\define lingo-base() $:/language/ClassicWarning/
<$list filter="[is[current]type[text/x-tiddlywiki]]">
<$list filter="[all[current]type[text/x-tiddlywiki]]">
<div class="tw-message-box">
<<lingo Hint>>

Wyświetl plik

@ -1,4 +1,4 @@
title: $:/core/ui/ViewTemplate/tags
tags: $:/tags/ViewTemplate
<div class="tw-tags-wrapper"><$list filter="[is[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
<div class="tw-tags-wrapper"><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>

Wyświetl plik

@ -7,19 +7,19 @@ fill:$(foregroundColor)$;
<div class="tw-tiddler-title">
<div class="titlebar">
<span class="tw-tiddler-controls">
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewToolbar]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewToolbar]] +[tag[$:/tags/ViewToolbar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$list filter="[all[tiddlers+shadows]!has[draft.of]tag[$:/tags/ViewToolbar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</span>
<$set name="foregroundColor" value={{!!color}}>
<span style=<<title-styles>>>
<$transclude tiddler={{!!icon}}/>
</span>
</$set>
<$list filter="[is[current]removeprefix[$:/]]">
<$list filter="[all[current]removeprefix[$:/]]">
<span class="title" title={{$:/language/SystemTiddler/Tooltip}}>
<span class="tw-system-title-prefix">$:/</span><$text text=<<currentTiddler>>/>
</span>
</$list>
<$list filter="[is[current]!prefix[$:/]]">
<$list filter="[all[current]!prefix[$:/]]">
<span class="title">
<$view field="title"/>
</span>

Wyświetl plik

@ -9,7 +9,7 @@ title: $:/snippets/modules
<$macrocall $name="describeModuleType" type=<<currentTiddler>>/>
<ul><$list filter="[is[current]modules[]]"><li><$link><<currentTiddler>></$link>
<ul><$list filter="[all[current]modules[]]"><li><$link><<currentTiddler>></$link>
</li>
</$list>
</ul>

Wyświetl plik

@ -8,12 +8,12 @@ title: $:/snippets/paletteeditor
<<lingo Prompt>> <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/></$link>
<$list filter="[is[current]is[shadow]is[tiddler]]" variable="listItem">
<$list filter="[all[current]is[shadow]is[tiddler]]" variable="listItem">
<<lingo Prompt/Modified>>
<$button message="tw-delete-tiddler" param={{$:/palette}}><<lingo Reset/Caption>></$button>
</$list>
<$list filter="[is[current]is[shadow]!is[tiddler]]" variable="listItem">
<$list filter="[all[current]is[shadow]!is[tiddler]]" variable="listItem">
<<lingo Clone/Prompt>>
</$list>
@ -21,7 +21,7 @@ title: $:/snippets/paletteeditor
<table>
<tbody>
<$list filter="[is[current]indexes[]]" variable="colourName">
<$list filter="[all[current]indexes[]]" variable="colourName">
<tr>
<td>
''<$macrocall $name="describePaletteColour" colour=<<colourName>>/>''<br/>

Wyświetl plik

@ -4,7 +4,7 @@ title: $:/snippets/paletteswitcher
<<lingo Prompt>> <$view tiddler={{$:/palette}} field="name"/>
<$linkcatcher to="$:/palette">
<div class="tw-chooser"><$list filter="[is[shadow]tag[$:/tags/Palette]] [!is[shadow]tag[$:/tags/Palette]] +[sort[description]]"><div class="tw-chooser-item"><$link to={{!!title}}><div><$reveal state="$:/palette" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/palette" type="nomatch" text={{!!title}}>&nbsp;</$reveal> ''<$view field="name" format="text"/>'' - <$view field="description" format="text"/></div><$transclude tiddler="$:/snippets/currpalettepreview"/></$link></div>
<div class="tw-chooser"><$list filter="[all[tiddlers+shadows]tag[$:/tags/Palette]sort[description]]"><div class="tw-chooser-item"><$link to={{!!title}}><div><$reveal state="$:/palette" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/palette" type="nomatch" text={{!!title}}>&nbsp;</$reveal> ''<$view field="name" format="text"/>'' - <$view field="description" format="text"/></div><$transclude tiddler="$:/snippets/currpalettepreview"/></$link></div>
</$list>
</div>
</$linkcatcher>

Wyświetl plik

@ -144,7 +144,7 @@ describe("Filter tests", function() {
expect(wiki.filterTiddlers("[!tag[one]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one");
expect(wiki.filterTiddlers("[prefix[Tidd]tag[one]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[!is[shadow]tag[two]sort[title]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three");
expect(wiki.filterTiddlers("[is[shadow]tag[two]sort[title]]").join(",")).toBe("$:/TiddlerFive");
expect(wiki.filterTiddlers("[all[shadows]tag[two]sort[title]]").join(",")).toBe("$:/TiddlerFive");
});
it("should handle the tags operator", function() {
@ -156,7 +156,7 @@ describe("Filter tests", function() {
expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[[two]tagging[]sort[title]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three");
expect(wiki.filterTiddlers("[is[current]tagging[]sort[title]]","one").join(",")).toBe("Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[all[current]tagging[]sort[title]]","one").join(",")).toBe("Tiddler Three,TiddlerOne");
});
it("should handle the untagged operator", function() {
@ -166,12 +166,12 @@ describe("Filter tests", function() {
it("should handle the links operator", function() {
expect(wiki.filterTiddlers("[!is[shadow]links[]sort[title]]").join(",")).toBe("a fourth tiddler,one,Tiddler Three,TiddlerSix,TiddlerTwo,TiddlerZero");
expect(wiki.filterTiddlers("[is[shadow]links[]sort[title]]").join(",")).toBe("TiddlerOne");
expect(wiki.filterTiddlers("[all[shadows]links[]sort[title]]").join(",")).toBe("TiddlerOne");
});
it("should handle the backlinks operator", function() {
expect(wiki.filterTiddlers("[!is[shadow]backlinks[]sort[title]]").join(",")).toBe("a fourth tiddler,one");
expect(wiki.filterTiddlers("[is[shadow]backlinks[]sort[title]]").join(",")).toBe("Tiddler Three");
expect(wiki.filterTiddlers("[all[shadows]backlinks[]sort[title]]").join(",")).toBe("Tiddler Three");
});
it("should handle the has operator", function() {
@ -187,7 +187,7 @@ describe("Filter tests", function() {
it("should handle the list operator", function() {
expect(wiki.filterTiddlers("[list[TiddlerSeventh]sort[title]]").join(",")).toBe("a fourth tiddler,MissingTiddler,Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[tag[one]list[TiddlerSeventh]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[tag[one]list[TiddlerSeventh]sort[title]]").join(",")).toBe("a fourth tiddler,MissingTiddler,Tiddler Three,TiddlerOne");
});
it("should handle the next operator", function() {
@ -232,12 +232,12 @@ describe("Filter tests", function() {
});
it("should handle the '[is[shadow]]' operator", function() {
expect(wiki.filterTiddlers("[is[shadow]sort[title]]").join(",")).toBe("$:/TiddlerFive,Tiddler8,TiddlerSeventh,TiddlerSix");
expect(wiki.filterTiddlers("[all[shadows]sort[title]]").join(",")).toBe("$:/TiddlerFive,Tiddler8,TiddlerSeventh,TiddlerSix");
expect(wiki.filterTiddlers("[!is[shadow]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
});
it("should handle the '[is[missing]]' operator", function() {
expect(wiki.filterTiddlers("[is[missing]]").join(",")).toBe("TiddlerZero,TiddlerTwo");
expect(wiki.filterTiddlers("[all[missing]]").join(",")).toBe("TiddlerZero,TiddlerTwo");
expect(wiki.filterTiddlers("[!is[missing]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[[TiddlerOne]is[missing]]").join(",")).toBe("");
expect(wiki.filterTiddlers("[[TiddlerZero]is[missing]]").join(",")).toBe("TiddlerZero");

Wyświetl plik

@ -8,4 +8,4 @@ ShadowTiddlers can be overridden with an ordinary tiddler of the same name. If t
The current shadow tiddlers are:
<$list filter="[is[shadow]sort[title]]"/>
<$list filter="[all[shadows]sort[title]]"/>

Wyświetl plik

@ -22,4 +22,4 @@ System tags are used to give special behaviour to tiddlers:
These are the system tags in use in this wiki:
{{{ [is[shadow]tags[]prefix[$:/]] [!is[shadow]tags[]prefix[$:/]] +[sort[title]] }}}
{{{ [all[tiddlers+shadows]tags[]prefix[$:/]] +[sort[title]] }}}

Wyświetl plik

@ -36,7 +36,7 @@ This wiki text shows how to display a list within the scrollable widget:
<<wikitext-example-without-html "<$scrollable class='tw-scrollable-demo'>
<$list filter='[!is[system]]'>
<$view field='title'/>: <$list filter='[is[current]links[]sort[title]]' storyview='pop'>
<$view field='title'/>: <$list filter='[all[current]links[]sort[title]]' storyview='pop'>
<$link><$view field='title'/></$link>
</$list>

Wyświetl plik

@ -1,6 +1,6 @@
title: $:/editions/clientserver/download-offline
\define saveTiddlerFilter()
[is[tiddler]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] +[sort[title]]
[all[tiddlers+shadows]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] +[sort[title]]
\end
{{$:/core/templates/tiddlywiki5.html}}