| (function(e,t,undefined){function a(){var t=this;t.name="Footable Sortable",t.init=function(a){t.footable=a,a.options.sort===!0&&e(a.table).unbind(".sorting").bind({"footable_initialized.sorting":function(){var o,i,n=e(a.table),r=(n.find("> tbody"),a.options.classes.sort);if(n.data("sort")!==!1){n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").each(function(){i=e(this),o=a.columns[i.index()],o.sort.ignore===!0||i.hasClass(r.sortable)||(i.addClass(r.sortable),e("<span />").addClass(r.indicator).appendTo(i))}),n.find("> thead > tr:last-child > th."+r.sortable+", > thead > tr:last-child > td."+r.sortable).unbind("click.footable").bind("click.footable",function(a){a.preventDefault(),i=e(this);var o=!i.hasClass(r.sorted);return t.doSort(i.index(),o),!1});var l=!1;for(var s in a.columns)if(o=a.columns[s],o.sort.initial){var d="descending"!==o.sort.initial;t.doSort(o.index,d);break}l&&a.bindToggleSelectors()}},"footable_redrawn.sorting":function(){var o=e(a.table),i=a.options.classes.sort;o.data("sorted")>=0&&o.find("> thead > tr:last-child > th").each(function(a){var o=e(this);return o.hasClass(i.sorted)||o.hasClass(i.descending)?(t.doSort(a),undefined):undefined})},"footable_column_data.sorting":function(t){var a=e(t.column.th);t.column.data.sort=t.column.data.sort||{},t.column.data.sort.initial=a.data("sort-initial")||!1,t.column.data.sort.ignore=a.data("sort-ignore")||!1,t.column.data.sort.selector=a.data("sort-selector")||null;var o=a.data("sort-match")||0;o>=t.column.data.matches.length&&(o=0),t.column.data.sort.match=t.column.data.matches[o]}}).data("footable-sort",t)},t.doSort=function(a,o){var i=t.footable;if(e(i.table).data("sort")!==!1){var n=e(i.table),r=n.find("> tbody"),l=i.columns[a],s=n.find("> thead > tr:last-child > th:eq("+a+")"),d=i.options.classes.sort,f=i.options.events.sort;if(o=o===undefined?s.hasClass(d.sorted):"toggle"===o?!s.hasClass(d.sorted):o,l.sort.ignore===!0)return!0;var u=i.raise(f.sorting,{column:l,direction:o?"ASC":"DESC"});u&&u.result===!1||(n.data("sorted",l.index),n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").not(s).removeClass(d.sorted+" "+d.descending),o===undefined&&(o=s.hasClass(d.sorted)),o?s.removeClass(d.descending).addClass(d.sorted):s.removeClass(d.sorted).addClass(d.descending),t.sort(i,r,l,o),i.bindToggleSelectors(),i.raise(f.sorted,{column:l,direction:o?"ASC":"DESC"}))}},t.rows=function(t,a,o){var i=[];return a.find("> tr").each(function(){var a=e(this),n=null;if(a.hasClass(t.options.classes.detail))return!0;a.next().hasClass(t.options.classes.detail)&&(n=a.next().get(0));var r={row:a,detail:n};return o!==undefined&&(r.value=t.parse(this.cells[o.sort.match],o)),i.push(r),!0}).detach(),i},t.sort=function(e,a,o,i){var n=t.rows(e,a,o),r=e.options.sorters[o.type]||e.options.sorters.alpha;n.sort(function(e,t){return i?r(e.value,t.value):r(t.value,e.value)});for(var l=0;n.length>l;l++)a.append(n[l].row),null!==n[l].detail&&a.append(n[l].detail)}}if(t.footable===undefined||null===t.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var o={sort:!0,sorters:{alpha:function(e,t){return e===t?0:t>e?-1:1},numeric:function(e,t){return e-t}},classes:{sort:{sortable:"footable-sortable",sorted:"footable-sorted",descending:"footable-sorted-desc",indicator:"footable-sort-indicator"}},events:{sort:{sorting:"footable_sorting",sorted:"footable_sorted"}}};t.footable.plugins.register(a,o)})(jQuery,window);
| | mw.loader.load("//zlb.uni-due.de/wiki/skins/footable.sort.min.js"); |