From 2b4880e8e8f51cf3e77b7730ed598dcf0e1f206c Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Sat, 21 Feb 2015 00:46:57 +1100 Subject: [PATCH] Added status bar feature --- .gitignore | 1 - dist/filtergrid.css | 2 +- dist/tablefilter.js | 8 +- src-es6/modules/statusBar.js | 117 ++++++++++++++++++++++++++++ src/core.js | 143 ++++------------------------------- src/index.html | 10 ++- src/modules/statusBar.js | 130 +++++++++++++++++++++++++++++++ test/test-status-bar.html | 82 ++++++++++++++++++++ test/test-status-bar.js | 47 ++++++++++++ 9 files changed, 401 insertions(+), 139 deletions(-) create mode 100644 src-es6/modules/statusBar.js create mode 100644 src/modules/statusBar.js create mode 100644 test/test-status-bar.html create mode 100644 test/test-status-bar.js diff --git a/.gitignore b/.gitignore index dc9b64f6..87a06a05 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -# Dependency directory node_modules npm-debug.log *.js.map diff --git a/dist/filtergrid.css b/dist/filtergrid.css index 82210d61..4e63022c 100644 --- a/dist/filtergrid.css +++ b/dist/filtergrid.css @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------ - TableFilter stylesheet by Max Guglielmi - - (build date: Fri Feb 20 2015 15:11:39) + - (build date: Sat Feb 21 2015 00:45:41) - Edit below for your projects' needs ------------------------------------------------------------------------*/ diff --git a/dist/tablefilter.js b/dist/tablefilter.js index 48b900e1..786fc301 100644 --- a/dist/tablefilter.js +++ b/dist/tablefilter.js @@ -1,10 +1,10 @@ /*------------------------------------------------------------------------ - TableFilter v3.0.0 by Max Guglielmi - - build date: Tue Feb 17 2015 22:16:28 + - build date: Sat Feb 21 2015 00:45:41 - http://tablefilter.free.fr - Copyright (c) 2014, Licensed under the MIT License ------------------------------------------------------------------------*/ !function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b:a.TableFilter=b()}(this,function(){var requirejs,require,define;return function(a){function b(a,b){return r.call(a,b)}function c(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=p.map,q=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,p.nodeIdCompat&&t.test(a[g])&&(a[g]=a[g].replace(t,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||q)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function d(b,c){return function(){var d=s.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),k.apply(a,d.concat([b,c]))}}function e(a){return function(b){return c(b,a)}}function f(a){return function(b){n[a]=b}}function g(c){if(b(o,c)){var d=o[c];delete o[c],q[c]=!0,j.apply(a,d)}if(!b(n,c)&&!b(q,c))throw new Error("No "+c);return n[c]}function h(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function i(a){return function(){return p&&p.config&&p.config[a]||{}}}var j,k,l,m,n={},o={},p={},q={},r=Object.prototype.hasOwnProperty,s=[].slice,t=/\.js$/;l=function(a,b){var d,f=h(a),i=f[0];return a=f[1],i&&(i=c(i,b),d=g(i)),i?a=d&&d.normalize?d.normalize(a,e(b)):c(a,b):(a=c(a,b),f=h(a),i=f[0],a=f[1],i&&(d=g(i))),{f:i?i+"!"+a:a,n:a,pr:i,p:d}},m={require:function(a){return d(a)},exports:function(a){var b=n[a];return"undefined"!=typeof b?b:n[a]={}},module:function(a){return{id:a,uri:"",exports:n[a],config:i(a)}}},j=function(c,e,h,i){var j,k,p,r,s,t,u=[],v=typeof h;if(i=i||c,"undefined"===v||"function"===v){for(e=!e.length&&h.length?["require","exports","module"]:e,s=0;s]+>/g,"");return b=b.replace(/^\s+/,"").replace(/\s+$/,"")},c.create=function(a){if(a&&""!==a){var b=document.createElement(a),c=arguments;if(c.length>1)for(var d=0;d0){var d=document.cookie,e=d.indexOf(c);if(-1!==e){e+=c.length;var f=d.indexOf(";",e);-1===f&&(f=d.length),b=unescape(d.substring(e,f))}}return b},b.remove=function(a){this.write(a,"",-1)},b.valueToArray=function(a,b){b||(b=",");var c=this.read(a),d=c.split(b);return d},b.getValueByIndex=function(a,b,c){c||(c=",");var d=this.valueToArray(a,c);return d[b]},a.Cookie=b}),define("types",["exports"],function(a){var b={},c=void 0;b.isObj=function(a){var b=!1;return"string"==typeof a?window[a]&&"object"==typeof window[a]&&(b=!0):a&&"object"==typeof a&&(b=!0),b},b.isFn=function(a){return a&&a.constructor==Function},b.isArray=function(a){return a&&a.constructor==Array},b.isUndef=function(a){return a===c},a.Types=b}),define("array",["exports","string"],function(a,b){var c=b.Str,d={has:function(a,b,d){for(var e=void 0===d?!1:d,f=0;f2)return a;var b;return 99>=a&&a>50&&(b="19"+a),(50>a||"00"===a)&&(b="20"+a),b}function d(a){if(void 0===a)return 0;for(var b,c=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],d=0;d11||23>b)&&(b-=12),1>b||b>12?0:b}if(b||(b="DMY"),!a||""===a)return new Date(1001,0,1);var e,f;switch(b.toUpperCase()){case"DDMMMYYYY":f=a.replace(/[- \/.]/g," ").split(" "),e=new Date(c(f[2]),d(f[1])-1,f[0]);break;case"DMY":f=a.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),e=new Date(c(f[2]),f[1]-1,f[0]);break;case"MDY":f=a.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),e=new Date(c(f[2]),f[0]-1,f[1]);break;case"YMD":f=a.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),e=new Date(c(f[0]),f[1]-1,f[2]);break;default:f=a.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),e=new Date(c(f[2]),f[1]-1,f[0])}return e}};a.DateHelper=b}),define("sort",["exports","string"],function(a,b){var c=b.Str,d={ignoreCase:function(a,b){var d=c.lower(a),e=c.lower(b);return e>d?-1:d>e?1:0}};a.Sort=d}),define("modules/store",["exports","../cookie"],function(a,b){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=b.Cookie,e=function(){var a=function(a){var b=a.fObj;this.duration=isNaN(b.set_cookie_duration)?1e5:parseInt(b.set_cookie_duration,10),this.tf=a};return c(a,null,{saveFilterValues:{writable:!0,value:function(a){for(var b=this.tf,c=[],e=0;e0&&c.removeChild(y[0]),this.headTbl.style.width=c.style.width,this.headTbl.style.tableLayout="fixed",c.style.tableLayout="fixed",this.headTbl.cellPadding=c.cellPadding,this.headTbl.cellSpacing=c.cellSpacing,a.SetColWidths(),this.headTblCont.style.width=this.tblCont.clientWidth+"px",c.style.width="";var z=this;i.add(this.tblCont,"scroll",function(){var a=this.scrollLeft;if(z.headTblCont.scrollLeft=a,!z.isPointerXOverwritten)try{z.Evt.pointerX=function(b){var c=b||global.event,d=tf_StandardBody().scrollLeft+a;return c.pageX+a||c.clientX+d},z.isPointerXOverwritten=!0}catch(b){z.isPointerXOverwritten=!1}}),b.sort!==!1&&(a.sort=!0,a.sortConfig.asyncSort=!0,a.sortConfig.triggerIds=o),this.gridEnableColResizer&&(a.hasExtensions?a.__containsStr("colsresizer",Str.lower(a.extensions.src.toString()))||(a.extensions.name.push("ColumnsResizer_"+a.id),a.extensions.src.push(a.gridColResizerPath),a.extensions.description.push("Columns Resizing"),a.extensions.initialize.push(function(a){a.SetColsResizer("ColumnsResizer_"+a.id)})):(a.extensions={name:["ColumnsResizer_"+a.id],src:[this.gridColResizerPath],description:["Columns Resizing"],initialize:[function(a){a.SetColsResizer("ColumnsResizer_"+a.id)}]},a.hasExtensions=!0)),b.col_resizer_cols_headers_table=this.headTbl.getAttribute("id"),b.col_resizer_cols_headers_index=this.gridHeadRowIndex,b.col_resizer_width_adjustment=0,b.col_enable_text_ellipsis=!1,z.tblHasColTag=g.tag(c,"col").length>0?!0:!1;var A=function(b){if(b){for(var d=a.nbCells-1;d>=0;d--){var e=g.create("col",["id",a.id+"_col_"+d]);c.firstChild.parentNode.insertBefore(e,c.firstChild),e.style.width=a.colWidth[d],b.gridColElms[d]=e}b.tblHasColTag=!0}};if(z.tblHasColTag)for(var B=g.tag(c,"col"),C=0;C',this.popUpDivCssClass=b.popup_div_css_class||"popUpFilter",this.onBeforePopUpOpen=g.isFn(b.on_before_popup_filter_open)?b.on_before_popup_filter_open:null,this.onAfterPopUpOpen=g.isFn(b.on_after_popup_filter_open)?b.on_after_popup_filter_open:null,this.onBeforePopUpClose=g.isFn(b.on_before_popup_filter_close)?b.on_before_popup_filter_close:null,this.onAfterPopUpClose=g.isFn(b.on_after_popup_filter_close)?b.on_after_popup_filter_close:null,this.popUpFltSpans=[],this.popUpFltImgs=[],this.popUpFltElms=this.popUpFltElmCache||[],this.popUpFltAdjustToContainer=!0,this.tf=a};return f(a,null,{onClick:{writable:!0,value:function(a){var b=a||global.event,c=b.target.parentNode,d=parseInt(c.getAttribute("ci"),10);if(this.closeAll(d),this.toggle(d),this.popUpFltAdjustToContainer){var e=this.popUpFltElms[d],f=this.tf.GetHeaderElement(d),g=.95*f.clientWidth;if(j.isIE()){var k=h.position(f).left;e.style.left=k+"px"}e.style.width=parseInt(g,10)+"px"}i.cancel(b),i.stop(b)}},init:{writable:!0,value:function(){for(var a=this,b=this.tf,c=0;cv;v++)if(a===v&&(!b||b&&e.disableExcludedOptions)||a==v&&b&&(""===l[s].style.display&&!e.paging||e.paging&&(!e.validRowsIndex||e.validRowsIndex&&h.has(e.validRowsIndex,s))&&(void 0===n||n==a||n!=a&&h.has(e.validRowsIndex,s)))){var w=e.GetCellData(v,t[v]),x=i.matchCase(w,m);if(h.has(this.opts,x,m)||this.opts.push(w),b&&e.disableExcludedOptions){var y=r[v];y||(y=this.GetFilteredDataCol(v)),!h.has(y,x,m)&&!h.has(q,x,m)&&!this.isFirstLoad&&q.push(w)}}}if(this.isCustom){var z=e.__getCustomValues(a);this.opts=z[0],this.optsTxt=z[1]}if(e.sortSlc&&!this.isCustom&&(m?(this.opts.sort(),q&&q.sort()):(this.opts.sort(j.ignoreCase),q&&q.sort(j.ignoreCase))),e.sortNumAsc&&h.has(e.sortNumAsc,a))try{this.opts.sort(numSortAsc),q&&q.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(A){this.opts.sort(),q&&q.sort(),this.isCustom&&this.optsTxt.sort()}if(e.sortNumDesc&&h.has(e.sortNumDesc,a))try{this.opts.sort(numSortDesc),q&&q.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(A){this.opts.sort(),q&&q.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(a,k,b,q,o,p)}}},addOptions:{writable:!0,value:function(a,b,c,d,e,f){var j=this.tf,k=i.lower(this.slcFillingMethod),l=b.value;b.innerHTML="",b=this.addFirstOption(b);for(var m=0;m"+o+""}else{var r;r=j.fillSlcOnDemand&&l===this.opts[m]&&j["col"+a]===j.fltTypeSlc?g.createOpt(o,n,!0):j["col"+a]!==j.fltTypeMulti?g.createOpt(o,n," "!==e[a]&&n===e[a]?!0:!1):g.createOpt(o,n,h.has(f,i.matchCase(this.opts[m],j.matchCase),j.matchCase)||-1!==f.toString().indexOf(n)?!0:!1),p&&(r.disabled=!0),b.appendChild(r)}}"innerhtml"===k&&(b.innerHTML+=this.slcInnerHtml),b.setAttribute("filled","1")}},addFirstOption:{writable:!0,value:function(a){var b=this.tf,c=i.lower(this.slcFillingMethod);if("innerhtml"===c)this.slcInnerHtml+='";else{var d=g.createOpt(this.enableSlcResetFilter?b.displayAllText:"","");if(this.enableSlcResetFilter||(d.style.display="none"),a.appendChild(d),b.enableEmptyOption){var e=g.createOpt(b.emptyText,b.emOperator);a.appendChild(e)}if(b.enableNonEmptyOption){var f=g.createOpt(b.nonEmptyText,b.nmOperator);a.appendChild(f)}}return a}}}),a}();a.Dropdown=k}),define("modules/checkList",["exports","../dom","../array","../string","../sort","../event"],function(a,b,c,d,e,f){var g=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},h=b.Dom,i=c.Arr,j=d.Str,k=e.Sort,l=f.Event,m=function(){var a=function(a){var b=a.fObj;this.checkListDiv=[],this.checkListDivCssClass=b.div_checklist_css_class||"div_checklist",this.checkListCssClass=b.checklist_css_class||"flt_checklist",this.checkListItemCssClass=b.checklist_item_css_class||"flt_checklist_item",this.checkListSlcItemCssClass=b.checklist_selected_item_css_class||"flt_checklist_slc_item",this.activateCheckListTxt=b.activate_checklist_text||"Click to load filter data",this.checkListItemDisabledCssClass=b.checklist_item_disabled_css_class||"flt_checklist_item_disabled",this.enableCheckListResetFilter=b.enable_checklist_reset_filter===!1?!1:!0,this.isCustom=null,this.opts=null,this.optsTxt=null,this.tf=a};return g(a,null,{onChange:{writable:!0,value:function(a){this.tf.Evt._OnSlcChange(a)}},optionClick:{writable:!0,value:function(a){this.setCheckListValues(a.target),this.onChange(a)}},build:{writable:!0,value:function(a,b,c){var d=this.tf;d.EvtManager(d.Evt.name.checklist,{slcIndex:a,slcExternal:b,slcId:c})}},_build:{writable:!0,value:function(a,b,c){var d=this;void 0===c&&(c=null),void 0===b&&(b=!1);var e=this.tf;a=parseInt(a,10),this.opts=[],this.optsTxt=[];var f=e.prfxCheckListDiv+a+"_"+e.id;if((h.id(f)||b)&&(h.id(c)||!b)){var g=b?h.id(c):this.checkListDiv[a],m=h.create("ul",["id",e.fltIds[a]],["colIndex",a]);m.className=this.checkListCssClass,l.add(m,"change",function(a){d.onChange(a)});var n=e.tbl.rows;this.isCustom=e.hasCustomSlcOptions&&i.has(e.customSlcOptions.cols,a);var o;e.refreshFilters&&e.activeFilterId&&(o=e.activeFilterId.split("_")[0],o=o.split(e.prfxFlt)[1]);var p,q=[];e.refreshFilters&&e.disableExcludedOptions&&(p=[]);for(var r=e.refRow;ru;u++)if(a===u&&(!e.refreshFilters||e.refreshFilters&&e.disableExcludedOptions)||a===u&&e.refreshFilters&&(""===n[r].style.display&&!e.paging||e.paging&&(!o||o===a||o!=a&&i.has(e.validRowsIndex,r)))){var v=e.GetCellData(u,s[u]),w=j.matchCase(v,e.matchCase);i.has(this.opts,w,e.matchCase)||this.opts.push(v);var x=q[u];e.refreshFilters&&e.disableExcludedOptions&&(x||(q[u]=e.GetFilteredDataCol(u)),!i.has(x,w,e.matchCase)&&!i.has(p,w,e.matchCase)&&!e.isFirstLoad&&p.push(v))}}if(this.isCustom){var y=e.__getCustomValues(a);this.opts=y[0],this.optsTxt=y[1]}if(e.sortSlc&&!this.isCustom&&(e.matchCase?(this.opts.sort(),p&&p.sort()):(this.opts.sort(k.ignoreCase),p&&p.sort(k.ignoreCase))),e.sortNumAsc&&i.has(e.sortNumAsc,a))try{this.opts.sort(numSortAsc),p&&p.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(z){this.opts.sort(),p&&p.sort(),this.isCustom&&this.optsTxt.sort()}if(e.sortNumDesc&&i.has(e.sortNumDesc,a))try{this.opts.sort(numSortDesc),p&&p.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(z){this.opts.sort(),p&&p.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(a,m,e.separator),e.fillSlcOnDemand&&(g.innerHTML=""),g.appendChild(m),g.setAttribute("filled","1")}}},addChecks:{writable:!0,value:function(a,b){var c=this,d=this.tf,e=this.addTChecks(a,b),f=[],g=d.Cpt.store,k=g?g.getFilterValues(d.fltsValuesCookie)[a]:null;k&&j.trim(k).length>0&&(d.hasCustomSlcOptions&&i.has(d.customSlcOptions.cols,a)?f.push(k):f=k.split(" "+d.orOperator+" "));for(var m=0;m0?1:0),f=e+d.pagingLength-1<=b.nbVisibleRows?e+d.pagingLength-1:b.nbVisibleRows;c=e+this.fromToTextSeparator+f+this.overText+b.nbVisibleRows}}else c=a&&""!==a?a:b.nbFilterableRows-b.nbHiddenRows-(b.hasVisibleRows?b.visibleRows.length:0);this.rowsCounterSpan.innerHTML=c,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,b,this.rowsCounterSpan,c)}}},destroy:{writable:!0,value:function(){var a=this.tf;a.hasGrid&&this.rowsCounterSpan&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?h.isIE()?this.rowsCounterDiv.outerHTML="":this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):f.id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}}),a}();a.RowsCounter=i}),define("modules/paging",["exports","../dom","../types","../string","../helpers","../event"],function(a,b,c,d,e,f){var g=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},h=b.Dom,i=c.Types,j=d.Str,k=(e.Helpers,f.Event),l=function(){var a=function(a){var b=a.fObj;this.btnPageCssClass=b.paging_btn_css_class||"pgInp",this.pagingSlc=null,this.resultsPerPageSlc=null,this.pagingTgtId=b.paging_target_id||null,this.pagingLength=isNaN(b.paging_length)?10:b.paging_length,this.resultsPerPageTgtId=b.results_per_page_target_id||null,this.pgSlcCssClass=b.paging_slc_css_class||"pgSlc",this.pgInpCssClass=b.paging_inp_css_class||"pgNbInp",this.resultsPerPage=b.results_per_page||null,this.hasResultsPerPage=i.isArray(this.resultsPerPage),this.resultsSlcCssClass=b.results_slc_css_class||"rspg",this.resultsSpanCssClass=b.results_span_css_class||"rspgSpan",this.startPagingRow=0,this.nbPages=0,this.currentPageNb=1,this.btnNextPageText=b.btn_next_page_text||">",this.btnPrevPageText=b.btn_prev_page_text||"<",this.btnLastPageText=b.btn_last_page_text||">|",this.btnFirstPageText=b.btn_first_page_text||"|<",this.btnNextPageHtml=b.btn_next_page_html||(a.enableIcons?'':null),this.btnPrevPageHtml=b.btn_prev_page_html||(a.enableIcons?'':null),this.btnFirstPageHtml=b.btn_first_page_html||(a.enableIcons?'':null),this.btnLastPageHtml=b.btn_last_page_html||(a.enableIcons?'':null),this.pageText=b.page_text||" Page ",this.ofText=b.of_text||" of ",this.nbPgSpanCssClass=b.nb_pages_css_class||"nbpg",this.hasPagingBtns=b.paging_btns===!1?!1:!0,this.pageSelectorType=b.page_selector_type||a.fltTypeSlc,this.onBeforeChangePage=i.isFn(b.on_before_change_page)?b.on_before_change_page:null,this.onAfterChangePage=i.isFn(b.on_after_change_page)?b.on_after_change_page:null;var c=this.refRow,d=this.nbRows;this.nbPages=Math.ceil((d-c)/this.pagingLength);var e=this;this.evt={slcIndex:function(){return e.pageSelectorType===a.fltTypeSlc?e.pagingSlc.options.selectedIndex:parseInt(e.pagingSlc.value,10)-1},nbOpts:function(){return e.pageSelectorType===a.fltTypeSlc?parseInt(e.pagingSlc.options.length,10)-1:e.nbPages-1},next:function(){var a=e.evt.slcIndex()0?e.evt.slcIndex()-1:e.evt.nbOpts();e.changePage(a)},last:function(){e.changePage(e.evt.nbOpts())},first:function(){e.changePage(0)},_detectKey:function(b){var c=a.Evt.getKeyCode(b);13===c&&(a.sorted?(a.Filter(),e.changePage(e.evt.slcIndex())):e.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=a};return g(a,null,{init:{writable:!0,value:function(){var a,b=this,c=this.tf,d=this.evt;this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),d.slcPagesChange=function(a){b.changePage(),a.target.blur()},this.pageSelectorType===c.fltTypeSlc&&(a=h.create(c.fltTypeSlc,["id",c.prfxSlcPages+c.id]),a.className=this.pgSlcCssClass,k.add(a,"change",d.slcPagesChange)),this.pageSelectorType===c.fltTypeInp&&(a=h.create(c.fltTypeInp,["id",c.prfxSlcPages+c.id],["value",this.currentPageNb]),a.className=this.pgInpCssClass,k.add(a,"keypress",d._detectKey));var e=h.create("span",["id",c.prfxBtnNextSpan+c.id]),f=h.create("span",["id",c.prfxBtnPrevSpan+c.id]),g=h.create("span",["id",c.prfxBtnLastSpan+c.id]),i=h.create("span",["id",c.prfxBtnFirstSpan+c.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)e.innerHTML=this.btnNextPageHtml,k.add(e,"click",d.next);else{var j=h.create(c.fltTypeInp,["id",c.prfxBtnNext+c.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);j.className=this.btnPageCssClass,k.add(j,"click",d.next),e.appendChild(j)}if(this.btnPrevPageHtml)f.innerHTML=this.btnPrevPageHtml,k.add(f,"click",d.prev);else{var l=h.create(c.fltTypeInp,["id",c.prfxBtnPrev+c.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);l.className=this.btnPageCssClass,k.add(l,"click",d.prev),f.appendChild(l)}if(this.btnLastPageHtml)g.innerHTML=this.btnLastPageHtml,k.add(g,"click",d.last);else{var m=h.create(c.fltTypeInp,["id",c.prfxBtnLast+c.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);m.className=this.btnPageCssClass,k.add(m,"click",d.last),g.appendChild(m)}if(this.btnFirstPageHtml)i.innerHTML=this.btnFirstPageHtml,k.add(i,"click",d.first);else{var n=h.create(c.fltTypeInp,["id",c.prfxBtnFirst+c.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);n.className=this.btnPageCssClass,k.add(n,"click",d.first),i.appendChild(n)}}this.pagingTgtId||c.SetTopDiv();var o=this.pagingTgtId?h.id(this.pagingTgtId):c.mDiv;o.appendChild(i),o.appendChild(f);var p=h.create("span",["id",c.prfxPgBeforeSpan+c.id]);p.appendChild(h.text(this.pageText)),p.className=this.nbPgSpanCssClass,o.appendChild(p),o.appendChild(a);var q=h.create("span",["id",c.prfxPgAfterSpan+c.id]);q.appendChild(h.text(this.ofText)),q.className=this.nbPgSpanCssClass,o.appendChild(q);var r=h.create("span",["id",c.prfxPgSpan+c.id]);r.className=this.nbPgSpanCssClass,r.appendChild(h.text(" "+this.nbPages+" ")),o.appendChild(r),o.appendChild(e),o.appendChild(g),this.pagingSlc=h.id(c.prfxSlcPages+c.id),(!c.rememberGridValues||this.isPagingRemoved)&&this.setPagingInfo(),c.fltGrid||(c.ValidateAllRows(),this.setPagingInfo(c.validRowsIndex)),this.isPagingRemoved=!1}},addPaging:{writable:!0,value:function(a){void 0===a&&(a=!1);var b=this.tf;b.hasGrid&&!b.paging&&(b.paging=!0,this.isPagingRemoved=!0,this.init(),b.ResetValues(),a&&b.Filter())}},setPagingInfo:{writable:!0,value:function(a){var b=this.tf,c=b.tbl.rows,d=this.pagingTgtId?h.id(this.pagingTgtId):b.mDiv,e=h.id(b.prfxPgSpan+b.id);if(a&&a.length>0)b.validRowsIndex=a;else{b.validRowsIndex=[];for(var f=b.refRow;f0)if(d.style.visibility="visible",this.pageSelectorType===b.fltTypeSlc)for(var j=0;j=this.startPagingRow&&d>e?("true"!==f.getAttribute("validRow")&&f.getAttribute("validRow")||(f.style.display=""),b.alternateBgs&&b.Cpt.alternateRows&&b.Cpt.alternateRows.setRowBg(b.validRowsIndex[e],e)):(f.style.display="none",b.alternateBgs&&b.Cpt.alternateRows&&b.Cpt.alternateRows.removeRowBg(b.validRowsIndex[e]))}b.nbVisibleRows=b.validRowsIndex.length,b.isStartBgAlternate=!1,b.ApplyGridProps()}},setPage:{writable:!0,value:function(a){var b=this.tf;if(b.hasGrid&&this.paging){var c=this.evt,d=typeof a;if("string"===d)switch(j.lower(a)){case"next":c.next();break;case"previous":c.prev();break;case"last":c.last();break;case"first":c.first();break;default:c.next()}else"number"===d&&this.changePage(a-1)}}},setResultsPerPage:{writable:!0,value:function(){var a=this,b=this.tf,c=this.evt;if((b.hasGrid||b.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){c.slcResultsChange=function(b){a.changeResultsPerPage(),b.target.blur()};var d=h.create(b.fltTypeSlc,["id",b.prfxSlcResults+b.id]);d.className=b.resultsSlcCssClass;var e=this.resultsPerPage[0],f=this.resultsPerPage[1],g=h.create("span",["id",b.prfxSlcResultsTxt+b.id]);g.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||b.SetTopDiv();var i=this.resultsPerPageTgtId?h.id(this.resultsPerPageTgtId):b.rDiv;g.appendChild(h.text(e)),i.appendChild(g),i.appendChild(d),this.resultsPerPageSlc=h.id(b.prfxSlcResults+b.id);for(var j=0;j=0&&a<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,a),this.currentPageNb=parseInt(a,10)+1,this.pageSelectorType===b.fltTypeSlc?this.pagingSlc.options[a].selected=!0:this.pagingSlc.value=this.currentPageNb,b.rememberPageNb&&b.Cpt.store.savePageNb(b.pgNbCookie),this.startPagingRow=this.pageSelectorType===b.fltTypeSlc?this.pagingSlc.value:a*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,a)))}},_changeResultsPerPage:{writable:!0,value:function(){var a=this.tf;if(a.paging){var b=this.resultsPerPageSlc,c=this.pageSelectorType===a.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(b.options[b.selectedIndex].value,10),this.startPagingRow=this.pagingLength*c,!isNaN(this.pagingLength)){if(this.startPagingRow>=a.nbFilterableRows&&(this.startPagingRow=a.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===a.fltTypeSlc){var d=this.pagingSlc.options.length-1<=c?this.pagingSlc.options.length-1:c;this.pagingSlc.options[d].selected=!0}a.rememberPageLen&&a.Cpt.store.savePageLength(a.pgLenCookie)}}}},_resetPage:{writable:!0,value:function(a){var b=this.tf,c=b.Cpt.store.getPageNb(a);""!==c&&this.changePage(c-1)}},_resetPageLength:{writable:!0,value:function(a){var b=this.tf;if(b.paging){var c=b.Cpt.store.getPageLength(a);""!==c&&(this.resultsPerPageSlc.options[c].selected=!0,this.changeResultsPerPage())}}},destroy:{writable:!0,value:function(){var a=this.tf;if(a.hasGrid){var b,c,d,e,f,g,i;b=h.id(a.prfxBtnNextSpan+a.id),c=h.id(a.prfxBtnPrevSpan+a.id),d=h.id(a.prfxBtnLastSpan+a.id),e=h.id(a.prfxBtnFirstSpan+a.id),f=h.id(a.prfxPgBeforeSpan+a.id),g=h.id(a.prfxPgAfterSpan+a.id),i=h.id(a.prfxPgSpan+a.id);var j=this.evt;this.pagingSlc&&(this.pageSelectorType===a.fltTypeSlc?k.remove(this.pagingSlc,"change",j.slcPagesChange):this.pageSelectorType===a.fltTypeInp&&k.remove(this.pagingSlc,"keypress",j._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),b&&(k.remove(b,"click",j.next),b.parentNode.removeChild(b)),c&&(k.remove(c,"click",j.prev),c.parentNode.removeChild(c)),d&&(k.remove(d,"click",j.last),d.parentNode.removeChild(d)),e&&(k.remove(e,"click",j.first),e.parentNode.removeChild(e)),f&&f.parentNode.removeChild(f),g&&g.parentNode.removeChild(g),i&&i.parentNode.removeChild(i),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,a.paging=!1}}}}),a}();a.Paging=l}),define("modules/alternateRows",["exports","../dom"],function(a,b){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=b.Dom,e=function(){var a=function(a){var b=a.fObj;this.evenCss=b.even_row_css_class||"even",this.oddCss=b.odd_row_css_class||"odd",this.tf=a};return c(a,null,{init:{writable:!0,value:function(){if(this.tf.hasGrid||this.tf.isFirstLoad)for(var a=(this.tf.tbl.rows,null===this.tf.validRowsIndex),b=a?this.tf.refRow:0,c=a?this.tf.nbFilterableRows+b:this.tf.validRowsIndex.length,d=0,e=b;c>e;e++){var f=a?e:this.tf.validRowsIndex[e];this.setRowBg(f,d),d++}}},setRowBg:{writable:!0,value:function(a,b){if(this.tf.alternateBgs&&!isNaN(a)){var c=this.tf.tbl.rows,e=b?b:a;this.removeRowBg(a),d.addClass(c[a],e%2?this.evenCss:this.oddCss)}}},removeRowBg:{writable:!0,value:function(a){if(!isNaN(a)){var b=this.tf.tbl.rows;d.removeClass(b[a],this.oddCss),d.removeClass(b[a],this.evenCss)}}},remove:{writable:!0,value:function(){if(this.tf.hasGrid){for(var a=(this.tf.tbl.rows,this.tf.refRow);a=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==Str.lower(typeof labelId)&&"object"==Str.lower(typeof colIndex)&&"object"==Str.lower(typeof operation))for(var row=this.tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(this.tf.GetColValues(ucolIndex[ucol],!0,excludeRow));for(var result,nbvalues=0,temp,meanValue=0,sumValue=0,minValue=null,maxValue=null,q1Value=null,medValue=null,q3Value=null,meanFlag=0,sumFlag=0,minFlag=0,maxFlag=0,q1Flag=0,medFlag=0,q3Flag=0,theList=[],opsThisCol=[],decThisCol=[],labThisCol=[],oTypeThisCol=[],mThisCol=-1,k=0;kmaxValue?parseFloat(cvalue):maxValue))}if(1===meanFlag&&(meanValue=sumValue/nbvalues),1===medFlag){var aux=0;nbvalues%2===1?(aux=Math.floor(nbvalues/2),medValue=theList[aux]):medValue=(theList[nbvalues/2]+theList[nbvalues/2-1])/2}var posa;if(1===q1Flag&&(posa=0,posa=Math.floor(nbvalues/4),q1Value=4*posa==nbvalues?(theList[posa-1]+theList[posa])/2:theList[posa]),1===q3Flag){posa=0;var posb=0;posa=Math.floor(nbvalues/4),4*posa===nbvalues?(posb=3*posa,q3Value=(theList[posb]+theList[posb-1])/2):q3Value=theList[nbvalues-posa-1]}for(var i=0;mThisCol>=i;i++){switch(opsThisCol[i]){case"mean":result=meanValue;break;case"sum":result=sumValue;break;case"min":result=minValue;break;case"max":result=maxValue;break;case"median":result=medValue;break;case"q1":result=q1Value;break;case"q3":result=q3Value}var precision=isNaN(decThisCol[i])?2:decThisCol[i];if(oTypeThisCol&&result){if(result=result.toFixed(precision),Dom.id(labThisCol[i]))switch(Str.lower(oTypeThisCol)){case"innerhtml":Dom.id(labThisCol[i]).innerHTML=isNaN(result)||!isFinite(result)||0===nbvalues?".":result;break;case"setvalue":Dom.id(labThisCol[i]).value=result;break;case"createtextnode":var oldnode=Dom.id(labThisCol[i]).firstChild,txtnode=Dom.text(result);Dom.id(labThisCol[i]).replaceChild(txtnode,oldnode)}}else try{Dom.id(labThisCol[i]).innerHTML=isNaN(result)||!isFinite(result)||0===nbvalues?".":result.toFixed(precision)}catch(e){}}var totRow=totRowIndex&&totRowIndex[ucol]?row[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,this.tf)}}}}),ColOps}();exports.ColOps=ColOps}),define("core",["require","event","dom","string","cookie","types","array","helpers","date","sort","modules/store","modules/gridLayout","modules/loader","modules/highlightKeywords","modules/popupFilter","modules/dropdown","modules/checkList","modules/rowsCounter","modules/paging","modules/alternateRows","modules/colOps"],function(a){function b(a){if(0!==arguments.length){if(this.id=a,this.version="3.0",this.year=(new Date).getFullYear(),this.tbl=h.id(a),this.startRow=null,this.refRow=null,this.headersRow=null,this.fObj=null,this.nbFilterableRows=null,this.nbRows=null,this.nbCells=null,this.hasGrid=!1,this.enableModules=!1,!this.tbl||"table"!==k.lower(this.tbl.nodeName)||0===this.GetRowsNb())throw new Error("Could not instantiate TF object: HTML table not found.");if(arguments.length>1)for(var b=0;b1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==i.filters_cell_tag||"td"!==i.filters_cell_tag?"td":i.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.tblData=[],this.validRowsIndex=null,this.fltGridEl=null,this.isFirstLoad=!0,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.contDiv=null,this.infDivCssClass=i.inf_div_css_class||"inf",this.lDivCssClass=i.left_div_css_class||"ldiv",this.rDivCssClass=i.right_div_css_class||"rdiv",this.mDivCssClass=i.middle_div_css_class||"mdiv",this.contDivCssClass=i.content_div_css_class||"cont",this.stylesheet=i.stylesheet||this.basePath+"filtergrid.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=i.flts_row_css_class||"fltrow",this.enableIcons=i.enable_icons===!1?!1:!0,this.alternateBgs=i.alternate_rows===!0?!0:!1,this.hasColWidth=i.col_width===!0?!0:!1,this.colWidth=this.hasColWidth?i.col_width:null,this.fixedHeaders=i.fixed_headers===!0?!0:!1,this.tBodyH=isNaN(i.tbody_height)?200:i.tbody_height,this.fltCssClass=i.flt_css_class||"flt",this.fltMultiCssClass=i.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=i.flt_small_css_class||"flt_s",this.singleFltCssClass=i.single_flt_css_class||"single_flt",this.isStartBgAlternate=!0,this.enterKey=i.enter_key===!1?!1:!0,this.isModFilterFn=i.mod_filter_fn===!0?!0:!1,this.modFilterFn=this.isModFilterFn?i.mod_filter_fn:null,this.onBeforeFilter=m.isFn(i.on_before_filter)?i.on_before_filter:null,this.onAfterFilter=m.isFn(i.on_after_filter)?i.on_after_filter:null,this.matchCase=i.match_case===!0?!0:!1,this.exactMatch=i.exact_match===!0?!0:!1,this.refreshFilters=i.refresh_filters===!0?!0:!1,this.disableExcludedOptions=i.disable_excluded_options===!0?!0:!1,this.activeFlt=null,this.activeFilterId=null,this.hasColOperation=i.col_operation?!0:!1,this.colOperation=null,this.hasVisibleRows=i.rows_always_visible?!0:!1,this.visibleRows=this.hasVisibleRows?i.rows_always_visible:[],this.searchType=i.search_type||"include",this.isExternalFlt=i.external_flt_grid===!0?!0:!1,this.externalFltTgtIds=i.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(i.exec_delay)?100:parseInt(i.exec_delay,10),this.status=i.status===!0?!0:!1,this.onFiltersLoaded=m.isFn(i.on_filters_loaded)?i.on_filters_loaded:null,this.singleSearchFlt=i.single_search_filter===!0?!0:!1,this.onRowValidated=m.isFn(i.on_row_validated)?i.on_row_validated:null,this.customCellDataCols=i.custom_cell_data_cols?i.custom_cell_data_cols:[],this.customCellData=m.isFn(i.custom_cell_data)?i.custom_cell_data:null,this.inpWatermark=i.input_watermark||"",this.inpWatermarkCssClass=i.input_watermark_css_class||"fltWatermark",this.isInpWatermarkArray=m.isArray(i.input_watermark),this.toolBarTgtId=i.toolbar_target_id||null,this.helpInstructions=i.help_instructions||null,this.popUpFilters=i.popup_filters===!0?!0:!1,this.markActiveColumns=i.mark_active_columns===!0?!0:!1,this.activeColumnsCssClass=i.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=m.isFn(i.on_before_active_column)?i.on_before_active_column:null,this.onAfterActiveColumn=m.isFn(i.on_after_active_column)?i.on_after_active_column:null,this.displayAllText=i.display_all_text||"",this.enableEmptyOption=i.enable_empty_option===!0?!0:!1,this.emptyText=i.empty_text||"(Empty)",this.enableNonEmptyOption=i.enable_non_empty_option===!0?!0:!1,this.nonEmptyText=i.non_empty_text||"(Non empty)",this.onSlcChange=i.on_change===!1?!1:!0,this.sortSlc=i.sort_select===!1?!1:!0,this.isSortNumAsc=i.sort_num_asc===!0?!0:!1,this.sortNumAsc=this.isSortNumAsc?i.sort_num_asc:null,this.isSortNumDesc=i.sort_num_desc===!0?!0:!1,this.sortNumDesc=this.isSortNumDesc?i.sort_num_desc:null,this.fillSlcOnDemand=i.fill_slc_on_demand===!0?!0:!1,this.hasCustomSlcOptions=m.isObj(i.custom_slc_options)?!0:!1,this.customSlcOptions=m.isArray(i.custom_slc_options)?i.custom_slc_options:null,this.rgxOperator=i.regexp_operator||"rgx:",this.emOperator=i.empty_operator||"[empty]",this.nmOperator=i.nonempty_operator||"[nonempty]",this.orOperator=i.or_operator||"||",this.anOperator=i.and_operator||"&&",this.grOperator=i.greater_operator||">",this.lwOperator=i.lower_operator||"<",this.leOperator=i.lower_equal_operator||"<=",this.geOperator=i.greater_equal_operator||">=",this.dfOperator=i.different_operator||"!",this.lkOperator=i.like_operator||"*",this.eqOperator=i.equal_operator||"=",this.stOperator=i.start_with_operator||"{",this.enOperator=i.end_with_operator||"}",this.curExp=i.cur_exp||"^[¥£€$]",this.separator=i.separator||",",this.rowsCounter=i.rows_counter===!0?!0:!1,this.statusBar=i.status_bar===!0?!0:!1,this.loader=i.loader===!0?!0:!1,this.displayBtn=i.btn===!0?!0:!1,this.btnText=i.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=i.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=i.btn_reset===!0?!0:!1,this.btnResetCssClass=i.btn_reset_css_class||"reset",this.onBeforeReset=m.isFn(i.on_before_reset)?i.on_before_reset:null,this.onAfterReset=m.isFn(i.on_after_reset)?i.on_after_reset:null,this.paging=i.paging===!0?!0:!1,this.nbVisibleRows=0,this.nbHiddenRows=0,this.sort=i.sort===!0?!0:!1,this.isSortEnabled=!1,this.sorted=!1,this.sortConfig=i.sort_config||{},this.sortConfig.name=void 0!==this.sortConfig.name?i.sort_config.name:"sortabletable",this.sortConfig.src=void 0!==this.sortConfig.src?i.sort_config.src:this.basePath+"sortabletable.js",this.sortConfig.adapterSrc=void 0!==this.sortConfig.adapter_src?i.sort_config.adapter_src:this.basePath+"tfAdapter.sortabletable.js",this.sortConfig.initialize=void 0!==this.sortConfig.initialize?i.sort_config.initialize:function(a){a.SetSortTable&&a.SetSortTable()},this.sortConfig.sortTypes=m.isArray(this.sortConfig.sort_types)?i.sort_config.sort_types:[],this.sortConfig.sortCol=void 0!==this.sortConfig.sort_col?i.sort_config.sort_col:null,this.sortConfig.asyncSort=this.sortConfig.async_sort===!0?!0:!1,this.sortConfig.triggerIds=m.isArray(this.sortConfig.sort_trigger_ids)?i.sort_config.sort_trigger_ids:[],this.selectable=i.selectable===!0?!0:!1,this.editable=i.editable===!0?!0:!1,this.ezEditTableConfig=i.ezEditTable_config||{},this.ezEditTableConfig.name=void 0!==this.ezEditTableConfig.name?i.ezEditTable_config.name:"ezedittable",this.ezEditTableConfig.src=void 0!==this.ezEditTableConfig.src?i.ezEditTable_config.src:this.basePath+"ezEditTable/ezEditTable.js",this.ezEditTableConfig.loadStylesheet=this.ezEditTableConfig.loadStylesheet===!0?!0:!1,this.ezEditTableConfig.stylesheet=this.ezEditTableConfig.stylesheet||this.basePath+"ezEditTable/ezEditTable.css",this.ezEditTableConfig.stylesheetName=void 0!==this.ezEditTableConfig.stylesheetName?i.ezEditTable_config.stylesheetName:"ezEditTableCss",this.ezEditTableConfig.err='Failed to instantiate EditTable object.\n"ezEditTable" module may not be available.',this.onKeyUp=i.on_keyup===!0?!0:!1,this.onKeyUpDelay=isNaN(i.on_keyup_delay)?900:i.on_keyup_delay,this.isUserTyping=null,this.onKeyUpTimer=void 0,this.highlightKeywords=i.highlight_keywords===!0?!0:!1,this.defaultDateType=i.default_date_type||"DMY",this.thousandsSeparator=i.thousands_separator||",",this.decimalSeparator=i.decimal_separator||".",this.hasColNbFormat=i.col_number_format===!0?!0:!1,this.colNbFormat=m.isArray(this.hasColNbFormat)?i.col_number_format:null,this.hasColDateType=i.col_date_type===!0?!0:!1,this.colDateType=m.isArray(this.hasColDateType)?i.col_date_type:null,this.msgFilter=i.msg_filter||"Filtering data...",this.msgPopulate=i.msg_populate||"Populating filter...",this.msgPopulateCheckList=i.msg_populate_checklist||"Populating list...",this.msgChangePage=i.msg_change_page||"Collecting paging data...",this.msgClear=i.msg_clear||"Clearing filters...",this.msgChangeResults=i.msg_change_results||"Changing results per page...",this.msgResetValues=i.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=i.msg_reset_page||"Re-setting page...",this.msgResetPageLength=i.msg_reset_page_length||"Re-setting page length...",this.msgSort=i.msg_sort||"Sorting data...",this.msgLoadExtensions=i.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=i.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxContentDiv="cont_",this.prfxCheckListDiv="chkdiv_",this.prfxSlcPages="slcPages_",this.prfxSlcResults="slcResults_",this.prfxSlcResultsTxt="slcResultsTxt_",this.prfxBtnNextSpan="btnNextSpan_",this.prfxBtnPrevSpan="btnPrevSpan_",this.prfxBtnLastSpan="btnLastSpan_",this.prfxBtnFirstSpan="btnFirstSpan_",this.prfxBtnNext="btnNext_",this.prfxBtnPrev="btnPrev_",this.prfxBtnLast="btnLast_",this.prfxBtnFirst="btnFirst_",this.prfxPgSpan="pgspan_",this.prfxPgBeforeSpan="pgbeforespan_",this.prfxPgAfterSpan="pgafterspan_",this.prfxCounter="counter_",this.prfxTotRows="totrows_span_",this.prfxTotRowsTxt="totRowsTextSpan_",this.prfxResetSpan="resetspan_",this.prfxLoader="load_",this.prfxStatus="status_",this.prfxStatusSpan="statusSpan_",this.prfxStatusTxt="statusText_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.prfxMainTblCont="gridCont_",this.prfxTblCont="tblCont_",this.prfxHeadTblCont="tblHeadCont_",this.prfxHeadTbl="tblHead_",this.prfxGridFltTd="_td_",this.prfxGridTh="tblHeadTh_",this.prfxHelpSpan="helpSpan_",this.prfxHelpDiv="helpDiv_",this.prfxPopUpSpan="popUpSpan_",this.prfxPopUpDiv="popUpDiv_",this.hasStoredValues=!1,this.rememberGridValues=i.remember_grid_values===!0?!0:!1,this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&i.remember_page_number?!0:!1,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&i.remember_page_length?!0:!1,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.hasExtensions=i.extensions===!0?!0:!1,this.extensions=this.hasExtensions?i.extensions:null,this.enableDefaultTheme=i.enable_default_theme===!0?!0:!1,this.hasThemes=i.enable_default_theme||i.themes&&m.isObj(i.themes)?!0:!1,this.themes=this.hasThemes?i.themes:null,this.themesPath=i.themes_path||this.basePath+"TF_Themes/",this.Cpt={loader:null,alternateRows:null,colOps:null,rowsCounter:null,gridLayout:null,store:null,highlightKeywords:null,paging:null,checkList:null,dropdown:null,popupFilter:null}; -var p=this;this.Evt={name:{filter:"Filter",dropdown:"dropdown",checklist:"checkList",changepage:"changePage",clear:"Clear",changeresultsperpage:"changeResults",resetvalues:"ResetValues",resetpage:"resetPage",resetpagelength:"resetPageLength",sort:"Sort",loadextensions:"LoadExtensions",loadthemes:"LoadThemes"},getKeyCode:function(a){return a.charCode?a.charCode:a.keyCode?a.keyCode:a.which?a.which:0},_DetectKey:function(a){if(p.enterKey){var b=a||f.event;if(b){var c=p.Evt.getKeyCode(b);13===c?(p._Filter(),g.cancel(b),g.stop(b)):(p.isUserTyping=!0,f.clearInterval(p.onKeyUpTimer),p.onKeyUpTimer=void 0)}}},_OnKeyUp:function(a){function b(){f.clearInterval(p.onKeyUpTimer),p.onKeyUpTimer=void 0,p.isUserTyping||(p.Filter(),p.isUserTyping=null)}if(p.onKeyUp){var c=a||f.event,d=p.Evt.getKeyCode(c);p.isUserTyping=!1,13!==d&&9!==d&&27!==d&&38!==d&&40!==d?void 0===p.onKeyUpTimer&&(p.onKeyUpTimer=f.setInterval(b,p.onKeyUpDelay)):(f.clearInterval(p.onKeyUpTimer),p.onKeyUpTimer=void 0)}},_OnKeyDown:function(){p.onKeyUp&&(p.isUserTyping=!0)},_OnInpBlur:function(){p.onKeyUp&&(p.isUserTyping=!1,f.clearInterval(p.onKeyUpTimer)),""===this.value&&""!==p.inpWatermark&&(this.value=p.isInpWatermarkArray?p.inpWatermark[this.getAttribute("ct")]:p.inpWatermark,h.addClass(this,p.inpWatermarkCssClass)),p.ezEditTable&&(p.editable&&p.ezEditTable.Editable.Set(),p.selectable&&p.ezEditTable.Selection.Set())},_OnInpFocus:function(a){var b=a||f.event;if(p.activeFilterId=this.getAttribute("id"),p.activeFlt=h.id(p.activeFilterId),p.isInpWatermarkArray){var c=p.inpWatermark[this.getAttribute("ct")];this.value===c&&""!==c&&(this.value="",h.removeClass(this,p.inpWatermarkCssClass))}else this.value===p.inpWatermark&&""!==p.inpWatermark&&(this.value="",h.removeClass(this,p.inpWatermarkCssClass));p.popUpFilters&&(g.cancel(b),g.stop(b)),p.ezEditTable&&(p.editable&&p.ezEditTable.Editable.Remove(),p.selectable&&p.ezEditTable.Selection.Remove())},_OnSlcFocus:function(a){var b=a||f.event;if(p.activeFilterId=this.getAttribute("id"),p.activeFlt=h.id(p.activeFilterId),p.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var c=this.getAttribute("ct");p.Cpt.dropdown._build(c)}p.popUpFilters&&(g.cancel(b),g.stop(b))},_OnSlcChange:function(a){if(p.activeFlt){var b=(p.activeFlt.getAttribute("colIndex"),a||f.event);p.popUpFilters&&g.stop(b),p.onSlcChange&&p.Filter()}},_OnSlcBlur:function(){},_OnCheckListClick:function(){if(p.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var a=this.getAttribute("ct");p.Cpt.checkList._build(a),p.Cpt.checkList.checkListDiv[a].onclick=null,p.Cpt.checkList.checkListDiv[a].title=""}},_OnCheckListFocus:function(){p.activeFilterId=this.firstChild.getAttribute("id"),p.activeFlt=h.id(p.activeFilterId)},_OnCheckListBlur:function(){},_OnBtnClick:function(){p.Filter()},_OnSlcPagesChangeEvt:null,_EnableSlc:function(){this.firstChild.disabled=!1,this.firstChild.focus(),this.onclick=null},_Clear:function(){p.ClearFilters()},_OnHelpBtnClick:function(){p._ToggleHelp()},_Paging:{nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null}}}}function c(a,b){if(a){b||(b="us");var c=a;return c="us"===k.lower(b)?+c.replace(/[^\d\.-]/g,""):+c.replace(/[^\d\,-]/g,"").replace(",",".")}}function d(a,b){for(var c=!1,d=b?b:"script",e="script"==d?"src":"href",f=h.tag(s,d),g=0;g0?n[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popUpFilters&&this.headersRow++,this.popUpFilters&&this.headersRow++,m.className=this.fltsRowCssClass,this.isExternalFlt&&(!this.gridLayout||this.popUpFilters)&&(m.style.display="none")}this.nbFilterableRows=this.GetRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var o=0;d>o;o++){this.popUpFilters&&this.Cpt.popupFilter.build(o);var p=h.create(this.fltCellTag),q=this["col"+o],r=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[o]:null;if(this.singleSearchFlt&&(p.colSpan=this.nbCells),this.gridLayout||m.appendChild(p),b=o==d-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,void 0===q&&(q=void 0===c["col_"+o]?this.fltTypeInp:k.lower(c["col_"+o])),this.singleSearchFlt&&(q=this.fltTypeInp,b=this.singleFltCssClass),q===this.fltTypeSlc||q===this.fltTypeMulti){var s;if(!this.Cpt.dropdown){var t=a("modules/dropdown").Dropdown;s=new t(this)}this.Cpt.dropdown=s;var u=h.create(this.fltTypeSlc,["id",this.prfxFlt+o+"_"+this.id],["ct",o],["filled","0"]);if(q===this.fltTypeMulti&&(u.multiple=this.fltTypeMulti,u.title=s.multipleSlcTooltip),u.className=k.lower(q)===this.fltTypeSlc?b:this.fltMultiCssClass,r?(h.id(r).appendChild(u),this.externalFltEls.push(u)):p.appendChild(u),this.fltIds.push(this.prfxFlt+o+"_"+this.id),this.fillSlcOnDemand||s._build(o),g.add(u,"keypress",this.Evt._DetectKey),g.add(u,"change",this.Evt._OnSlcChange),g.add(u,"focus",this.Evt._OnSlcFocus),g.add(u,"blur",this.Evt._OnSlcBlur),this.fillSlcOnDemand){var v=h.createOpt(this.displayAllText,"");u.appendChild(v)}}else if(q===this.fltTypeCheckList){if(!this.Cpt.checkList){var w=a("modules/checkList").CheckList;this.Cpt.checkList=new w(this)}var x=h.create("div",["id",this.prfxCheckListDiv+o+"_"+this.id],["ct",o],["filled","0"]);x.className=this.Cpt.checkList.checkListDivCssClass,r?(h.id(r).appendChild(x),this.externalFltEls.push(x)):p.appendChild(x),this.Cpt.checkList.checkListDiv[o]=x,this.fltIds.push(this.prfxFlt+o+"_"+this.id),this.fillSlcOnDemand||this.Cpt.checkList._build(o),this.fillSlcOnDemand&&(g.add(x,"click",this.Evt._OnCheckListClick),x.appendChild(h.text(this.Cpt.checkList.activateCheckListTxt))),g.add(x,"click",this.Evt._OnCheckListFocus)}else{var y=q===this.fltTypeInp?"text":"hidden",z=h.create(this.fltTypeInp,["id",this.prfxFlt+o+"_"+this.id],["type",y],["ct",o]);if("hidden"!=y&&(z.value=this.isInpWatermarkArray?this.inpWatermark[o]:this.inpWatermark),z.className=b,""!==this.inpWatermark&&h.addClass(z,this.inpWatermarkCssClass),z.onfocus=this.Evt._OnInpFocus,r?(h.id(r).appendChild(z),this.externalFltEls.push(z)):p.appendChild(z),this.fltIds.push(this.prfxFlt+o+"_"+this.id),z.onkeypress=this.Evt._DetectKey,z.onkeydown=this.Evt._OnKeyDown,z.onkeyup=this.Evt._OnKeyUp,z.onblur=this.Evt._OnInpBlur,this.rememberGridValues){var A=this.Cpt.store.getFilterValues(this.fltsValuesCookie);" "!=A[o]&&this.SetFilterValue(o,A[o],!1)}}if(o==d-1&&this.displayBtn){var B=h.create(this.fltTypeInp,["id",this.prfxValButton+o+"_"+this.id],["type","button"],["value",this.btnText]);B.className=this.btnCssClass,r?h.id(r).appendChild(B):p.appendChild(B),B.onclick=this.Evt._OnBtnClick}}}else this.__resetGrid();else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.GetRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;if(this.rowsCounter){var C=a("modules/rowsCounter").RowsCounter;this.Cpt.rowsCounter=new C(this),this.Cpt.rowsCounter.init()}if(this.statusBar&&this.SetStatusBar(),this.paging){var D=a("modules/paging").Paging;this.Cpt.paging=new D(this),this.Cpt.paging.init()}if(this.btnReset&&this.SetResetBtn(),this.helpInstructions&&this.SetHelpInstructions(),this.hasColWidth&&!this.gridLayout&&this.SetColWidths(),this.alternateBgs){var E=a("modules/alternateRows").AlternateRows;this.Cpt.alternateRows=new E(this),this.Cpt.alternateRows.init()}if(this.hasColOperation){var F=a("modules/colOps").ColOps;this.Cpt.colOps=new F(this),this.Cpt.colOps.calc()}(this.sort||this.gridLayout)&&this.SetSort(),(this.selectable||this.editable)&&this.SetEditable(),this.isFirstLoad=!1,this.hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.ResetValues(),this.gridLayout||h.addClass(this.tbl,this.prfxTf),this.loader&&this.Cpt.loader.show("none"),this.hasExtensions&&this.LoadExtensions(),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this)}},EvtManager:function(a,b){function c(){if(a){switch(a){case d.Evt.name.filter:d.isModFilterFn?d.modFilterFn.call(null,d):d._Filter();break;case d.Evt.name.dropdown:d.refreshFilters?d.Cpt.dropdown._build(e,!0):d.Cpt.dropdown._build(e,!1,g,h);break;case d.Evt.name.checklist:d.Cpt.checkList._build(e,g,h);break;case d.Evt.name.changepage:d.Cpt.paging._changePage(i);break;case d.Evt.name.clear:d._ClearFilters(),d._Filter();break;case d.Evt.name.changeresultsperpage:d.Cpt.paging._changeResultsPerPage();break;case d.Evt.name.resetvalues:d._ResetValues(),d._Filter();break;case d.Evt.name.resetpage:d.Cpt.paging._resetPage(d.pgNbCookie);break;case d.Evt.name.resetpagelength:d.Cpt.paging._resetPageLength(d.pgLenCookie);break;case d.Evt.name.sort:break;case d.Evt.name.loadextensions:d._LoadExtensions();break;case d.Evt.name.loadthemes:d._LoadThemes();break;default:d["_"+a].call(null,d,b)}(d.status||d.statusBar)&&d.StatusMsg(""),d.loader&&d.Cpt.loader.show("none")}}var d=this,e=b&&void 0!==b.slcIndex?b.slcIndex:null,g=b&&void 0!==b.slcExternal?b.slcExternal:!1,h=b&&void 0!==b.slcId?b.slcId:null,i=b&&void 0!==b.pgIndex?b.pgIndex:null;if(this.loader||this.status||this.statusBar){try{this.Cpt.loader.show(""),this.StatusMsg(d["msg"+a])}catch(j){}f.setTimeout(c,this.execDelay)}else c()},ImportModule:function(a){a.path&&a.name&&this.IncludeFile(a.name,a.path,a.init)},LoadExtensions:function(){if(!this.Ext){var a=this;this.Ext={list:{},add:function(b,c,d,e){var f=d.split("/")[d.split("/").length-1],g=new RegExp(f),h=d.replace(g,"");a.Ext.list[b]={name:b,description:c,file:f,path:h,callback:e}}}}this.EvtManager(this.Evt.name.loadextensions)},_LoadExtensions:function(){if(this.hasExtensions&&m.isArray(this.extensions.name)&&m.isArray(this.extensions.src))for(var a=this.extensions,b=0;b',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null}},RemoveGrid:function(){if(this.fltGrid&&this.hasGrid){var a=this.tbl.rows;this.paging&&this.Cpt.paging.destroy(),this.statusBar&&this.RemoveStatusBar(),this.rowsCounter&&this.Cpt.rowsCounter.destroy(),this.btnReset&&this.RemoveResetBtn(),(this.helpInstructions||!this.helpInstructions)&&this.RemoveHelpInstructions(),this.isExternalFlt&&!this.popUpFilters&&this.RemoveExternalFlts(),this.infDiv&&this.RemoveTopDiv(),this.highlightKeywords&&this.Cpt.highlightKeyword.unhighlightAll(),this.sort&&this.RemoveSort(),this.loader&&this.Cpt.loader.remove(),this.popUpFilters&&this.Cpt.popupFilter.destroy(),this.markActiveColumns&&this.ClearActiveColumns(),(this.editable||this.selectable)&&this.RemoveEditable();for(var b=this.refRow;b0&&!c.startRow?void 0:c.startRow||a.refRow,c.scroll_into_view=c.scroll_into_view===!1?!1:!0,c.base_path=c.base_path||a.basePath+"ezEditTable/",c.editable=a.editable=a.fObj.editable,c.selection=a.selectable=a.fObj.selectable,a.selectable&&(c.default_selection=c.default_selection||"row"),c.active_cell_css=c.active_cell_css||"ezETSelectedCell",a._lastValidRowIndex=0,a._lastRowIndex=0,a.selectable){var e=function(b,c,d){if(a.validRowsIndex){var e,f=a.validRowsIndex,g=f.length,h="row"!==b.defaultSelection?c.parentNode:c,i="TD"===c.nodeName?c:null,j=void 0!==d?b.Event.GetKey(d):0,k=n.has(f,h.rowIndex),l=34===j||33===j?a.pagingLength||b.nbRowsPerPage:1;if(k)34!==j&&33!==j?(a._lastValidRowIndex=n.indexByValue(f,h.rowIndex),a._lastRowIndex=h.rowIndex):(e=34===j?a._lastValidRowIndex+l<=g-1?f[a._lastValidRowIndex+l]:[g-1]:a._lastValidRowIndex-l<=f[0]?f[0]:f[a._lastValidRowIndex-l],a._lastRowIndex=e,a._lastValidRowIndex=n.indexByValue(f,e),p(e));else{if(h.rowIndex>a._lastRowIndex)if(h.rowIndex>=f[g-1])e=f[g-1];else{var m=a._lastValidRowIndex+l;e=m>g-1?f[g-1]:f[m]}else if(h.rowIndex<=f[0])e=f[0];else{var o=f[a._lastValidRowIndex-l];e=o?o:f[0]}a._lastRowIndex=h.rowIndex,p(e)}var p=function(d){if("row"===b.defaultSelection)b.Selection.SelectRowByIndex(d);else{b.ClearSelections();var e=c.cellIndex,f=a.tbl.rows[d];"both"===b.defaultSelection&&b.Selection.SelectRowByIndex(d),f&&b.Selection.SelectCell(f.cells[e])}if(a.validRowsIndex.length!==a.GetRowsNb()){var g=a.tbl.rows[d];g&&g.scrollIntoView(!1),i&&(i.cellIndex===a.GetCellsNb()-1&&a.gridLayout?a.tblCont.scrollLeft=1e8:0===i.cellIndex&&a.gridLayout?a.tblCont.scrollLeft=0:i.scrollIntoView(!1))}}}},f=function(b,c){var d="row"!==b.defaultSelection?c.parentNode:c;if(a.paging&&a.nbPages>1){b.nbRowsPerPage=a.pagingLength;var e=a.validRowsIndex,f=e.length,g=parseInt(a.startPagingRow,10)+parseInt(a.pagingLength,10),h=d.rowIndex;h===e[f-1]&&a.currentPageNb!=a.nbPages?a.Cpt.paging.setPage("last"):h==e[0]&&1!==a.currentPageNb?a.Cpt.paging.setPage("first"):h>e[g-1]&&he[0]&&a.Cpt.paging.setPage("previous")}};if(a.paging&&(a.onAfterChangePage=function(a){var b=a.ezEditTable,c=b.Selection.GetActiveRow();c&&c.scrollIntoView(!1);var d=b.Selection.GetActiveCell();d&&d.scrollIntoView(!1)}),"row"===c.default_selection){var g=c.on_before_selected_row;c.on_before_selected_row=function(){f(arguments[0],arguments[1],arguments[2]),g&&g.call(null,arguments[0],arguments[1],arguments[2])};var i=c.on_after_selected_row;c.on_after_selected_row=function(){e(arguments[0],arguments[1],arguments[2]),i&&i.call(null,arguments[0],arguments[1],arguments[2])}}else{var j=c.on_before_selected_cell;c.on_before_selected_cell=function(){f(arguments[0],arguments[1],arguments[2]),j&&j.call(null,arguments[0],arguments[1],arguments[2])};var k=c.on_after_selected_cell;c.on_after_selected_cell=function(){e(arguments[0],arguments[1],arguments[2]),k&&k.call(null,arguments[0],arguments[1],arguments[2])}}}if(a.editable){var l=c.on_added_dom_row;if(c.on_added_dom_row=function(){a.nbFilterableRows++,a.paging?(a.nbRows++,a.nbVisibleRows++,a.nbFilterableRows++,a.paging=!1,a.Cpt.paging.destroy(),a.Cpt.paging.addPaging()):a.Cpt.rowsCounter.refresh(),a.alternateBgs&&a.Cpt.alternateRows.init(),l&&l.call(null,arguments[0],arguments[1],arguments[2])},c.actions&&c.actions["delete"]){var m=c.actions["delete"].on_after_submit;c.actions["delete"].on_after_submit=function(){a.nbFilterableRows--,a.paging?(a.nbRows--,a.nbVisibleRows--,a.nbFilterableRows--,a.paging=!1,a.Cpt.paging.destroy(),a.Cpt.paging.addPaging(!1)):a.Cpt.rowsCounter.refresh(),a.alternateBgs&&a.Cpt.alternateRows.init(),m&&m.call(null,arguments[0],arguments[1])}}}try{a.ezEditTable=new EditTable(a.id,c,b),a.ezEditTable.Init()}catch(o){console.log(c.err)}},SetHelpInstructions:function(){if(!this.helpInstrBtnEl){var a=this.fObj;this.helpInstrTgtId=a.help_instructions_target_id||null,this.helpInstrContTgtId=a.help_instructions_container_target_id||null,this.helpInstrText=a.help_instructions_text?a.help_instructions_text:'Use the filters above each column to filter and limit table data. Avanced searches can be performed by using the following operators:
<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
These operators are described here:
http://tablefilter.free.fr/#operators
',this.helpInstrHtml=a.help_instructions_html||null,this.helpInstrBtnText=a.help_instructions_btn_text||"?",this.helpInstrBtnHtml=a.help_instructions_btn_html||null,this.helpInstrBtnCssClass=a.help_instructions_btn_css_class||"helpBtn",this.helpInstrContCssClass=a.help_instructions_container_css_class||"helpCont",this.helpInstrBtnEl=null,this.helpInstrContEl=null,this.helpInstrDefaultHtml='

