1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 07:13:15 +00:00
TiddlyWiki5/core/modules/filters/haschanged.js
Jermolene aae56f20af Display warning banner when plugins are modified
Fixes #1455

@aelocson have I got the docs right for the new filter?
2015-02-08 19:40:15 +00:00

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;
};
})();