Added Bootstrap pagination style
authorThierry Florac <thierry.florac@onf.fr>
Wed, 11 Mar 2015 12:16:52 +0100
changeset 30 a4a95e733cac
parent 29 cb1e1855f1aa
child 31 c08ec7495e11
Added Bootstrap pagination style
src/pyams_skin/resources/js/myams-dataTables.js
src/pyams_skin/resources/js/myams-dataTables.min.js
--- a/src/pyams_skin/resources/js/myams-dataTables.js	Wed Mar 04 14:09:12 2015 +0100
+++ b/src/pyams_skin/resources/js/myams-dataTables.js	Wed Mar 11 12:16:52 2015 +0100
@@ -218,6 +218,83 @@
 	} );
 
 
+	/**
+	 * Bootstrap style pagination control with only previous/next buttons
+	 */
+	$.extend($.fn.dataTableExt.oPagination, {
+		"bootstrap_prevnext": {
+			"fnInit": function(oSettings, nPaging, fnDraw) {
+				var oLang = oSettings.oLanguage.oPaginate;
+				var fnClickHandler = function (e) {
+					e.preventDefault();
+					if (oSettings.oApi._fnPageChange(oSettings, e.data.action))
+						fnDraw(oSettings);
+				};
+
+				$(nPaging).append(
+					'<ul class="pagination">' +
+						'<li class="first disabled"><a href="#"><i class="fa fa-fw fa-fast-backward"></i></a></li>' +
+						'<li class="prev disabled"><a href="#"><i class="fa fa-fw fa-step-backward"></i></a></li>' +
+						'<li class="next disabled"><a href="#"><i class="fa fa-fw fa-step-forward"></i></a></li>' +
+						'<li class="last disabled"><a href="#"><i class="fa fa-fw fa-fast-forward"></i></a></li>' +
+					'</ul>'
+				);
+				var els = $('a', nPaging);
+				$(els[0]).on('click.DT', { action: "first" }, fnClickHandler);
+				$(els[1]).on('click.DT', { action: "previous" }, fnClickHandler);
+				$(els[2]).on('click.DT', { action: "next" }, fnClickHandler);
+				$(els[3]).on('click.DT', { action: "last" }, fnClickHandler);
+			},
+
+			"fnUpdate": function (oSettings, fnDraw) {
+				var iListLength = 5;
+				var oPaging = oSettings.oInstance.fnPagingInfo();
+				var an = oSettings.aanFeatures.p;
+				var i,
+					j,
+					sClass,
+					iStart,
+					iEnd,
+					iLen,
+					iHalf=Math.floor(iListLength/2);
+
+				if (oPaging.iTotalPages < iListLength) {
+					iStart = 1;
+					iEnd = oPaging.iTotalPages;
+				} else if (oPaging.iPage <= iHalf) {
+					iStart = 1;
+					iEnd = iListLength;
+				} else if (oPaging.iPage >= (oPaging.iTotalPages-iHalf)) {
+					iStart = oPaging.iTotalPages - iListLength + 1;
+					iEnd = oPaging.iTotalPages;
+				} else {
+					iStart = oPaging.iPage - iHalf + 1;
+					iEnd = iStart + iListLength - 1;
+				}
+
+				for (i=0, iLen=an.length ; i<iLen ; i++) {
+					// Add / remove disabled classes from the static elements
+					if (oPaging.iPage === 0) {
+						$('li.first', an[i]).addClass('disabled');
+						$('li.prev', an[i]).addClass('disabled');
+					} else {
+						$('li.prev', an[i]).removeClass('disabled');
+						$('li.first', an[i]).removeClass('disabled');
+					}
+
+					if (oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0) {
+						$('li.last', an[i]).addClass('disabled');
+						$('li.next', an[i]).addClass('disabled');
+					} else {
+						$('li.next', an[i]).removeClass('disabled');
+						$('li.last', an[i]).removeClass('disabled');
+					}
+				}
+			}
+		}
+	});
+
+
 	/*
 	 * TableTools Bootstrap compatibility
 	 * Required TableTools 2.1+
--- a/src/pyams_skin/resources/js/myams-dataTables.min.js	Wed Mar 04 14:09:12 2015 +0100
+++ b/src/pyams_skin/resources/js/myams-dataTables.min.js	Wed Mar 11 12:16:52 2015 +0100
@@ -1,1 +1,1 @@
-(function(b){b.extend(true,b.fn.dataTable.defaults,{sDom:"R<'dt-top-row'CLF>r<'dt-wrapper't><'dt-row dt-bottom-row'<'row'<'col-sm-6'i><'col-sm-6 text-right'p>>",sPaginationType:"bootstrap",oLanguage:{sLengthMenu:"_MENU_",sSearch:"_INPUT_"}});b.extend(b.fn.dataTableExt.oStdClasses,{sWrapper:"dataTables_wrapper form-inline"});b.fn.dataTableExt.oApi.fnPagingInfo=function(d){return{iStart:d._iDisplayStart,iEnd:d.fnDisplayEnd(),iLength:d._iDisplayLength,iTotal:d.fnRecordsTotal(),iFilteredTotal:d.fnRecordsDisplay(),iPage:d._iDisplayLength===-1?0:Math.ceil(d._iDisplayStart/d._iDisplayLength),iTotalPages:d._iDisplayLength===-1?0:Math.ceil(d.fnRecordsDisplay()/d._iDisplayLength)}};b.extend(b.fn.dataTableExt.oPagination,{bootstrap:{fnInit:function(h,e,g){var d=h.oLanguage.oPaginate;var i=function(j){j.preventDefault();if(h.oApi._fnPageChange(h,j.data.action)){g(h)}};b(e).append('<ul class="pagination"><li class="prev disabled"><a href="#">'+d.sPrevious+'</a></li><li class="next disabled"><a href="#">'+d.sNext+"</a></li></ul>");var f=b("a",e);b(f[0]).on("click.DT",{action:"previous"},i);b(f[1]).on("click.DT",{action:"next"},i)},fnUpdate:function(f,o){var p=5;var k=f.oInstance.fnPagingInfo();var n=f.aanFeatures.p;var m,l,h,d,q,g,e=Math.floor(p/2);if(k.iTotalPages<p){d=1;q=k.iTotalPages}else{if(k.iPage<=e){d=1;q=p}else{if(k.iPage>=(k.iTotalPages-e)){d=k.iTotalPages-p+1;q=k.iTotalPages}else{d=k.iPage-e+1;q=d+p-1}}}for(m=0,g=n.length;m<g;m++){b("li:gt(0)",n[m]).filter(":not(:last)").remove();for(l=d;l<=q;l++){h=(l==k.iPage+1)?'class="active"':"";b("<li "+h+'><a href="#">'+l+"</a></li>").insertBefore(b("li:last",n[m])[0]).on("click",function(i){i.preventDefault();f._iDisplayStart=(parseInt(b("a",this).text(),10)-1)*k.iLength;o(f)})}if(k.iPage===0){b("li:first",n[m]).addClass("disabled")}else{b("li:first",n[m]).removeClass("disabled")}if(k.iPage===k.iTotalPages-1||k.iTotalPages===0){b("li:last",n[m]).addClass("disabled")}else{b("li:last",n[m]).removeClass("disabled")}}}}});b.extend(b.fn.dataTableExt.oPagination,{bootstrap_full:{fnInit:function(h,e,g){var d=h.oLanguage.oPaginate;var i=function(j){j.preventDefault();if(h.oApi._fnPageChange(h,j.data.action)){g(h)}};b(e).append('<ul class="pagination"><li class="first disabled"><a href="#">'+d.sFirst+'</a></li><li class="prev disabled"><a href="#">'+d.sPrevious+'</a></li><li class="next disabled"><a href="#">'+d.sNext+'</a></li><li class="last disabled"><a href="#">'+d.sLast+"</a></li></ul>");var f=b("a",e);b(f[0]).on("click.DT",{action:"first"},i);b(f[1]).on("click.DT",{action:"previous"},i);b(f[2]).on("click.DT",{action:"next"},i);b(f[3]).on("click.DT",{action:"last"},i)},fnUpdate:function(f,o){var p=5;var k=f.oInstance.fnPagingInfo();var n=f.aanFeatures.p;var m,l,h,d,g,q,e=Math.floor(p/2);if(k.iTotalPages<p){d=1;q=k.iTotalPages}else{if(k.iPage<=e){d=1;q=p}else{if(k.iPage>=(k.iTotalPages-e)){d=k.iTotalPages-p+1;q=k.iTotalPages}else{d=k.iPage-e+1;q=d+p-1}}}for(m=0,g=n.length;m<g;m++){b("li",n[m]).filter(":not(.first)").filter(":not(.last)").filter(":not(.prev)").filter(":not(.next)").remove();for(l=d;l<=q;l++){h=(l==k.iPage+1)?'class="active"':"";b("<li "+h+'><a href="#">'+l+"</a></li>").insertBefore(b("li.next",n[m])[0]).on("click",function(i){i.preventDefault();f._iDisplayStart=(parseInt(b("a",this).text(),10)-1)*k.iLength;o(f)})}if(k.iPage===0){b("li.first",n[m]).addClass("disabled");b("li.prev",n[m]).addClass("disabled")}else{b("li.prev",n[m]).removeClass("disabled");b("li.first",n[m]).removeClass("disabled")}if(k.iPage===k.iTotalPages-1||k.iTotalPages===0){b("li.last",n[m]).addClass("disabled");b("li.next",n[m]).addClass("disabled")}else{b("li.next",n[m]).removeClass("disabled");b("li.last",n[m]).removeClass("disabled")}}}}});if(b.fn.DataTable.TableTools){b.extend(true,b.fn.DataTable.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default btn-sm",disabled:"disabled"},collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info modal"},select:{row:"active"}});b.extend(true,b.fn.DataTable.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}})}var a=function(f,e){var d=function(h,g){if(!this.CLASS||this.CLASS!="BootstrapLength"){alert("Warning: BootstrapLength must be initialized with the 'new' keyword")}if(typeof(g)=="undefined"){g={}}if(f.fn.dataTable.camelToHungarian){f.fn.dataTable.camelToHungarian(d.defaults,g)}this.s={dt:null,oInit:g,hidden:true,abOriginal:[]};this.dom={wrapper:null,input:null};d.aInstances.push(this);this.s.dt=f.fn.dataTable.Api?new f.fn.dataTable.Api(h).settings()[0]:h;this._fnConstruct(g);return this};d.prototype={input:function(){return this.dom.wrapper},fnRebuild:function(){return this.rebuild()},rebuild:function(){},_fnConstruct:function(n){var o=this;var g=o.s.dt;if(g.oScroll.bInfinite){return}var j=g.sTableId+"_length";var l=f('<select size="1"></select>').attr("name",j);var k,h;var m=g.aLengthMenu;if(m.length==2&&typeof(m[0])=="object"&&typeof(m[1])=="object"){for(k=0,h=m[0].length;k<h;k++){f("<option />").attr("value",m[0][k]).text(m[1][k]).appendTo(l)}}else{for(k=0,h=m.length;k<h;k++){f("<option />").attr("value",m[k]).text(m[k]).appendTo(l)}}var p=f("<div>").addClass(g.oClasses.sLength).append(f("<span></span>").addClass("ams-form").append(f("<label></label>").addClass("select").css("width",60).append(l).append(f("<i></i>"))));if(!g.aanFeatures.L){p.attr("id",g.sTableId+"_length")}this.dom.wrapper=p.get(0);f('select option[value="'+g._iDisplayLength+'"]',p).attr("selected",true);f("select",p).on("change.DT",function(i){var q=f(this).val();var r=g.aanFeatures.L;for(k=0,h=r.length;k<h;k++){if(r[k]!=this.parentNode){f("select",r[k]).val(q)}}g._iDisplayLength=parseInt(q,10);g.oInstance._fnCalculateEnd(g);if(g.fnDisplayEnd()==g.fnRecordsDisplay()){g._iDisplayStart=g.fnDisplayEnd()-g._iDisplayLength;if(g._iDisplayStart<0){g._iDisplayStart=0}}if(g._iDisplayLength==-1){g._iDisplayStart=0}g.oInstance._fnDraw()});f("select",p).attr("aria-controls",g.sTableId)}};d.fnRebuild=function(g){};d.defaults={};d.aInstances=[];d.prototype.CLASS="BootstrapLength";d.VERSION="1.0.0";d.prototype.VERSION=d.VERSION;if((typeof(f.fn.dataTable)=="function")&&(typeof(f.fn.dataTableExt.fnVersionCheck)=="function")&&f.fn.dataTableExt.fnVersionCheck("1.7.0")){f.fn.dataTableExt.aoFeatures.push({fnInit:function(h){var i=h.oInit;var g=new d(h,i.bootstrapLength||i.oBootstrapLength||{});return g.input()},cFeature:"L",sFeature:"BootstrapLength"})}else{alert("Warning: BootstrapLength required DataTables 1.7 or greater...")}f.fn.dataTable.BootstrapLength=d;return d};if(!jQuery.fn.dataTable.BootstrapLength){a(b,b.fn.dataTable)}var c=function(f,e){var d=function(h,g){if(!this.CLASS||this.CLASS!="BootstrapFilter"){alert("Warning: BootstrapFilter must be initialized with the 'new' keyword")}if(typeof(g)=="undefined"){g={}}if(f.fn.dataTable.camelToHungarian){f.fn.dataTable.camelToHungarian(d.defaults,g)}this.s={dt:null,oInit:g,hidden:true,abOriginal:[]};this.dom={wrapper:null,input:null};d.aInstances.push(this);this.s.dt=f.fn.dataTable.Api?new f.fn.dataTable.Api(h).settings()[0]:h;this._fnConstruct(g);return this};d.prototype={input:function(){return this.dom.wrapper},fnRebuild:function(){return this.rebuild()},rebuild:function(){},_fnConstruct:function(m){var h=this;var j=h.s.dt;var g=j.oPreviousSearch;var l='<input type="text">';var i=f("<div>").addClass(j.oClasses.sFilter).html('<div class="input-group"><span class="input-group-addon"><i class="fa fa-search"></i></span>'+l+"</div>");if(!j.aanFeatures.F){i.attr("id",j.sTableId+"_filter")}this.dom.wrapper=i.get(0);var k=f('input[type="text"]',i);i.data("DT_Input",k[0]);k.val(g.sSearch.replace('"',"&quot;")).addClass("form-control").attr("placeholder",j.oLanguage.sSearch).attr("aria-control",j.sTableId).on("keyup.DT",function(q){var s=j.aanFeatures.F;var r=f(this).val();for(var p=0,o=s.length;p<o;p++){if(s[p]!=f(this).parents("div.dataTables_filter")[0]){f(s[p]).data("DT_Input").val(r)}}if(r!=g.sSearch){j.oInstance._fnFilterComplete({sSearch:r,bRegex:g.bRegex,bSmart:g.bSmart,bCaseInsensitive:g.bCaseInsensitive})}}).on("keypress.DT",function(n){if(n.keyCode==13){return false}})}};d.fnRebuild=function(g){};d.defaults={};d.aInstances=[];d.prototype.CLASS="BootstrapFilter";d.VERSION="1.0.0";d.prototype.VERSION=d.VERSION;if((typeof(f.fn.dataTable)=="function")&&(typeof(f.fn.dataTableExt.fnVersionCheck)=="function")&&f.fn.dataTableExt.fnVersionCheck("1.7.0")){f.fn.dataTableExt.aoFeatures.push({fnInit:function(h){var i=h.oInit;var g=new d(h,i.bootstrapFilter||i.oBootstrapFilter||{});return g.input()},cFeature:"F",sFeature:"BootstrapFilter"})}else{alert("Warning: BootstrapFilter required DataTables 1.7 or greater...")}f.fn.dataTable.BootstrapFilter=d;return d};if(!jQuery.fn.dataTable.BootstrapFilter){c(b,b.fn.dataTable)}})(jQuery);
\ No newline at end of file
+(function(b){b.extend(true,b.fn.dataTable.defaults,{sDom:"R<'dt-top-row'CLF>r<'dt-wrapper't><'dt-row dt-bottom-row'<'row'<'col-sm-6'i><'col-sm-6 text-right'p>>",sPaginationType:"bootstrap",oLanguage:{sLengthMenu:"_MENU_",sSearch:"_INPUT_"}});b.extend(b.fn.dataTableExt.oStdClasses,{sWrapper:"dataTables_wrapper form-inline"});b.fn.dataTableExt.oApi.fnPagingInfo=function(d){return{iStart:d._iDisplayStart,iEnd:d.fnDisplayEnd(),iLength:d._iDisplayLength,iTotal:d.fnRecordsTotal(),iFilteredTotal:d.fnRecordsDisplay(),iPage:d._iDisplayLength===-1?0:Math.ceil(d._iDisplayStart/d._iDisplayLength),iTotalPages:d._iDisplayLength===-1?0:Math.ceil(d.fnRecordsDisplay()/d._iDisplayLength)}};b.extend(b.fn.dataTableExt.oPagination,{bootstrap:{fnInit:function(h,e,g){var d=h.oLanguage.oPaginate;var i=function(j){j.preventDefault();if(h.oApi._fnPageChange(h,j.data.action)){g(h)}};b(e).append('<ul class="pagination"><li class="prev disabled"><a href="#">'+d.sPrevious+'</a></li><li class="next disabled"><a href="#">'+d.sNext+"</a></li></ul>");var f=b("a",e);b(f[0]).on("click.DT",{action:"previous"},i);b(f[1]).on("click.DT",{action:"next"},i)},fnUpdate:function(f,o){var p=5;var k=f.oInstance.fnPagingInfo();var n=f.aanFeatures.p;var m,l,h,d,q,g,e=Math.floor(p/2);if(k.iTotalPages<p){d=1;q=k.iTotalPages}else{if(k.iPage<=e){d=1;q=p}else{if(k.iPage>=(k.iTotalPages-e)){d=k.iTotalPages-p+1;q=k.iTotalPages}else{d=k.iPage-e+1;q=d+p-1}}}for(m=0,g=n.length;m<g;m++){b("li:gt(0)",n[m]).filter(":not(:last)").remove();for(l=d;l<=q;l++){h=(l==k.iPage+1)?'class="active"':"";b("<li "+h+'><a href="#">'+l+"</a></li>").insertBefore(b("li:last",n[m])[0]).on("click",function(i){i.preventDefault();f._iDisplayStart=(parseInt(b("a",this).text(),10)-1)*k.iLength;o(f)})}if(k.iPage===0){b("li:first",n[m]).addClass("disabled")}else{b("li:first",n[m]).removeClass("disabled")}if(k.iPage===k.iTotalPages-1||k.iTotalPages===0){b("li:last",n[m]).addClass("disabled")}else{b("li:last",n[m]).removeClass("disabled")}}}}});b.extend(b.fn.dataTableExt.oPagination,{bootstrap_full:{fnInit:function(h,e,g){var d=h.oLanguage.oPaginate;var i=function(j){j.preventDefault();if(h.oApi._fnPageChange(h,j.data.action)){g(h)}};b(e).append('<ul class="pagination"><li class="first disabled"><a href="#">'+d.sFirst+'</a></li><li class="prev disabled"><a href="#">'+d.sPrevious+'</a></li><li class="next disabled"><a href="#">'+d.sNext+'</a></li><li class="last disabled"><a href="#">'+d.sLast+"</a></li></ul>");var f=b("a",e);b(f[0]).on("click.DT",{action:"first"},i);b(f[1]).on("click.DT",{action:"previous"},i);b(f[2]).on("click.DT",{action:"next"},i);b(f[3]).on("click.DT",{action:"last"},i)},fnUpdate:function(f,o){var p=5;var k=f.oInstance.fnPagingInfo();var n=f.aanFeatures.p;var m,l,h,d,g,q,e=Math.floor(p/2);if(k.iTotalPages<p){d=1;q=k.iTotalPages}else{if(k.iPage<=e){d=1;q=p}else{if(k.iPage>=(k.iTotalPages-e)){d=k.iTotalPages-p+1;q=k.iTotalPages}else{d=k.iPage-e+1;q=d+p-1}}}for(m=0,g=n.length;m<g;m++){b("li",n[m]).filter(":not(.first)").filter(":not(.last)").filter(":not(.prev)").filter(":not(.next)").remove();for(l=d;l<=q;l++){h=(l==k.iPage+1)?'class="active"':"";b("<li "+h+'><a href="#">'+l+"</a></li>").insertBefore(b("li.next",n[m])[0]).on("click",function(i){i.preventDefault();f._iDisplayStart=(parseInt(b("a",this).text(),10)-1)*k.iLength;o(f)})}if(k.iPage===0){b("li.first",n[m]).addClass("disabled");b("li.prev",n[m]).addClass("disabled")}else{b("li.prev",n[m]).removeClass("disabled");b("li.first",n[m]).removeClass("disabled")}if(k.iPage===k.iTotalPages-1||k.iTotalPages===0){b("li.last",n[m]).addClass("disabled");b("li.next",n[m]).addClass("disabled")}else{b("li.next",n[m]).removeClass("disabled");b("li.last",n[m]).removeClass("disabled")}}}}});b.extend(b.fn.dataTableExt.oPagination,{bootstrap_prevnext:{fnInit:function(h,e,g){var d=h.oLanguage.oPaginate;var i=function(j){j.preventDefault();if(h.oApi._fnPageChange(h,j.data.action)){g(h)}};b(e).append('<ul class="pagination"><li class="first disabled"><a href="#"><i class="fa fa-fw fa-fast-backward"></i></a></li><li class="prev disabled"><a href="#"><i class="fa fa-fw fa-step-backward"></i></a></li><li class="next disabled"><a href="#"><i class="fa fa-fw fa-step-forward"></i></a></li><li class="last disabled"><a href="#"><i class="fa fa-fw fa-fast-forward"></i></a></li></ul>');var f=b("a",e);b(f[0]).on("click.DT",{action:"first"},i);b(f[1]).on("click.DT",{action:"previous"},i);b(f[2]).on("click.DT",{action:"next"},i);b(f[3]).on("click.DT",{action:"last"},i)},fnUpdate:function(f,o){var p=5;var k=f.oInstance.fnPagingInfo();var n=f.aanFeatures.p;var m,l,h,d,q,g,e=Math.floor(p/2);if(k.iTotalPages<p){d=1;q=k.iTotalPages}else{if(k.iPage<=e){d=1;q=p}else{if(k.iPage>=(k.iTotalPages-e)){d=k.iTotalPages-p+1;q=k.iTotalPages}else{d=k.iPage-e+1;q=d+p-1}}}for(m=0,g=n.length;m<g;m++){if(k.iPage===0){b("li.first",n[m]).addClass("disabled");b("li.prev",n[m]).addClass("disabled")}else{b("li.prev",n[m]).removeClass("disabled");b("li.first",n[m]).removeClass("disabled")}if(k.iPage===k.iTotalPages-1||k.iTotalPages===0){b("li.last",n[m]).addClass("disabled");b("li.next",n[m]).addClass("disabled")}else{b("li.next",n[m]).removeClass("disabled");b("li.last",n[m]).removeClass("disabled")}}}}});if(b.fn.DataTable.TableTools){b.extend(true,b.fn.DataTable.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default btn-sm",disabled:"disabled"},collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info modal"},select:{row:"active"}});b.extend(true,b.fn.DataTable.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}})}var a=function(f,e){var d=function(h,g){if(!this.CLASS||this.CLASS!="BootstrapLength"){alert("Warning: BootstrapLength must be initialized with the 'new' keyword")}if(typeof(g)=="undefined"){g={}}if(f.fn.dataTable.camelToHungarian){f.fn.dataTable.camelToHungarian(d.defaults,g)}this.s={dt:null,oInit:g,hidden:true,abOriginal:[]};this.dom={wrapper:null,input:null};d.aInstances.push(this);this.s.dt=f.fn.dataTable.Api?new f.fn.dataTable.Api(h).settings()[0]:h;this._fnConstruct(g);return this};d.prototype={input:function(){return this.dom.wrapper},fnRebuild:function(){return this.rebuild()},rebuild:function(){},_fnConstruct:function(n){var o=this;var g=o.s.dt;if(g.oScroll.bInfinite){return}var j=g.sTableId+"_length";var l=f('<select size="1"></select>').attr("name",j);var k,h;var m=g.aLengthMenu;if(m.length==2&&typeof(m[0])=="object"&&typeof(m[1])=="object"){for(k=0,h=m[0].length;k<h;k++){f("<option />").attr("value",m[0][k]).text(m[1][k]).appendTo(l)}}else{for(k=0,h=m.length;k<h;k++){f("<option />").attr("value",m[k]).text(m[k]).appendTo(l)}}var p=f("<div>").addClass(g.oClasses.sLength).append(f("<span></span>").addClass("ams-form").append(f("<label></label>").addClass("select").css("width",60).append(l).append(f("<i></i>"))));if(!g.aanFeatures.L){p.attr("id",g.sTableId+"_length")}this.dom.wrapper=p.get(0);f('select option[value="'+g._iDisplayLength+'"]',p).attr("selected",true);f("select",p).on("change.DT",function(i){var q=f(this).val();var r=g.aanFeatures.L;for(k=0,h=r.length;k<h;k++){if(r[k]!=this.parentNode){f("select",r[k]).val(q)}}g._iDisplayLength=parseInt(q,10);g.oInstance._fnCalculateEnd(g);if(g.fnDisplayEnd()==g.fnRecordsDisplay()){g._iDisplayStart=g.fnDisplayEnd()-g._iDisplayLength;if(g._iDisplayStart<0){g._iDisplayStart=0}}if(g._iDisplayLength==-1){g._iDisplayStart=0}g.oInstance._fnDraw()});f("select",p).attr("aria-controls",g.sTableId)}};d.fnRebuild=function(g){};d.defaults={};d.aInstances=[];d.prototype.CLASS="BootstrapLength";d.VERSION="1.0.0";d.prototype.VERSION=d.VERSION;if((typeof(f.fn.dataTable)=="function")&&(typeof(f.fn.dataTableExt.fnVersionCheck)=="function")&&f.fn.dataTableExt.fnVersionCheck("1.7.0")){f.fn.dataTableExt.aoFeatures.push({fnInit:function(h){var i=h.oInit;var g=new d(h,i.bootstrapLength||i.oBootstrapLength||{});return g.input()},cFeature:"L",sFeature:"BootstrapLength"})}else{alert("Warning: BootstrapLength required DataTables 1.7 or greater...")}f.fn.dataTable.BootstrapLength=d;return d};if(!jQuery.fn.dataTable.BootstrapLength){a(b,b.fn.dataTable)}var c=function(f,e){var d=function(h,g){if(!this.CLASS||this.CLASS!="BootstrapFilter"){alert("Warning: BootstrapFilter must be initialized with the 'new' keyword")}if(typeof(g)=="undefined"){g={}}if(f.fn.dataTable.camelToHungarian){f.fn.dataTable.camelToHungarian(d.defaults,g)}this.s={dt:null,oInit:g,hidden:true,abOriginal:[]};this.dom={wrapper:null,input:null};d.aInstances.push(this);this.s.dt=f.fn.dataTable.Api?new f.fn.dataTable.Api(h).settings()[0]:h;this._fnConstruct(g);return this};d.prototype={input:function(){return this.dom.wrapper},fnRebuild:function(){return this.rebuild()},rebuild:function(){},_fnConstruct:function(m){var h=this;var j=h.s.dt;var g=j.oPreviousSearch;var l='<input type="text">';var i=f("<div>").addClass(j.oClasses.sFilter).html('<div class="input-group"><span class="input-group-addon"><i class="fa fa-search"></i></span>'+l+"</div>");if(!j.aanFeatures.F){i.attr("id",j.sTableId+"_filter")}this.dom.wrapper=i.get(0);var k=f('input[type="text"]',i);i.data("DT_Input",k[0]);k.val(g.sSearch.replace('"',"&quot;")).addClass("form-control").attr("placeholder",j.oLanguage.sSearch).attr("aria-control",j.sTableId).on("keyup.DT",function(q){var s=j.aanFeatures.F;var r=f(this).val();for(var p=0,o=s.length;p<o;p++){if(s[p]!=f(this).parents("div.dataTables_filter")[0]){f(s[p]).data("DT_Input").val(r)}}if(r!=g.sSearch){j.oInstance._fnFilterComplete({sSearch:r,bRegex:g.bRegex,bSmart:g.bSmart,bCaseInsensitive:g.bCaseInsensitive})}}).on("keypress.DT",function(n){if(n.keyCode==13){return false}})}};d.fnRebuild=function(g){};d.defaults={};d.aInstances=[];d.prototype.CLASS="BootstrapFilter";d.VERSION="1.0.0";d.prototype.VERSION=d.VERSION;if((typeof(f.fn.dataTable)=="function")&&(typeof(f.fn.dataTableExt.fnVersionCheck)=="function")&&f.fn.dataTableExt.fnVersionCheck("1.7.0")){f.fn.dataTableExt.aoFeatures.push({fnInit:function(h){var i=h.oInit;var g=new d(h,i.bootstrapFilter||i.oBootstrapFilter||{});return g.input()},cFeature:"F",sFeature:"BootstrapFilter"})}else{alert("Warning: BootstrapFilter required DataTables 1.7 or greater...")}f.fn.dataTable.BootstrapFilter=d;return d};if(!jQuery.fn.dataTable.BootstrapFilter){c(b,b.fn.dataTable)}})(jQuery);
\ No newline at end of file