diff --git a/pagure/static/vendor/stupidtable/stupidtable-1.0.1.js b/pagure/static/vendor/stupidtable/stupidtable-1.0.1.js deleted file mode 100644 index 851ba4c..0000000 --- a/pagure/static/vendor/stupidtable/stupidtable-1.0.1.js +++ /dev/null @@ -1,135 +0,0 @@ -// Stupid jQuery table plugin. - -(function($) { - $.fn.stupidtable = function(sortFns) { - return this.each(function() { - var $table = $(this); - sortFns = sortFns || {}; - sortFns = $.extend({}, $.fn.stupidtable.default_sort_fns, sortFns); - $table.data('sortFns', sortFns); - - $table.on("click.stupidtable", "thead th", function() { - $(this).stupidsort(); - }); - }); - }; - - - // Expects $("#mytable").stupidtable() to have already been called. - // Call on a table header. - $.fn.stupidsort = function(force_direction){ - var $this_th = $(this); - var th_index = 0; // we'll increment this soon - var dir = $.fn.stupidtable.dir; - var $table = $this_th.closest("table"); - var datatype = $this_th.data("sort") || null; - - // No datatype? Nothing to do. - if (datatype === null) { - return; - } - - // Account for colspans - $this_th.parents("tr").find("th").slice(0, $(this).index()).each(function() { - var cols = $(this).attr("colspan") || 1; - th_index += parseInt(cols,10); - }); - - var sort_dir; - if(arguments.length == 1){ - sort_dir = force_direction; - } - else{ - sort_dir = force_direction || $this_th.data("sort-default") || dir.ASC; - if ($this_th.data("sort-dir")) - sort_dir = $this_th.data("sort-dir") === dir.ASC ? dir.DESC : dir.ASC; - } - - - $table.trigger("beforetablesort", {column: th_index, direction: sort_dir}); - - // More reliable method of forcing a redraw - $table.css("display"); - - // Run sorting asynchronously on a timout to force browser redraw after - // `beforetablesort` callback. Also avoids locking up the browser too much. - setTimeout(function() { - // Gather the elements for this column - var column = []; - var sortFns = $table.data('sortFns'); - var sortMethod = sortFns[datatype]; - var trs = $table.children("tbody").children("tr"); - - // Extract the data for the column that needs to be sorted and pair it up - // with the TR itself into a tuple. This way sorting the values will - // incidentally sort the trs. - trs.each(function(index,tr) { - var $e = $(tr).children().eq(th_index); - var sort_val = $e.data("sort-value"); - - // Store and read from the .data cache for display text only sorts - // instead of looking through the DOM every time - if(typeof(sort_val) === "undefined"){ - var txt = $e.text(); - $e.data('sort-value', txt); - sort_val = txt; - } - column.push([sort_val, tr]); - }); - - // Sort by the data-order-by value - column.sort(function(a, b) { return sortMethod(a[0], b[0]); }); - if (sort_dir != dir.ASC) - column.reverse(); - - // Replace the content of tbody with the sorted rows. Strangely - // enough, .append accomplishes this for us. - trs = $.map(column, function(kv) { return kv[1]; }); - $table.children("tbody").append(trs); - - // Reset siblings - $table.find("th").data("sort-dir", null).removeClass("sorting-desc sorting-asc"); - $this_th.data("sort-dir", sort_dir).addClass("sorting-"+sort_dir); - - $table.trigger("aftertablesort", {column: th_index, direction: sort_dir}); - $table.css("display"); - }, 10); - - return $this_th; - }; - - // Call on a sortable td to update its value in the sort. This should be the - // only mechanism used to update a cell's sort value. If your display value is - // different from your sort value, use jQuery's .text() or .html() to update - // the td contents, Assumes stupidtable has already been called for the table. - $.fn.updateSortVal = function(new_sort_val){ - var $this_td = $(this); - if($this_td.is('[data-sort-value]')){ - // For visual consistency with the .data cache - $this_td.attr('data-sort-value', new_sort_val); - } - $this_td.data("sort-value", new_sort_val); - return $this_td; - }; - - // ------------------------------------------------------------------ - // Default settings - // ------------------------------------------------------------------ - $.fn.stupidtable.dir = {ASC: "asc", DESC: "desc"}; - $.fn.stupidtable.default_sort_fns = { - "int": function(a, b) { - return parseInt(a, 10) - parseInt(b, 10); - }, - "float": function(a, b) { - return parseFloat(a) - parseFloat(b); - }, - "string": function(a, b) { - return a.localeCompare(b); - }, - "string-ins": function(a, b) { - a = a.toLocaleLowerCase(); - b = b.toLocaleLowerCase(); - return a.localeCompare(b); - } - }; -})(jQuery); diff --git a/pagure/static/vendor/stupidtable/stupidtable-1.0.1.min.js b/pagure/static/vendor/stupidtable/stupidtable-1.0.1.min.js deleted file mode 100644 index bc7bfd3..0000000 --- a/pagure/static/vendor/stupidtable/stupidtable-1.0.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -(function(c){c.fn.stupidtable=function(b){return this.each(function(){var a=c(this);b=b||{};b=c.extend({},c.fn.stupidtable.default_sort_fns,b);a.data("sortFns",b);a.on("click.stupidtable","thead th",function(){c(this).stupidsort()})})};c.fn.stupidsort=function(b){var a=c(this),g=0,f=c.fn.stupidtable.dir,e=a.closest("table"),k=a.data("sort")||null;if(null!==k){a.parents("tr").find("th").slice(0,c(this).index()).each(function(){var a=c(this).attr("colspan")||1;g+=parseInt(a,10)});var d;1==arguments.length? -d=b:(d=b||a.data("sort-default")||f.ASC,a.data("sort-dir")&&(d=a.data("sort-dir")===f.ASC?f.DESC:f.ASC));e.trigger("beforetablesort",{column:g,direction:d});e.css("display");setTimeout(function(){var b=[],l=e.data("sortFns")[k],h=e.children("tbody").children("tr");h.each(function(a,e){var d=c(e).children().eq(g),f=d.data("sort-value");"undefined"===typeof f&&(f=d.text(),d.data("sort-value",f));b.push([f,e])});b.sort(function(a,b){return l(a[0],b[0])});d!=f.ASC&&b.reverse();h=c.map(b,function(a){return a[1]}); -e.children("tbody").append(h);e.find("th").data("sort-dir",null).removeClass("sorting-desc sorting-asc");a.data("sort-dir",d).addClass("sorting-"+d);e.trigger("aftertablesort",{column:g,direction:d});e.css("display")},10);return a}};c.fn.updateSortVal=function(b){var a=c(this);a.is("[data-sort-value]")&&a.attr("data-sort-value",b);a.data("sort-value",b);return a};c.fn.stupidtable.dir={ASC:"asc",DESC:"desc"};c.fn.stupidtable.default_sort_fns={"int":function(b,a){return parseInt(b,10)-parseInt(a,10)}, -"float":function(b,a){return parseFloat(b)-parseFloat(a)},string:function(b,a){return b.localeCompare(a)},"string-ins":function(b,a){b=b.toLocaleLowerCase();a=a.toLocaleLowerCase();return b.localeCompare(a)}}})(jQuery); diff --git a/pagure/static/vendor/stupidtable/stupidtable.js b/pagure/static/vendor/stupidtable/stupidtable.js deleted file mode 120000 index eb10d05..0000000 --- a/pagure/static/vendor/stupidtable/stupidtable.js +++ /dev/null @@ -1 +0,0 @@ -stupidtable-1.0.1.js \ No newline at end of file diff --git a/pagure/static/vendor/stupidtable/stupidtable.min.js b/pagure/static/vendor/stupidtable/stupidtable.min.js deleted file mode 120000 index 8a5a092..0000000 --- a/pagure/static/vendor/stupidtable/stupidtable.min.js +++ /dev/null @@ -1 +0,0 @@ -stupidtable-1.0.1.min.js \ No newline at end of file diff --git a/pagure/templates/issues.html b/pagure/templates/issues.html index dadb503..b8c5841 100644 --- a/pagure/templates/issues.html +++ b/pagure/templates/issues.html @@ -263,10 +263,7 @@ issue.last_updated | humanize}} {% endif %} -