HTML Table Filter Generator v. '+this.version+'

http://tablefilter.free.fr
©2009-'+this.year+' Max Guglielmi.
";var b=h.create("span",["id",this.prfxHelpSpan+this.id]),c=h.create("div",["id",this.prfxHelpDiv+this.id]);this.helpInstrTgtId||this.SetTopDiv();var d=this.helpInstrTgtId?h.id(this.helpInstrTgtId):this.rDiv;d.appendChild(b);var e=this.helpInstrContTgtId?h.id(this.helpInstrContTgtId):b;if(this.helpInstrBtnHtml){b.innerHTML=this.helpInstrBtnHtml;var f=b.firstChild;f.onclick=this.Evt._OnHelpBtnClick,e.appendChild(c)}else{e.appendChild(c);var g=h.create("a",["href","javascript:void(0);"]);g.className=this.helpInstrBtnCssClass,g.appendChild(h.text(this.helpInstrBtnText)),b.appendChild(g),g.onclick=this.Evt._OnHelpBtnClick}this.helpInstrHtml?(this.helpInstrContTgtId&&e.appendChild(c),c.innerHTML=this.helpInstrHtml,this.helpInstrContTgtId||(c.className=this.helpInstrContCssClass,c.ondblclick=this.Evt._OnHelpBtnClick)):(c.innerHTML=this.helpInstrText,c.className=this.helpInstrContCssClass,c.ondblclick=this.Evt._OnHelpBtnClick),c.innerHTML+=this.helpInstrDefaultHtml,this.helpInstrContEl=c,this.helpInstrBtnEl=b}},RemoveHelpInstructions:function(){this.helpInstrBtnEl&&(this.helpInstrBtnEl.parentNode.removeChild(this.helpInstrBtnEl),this.helpInstrBtnEl=null,this.helpInstrContEl&&(this.helpInstrContEl.parentNode.removeChild(this.helpInstrContEl),this.helpInstrContEl=null))},_ToggleHelp:function(){if(this.helpInstrContEl){var a=this.helpInstrContEl.style.display;if(""===a||"none"===a){this.helpInstrContEl.style.display="block";var b=h.position(this.helpInstrBtnEl).left;this.helpInstrContTgtId||(this.helpInstrContEl.style.left=b-this.helpInstrContEl.clientWidth+25+"px")}else this.helpInstrContEl.style.display="none"}},__deferMultipleSelection:function(a,b,c){if("select"===k.lower(a.nodeName)){var d=void 0===c?!1:c,e=this;f.setTimeout(function(){a.options[0].selected=!1,""===a.options[b].value?a.options[b].selected=!1:(a.options[b].selected=!0,d&&e.Filter())},.1)}},__getCustomValues:function(a){if(a){var b=this.hasCustomSlcOptions&&n.has(this.customSlcOptions.cols,a);if(b){for(var c=[],d=[],e=n.indexByValue(this.customSlcOptions.cols,a),f=this.customSlcOptions.values[e],g=this.customSlcOptions.texts[e],h=this.customSlcOptions.sorts[e],i=0;i':null);var b=h.create("span",["id",this.prfxResetSpan+this.id]);this.btnResetTgtId||this.SetTopDiv();var c=this.btnResetTgtId?h.id(this.btnResetTgtId):this.rDiv;if(c.appendChild(b),this.btnResetHtml){b.innerHTML=this.btnResetHtml;var d=b.firstChild;d.onclick=this.Evt._Clear}else{var e=h.create("a",["href","javascript:void(0);"]);e.className=this.btnResetCssClass,e.appendChild(h.text(this.btnResetText)),b.appendChild(e),e.onclick=this.Evt._Clear}this.btnResetEl=h.id(this.prfxResetSpan+this.id).firstChild}},RemoveResetBtn:function(){if(this.hasGrid&&this.btnResetEl){var a=h.id(this.prfxResetSpan+this.id);a&&a.parentNode.removeChild(a),this.btnResetEl=null}},SetStatusBar:function(){if(this.hasGrid||this.isFirstLoad){var a=this.fObj;this.statusBarTgtId=a.status_bar_target_id||null,this.statusBarDiv=null,this.statusBarSpan=null,this.statusBarSpanText=null,this.statusBarText=a.status_bar_text||"",this.statusBarCssClass=a.status_bar_css_class||"status",this.statusBarCloseDelay=250;var b=h.create("div",["id",this.prfxStatus+this.id]);b.className=this.statusBarCssClass;var c=h.create("span",["id",this.prfxStatusSpan+this.id]),d=h.create("span",["id",this.prfxStatusTxt+this.id]);d.appendChild(h.text(this.statusBarText)),this.onBeforeShowMsg=m.isFn(a.on_before_show_msg)?a.on_before_show_msg:null,this.onAfterShowMsg=m.isFn(a.on_after_show_msg)?a.on_after_show_msg:null,this.statusBarTgtId||this.SetTopDiv();var e=this.statusBarTgtId?h.id(this.statusBarTgtId):this.lDiv;this.statusBarDiv&&o.isIE()&&(this.statusBarDiv.outerHTML=""),this.statusBarTgtId?(e.appendChild(d),e.appendChild(c)):(b.appendChild(d),b.appendChild(c),e.appendChild(b)),this.statusBarDiv=h.id(this.prfxStatus+this.id),this.statusBarSpan=h.id(this.prfxStatusSpan+this.id),this.statusBarSpanText=h.id(this.prfxStatusTxt+this.id)}},RemoveStatusBar:function(){(this.hasGrid||this.statusBarDiv)&&(this.statusBarDiv.innerHTML="",this.statusBarDiv.parentNode.removeChild(this.statusBarDiv),this.statusBarSpan=null,this.statusBarSpanText=null,this.statusBarDiv=null)},StatusMsg:function(a){a||this.StatusMsg(""),this.status&&this.WinStatusMsg(a),this.statusBar&&this.StatusBarMsg(a)},WinStatusMsg:function(a){this.status&&(this.onBeforeShowMsg&&this.onBeforeShowMsg.call(null,this,a),f.status=a,this.onAfterShowMsg&&this.onAfterShowMsg.call(null,this,a))},StatusBarMsg:function(a){function b(){c.statusBarSpan.innerHTML=a,c.onAfterShowMsg&&c.onAfterShowMsg.call(null,c,a)}if(this.statusBar&&this.statusBarSpan){this.onBeforeShowMsg&&this.onBeforeShowMsg.call(null,this,a);var c=this,d=""===a?this.statusBarCloseDelay:1;f.setTimeout(b,d)}},SetWatermark:function(a){if(this.fltGrid||""!==this.inpWatermark){a=void 0===a?!0:a;for(var b=0;bh):P?(n=r(a.replace(l,""),J),f=n>=h):R?(n=r(a.replace(m,""),J),f=h>=n):Q?(n=r(a.replace(p,""),J),f=h>n):S?(n=r(a.replace(s,""),J),f=h.toString()!=n.toString()):T?(n=r(a.replace(u,""),J),f=h.toString()==n.toString()):t.test(a)?f=g.__containsStr(a.replace(t,""),b,null,!1):q(a,J)?(n=r(a,J),f=h.toString()==n.toString()):L?f=k.isEmpty(b):M&&(f=!k.isEmpty(b));else if(g.hasColNbFormat&&g.colNbFormat[d]?(i=c(b,g.colNbFormat[d]),j=g.colNbFormat[d]):","===g.thousandsSeparator&&"."===g.decimalSeparator?(i=c(b,"us"),j="us"):(i=c(b,"eu"),j="eu"),C)f=i<=c(a.replace(l,""),j);else if(E)f=i>=c(a.replace(m,""),j);else if(B)f=ic(a.replace(p,""),j);else if(F)f=g.__containsStr(a.replace(s,""),b)?!1:!0;else if(H)f=g.__containsStr(a.replace(t,""),b,null,!1);else if(G)f=g.__containsStr(a.replace(u,""),b,null,!0);else if(I)f=0===b.indexOf(a.replace(v,""))?!0:!1;else if(K){var U=a.replace(w,"");f=b.lastIndexOf(U,b.length-1)===b.length-1-(U.length-1)&&b.lastIndexOf(U,b.length-1)>-1?!0:!1}else if(L)f=k.isEmpty(b);else if(M)f=!k.isEmpty(b);else if(N)try{var V=a.replace(A,""),W=new RegExp(V);f=W.test(b)}catch(X){f=!1}else{var Y=e["col_"+d];f=g.__containsStr(a,b,Y?Y:this.fltTypeInp)}return f}if(this.fltGrid&&(this.hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),""!==this.inpWatermark&&this.SetWatermark(!1);var d=this.tbl.rows,e=this.fObj||{},f=0;this.validRowsIndex=[];var g=this;this.highlightKeywords&&this.Cpt.highlightKeyword.unhighlightAll(),this.popUpFilters&&this.Cpt.popupFilter.buildIcons(),this.markActiveColumns&&this.ClearActiveColumns(),this.searchArgs=this.GetFiltersValue();for(var i,j,l=new RegExp(this.leOperator),m=new RegExp(this.geOperator),o=new RegExp(this.lwOperator),p=new RegExp(this.grOperator),s=new RegExp(this.dfOperator),t=new RegExp(k.rgxEsc(this.lkOperator)),u=new RegExp(this.eqOperator),v=new RegExp(this.stOperator),w=new RegExp(this.enOperator),x=new RegExp(this.anOperator),y=(new RegExp(this.curExp),this.emOperator),z=this.nmOperator,A=new RegExp(k.rgxEsc(this.rgxOperator)),B=this.refRow;BH;H++){var I=this.searchArgs[this.singleSearchFlt?0:H],J=this.hasColDateType?this.colDateType[H]:this.defaultDateType;if(""!==I){var K=k.matchCase(this.GetCellData(H,C[H]),this.matchCase),L=I.split(this.orOperator),M=L.length>1?!0:!1,N=I.split(this.anOperator),O=N.length>1?!0:!1;if(M||O){for(var P,Q=!1,R=M?L:N,S=0;Sl;l++)if(l===a&&""===e[g].style.display){var o=k.lower(this.GetCellData(l,i[l])),p=this.colNbFormat?this.colNbFormat[a]:null,q=b?c(o,p):o;f.push(q)}}return f}},GetFilterValue:function(a){if(this.fltGrid){var b,c=this.GetFilterElement(a);if(!c)return"";var d=this.fltCol[a];if(d!==this.fltTypeMulti&&d!==this.fltTypeCheckList)b=c.value;else if(d===this.fltTypeMulti){b="";for(var e=0;e0?1:0),f=e+d.pagingLength-1<=b.nbVisibleRows?e+d.pagingLength-1:b.nbVisibleRows;c=e+this.fromToTextSeparator+f+this.overText+b.nbVisibleRows}}else c=a&&""!==a?a:b.nbFilterableRows-b.nbHiddenRows-(b.hasVisibleRows?b.visibleRows.length:0);this.rowsCounterSpan.innerHTML=c,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,b,this.rowsCounterSpan,c)}}},destroy:{writable:!0,value:function(){var a=this.tf;a.hasGrid&&this.rowsCounterSpan&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?h.isIE()?this.rowsCounterDiv.outerHTML="":this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):f.id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}}),a}();a.RowsCounter=i}),define("modules/statusBar",["exports","../dom","../event","../types","../helpers"],function(a,b,c,d,e){var f=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},g=b.Dom,h=(c.Event,d.Types),i=e.Helpers,j=function(){var a=function(a){var b=a.fObj||{};this.statusBarTgtId=b.status_bar_target_id||null,this.statusBarDiv=null,this.statusBarSpan=null,this.statusBarSpanText=null,this.statusBarText=b.status_bar_text||"",this.statusBarCssClass=b.status_bar_css_class||"status",this.statusBarCloseDelay=250,this.onBeforeShowMsg=h.isFn(b.on_before_show_msg)?b.on_before_show_msg:null,this.onAfterShowMsg=h.isFn(b.on_after_show_msg)?b.on_after_show_msg:null,this.tf=a};return f(a,null,{init:{writable:!0,value:function(){var a=this.tf;if(a.hasGrid||a.isFirstLoad){var b=g.create("div",["id",a.prfxStatus+a.id]);b.className=this.statusBarCssClass;var c=g.create("span",["id",a.prfxStatusSpan+a.id]),d=g.create("span",["id",a.prfxStatusTxt+a.id]);d.appendChild(g.text(this.statusBarText)),this.statusBarTgtId||a.SetTopDiv();var e=this.statusBarTgtId?g.id(this.statusBarTgtId):a.lDiv;this.statusBarDiv&&i.isIE()&&(this.statusBarDiv.outerHTML=""),this.statusBarTgtId?(e.appendChild(d),e.appendChild(c)):(b.appendChild(d),b.appendChild(c),e.appendChild(b)),this.statusBarDiv=b,this.statusBarSpan=c,this.statusBarSpanText=d}}},message:{writable:!0,value:function(a){var b=this;void 0===a&&(a="");var c=this.tf;if(c.statusBar&&this.statusBarSpan){this.onBeforeShowMsg&&this.onBeforeShowMsg.call(null,this.tf,a);var d=""===a?this.statusBarCloseDelay:1;window.setTimeout(function(){b.statusBarSpan.innerHTML=a,b.onAfterShowMsg&&b.onAfterShowMsg.call(null,b.tf,a)},d)}}},destroy:{writable:!0,value:function(){var a=this.tf;a.hasGrid&&this.statusBarDiv&&(this.statusBarDiv.innerHTML="",this.statusBarDiv.parentNode.removeChild(this.statusBarDiv),this.statusBarSpan=null,this.statusBarSpanText=null,this.statusBarDiv=null)}}}),a}();a.StatusBar=j}),define("modules/paging",["exports","../dom","../types","../string","../helpers","../event"],function(a,b,c,d,e,f){var g=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},h=b.Dom,i=c.Types,j=d.Str,k=(e.Helpers,f.Event),l=function(){var a=function(a){var b=a.fObj;this.btnPageCssClass=b.paging_btn_css_class||"pgInp",this.pagingSlc=null,this.resultsPerPageSlc=null,this.pagingTgtId=b.paging_target_id||null,this.pagingLength=isNaN(b.paging_length)?10:b.paging_length,this.resultsPerPageTgtId=b.results_per_page_target_id||null,this.pgSlcCssClass=b.paging_slc_css_class||"pgSlc",this.pgInpCssClass=b.paging_inp_css_class||"pgNbInp",this.resultsPerPage=b.results_per_page||null,this.hasResultsPerPage=i.isArray(this.resultsPerPage),this.resultsSlcCssClass=b.results_slc_css_class||"rspg",this.resultsSpanCssClass=b.results_span_css_class||"rspgSpan",this.startPagingRow=0,this.nbPages=0,this.currentPageNb=1,this.btnNextPageText=b.btn_next_page_text||">",this.btnPrevPageText=b.btn_prev_page_text||"<",this.btnLastPageText=b.btn_last_page_text||">|",this.btnFirstPageText=b.btn_first_page_text||"|<",this.btnNextPageHtml=b.btn_next_page_html||(a.enableIcons?'':null),this.btnPrevPageHtml=b.btn_prev_page_html||(a.enableIcons?'':null),this.btnFirstPageHtml=b.btn_first_page_html||(a.enableIcons?'':null),this.btnLastPageHtml=b.btn_last_page_html||(a.enableIcons?'':null),this.pageText=b.page_text||" Page ",this.ofText=b.of_text||" of ",this.nbPgSpanCssClass=b.nb_pages_css_class||"nbpg",this.hasPagingBtns=b.paging_btns===!1?!1:!0,this.pageSelectorType=b.page_selector_type||a.fltTypeSlc,this.onBeforeChangePage=i.isFn(b.on_before_change_page)?b.on_before_change_page:null,this.onAfterChangePage=i.isFn(b.on_after_change_page)?b.on_after_change_page:null;var c=this.refRow,d=this.nbRows;this.nbPages=Math.ceil((d-c)/this.pagingLength);var e=this;this.evt={slcIndex:function(){return e.pageSelectorType===a.fltTypeSlc?e.pagingSlc.options.selectedIndex:parseInt(e.pagingSlc.value,10)-1},nbOpts:function(){return e.pageSelectorType===a.fltTypeSlc?parseInt(e.pagingSlc.options.length,10)-1:e.nbPages-1},next:function(){var a=e.evt.slcIndex()0?e.evt.slcIndex()-1:e.evt.nbOpts();e.changePage(a)},last:function(){e.changePage(e.evt.nbOpts())},first:function(){e.changePage(0)},_detectKey:function(b){var c=a.Evt.getKeyCode(b);13===c&&(a.sorted?(a.Filter(),e.changePage(e.evt.slcIndex())):e.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=a};return g(a,null,{init:{writable:!0,value:function(){var a,b=this,c=this.tf,d=this.evt;this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),d.slcPagesChange=function(a){b.changePage(),a.target.blur()},this.pageSelectorType===c.fltTypeSlc&&(a=h.create(c.fltTypeSlc,["id",c.prfxSlcPages+c.id]),a.className=this.pgSlcCssClass,k.add(a,"change",d.slcPagesChange)),this.pageSelectorType===c.fltTypeInp&&(a=h.create(c.fltTypeInp,["id",c.prfxSlcPages+c.id],["value",this.currentPageNb]),a.className=this.pgInpCssClass,k.add(a,"keypress",d._detectKey));var e=h.create("span",["id",c.prfxBtnNextSpan+c.id]),f=h.create("span",["id",c.prfxBtnPrevSpan+c.id]),g=h.create("span",["id",c.prfxBtnLastSpan+c.id]),i=h.create("span",["id",c.prfxBtnFirstSpan+c.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)e.innerHTML=this.btnNextPageHtml,k.add(e,"click",d.next);else{var j=h.create(c.fltTypeInp,["id",c.prfxBtnNext+c.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);j.className=this.btnPageCssClass,k.add(j,"click",d.next),e.appendChild(j)}if(this.btnPrevPageHtml)f.innerHTML=this.btnPrevPageHtml,k.add(f,"click",d.prev);else{var l=h.create(c.fltTypeInp,["id",c.prfxBtnPrev+c.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);l.className=this.btnPageCssClass,k.add(l,"click",d.prev),f.appendChild(l)}if(this.btnLastPageHtml)g.innerHTML=this.btnLastPageHtml,k.add(g,"click",d.last);else{var m=h.create(c.fltTypeInp,["id",c.prfxBtnLast+c.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);m.className=this.btnPageCssClass,k.add(m,"click",d.last),g.appendChild(m)}if(this.btnFirstPageHtml)i.innerHTML=this.btnFirstPageHtml,k.add(i,"click",d.first);else{var n=h.create(c.fltTypeInp,["id",c.prfxBtnFirst+c.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);n.className=this.btnPageCssClass,k.add(n,"click",d.first),i.appendChild(n)}}this.pagingTgtId||c.SetTopDiv();var o=this.pagingTgtId?h.id(this.pagingTgtId):c.mDiv;o.appendChild(i),o.appendChild(f);var p=h.create("span",["id",c.prfxPgBeforeSpan+c.id]);p.appendChild(h.text(this.pageText)),p.className=this.nbPgSpanCssClass,o.appendChild(p),o.appendChild(a);var q=h.create("span",["id",c.prfxPgAfterSpan+c.id]);q.appendChild(h.text(this.ofText)),q.className=this.nbPgSpanCssClass,o.appendChild(q);var r=h.create("span",["id",c.prfxPgSpan+c.id]);r.className=this.nbPgSpanCssClass,r.appendChild(h.text(" "+this.nbPages+" ")),o.appendChild(r),o.appendChild(e),o.appendChild(g),this.pagingSlc=h.id(c.prfxSlcPages+c.id),(!c.rememberGridValues||this.isPagingRemoved)&&this.setPagingInfo(),c.fltGrid||(c.ValidateAllRows(),this.setPagingInfo(c.validRowsIndex)),this.isPagingRemoved=!1}},addPaging:{writable:!0,value:function(a){void 0===a&&(a=!1);var b=this.tf;b.hasGrid&&!b.paging&&(b.paging=!0,this.isPagingRemoved=!0,this.init(),b.ResetValues(),a&&b.Filter())}},setPagingInfo:{writable:!0,value:function(a){var b=this.tf,c=b.tbl.rows,d=this.pagingTgtId?h.id(this.pagingTgtId):b.mDiv,e=h.id(b.prfxPgSpan+b.id);if(a&&a.length>0)b.validRowsIndex=a;else{b.validRowsIndex=[];for(var f=b.refRow;f0)if(d.style.visibility="visible",this.pageSelectorType===b.fltTypeSlc)for(var j=0;j=this.startPagingRow&&d>e?("true"!==f.getAttribute("validRow")&&f.getAttribute("validRow")||(f.style.display=""),b.alternateBgs&&b.Cpt.alternateRows&&b.Cpt.alternateRows.setRowBg(b.validRowsIndex[e],e)):(f.style.display="none",b.alternateBgs&&b.Cpt.alternateRows&&b.Cpt.alternateRows.removeRowBg(b.validRowsIndex[e]))}b.nbVisibleRows=b.validRowsIndex.length,b.isStartBgAlternate=!1,b.ApplyGridProps()}},setPage:{writable:!0,value:function(a){var b=this.tf;if(b.hasGrid&&this.paging){var c=this.evt,d=typeof a;if("string"===d)switch(j.lower(a)){case"next":c.next();break;case"previous":c.prev();break;case"last":c.last();break;case"first":c.first();break;default:c.next()}else"number"===d&&this.changePage(a-1)}}},setResultsPerPage:{writable:!0,value:function(){var a=this,b=this.tf,c=this.evt;if((b.hasGrid||b.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){c.slcResultsChange=function(b){a.changeResultsPerPage(),b.target.blur()};var d=h.create(b.fltTypeSlc,["id",b.prfxSlcResults+b.id]);d.className=b.resultsSlcCssClass;var e=this.resultsPerPage[0],f=this.resultsPerPage[1],g=h.create("span",["id",b.prfxSlcResultsTxt+b.id]);g.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||b.SetTopDiv();var i=this.resultsPerPageTgtId?h.id(this.resultsPerPageTgtId):b.rDiv;g.appendChild(h.text(e)),i.appendChild(g),i.appendChild(d),this.resultsPerPageSlc=h.id(b.prfxSlcResults+b.id);for(var j=0;j=0&&a<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,a),this.currentPageNb=parseInt(a,10)+1,this.pageSelectorType===b.fltTypeSlc?this.pagingSlc.options[a].selected=!0:this.pagingSlc.value=this.currentPageNb,b.rememberPageNb&&b.Cpt.store.savePageNb(b.pgNbCookie),this.startPagingRow=this.pageSelectorType===b.fltTypeSlc?this.pagingSlc.value:a*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,a)))}},_changeResultsPerPage:{writable:!0,value:function(){var a=this.tf;if(a.paging){var b=this.resultsPerPageSlc,c=this.pageSelectorType===a.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(b.options[b.selectedIndex].value,10),this.startPagingRow=this.pagingLength*c,!isNaN(this.pagingLength)){if(this.startPagingRow>=a.nbFilterableRows&&(this.startPagingRow=a.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===a.fltTypeSlc){var d=this.pagingSlc.options.length-1<=c?this.pagingSlc.options.length-1:c;this.pagingSlc.options[d].selected=!0}a.rememberPageLen&&a.Cpt.store.savePageLength(a.pgLenCookie)}}}},_resetPage:{writable:!0,value:function(a){var b=this.tf,c=b.Cpt.store.getPageNb(a);""!==c&&this.changePage(c-1)}},_resetPageLength:{writable:!0,value:function(a){var b=this.tf;if(b.paging){var c=b.Cpt.store.getPageLength(a);""!==c&&(this.resultsPerPageSlc.options[c].selected=!0,this.changeResultsPerPage())}}},destroy:{writable:!0,value:function(){var a=this.tf;if(a.hasGrid){var b,c,d,e,f,g,i;b=h.id(a.prfxBtnNextSpan+a.id),c=h.id(a.prfxBtnPrevSpan+a.id),d=h.id(a.prfxBtnLastSpan+a.id),e=h.id(a.prfxBtnFirstSpan+a.id),f=h.id(a.prfxPgBeforeSpan+a.id),g=h.id(a.prfxPgAfterSpan+a.id),i=h.id(a.prfxPgSpan+a.id);var j=this.evt;this.pagingSlc&&(this.pageSelectorType===a.fltTypeSlc?k.remove(this.pagingSlc,"change",j.slcPagesChange):this.pageSelectorType===a.fltTypeInp&&k.remove(this.pagingSlc,"keypress",j._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),b&&(k.remove(b,"click",j.next),b.parentNode.removeChild(b)),c&&(k.remove(c,"click",j.prev),c.parentNode.removeChild(c)),d&&(k.remove(d,"click",j.last),d.parentNode.removeChild(d)),e&&(k.remove(e,"click",j.first),e.parentNode.removeChild(e)),f&&f.parentNode.removeChild(f),g&&g.parentNode.removeChild(g),i&&i.parentNode.removeChild(i),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,a.paging=!1}}}}),a}();a.Paging=l}),define("modules/clearButton",["exports","../dom","../event"],function(a,b,c){var d=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},e=b.Dom,f=c.Event,g=function(){var a=function(a){var b=a.fObj;this.btnResetTgtId=b.btn_reset_target_id||null,this.btnResetEl=null,this.btnResetText=b.btn_reset_text||"Reset",this.btnResetTooltip=b.btn_reset_tooltip||"Clear filters",this.btnResetHtml=b.btn_reset_html||(a.enableIcons?'':null),this.tf=a};return d(a,null,{onClick:{writable:!0,value:function(){this.tf.ClearFilters()}},init:{writable:!0,value:function(){var a=this,b=this.tf;if(b.hasGrid||b.isFirstLoad||!b.btnResetEl){var c=e.create("span",["id",b.prfxResetSpan+b.id]);this.btnResetTgtId||b.SetTopDiv();var d=this.btnResetTgtId?e.id(this.btnResetTgtId):b.rDiv;if(d.appendChild(c),this.btnResetHtml){c.innerHTML=this.btnResetHtml;var g=c.firstChild;f.add(g,"click",function(){a.onClick()})}else{var h=e.create("a",["href","javascript:void(0);"]);h.className=b.btnResetCssClass,h.appendChild(e.text(this.btnResetText)),c.appendChild(h),f.add(h,"click",function(){a.onClick()})}this.btnResetEl=c.firstChild}}},destroy:{writable:!0,value:function(){var a=this.tf;if(a.hasGrid&&this.btnResetEl){var b=e.id(a.prfxResetSpan+a.id);b&&b.parentNode.removeChild(b),this.btnResetEl=null}}}}),a}();a.ClearButton=g}),define("modules/help",["exports","../dom","../event"],function(a,b,c){var d=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},e=b.Dom,f=c.Event,g=function(){var a=function(a){var b=a.fObj||{};this.helpInstrTgtId=b.help_instructions_target_id||null,this.helpInstrContTgtId=b.help_instructions_container_target_id||null,this.helpInstrText=b.help_instructions_text?b.help_instructions_text:'Use the filters above each column to filter and limit table data. Avanced searches can be performed by using the following operators:
<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
These operators are described here:
http://tablefilter.free.fr/#operators
',this.helpInstrHtml=b.help_instructions_html||null,this.helpInstrBtnText=b.help_instructions_btn_text||"?",this.helpInstrBtnHtml=b.help_instructions_btn_html||null,this.helpInstrBtnCssClass=b.help_instructions_btn_css_class||"helpBtn",this.helpInstrContCssClass=b.help_instructions_container_css_class||"helpCont",this.helpInstrBtnEl=null,this.helpInstrContEl=null,this.helpInstrDefaultHtml='

