From a8ab08e8fac05ac4b50b18e9492869b802fa4cbb Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sat, 17 Jan 2015 11:40:33 +0100 Subject: [PATCH 1/2] sort unlisted tags by title when the tiddlers are not listed in the list field, sort them by title nonetheless, otherwise we get a real poor taglist from **$:/core/ui/TagTemplate** --- core/modules/wiki.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 75245ac17..707a900e7 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -516,7 +516,7 @@ exports.sortByList = function(array,listTitle) { if(!array || array.length === 0) { return []; } else { - var titles = [], t, title; + var t, title, titles = [], unlisted = []; // First place any entries that are present in the list for(t=0; t Date: Sat, 17 Jan 2015 12:02:54 +0100 Subject: [PATCH 2/2] added case-insensitivity using wiki.sortTiddlers --- core/modules/wiki.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 707a900e7..61338f744 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -531,8 +531,10 @@ exports.sortByList = function(array,listTitle) { unlisted.push(title); } } - //concat listed with unlisted, sorted - titles = titles.concat(unlisted.sort()); + //sort unlisted + $tw.wiki.sortTiddlers(unlisted,"title",false,false); + //concat listed with unlisted + titles = titles.concat(unlisted); // Finally obey the list-before and list-after fields of each tiddler in turn var sortedTitles = titles.slice(0); for(t=0; t