mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 10:49:43 +00:00
37 lines
703 B
JavaScript
37 lines
703 B
JavaScript
|
/*\
|
||
|
title: $:/core/modules/filters/haschanged.js
|
||
|
type: application/javascript
|
||
|
module-type: filteroperator
|
||
|
|
||
|
Filter operator returns tiddlers from the list that have a non-zero changecount.
|
||
|
|
||
|
\*/
|
||
|
(function(){
|
||
|
|
||
|
/*jslint node: true, browser: true */
|
||
|
/*global $tw: false */
|
||
|
"use strict";
|
||
|
|
||
|
/*
|
||
|
Export our filter function
|
||
|
*/
|
||
|
exports.haschanged = function(source,operator,options) {
|
||
|
var results = [];
|
||
|
if(operator.prefix === "!") {
|
||
|
source(function(tiddler,title) {
|
||
|
if(options.wiki.getChangeCount(title) === 0) {
|
||
|
results.push(title);
|
||
|
}
|
||
|
});
|
||
|
} else {
|
||
|
source(function(tiddler,title) {
|
||
|
if(options.wiki.getChangeCount(title) > 0) {
|
||
|
results.push(title);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
return results;
|
||
|
};
|
||
|
|
||
|
})();
|