From acad64a9333f7e3a07c31c9f4f030e67f8e7e9f0 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 14 Jun 2012 11:35:54 +0100 Subject: [PATCH] Added a case insensitive sort to the filters Hoping to come up with a better syntax for this --- core/modules/filters.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/modules/filters.js b/core/modules/filters.js index f11752e5b..a09b1a2c3 100644 --- a/core/modules/filters.js +++ b/core/modules/filters.js @@ -141,6 +141,15 @@ exports.operators = { return "this.sortTiddlers(subResults,\"" + $tw.utils.stringify(operator.operand) + "\"," + desc + ");"; } }, + "sort-case-sensitive": { + selector: function(operator) { + throw "Cannot use sort operator at the start of a filter operation"; + }, + filter: function(operator) { + var desc = operator.prefix === "!" ? "true" : "false"; + return "this.sortTiddlers(subResults,\"" + $tw.utils.stringify(operator.operand) + "\"," + desc + ",true);"; + } + }, "limit": { selector: function(operator) { throw "Cannot use limit operator at the start of a filter operation";