Additional glyphicons for music on search and author page
Fix duplicate user and email (now case insensitive) Output of calibre on stderr is now logged (full traceback in debug-log, otherwise, only errormessage) Natural sorting for comic reader Fix for long running tasks
This commit is contained in:
@@ -162,12 +162,7 @@ var unzip = function(arrayBuffer) {
|
||||
totalFilesInArchive = localFiles.length;
|
||||
|
||||
// got all local files, now sort them
|
||||
localFiles.sort(naturalCompare);
|
||||
/*localFiles.sort(function(a, b) {
|
||||
var aname = a.filename.toLowerCase();
|
||||
var bname = b.filename.toLowerCase();
|
||||
return aname > bname ? 1 : -1;
|
||||
});*/
|
||||
localFiles.sort(alphanumCase);
|
||||
|
||||
// archive extra data record
|
||||
if (bstream.peekNumber(4) === zArchiveExtraDataSignature) {
|
||||
@@ -663,51 +658,3 @@ function inflate(compressedData, numDecompressedBytes) {
|
||||
onmessage = function(event) {
|
||||
unzip(event.data.file, true);
|
||||
};
|
||||
|
||||
/*
|
||||
function naturalCompare(a, b) {
|
||||
var ax = [], bx = [];
|
||||
|
||||
a.filename.toLowerCase().replace(/(\d+)|(\D+)/g, function(_, $1, $2) { ax.push([$1 || Infinity, $2 || ""]) });
|
||||
b.filename.toLowerCase().replace(/(\d+)|(\D+)/g, function(_, $1, $2) { bx.push([$1 || Infinity, $2 || ""]) });
|
||||
|
||||
while(ax.length && bx.length) {
|
||||
var an = ax.shift();
|
||||
var bn = bx.shift();
|
||||
var nn = (an[0] - bn[0]) || an[1].localeCompare(bn[1]);
|
||||
if(nn) return nn;
|
||||
}
|
||||
|
||||
return ax.length - bx.length;
|
||||
}*/
|
||||
|
||||
|
||||
/*var re = /([a-z]+)(\d+)(.+)/i;
|
||||
function naturalCompare(a, b) {
|
||||
var ma = a.match(re),
|
||||
mb = b.match(re),
|
||||
a_str = ma[1],
|
||||
b_str = mb[1],
|
||||
a_num = parseInt(ma[2],10),
|
||||
b_num = parseInt(mb[2],10),
|
||||
a_rem = ma[3],
|
||||
b_rem = mb[3];
|
||||
return a_str > b_str ? 1 : a_str < b_str ? -1 : a_num > b_num ? 1 : a_num < b_num ? -1 : a_rem > b_rem;
|
||||
}*/
|
||||
|
||||
/*function naturalCompare(a, b) {
|
||||
var ax = [], bx = [];
|
||||
|
||||
a.replace(/(\d+)|(\D+)/g, function(_, $1, $2) { ax.push([$1 || Infinity, $2 || ""]) });
|
||||
b.replace(/(\d+)|(\D+)/g, function(_, $1, $2) { bx.push([$1 || Infinity, $2 || ""]) });
|
||||
|
||||
while(ax.length && bx.length) {
|
||||
var an = ax.shift();
|
||||
var bn = bx.shift();
|
||||
var nn = (an[0] - bn[0]) || an[1].localeCompare(bn[1]);
|
||||
if(nn) return nn;
|
||||
}
|
||||
|
||||
return ax.length - bx.length;
|
||||
}*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user