diff --git a/archive/src/main/resources/org/openrs2/archive/static/js/openrs2.js b/archive/src/main/resources/org/openrs2/archive/static/js/openrs2.js index 228234b7..99a5fe19 100644 --- a/archive/src/main/resources/org/openrs2/archive/static/js/openrs2.js +++ b/archive/src/main/resources/org/openrs2/archive/static/js/openrs2.js @@ -1,13 +1,35 @@ var buildRegex = new RegExp('>([0-9]+)(?:[.]([0-9]+))?<'); +function customSort(name, order, data) { + order = order === 'asc' ? 1 : -1; + + data.sort(function (a, b) { + a = a[name]; + b = b[name]; + + if (!a) { + return 1; + } else if (!b) { + return -1; + } + + if (name === 'builds') { + return buildSort(a, b) * order; + } else { + if (a < b) { + return -order; + } else if (a === b) { + return 0; + } else { + return order; + } + } + }); +} + function buildSort(a, b) { a = buildRegex.exec(a); b = buildRegex.exec(b); - if (!a) { - return -1; - } else if (!b) { - return 1; - } var aMajor = parseInt(a[1]); var bMajor = parseInt(b[1]); diff --git a/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html b/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html index 94f6d69e..6727aeca 100644 --- a/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html +++ b/archive/src/main/resources/org/openrs2/archive/templates/caches/index.html @@ -12,13 +12,13 @@

Caches

- +
- + @@ -41,9 +41,11 @@
Game Env LangBuild(s)Build(s) Timestamp Source(s) Archives - -
- + + +
+ +