mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-20 19:29:43 +00:00
aae56f20af
Fixes #1455 @aelocson have I got the docs right for the new filter?
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;
|
|
};
|
|
|
|
})();
|