View Single Post
Old 02-23-2010, 07:18 AM   #535
thawk
Connoisseur
thawk began at the beginning.
 
Posts: 57
Karma: 10
Join Date: Oct 2008
Device: prs 505
Thumbs up

Quote:
Originally Posted by kartu View Post
thawk
What is "title sorter"? Other features you've mentioned are already in FR (except remembering last folder used)
titleSorter is a field in cache.xml. If a book has this field, 505 will sort on this field instead of the title field. Using this field, the CJK character can be sorted correctly.

For example:
Code:
<text author="林建" page="0" pageOffset="0" part="0" scale="0" status="0" sourceid="15" id="16" date="Fri, 04 Jul 2008 15:40:15 GMT" mime="application/x-sony-bbeb" path="Sony Reader/books/传记纪实/大交易场:美国证券市场风云实录.lrf" size="1213012" title="大交易场:美国证券市场风云实录" titleSorter="da jiao yi chang :mei guo zheng quan shi chang feng yun shi lu ">
I simply modified the _BrowseFolders.js, replacing the compareString() in sortByTitle/sortByAuthor function using the following compareTitle function, it works:

Code:
var compareTitle = function(a, b) {
    var atitle = a.media.titleSorter ? a.media.titleSorter : a.media.title;
    var btitle = b.media.titleSorter ? b.media.titleSorter : b.media.title;

    return compareStrings(atitle, btitle);
};
In sortByTitle:
Code:
         //return compareStrings(a.name, b.name);
         return compareTitle(a, b);
In sortByAuthor:
Code:
             //return compareStrings(a.media.title, b.media.title);
             return compareTitle(a, b);
BTW, I discovered the "titleSorter" field in the prs505xml script (http://prs505media.sourceforge.net/). The author used this field to sort Russian book titles, and it also works on CJK.
thawk is offline   Reply With Quote