(function(f){f.fn.stupidtable=function(j){return this.each(function(){var k=f(this);j=j||{};j=f.extend({},{"int":function(d,a){return parseInt(d,10)-parseInt(a,10)},"float":function(d,a){return parseFloat(d)-parseFloat(a)},string:function(d,a){return d<a?-1:d>a?1:0}},j);k.on("click","th",function(){var d=k.children("tbody").children("tr"),a=f(this),l=0;k.find("th").slice(0,a.index()).each(function(){var a=f(this).attr("colspan")||1;l+=parseInt(a)});var e=a.data("sort")||null;if(e){var c=j[e],g=[];
    d.each(function(a,c){var b=f(c).children().eq(l),b=b.data("sort-value")||b.text();g.push(b)});var e=[],b=g.slice(0),h=g.slice(0).reverse(),i=g.slice(0).sort(c);if((b&&i&&!(b<i||i<b)||h&&i&&!(h<i||i<h))&&null!==a.data("sort-dir")){g.reverse();for(c=g.length-1;0<=c;c--)e.push(c)}else{e=g.slice(0).sort(c);c=[];for(h=b=0;h<g.length;h++){for(b=f.inArray(g[h],e);-1!=f.inArray(b,c);)b++;c.push(b)}e=c}c="asc"===a.data("sort-dir")?"desc":"asc";a.siblings("th").data("sort-dir",null);a.data("sort-dir",c);a=
    e;e=d.slice(0);for(b=0;b<a.length;b++)newIndex=a[b],e[newIndex]=d[b];d=f(e);k.children("tbody").append(d);k.trigger("aftertablesort",{column:l,direction:c})}})})}})(jQuery);

@@ -32,17 +32,17 @@
 unction(
-j
+k
 )%7Breturn
@@ -67,17 +67,17 @@
 n()%7Bvar 
-k
+h
 =f(this)
@@ -81,17 +81,17 @@
 is);
-j=j
+k=k
 %7C%7C%7B%7D;
-j
+k
 =f.e
@@ -265,12 +265,12 @@
 0%7D%7D,
-j);k
+k);h
 .on(
@@ -299,17 +299,17 @@
 )%7Bvar d=
-k
+h
 .childre
@@ -348,17 +348,17 @@
 is),l=0;
-k
+h
 .find(%22t
@@ -485,17 +485,17 @@
 )%7Bvar c=
-j
+k
 %5Be%5D,g=%5B%5D
@@ -496,20 +496,16 @@
 %5D,g=%5B%5D;%0A
-    
 d.each(f
@@ -612,17 +612,17 @@
 lice(0),
-h
+i
 =g.slice
@@ -635,17 +635,17 @@
 verse(),
-i
+j
 =g.slice
@@ -667,40 +667,40 @@
 (b&&
-i
+j
 &&!(b%3C
-i%7C%7Ci
+j%7C%7Cj
 %3Cb)%7C%7C
-h&&i
+i&&j
 &&!(
-h%3Ci%7C%7Ci%3Ch
+i%3Cj%7C%7Cj%3Ci
 ))&&
@@ -813,15 +813,15 @@
 for(
-h
+i
 =b=0;
-h
+i
 %3Cg.l
@@ -826,17 +826,17 @@
 .length;
-h
+i
 ++)%7Bfor(
@@ -849,17 +849,17 @@
 Array(g%5B
-h
+i
 %5D,e);-1!
@@ -939,18 +939,14 @@
 sc%22;
-a.siblings
+h.find
 (%22th
@@ -973,37 +973,148 @@
 ull)
-;a.data(%22sort-dir%22,c);a=%0A    
+.removeClass(%22sorting-desc sorting-asc%22);%0Aa.data(%22sort-dir%22,c).addClass(%22sorting-%22+c);h.trigger(%22beforetablesort%22,%7Bcolumn:l,direction:c%7D);a=
 e;e=
@@ -1185,17 +1185,17 @@
 ;d=f(e);
-k
+h
 .childre
@@ -1215,17 +1215,17 @@
 pend(d);
-k
+h
 .trigger

Update minified js