| 1234567 |
- /*
- * bootstrap-table - v1.8.1 - 2015-08-24
- * https://github.com/wenzhixin/bootstrap-table
- * Copyright (c) 2015 zhixin wen
- * Licensed MIT License
- */
- !function(a){"use strict";var b={sortOrder:"bs.table.sortOrder",sortName:"bs.table.sortName",pageNumber:"bs.table.pageNumber",pageList:"bs.table.pageList",columns:"bs.table.columns",searchText:"bs.table.searchText",filterControl:"bs.table.filterControl"},c=function(a){var b=a.$header;return a.options.height&&(b=a.$tableHeader),b},d=function(a){var b="select, input";return a.options.height&&(b="table select, table input"),b},e=function(){return!!navigator.cookieEnabled},f=function(b,c,d){return b.options.cookie&&e()&&""!==b.options.cookieIdTable&&-1!==a.inArray(c.toLowerCase(),b.options.cookiesEnabled)?(c=b.options.cookieIdTable+"."+c,!c||/^(?:expires|max\-age|path|domain|secure)$/i.test(c)?!1:(document.cookie=encodeURIComponent(c)+"="+encodeURIComponent(d)+j(b.options.cookieExpire)+(b.options.cookieDomain?"; domain="+b.options.cookieDomain:"")+(b.options.cookiePath?"; path="+b.options.cookiePath:"")+(b.cookieSecure?"; secure":""),!0)):void 0},g=function(b,c,d){return d?-1===a.inArray(d.toLowerCase(),b.options.cookiesEnabled)?null:(d=c+"."+d,decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(d).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null):null},h=function(a){return a?new RegExp("(?:^|;\\s*)"+encodeURIComponent(a).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie):!1},i=function(a,b,c,d){return b=a+"."+b,h(b)?(document.cookie=encodeURIComponent(b)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(d?"; domain="+d:"")+(c?"; path="+c:""),!0):!1},j=function(a){var b=a.replace(/[0-9]*/,"");switch(a=a.replace(/[A-Za-z]/,""),b.toLowerCase()){case"s":a=+a;break;case"mi":a=60*a;break;case"h":a=60*a*60;break;case"d":a=24*a*60*60;break;case"m":a=30*a*24*60*60;break;case"y":a=365*a*30*24*60*60;break;default:a=void 0}return void 0===a?"":"; max-age="+a};a.extend(a.fn.bootstrapTable.defaults,{cookie:!1,cookieExpire:"2h",cookiePath:null,cookieDomain:null,cookieSecure:null,cookieIdTable:"",cookiesEnabled:["bs.table.sortOrder","bs.table.sortName","bs.table.pageNumber","bs.table.pageList","bs.table.columns","bs.table.searchText","bs.table.filterControl"],filterControls:[],filterControlValuesLoaded:!1}),a.fn.bootstrapTable.methods.push("deleteCookie");var k=a.fn.bootstrapTable.Constructor,l=k.prototype.init,m=k.prototype.initTable,n=k.prototype.onSort,o=k.prototype.onPageNumber,p=k.prototype.onPageListChange,q=k.prototype.onPageFirst,r=k.prototype.onPagePre,s=k.prototype.onPageNext,t=k.prototype.onPageLast,u=k.prototype.toggleColumn,v=k.prototype.selectPage,w=k.prototype.onSearch;k.prototype.init=function(){if(this.options.filterControls=[],this.options.filterControlValuesLoaded=!1,this.options.cookiesEnabled="string"==typeof this.options.cookiesEnabled?this.options.cookiesEnabled.replace("[","").replace("]","").replace(/ /g,"").toLowerCase().split(","):this.options.cookiesEnabled,this.options.filterControl){var e=this;this.$el.on("column-search.bs.table",function(a,c,d){for(var g=!0,h=0;h<e.options.filterControls.length;h++)if(e.options.filterControls[h].field===c){e.options.filterControls[h].text=d,g=!1;break}g&&e.options.filterControls.push({field:c,text:d}),f(e,b.filterControl,JSON.stringify(e.options.filterControls))}).on("post-body.bs.table",function(){setTimeout(function(){if(!e.options.filterControlValuesLoaded){e.options.filterControlValuesLoaded=!0;var f=JSON.parse(g(e,e.options.cookieIdTable,b.filterControl));if(f){var h=null,i=[],j=c(e),k=d(e);j.find(k).each(function(){h=a(this).parent().parent().parent().data("field"),i=a.grep(f,function(a){return a.field===h}),i.length>0&&(a(this).val(i[0].text),e.onColumnSearch({currentTarget:a(this)}))})}}},250)})}l.apply(this,Array.prototype.slice.apply(arguments))},k.prototype.initTable=function(){m.apply(this,Array.prototype.slice.apply(arguments)),this.initCookie()},k.prototype.initCookie=function(){if(this.options.cookie){if(""===this.options.cookieIdTable||""===this.options.cookieExpire||!e())throw new Error("Configuration error. Please review the cookieIdTable, cookieExpire properties, if those properties are ok, then this browser does not support the cookies");var c=g(this,this.options.cookieIdTable,b.sortOrder),d=g(this,this.options.cookieIdTable,b.sortName),f=g(this,this.options.cookieIdTable,b.pageNumber),h=g(this,this.options.cookieIdTable,b.pageList),i=JSON.parse(g(this,this.options.cookieIdTable,b.columns)),j=g(this,this.options.cookieIdTable,b.searchText);this.options.sortOrder=c?c:"asc",this.options.sortName=d?d:void 0,this.options.pageNumber=f?+f:this.options.pageNumber,this.options.pageSize=h?h===this.options.formatAllRows()?h:+h:this.options.pageSize,this.options.searchText=j?j:"",i&&a.each(this.columns,function(a,b){b.visible=-1!==i.indexOf(b.field)})}},k.prototype.onSort=function(){n.apply(this,Array.prototype.slice.apply(arguments)),f(this,b.sortOrder,this.options.sortOrder),f(this,b.sortName,this.options.sortName)},k.prototype.onPageNumber=function(){o.apply(this,Array.prototype.slice.apply(arguments)),f(this,b.pageNumber,this.options.pageNumber)},k.prototype.onPageListChange=function(){p.apply(this,Array.prototype.slice.apply(arguments)),f(this,b.pageList,this.options.pageSize)},k.prototype.onPageFirst=function(){q.apply(this,Array.prototype.slice.apply(arguments)),f(this,b.pageNumber,this.options.pageNumber)},k.prototype.onPagePre=function(){r.apply(this,Array.prototype.slice.apply(arguments)),f(this,b.pageNumber,this.options.pageNumber)},k.prototype.onPageNext=function(){s.apply(this,Array.prototype.slice.apply(arguments)),f(this,b.pageNumber,this.options.pageNumber)},k.prototype.onPageLast=function(){t.apply(this,Array.prototype.slice.apply(arguments)),f(this,b.pageNumber,this.options.pageNumber)},k.prototype.toggleColumn=function(){u.apply(this,Array.prototype.slice.apply(arguments));var c=[];a.each(this.columns,function(a,b){b.visible&&c.push(b.field)}),f(this,b.columns,JSON.stringify(c))},k.prototype.selectPage=function(a){v.apply(this,Array.prototype.slice.apply(arguments)),f(this,idsStateSaveList.pageNumber,a)},k.prototype.onSearch=function(){w.apply(this,Array.prototype.slice.apply(arguments)),f(this,b.searchText,this.searchText)},k.prototype.deleteCookie=function(a){""!==a&&e()&&i(this.options.cookieIdTable,b[a],this.options.cookiePath,this.options.cookieDomain)}}(jQuery);
|