3 lines
83 KiB
JavaScript
3 lines
83 KiB
JavaScript
|
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t,window,document)}):"object"==typeof exports?module.exports=function(t,a){return t||(t=window),a||(a="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(a,t,t.document)}:e(jQuery,window,document)}(function(e,t,a,r){"use strict";function A(t){var r,n,a="a aa ai ao as b fn i m o s ",i={};e.each(t,function(e,l){r=e.match(/^([^A-Z]+?)([A-Z])/),r&&-1!==a.indexOf(r[1]+" ")&&(n=e.replace(r[0],r[2].toLowerCase()),i[n]=e,"o"===r[1]&&A(t[e]))}),t._hungarianMap=i}function F(t,a,n){t._hungarianMap||A(t);var i;e.each(a,function(l,o){i=t._hungarianMap[l],i===r||!n&&a[i]!==r||("o"===i.charAt(0)?(a[i]||(a[i]={}),e.extend(!0,a[i],a[l]),F(t[i],a[i],n)):a[i]=a[l])})}function L(e){var t=n.defaults.oLanguage,a=t.sDecimal;if(a&&Xt(a),e){var r=e.sZeroRecords;!e.sEmptyTable&&r&&"No data available in table"===t.sEmptyTable&&ct(e,e,"sZeroRecords","sEmptyTable"),!e.sLoadingRecords&&r&&"Loading..."===t.sLoadingRecords&&ct(e,e,"sZeroRecords","sLoadingRecords"),e.sInfoThousands&&(e.sThousands=e.sInfoThousands);var i=e.sDecimal;i&&a!==i&&Xt(i)}}function R(e){P(e,"ordering","bSort"),P(e,"orderMulti","bSortMulti"),P(e,"orderClasses","bSortClasses"),P(e,"orderCellsTop","bSortCellsTop"),P(e,"order","aaSorting"),P(e,"orderFixed","aaSortingFixed"),P(e,"paging","bPaginate"),P(e,"pagingType","sPaginationType"),P(e,"pageLength","iDisplayLength"),P(e,"searching","bFilter"),"boolean"==typeof e.sScrollX&&(e.sScrollX=e.sScrollX?"100%":""),"boolean"==typeof e.scrollX&&(e.scrollX=e.scrollX?"100%":"");var t=e.aoSearchCols;if(t)for(var a=0,r=t.length;r>a;a++)t[a]&&F(n.models.oSearch,t[a])}function j(t){P(t,"orderable","bSortable"),P(t,"orderData","aDataSort"),P(t,"orderSequence","asSorting"),P(t,"orderDataType","sortDataType");var a=t.aDataSort;"number"!=typeof a||e.isArray(a)||(t.aDataSort=[a])}function N(a){if(!n.__browser){var r={};n.__browser=r;var i=e("<div/>").css({position:"fixed",top:0,left:-1*e(t).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(e("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(e("<div/>").css({width:"100%",height:10}))).appendTo("body"),l=i.children(),o=l.children();r.barWidth=l[0].offsetWidth-l[0].clientWidth,r.bScrollOversize=100===o[0].offsetWidth&&100!==l[0].clientWidth,r.bScrollbarLeft=1!==Math.round(o.offset().left),r.bBounding=i[0].getBoundingClientRect().width?!0:!1,i.remove()}e.extend(a.oBrowser,n.__browser),a.oScroll.iBarWidth=n.__browser.barWidth}function H(e,t,a,n,i,l){var s,o=n,u=!1;for(a!==r&&(s=a,u=!0);o!==i;)e.hasOwnProperty(o)&&(s=u?t(s,e[o],o,e):e[o],u=!0,o+=l);return s}function k(t,r){var i=n.defaults.column,l=t.aoColumns.length,o=e.extend({},n.models.oColumn,i,{nTh:r?r:a.createElement("th"),sTitle:i.sTitle?i.sTitle:r?r.innerHTML:"",aDataSort:i.aDataSort?i.aDataSort:[l],mData:i.mData?i.mData:l,idx:l});t.aoColumns.push(o);var s=t.aoPreSearchCols;s[l]=e.extend({},n.models.oSearch,s[l]),O(t,l,e(r).data())}function O(t,a,i){var l=t.aoColumns[a],o=t.oClasses,s=e(l.nTh);if(!l.sWidthOrig){l.sWidthOrig=s.attr("width")||null;var u=(s.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);u&&(l.sWidthOrig=u[1])}i!==r&&null!==i&&(j(i),F(n.defaults.column,i),i.mDataProp===r||i.mData||(i.mData=i.mDataProp),i.sType&&(l._sManualType=i.sType),i.className&&!i.sClass&&(i.sClass=i.className),i.sClass&&s.addClass(i.sClass),e.extend(l,i),ct(l,i,"sWidth","sWidthOrig"),i.iDataSort!==r&&(l.aDataSort=[i.iDataSort]),ct(l,i,"aDataSort"));var f=l.mData,c=ee(f),d=l.mRender?ee(l.mRender):null,h=function(e){return"string"==typeof e&&-1!==e.indexOf("@")};l._bAttrSrc=e.isPlainObject(f)&&(h(f.sort)||h(f.type)||h(f.filter)),l._setter=null,l.fnGetData=function(e,t,a){var n=c(e,t,r,a);return d&&t?d(n,t,e,a):n},l.fnSetData=function(e,t,a){return te(f)(e,t,a)},"number"!=typeof f&&(t._rowReadObject=!0),t.oFeatures.bSort||(l.bSortable=!1,s.addClass(o.sSortableNone));var p=-1!==e.inArray("asc",l.asSorting),v=-1!==e.inArray("desc",l.asSorting);l.bSortable&&(p||v)?p&&!v?(l.sSortingClass=o.sSortableAsc,l.sS
|
||
|
0),_=e.aiDisplayMaster;for(V(e),w=et(e),t=0,a=w.length;a>t;t++)y=w[t],y.formatter&&D++,lt(e,y.col);if("ssp"!=mt(e)&&0!==w.length){for(t=0,r=_.length;r>t;t++)c[_[t]]=t;D===w.length?_.sort(function(e,t){var a,r,n,i,l,o=w.length,s=h[e]._aSortData,u=h[t]._aSortData;for(n=0;o>n;n++)if(l=w[n],a=s[l.col],r=u[l.col],i=r>a?-1:a>r?1:0,0!==i)return"asc"===l.dir?i:-i;return a=c[e],r=c[t],r>a?-1:a>r?1:0}):_.sort(function(e,t){var a,r,n,l,o,s,u=w.length,f=h[e]._aSortData,p=h[t]._aSortData;for(n=0;u>n;n++)if(o=w[n],a=f[o.col],r=p[o.col],s=d[o.type+"-"+o.dir]||d["string-"+o.dir],l=s(a,r),0!==l)return l;return a=c[e],r=c[t],r>a?-1:a>r?1:0})}e.bSorted=!0}function at(e){for(var t,a,r=e.aoColumns,n=et(e),i=e.oLanguage.oAria,l=0,o=r.length;o>l;l++){var s=r[l],u=s.asSorting,f=s.sTitle.replace(/<.*?>/g,""),c=s.nTh;c.removeAttribute("aria-sort"),s.bSortable?(n.length>0&&n[0].col==l?(c.setAttribute("aria-sort","asc"==n[0].dir?"ascending":"descending"),a=u[n[0].index+1]||u[0]):a=u[0],t=f+("asc"===a?i.sSortAscending:i.sSortDescending)):t=f,c.setAttribute("aria-label",t)}}function rt(t,a,n,i){var u,l=t.aoColumns[a],o=t.aaSorting,s=l.asSorting,f=function(t,a){var n=t._idx;return n===r&&(n=e.inArray(t[1],s)),n+1<s.length?n+1:a?null:0};if("number"==typeof o[0]&&(o=t.aaSorting=[o]),n&&t.oFeatures.bSortMulti){var c=e.inArray(a,y(o,"0"));-1!==c?(u=f(o[c],!0),null===u&&1===o.length&&(u=0),null===u?o.splice(c,1):(o[c][1]=s[u],o[c]._idx=u)):(o.push([a,s[0],0]),o[o.length-1]._idx=0)}else o.length&&o[0][0]==a?(u=f(o[0]),o.length=1,o[0][1]=s[u],o[0]._idx=u):(o.length=0,o.push([a,s[0]]),o[0]._idx=0);de(t),"function"==typeof i&&i(t)}function nt(e,t,a,r){var n=e.aoColumns[a];ht(t,{},function(t){n.bSortable!==!1&&(e.oFeatures.bProcessing?(Ve(e,!0),setTimeout(function(){rt(e,a,t.shiftKey,r),"ssp"!==mt(e)&&Ve(e,!1)},0)):rt(e,a,t.shiftKey,r))})}function it(t){var l,o,s,a=t.aLastSort,r=t.oClasses.sSortColumn,n=et(t),i=t.oFeatures;if(i.bSort&&i.bSortClasses){for(l=0,o=a.length;o>l;l++)s=a[l].src,e(y(t.aoData,"anCells",s)).removeClass(r+(2>l?l+1:3));for(l=0,o=n.length;o>l;l++)s=n[l].src,e(y(t.aoData,"anCells",s)).addClass(r+(2>l?l+1:3))}t.aLastSort=n}function lt(e,t){var i,a=e.aoColumns[t],r=n.ext.order[a.sSortDataType];r&&(i=r.call(e.oInstance,e,t,B(e,t)));for(var l,o,s=n.ext.type.order[a.sType+"-pre"],u=0,f=e.aoData.length;f>u;u++)l=e.aoData[u],l._aSortData||(l._aSortData=[]),(!l._aSortData[t]||r)&&(o=r?i[u]:z(e,u,t,"sort"),l._aSortData[t]=s?s(o):o)}function ot(t){if(t.oFeatures.bStateSave&&!t.bDestroying){var a={time:+new Date,start:t._iDisplayStart,length:t._iDisplayLength,order:e.extend(!0,[],t.aaSorting),search:Pe(t.oPreviousSearch),columns:e.map(t.aoColumns,function(e,a){return{visible:e.bVisible,search:Pe(t.aoPreSearchCols[a])}})};vt(t,"aoStateSaveParams","stateSaveParams",[t,a]),t.oSavedState=a,t.fnStateSaveCallback.call(t.oInstance,t,a)}}function st(t,a,n){var i,l,o=t.aoColumns,s=function(a){if(!a||!a.time)return void n();var s=vt(t,"aoStateLoadParams","stateLoadParams",[t,a]);if(-1!==e.inArray(!1,s))return void n();var u=t.iStateDuration;if(u>0&&a.time<+new Date-1e3*u)return void n();if(a.columns&&o.length!==a.columns.length)return void n();if(t.oLoadedState=e.extend(!0,{},a),a.start!==r&&(t._iDisplayStart=a.start,t.iInitDisplayStart=a.start),a.length!==r&&(t._iDisplayLength=a.length),a.order!==r&&(t.aaSorting=[],e.each(a.order,function(e,a){t.aaSorting.push(a[0]>=o.length?[0,a[1]]:a)})),a.search!==r&&e.extend(t.oPreviousSearch,Re(a.search)),a.columns)for(i=0,l=a.columns.length;l>i;i++){var f=a.columns[i];f.visible!==r&&(o[i].bVisible=f.visible),f.search!==r&&e.extend(t.aoPreSearchCols[i],Re(f.search))}vt(t,"aoStateLoaded","stateLoaded",[t,a]),n()};if(!t.oFeatures.bStateSave)return void n();var u=t.fnStateLoadCallback.call(t.oInstance,t,s);u!==r&&s(u)}function ut(t){var a=n.settings,r=e.inArray(t,y(a,"nTable"));return-1!==r?a[r]:null}function ft(e,a,r,i){if(r="DataTables warning: "+(e?"table id="+e.sTableId+" - ":"")+r,i&&(r+=". For more information about this error, please see http://datatables.net/tn/"+i),a)t.console&&console.log&&console.log(r);else{var l
|
||
|
}}).toArray();return o.length||!a.nodeName?o:(g=e(a).closest("*[data-dt-row]"),g.length?[{row:g.data("dt-row"),column:g.data("dt-column")}]:[])};return Tt("cell",a,b,t,n)};o("cells()",function(t,a,n){if(e.isPlainObject(t)&&(t.row===r?(n=t,t=null):(n=a,a=null)),e.isPlainObject(a)&&(n=a,a=null),null===a||a===r)return this.iterator("table",function(e){return Bt(e,t,Ct(n))});var o,s,u,f,c,i=this.columns(a),l=this.rows(t);this.iterator("table",function(e,t){for(o=[],s=0,u=l[t].length;u>s;s++)for(f=0,c=i[t].length;c>f;f++)o.push({row:l[t][s],column:i[t][f]})},1);var d=this.cells(o,n);return e.extend(d.selector,{cols:a,rows:t,opts:n}),d}),s("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(e,t,a){var n=e.aoData[t];return n&&n.anCells?n.anCells[a]:r},1)}),o("cells().data()",function(){return this.iterator("cell",function(e,t,a){return z(e,t,a)},1)}),s("cells().cache()","cell().cache()",function(e){return e="search"===e?"_aFilterData":"_aSortData",this.iterator("cell",function(t,a,r){return t.aoData[a][e][r]},1)}),s("cells().render()","cell().render()",function(e){return this.iterator("cell",function(t,a,r){return z(t,a,r,e)},1)}),s("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(e,t,a){return{row:t,column:a,columnVisible:B(e,a)}},1)}),s("cells().invalidate()","cell().invalidate()",function(e){return this.iterator("cell",function(t,a,r){ie(t,a,e,r)})}),o("cell()",function(e,t,a){return xt(this.cells(e,t,a))}),o("cell().data()",function(e){var t=this.context,a=this[0];return e===r?t.length&&a.length?z(t[0],a[0].row,a[0].column):r:(Y(t[0],a[0].row,a[0].column,e),ie(t[0],a[0].row,"data",a[0].column),this)}),o("order()",function(t,a){var n=this.context;return t===r?0!==n.length?n[0].aaSorting:r:("number"==typeof t?t=[[t,a]]:t.length&&!e.isArray(t[0])&&(t=Array.prototype.slice.call(arguments)),this.iterator("table",function(e){e.aaSorting=t.slice()}))}),o("order.listener()",function(e,t,a){return this.iterator("table",function(r){nt(r,e,t,a)})}),o("order.fixed()",function(t){if(!t){var a=this.context,n=a.length?a[0].aaSortingFixed:r;return e.isArray(n)?{pre:n}:n}return this.iterator("table",function(a){a.aaSortingFixed=e.extend(!0,{},t)})}),o(["columns().order()","column().order()"],function(t){var a=this;return this.iterator("table",function(r,n){var i=[];e.each(a[n],function(e,a){i.push([a,t])}),r.aaSorting=i})}),o("search()",function(t,a,n,i){var l=this.context;return t===r?0!==l.length?l[0].oPreviousSearch.sSearch:r:this.iterator("table",function(r){r.oFeatures.bFilter&&_e(r,e.extend({},r.oPreviousSearch,{sSearch:t+"",bRegex:null===a?!1:a,bSmart:null===n?!0:n,bCaseInsensitive:null===i?!0:i}),1)})}),s("columns().search()","column().search()",function(t,a,n,i){return this.iterator("column",function(l,o){var s=l.aoPreSearchCols;return t===r?s[o].sSearch:void(l.oFeatures.bFilter&&(e.extend(s[o],{sSearch:t+"",bRegex:null===a?!1:a,bSmart:null===n?!0:n,bCaseInsensitive:null===i?!0:i}),_e(l,l.oPreviousSearch,1)))})}),o("state()",function(){return this.context.length?this.context[0].oSavedState:null}),o("state.clear()",function(){return this.iterator("table",function(e){e.fnStateSaveCallback.call(e.oInstance,e,{})})}),o("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null}),o("state.save()",function(){return this.iterator("table",function(e){ot(e)})}),n.versionCheck=n.fnVersionCheck=function(e){for(var r,i,t=n.version.split("."),a=e.split("."),l=0,o=a.length;o>l;l++)if(r=parseInt(t[l],10)||0,i=parseInt(a[l],10)||0,r!==i)return r>i;return!0},n.isDataTable=n.fnIsDataTable=function(t){var a=e(t).get(0),r=!1;return t instanceof n.Api?!0:(e.each(n.settings,function(t,n){var i=n.nScrollHead?e("table",n.nScrollHead)[0]:null,l=n.nScrollFoot?e("table",n.nScrollFoot)[0]:null;(n.nTable===a||i===a||l===a)&&(r=!0)}),r)},n.tables=n.fnTables=function(t){var a=!1;e.isPlainObject(t)&&(a=t.api,t=t.visible);var r=e.map(n.settings,function(a){return!t||t&&e(a.nTable).is(":visible")?a.nTable:void 0});return a?new l(r):r},n.camelToHungarian=F,o("$()",functi
|