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 new file mode 100644 index 0000000000..228234b76c --- /dev/null +++ b/archive/src/main/resources/org/openrs2/archive/static/js/openrs2.js @@ -0,0 +1,21 @@ +var buildRegex = new RegExp('>([0-9]+)(?:[.]([0-9]+))?<'); + +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]); + if (aMajor !== bMajor) { + return aMajor - bMajor; + } + + var aMinor = a[2] ? parseInt(a[2]) : 0; + var bMinor = b[2] ? parseInt(b[2]) : 0; + return aMinor - bMinor; +} 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 188a812636..94f6d69e04 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 @@ -18,7 +18,7 @@