diff --git a/classes/lnApp/HTMLRender.php b/classes/lnApp/HTMLRender.php index b624582..92d32ac 100644 --- a/classes/lnApp/HTMLRender.php +++ b/classes/lnApp/HTMLRender.php @@ -11,7 +11,7 @@ * @license http://dev.leenooks.net/license.html */ abstract class lnApp_HTMLRender { - protected static $_unique_vals = array(); + protected $_unique_vals = array(); protected $_x = 0; abstract protected function render(); @@ -25,6 +25,16 @@ abstract class lnApp_HTMLRender { if (! $args) return static::$_data[$c][$name]; + // Strip out unique values + if (in_array($name,$this->_unique_vals)) + foreach ($args as $u) + foreach (static::$_data as $d) + if (isset($d[$name]) AND $d[$name] == $u) { + unset(static::$_data[$c]); + + return $this; + } + static::$_data[$c][$name] = array_pop($args); return $this; @@ -44,13 +54,11 @@ abstract class lnApp_HTMLRender { if (empty(static::$_data[$this->_x])) $this->record(); - return $this->render(); try { return $this->render(); - } // Display the exception message - catch (Exception $e) { + } catch (Exception $e) { return $e->getMessage(); } } diff --git a/classes/lnApp/Script.php b/classes/lnApp/Script.php index fba7f5e..2ae6a57 100644 --- a/classes/lnApp/Script.php +++ b/classes/lnApp/Script.php @@ -14,6 +14,7 @@ abstract class lnApp_Script extends HTMLRender { protected static $_spacer = "\n"; protected static $_c = 0; protected $_items = array('data','media','type'); + protected $_unique_vals = array('data'); protected static $_required_keys = array('type','data'); diff --git a/classes/lnApp/Style.php b/classes/lnApp/Style.php index 97803a3..df2dba3 100644 --- a/classes/lnApp/Style.php +++ b/classes/lnApp/Style.php @@ -14,6 +14,7 @@ abstract class lnApp_Style extends HTMLRender { protected static $_spacer = "\n"; protected static $_c = 0; protected $_items = array('data','media','type'); + protected $_unique_vals = array('data'); protected static $_required_keys = array('type','data'); diff --git a/classes/lnApp/Table.php b/classes/lnApp/Table.php index 4f57d4d..e1b7c5b 100644 --- a/classes/lnApp/Table.php +++ b/classes/lnApp/Table.php @@ -201,6 +201,9 @@ $(document).ready(function() { widthFixed : true, headerTemplate : "{content} {icon}", // Add icon for jui theme; new in v2.7! widgets: [ "uitheme", "stickyHeaders", "filter" ], + widgetOptions : { + stickyHeaders_offset: ".navbar-fixed-top", + } }).tablesorterPager({ // target the pager markup - see the HTML block below @@ -232,6 +235,10 @@ $(document).ready(function() { Style::factory() ->type('file') ->data('media/vendor/mottie-tablesorter/css/jquery.tablesorter.pager.css'); + // @todo The theme should be moved from here, but Controller_Media will need to know about admin requests for media/ + Style::factory() + ->type('file') + ->data('media/theme/baseadmin/css/custom/tablesort.css'); } if ($this->select) { diff --git a/media/theme/baseadmin/css/custom/tablesort.css b/media/theme/baseadmin/css/custom/tablesort.css new file mode 100644 index 0000000..6c03ecf --- /dev/null +++ b/media/theme/baseadmin/css/custom/tablesort.css @@ -0,0 +1,3 @@ +.table-striped td { + padding-left: 10px; +} diff --git a/media/vendor/mottie-tablesorter/css/jquery.tablesorter.pager.css b/media/vendor/mottie-tablesorter/css/jquery.tablesorter.pager.css index 83c8c3d..e77cd88 100644 --- a/media/vendor/mottie-tablesorter/css/jquery.tablesorter.pager.css +++ b/media/vendor/mottie-tablesorter/css/jquery.tablesorter.pager.css @@ -1,12 +1,16 @@ /* pager wrapper, div */ .tablesorter-pager { - font-size: 14px; + padding: 5px; +} +/* pager wrapper, in thead/tfoot */ +td.tablesorter-pager { + background-color: #e6eeee; + margin: 0; /* needed for bootstrap .pager gets a 18px bottom margin */ } - /* pager navigation arrows */ -.tablesorter-pager [class^="icon-"] { +.tablesorter-pager img { vertical-align: middle; - margin-right: 4px; + margin-right: 2px; cursor: pointer; } @@ -22,8 +26,6 @@ .tablesorter-pager select { margin: 0; padding: 0; - height: 25px; - font-size: 12px; } /*** css used when "updateArrows" option is true ***/ @@ -37,4 +39,4 @@ opacity: 0.5; filter: alpha(opacity=50); cursor: default; -} +} \ No newline at end of file diff --git a/media/vendor/mottie-tablesorter/css/theme.bootstrap.css b/media/vendor/mottie-tablesorter/css/theme.bootstrap.css index 1a02458..4c67f59 100644 --- a/media/vendor/mottie-tablesorter/css/theme.bootstrap.css +++ b/media/vendor/mottie-tablesorter/css/theme.bootstrap.css @@ -94,6 +94,7 @@ caption { } .tablesorter-bootstrap .tablesorter-filter-row .tablesorter-filter.disabled { background: #eee; + cursor: not-allowed; } .tablesorter-bootstrap .tablesorter-filter-row td { background: #eee; @@ -131,6 +132,8 @@ caption { border: 0; } -.table-striped td { - padding-left: 15px; +/* ajax error row */ +.tablesorter .tablesorter-errorRow td { + cursor: pointer; + background-color: #e6bf99; } diff --git a/media/vendor/mottie-tablesorter/js/jquery.tablesorter.min.js b/media/vendor/mottie-tablesorter/js/jquery.tablesorter.min.js index 730df63..747c898 100644 --- a/media/vendor/mottie-tablesorter/js/jquery.tablesorter.min.js +++ b/media/vendor/mottie-tablesorter/js/jquery.tablesorter.min.js @@ -1,5 +1,5 @@ /*! -* TableSorter 2.9.1 min - Client-side table sorting with ease! +* TableSorter 2.10.0 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ -!function(f){f.extend({tablesorter:new function(){function d(c){"undefined"!==typeof console&&"undefined"!==typeof console.log?console.log(c):alert(c)}function w(c,b){d(c+" ("+((new Date).getTime()-b.getTime())+"ms)")}function r(c,b,a){if(!b)return"";var e=c.config,d=e.textExtraction,m="",m="simple"===d?e.supportsTextContent?b.textContent:f(b).text():"function"===typeof d?d(b,c,a):"object"===typeof d&&d.hasOwnProperty(a)?d[a](b,c,a):e.supportsTextContent?b.textContent:f(b).text();return f.trim(m)} function j(c){var b=c.config,a=b.$tbodies=b.$table.children("tbody:not(."+b.cssInfoBlock+")"),e,t,m,p,k,n,h="";if(0===a.length)return b.debug?d("*Empty table!* Not building a parser cache"):"";a=a[0].rows;if(a[0]){e=[];t=a[0].cells.length;for(m=0;m':"";x.$headers=f(c).find(x.selectorHeaders).each(function(c){u=f(this);v=x.headers[c];x.headerContent[c]=this.innerHTML;A=x.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,B);x.onRenderTemplate&&(z=x.onRenderTemplate.apply(u,[c,A]))&&"string"===typeof z&&(A=z);this.innerHTML='
'+A+"
";x.onRenderHeader&&x.onRenderHeader.apply(u,[c]);this.column=a[this.parentNode.rowIndex+"-"+ this.cellIndex];var b=g.getData(u,v,"sortInitialOrder")||x.sortInitialOrder;this.order=/^d/i.test(b)||1===b?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;y=g.getData(u,v,"lockedOrder")||!1;"undefined"!==typeof y&&!1!==y&&(this.order=this.lockedOrder=/^d/i.test(y)||1===y?[1,1,1]:[0,0,0]);u.addClass(x.cssHeader);x.headerList[c]=this;u.parent().addClass(x.cssHeaderRow)});E(c);x.debug&&(w("Built headers:",D),d(x.$headers))}function A(c,b,a){var e=f(c);e.find(c.config.selectorRemove).remove();j(c); s(c);D(e,b,a)}function E(c){var b,a=c.config;a.$headers.each(function(c,d){b="false"===g.getData(d,a.headers[c],"sorter");d.sortDisabled=b;f(d)[b?"addClass":"removeClass"]("sorter-false")})}function y(c){var b,a,e,d=c.config,m=d.sortList,p=[d.cssAsc,d.cssDesc],k=f(c).find("tfoot tr").children().removeClass(p.join(" "));d.$headers.removeClass(p.join(" "));e=m.length;for(b=0;bn&&(l.sortList.push([h,n]),1n&&(l.sortList.push([h,n]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.benchmark=w;g.construct=function(c){return this.each(function(){if(!this.tHead|| 0===this.tBodies.length||!0===this.hasInitialized)return this.config&&this.config.debug?d("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var b=f(this),a=this,e,t="",m=f.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config={};e=f.extend(!0,a.config,g.defaults,c);f.data(a,"tablesorter",e);e.debug&&f.data(a,"startoveralltimer",new Date);e.supportsTextContent="x"===f("x")[0].textContent;e.supportsDataObject=1.4<=parseFloat(f.fn.jquery);e.string= {max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(b.attr("class"))||(t=""!==e.theme?" tablesorter-"+e.theme:"");e.$table=b.addClass(e.tableClass+t);e.$tbodies=b.children("tbody:not(."+e.cssInfoBlock+")");z(a);if(a.config.widthFixed&&0===f(a).find("colgroup").length){var p=f(""),k=f(a).width();f(a.tBodies[0]).find("tr:first").children("td").each(function(){p.append(f("").css("width",parseInt(1E3*(f(this).width()/k),10)/10+"%"))});f(a).prepend(p)}j(a); e.delayInit||s(a);I(a);e.supportsDataObject&&"undefined"!==typeof b.data().sortlist?e.sortList=b.data().sortlist:m&&(b.metadata()&&b.metadata().sortlist)&&(e.sortList=b.metadata().sortlist);g.applyWidget(a,!0);0'),a=f.fn.detach?b.detach():b.remove();a=f(c).find("span.tablesorter-savemyplace");b.insertAfter(a);a.remove();c.isProcessing=!1};g.clearTableBody=function(c){f(c)[0].config.$tbodies.empty()};g.restoreHeaders=function(c){var b=c.config;b.$headers.each(function(a){f(this).find(".tablesorter-header-inner").length&&f(this).html(b.headerContent[a])})};g.destroy=function(c,b,a){c=f(c)[0];if(c.hasInitialized){g.refreshWidgets(c, !0,!0);var e=f(c),d=c.config,m=e.find("thead:first"),p=m.find("tr."+d.cssHeaderRow).removeClass(d.cssHeaderRow),k=e.find("tfoot:first > tr").children("th, td");m.find("tr").not(p).remove();e.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave sortBegin sortEnd ".split(" ").join(".tablesorter "));d.$headers.add(k).removeClass(d.cssHeader+" "+d.cssAsc+" "+d.cssDesc).removeAttr("data-column"); p.find(d.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter");g.restoreHeaders(c);!1!==b&&e.removeClass(d.tableClass+" tablesorter-"+d.theme);c.hasInitialized=!1;"function"===typeof a&&a(c)}};g.regex=[/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];g.sortText=function(c,b,a,e){if(b===a)return 0;var d=c.config,m=d.string[d.empties[e]|| d.emptyTo],f=g.regex;if(""===b&&0!==m)return"boolean"===typeof m?m?-1:1:-m||-1;if(""===a&&0!==m)return"boolean"===typeof m?m?1:-1:m||1;if("function"===typeof d.textSorter)return d.textSorter(b,a,c,e);c=b.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");e=a.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");b=parseInt(b.match(f[2]),16)||1!==c.length&&b.match(f[1])&&Date.parse(b);if(a=parseInt(a.match(f[2]),16)||b&&a.match(f[1])&&Date.parse(a)||null){if(b< a)return-1;if(b>a)return 1}d=Math.max(c.length,e.length);for(b=0;bf)return 1}return 0};g.sortTextDesc=function(c,b,a,e){if(b===a)return 0;var d=c.config,f=d.string[d.empties[e]||d.emptyTo];return""===b&&0!==f?"boolean"===typeof f?f?-1:1:f||1:""===a&&0!==f?"boolean"===typeof f?f?1:-1:-f||-1:"function"===typeof d.textSorter? d.textSorter(a,b,c,e):g.sortText(c,a,b)};g.getTextValue=function(c,b,a){if(b){var e=c?c.length:0,d=b+a;for(b=0;bf.inArray(p[e].id,m)))j.debug&&d("Refeshing widgets: Removing "+p[e].id),p[e].hasOwnProperty("remove")&&p[e].remove(c,j,j.widgetOptions);!0!==a&&g.applyWidget(c,b)};g.getData=function(c,b,a){var d="";c=f(c);var g,m;if(!c.length)return"";g=f.metadata?c.metadata():!1;m=" "+(c.attr("class")||"");"undefined"!==typeof c.data(a)||"undefined"!==typeof c.data(a.toLowerCase())?d+=c.data(a)||c.data(a.toLowerCase()):g&&"undefined"!==typeof g[a]?d+=g[a]:b&&"undefined"!==typeof b[a]?d+=b[a]:" "!==m&&m.match(" "+ a+"-")&&(d=m.match(RegExp("\\s"+a+"-([\\w-]+)"))[1]||"");return f.trim(d)};g.formatFloat=function(c,b){if("string"!==typeof c||""===c)return c;var a;c=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));a=parseFloat(c);return isNaN(a)?f.trim(c):a};g.isDigit=function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'"\s]/g,"")):!0}}}); var j=f.tablesorter;f.fn.extend({tablesorter:j.construct});j.addParser({id:"text",is:function(){return!0},format:function(d,w){var r=w.config;d&&(d=f.trim(r.ignoreCase?d.toLocaleLowerCase():d),d=r.sortLocaleCompare?j.replaceAccents(d):d);return d},type:"text"});j.addParser({id:"digit",is:function(d){return j.isDigit(d)},format:function(d,f){return d?j.formatFloat(d.replace(/[^\w,. \-()]/g,""),f):d},type:"numeric"});j.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d|| "").replace(/[,. ]/g,""))},format:function(d,f){return d?j.formatFloat(d.replace(/[^\w,. \-()]/g,""),f):d},type:"numeric"});j.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,f){var r,u=d?d.split("."):"",s="",v=u.length;for(r=0;r':"";x.$headers=f(d).find(x.selectorHeaders).each(function(d){v=f(this);w=x.headers[d];x.headerContent[d]=this.innerHTML;A=x.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,B);x.onRenderTemplate&&(z=x.onRenderTemplate.apply(v,[d,A]))&&"string"===typeof z&&(A=z);this.innerHTML='
'+A+"
";x.onRenderHeader&&x.onRenderHeader.apply(v,[d]);this.column=b[this.parentNode.rowIndex+"-"+ this.cellIndex];var a=g.getData(v,w,"sortInitialOrder")||x.sortInitialOrder;this.order=/^d/i.test(a)||1===a?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;y=g.getData(v,w,"lockedOrder")||!1;"undefined"!==typeof y&&!1!==y&&(this.order=this.lockedOrder=/^d/i.test(y)||1===y?[1,1,1]:[0,0,0]);v.addClass(x.cssHeader);x.headerList[d]=this;v.parent().addClass(x.cssHeaderRow)});E(d);x.debug&&(t("Built headers:",D),c(x.$headers))}function A(d,a,b){var e=f(d);e.find(d.config.selectorRemove).remove();j(d); s(d);D(e,a,b)}function E(d){var a,b=d.config;b.$headers.each(function(d,c){a="false"===g.getData(c,b.headers[d],"sorter");c.sortDisabled=a;f(c)[a?"addClass":"removeClass"]("sorter-false")})}function y(d){var a,b,e,c=d.config,l=c.sortList,p=[c.cssAsc,c.cssDesc],k=f(d).find("tfoot tr").children().removeClass(p.join(" "));c.$headers.removeClass(p.join(" "));e=l.length;for(a=0;an&&(m.sortList.push([h,n]),1n&&(m.sortList.push([h,n]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.benchmark=t;g.construct= function(d){return this.each(function(){if(!this.tHead||0===this.tBodies.length||!0===this.hasInitialized)return this.config&&this.config.debug?c("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var a=f(this),b=this,e,u="",l=f.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config={};e=f.extend(!0,b.config,g.defaults,d);f.data(b,"tablesorter",e);e.debug&&f.data(b,"startoveralltimer",new Date);e.supportsTextContent="x"===f("x")[0].textContent; e.supportsDataObject=1.4<=parseFloat(f.fn.jquery);e.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(a.attr("class"))||(u=""!==e.theme?" tablesorter-"+e.theme:"");e.$table=a.addClass(e.tableClass+u);e.$tbodies=a.children("tbody:not(."+e.cssInfoBlock+")");z(b);if(b.config.widthFixed&&0===f(b).find("colgroup").length){var p=f(""),k=f(b).width();f(b.tBodies[0]).find("tr:first").children("td").each(function(){p.append(f("").css("width", parseInt(1E3*(f(this).width()/k),10)/10+"%"))});f(b).prepend(p)}j(b);e.delayInit||s(b);I(b);e.supportsDataObject&&"undefined"!==typeof a.data().sortlist?e.sortList=a.data().sortlist:l&&(a.metadata()&&a.metadata().sortlist)&&(e.sortList=a.metadata().sortlist);g.applyWidget(b,!0);0'),b=f.fn.detach?a.detach():a.remove();b=f(d).find("span.tablesorter-savemyplace");a.insertAfter(b);b.remove();d.isProcessing=!1};g.clearTableBody=function(d){f(d)[0].config.$tbodies.empty()};g.restoreHeaders=function(d){var a=d.config;a.$headers.each(function(b){f(this).find(".tablesorter-header-inner").length&&f(this).html(a.headerContent[b])})};g.destroy= function(d,a,b){d=f(d)[0];if(d.hasInitialized){g.refreshWidgets(d,!0,!0);var e=f(d),c=d.config,l=e.find("thead:first"),p=l.find("tr."+c.cssHeaderRow).removeClass(c.cssHeaderRow),k=e.find("tfoot:first > tr").children("th, td");l.find("tr").not(p).remove();e.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave sortBegin sortEnd ".split(" ").join(".tablesorter "));c.$headers.add(k).removeClass(c.cssHeader+ " "+c.cssAsc+" "+c.cssDesc).removeAttr("data-column");p.find(c.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter");g.restoreHeaders(d);!1!==a&&e.removeClass(c.tableClass+" tablesorter-"+c.theme);d.hasInitialized=!1;"function"===typeof b&&b(d)}};g.regex=[/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];g.sortText=function(d,a, b,e){if(a===b)return 0;var c=d.config,l=c.string[c.empties[e]||c.emptyTo],f=g.regex;if(""===a&&0!==l)return"boolean"===typeof l?l?-1:1:-l||-1;if(""===b&&0!==l)return"boolean"===typeof l?l?1:-1:l||1;if("function"===typeof c.textSorter)return c.textSorter(a,b,d,e);d=a.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");e=b.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");a=parseInt(a.match(f[2]),16)||1!==d.length&&a.match(f[1])&&Date.parse(a);if(b= parseInt(b.match(f[2]),16)||a&&b.match(f[1])&&Date.parse(b)||null){if(ab)return 1}c=Math.max(d.length,e.length);for(a=0;af)return 1}return 0};g.sortTextDesc=function(d,a,b,e){if(a===b)return 0;var c=d.config,f=c.string[c.empties[e]||c.emptyTo];return""===a&&0!==f?"boolean"===typeof f?f?-1:1: f||1:""===b&&0!==f?"boolean"===typeof f?f?1:-1:-f||-1:"function"===typeof c.textSorter?c.textSorter(b,a,d,e):g.sortText(d,b,a)};g.getTextValue=function(d,a,b){if(a){var c=d?d.length:0,g=a+b;for(a=0;af.inArray(p[e].id,l)))j.debug&&c("Refeshing widgets: Removing "+p[e].id),p[e].hasOwnProperty("remove")&&p[e].remove(d,j,j.widgetOptions);!0!==b&&g.applyWidget(d,a)};g.getData=function(d,a,b){var c="";d=f(d);var g,l;if(!d.length)return"";g=f.metadata?d.metadata():!1;l=" "+(d.attr("class")||"");"undefined"!==typeof d.data(b)||"undefined"!==typeof d.data(b.toLowerCase())?c+=d.data(b)||d.data(b.toLowerCase()): g&&"undefined"!==typeof g[b]?c+=g[b]:a&&"undefined"!==typeof a[b]?c+=a[b]:" "!==l&&l.match(" "+b+"-")&&(c=l.match(RegExp("\\s"+b+"-([\\w-]+)"))[1]||"");return f.trim(c)};g.formatFloat=function(c,a){if("string"!==typeof c||""===c)return c;var b;c=(a&&a.config?!1!==a.config.usNumberFormat:"undefined"!==typeof a?a:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));b=parseFloat(c);return isNaN(b)?f.trim(c):b};g.isDigit= function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'"\s]/g,"")):!0}}});var j=f.tablesorter;f.fn.extend({tablesorter:j.construct});j.addParser({id:"text",is:function(){return!0},format:function(c,t){var r=t.config;c&&(c=f.trim(r.ignoreCase?c.toLocaleLowerCase():c),c=r.sortLocaleCompare?j.replaceAccents(c):c);return c},type:"text"});j.addParser({id:"digit",is:function(c){return j.isDigit(c)},format:function(c,t){var r=j.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),t);return c&& "number"===typeof r?r:c?f.trim(c&&t.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});j.addParser({id:"currency",is:function(c){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((c||"").replace(/[,. ]/g,""))},format:function(c,t){var r=j.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),t);return c&&"number"===typeof r?r:c?f.trim(c&&t.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});j.addParser({id:"ipAddress",is:function(c){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(c)}, format:function(c,f){var r,v=c?c.split("."):"",s="",w=v.length;for(r=0;ra.filteredRows,a.startRow=h?1:a.size*a.page+1,a.page=h?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),f=d(a.cssPageDisplay,a.container),c=a.output.replace(/\{(page|filteredRows|filteredPages|totalPages|startRow|endRow|totalRows)\}/gi,function(b){return{"{page}":a.page+1,"{filteredRows}":a.filteredRows,"{filteredPages}":a.filteredPages,"{totalPages}":a.totalPages, "{startRow}":a.startRow,"{endRow}":a.endRow,"{totalRows}":a.totalRows}[b]}),f[0]&&(f["INPUT"===f[0].tagName?"val":"html"](c),d(a.cssGoto,a.container).length))){h="";f=Math.min(a.totalPages,a.filteredPages);for(c=1;c<=f;c++)h+="";d(a.cssGoto,a.container).html(h).val(a.page+1)}v(a);a.initialized&&d(b).trigger("pagerComplete",a)},t=function(b,a){var c,f=d(b.tBodies[0]);if(a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),c=d.data(b,"pagerSavedHeight")))c-=f.height(), 5')},y=function(b,a){var c=d(b.tBodies[0]);c.find("tr.pagerSavedHeightSpacer").remove();d.data(b,"pagerSavedHeight",c.height());t(b,a);d.data(b,"pagerLastSize",a.size)},q=function(b,a){if(!a.ajaxUrl){var c,f=d(b.tBodies).children("tr:not(."+b.config.cssChildRow+")"),h=f.length,e=a.page*a.size, g=e+a.size,k=0;for(c=0;c=e&&k'+(f?f.message+" ("+f.name+")":"No rows found")+"";h=c.ajaxProcessing(b)||[0,[]];b=isNaN(h[0])&&!isNaN(h[1]);c.totalRows=h[b?1:0]||0;b=h[b?0:1]||[];w=b.length;j=h[2];if(0";for(e=0;e"+b[h][e]+"";r+=""}j&&j.length===m&&(g=n.hasClass("hasStickyHeaders"),l=n.find("."+(p.widgetOptions&&p.widgetOptions.stickyHeaders||"tablesorter-stickyheader")), k=n.find("tfoot tr:first").children(),n.find("th."+p.cssHeader).each(function(a){var b=d(this),c;b.find("."+p.cssIcon).length?(c=b.find("."+p.cssIcon).clone(!0),b.find(".tablesorter-header-inner").html(j[a]).append(c),g&&l.length&&(c=l.find("th").eq(a).find("."+p.cssIcon).clone(!0),l.find("th").eq(a).find(".tablesorter-header-inner").html(j[a]).append(c))):(b.find(".tablesorter-header-inner").html(j[a]),l.find("th").eq(a).find(".tablesorter-header-inner").html(j[a]));k.eq(a).html(j[a])}));n.find("thead tr."+ c.cssErrorRow).remove();f?n.find("thead").append(q):d(a.tBodies[0]).html(r);p.showProcessing&&d.tablesorter.isProcessing(a);n.trigger("update");c.totalPages=Math.ceil(c.totalRows/c.size);s(a,c);t(a,c);c.initialized&&n.trigger("pagerChange",c)}c.initialized||(c.initialized=!0,d(a).trigger("pagerInitialized",c))},x=function(b,a,c){c.isDisabled=!1;var f,h,e,g=document.createDocumentFragment(),k=a.length;f=c.page*c.size;var l=f+c.size;if(!(1>k)){c.initialized&&d(b).trigger("pagerChange",c);if(c.removeRows){l> a.length&&(l=a.length);d(b.tBodies[0]).addClass("tablesorter-hidden");for(d.tablesorter.clearTableBody(b);f=c.totalPages&&B(b,c);s(b,c);c.isDisabled||t(b,c);d(b).trigger("applyWidgets")}},C=function(b,a){a.ajax?v(a,!0):(a.isDisabled=!0,d.data(b,"pagerLastPage",a.page),d.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages= 1,d("tr.pagerSavedHeightSpacer",b.tBodies[0]).remove(),x(b,b.config.rowsCopy,a));d(a.container).find(a.cssPageSize+","+a.cssGoto).each(function(){d(this).addClass(a.cssDisabled)[0].disabled=!0})},m=function(b,a,c){if(!a.isDisabled){var f=Math.min(a.totalPages,a.filteredPages);0>a.page&&(a.page=0);a.page>f-1&&0!==f&&(a.page=f-1);if(a.ajax){var h,f=a.ajaxUrl?a.ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(b,c){return a.page+(c?parseInt(c,10):0)}).replace(/\{size\}/g,a.size):"",e=b.config.sortList, g=a.currentFilters||[],k=f.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),l=f.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),j=[];k&&(k=k[1],d.each(e,function(a,b){j.push(k+"["+b[0]+"]="+b[1])}),f=f.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,j.length?j.join("&"):k),j=[]);l&&(l=l[1],d.each(g,function(a,b){b&&j.push(l+"["+a+"]="+encodeURIComponent(b))}),f=f.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,j.length?j.join("&"):l));"function"===typeof a.customAjaxUrl&&(f=a.customAjaxUrl(b,f));h=f;f= b.config;""!==h&&(f.showProcessing&&d.tablesorter.isProcessing(b,!0),d(document).bind("ajaxError.pager",function(c,e,f,g){f.url===h&&(A(null,b,a,g),d(document).unbind("ajaxError.pager"))}),d.getJSON(h,function(c){A(c,b,a);d(document).unbind("ajaxError.pager")}))}else a.ajax||x(b,b.config.rowsCopy,a);d.data(b,"pagerLastPage",a.page);d.data(b,"pagerUpdateTriggered",!0);a.initialized&&!1!==c&&d(b).trigger("pageMoved",a)}},D=function(b,a,c){c.size=a;d.data(b,"pagerLastPage",c.page);d.data(b,"pagerLastSize", c.size);c.totalPages=Math.ceil(c.totalRows/c.size);m(b,c)},F=function(b,a){a.page=0;m(b,a)},B=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;m(b,a)},G=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);m(b,a)},H=function(b,a){a.page--;0>=a.page&&(a.page=0);m(b,a)},E=function(b,a,c){var f=d(a.cssPageSize,a.container).removeClass(a.cssDisabled).removeAttr("disabled");d(a.container).find(a.cssGoto).removeClass(a.cssDisabled).removeAttr("disabled"); a.isDisabled=!1;a.page=d.data(b,"pagerLastPage")||a.page||0;a.size=d.data(b,"pagerLastSize")||parseInt(f.find("option[selected]").val(),10)||a.size;f.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalPages,a.filteredPages)/a.size);c&&(d(b).trigger("update"),D(b,a.size,a),z(b,a),t(b,a))};u.appender=function(b,a){var c=b.config.pager;c.ajax||(b.config.rowsCopy=a,c.totalRows=a.length,c.size=d.data(b,"pagerLastSize")||c.size,c.totalPages=Math.ceil(c.totalRows/c.size),x(b,a,c))};u.construct=function(b){return this.each(function(){if(this.config&& this.hasInitialized){var a,c,f,h=this.config,e=h.pager=d.extend({},d.tablesorterPager.defaults,b),g=this,k=g.config,l=d(g),j=d(e.container).addClass("tablesorter-pager").show();h.appender=u.appender;l.unbind("filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager pageSize.pager").bind("filterStart.pager",function(a,b){d.data(g,"pagerUpdateTriggered",!1);e.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(){d.data(g,"pagerUpdateTriggered")? d.data(g,"pagerUpdateTriggered",!1):(m(g,e,!1),s(g,e),t(g,e))}).bind("disable.pager",function(a){a.stopPropagation();C(g,e)}).bind("enable.pager",function(a){a.stopPropagation();E(g,e,!0)}).bind("destroy.pager",function(a){a.stopPropagation();C(g,e);d(e.container).hide();g.config.appender=null;d(g).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager")}).bind("update.pager",function(a){a.stopPropagation();q(g,e)}).bind("pageSize.pager",function(a,b){a.stopPropagation();e.size= parseInt(b,10)||10;q(g,e);s(g,e)}).bind("pageSet.pager",function(a,b){a.stopPropagation();e.page=(parseInt(b,10)||1)-1;m(g,e);s(g,e)});c=[e.cssFirst,e.cssPrev,e.cssNext,e.cssLast];f=[F,H,G,B];j.find(c.join(",")).unbind("click.pager").bind("click.pager",function(){var a,b=d(this),h=c.length;if(!b.hasClass(e.cssDisabled))for(a=0;aa.filteredRows,a.startRow=g?1:0===a.filteredRows?0:a.size*a.page+1,a.page=g?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),c=a.$container.find(a.cssPageDisplay),e=a.output.replace(/\{(page|filteredRows|filteredPages|totalPages|startRow|endRow|totalRows)\}/gi, function(b){return{"{page}":a.page+1,"{filteredRows}":a.filteredRows,"{filteredPages}":a.filteredPages,"{totalPages}":a.totalPages,"{startRow}":a.startRow,"{endRow}":a.endRow,"{totalRows}":a.totalRows}[b]}),c.length&&(c["INPUT"===c[0].tagName?"val":"html"](e),a.$goto.length))){g="";c=Math.min(a.totalPages,a.filteredPages);for(e=1;e<=c;e++)g+="";a.$goto.html(g).val(a.page+1)}u(a);a.initialized&&!1!==d&&f(b).trigger("pagerComplete",a)},r=function(b,a){var d,e=b.config.$tbodies.eq(0); if(a.fixedHeight&&(e.find("tr.pagerSavedHeightSpacer").remove(),d=f.data(b,"pagerSavedHeight")))d-=e.height(),5')},w=function(b,a){var d=b.config.$tbodies.eq(0);d.find("tr.pagerSavedHeightSpacer").remove();f.data(b,"pagerSavedHeight",d.height());r(b,a);f.data(b,"pagerLastSize",a.size)},s=function(b, a){if(!a.ajaxUrl){var d;d=b.config;var e=d.$tbodies.eq(0).children("tr:not(."+d.cssChildRow+")"),c=e.length,f=a.page*a.size,p=f+a.size,k=d.widgetOptions&&d.widgetOptions.filter_filteredRow||"filtered",h=0;for(d=0;d=f&&h'+(0===e.status?"Not connected, verify Network":404===e.status?"Requested page not found [404]":500===e.status?"Internal Server Error [500]":"parsererror"===c?"Requested JSON parse failed":"timeout"===c?"Time out error":"abort"=== c?"Ajax Request aborted":"Uncaught error: "+e.statusText+" ["+e.status+"]")+"").click(function(){f(this).remove()}).appendTo(m.find("thead:first")),n.$tbodies.eq(0).empty();else{d.totalRows=b[g?1:0]||d.totalRows||0;e=b[g?0:1]||[];c=e.length;l=b[2];if(e instanceof jQuery)n.$tbodies.eq(0).empty().append(e);else if(e.length){if(0";for(g=0;g"+e[b][g]+"";j+=""}n.$tbodies.eq(0).html(j)}l&&l.length===y&&(h=(p=m.hasClass("hasStickyHeaders"))? n.$sticky.children("thead:first").children().children():"",k=m.find("tfoot tr:first").children(),m.find("th."+n.cssHeader).each(function(a){var b=f(this),c;b.find("."+n.cssIcon).length?(c=b.find("."+n.cssIcon).clone(!0),b.find(".tablesorter-header-inner").html(l[a]).append(c),p&&h.length&&(c=h.eq(a).find("."+n.cssIcon).clone(!0),h.eq(a).find(".tablesorter-header-inner").html(l[a]).append(c))):(b.find(".tablesorter-header-inner").html(l[a]),p&&h.length&&h.eq(a).find(".tablesorter-header-inner").html(l[a])); k.eq(a).html(l[a])}))}n.showProcessing&&f.tablesorter.isProcessing(a);m.trigger("update");d.totalPages=Math.ceil(d.totalRows/d.size);q(a,d);r(a,d);d.initialized&&m.trigger("pagerChange",d)}d.initialized||(d.initialized=!0,f(a).trigger("pagerInitialized",d))},v=function(b,a,d){d.isDisabled=!1;var e,c,g,j,k=a.length;e=d.page*d.size;var h=e+d.size;if(!(1>k)){d.initialized&&f(b).trigger("pagerChange",d);if(d.removeRows){h>a.length&&(h=a.length);f.tablesorter.clearTableBody(b);for(j=f.tablesorter.processTbody(b, b.config.$tbodies.eq(0),!0);e=d.totalPages&&A(b,d);q(b,d);d.isDisabled||r(b,d);f(b).trigger("applyWidgets")}},B=function(b,a){a.ajax?u(a,!0):(a.isDisabled=!0,f.data(b,"pagerLastPage",a.page),f.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,f(b).find("tr.pagerSavedHeightSpacer").remove(),v(b,b.config.rowsCopy,a));a.$size.add(a.$goto).each(function(){f(this).addClass(a.cssDisabled)[0].disabled= !0})},j=function(b,a,d){if(!a.isDisabled){var e=Math.min(a.totalPages,a.filteredPages);0>a.page&&(a.page=0);a.page>e-1&&0!==e&&(a.page=e-1);if(a.ajax){var c,e=a.ajaxUrl?a.ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(b,c){return a.page+(c?parseInt(c,10):0)}).replace(/\{size\}/g,a.size):"",g=b.config.sortList,j=a.currentFilters||[],k=e.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),h=e.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),l=[];k&&(k=k[1],f.each(g,function(a,b){l.push(k+"["+b[0]+"]="+b[1])}), e=e.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,l.length?l.join("&"):k),l=[]);h&&(h=h[1],f.each(j,function(a,b){b&&l.push(h+"["+a+"]="+encodeURIComponent(b))}),e=e.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,l.length?l.join("&"):h));"function"===typeof a.customAjaxUrl&&(e=a.customAjaxUrl(b,e));c=e;var m=f(document),e=b.config;""!==c&&(e.showProcessing&&f.tablesorter.isProcessing(b,!0),m.bind("ajaxError.pager",function(d,e,f,g){c.match(f.url)&&(z(null,b,a,e,g),m.unbind("ajaxError.pager"))}), a.ajaxObject.url=c,a.ajaxObject.success=function(c){z(c,b,a);m.unbind("ajaxError.pager");"function"===typeof a.oldAjaxSuccess&&a.oldAjaxSuccess(c)},f.ajax(a.ajaxObject))}else a.ajax||v(b,b.config.rowsCopy,a);f.data(b,"pagerLastPage",a.page);f.data(b,"pagerUpdateTriggered",!0);a.initialized&&!1!==d&&f(b).trigger("pageMoved",a)}},C=function(b,a,d){d.size=a;f.data(b,"pagerLastPage",d.page);f.data(b,"pagerLastSize",d.size);d.totalPages=Math.ceil(d.totalRows/d.size);j(b,d)},E=function(b,a){a.page=0;j(b, a)},A=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;j(b,a)},F=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);j(b,a)},G=function(b,a){a.page--;0>=a.page&&(a.page=0);j(b,a)},D=function(b,a,d){var e=a.$size.removeClass(a.cssDisabled).removeAttr("disabled");a.$goto.removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled=!1;a.page=f.data(b,"pagerLastPage")||a.page||0;a.size=f.data(b,"pagerLastSize")||parseInt(e.find("option[selected]").val(), 10)||a.size;e.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalPages,a.filteredPages)/a.size);d&&(f(b).trigger("update"),C(b,a.size,a),x(b,a),r(b,a))};t.appender=function(b,a){var d=b.config.pager;d.ajax||(b.config.rowsCopy=a,d.totalRows=a.length,d.size=f.data(b,"pagerLastSize")||d.size,d.totalPages=Math.ceil(d.totalRows/d.size),v(b,a,d))};t.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,d,e=this.config,c=e.pager=f.extend({},f.tablesorterPager.defaults, b),g=this,p=g.config,k=f(g),h=c.$container=f(c.container).addClass("tablesorter-pager").show();c.oldAjaxSuccess=c.oldAjaxSuccess||c.ajaxObject.success;e.appender=t.appender;k.unbind("filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager pageSize.pager").bind("filterStart.pager",function(a,b){f.data(g,"pagerUpdateTriggered",!1);c.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(){f.data(g,"pagerUpdateTriggered")?f.data(g,"pagerUpdateTriggered", !1):(j(g,c,!1),q(g,c,!1),r(g,c))}).bind("disable.pager",function(a){a.stopPropagation();B(g,c)}).bind("enable.pager",function(a){a.stopPropagation();D(g,c,!0)}).bind("destroy.pager",function(a){a.stopPropagation();B(g,c);c.$container.hide();g.config.appender=null;f(g).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager")}).bind("update.pager",function(a){a.stopPropagation();s(g,c)}).bind("pageSize.pager",function(a,b){a.stopPropagation();c.size=parseInt(b,10)||10;s(g,c); q(g,c,!1);c.$size.length&&c.$size.val(c.size)}).bind("pageSet.pager",function(a,b){a.stopPropagation();c.page=(parseInt(b,10)||1)-1;c.$goto.length&&c.$goto.val(c.size);j(g,c);q(g,c,!1)});a=[c.cssFirst,c.cssPrev,c.cssNext,c.cssLast];d=[E,G,F,A];h.find(a.join(",")).unbind("click.pager").bind("click.pager",function(){var b,e=f(this),h=a.length;if(!e.hasClass(c.cssDisabled))for(b=0;b'),c.cssIcon&&u.find("."+c.cssIcon).addClass(e.icons),n.hasClass("hasFilters")&&u.find(".tablesorter-filter-row").addClass(e.filterRow);h.each(u,function(b){k=h(this);l=c.cssIcon?k.find("."+c.cssIcon):k;this.sortDisabled?(k.removeClass(t),l.removeClass(t+" tablesorter-icon "+e.icons)):(j=n.hasClass("hasStickyHeaders")? n.find(s).find("th").eq(b).add(k):k,f=k.hasClass(c.cssAsc)?e.sortAsc:k.hasClass(c.cssDesc)?e.sortDesc:k.hasClass(c.cssHeader)?e.sortNone:"",k[f===e.sortNone?"removeClass":"addClass"](e.active),l.removeClass(t).addClass(f))});c.debug&&g.benchmark("Applying "+r+" theme",a)},remove:function(d,c,b){d=c.$table;var a="object"===typeof b.uitheme?"jui":b.uitheme||"jui";b="object"===typeof b.uitheme?b.uitheme:g.themes[g.themes.hasOwnProperty(a)?a:"jui"];var f=d.children("thead").children(),h=b.sortNone+" "+ b.sortDesc+" "+b.sortAsc;d.removeClass("tablesorter-"+a+" "+b.table).find(c.cssHeader).removeClass(b.header);f.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(b.hover+" "+h+" "+b.active).find(".tablesorter-filter-row").removeClass(b.filterRow);f.find(".tablesorter-icon").removeClass(b.icons)}}); -g.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(d,c,b){var a,f,k,l,j,n,r,e,u,s=c.$table,t=c.$tbodies,m=c.sortList,p=m.length,v=c.widgetColumns&& c.widgetColumns.hasOwnProperty("css")?c.widgetColumns.css||v:b&&b.hasOwnProperty("columns")?b.columns||v:v;n=v.length-1;r=v.join(" ");c.debug&&(j=new Date);for(u=0;u=]/g}},format:function(d,c,b){if(c.parsers&&!c.$table.hasClass("hasFilters")){var a,f,k,l,j,n,r,e,u,s,t,m,p,v,y,q,I,z,D=g.formatFloat,J="",B=c.$headers,C=b.filter_cssFilter,w=c.$table.addClass("hasFilters"),G=w.find("tbody"),H=c.parsers.length,K,L,M,E=function(a){var f=h.isArray(a),e=f?a:g.getFilters(d),k=(e||[]).join("");f&&c.$filters.each(function(b,c){h(c).val(a[b]||"")}); b.filter_hideFilters&&w.find(".tablesorter-filter-row").trigger(""===k?"mouseleave":"mouseenter");if(!(J===k&&!1!==a))if(w.trigger("filterStart",[e]),c.showProcessing)setTimeout(function(){N(a,e,k);return!1},30);else return N(a,e,k),!1},N=function(p,l,n){var m,u,t,s,z,x,C,A,F;c.debug&&(C=new Date);for(k=0;k]=?/.test(j))v=isNaN(e)?D(e.replace(b.filter_regex.nondigit,""),d):D(e,d),y=D(j.replace(b.filter_regex.nondigit,"").replace(b.filter_regex.operators,""),d),/>/.test(j)&&(x=/>=/.test(j)?v>=y:v>y),/F&&(x=A,A=F,F=x),x=v>=A&&v<=F||""===A||""===F?!0:!1):/[\?|\*]/.test(j)||/\s+OR\s+/.test(l[a])?x=RegExp(j.replace(/\s+or\s+/gi,"|").replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(e):(r=(e+q).indexOf(j),x=!b.filter_startsWith&&0<=r||b.filter_startsWith&&0=== r);s=x?s?!0:!1:!1}m[f].style.display=s?"":"none";m.eq(f)[s?"removeClass":"addClass"]("filtered");if(t.length)t[s?"show":"hide"]()}g.processTbody(d,p,!1)}J=n;w.data("lastSearch",l);c.debug&&g.benchmark("Completed filter widget search",C);w.trigger("applyWidgets");w.trigger("filterEnd")},O=function(a,e){var j,p=[];a=parseInt(a,10);j='";for(k=0;k'+p[k]+"":"";w.find("thead").find("select."+C+'[data-column="'+a+'"]')[e?"html":"append"](j)},P=function(c){for(a=0;a';for(a=0;a";c.$filters=h(q+="").appendTo(w.find("thead").eq(0)).find("td");for(a=0;a").appendTo(c.$filters.eq(a)):(b.filter_formatter&&h.isFunction(b.filter_formatter[a])?((q=b.filter_formatter[a](c.$filters.eq(a),a))&&0===q.length&&(q=c.$filters.eq(a).children("input")), q&&(0===q.parent().length||q.parent().length&&q.parent()[0]!==c.$filters[a])&&c.$filters.eq(a).append(q)):q=h('').appendTo(c.$filters.eq(a)),q&&q.attr("placeholder",p.attr("data-placeholder")||"")),q&&(q.addClass(C).attr("data-column",a),I&&(q.addClass("disabled")[0].disabled=!0))}w.bind("addRows updateCell update updateRows updateComplete appendCache filterReset search ".split(" ").join(".tsfilter "),function(a,b){/(search|filterReset)/.test(a.type)||(a.stopPropagation(),P(!0)); "filterReset"===a.type&&w.find("."+C).val("");b="search"===a.type?b:"updateComplete"===a.type?w.data("lastSearch"):"";E(b);return!1}).find("input."+C).bind("keyup search",function(a,c){if(!("keyup"===a.type&&(32>a.which&&8!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!b.filter_liveSearch)))if("undefined"===typeof c||!1===c)E();else return clearTimeout(M),M=setTimeout(function(){E(c)},b.filter_searchDelay),!1});K=B.map(function(a){return g.getData?"parsed"===g.getData(B.filter('[data-column="'+ a+'"]:last'),c.headers[a],"filter"):h(this).hasClass("filter-parsed")}).get();b.filter_reset&&h(b.filter_reset).length&&h(b.filter_reset).bind("click.tsfilter",function(){w.trigger("filterReset")});if(b.filter_functions)for(z in b.filter_functions)if(b.filter_functions.hasOwnProperty(z)&&"string"===typeof z)if(q=B.filter('[data-column="'+z+'"]:last'),n="",!0===b.filter_functions[z]&&!q.hasClass("filter-false"))O(z);else if("string"===typeof z&&!q.hasClass("filter-false")){for(s in b.filter_functions[z])"string"=== typeof s&&(n+=""===n?'":"",n+='");w.find("thead").find("select."+C+'[data-column="'+z+'"]').append(n)}P(!0);w.find("select."+C).bind("change search",function(a,b){E(b)});b.filter_hideFilters&&w.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){var c;t=h(this);clearTimeout(u);u=setTimeout(function(){/enter|over/.test(a.type)?t.removeClass("hideme"):h(document.activeElement).closest("tr")[0]!== t[0]&&(c=w.find("."+b.filter_cssFilter).map(function(){return h(this).val()||""}).get().join(""),""===c&&t.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(a){m=h(this).closest("tr");clearTimeout(u);u=setTimeout(function(){if(""===w.find("."+b.filter_cssFilter).map(function(){return h(this).val()||""}).get().join(""))m["focus"===a.type?"removeClass":"addClass"]("hideme")},200)});c.showProcessing&&w.bind("filterStart.tsfilter filterEnd.tsfilter",function(a,b){var d=b?w.find("."+ c.cssHeader).filter("[data-column]").filter(function(){return""!==b[h(this).data("column")]}):"";g.isProcessing(w[0],"filterStart"===a.type,b?d:"")});c.debug&&g.benchmark("Applying Filter widget",L);w.trigger("filterInit");E()}},remove:function(d,c,b){var a,f=c.$tbodies;c.$table.removeClass("hasFilters").unbind("addRows updateCell update updateComplete appendCache search filterStart filterEnd ".split(" ").join(".tsfilter ")).find(".tablesorter-filter-row").remove();for(c=0;cc.top&&da.which&&8!==a.which||37<=a.which&&40>=a.which)){t=!0;a=h(this);var d=a.attr("data-column");c.$filters.find("input, select").eq(d).val(a.val()).trigger("search");setTimeout(function(){t=!1}, b.filter_searchDelay)}})}},remove:function(d,c,b){c.$table.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find("."+b.stickyHeaders).remove();b.$sticky&&b.$sticky.remove();h(window).unbind("scroll.tsSticky resize.tsSticky")}}); -g.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1},format:function(d,c,b){if(!c.$table.hasClass("hasResizable")){c.$table.addClass("hasResizable");var a,f,k,l,j={},n,r,e,u,s=c.$table,t=0,m=null,p=null, v=20>Math.abs(s.parent().width()-s.width()),y=function(){g.storage&&m&&(j[m.index()]=m.width(),j[p.index()]=p.width(),m.width(j[m.index()]),p.width(j[p.index()]),!1!==b.resizable&&g.storage(d,"tablesorter-resizable",j));t=0;m=p=null;h(window).trigger("resize")};if(j=g.storage&&!1!==b.resizable?g.storage(d,"tablesorter-resizable"):{})for(l in j)!isNaN(l)&&l');b.resizable_addLastColumn||(n=n.slice(0,-1));r=r?r.add(n):n});r.each(function(){a=h(this);l=parseInt(a.css("padding-right"),10)+10;f='
';a.find(".tablesorter-wrapper").append(f)}).bind("mousemove.tsresize",function(a){0!==t&&m&&(e=a.pageX-t,u=m.width(),m.width(u+e),m.width()!==u&&v&&p.width(p.width()-e),t=a.pageX)}).bind("mouseup.tsresize",function(){y()}).find(".tablesorter-resizer,.tablesorter-resizer-grip").bind("mousedown",function(a){m=h(a.target).closest("th");f=c.$headers.filter('[data-column="'+m.attr("data-column")+'"]');1'),c.cssIcon&&r.find("."+c.cssIcon).addClass(g.icons),q.hasClass("hasFilters")&&r.find(".tablesorter-filter-row").addClass(g.filterRow);h.each(r,function(b){k=h(this);m=c.cssIcon?k.find("."+c.cssIcon):k;this.sortDisabled?(k.removeClass(u),m.removeClass(u+" tablesorter-icon "+g.icons)): (l=q.hasClass("hasStickyHeaders")?q.find(t).find("th").eq(b).add(k):k,e=k.hasClass(c.cssAsc)?g.sortAsc:k.hasClass(c.cssDesc)?g.sortDesc:k.hasClass(c.cssHeader)?g.sortNone:"",k[e===g.sortNone?"removeClass":"addClass"](g.active),m.removeClass(u).addClass(e))});c.debug&&f.benchmark("Applying "+s+" theme",a)},remove:function(d,c,b){d=c.$table;var a="object"===typeof b.uitheme?"jui":b.uitheme||"jui";b="object"===typeof b.uitheme?b.uitheme:f.themes[f.themes.hasOwnProperty(a)?a:"jui"];var e=d.children("thead").children(), h=b.sortNone+" "+b.sortDesc+" "+b.sortAsc;d.removeClass("tablesorter-"+a+" "+b.table).find(c.cssHeader).removeClass(b.header);e.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(b.hover+" "+h+" "+b.active).find(".tablesorter-filter-row").removeClass(b.filterRow);e.find(".tablesorter-icon").removeClass(b.icons)}}); +f.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(d,c,b){var a,e,k,m,l,q,s,g,r,t=c.$table,u=c.$tbodies,j=c.sortList, v=j.length,n=c.widgetColumns&&c.widgetColumns.hasOwnProperty("css")?c.widgetColumns.css||n:b&&b.hasOwnProperty("columns")?b.columns||n:n;q=n.length-1;s=n.join(" ");c.debug&&(l=new Date);for(r=0;r=]/g}},format:function(d,c,b){if(c.parsers&&!c.$table.hasClass("hasFilters")){var a,e,k,m,l,q,s,g,r,t,u,j,v,n,w,p,F,A,D=f.formatFloat,K="",C=c.$headers,E=b.filter_cssFilter,x=c.$table.addClass("hasFilters"),I=x.find("tbody"),J=c.parsers.length,G,L,M,H=function(a){var e=h.isArray(a),g= e?a:f.getFilters(d),p=(g||[]).join("");e&&f.setFilters(x,g);b.filter_hideFilters&&x.find(".tablesorter-filter-row").trigger(""===p?"mouseleave":"mouseenter");if(!(K===p&&!1!==a))if(x.trigger("filterStart",[g]),c.showProcessing)setTimeout(function(){N(a,g,p);return!1},30);else return N(a,g,p),!1},N=function(m,j,q){var r,v,u,t,A,y,F,z,B;c.debug&&(F=new Date);for(k=0;k]=?/.test(l)){w=D(l.replace(b.filter_regex.nondigit,"").replace(b.filter_regex.operators,""),d);if(G[a]||"numeric"===c.parsers[a].type)n=c.parsers[a].format(""+w,d),w=""!==n&&!isNaN(n)?n:w;n=(G[a]||"numeric"===c.parsers[a].type)&&!isNaN(w)?c.cache[k].normalized[e][a]:isNaN(g)?D(g.replace(b.filter_regex.nondigit,""),d):D(g,d);/>/.test(l)&&(y=/>=/.test(l)?n>=w:n>w); /B&&(y=z,z=B,B=y);y=n>=z&&n<=B||""===z||""===B?!0:!1}else/[\?|\*]/.test(l)||/\s+OR\s+/.test(j[a])?y=RegExp(l.replace(/\s+or\s+/gi,"|").replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(g):(s=(g+p).indexOf(l),y=!b.filter_startsWith&&0<=s||b.filter_startsWith&&0===s);t=y?t?!0:!1:!1}r[e].style.display=t?"":"none";r.eq(e)[t?"removeClass":"addClass"](b.filter_filteredRow); if(u.length)u[t?"show":"hide"]()}f.processTbody(d,m,!1)}K=q;x.data("lastSearch",j);c.debug&&f.benchmark("Completed filter widget search",F);x.trigger("applyWidgets");x.trigger("filterEnd")},O=function(a,g){var l,j=[];a=parseInt(a,10);l='";for(k=0;k'+j[k]+"":"";x.find("thead").find("select."+E+'[data-column="'+a+'"]')[g?"html":"append"](l)},P=function(c){for(a=0;a';for(a=0;a";c.$filters=h(p+="").appendTo(x.find("thead").eq(0)).find("td");for(a=0;a").appendTo(c.$filters.eq(a)):(b.filter_formatter&&h.isFunction(b.filter_formatter[a])?((p=b.filter_formatter[a](c.$filters.eq(a),a))&&0===p.length&&(p=c.$filters.eq(a).children("input")),p&&(0===p.parent().length||p.parent().length&&p.parent()[0]!==c.$filters[a])&&c.$filters.eq(a).append(p)):p=h('').appendTo(c.$filters.eq(a)), p&&p.attr("placeholder",v.attr("data-placeholder")||"")),p&&(p.addClass(E).attr("data-column",a),F&&(p.addClass("disabled")[0].disabled=!0))}x.bind("addRows updateCell update updateRows updateComplete appendCache filterReset search ".split(" ").join(".tsfilter "),function(a,b){/(search|filterReset)/.test(a.type)||(a.stopPropagation(),P(!0));"filterReset"===a.type&&x.find("."+E).val("");b="search"===a.type?b:"updateComplete"===a.type?x.data("lastSearch"):"";H(b);return!1}).find("input."+E).bind("keyup search", function(a,c){if(27===a.which)this.value="";else if("number"===typeof b.filter_liveSearch&&this.value.lengtha.which&&8!==a.which&&!0===b.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===b.filter_liveSearch))return;if("undefined"!==typeof c||!1===c)H();else return clearTimeout(M),M=setTimeout(function(){H(c)},b.filter_liveSearch?b.filter_searchDelay:10),!1});G=C.map(function(a){return f.getData?"parsed"===f.getData(C.filter('[data-column="'+ a+'"]:last'),c.headers[a],"filter"):h(this).hasClass("filter-parsed")}).get();b.filter_reset&&h(b.filter_reset).length&&h(b.filter_reset).bind("click.tsfilter",function(){x.trigger("filterReset")});if(b.filter_functions)for(A in b.filter_functions)if(b.filter_functions.hasOwnProperty(A)&&"string"===typeof A)if(p=C.filter('[data-column="'+A+'"]:last'),q="",!0===b.filter_functions[A]&&!p.hasClass("filter-false"))O(A);else if("string"===typeof A&&!p.hasClass("filter-false")){for(t in b.filter_functions[A])"string"=== typeof t&&(q+=""===q?'":"",q+='");x.find("thead").find("select."+E+'[data-column="'+A+'"]').append(q)}P(!0);x.find("select."+E).bind("change search",function(a,b){H(b)});b.filter_hideFilters&&x.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){var c;u=h(this);clearTimeout(r);r=setTimeout(function(){/enter|over/.test(a.type)?u.removeClass("hideme"):h(document.activeElement).closest("tr")[0]!== u[0]&&(c=x.find("."+b.filter_cssFilter).map(function(){return h(this).val()||""}).get().join(""),""===c&&u.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(a){j=h(this).closest("tr");clearTimeout(r);r=setTimeout(function(){if(""===x.find("."+b.filter_cssFilter).map(function(){return h(this).val()||""}).get().join(""))j["focus"===a.type?"removeClass":"addClass"]("hideme")},200)});c.showProcessing&&x.bind("filterStart.tsfilter filterEnd.tsfilter",function(a,b){var d=b?x.find("."+ c.cssHeader).filter("[data-column]").filter(function(){return""!==b[h(this).data("column")]}):"";f.isProcessing(x[0],"filterStart"===a.type,b?d:"")});c.debug&&f.benchmark("Applying Filter widget",L);x.trigger("filterInit");H()}},remove:function(d,c,b){var a,e=c.$tbodies;c.$table.removeClass("hasFilters").unbind("addRows updateCell update updateComplete appendCache search filterStart filterEnd ".split(" ").join(".tsfilter ")).find(".tablesorter-filter-row").remove();for(c=0;cc.top&&da.which&&8!==a.which||37<=a.which&&40>=a.which)){v=!0;a=h(this);var d=a.attr("data-column");c.$filters.find("input, select").eq(d).val(a.val()).trigger("search");setTimeout(function(){v=!1},b.filter_searchDelay)}})}},remove:function(d,c,b){c.$table.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find("."+ b.stickyHeaders).remove();b.$sticky&&b.$sticky.remove();h(window).unbind("scroll.tsSticky resize.tsSticky");f.addHeaderResizeEvent(d,!1)}}); +f.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1},format:function(d,c,b){if(!c.$table.hasClass("hasResizable")){c.$table.addClass("hasResizable");var a,e,k,m,l={},q,s,g,r,t=c.$table,u=0,j=null,v=null,n=20>Math.abs(t.parent().width()-t.width()),w=function(){f.storage&&j&&(l[j.index()]=j.width(),l[v.index()]=v.width(),j.width(l[j.index()]), v.width(l[v.index()]),!1!==b.resizable&&f.storage(d,"tablesorter-resizable",l));u=0;j=v=null;h(window).trigger("resize")};if(l=f.storage&&!1!==b.resizable?f.storage(d,"tablesorter-resizable"):{})for(m in l)!isNaN(m)&&m');b.resizable_addLastColumn||(q=q.slice(0,-1));s=s?s.add(q):q});s.each(function(){a=h(this);m=parseInt(a.css("padding-right"),10)+10;e='
';a.find(".tablesorter-wrapper").append(e)}).bind("mousemove.tsresize", function(a){0!==u&&j&&(g=a.pageX-u,r=j.width(),j.width(r+g),j.width()!==r&&n&&v.width(v.width()-g),u=a.pageX)}).bind("mouseup.tsresize",function(){w()}).find(".tablesorter-resizer,.tablesorter-resizer-grip").bind("mousedown",function(a){j=h(a.target).closest("th");e=c.$headers.filter('[data-column="'+j.attr("data-column")+'"]');1