mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 10:49:43 +00:00
33 lines
613 B
JavaScript
33 lines
613 B
JavaScript
|
/*\
|
||
|
title: $:/core/modules/filters/sortcs.js
|
||
|
type: application/javascript
|
||
|
module-type: filteroperator
|
||
|
|
||
|
Filter operator for case-sensitive sorting
|
||
|
|
||
|
\*/
|
||
|
(function(){
|
||
|
|
||
|
/*jslint node: true, browser: true */
|
||
|
/*global $tw: false */
|
||
|
"use strict";
|
||
|
|
||
|
/*
|
||
|
Export our filter function
|
||
|
*/
|
||
|
exports.sortcs = function(source,operator,options) {
|
||
|
var results;
|
||
|
if($tw.utils.isArray(source)) {
|
||
|
results = source;
|
||
|
} else {
|
||
|
results = [];
|
||
|
$tw.utils.each(source,function(element,title) {
|
||
|
results.push(title);
|
||
|
});
|
||
|
}
|
||
|
options.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",true);
|
||
|
return results;
|
||
|
};
|
||
|
|
||
|
})();
|