HTML Table Filter Generator v. '+a.version+'

http://tablefilter.free.fr
©2009-'+a.year+' Max Guglielmi.
',this.tf=a};return d(a,null,{init:{writable:!0,value:function(){var a=this;if(!this.helpInstrBtnEl){var b=this.tf,c=e.create("span",["id",b.prfxHelpSpan+b.id]),d=e.create("div",["id",b.prfxHelpDiv+b.id]);this.helpInstrTgtId||b.SetTopDiv();var g=this.helpInstrTgtId?e.id(this.helpInstrTgtId):b.rDiv;g.appendChild(c);var h=this.helpInstrContTgtId?e.id(this.helpInstrContTgtId):c;if(this.helpInstrBtnHtml){c.innerHTML=this.helpInstrBtnHtml;var i=c.firstChild;f.add(i,"click",function(){a.toggle()}),h.appendChild(d)}else{h.appendChild(d);var j=e.create("a",["href","javascript:void(0);"]);j.className=this.helpInstrBtnCssClass,j.appendChild(e.text(this.helpInstrBtnText)),c.appendChild(j),f.add(j,"click",function(){a.toggle()})}this.helpInstrHtml?(this.helpInstrContTgtId&&h.appendChild(d),d.innerHTML=this.helpInstrHtml,this.helpInstrContTgtId||(d.className=this.helpInstrContCssClass,f.add(d,"dblclick",function(){a.toggle()}))):(d.innerHTML=this.helpInstrText,d.className=this.helpInstrContCssClass,f.add(d,"dblclick",function(){a.toggle()})),d.innerHTML+=this.helpInstrDefaultHtml,f.add(d,"click",function(){a.toggle()}),this.helpInstrContEl=d,this.helpInstrBtnEl=c}}},toggle:{writable:!0,value:function(){if(this.helpInstrContEl){var a=this.helpInstrContEl.style.display;if(""===a||"none"===a){this.helpInstrContEl.style.display="block";var b=e.position(this.helpInstrBtnEl).left;this.helpInstrContTgtId||(this.helpInstrContEl.style.left=b-this.helpInstrContEl.clientWidth+25+"px")}else this.helpInstrContEl.style.display="none"}}},destroy:{writable:!0,value:function(){this.helpInstrBtnEl&&(this.helpInstrBtnEl.parentNode.removeChild(this.helpInstrBtnEl),this.helpInstrBtnEl=null,this.helpInstrContEl&&(this.helpInstrContEl.parentNode.removeChild(this.helpInstrContEl),this.helpInstrContEl=null))}}}),a}();a.Help=g}),define("modules/alternateRows",["exports","../dom"],function(a,b){var c=function(a,b,c){b&&Object.defineProperties(a,b),c&&Object.defineProperties(a.prototype,c)},d=b.Dom,e=function(){var a=function(a){var b=a.fObj;this.evenCss=b.even_row_css_class||"even",this.oddCss=b.odd_row_css_class||"odd",this.tf=a};return c(a,null,{init:{writable:!0,value:function(){if(this.tf.hasGrid||this.tf.isFirstLoad)for(var a=(this.tf.tbl.rows,null===this.tf.validRowsIndex),b=a?this.tf.refRow:0,c=a?this.tf.nbFilterableRows+b:this.tf.validRowsIndex.length,d=0,e=b;c>e;e++){var f=a?e:this.tf.validRowsIndex[e];this.setRowBg(f,d),d++}}},setRowBg:{writable:!0,value:function(a,b){if(this.tf.alternateBgs&&!isNaN(a)){var c=this.tf.tbl.rows,e=b?b:a;this.removeRowBg(a),d.addClass(c[a],e%2?this.evenCss:this.oddCss)}}},removeRowBg:{writable:!0,value:function(a){if(!isNaN(a)){var b=this.tf.tbl.rows;d.removeClass(b[a],this.oddCss),d.removeClass(b[a],this.evenCss)}}},remove:{writable:!0,value:function(){if(this.tf.hasGrid){for(var a=(this.tf.tbl.rows,this.tf.refRow);a=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==Str.lower(typeof labelId)&&"object"==Str.lower(typeof colIndex)&&"object"==Str.lower(typeof operation))for(var row=this.tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(this.tf.GetColValues(ucolIndex[ucol],!0,excludeRow));for(var result,nbvalues=0,temp,meanValue=0,sumValue=0,minValue=null,maxValue=null,q1Value=null,medValue=null,q3Value=null,meanFlag=0,sumFlag=0,minFlag=0,maxFlag=0,q1Flag=0,medFlag=0,q3Flag=0,theList=[],opsThisCol=[],decThisCol=[],labThisCol=[],oTypeThisCol=[],mThisCol=-1,k=0;kmaxValue?parseFloat(cvalue):maxValue))}if(1===meanFlag&&(meanValue=sumValue/nbvalues),1===medFlag){var aux=0;nbvalues%2===1?(aux=Math.floor(nbvalues/2),medValue=theList[aux]):medValue=(theList[nbvalues/2]+theList[nbvalues/2-1])/2}var posa;if(1===q1Flag&&(posa=0,posa=Math.floor(nbvalues/4),q1Value=4*posa==nbvalues?(theList[posa-1]+theList[posa])/2:theList[posa]),1===q3Flag){posa=0;var posb=0;posa=Math.floor(nbvalues/4),4*posa===nbvalues?(posb=3*posa,q3Value=(theList[posb]+theList[posb-1])/2):q3Value=theList[nbvalues-posa-1]}for(var i=0;mThisCol>=i;i++){switch(opsThisCol[i]){case"mean":result=meanValue;break;case"sum":result=sumValue;break;case"min":result=minValue;break;case"max":result=maxValue;break;case"median":result=medValue;break;case"q1":result=q1Value;break;case"q3":result=q3Value}var precision=isNaN(decThisCol[i])?2:decThisCol[i];if(oTypeThisCol&&result){if(result=result.toFixed(precision),Dom.id(labThisCol[i]))switch(Str.lower(oTypeThisCol)){case"innerhtml":Dom.id(labThisCol[i]).innerHTML=isNaN(result)||!isFinite(result)||0===nbvalues?".":result;break;case"setvalue":Dom.id(labThisCol[i]).value=result;break;case"createtextnode":var oldnode=Dom.id(labThisCol[i]).firstChild,txtnode=Dom.text(result);Dom.id(labThisCol[i]).replaceChild(txtnode,oldnode)}}else try{Dom.id(labThisCol[i]).innerHTML=isNaN(result)||!isFinite(result)||0===nbvalues?".":result.toFixed(precision)}catch(e){}}var totRow=totRowIndex&&totRowIndex[ucol]?row[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,this.tf)}}}}),ColOps}();exports.ColOps=ColOps}),define("core",["require","event","dom","string","cookie","types","array","helpers","date","sort","modules/store","modules/gridLayout","modules/loader","modules/highlightKeywords","modules/popupFilter","modules/dropdown","modules/checkList","modules/rowsCounter","modules/statusBar","modules/paging","modules/clearButton","modules/help","modules/alternateRows","modules/colOps","modules/help"],function(a){function b(a){if(0!==arguments.length){if(this.id=a,this.version="3.0",this.year=(new Date).getFullYear(),this.tbl=h.id(a),this.startRow=null,this.refRow=null,this.headersRow=null,this.fObj=null,this.nbFilterableRows=null,this.nbRows=null,this.nbCells=null,this.hasGrid=!1,this.enableModules=!1,!this.tbl||"table"!==k.lower(this.tbl.nodeName)||0===this.GetRowsNb())throw new Error("Could not instantiate TF object: HTML table not found.");if(arguments.length>1)for(var b=0;b1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==i.filters_cell_tag||"td"!==i.filters_cell_tag?"td":i.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.tblData=[],this.validRowsIndex=null,this.fltGridEl=null,this.isFirstLoad=!0,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.contDiv=null,this.infDivCssClass=i.inf_div_css_class||"inf",this.lDivCssClass=i.left_div_css_class||"ldiv",this.rDivCssClass=i.right_div_css_class||"rdiv",this.mDivCssClass=i.middle_div_css_class||"mdiv",this.contDivCssClass=i.content_div_css_class||"cont",this.stylesheet=i.stylesheet||this.basePath+"filtergrid.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=i.flts_row_css_class||"fltrow",this.enableIcons=i.enable_icons===!1?!1:!0,this.alternateBgs=i.alternate_rows===!0?!0:!1,this.hasColWidth=i.col_width===!0?!0:!1,this.colWidth=this.hasColWidth?i.col_width:null,this.fixedHeaders=i.fixed_headers===!0?!0:!1,this.tBodyH=isNaN(i.tbody_height)?200:i.tbody_height,this.fltCssClass=i.flt_css_class||"flt",this.fltMultiCssClass=i.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=i.flt_small_css_class||"flt_s",this.singleFltCssClass=i.single_flt_css_class||"single_flt",this.isStartBgAlternate=!0,this.enterKey=i.enter_key===!1?!1:!0,this.isModFilterFn=i.mod_filter_fn===!0?!0:!1,this.modFilterFn=this.isModFilterFn?i.mod_filter_fn:null,this.onBeforeFilter=m.isFn(i.on_before_filter)?i.on_before_filter:null,this.onAfterFilter=m.isFn(i.on_after_filter)?i.on_after_filter:null,this.matchCase=i.match_case===!0?!0:!1,this.exactMatch=i.exact_match===!0?!0:!1,this.refreshFilters=i.refresh_filters===!0?!0:!1,this.disableExcludedOptions=i.disable_excluded_options===!0?!0:!1,this.activeFlt=null,this.activeFilterId=null,this.hasColOperation=i.col_operation?!0:!1,this.colOperation=null,this.hasVisibleRows=i.rows_always_visible?!0:!1,this.visibleRows=this.hasVisibleRows?i.rows_always_visible:[],this.searchType=i.search_type||"include",this.isExternalFlt=i.external_flt_grid===!0?!0:!1,this.externalFltTgtIds=i.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(i.exec_delay)?100:parseInt(i.exec_delay,10),this.onFiltersLoaded=m.isFn(i.on_filters_loaded)?i.on_filters_loaded:null,this.singleSearchFlt=i.single_search_filter===!0?!0:!1,this.onRowValidated=m.isFn(i.on_row_validated)?i.on_row_validated:null,this.customCellDataCols=i.custom_cell_data_cols?i.custom_cell_data_cols:[],this.customCellData=m.isFn(i.custom_cell_data)?i.custom_cell_data:null,this.inpWatermark=i.input_watermark||"",this.inpWatermarkCssClass=i.input_watermark_css_class||"fltWatermark",this.isInpWatermarkArray=m.isArray(i.input_watermark),this.toolBarTgtId=i.toolbar_target_id||null,this.helpInstructions=i.help_instructions||!1,this.popUpFilters=i.popup_filters===!0?!0:!1,this.markActiveColumns=i.mark_active_columns===!0?!0:!1,this.activeColumnsCssClass=i.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=m.isFn(i.on_before_active_column)?i.on_before_active_column:null,this.onAfterActiveColumn=m.isFn(i.on_after_active_column)?i.on_after_active_column:null,this.displayAllText=i.display_all_text||"",this.enableEmptyOption=i.enable_empty_option===!0?!0:!1,this.emptyText=i.empty_text||"(Empty)",this.enableNonEmptyOption=i.enable_non_empty_option===!0?!0:!1,this.nonEmptyText=i.non_empty_text||"(Non empty)",this.onSlcChange=i.on_change===!1?!1:!0,this.sortSlc=i.sort_select===!1?!1:!0,this.isSortNumAsc=i.sort_num_asc===!0?!0:!1,this.sortNumAsc=this.isSortNumAsc?i.sort_num_asc:null,this.isSortNumDesc=i.sort_num_desc===!0?!0:!1,this.sortNumDesc=this.isSortNumDesc?i.sort_num_desc:null,this.fillSlcOnDemand=i.fill_slc_on_demand===!0?!0:!1,this.hasCustomSlcOptions=m.isObj(i.custom_slc_options)?!0:!1,this.customSlcOptions=m.isArray(i.custom_slc_options)?i.custom_slc_options:null,this.rgxOperator=i.regexp_operator||"rgx:",this.emOperator=i.empty_operator||"[empty]",this.nmOperator=i.nonempty_operator||"[nonempty]",this.orOperator=i.or_operator||"||",this.anOperator=i.and_operator||"&&",this.grOperator=i.greater_operator||">",this.lwOperator=i.lower_operator||"<",this.leOperator=i.lower_equal_operator||"<=",this.geOperator=i.greater_equal_operator||">=",this.dfOperator=i.different_operator||"!",this.lkOperator=i.like_operator||"*",this.eqOperator=i.equal_operator||"=",this.stOperator=i.start_with_operator||"{",this.enOperator=i.end_with_operator||"}",this.curExp=i.cur_exp||"^[¥£€$]",this.separator=i.separator||",",this.rowsCounter=i.rows_counter===!0?!0:!1,this.statusBar=i.status_bar===!0?!0:!1,this.loader=i.loader===!0?!0:!1,this.displayBtn=i.btn===!0?!0:!1,this.btnText=i.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=i.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=i.btn_reset===!0?!0:!1,this.btnResetCssClass=i.btn_reset_css_class||"reset",this.onBeforeReset=m.isFn(i.on_before_reset)?i.on_before_reset:null,this.onAfterReset=m.isFn(i.on_after_reset)?i.on_after_reset:null,this.paging=i.paging===!0?!0:!1,this.nbVisibleRows=0,this.nbHiddenRows=0,this.sort=i.sort===!0?!0:!1,this.isSortEnabled=!1,this.sorted=!1,this.sortConfig=i.sort_config||{},this.sortConfig.name=void 0!==this.sortConfig.name?i.sort_config.name:"sortabletable",this.sortConfig.src=void 0!==this.sortConfig.src?i.sort_config.src:this.basePath+"sortabletable.js",this.sortConfig.adapterSrc=void 0!==this.sortConfig.adapter_src?i.sort_config.adapter_src:this.basePath+"tfAdapter.sortabletable.js",this.sortConfig.initialize=void 0!==this.sortConfig.initialize?i.sort_config.initialize:function(a){a.SetSortTable&&a.SetSortTable() +},this.sortConfig.sortTypes=m.isArray(this.sortConfig.sort_types)?i.sort_config.sort_types:[],this.sortConfig.sortCol=void 0!==this.sortConfig.sort_col?i.sort_config.sort_col:null,this.sortConfig.asyncSort=this.sortConfig.async_sort===!0?!0:!1,this.sortConfig.triggerIds=m.isArray(this.sortConfig.sort_trigger_ids)?i.sort_config.sort_trigger_ids:[],this.selectable=i.selectable===!0?!0:!1,this.editable=i.editable===!0?!0:!1,this.ezEditTableConfig=i.ezEditTable_config||{},this.ezEditTableConfig.name=void 0!==this.ezEditTableConfig.name?i.ezEditTable_config.name:"ezedittable",this.ezEditTableConfig.src=void 0!==this.ezEditTableConfig.src?i.ezEditTable_config.src:this.basePath+"ezEditTable/ezEditTable.js",this.ezEditTableConfig.loadStylesheet=this.ezEditTableConfig.loadStylesheet===!0?!0:!1,this.ezEditTableConfig.stylesheet=this.ezEditTableConfig.stylesheet||this.basePath+"ezEditTable/ezEditTable.css",this.ezEditTableConfig.stylesheetName=void 0!==this.ezEditTableConfig.stylesheetName?i.ezEditTable_config.stylesheetName:"ezEditTableCss",this.ezEditTableConfig.err='Failed to instantiate EditTable object.\n"ezEditTable" module may not be available.',this.onKeyUp=i.on_keyup===!0?!0:!1,this.onKeyUpDelay=isNaN(i.on_keyup_delay)?900:i.on_keyup_delay,this.isUserTyping=null,this.onKeyUpTimer=void 0,this.highlightKeywords=i.highlight_keywords===!0?!0:!1,this.defaultDateType=i.default_date_type||"DMY",this.thousandsSeparator=i.thousands_separator||",",this.decimalSeparator=i.decimal_separator||".",this.hasColNbFormat=i.col_number_format===!0?!0:!1,this.colNbFormat=m.isArray(this.hasColNbFormat)?i.col_number_format:null,this.hasColDateType=i.col_date_type===!0?!0:!1,this.colDateType=m.isArray(this.hasColDateType)?i.col_date_type:null,this.msgFilter=i.msg_filter||"Filtering data...",this.msgPopulate=i.msg_populate||"Populating filter...",this.msgPopulateCheckList=i.msg_populate_checklist||"Populating list...",this.msgChangePage=i.msg_change_page||"Collecting paging data...",this.msgClear=i.msg_clear||"Clearing filters...",this.msgChangeResults=i.msg_change_results||"Changing results per page...",this.msgResetValues=i.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=i.msg_reset_page||"Re-setting page...",this.msgResetPageLength=i.msg_reset_page_length||"Re-setting page length...",this.msgSort=i.msg_sort||"Sorting data...",this.msgLoadExtensions=i.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=i.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxContentDiv="cont_",this.prfxCheckListDiv="chkdiv_",this.prfxSlcPages="slcPages_",this.prfxSlcResults="slcResults_",this.prfxSlcResultsTxt="slcResultsTxt_",this.prfxBtnNextSpan="btnNextSpan_",this.prfxBtnPrevSpan="btnPrevSpan_",this.prfxBtnLastSpan="btnLastSpan_",this.prfxBtnFirstSpan="btnFirstSpan_",this.prfxBtnNext="btnNext_",this.prfxBtnPrev="btnPrev_",this.prfxBtnLast="btnLast_",this.prfxBtnFirst="btnFirst_",this.prfxPgSpan="pgspan_",this.prfxPgBeforeSpan="pgbeforespan_",this.prfxPgAfterSpan="pgafterspan_",this.prfxCounter="counter_",this.prfxTotRows="totrows_span_",this.prfxTotRowsTxt="totRowsTextSpan_",this.prfxResetSpan="resetspan_",this.prfxLoader="load_",this.prfxStatus="status_",this.prfxStatusSpan="statusSpan_",this.prfxStatusTxt="statusText_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.prfxMainTblCont="gridCont_",this.prfxTblCont="tblCont_",this.prfxHeadTblCont="tblHeadCont_",this.prfxHeadTbl="tblHead_",this.prfxGridFltTd="_td_",this.prfxGridTh="tblHeadTh_",this.prfxHelpSpan="helpSpan_",this.prfxHelpDiv="helpDiv_",this.prfxPopUpSpan="popUpSpan_",this.prfxPopUpDiv="popUpDiv_",this.hasStoredValues=!1,this.rememberGridValues=i.remember_grid_values===!0?!0:!1,this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&i.remember_page_number?!0:!1,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&i.remember_page_length?!0:!1,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.hasExtensions=i.extensions===!0?!0:!1,this.extensions=this.hasExtensions?i.extensions:null,this.enableDefaultTheme=i.enable_default_theme===!0?!0:!1,this.hasThemes=i.enable_default_theme||i.themes&&m.isObj(i.themes)?!0:!1,this.themes=this.hasThemes?i.themes:null,this.themesPath=i.themes_path||this.basePath+"TF_Themes/",this.Cpt={loader:null,alternateRows:null,colOps:null,rowsCounter:null,gridLayout:null,store:null,highlightKeywords:null,paging:null,checkList:null,dropdown:null,popupFilter:null,clearButton:null,help:null,statusBar:null};var p=this;this.Evt={name:{filter:"Filter",dropdown:"dropdown",checklist:"checkList",changepage:"changePage",clear:"Clear",changeresultsperpage:"changeResults",resetvalues:"ResetValues",resetpage:"resetPage",resetpagelength:"resetPageLength",sort:"Sort",loadextensions:"LoadExtensions",loadthemes:"LoadThemes"},getKeyCode:function(a){return a.charCode?a.charCode:a.keyCode?a.keyCode:a.which?a.which:0},_DetectKey:function(a){if(p.enterKey){var b=a||f.event;if(b){var c=p.Evt.getKeyCode(b);13===c?(p._Filter(),g.cancel(b),g.stop(b)):(p.isUserTyping=!0,f.clearInterval(p.onKeyUpTimer),p.onKeyUpTimer=void 0)}}},_OnKeyUp:function(a){function b(){f.clearInterval(p.onKeyUpTimer),p.onKeyUpTimer=void 0,p.isUserTyping||(p.Filter(),p.isUserTyping=null)}if(p.onKeyUp){var c=a||f.event,d=p.Evt.getKeyCode(c);p.isUserTyping=!1,13!==d&&9!==d&&27!==d&&38!==d&&40!==d?void 0===p.onKeyUpTimer&&(p.onKeyUpTimer=f.setInterval(b,p.onKeyUpDelay)):(f.clearInterval(p.onKeyUpTimer),p.onKeyUpTimer=void 0)}},_OnKeyDown:function(){p.onKeyUp&&(p.isUserTyping=!0)},_OnInpBlur:function(){p.onKeyUp&&(p.isUserTyping=!1,f.clearInterval(p.onKeyUpTimer)),""===this.value&&""!==p.inpWatermark&&(this.value=p.isInpWatermarkArray?p.inpWatermark[this.getAttribute("ct")]:p.inpWatermark,h.addClass(this,p.inpWatermarkCssClass)),p.ezEditTable&&(p.editable&&p.ezEditTable.Editable.Set(),p.selectable&&p.ezEditTable.Selection.Set())},_OnInpFocus:function(a){var b=a||f.event;if(p.activeFilterId=this.getAttribute("id"),p.activeFlt=h.id(p.activeFilterId),p.isInpWatermarkArray){var c=p.inpWatermark[this.getAttribute("ct")];this.value===c&&""!==c&&(this.value="",h.removeClass(this,p.inpWatermarkCssClass))}else this.value===p.inpWatermark&&""!==p.inpWatermark&&(this.value="",h.removeClass(this,p.inpWatermarkCssClass));p.popUpFilters&&(g.cancel(b),g.stop(b)),p.ezEditTable&&(p.editable&&p.ezEditTable.Editable.Remove(),p.selectable&&p.ezEditTable.Selection.Remove())},_OnSlcFocus:function(a){var b=a||f.event;if(p.activeFilterId=this.getAttribute("id"),p.activeFlt=h.id(p.activeFilterId),p.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var c=this.getAttribute("ct");p.Cpt.dropdown._build(c)}p.popUpFilters&&(g.cancel(b),g.stop(b))},_OnSlcChange:function(a){if(p.activeFlt){var b=(p.activeFlt.getAttribute("colIndex"),a||f.event);p.popUpFilters&&g.stop(b),p.onSlcChange&&p.Filter()}},_OnSlcBlur:function(){},_OnCheckListClick:function(){if(p.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var a=this.getAttribute("ct");p.Cpt.checkList._build(a),p.Cpt.checkList.checkListDiv[a].onclick=null,p.Cpt.checkList.checkListDiv[a].title=""}},_OnCheckListFocus:function(){p.activeFilterId=this.firstChild.getAttribute("id"),p.activeFlt=h.id(p.activeFilterId)},_OnCheckListBlur:function(){},_OnBtnClick:function(){p.Filter()},_OnSlcPagesChangeEvt:null,_EnableSlc:function(){this.firstChild.disabled=!1,this.firstChild.focus(),this.onclick=null},_Paging:{nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null}}}}function c(a,b){if(a){b||(b="us");var c=a;return c="us"===k.lower(b)?+c.replace(/[^\d\.-]/g,""):+c.replace(/[^\d\,-]/g,"").replace(",",".")}}function d(a,b){for(var c=!1,d=b?b:"script",e="script"==d?"src":"href",f=h.tag(s,d),g=0;g0?n[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popUpFilters&&this.headersRow++,this.popUpFilters&&this.headersRow++,m.className=this.fltsRowCssClass,this.isExternalFlt&&(!this.gridLayout||this.popUpFilters)&&(m.style.display="none")}this.nbFilterableRows=this.GetRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var o=0;d>o;o++){this.popUpFilters&&this.Cpt.popupFilter.build(o);var p=h.create(this.fltCellTag),q=this["col"+o],r=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[o]:null;if(this.singleSearchFlt&&(p.colSpan=this.nbCells),this.gridLayout||m.appendChild(p),b=o==d-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,void 0===q&&(q=void 0===c["col_"+o]?this.fltTypeInp:k.lower(c["col_"+o])),this.singleSearchFlt&&(q=this.fltTypeInp,b=this.singleFltCssClass),q===this.fltTypeSlc||q===this.fltTypeMulti){var s;if(!this.Cpt.dropdown){var t=a("modules/dropdown").Dropdown;s=new t(this)}this.Cpt.dropdown=s;var u=h.create(this.fltTypeSlc,["id",this.prfxFlt+o+"_"+this.id],["ct",o],["filled","0"]);if(q===this.fltTypeMulti&&(u.multiple=this.fltTypeMulti,u.title=s.multipleSlcTooltip),u.className=k.lower(q)===this.fltTypeSlc?b:this.fltMultiCssClass,r?(h.id(r).appendChild(u),this.externalFltEls.push(u)):p.appendChild(u),this.fltIds.push(this.prfxFlt+o+"_"+this.id),this.fillSlcOnDemand||s._build(o),g.add(u,"keypress",this.Evt._DetectKey),g.add(u,"change",this.Evt._OnSlcChange),g.add(u,"focus",this.Evt._OnSlcFocus),g.add(u,"blur",this.Evt._OnSlcBlur),this.fillSlcOnDemand){var v=h.createOpt(this.displayAllText,"");u.appendChild(v)}}else if(q===this.fltTypeCheckList){if(!this.Cpt.checkList){var w=a("modules/checkList").CheckList;this.Cpt.checkList=new w(this)}var x=h.create("div",["id",this.prfxCheckListDiv+o+"_"+this.id],["ct",o],["filled","0"]);x.className=this.Cpt.checkList.checkListDivCssClass,r?(h.id(r).appendChild(x),this.externalFltEls.push(x)):p.appendChild(x),this.Cpt.checkList.checkListDiv[o]=x,this.fltIds.push(this.prfxFlt+o+"_"+this.id),this.fillSlcOnDemand||this.Cpt.checkList._build(o),this.fillSlcOnDemand&&(g.add(x,"click",this.Evt._OnCheckListClick),x.appendChild(h.text(this.Cpt.checkList.activateCheckListTxt))),g.add(x,"click",this.Evt._OnCheckListFocus)}else{var y=q===this.fltTypeInp?"text":"hidden",z=h.create(this.fltTypeInp,["id",this.prfxFlt+o+"_"+this.id],["type",y],["ct",o]);if("hidden"!=y&&(z.value=this.isInpWatermarkArray?this.inpWatermark[o]:this.inpWatermark),z.className=b,""!==this.inpWatermark&&h.addClass(z,this.inpWatermarkCssClass),z.onfocus=this.Evt._OnInpFocus,r?(h.id(r).appendChild(z),this.externalFltEls.push(z)):p.appendChild(z),this.fltIds.push(this.prfxFlt+o+"_"+this.id),z.onkeypress=this.Evt._DetectKey,z.onkeydown=this.Evt._OnKeyDown,z.onkeyup=this.Evt._OnKeyUp,z.onblur=this.Evt._OnInpBlur,this.rememberGridValues){var A=this.Cpt.store.getFilterValues(this.fltsValuesCookie);" "!=A[o]&&this.SetFilterValue(o,A[o],!1)}}if(o==d-1&&this.displayBtn){var B=h.create(this.fltTypeInp,["id",this.prfxValButton+o+"_"+this.id],["type","button"],["value",this.btnText]);B.className=this.btnCssClass,r?h.id(r).appendChild(B):p.appendChild(B),B.onclick=this.Evt._OnBtnClick}}}else this.__resetGrid();else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.GetRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;if(this.rowsCounter){var C=a("modules/rowsCounter").RowsCounter;this.Cpt.rowsCounter=new C(this),this.Cpt.rowsCounter.init()}if(this.statusBar){var D=a("modules/statusBar").StatusBar;this.Cpt.statusBar=new D(this),this.Cpt.statusBar.init()}if(this.paging){var E=a("modules/paging").Paging;this.Cpt.paging=new E(this),this.Cpt.paging.init()}if(this.btnReset){var F=a("modules/clearButton").ClearButton;this.Cpt.clearButton=new F(this),this.Cpt.clearButton.init()}if(this.helpInstructions){var G=a("modules/help").Help;this.Cpt.help=new G(this),this.Cpt.help.init()}if(this.hasColWidth&&!this.gridLayout&&this.SetColWidths(),this.alternateBgs){var H=a("modules/alternateRows").AlternateRows;this.Cpt.alternateRows=new H(this),this.Cpt.alternateRows.init()}if(this.hasColOperation){var I=a("modules/colOps").ColOps;this.Cpt.colOps=new I(this),this.Cpt.colOps.calc()}(this.sort||this.gridLayout)&&this.SetSort(),(this.selectable||this.editable)&&this.SetEditable(),this.isFirstLoad=!1,this.hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.ResetValues(),this.gridLayout||h.addClass(this.tbl,this.prfxTf),this.loader&&this.Cpt.loader.show("none"),this.hasExtensions&&this.LoadExtensions(),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this)}},EvtManager:function(a,b){function c(){if(a){switch(a){case d.Evt.name.filter:d.isModFilterFn?d.modFilterFn.call(null,d):d._Filter();break;case d.Evt.name.dropdown:d.refreshFilters?d.Cpt.dropdown._build(e,!0):d.Cpt.dropdown._build(e,!1,g,h);break;case d.Evt.name.checklist:d.Cpt.checkList._build(e,g,h);break;case d.Evt.name.changepage:d.Cpt.paging._changePage(i);break;case d.Evt.name.clear:d._ClearFilters(),d._Filter();break;case d.Evt.name.changeresultsperpage:d.Cpt.paging._changeResultsPerPage();break;case d.Evt.name.resetvalues:d._ResetValues(),d._Filter();break;case d.Evt.name.resetpage:d.Cpt.paging._resetPage(d.pgNbCookie);break;case d.Evt.name.resetpagelength:d.Cpt.paging._resetPageLength(d.pgLenCookie);break;case d.Evt.name.sort:break;case d.Evt.name.loadextensions:d._LoadExtensions();break;case d.Evt.name.loadthemes:d._LoadThemes();break;default:d["_"+a].call(null,d,b)}d.statusBar&&d.Cpt.statusBar.message(""),d.loader&&d.Cpt.loader.show("none")}}var d=this,e=b&&void 0!==b.slcIndex?b.slcIndex:null,g=b&&void 0!==b.slcExternal?b.slcExternal:!1,h=b&&void 0!==b.slcId?b.slcId:null,i=b&&void 0!==b.pgIndex?b.pgIndex:null;if(this.loader||this.statusBar){try{this.Cpt.loader.show(""),this.Cpt.statusBar.message(this["msg"+a])}catch(j){}f.setTimeout(c,this.execDelay)}else c()},ImportModule:function(a){a.path&&a.name&&this.IncludeFile(a.name,a.path,a.init)},LoadExtensions:function(){if(!this.Ext){var a=this;this.Ext={list:{},add:function(b,c,d,e){var f=d.split("/")[d.split("/").length-1],g=new RegExp(f),h=d.replace(g,"");a.Ext.list[b]={name:b,description:c,file:f,path:h,callback:e}}}}this.EvtManager(this.Evt.name.loadextensions)},_LoadExtensions:function(){if(this.hasExtensions&&m.isArray(this.extensions.name)&&m.isArray(this.extensions.src))for(var a=this.extensions,b=0;b',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null}},RemoveGrid:function(){if(this.fltGrid&&this.hasGrid){var a=this.tbl.rows;this.paging&&this.Cpt.paging.destroy(),this.statusBar&&this.Cpt.statusBar.destroy(),this.rowsCounter&&this.Cpt.rowsCounter.destroy(),this.btnReset&&this.Cpt.clearButton.destroy(),this.helpInstructions&&this.Cpt.help.destroy(),this.isExternalFlt&&!this.popUpFilters&&this.RemoveExternalFlts(),this.infDiv&&this.RemoveTopDiv(),this.highlightKeywords&&this.Cpt.highlightKeyword.unhighlightAll(),this.sort&&this.RemoveSort(),this.loader&&this.Cpt.loader.remove(),this.popUpFilters&&this.Cpt.popupFilter.destroy(),this.markActiveColumns&&this.ClearActiveColumns(),(this.editable||this.selectable)&&this.RemoveEditable();for(var b=this.refRow;b0&&!c.startRow?void 0:c.startRow||a.refRow,c.scroll_into_view=c.scroll_into_view===!1?!1:!0,c.base_path=c.base_path||a.basePath+"ezEditTable/",c.editable=a.editable=a.fObj.editable,c.selection=a.selectable=a.fObj.selectable,a.selectable&&(c.default_selection=c.default_selection||"row"),c.active_cell_css=c.active_cell_css||"ezETSelectedCell",a._lastValidRowIndex=0,a._lastRowIndex=0,a.selectable){var e=function(b,c,d){if(a.validRowsIndex){var e,f=a.validRowsIndex,g=f.length,h="row"!==b.defaultSelection?c.parentNode:c,i="TD"===c.nodeName?c:null,j=void 0!==d?b.Event.GetKey(d):0,k=n.has(f,h.rowIndex),l=34===j||33===j?a.pagingLength||b.nbRowsPerPage:1;if(k)34!==j&&33!==j?(a._lastValidRowIndex=n.indexByValue(f,h.rowIndex),a._lastRowIndex=h.rowIndex):(e=34===j?a._lastValidRowIndex+l<=g-1?f[a._lastValidRowIndex+l]:[g-1]:a._lastValidRowIndex-l<=f[0]?f[0]:f[a._lastValidRowIndex-l],a._lastRowIndex=e,a._lastValidRowIndex=n.indexByValue(f,e),p(e));else{if(h.rowIndex>a._lastRowIndex)if(h.rowIndex>=f[g-1])e=f[g-1];else{var m=a._lastValidRowIndex+l;e=m>g-1?f[g-1]:f[m]}else if(h.rowIndex<=f[0])e=f[0];else{var o=f[a._lastValidRowIndex-l];e=o?o:f[0]}a._lastRowIndex=h.rowIndex,p(e)}var p=function(d){if("row"===b.defaultSelection)b.Selection.SelectRowByIndex(d);else{b.ClearSelections();var e=c.cellIndex,f=a.tbl.rows[d];"both"===b.defaultSelection&&b.Selection.SelectRowByIndex(d),f&&b.Selection.SelectCell(f.cells[e])}if(a.validRowsIndex.length!==a.GetRowsNb()){var g=a.tbl.rows[d];g&&g.scrollIntoView(!1),i&&(i.cellIndex===a.GetCellsNb()-1&&a.gridLayout?a.tblCont.scrollLeft=1e8:0===i.cellIndex&&a.gridLayout?a.tblCont.scrollLeft=0:i.scrollIntoView(!1))}}}},f=function(b,c){var d="row"!==b.defaultSelection?c.parentNode:c;if(a.paging&&a.nbPages>1){b.nbRowsPerPage=a.pagingLength;var e=a.validRowsIndex,f=e.length,g=parseInt(a.startPagingRow,10)+parseInt(a.pagingLength,10),h=d.rowIndex;h===e[f-1]&&a.currentPageNb!=a.nbPages?a.Cpt.paging.setPage("last"):h==e[0]&&1!==a.currentPageNb?a.Cpt.paging.setPage("first"):h>e[g-1]&&he[0]&&a.Cpt.paging.setPage("previous")}};if(a.paging&&(a.onAfterChangePage=function(a){var b=a.ezEditTable,c=b.Selection.GetActiveRow();c&&c.scrollIntoView(!1);var d=b.Selection.GetActiveCell();d&&d.scrollIntoView(!1)}),"row"===c.default_selection){var g=c.on_before_selected_row;c.on_before_selected_row=function(){f(arguments[0],arguments[1],arguments[2]),g&&g.call(null,arguments[0],arguments[1],arguments[2])};var i=c.on_after_selected_row;c.on_after_selected_row=function(){e(arguments[0],arguments[1],arguments[2]),i&&i.call(null,arguments[0],arguments[1],arguments[2])}}else{var j=c.on_before_selected_cell;c.on_before_selected_cell=function(){f(arguments[0],arguments[1],arguments[2]),j&&j.call(null,arguments[0],arguments[1],arguments[2])};var k=c.on_after_selected_cell;c.on_after_selected_cell=function(){e(arguments[0],arguments[1],arguments[2]),k&&k.call(null,arguments[0],arguments[1],arguments[2])}}}if(a.editable){var l=c.on_added_dom_row;if(c.on_added_dom_row=function(){a.nbFilterableRows++,a.paging?(a.nbRows++,a.nbVisibleRows++,a.nbFilterableRows++,a.paging=!1,a.Cpt.paging.destroy(),a.Cpt.paging.addPaging()):a.Cpt.rowsCounter.refresh(),a.alternateBgs&&a.Cpt.alternateRows.init(),l&&l.call(null,arguments[0],arguments[1],arguments[2])},c.actions&&c.actions["delete"]){var m=c.actions["delete"].on_after_submit;c.actions["delete"].on_after_submit=function(){a.nbFilterableRows--,a.paging?(a.nbRows--,a.nbVisibleRows--,a.nbFilterableRows--,a.paging=!1,a.Cpt.paging.destroy(),a.Cpt.paging.addPaging(!1)):a.Cpt.rowsCounter.refresh(),a.alternateBgs&&a.Cpt.alternateRows.init(),m&&m.call(null,arguments[0],arguments[1])}}}try{a.ezEditTable=new EditTable(a.id,c,b),a.ezEditTable.Init()}catch(o){console.log(c.err)}},__deferMultipleSelection:function(a,b,c){if("select"===k.lower(a.nodeName)){var d=void 0===c?!1:c,e=this;f.setTimeout(function(){a.options[0].selected=!1,""===a.options[b].value?a.options[b].selected=!1:(a.options[b].selected=!0,d&&e.Filter())},.1)}},__getCustomValues:function(a){if(a){var b=this.hasCustomSlcOptions&&n.has(this.customSlcOptions.cols,a);if(b){for(var c=[],d=[],e=n.indexByValue(this.customSlcOptions.cols,a),f=this.customSlcOptions.values[e],g=this.customSlcOptions.texts[e],h=this.customSlcOptions.sorts[e],i=0;ih):P?(n=r(a.replace(l,""),J),f=n>=h):R?(n=r(a.replace(m,""),J),f=h>=n):Q?(n=r(a.replace(p,""),J),f=h>n):S?(n=r(a.replace(s,""),J),f=h.toString()!=n.toString()):T?(n=r(a.replace(u,""),J),f=h.toString()==n.toString()):t.test(a)?f=g.__containsStr(a.replace(t,""),b,null,!1):q(a,J)?(n=r(a,J),f=h.toString()==n.toString()):L?f=k.isEmpty(b):M&&(f=!k.isEmpty(b));else if(g.hasColNbFormat&&g.colNbFormat[d]?(i=c(b,g.colNbFormat[d]),j=g.colNbFormat[d]):","===g.thousandsSeparator&&"."===g.decimalSeparator?(i=c(b,"us"),j="us"):(i=c(b,"eu"),j="eu"),C)f=i<=c(a.replace(l,""),j);else if(E)f=i>=c(a.replace(m,""),j);else if(B)f=ic(a.replace(p,""),j);else if(F)f=g.__containsStr(a.replace(s,""),b)?!1:!0;else if(H)f=g.__containsStr(a.replace(t,""),b,null,!1);else if(G)f=g.__containsStr(a.replace(u,""),b,null,!0);else if(I)f=0===b.indexOf(a.replace(v,""))?!0:!1;else if(K){var U=a.replace(w,"");f=b.lastIndexOf(U,b.length-1)===b.length-1-(U.length-1)&&b.lastIndexOf(U,b.length-1)>-1?!0:!1}else if(L)f=k.isEmpty(b);else if(M)f=!k.isEmpty(b);else if(N)try{var V=a.replace(A,""),W=new RegExp(V);f=W.test(b)}catch(X){f=!1}else{var Y=e["col_"+d];f=g.__containsStr(a,b,Y?Y:this.fltTypeInp)}return f}if(this.fltGrid&&(this.hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),""!==this.inpWatermark&&this.SetWatermark(!1);var d=this.tbl.rows,e=this.fObj||{},f=0;this.validRowsIndex=[];var g=this;this.highlightKeywords&&this.Cpt.highlightKeyword.unhighlightAll(),this.popUpFilters&&this.Cpt.popupFilter.buildIcons(),this.markActiveColumns&&this.ClearActiveColumns(),this.searchArgs=this.GetFiltersValue();for(var i,j,l=new RegExp(this.leOperator),m=new RegExp(this.geOperator),o=new RegExp(this.lwOperator),p=new RegExp(this.grOperator),s=new RegExp(this.dfOperator),t=new RegExp(k.rgxEsc(this.lkOperator)),u=new RegExp(this.eqOperator),v=new RegExp(this.stOperator),w=new RegExp(this.enOperator),x=new RegExp(this.anOperator),y=(new RegExp(this.curExp),this.emOperator),z=this.nmOperator,A=new RegExp(k.rgxEsc(this.rgxOperator)),B=this.refRow;BH;H++){var I=this.searchArgs[this.singleSearchFlt?0:H],J=this.hasColDateType?this.colDateType[H]:this.defaultDateType;if(""!==I){var K=k.matchCase(this.GetCellData(H,C[H]),this.matchCase),L=I.split(this.orOperator),M=L.length>1?!0:!1,N=I.split(this.anOperator),O=N.length>1?!0:!1;if(M||O){for(var P,Q=!1,R=M?L:N,S=0;Sl;l++)if(l===a&&""===e[g].style.display){var o=k.lower(this.GetCellData(l,i[l])),p=this.colNbFormat?this.colNbFormat[a]:null,q=b?c(o,p):o;f.push(q)}}return f}},GetFilterValue:function(a){if(this.fltGrid){var b,c=this.GetFilterElement(a);if(!c)return"";var d=this.fltCol[a];if(d!==this.fltTypeMulti&&d!==this.fltTypeCheckList)b=c.value;else if(d===this.fltTypeMulti){b="";for(var e=0;e { + this.statusBarSpan.innerHTML = t; + if(this.onAfterShowMsg){ + this.onAfterShowMsg.call(null, this.tf, t); + } + }, d); + } + + destroy(){ + var tf = this.tf; + if(!tf.hasGrid || !this.statusBarDiv){ + return; + } + + this.statusBarDiv.innerHTML = ''; + this.statusBarDiv.parentNode.removeChild(this.statusBarDiv); + this.statusBarSpan = null; + this.statusBarSpanText = null; + this.statusBarDiv = null; + } + +} diff --git a/src/core.js b/src/core.js index 9e8cddff..3a7fd87e 100644 --- a/src/core.js +++ b/src/core.js @@ -238,8 +238,6 @@ function TableFilter(id) { this.externalFltEls = []; //delays any filtering process if loader true this.execDelay = !isNaN(f.exec_delay) ? parseInt(f.exec_delay,10) : 100; - //enables/disables status messages - this.status = f.status===true ? true : false; //calls function when filters grid loaded this.onFiltersLoaded = types.isFn(f.on_filters_loaded) ? f.on_filters_loaded : null; @@ -622,7 +620,8 @@ function TableFilter(id) { dropdown: null, popupFilter: null, clearButton: null, - help: null + help: null, + statusBar: null }; /*** TF events ***/ @@ -1136,7 +1135,10 @@ TableFilter.prototype = { this.Cpt.rowsCounter.init(); } if(this.statusBar){ - this.SetStatusBar(); + // this.SetStatusBar(); + var StatusBar = require('modules/statusBar').StatusBar; + this.Cpt.statusBar = new StatusBar(this); + this.Cpt.statusBar.init(); } if(this.paging){ var Paging = require('modules/paging').Paging; @@ -1270,18 +1272,19 @@ TableFilter.prototype = { o['_'+evt].call(null,o,s); break; } - if(o.status || o.statusBar){ - o.StatusMsg(''); + if(o.statusBar){ + o.Cpt.statusBar.message(''); } if(o.loader){ o.Cpt.loader.show('none'); } } - if(this.loader || this.status || this.statusBar) { + if(this.loader || this.statusBar) { try{ this.Cpt.loader.show(''); - this.StatusMsg(o['msg'+evt]); + // this.StatusMsg(o['msg'+evt]); + this.Cpt.statusBar.message(this['msg'+evt]); } catch(e){} global.setTimeout(efx, this.execDelay); } else { @@ -1442,7 +1445,8 @@ TableFilter.prototype = { this.Cpt.paging.destroy(); } if(this.statusBar){ - this.RemoveStatusBar(); + // this.RemoveStatusBar(); + this.Cpt.statusBar.destroy(); } if(this.rowsCounter){ this.Cpt.rowsCounter.destroy(); @@ -2076,127 +2080,6 @@ TableFilter.prototype = { return [optArray,optTxt]; }, - /*==================================================== - - Generates status bar label - =====================================================*/ - SetStatusBar: function(){ - if(!this.hasGrid && !this.isFirstLoad){ - return; - } - var f = this.fObj; - //id of custom container element - this.statusBarTgtId = f.status_bar_target_id || null; - //element containing status bar label - this.statusBarDiv = null; - //status bar - this.statusBarSpan = null; - //status bar label - this.statusBarSpanText = null; - //defines status bar text - this.statusBarText = f.status_bar_text || ''; - //defines css class status bar - this.statusBarCssClass = f.status_bar_css_class || 'status'; - //delay for status bar clearing - this.statusBarCloseDelay = 250; - //status bar container - var statusDiv = dom.create('div', ['id',this.prfxStatus+this.id]); - statusDiv.className = this.statusBarCssClass; - //status bar label - var statusSpan = dom.create( - 'span', ['id',this.prfxStatusSpan+this.id]); - //preceding text - var statusSpanText = dom.create( - 'span', ['id',this.prfxStatusTxt+this.id]); - statusSpanText.appendChild(dom.text(this.statusBarText)); - //calls function before message is displayed - this.onBeforeShowMsg = types.isFn(f.on_before_show_msg) ? - f.on_before_show_msg : null; - //calls function after message is displayed - this.onAfterShowMsg = types.isFn(f.on_after_show_msg) ? - f.on_after_show_msg : null; - - // target element container - if(!this.statusBarTgtId){ - this.SetTopDiv(); - } - var targetEl = (!this.statusBarTgtId) ? - this.lDiv : dom.id(this.statusBarTgtId); - - if(this.statusBarDiv && hlp.isIE()){ - this.statusBarDiv.outerHTML = ''; - } - - //default container: 'lDiv' - if(!this.statusBarTgtId){ - statusDiv.appendChild(statusSpanText); - statusDiv.appendChild(statusSpan); - targetEl.appendChild(statusDiv); - } else { - // custom container, no need to append statusDiv - targetEl.appendChild(statusSpanText); - targetEl.appendChild(statusSpan); - } - - this.statusBarDiv = dom.id( this.prfxStatus+this.id ); - this.statusBarSpan = dom.id( this.prfxStatusSpan+this.id ); - this.statusBarSpanText = dom.id( this.prfxStatusTxt+this.id ); - }, - - /*==================================================== - - Removes status bar div - =====================================================*/ - RemoveStatusBar: function(){ - if(!this.hasGrid && !this.statusBarDiv){ - return; - } - - this.statusBarDiv.innerHTML = ''; - this.statusBarDiv.parentNode.removeChild(this.statusBarDiv); - this.statusBarSpan = null; - this.statusBarSpanText = null; - this.statusBarDiv = null; - }, - - /*==================================================== - - sets status messages - =====================================================*/ - StatusMsg: function(t){ - if(!t){ - this.StatusMsg(''); - } - if(this.status){ this.WinStatusMsg(t); } - if(this.statusBar){ this.StatusBarMsg(t); } - }, - - /*==================================================== - - sets window status messages - =====================================================*/ - WinStatusMsg: function(t){ - if(!this.status){ - return; - } - if(this.onBeforeShowMsg){ this.onBeforeShowMsg.call(null, this, t); } - global.status = t; - if(this.onAfterShowMsg){ this.onAfterShowMsg.call(null, this, t); } - }, - - /*==================================================== - - sets status bar messages - =====================================================*/ - StatusBarMsg: function(t){ - if(!this.statusBar || !this.statusBarSpan){ - return; - } - if(this.onBeforeShowMsg){ this.onBeforeShowMsg.call(null, this, t); } - var o = this; - function setMsg(){ - o.statusBarSpan.innerHTML = t; - if(o.onAfterShowMsg){ o.onAfterShowMsg.call(null, o, t); } - } - var d = t==='' ? this.statusBarCloseDelay : 1; - global.setTimeout(setMsg, d); - }, - /*==================================================== - inserts or removes input watermark - Params: diff --git a/src/index.html b/src/index.html index e80f9444..967b60ca 100644 --- a/src/index.html +++ b/src/index.html @@ -97,7 +97,7 @@ enable_default_theme: true, // slc_filling_method: 'innerhtml', paging: false, - paging_length: 2, + paging_length: 4, // page_selector_type: 'input', results_per_page: ['Results per page', [2,4,6]], remember_grid_values: true, @@ -109,10 +109,14 @@ alternate_rows: true, highlight_keywords: true, match_case: false, - btn_reset: true + btn_reset: true, + status_bar: true, // grid_layout: true, // grid_width: '500px', - // grid_height: '200px' + // grid_height: '200px', + on_before_show_msg: function(tf){ + console.log('on_before_show_msg'); + } }); tf.init(); diff --git a/src/modules/statusBar.js b/src/modules/statusBar.js new file mode 100644 index 00000000..f7aafa2b --- /dev/null +++ b/src/modules/statusBar.js @@ -0,0 +1,130 @@ +define(["exports", "../dom", "../event", "../types", "../helpers"], function (exports, _dom, _event, _types, _helpers) { + "use strict"; + + var _classProps = function (child, staticProps, instanceProps) { + if (staticProps) Object.defineProperties(child, staticProps); + if (instanceProps) Object.defineProperties(child.prototype, instanceProps); + }; + + var Dom = _dom.Dom; + var Event = _event.Event; + var Types = _types.Types; + var Helpers = _helpers.Helpers; + var StatusBar = (function () { + var StatusBar = function StatusBar(tf) { + // Configuration object + var f = tf.fObj || {}; + + //id of custom container element + this.statusBarTgtId = f.status_bar_target_id || null; + //element containing status bar label + this.statusBarDiv = null; + //status bar + this.statusBarSpan = null; + //status bar label + this.statusBarSpanText = null; + //defines status bar text + this.statusBarText = f.status_bar_text || ""; + //defines css class status bar + this.statusBarCssClass = f.status_bar_css_class || "status"; + //delay for status bar clearing + this.statusBarCloseDelay = 250; + + //calls function before message is displayed + this.onBeforeShowMsg = Types.isFn(f.on_before_show_msg) ? f.on_before_show_msg : null; + //calls function after message is displayed + this.onAfterShowMsg = Types.isFn(f.on_after_show_msg) ? f.on_after_show_msg : null; + + this.tf = tf; + }; + + _classProps(StatusBar, null, { + init: { + writable: true, + value: function () { + var tf = this.tf; + if (!tf.hasGrid && !tf.isFirstLoad) { + return; + } + + //status bar container + var statusDiv = Dom.create("div", ["id", tf.prfxStatus + tf.id]); + statusDiv.className = this.statusBarCssClass; + + //status bar label + var statusSpan = Dom.create("span", ["id", tf.prfxStatusSpan + tf.id]); + //preceding text + var statusSpanText = Dom.create("span", ["id", tf.prfxStatusTxt + tf.id]); + statusSpanText.appendChild(Dom.text(this.statusBarText)); + + // target element container + if (!this.statusBarTgtId) { + tf.SetTopDiv(); + } + var targetEl = (!this.statusBarTgtId) ? tf.lDiv : Dom.id(this.statusBarTgtId); + + // TODO: use alternative to outerHTML + if (this.statusBarDiv && Helpers.isIE()) { + this.statusBarDiv.outerHTML = ""; + } + + //default container: 'lDiv' + if (!this.statusBarTgtId) { + statusDiv.appendChild(statusSpanText); + statusDiv.appendChild(statusSpan); + targetEl.appendChild(statusDiv); + } else { + // custom container, no need to append statusDiv + targetEl.appendChild(statusSpanText); + targetEl.appendChild(statusSpan); + } + + this.statusBarDiv = statusDiv; + this.statusBarSpan = statusSpan; + this.statusBarSpanText = statusSpanText; + } + }, + message: { + writable: true, + value: function (t) { + var _this = this; + if (t === undefined) t = ""; + var tf = this.tf; + if (!tf.statusBar || !this.statusBarSpan) { + return; + } + if (this.onBeforeShowMsg) { + this.onBeforeShowMsg.call(null, this.tf, t); + } + + var d = t === "" ? this.statusBarCloseDelay : 1; + window.setTimeout(function () { + _this.statusBarSpan.innerHTML = t; + if (_this.onAfterShowMsg) { + _this.onAfterShowMsg.call(null, _this.tf, t); + } + }, d); + } + }, + destroy: { + writable: true, + value: function () { + var tf = this.tf; + if (!tf.hasGrid || !this.statusBarDiv) { + return; + } + + this.statusBarDiv.innerHTML = ""; + this.statusBarDiv.parentNode.removeChild(this.statusBarDiv); + this.statusBarSpan = null; + this.statusBarSpanText = null; + this.statusBarDiv = null; + } + } + }); + + return StatusBar; + })(); + + exports.StatusBar = StatusBar; +}); \ No newline at end of file diff --git a/test/test-status-bar.html b/test/test-status-bar.html new file mode 100644 index 00000000..6437f3e0 --- /dev/null +++ b/test/test-status-bar.html @@ -0,0 +1,82 @@ + + + + + TableFilter status bar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
+ + + +
+
+ + \ No newline at end of file diff --git a/test/test-status-bar.js b/test/test-status-bar.js new file mode 100644 index 00000000..8dfdf7c2 --- /dev/null +++ b/test/test-status-bar.js @@ -0,0 +1,47 @@ +requirejs(['test-config', '../src/core'], function(config, TableFilter){ + + QUnit.start(); + + var StatusBar = require('modules/statusBar').StatusBar, + types = require('types').Types, + dom = require('dom').Dom; + + var tf = new TableFilter('demo', { + status_bar: true + }); + tf.init(); + + var statusBar = tf.Cpt.statusBar; + module('Sanity checks'); + test('Status bar component', function() { + deepEqual(statusBar instanceof StatusBar, true, 'StatusBar type'); + notEqual(statusBar.statusBarDiv, null, 'statusBarDiv property'); + }); + + module('UI elements'); + test('Status bar UI elements', function() { + var container = statusBar.statusBarDiv, + label = statusBar.statusBarSpanText; + deepEqual(container.nodeName, 'DIV', 'Status bar container'); + deepEqual(label.nodeName, 'SPAN', 'Status bar label'); + }); + + module('Destroy'); + test('Remove UI', function() { + statusBar.destroy(); + var container = statusBar.statusBarDiv, + label = statusBar.statusBarSpanText; + deepEqual(container, null, 'Status bar container removed'); + deepEqual(label, null, 'Status bar button removed'); + }); + + test('Re-set UI', function() { + statusBar.statusBarText = '→←'; + statusBar.init(); + + var label = statusBar.statusBarSpanText; + notEqual( + dom.getText(label).indexOf('→←'), -1, 'Status bar text'); + }); + +});