summaryrefslogtreecommitdiffstats
path: root/data/js/tablesorter.js
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-06-04 23:10:31 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-06-05 21:23:49 +0200
commitd088234d67f3aa422796d922e08a07949dc53d83 (patch)
treea964821b6b725dd26becbb3e91acf8d7dd5e0014 /data/js/tablesorter.js
parent048410164d2a17bbb588e43351e44eeb81610960 (diff)
Move public files to ./public_html
./data/local is not moved because it contains likely untracked files and moving it would throw an error when updating. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'data/js/tablesorter.js')
-rw-r--r--data/js/tablesorter.js82
1 files changed, 0 insertions, 82 deletions
diff --git a/data/js/tablesorter.js b/data/js/tablesorter.js
deleted file mode 100644
index d500f2ade..000000000
--- a/data/js/tablesorter.js
+++ /dev/null
@@ -1,82 +0,0 @@
-(function () {
-'use strict';
-define(['jquery', 'jquery.tablesorter'], function ($) {
- var PrivateFunctions = {
- setupParser: function () {
- // source: https://projects.archlinux.org/archweb.git/tree/sitestatic/archweb.js
- $.tablesorter.addParser({
- id: 'filesize',
- re: /^(\d+(?:\.\d+)?)(bytes?|[KMGTPEZY]i?B|B)$/,
- is: function(s) {
- return this.re.test(s);
- },
- format: function(s) {
- var matches = this.re.exec(s);
- if (!matches) {
- return 0;
- }
- var size = parseFloat(matches[1]),
- suffix = matches[2];
-
- switch(suffix) {
- /* intentional fall-through at each level */
- case 'YB':
- case 'YiB':
- size *= 1024;
- case 'ZB':
- case 'ZiB':
- size *= 1024;
- case 'EB':
- case 'EiB':
- size *= 1024;
- case 'PB':
- case 'PiB':
- size *= 1024;
- case 'TB':
- case 'TiB':
- size *= 1024;
- case 'GB':
- case 'GiB':
- size *= 1024;
- case 'MB':
- case 'MiB':
- size *= 1024;
- case 'KB':
- case 'KiB':
- size *= 1024;
- }
- return size;
- },
- type: 'numeric'
- });
- },
-
- textExtraction: function (node) {
- var attr = $(node).attr('data-sort-value');
- if (!_.isUndefined(attr) && attr !== false) {
- var intAttr = parseInt(attr);
- if (!_.isNaN(intAttr)) {
- return intAttr;
- }
- return attr;
- }
- return $(node).text();
- },
-
- setupTableSorter: function () {
- $(".tablesorter").tablesorter({
- textExtraction: this.textExtraction
- });
- }
- };
-
- var TableSorter = {
- initialize: function () {
- PrivateFunctions.setupParser();
- PrivateFunctions.setupTableSorter();
- }
- };
-
- return TableSorter;
-});
-})();