tablesorter/dist/js/jquery.tablesorter.widgets.min.js

2 lines
50 KiB
JavaScript
Raw Normal View History

2017-07-04 17:56:45 +00:00
/*! tablesorter (FORK) - updated 07-04-2017 (v2.28.15)*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(e,t,r){"use strict";var i=e.tablesorter||{};e.extend(!0,i.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}}),i.storage=function(i,a,l,s){var n,o,c,d=!1,f={},h=(i=e(i)[0]).config,u=h&&h.widgetOptions,p=(s&&s.storageType||u&&u.storage_storageType).toString().charAt(0).toLowerCase(),g=p?"":s&&s.useSessionStorage||u&&u.storage_useSessionStorage,m=e(i),b=s&&s.id||m.attr(s&&s.group||u&&u.storage_group||"data-table-group")||u&&u.storage_tableId||i.id||e(".tablesorter").index(m),y=s&&s.url||m.attr(s&&s.page||u&&u.storage_page||"data-table-page")||u&&u.storage_fixedUrl||h&&h.fixedUrl||t.location.pathname;if("c"!==p&&(p="s"===p||g?"sessionStorage":"localStorage")in t)try{t[p].setItem("_tmptest","temp"),d=!0,t[p].removeItem("_tmptest")}catch(e){h&&h.debug&&console.warn(p+" is not supported in this browser")}if(h.debug&&console.log("Storage widget using",d?p:"cookies"),e.parseJSON&&(d?f=e.parseJSON(t[p][a]||"null")||{}:(o=r.cookie.split(/[;\s|=]/),f=0!==(n=e.inArray(a,o)+1)?e.parseJSON(o[n]||"null")||{}:{})),void 0===l||!t.JSON||!JSON.hasOwnProperty("stringify"))return f&&f[y]?f[y][b]:"";f[y]||(f[y]={}),f[y][b]=l,d?t[p][a]=JSON.stringify(f):((c=new Date).setTime(c.getTime()+31536e6),r.cookie=a+"="+JSON.stringify(f).replace(/\"/g,'"')+"; expires="+c.toGMTString()+"; path=/")}}(e,window,document),function(e){"use strict";var t=e.tablesorter||{};t.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(t.css,{wrapper:"tablesorter-wrapper"}),t.addWidget({id:"uitheme",priority:10,format:function(r,i,a){var l,s,n,o,c,d,f,h,u,p,g,m,b,y=t.themes,_=i.$table.add(e(i.namespace+"_extra_table")),v=i.$headers.add(e(i.namespace+"_extra_headers")),w=i.theme||"jui",x=y[w]||{},S=e.trim([x.sortNone,x.sortDesc,x.sortAsc,x.active].join(" ")),C=e.trim([x.iconSortNone,x.iconSortDesc,x.iconSortAsc].join(" "));for(i.debug&&(c=new Date),_.hasClass("tablesorter-"+w)&&i.theme===i.appliedTheme&&a.uitheme_applied||(a.uitheme_applied=!0,p=y[i.appliedTheme]||{},g=(b=!e.isEmptyObject(p))?[p.sortNone,p.sortDesc,p.sortAsc,p.active].join(" "):"",m=b?[p.iconSortNone,p.iconSortDesc,p.iconSortAsc].join(" "):"",b&&(a.zebra[0]=e.trim(" "+a.zebra[0].replace(" "+p.even,"")),a.zebra[1]=e.trim(" "+a.zebra[1].replace(" "+p.odd,"")),i.$tbodies.children().removeClass([p.even,p.odd].join(" "))),x.even&&(a.zebra[0]+=" "+x.even),x.odd&&(a.zebra[1]+=" "+x.odd),_.children("caption").removeClass(p.caption||"").addClass(x.caption),h=_.removeClass((i.appliedTheme?"tablesorter-"+(i.appliedTheme||""):"")+" "+(p.table||"")).addClass("tablesorter-"+w+" "+(x.table||"")).children("tfoot"),i.appliedTheme=i.theme,h.length&&h.children("tr").removeClass(p.footerRow||"").addClass(x.footerRow).children("th, td").removeClass(p.footerCells||"").addClass(x.footerCells),v.removeClass((b?[p.header,p.hover,g].join(" "):"")||"").addClass(x.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(t){