foo_table-rails 2.0.1 → 2.0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03b05aa8a185ac11fdc92efcc7881b35e82be708
4
- data.tar.gz: 6d4707307e7b3f3bdb7d7cd7dfb1f37d39b60577
3
+ metadata.gz: a4bf5b57cbe5a913d4d57f55c3c70c428a0e6da4
4
+ data.tar.gz: bf23b37fa124411f3bdbc6551550ddf6d875175a
5
5
  SHA512:
6
- metadata.gz: 5f4f02c225c6cbbbf66a6cbbb55604098b2b3f0c5835702b79c8cb3326e66e2f3e454aec928abf39284035a05bb8e9fe99a387d02f59727fb254b7a5c43296b9
7
- data.tar.gz: e19334e96c13c5e2849d02371c73cdaa83f4e12d7fc4f85e7775a1860ed81cdcb6983d14bb97ead076416c032762ba189480bbbd7db5f71825381ddfa51e5c58
6
+ metadata.gz: 6531b151cfe80bf1a0af7e8ecaa5b20e38ed5f0fa35b8369af0ed8ef640364dbe3a6e2093febdd88cc91399486df568548417e09df9e1355bbfccebb8296f784
7
+ data.tar.gz: 8b3f72ccc3488178c14a3b4457681bd29f971b4c7a811caf7b9185dbcdd39297b015c5d4a0ad6b906e6ae5c2f3b5ee4052e4b20fb7584e0ce6a5b1b79850f261
data/README.md CHANGED
@@ -25,6 +25,9 @@ probably want the following in your application.js and application.css:
25
25
 
26
26
  ```js
27
27
  //= require footable.core
28
+ // ... and plugins ...
29
+ // or...
30
+ //= require footable.all
28
31
  ```
29
32
 
30
33
  ```css
@@ -1,5 +1,5 @@
1
1
  module FooTable
2
2
  module Rails
3
- VERSION = '2.0.1'
3
+ VERSION = '2.0.1.3'
4
4
  end
5
5
  end
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * FooTable - Awesome Responsive Tables
3
+ * Version : 2.0.1.3
4
+ * http://fooplugins.com/plugins/footable-jquery/
5
+ *
6
+ * Requires jQuery - http://jquery.com/
7
+ *
8
+ * Copyright 2013 Steven Usher & Brad Vincent
9
+ * Released under the MIT license
10
+ * You are free to use FooTable in commercial projects as long as this copyright header is left intact.
11
+ *
12
+ * Date: 21 Sep 2013
13
+ */
14
+ (function(e,t){function a(){var e=this;e.id=null,e.busy=!1,e.start=function(t,a){e.busy||(e.stop(),e.id=setTimeout(function(){t(),e.id=null,e.busy=!1},a),e.busy=!0)},e.stop=function(){null!==e.id&&(clearTimeout(e.id),e.id=null,e.busy=!1)}}function o(o,i,n){var r=this;r.id=n,r.table=o,r.options=i,r.breakpoints=[],r.breakpointNames="",r.columns={},r.plugins=t.footable.plugins.load(r);var l=r.options,d=l.classes,s=l.events,u=l.triggers,f=0;return r.timers={resize:new a,register:function(e){return r.timers[e]=new a,r.timers[e]}},r.init=function(){var a=e(t),o=e(r.table);if(t.footable.plugins.init(r),o.hasClass(d.loaded))return r.raise(s.alreadyInitialized),undefined;r.raise(s.initializing),o.addClass(d.loading),o.find(l.columnDataSelector).each(function(){var e=r.getColumnData(this);r.columns[e.index]=e});for(var i in l.breakpoints)r.breakpoints.push({name:i,width:l.breakpoints[i]}),r.breakpointNames+=i+" ";r.breakpoints.sort(function(e,t){return e.width-t.width}),o.unbind(u.initialize).bind(u.initialize,function(){o.removeData("footable_info"),o.data("breakpoint",""),o.trigger(u.resize),o.removeClass(d.loading),o.addClass(d.loaded).addClass(d.main),r.raise(s.initialized)}).unbind(u.redraw).bind(u.redraw,function(){r.redraw()}).unbind(u.resize).bind(u.resize,function(){r.resize()}).unbind(u.expandFirstRow).bind(u.expandFirstRow,function(){o.find(l.toggleSelector).first().not("."+d.detailShow).trigger(u.toggleRow)}).unbind(u.expandAll).bind(u.expandAll,function(){o.find(l.toggleSelector).not("."+d.detailShow).trigger(u.toggleRow)}).unbind(u.collapseAll).bind(u.collapseAll,function(){o.find("."+d.detailShow).trigger(u.toggleRow)}),o.trigger(u.initialize),a.bind("resize.footable",function(){r.timers.resize.stop(),r.timers.resize.start(function(){r.raise(u.resize)},l.delay)})},r.addRowToggle=function(){if(l.addRowToggle){var t=e(r.table),a=!1;t.find("span."+d.toggle).remove();for(var o in r.columns){var i=r.columns[o];if(i.toggle){a=!0;var n="> tbody > tr:not(."+d.detail+",."+d.disabled+") > td:nth-child("+(parseInt(i.index,10)+1)+")";return t.find(n).not("."+d.detailCell).prepend(e(l.toggleHTMLElement).addClass(d.toggle)),undefined}}a||t.find("> tbody > tr:not(."+d.detail+",."+d.disabled+") > td:first-child").not("."+d.detailCell).prepend(e(l.toggleHTMLElement).addClass(d.toggle))}},r.setColumnClasses=function(){$table=e(r.table);for(var t in r.columns){var a=r.columns[t];if(null!==a.className){var o="",i=!0;e.each(a.matches,function(e,t){i||(o+=", "),o+="> tbody > tr:not(."+d.detail+") > td:nth-child("+(parseInt(t,10)+1)+")",i=!1}),$table.find(o).not("."+d.detailCell).addClass(a.className)}}},r.bindToggleSelectors=function(){var t=e(r.table);r.hasAnyBreakpointColumn()&&(t.find(l.toggleSelector).unbind(u.toggleRow).bind(u.toggleRow,function(){var t=e(this).is("tr")?e(this):e(this).parents("tr:first");r.toggleDetail(t)}),t.find(l.toggleSelector).unbind("click.footable").bind("click.footable",function(a){t.is(".breakpoint")&&e(a.target).is("td,."+d.toggle)&&e(this).trigger(u.toggleRow)}))},r.parse=function(e,t){var a=l.parsers[t.type]||l.parsers.alpha;return a(e)},r.getColumnData=function(t){var a=e(t),o=a.data("hide"),i=a.index();o=o||"",o=jQuery.map(o.split(","),function(e){return jQuery.trim(e)});var n={index:i,hide:{},type:a.data("type")||"alpha",name:a.data("name")||e.trim(a.text()),ignore:a.data("ignore")||!1,toggle:a.data("toggle")||!1,className:a.data("class")||null,matches:[],names:{},group:a.data("group")||null,groupName:null};if(null!==n.group){var d=e(r.table).find('> thead > tr.footable-group-row > th[data-group="'+n.group+'"], > thead > tr.footable-group-row > td[data-group="'+n.group+'"]').first();n.groupName=r.parse(d,{type:"alpha"})}var u=parseInt(a.prev().attr("colspan")||0,10);f+=u>1?u-1:0;var p=parseInt(a.attr("colspan")||0,10),c=n.index+f;if(p>1){var g=a.data("names");g=g||"",g=g.split(",");for(var b=0;p>b;b++)n.matches.push(b+c),g.length>b&&(n.names[b+c]=g[b])}else n.matches.push(c);n.hide["default"]="all"===a.data("hide")||e.inArray("default",o)>=0;var h=!1;for(var m in l.breakpoints)n.hide[m]="all"===a.data("hide")||e.inArray(m,o)>=0,h=h||n.hide[m];n.hasBreakpoint=h;var v=r.raise(s.columnData,{column:{data:n,th:t}});return v.column.data},r.getViewportWidth=function(){return window.innerWidth||(document.body?document.body.offsetWidth:0)},r.calculateWidth=function(e,t){return jQuery.isFunction(l.calculateWidthOverride)?l.calculateWidthOverride(e,t):(t.viewportWidth<t.width&&(t.width=t.viewportWidth),t.parentWidth<t.width&&(t.width=t.parentWidth),t)},r.hasBreakpointColumn=function(e){for(var t in r.columns)if(r.columns[t].hide[e]){if(r.columns[t].ignore)continue;return!0}return!1},r.hasAnyBreakpointColumn=function(){for(var e in r.columns)if(r.columns[e].hasBreakpoint)return!0;return!1},r.resize=function(){var t=e(r.table);if(t.is(":visible")&&r.hasAnyBreakpointColumn()){var a={width:t.width(),viewportWidth:r.getViewportWidth(),parentWidth:t.parent().width()};a=r.calculateWidth(t,a);var o=t.data("footable_info");if(t.data("footable_info",a),r.raise(s.resizing,{old:o,info:a}),!o||o&&o.width&&o.width!==a.width){for(var i,n=null,l=0;r.breakpoints.length>l;l++)if(i=r.breakpoints[l],i&&i.width&&a.width<=i.width){n=i;break}var d=null===n?"default":n.name,f=r.hasBreakpointColumn(d),p=t.data("breakpoint");t.data("breakpoint",d).removeClass("default breakpoint").removeClass(r.breakpointNames).addClass(d+(f?" breakpoint":"")),d!==p&&(t.trigger(u.redraw),r.raise(s.breakpoint,{breakpoint:d,info:a}))}r.raise(s.resized,{old:o,info:a})}},r.redraw=function(){r.addRowToggle(),r.bindToggleSelectors(),r.setColumnClasses();var t=e(r.table),a=t.data("breakpoint"),o=r.hasBreakpointColumn(a);t.find("> tbody > tr:not(."+d.detail+")").data("detail_created",!1).end().find("> thead > tr:last-child > th").each(function(){var o=r.columns[e(this).index()],i="",n=!0;e.each(o.matches,function(e,t){n||(i+=", ");var a=t+1;i+="> tbody > tr:not(."+d.detail+") > td:nth-child("+a+")",i+=", > tfoot > tr:not(."+d.detail+") > td:nth-child("+a+")",i+=", > colgroup > col:nth-child("+a+")",n=!1}),i+=', > thead > tr[data-group-row="true"] > th[data-group="'+o.group+'"]';var l=t.find(i).add(this);if(""!==a&&(o.hide[a]===!1?l.addClass("footable-visible").show():l.removeClass("footable-visible").hide()),1===t.find("> thead > tr.footable-group-row").length){var s=t.find('> thead > tr:last-child > th[data-group="'+o.group+'"]:visible, > thead > tr:last-child > th[data-group="'+o.group+'"]:visible'),u=t.find('> thead > tr.footable-group-row > th[data-group="'+o.group+'"], > thead > tr.footable-group-row > td[data-group="'+o.group+'"]'),f=0;e.each(s,function(){f+=parseInt(e(this).attr("colspan")||1,10)}),f>0?u.attr("colspan",f).show():u.hide()}}).end().find("> tbody > tr."+d.detailShow).each(function(){r.createOrUpdateDetailRow(this)}),t.find("> tbody > tr."+d.detailShow+".footable-visible").each(function(){var t=e(this).next();t.hasClass(d.detail)&&(o?t.show():t.hide())}),t.find("> thead > tr > th.footable-last-column, > tbody > tr > td.footable-last-column").removeClass("footable-last-column"),t.find("> thead > tr > th.footable-first-column, > tbody > tr > td.footable-first-column").removeClass("footable-first-column"),t.find("> thead > tr, > tbody > tr").find("> th.footable-visible:last, > td.footable-visible:last").addClass("footable-last-column").end().find("> th.footable-visible:first, > td.footable-visible:first").addClass("footable-first-column"),r.raise(s.redrawn)},r.toggleDetail=function(t){var a=t.jquery?t:e(t),o=a.next();a.hasClass(d.detailShow)?(a.removeClass(d.detailShow),o.hasClass(d.detail)&&o.hide(),r.raise(s.rowCollapsed,{row:a[0]})):(r.createOrUpdateDetailRow(a[0]),a.addClass(d.detailShow).next().show(),r.raise(s.rowExpanded,{row:a[0]}))},r.removeRow=function(t){var a=t.jquery?t:e(t);a.hasClass(d.detail)&&(a=a.prev());var o=a.next();a.data("detail_created")===!0&&o.remove(),a.remove(),r.raise(s.rowRemoved)},r.appendRow=function(t){var a=t.jquery?t:e(t);e(r.table).find("tbody").append(a),r.redraw()},r.getColumnFromTdIndex=function(t){var a=null;for(var o in r.columns)if(e.inArray(t,r.columns[o].matches)>=0){a=r.columns[o];break}return a},r.createOrUpdateDetailRow=function(t){var a,o=e(t),i=o.next(),n=[];if(o.data("detail_created")===!0)return!0;if(o.is(":hidden"))return!1;if(r.raise(s.rowDetailUpdating,{row:o,detail:i}),o.find("> td:hidden").each(function(){var t=e(this).index(),a=r.getColumnFromTdIndex(t),o=a.name;return a.ignore===!0?!0:(t in a.names&&(o=a.names[t]),n.push({name:o,value:r.parse(this,a),display:e.trim(e(this).html()),group:a.group,groupName:a.groupName}),!0)}),0===n.length)return!1;var u=o.find("> td:visible").length,f=i.hasClass(d.detail);return f||(i=e('<tr class="'+d.detail+'"><td class="'+d.detailCell+'"><div class="'+d.detailInner+'"></div></td></tr>'),o.after(i)),i.find("> td:first").attr("colspan",u),a=i.find("."+d.detailInner).empty(),l.createDetail(a,n,l.createGroupedDetail,l.detailSeparator,d),o.data("detail_created",!0),r.raise(s.rowDetailUpdated,{row:o,detail:i}),!f},r.raise=function(t,a){r.options.debug===!0&&e.isFunction(r.options.log)&&r.options.log(t,"event"),a=a||{};var o={ft:r};e.extend(!0,o,a);var i=e.Event(t,o);return i.ft||e.extend(!0,i,o),e(r.table).trigger(i),i},r.reset=function(){var t=e(r.table);t.removeData("footable_info").data("breakpoint","").removeClass(d.loading).removeClass(d.loaded),t.find(l.toggleSelector).unbind(u.toggleRow).unbind("click.footable"),t.find("> tbody > tr").removeClass(d.detailShow),t.find("> tbody > tr."+d.detail).remove(),r.raise(s.reset)},r.init(),r}t.footable={options:{delay:100,breakpoints:{phone:480,tablet:1024},parsers:{alpha:function(t){return e(t).data("value")||e.trim(e(t).text())},numeric:function(t){var a=e(t).data("value")||e(t).text().replace(/[^0-9.\-]/g,"");return a=parseFloat(a),isNaN(a)&&(a=0),a}},addRowToggle:!0,calculateWidthOverride:null,toggleSelector:" > tbody > tr:not(.footable-row-detail)",columnDataSelector:"> thead > tr:last-child > th, > thead > tr:last-child > td",detailSeparator:":",toggleHTMLElement:"<span />",createGroupedDetail:function(e){for(var t={_none:{name:null,data:[]}},a=0;e.length>a;a++){var o=e[a].group;null!==o?(o in t||(t[o]={name:e[a].groupName||e[a].group,data:[]}),t[o].data.push(e[a])):t._none.data.push(e[a])}return t},createDetail:function(e,t,a,o,i){var n=a(t);for(var r in n)if(0!==n[r].data.length){"_none"!==r&&e.append('<div class="'+i.detailInnerGroup+'">'+n[r].name+"</div>");for(var l=0;n[r].data.length>l;l++){var d=n[r].data[l].name?o:"";e.append('<div class="'+i.detailInnerRow+'"><div class="'+i.detailInnerName+'">'+n[r].data[l].name+d+'</div><div class="'+i.detailInnerValue+'">'+n[r].data[l].display+"</div></div>")}}},classes:{main:"footable",loading:"footable-loading",loaded:"footable-loaded",toggle:"footable-toggle",disabled:"footable-disabled",detail:"footable-row-detail",detailCell:"footable-row-detail-cell",detailInner:"footable-row-detail-inner",detailInnerRow:"footable-row-detail-row",detailInnerGroup:"footable-row-detail-group",detailInnerName:"footable-row-detail-name",detailInnerValue:"footable-row-detail-value",detailShow:"footable-detail-show"},triggers:{initialize:"footable_initialize",resize:"footable_resize",redraw:"footable_redraw",toggleRow:"footable_toggle_row",expandFirstRow:"footable_expand_first_row",expandAll:"footable_expand_all",collapseAll:"footable_collapse_all"},events:{alreadyInitialized:"footable_already_initialized",initializing:"footable_initializing",initialized:"footable_initialized",resizing:"footable_resizing",resized:"footable_resized",redrawn:"footable_redrawn",breakpoint:"footable_breakpoint",columnData:"footable_column_data",rowDetailUpdating:"footable_row_detail_updating",rowDetailUpdated:"footable_row_detail_updated",rowCollapsed:"footable_row_collapsed",rowExpanded:"footable_row_expanded",rowRemoved:"footable_row_removed",reset:"footable_reset"},debug:!1,log:null},version:{major:0,minor:5,toString:function(){return t.footable.version.major+"."+t.footable.version.minor},parse:function(e){return version=/(\d+)\.?(\d+)?\.?(\d+)?/.exec(e),{major:parseInt(version[1],10)||0,minor:parseInt(version[2],10)||0,patch:parseInt(version[3],10)||0}}},plugins:{_validate:function(a){if(!e.isFunction(a))return t.footable.options.debug===!0&&console.error('Validation failed, expected type "function", received type "{0}".',typeof a),!1;var o=new a;return"string"!=typeof o.name?(t.footable.options.debug===!0&&console.error('Validation failed, plugin does not implement a string property called "name".',o),!1):e.isFunction(o.init)?(t.footable.options.debug===!0&&console.log('Validation succeeded for plugin "'+o.name+'".',o),!0):(t.footable.options.debug===!0&&console.error('Validation failed, plugin "'+o.name+'" does not implement a function called "init".',o),!1)},registered:[],register:function(a,o){t.footable.plugins._validate(a)&&(t.footable.plugins.registered.push(a),"object"==typeof o&&e.extend(!0,t.footable.options,o))},load:function(e){var a,o,i=[];for(o=0;t.footable.plugins.registered.length>o;o++)try{a=t.footable.plugins.registered[o],i.push(new a(e))}catch(n){t.footable.options.debug===!0&&console.error(n)}return i},init:function(e){for(var a=0;e.plugins.length>a;a++)try{e.plugins[a].init(e)}catch(o){t.footable.options.debug===!0&&console.error(o)}}}};var i=0;e.fn.footable=function(a){a=a||{};var n=e.extend(!0,{},t.footable.options,a);return this.each(function(){i++;var t=new o(this,n,i);e(this).data("footable",t)})}})(jQuery,window);;(function(e,t,undefined){function a(){var t=this;t.name="Footable Filter",t.init=function(a){if(t.footable=a,a.options.filter.enabled===!0){if(e(a.table).data("filter")===!1)return;a.timers.register("filter"),e(a.table).unbind(".filtering").bind({"footable_initialized.filtering":function(){var i=e(a.table),o={input:i.data("filter")||a.options.filter.input,timeout:i.data("filter-timeout")||a.options.filter.timeout,minimum:i.data("filter-minimum")||a.options.filter.minimum,disableEnter:i.data("filter-disable-enter")||a.options.filter.disableEnter};o.disableEnter&&e(o.input).keypress(function(e){return window.event?13!==window.event.keyCode:13!==e.which}),i.bind("footable_clear_filter",function(){e(o.input).val(""),t.clearFilter()}),i.bind("footable_filter",function(e,a){t.filter(a.filter)}),e(o.input).keyup(function(i){a.timers.filter.stop(),27===i.which&&e(o.input).val(""),a.timers.filter.start(function(){var a=e(o.input).val()||"";t.filter(a)},o.timeout)})},"footable_redrawn.filtering":function(){var i=e(a.table),o=i.data("filter-string");o&&t.filter(o)}}).data("footable-filter",t)}},t.filter=function(a){var i=t.footable,o=e(i.table),n=o.data("filter-minimum")||i.options.filter.minimum,r=!a,l=i.raise("footable_filtering",{filter:a,clear:r});if(!(l&&l.result===!1||l.filter&&n>l.filter.length))if(l.clear)t.clearFilter();else{var d=l.filter.split(" ");o.find("> tbody > tr").hide().addClass("footable-filtered");var s=o.find("> tbody > tr:not(.footable-row-detail)");e.each(d,function(e,t){t&&t.length>0&&(o.data("current-filter",t),s=s.filter(i.options.filter.filterFunction))}),s.each(function(){t.showRow(this,i),e(this).removeClass("footable-filtered")}),o.data("filter-string",l.filter),i.raise("footable_filtered",{filter:l.filter,clear:!1})}},t.clearFilter=function(){var a=t.footable,i=e(a.table);i.find("> tbody > tr:not(.footable-row-detail)").removeClass("footable-filtered").each(function(){t.showRow(this,a)}),i.removeData("filter-string"),a.raise("footable_filtered",{clear:!0})},t.showRow=function(t,a){var i=e(t),o=i.next(),n=e(a.table);i.is(":visible")||(n.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(t)):i.show())}}if(t.footable===undefined||null===t.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={filter:{enabled:!0,input:".footable-filter",timeout:300,minimum:2,disableEnter:!1,filterFunction:function(){var t=e(this),a=t.parents("table:first"),i=a.data("current-filter").toUpperCase(),o=t.find("td").text();return a.data("filter-text-only")||t.find("td[data-value]").each(function(){o+=e(this).data("value")}),o.toUpperCase().indexOf(i)>=0}}};t.footable.plugins.register(a,i)})(jQuery,window);;(function(e,t,undefined){function a(t){var a=e(t.table),i=a.data();this.pageNavigation=i.pageNavigation||t.options.pageNavigation,this.pageSize=i.pageSize||t.options.pageSize,this.firstText=i.firstText||t.options.firstText,this.previousText=i.previousText||t.options.previousText,this.nextText=i.nextText||t.options.nextText,this.lastText=i.lastText||t.options.lastText,this.limitNavigation=parseInt(i.limitNavigation||t.options.limitNavigation||o.limitNavigation,10),this.limitPreviousText=i.limitPreviousText||t.options.limitPreviousText,this.limitNextText=i.limitNextText||t.options.limitNextText,this.limit=this.limitNavigation>0,this.currentPage=0,this.pages=[],this.control=!1}function i(){var t=this;t.name="Footable Paginate",t.init=function(a){if(a.options.paginate===!0){if(e(a.table).data("page")===!1)return;t.footable=a,e(a.table).unbind(".paging").bind({"footable_initialized.paging footable_row_removed.paging footable_redrawn.paging footable_sorted.paging footable_filtered.paging":function(){t.setupPaging()}}).data("footable-paging",t)}},t.setupPaging=function(){var i=t.footable,o=e(i.table).find("> tbody");i.pageInfo=new a(i),t.createPages(i,o),t.createNavigation(i,o),t.fillPage(i,o,i.pageInfo.currentPage)},t.createPages=function(t,a){var i=1,o=t.pageInfo,n=i*o.pageSize,l=[],r=[];o.pages=[];var d=a.find("> tr:not(.footable-filtered,.footable-row-detail)");d.each(function(e,t){l.push(t),e===n-1?(o.pages.push(l),i++,n=i*o.pageSize,l=[]):e>=d.length-d.length%o.pageSize&&r.push(t)}),r.length>0&&o.pages.push(r),o.currentPage>=o.pages.length&&(o.currentPage=o.pages.length-1),0>o.currentPage&&(o.currentPage=0),1===o.pages.length?e(t.table).addClass("no-paging"):e(t.table).removeClass("no-paging")},t.createNavigation=function(a){var i=e(a.table).find(a.pageInfo.pageNavigation);if(0===i.length){if(i=e(a.pageInfo.pageNavigation),i.parents("table:first").length>0&&i.parents("table:first")!==e(a.table))return;i.length>1&&a.options.debug===!0&&console.error("More than one pagination control was found!")}if(0!==i.length){i.is("ul")||(0===i.find("ul:first").length&&i.append("<ul />"),i=i.find("ul")),i.find("li").remove();var o=a.pageInfo;o.control=i,o.pages.length>0&&(i.append('<li class="footable-page-arrow"><a data-page="first" href="#first">'+a.pageInfo.firstText+"</a>"),i.append('<li class="footable-page-arrow"><a data-page="prev" href="#prev">'+a.pageInfo.previousText+"</a></li>"),o.limit&&i.append('<li class="footable-page-arrow"><a data-page="limit-prev" href="#limit-prev">'+a.pageInfo.limitPreviousText+"</a></li>"),o.limit||e.each(o.pages,function(e,t){t.length>0&&i.append('<li class="footable-page"><a data-page="'+e+'" href="#">'+(e+1)+"</a></li>")}),o.limit&&(i.append('<li class="footable-page-arrow"><a data-page="limit-next" href="#limit-next">'+a.pageInfo.limitNextText+"</a></li>"),t.createLimited(i,o,0)),i.append('<li class="footable-page-arrow"><a data-page="next" href="#next">'+a.pageInfo.nextText+"</a></li>"),i.append('<li class="footable-page-arrow"><a data-page="last" href="#last">'+a.pageInfo.lastText+"</a></li>")),i.off("click","a[data-page]").on("click","a[data-page]",function(n){n.preventDefault();var l=e(this).data("page"),r=o.currentPage;if("first"===l)r=0;else if("prev"===l)r>0&&r--;else if("next"===l)o.pages.length-1>r&&r++;else if("last"===l)r=o.pages.length-1;else if("limit-prev"===l){r=-1;var d=i.find(".footable-page:first a").data("page");t.createLimited(i,o,d-o.limitNavigation),t.setPagingClasses(i,o.currentPage,o.pages.length)}else if("limit-next"===l){r=-1;var s=i.find(".footable-page:last a").data("page");t.createLimited(i,o,s+1),t.setPagingClasses(i,o.currentPage,o.pages.length)}else r=l;if(r>=0){if(o.limit&&o.currentPage!=r){for(var f=r;0!==f%o.limitNavigation;)f-=1;t.createLimited(i,o,f)}t.paginate(a,r)}}),t.setPagingClasses(i,o.currentPage,o.pages.length)}},t.createLimited=function(e,t,a){a=a||0,e.find("li.footable-page").remove();var i,o,n=e.find('li.footable-page-arrow > a[data-page="limit-prev"]').parent(),l=e.find('li.footable-page-arrow > a[data-page="limit-next"]').parent();for(i=t.pages.length-1;i>=0;i--)o=t.pages[i],i>=a&&a+t.limitNavigation>i&&o.length>0&&n.after('<li class="footable-page"><a data-page="'+i+'" href="#">'+(i+1)+"</a></li>");0===a?n.hide():n.show(),a+t.limitNavigation>=t.pages.length?l.hide():l.show()},t.paginate=function(a,i){var o=a.pageInfo;if(o.currentPage!==i){var n=e(a.table).find("> tbody"),l=a.raise("footable_paging",{page:i,size:o.pageSize});if(l&&l.result===!1)return;t.fillPage(a,n,i),o.control.find("li").removeClass("active disabled"),t.setPagingClasses(o.control,o.currentPage,o.pages.length)}},t.setPagingClasses=function(e,t,a){e.find("li.footable-page > a[data-page="+t+"]").parent().addClass("active"),t>=a-1&&(e.find('li.footable-page-arrow > a[data-page="next"]').parent().addClass("disabled"),e.find('li.footable-page-arrow > a[data-page="last"]').parent().addClass("disabled")),1>t&&(e.find('li.footable-page-arrow > a[data-page="first"]').parent().addClass("disabled"),e.find('li.footable-page-arrow > a[data-page="prev"]').parent().addClass("disabled"))},t.fillPage=function(a,i,o){a.pageInfo.currentPage=o,i.find("> tr").hide(),e(a.pageInfo.pages[o]).each(function(){t.showRow(this,a)})},t.showRow=function(t,a){var i=e(t),o=i.next(),n=e(a.table);n.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(t)):i.show()}}if(t.footable===undefined||null===t.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var o={paginate:!0,pageSize:10,pageNavigation:".pagination",firstText:"&laquo;",previousText:"&lsaquo;",nextText:"&rsaquo;",lastText:"&raquo;",limitNavigation:0,limitPreviousText:"...",limitNextText:"..."};t.footable.plugins.register(i,o)})(jQuery,window);;(function(e,t,undefined){function a(){var t=this;t.name="Footable Sortable",t.init=function(a){t.footable=a,a.options.sort===!0&&e(a.table).unbind(".sorting").bind({"footable_initialized.sorting":function(){var i,o,n=e(a.table),r=(n.find("> tbody"),a.options.classes.sort);if(n.data("sort")!==!1){n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").each(function(){o=e(this),i=a.columns[o.index()],i.sort.ignore===!0||o.hasClass(r.sortable)||(o.addClass(r.sortable),e("<span />").addClass(r.indicator).appendTo(o))}),n.find("> thead > tr:last-child > th."+r.sortable+", > thead > tr:last-child > td."+r.sortable).unbind("click.footable").bind("click.footable",function(a){a.preventDefault(),o=e(this);var i=!o.hasClass(r.sorted);return t.doSort(o.index(),i),!1});var l=!1;for(var s in a.columns)if(i=a.columns[s],i.sort.initial){var d="descending"!==i.sort.initial;t.doSort(i.index,d);break}l&&a.bindToggleSelectors()}},"footable_redrawn.sorting":function(){var i=e(a.table),o=a.options.classes.sort;i.data("sorted")>=0&&i.find("> thead > tr:last-child > th").each(function(a){var i=e(this);return i.hasClass(o.sorted)||i.hasClass(o.descending)?(t.doSort(a),undefined):undefined})},"footable_column_data.sorting":function(t){var a=e(t.column.th);t.column.data.sort=t.column.data.sort||{},t.column.data.sort.initial=a.data("sort-initial")||!1,t.column.data.sort.ignore=a.data("sort-ignore")||!1,t.column.data.sort.selector=a.data("sort-selector")||null;var i=a.data("sort-match")||0;i>=t.column.data.matches.length&&(i=0),t.column.data.sort.match=t.column.data.matches[i]}}).data("footable-sort",t)},t.doSort=function(a,i){var o=t.footable;if(e(o.table).data("sort")!==!1){var n=e(o.table),r=n.find("> tbody"),l=o.columns[a],s=n.find("> thead > tr:last-child > th:eq("+a+")"),d=o.options.classes.sort,f=o.options.events.sort;if(i=i===undefined?s.hasClass(d.sorted):"toggle"===i?!s.hasClass(d.sorted):i,l.sort.ignore===!0)return!0;var u=o.raise(f.sorting,{column:l,direction:i?"ASC":"DESC"});u&&u.result===!1||(n.data("sorted",l.index),n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").not(s).removeClass(d.sorted+" "+d.descending),i===undefined&&(i=s.hasClass(d.sorted)),i?s.removeClass(d.descending).addClass(d.sorted):s.removeClass(d.sorted).addClass(d.descending),t.sort(o,r,l,i),o.bindToggleSelectors(),o.raise(f.sorted,{column:l,direction:i?"ASC":"DESC"}))}},t.rows=function(t,a,i){var o=[];return a.find("> tr").each(function(){var a=e(this),n=null;if(a.hasClass(t.options.classes.detail))return!0;a.next().hasClass(t.options.classes.detail)&&(n=a.next().get(0));var r={row:a,detail:n};return i!==undefined&&(r.value=t.parse(this.cells[i.sort.match],i)),o.push(r),!0}).detach(),o},t.sort=function(e,a,i,o){var n=t.rows(e,a,i),r=e.options.sorters[i.type]||e.options.sorters.alpha;n.sort(function(e,t){return o?r(e.value,t.value):r(t.value,e.value)});for(var l=0;n.length>l;l++)a.append(n[l].row),null!==n[l].detail&&a.append(n[l].detail)}}if(t.footable===undefined||null===t.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={sort:!0,sorters:{alpha:function(e,t){return"string"==typeof e&&(e=e.toLowerCase()),"string"==typeof t&&(t=t.toLowerCase()),e===t?0:t>e?-1:1},numeric:function(e,t){return e-t}},classes:{sort:{sortable:"footable-sortable",sorted:"footable-sorted",descending:"footable-sorted-desc",indicator:"footable-sort-indicator"}},events:{sort:{sorting:"footable_sorting",sorted:"footable_sorted"}}};t.footable.plugins.register(a,i)})(jQuery,window);
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * FooTable - Awesome Responsive Tables
3
- * Version : 2.0.1
3
+ * Version : 2.0.1.3
4
4
  * http://fooplugins.com/plugins/footable-jquery/
5
5
  *
6
6
  * Requires jQuery - http://jquery.com/
@@ -9,7 +9,7 @@
9
9
  * Released under the MIT license
10
10
  * You are free to use FooTable in commercial projects as long as this copyright header is left intact.
11
11
  *
12
- * Date: 31 Aug 2013
12
+ * Date: 21 Sep 2013
13
13
  */
14
14
  (function ($, w, undefined) {
15
15
  w.footable = {
@@ -34,7 +34,8 @@
34
34
  calculateWidthOverride: null,
35
35
  toggleSelector: ' > tbody > tr:not(.footable-row-detail)', //the selector to show/hide the detail row
36
36
  columnDataSelector: '> thead > tr:last-child > th, > thead > tr:last-child > td', //the selector used to find the column data in the thead
37
- detailSeparator: ':', //the seperator character used when building up the detail row
37
+ detailSeparator: ':', //the separator character used when building up the detail row
38
+ toggleHTMLElement: '<span />', // override this if you want to insert a click target rather than use a background image.
38
39
  createGroupedDetail: function (data) {
39
40
  var groups = { '_none': { 'name': null, 'data': [] } };
40
41
  for (var i = 0; i < data.length; i++) {
@@ -99,7 +100,9 @@
99
100
  resize: 'footable_resize', //trigger this event to force FooTable to resize
100
101
  redraw: 'footable_redraw', //trigger this event to force FooTable to redraw
101
102
  toggleRow: 'footable_toggle_row', //trigger this event to force FooTable to toggle a row
102
- expandFirstRow: 'footable_expand_first_row' //trigger this event to force FooTable to expand the first row
103
+ expandFirstRow: 'footable_expand_first_row', //trigger this event to force FooTable to expand the first row
104
+ expandAll: 'footable_expand_all', //trigger this event to force FooTable to expand all rows
105
+ collapseAll: 'footable_collapse_all' //trigger this event to force FooTable to collapse all rows
103
106
  },
104
107
  events: {
105
108
  alreadyInitialized: 'footable_already_initialized', //fires when the FooTable has already been initialized
@@ -114,7 +117,8 @@
114
117
  rowDetailUpdated: 'footable_row_detail_updated', //fires when a detail row is being updated
115
118
  rowCollapsed: 'footable_row_collapsed', //fires when a row is collapsed
116
119
  rowExpanded: 'footable_row_expanded', //fires when a row is expanded
117
- rowRemoved: 'footable_row_removed' //fires when a row is removed
120
+ rowRemoved: 'footable_row_removed', //fires when a row is removed
121
+ reset: 'footable_reset' //fires when FooTable is reset
118
122
  },
119
123
  debug: false, // Whether or not to log information to the console.
120
124
  log: null
@@ -309,6 +313,7 @@
309
313
  });
310
314
 
311
315
  $table
316
+ .unbind(trg.initialize)
312
317
  //bind to FooTable initialize trigger
313
318
  .bind(trg.initialize, function () {
314
319
  //remove previous "state" (to "force" a resize)
@@ -327,18 +332,30 @@
327
332
  //raise the initialized event
328
333
  ft.raise(evt.initialized);
329
334
  })
335
+ .unbind(trg.redraw)
330
336
  //bind to FooTable redraw trigger
331
337
  .bind(trg.redraw, function () {
332
338
  ft.redraw();
333
339
  })
334
-
340
+ .unbind(trg.resize)
335
341
  //bind to FooTable resize trigger
336
342
  .bind(trg.resize, function () {
337
343
  ft.resize();
338
344
  })
345
+ .unbind(trg.expandFirstRow)
339
346
  //bind to FooTable expandFirstRow trigger
340
347
  .bind(trg.expandFirstRow, function () {
341
348
  $table.find(opt.toggleSelector).first().not('.' + cls.detailShow).trigger(trg.toggleRow);
349
+ })
350
+ .unbind(trg.expandAll)
351
+ //bind to FooTable expandFirstRow trigger
352
+ .bind(trg.expandAll, function () {
353
+ $table.find(opt.toggleSelector).not('.' + cls.detailShow).trigger(trg.toggleRow);
354
+ })
355
+ .unbind(trg.collapseAll)
356
+ //bind to FooTable expandFirstRow trigger
357
+ .bind(trg.collapseAll, function () {
358
+ $table.find('.' + cls.detailShow).trigger(trg.toggleRow);
342
359
  });
343
360
 
344
361
  //trigger a FooTable initialize
@@ -368,7 +385,7 @@
368
385
  if (col.toggle) {
369
386
  hasToggleColumn = true;
370
387
  var selector = '> tbody > tr:not(.' + cls.detail + ',.' + cls.disabled + ') > td:nth-child(' + (parseInt(col.index, 10) + 1) + ')';
371
- $table.find(selector).not('.' + cls.detailCell).prepend($('<span />').addClass(cls.toggle));
388
+ $table.find(selector).not('.' + cls.detailCell).prepend($(opt.toggleHTMLElement).addClass(cls.toggle));
372
389
  return;
373
390
  }
374
391
  }
@@ -377,7 +394,7 @@
377
394
  $table
378
395
  .find('> tbody > tr:not(.' + cls.detail + ',.' + cls.disabled + ') > td:first-child')
379
396
  .not('.' + cls.detailCell)
380
- .prepend($('<span />').addClass(cls.toggle));
397
+ .prepend($(opt.toggleHTMLElement).addClass(cls.toggle));
381
398
  }
382
399
  };
383
400
 
@@ -406,7 +423,7 @@
406
423
 
407
424
  $table.find(opt.toggleSelector).unbind(trg.toggleRow).bind(trg.toggleRow, function (e) {
408
425
  var $row = $(this).is('tr') ? $(this) : $(this).parents('tr:first');
409
- ft.toggleDetail($row.get(0));
426
+ ft.toggleDetail($row);
410
427
  });
411
428
 
412
429
  $table.find(opt.toggleSelector).unbind('click.footable').bind('click.footable', function (e) {
@@ -595,8 +612,10 @@
595
612
 
596
613
  selector += ', > thead > tr[data-group-row="true"] > th[data-group="' + data.group + '"]';
597
614
  var $column = $table.find(selector).add(this);
598
- if (data.hide[breakpointName] === false) $column.show();
599
- else $column.hide();
615
+ if (breakpointName !== '') {
616
+ if (data.hide[breakpointName] === false) $column.addClass('footable-visible').show();
617
+ else $column.removeClass('footable-visible').hide();
618
+ }
600
619
 
601
620
  if ($table.find('> thead > tr.footable-group-row').length === 1) {
602
621
  var $groupcols = $table.find('> thead > tr:last-child > th[data-group="' + data.group + '"]:visible, > thead > tr:last-child > th[data-group="' + data.group + '"]:visible'),
@@ -616,7 +635,7 @@
616
635
  ft.createOrUpdateDetailRow(this);
617
636
  });
618
637
 
619
- $table.find('> tbody > tr.' + cls.detailShow + ':visible').each(function () {
638
+ $table.find('> tbody > tr.' + cls.detailShow + '.footable-visible').each(function () {
620
639
  var $next = $(this).next();
621
640
  if ($next.hasClass(cls.detail)) {
622
641
  if (!hasBreakpointFired) $next.hide();
@@ -629,10 +648,10 @@
629
648
  $table.find('> thead > tr > th.footable-last-column, > tbody > tr > td.footable-last-column').removeClass('footable-last-column');
630
649
  $table.find('> thead > tr > th.footable-first-column, > tbody > tr > td.footable-first-column').removeClass('footable-first-column');
631
650
  $table.find('> thead > tr, > tbody > tr')
632
- .find('> th:visible:last, > td:visible:last')
651
+ .find('> th.footable-visible:last, > td.footable-visible:last')
633
652
  .addClass('footable-last-column')
634
653
  .end()
635
- .find('> th:visible:first, > td:visible:first')
654
+ .find('> th.footable-visible:first, > td.footable-visible:first')
636
655
  .addClass('footable-first-column');
637
656
 
638
657
  ft.raise(evt.redrawn);
@@ -653,8 +672,8 @@
653
672
 
654
673
  } else {
655
674
  ft.createOrUpdateDetailRow($row[0]);
656
- $row.addClass(cls.detailShow);
657
- $row.next().show();
675
+ $row.addClass(cls.detailShow)
676
+ .next().show();
658
677
 
659
678
  ft.raise(evt.rowExpanded, { 'row': $row[0] });
660
679
  }
@@ -742,6 +761,23 @@
742
761
  return e;
743
762
  };
744
763
 
764
+ //reset the state of FooTable
765
+ ft.reset = function() {
766
+ var $table = $(ft.table);
767
+ $table.removeData('footable_info')
768
+ .data('breakpoint', '')
769
+ .removeClass(cls.loading)
770
+ .removeClass(cls.loaded);
771
+
772
+ $table.find(opt.toggleSelector).unbind(trg.toggleRow).unbind('click.footable');
773
+
774
+ $table.find('> tbody > tr').removeClass(cls.detailShow);
775
+
776
+ $table.find('> tbody > tr.' + cls.detail).remove();
777
+
778
+ ft.raise(evt.reset);
779
+ };
780
+
745
781
  ft.init();
746
782
  return ft;
747
783
  }
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * FooTable - Awesome Responsive Tables
3
- * Version : 2.0.1
3
+ * Version : 2.0.1.3
4
4
  * http://fooplugins.com/plugins/footable-jquery/
5
5
  *
6
6
  * Requires jQuery - http://jquery.com/
@@ -9,6 +9,6 @@
9
9
  * Released under the MIT license
10
10
  * You are free to use FooTable in commercial projects as long as this copyright header is left intact.
11
11
  *
12
- * Date: 31 Aug 2013
12
+ * Date: 21 Sep 2013
13
13
  */
14
- (function(e,t){function a(){var e=this;e.id=null,e.busy=!1,e.start=function(t,a){e.busy||(e.stop(),e.id=setTimeout(function(){t(),e.id=null,e.busy=!1},a),e.busy=!0)},e.stop=function(){null!==e.id&&(clearTimeout(e.id),e.id=null,e.busy=!1)}}function o(o,i,n){var r=this;r.id=n,r.table=o,r.options=i,r.breakpoints=[],r.breakpointNames="",r.columns={},r.plugins=t.footable.plugins.load(r);var l=r.options,d=l.classes,s=l.events,u=l.triggers,f=0;return r.timers={resize:new a,register:function(e){return r.timers[e]=new a,r.timers[e]}},r.init=function(){var a=e(t),o=e(r.table);if(t.footable.plugins.init(r),o.hasClass(d.loaded))return r.raise(s.alreadyInitialized),undefined;r.raise(s.initializing),o.addClass(d.loading),o.find(l.columnDataSelector).each(function(){var e=r.getColumnData(this);r.columns[e.index]=e});for(var i in l.breakpoints)r.breakpoints.push({name:i,width:l.breakpoints[i]}),r.breakpointNames+=i+" ";r.breakpoints.sort(function(e,t){return e.width-t.width}),o.bind(u.initialize,function(){o.removeData("footable_info"),o.data("breakpoint",""),o.trigger(u.resize),o.removeClass(d.loading),o.addClass(d.loaded).addClass(d.main),r.raise(s.initialized)}).bind(u.redraw,function(){r.redraw()}).bind(u.resize,function(){r.resize()}).bind(u.expandFirstRow,function(){o.find(l.toggleSelector).first().not("."+d.detailShow).trigger(u.toggleRow)}),o.trigger(u.initialize),a.bind("resize.footable",function(){r.timers.resize.stop(),r.timers.resize.start(function(){r.raise(u.resize)},l.delay)})},r.addRowToggle=function(){if(l.addRowToggle){var t=e(r.table),a=!1;t.find("span."+d.toggle).remove();for(var o in r.columns){var i=r.columns[o];if(i.toggle){a=!0;var n="> tbody > tr:not(."+d.detail+",."+d.disabled+") > td:nth-child("+(parseInt(i.index,10)+1)+")";return t.find(n).not("."+d.detailCell).prepend(e("<span />").addClass(d.toggle)),undefined}}a||t.find("> tbody > tr:not(."+d.detail+",."+d.disabled+") > td:first-child").not("."+d.detailCell).prepend(e("<span />").addClass(d.toggle))}},r.setColumnClasses=function(){$table=e(r.table);for(var t in r.columns){var a=r.columns[t];if(null!==a.className){var o="",i=!0;e.each(a.matches,function(e,t){i||(o+=", "),o+="> tbody > tr:not(."+d.detail+") > td:nth-child("+(parseInt(t,10)+1)+")",i=!1}),$table.find(o).not("."+d.detailCell).addClass(a.className)}}},r.bindToggleSelectors=function(){var t=e(r.table);r.hasAnyBreakpointColumn()&&(t.find(l.toggleSelector).unbind(u.toggleRow).bind(u.toggleRow,function(){var t=e(this).is("tr")?e(this):e(this).parents("tr:first");r.toggleDetail(t.get(0))}),t.find(l.toggleSelector).unbind("click.footable").bind("click.footable",function(a){t.is(".breakpoint")&&e(a.target).is("td,."+d.toggle)&&e(this).trigger(u.toggleRow)}))},r.parse=function(e,t){var a=l.parsers[t.type]||l.parsers.alpha;return a(e)},r.getColumnData=function(t){var a=e(t),o=a.data("hide"),i=a.index();o=o||"",o=jQuery.map(o.split(","),function(e){return jQuery.trim(e)});var n={index:i,hide:{},type:a.data("type")||"alpha",name:a.data("name")||e.trim(a.text()),ignore:a.data("ignore")||!1,toggle:a.data("toggle")||!1,className:a.data("class")||null,matches:[],names:{},group:a.data("group")||null,groupName:null};if(null!==n.group){var d=e(r.table).find('> thead > tr.footable-group-row > th[data-group="'+n.group+'"], > thead > tr.footable-group-row > td[data-group="'+n.group+'"]').first();n.groupName=r.parse(d,{type:"alpha"})}var u=parseInt(a.prev().attr("colspan")||0,10);f+=u>1?u-1:0;var p=parseInt(a.attr("colspan")||0,10),c=n.index+f;if(p>1){var g=a.data("names");g=g||"",g=g.split(",");for(var h=0;p>h;h++)n.matches.push(h+c),g.length>h&&(n.names[h+c]=g[h])}else n.matches.push(c);n.hide["default"]="all"===a.data("hide")||e.inArray("default",o)>=0;var b=!1;for(var m in l.breakpoints)n.hide[m]="all"===a.data("hide")||e.inArray(m,o)>=0,b=b||n.hide[m];n.hasBreakpoint=b;var v=r.raise(s.columnData,{column:{data:n,th:t}});return v.column.data},r.getViewportWidth=function(){return window.innerWidth||(document.body?document.body.offsetWidth:0)},r.calculateWidth=function(e,t){return jQuery.isFunction(l.calculateWidthOverride)?l.calculateWidthOverride(e,t):(t.viewportWidth<t.width&&(t.width=t.viewportWidth),t.parentWidth<t.width&&(t.width=t.parentWidth),t)},r.hasBreakpointColumn=function(e){for(var t in r.columns)if(r.columns[t].hide[e]){if(r.columns[t].ignore)continue;return!0}return!1},r.hasAnyBreakpointColumn=function(){for(var e in r.columns)if(r.columns[e].hasBreakpoint)return!0;return!1},r.resize=function(){var t=e(r.table);if(t.is(":visible")&&r.hasAnyBreakpointColumn()){var a={width:t.width(),viewportWidth:r.getViewportWidth(),parentWidth:t.parent().width()};a=r.calculateWidth(t,a);var o=t.data("footable_info");if(t.data("footable_info",a),r.raise(s.resizing,{old:o,info:a}),!o||o&&o.width&&o.width!==a.width){for(var i,n=null,l=0;r.breakpoints.length>l;l++)if(i=r.breakpoints[l],i&&i.width&&a.width<=i.width){n=i;break}var d=null===n?"default":n.name,f=r.hasBreakpointColumn(d),p=t.data("breakpoint");t.data("breakpoint",d).removeClass("default breakpoint").removeClass(r.breakpointNames).addClass(d+(f?" breakpoint":"")),d!==p&&(t.trigger(u.redraw),r.raise(s.breakpoint,{breakpoint:d,info:a}))}r.raise(s.resized,{old:o,info:a})}},r.redraw=function(){r.addRowToggle(),r.bindToggleSelectors(),r.setColumnClasses();var t=e(r.table),a=t.data("breakpoint"),o=r.hasBreakpointColumn(a);t.find("> tbody > tr:not(."+d.detail+")").data("detail_created",!1).end().find("> thead > tr:last-child > th").each(function(){var o=r.columns[e(this).index()],i="",n=!0;e.each(o.matches,function(e,t){n||(i+=", ");var a=t+1;i+="> tbody > tr:not(."+d.detail+") > td:nth-child("+a+")",i+=", > tfoot > tr:not(."+d.detail+") > td:nth-child("+a+")",i+=", > colgroup > col:nth-child("+a+")",n=!1}),i+=', > thead > tr[data-group-row="true"] > th[data-group="'+o.group+'"]';var l=t.find(i).add(this);if(o.hide[a]===!1?l.show():l.hide(),1===t.find("> thead > tr.footable-group-row").length){var s=t.find('> thead > tr:last-child > th[data-group="'+o.group+'"]:visible, > thead > tr:last-child > th[data-group="'+o.group+'"]:visible'),u=t.find('> thead > tr.footable-group-row > th[data-group="'+o.group+'"], > thead > tr.footable-group-row > td[data-group="'+o.group+'"]'),f=0;e.each(s,function(){f+=parseInt(e(this).attr("colspan")||1,10)}),f>0?u.attr("colspan",f).show():u.hide()}}).end().find("> tbody > tr."+d.detailShow).each(function(){r.createOrUpdateDetailRow(this)}),t.find("> tbody > tr."+d.detailShow+":visible").each(function(){var t=e(this).next();t.hasClass(d.detail)&&(o?t.show():t.hide())}),t.find("> thead > tr > th.footable-last-column, > tbody > tr > td.footable-last-column").removeClass("footable-last-column"),t.find("> thead > tr > th.footable-first-column, > tbody > tr > td.footable-first-column").removeClass("footable-first-column"),t.find("> thead > tr, > tbody > tr").find("> th:visible:last, > td:visible:last").addClass("footable-last-column").end().find("> th:visible:first, > td:visible:first").addClass("footable-first-column"),r.raise(s.redrawn)},r.toggleDetail=function(t){var a=t.jquery?t:e(t),o=a.next();a.hasClass(d.detailShow)?(a.removeClass(d.detailShow),o.hasClass(d.detail)&&o.hide(),r.raise(s.rowCollapsed,{row:a[0]})):(r.createOrUpdateDetailRow(a[0]),a.addClass(d.detailShow),a.next().show(),r.raise(s.rowExpanded,{row:a[0]}))},r.removeRow=function(t){var a=t.jquery?t:e(t);a.hasClass(d.detail)&&(a=a.prev());var o=a.next();a.data("detail_created")===!0&&o.remove(),a.remove(),r.raise(s.rowRemoved)},r.appendRow=function(t){var a=t.jquery?t:e(t);e(r.table).find("tbody").append(a),r.redraw()},r.getColumnFromTdIndex=function(t){var a=null;for(var o in r.columns)if(e.inArray(t,r.columns[o].matches)>=0){a=r.columns[o];break}return a},r.createOrUpdateDetailRow=function(t){var a,o=e(t),i=o.next(),n=[];if(o.data("detail_created")===!0)return!0;if(o.is(":hidden"))return!1;if(r.raise(s.rowDetailUpdating,{row:o,detail:i}),o.find("> td:hidden").each(function(){var t=e(this).index(),a=r.getColumnFromTdIndex(t),o=a.name;return a.ignore===!0?!0:(t in a.names&&(o=a.names[t]),n.push({name:o,value:r.parse(this,a),display:e.trim(e(this).html()),group:a.group,groupName:a.groupName}),!0)}),0===n.length)return!1;var u=o.find("> td:visible").length,f=i.hasClass(d.detail);return f||(i=e('<tr class="'+d.detail+'"><td class="'+d.detailCell+'"><div class="'+d.detailInner+'"></div></td></tr>'),o.after(i)),i.find("> td:first").attr("colspan",u),a=i.find("."+d.detailInner).empty(),l.createDetail(a,n,l.createGroupedDetail,l.detailSeparator,d),o.data("detail_created",!0),r.raise(s.rowDetailUpdated,{row:o,detail:i}),!f},r.raise=function(t,a){r.options.debug===!0&&e.isFunction(r.options.log)&&r.options.log(t,"event"),a=a||{};var o={ft:r};e.extend(!0,o,a);var i=e.Event(t,o);return i.ft||e.extend(!0,i,o),e(r.table).trigger(i),i},r.init(),r}t.footable={options:{delay:100,breakpoints:{phone:480,tablet:1024},parsers:{alpha:function(t){return e(t).data("value")||e.trim(e(t).text())},numeric:function(t){var a=e(t).data("value")||e(t).text().replace(/[^0-9.\-]/g,"");return a=parseFloat(a),isNaN(a)&&(a=0),a}},addRowToggle:!0,calculateWidthOverride:null,toggleSelector:" > tbody > tr:not(.footable-row-detail)",columnDataSelector:"> thead > tr:last-child > th, > thead > tr:last-child > td",detailSeparator:":",createGroupedDetail:function(e){for(var t={_none:{name:null,data:[]}},a=0;e.length>a;a++){var o=e[a].group;null!==o?(o in t||(t[o]={name:e[a].groupName||e[a].group,data:[]}),t[o].data.push(e[a])):t._none.data.push(e[a])}return t},createDetail:function(e,t,a,o,i){var n=a(t);for(var r in n)if(0!==n[r].data.length){"_none"!==r&&e.append('<div class="'+i.detailInnerGroup+'">'+n[r].name+"</div>");for(var l=0;n[r].data.length>l;l++){var d=n[r].data[l].name?o:"";e.append('<div class="'+i.detailInnerRow+'"><div class="'+i.detailInnerName+'">'+n[r].data[l].name+d+'</div><div class="'+i.detailInnerValue+'">'+n[r].data[l].display+"</div></div>")}}},classes:{main:"footable",loading:"footable-loading",loaded:"footable-loaded",toggle:"footable-toggle",disabled:"footable-disabled",detail:"footable-row-detail",detailCell:"footable-row-detail-cell",detailInner:"footable-row-detail-inner",detailInnerRow:"footable-row-detail-row",detailInnerGroup:"footable-row-detail-group",detailInnerName:"footable-row-detail-name",detailInnerValue:"footable-row-detail-value",detailShow:"footable-detail-show"},triggers:{initialize:"footable_initialize",resize:"footable_resize",redraw:"footable_redraw",toggleRow:"footable_toggle_row",expandFirstRow:"footable_expand_first_row"},events:{alreadyInitialized:"footable_already_initialized",initializing:"footable_initializing",initialized:"footable_initialized",resizing:"footable_resizing",resized:"footable_resized",redrawn:"footable_redrawn",breakpoint:"footable_breakpoint",columnData:"footable_column_data",rowDetailUpdating:"footable_row_detail_updating",rowDetailUpdated:"footable_row_detail_updated",rowCollapsed:"footable_row_collapsed",rowExpanded:"footable_row_expanded",rowRemoved:"footable_row_removed"},debug:!1,log:null},version:{major:0,minor:5,toString:function(){return t.footable.version.major+"."+t.footable.version.minor},parse:function(e){return version=/(\d+)\.?(\d+)?\.?(\d+)?/.exec(e),{major:parseInt(version[1],10)||0,minor:parseInt(version[2],10)||0,patch:parseInt(version[3],10)||0}}},plugins:{_validate:function(a){if(!e.isFunction(a))return t.footable.options.debug===!0&&console.error('Validation failed, expected type "function", received type "{0}".',typeof a),!1;var o=new a;return"string"!=typeof o.name?(t.footable.options.debug===!0&&console.error('Validation failed, plugin does not implement a string property called "name".',o),!1):e.isFunction(o.init)?(t.footable.options.debug===!0&&console.log('Validation succeeded for plugin "'+o.name+'".',o),!0):(t.footable.options.debug===!0&&console.error('Validation failed, plugin "'+o.name+'" does not implement a function called "init".',o),!1)},registered:[],register:function(a,o){t.footable.plugins._validate(a)&&(t.footable.plugins.registered.push(a),"object"==typeof o&&e.extend(!0,t.footable.options,o))},load:function(e){var a,o,i=[];for(o=0;t.footable.plugins.registered.length>o;o++)try{a=t.footable.plugins.registered[o],i.push(new a(e))}catch(n){t.footable.options.debug===!0&&console.error(n)}return i},init:function(e){for(var a=0;e.plugins.length>a;a++)try{e.plugins[a].init(e)}catch(o){t.footable.options.debug===!0&&console.error(o)}}}};var i=0;e.fn.footable=function(a){a=a||{};var n=e.extend(!0,{},t.footable.options,a);return this.each(function(){i++;var t=new o(this,n,i);e(this).data("footable",t)})}})(jQuery,window);
14
+ (function(e,t){function a(){var e=this;e.id=null,e.busy=!1,e.start=function(t,a){e.busy||(e.stop(),e.id=setTimeout(function(){t(),e.id=null,e.busy=!1},a),e.busy=!0)},e.stop=function(){null!==e.id&&(clearTimeout(e.id),e.id=null,e.busy=!1)}}function o(o,i,n){var r=this;r.id=n,r.table=o,r.options=i,r.breakpoints=[],r.breakpointNames="",r.columns={},r.plugins=t.footable.plugins.load(r);var l=r.options,d=l.classes,s=l.events,u=l.triggers,f=0;return r.timers={resize:new a,register:function(e){return r.timers[e]=new a,r.timers[e]}},r.init=function(){var a=e(t),o=e(r.table);if(t.footable.plugins.init(r),o.hasClass(d.loaded))return r.raise(s.alreadyInitialized),undefined;r.raise(s.initializing),o.addClass(d.loading),o.find(l.columnDataSelector).each(function(){var e=r.getColumnData(this);r.columns[e.index]=e});for(var i in l.breakpoints)r.breakpoints.push({name:i,width:l.breakpoints[i]}),r.breakpointNames+=i+" ";r.breakpoints.sort(function(e,t){return e.width-t.width}),o.unbind(u.initialize).bind(u.initialize,function(){o.removeData("footable_info"),o.data("breakpoint",""),o.trigger(u.resize),o.removeClass(d.loading),o.addClass(d.loaded).addClass(d.main),r.raise(s.initialized)}).unbind(u.redraw).bind(u.redraw,function(){r.redraw()}).unbind(u.resize).bind(u.resize,function(){r.resize()}).unbind(u.expandFirstRow).bind(u.expandFirstRow,function(){o.find(l.toggleSelector).first().not("."+d.detailShow).trigger(u.toggleRow)}).unbind(u.expandAll).bind(u.expandAll,function(){o.find(l.toggleSelector).not("."+d.detailShow).trigger(u.toggleRow)}).unbind(u.collapseAll).bind(u.collapseAll,function(){o.find("."+d.detailShow).trigger(u.toggleRow)}),o.trigger(u.initialize),a.bind("resize.footable",function(){r.timers.resize.stop(),r.timers.resize.start(function(){r.raise(u.resize)},l.delay)})},r.addRowToggle=function(){if(l.addRowToggle){var t=e(r.table),a=!1;t.find("span."+d.toggle).remove();for(var o in r.columns){var i=r.columns[o];if(i.toggle){a=!0;var n="> tbody > tr:not(."+d.detail+",."+d.disabled+") > td:nth-child("+(parseInt(i.index,10)+1)+")";return t.find(n).not("."+d.detailCell).prepend(e(l.toggleHTMLElement).addClass(d.toggle)),undefined}}a||t.find("> tbody > tr:not(."+d.detail+",."+d.disabled+") > td:first-child").not("."+d.detailCell).prepend(e(l.toggleHTMLElement).addClass(d.toggle))}},r.setColumnClasses=function(){$table=e(r.table);for(var t in r.columns){var a=r.columns[t];if(null!==a.className){var o="",i=!0;e.each(a.matches,function(e,t){i||(o+=", "),o+="> tbody > tr:not(."+d.detail+") > td:nth-child("+(parseInt(t,10)+1)+")",i=!1}),$table.find(o).not("."+d.detailCell).addClass(a.className)}}},r.bindToggleSelectors=function(){var t=e(r.table);r.hasAnyBreakpointColumn()&&(t.find(l.toggleSelector).unbind(u.toggleRow).bind(u.toggleRow,function(){var t=e(this).is("tr")?e(this):e(this).parents("tr:first");r.toggleDetail(t)}),t.find(l.toggleSelector).unbind("click.footable").bind("click.footable",function(a){t.is(".breakpoint")&&e(a.target).is("td,."+d.toggle)&&e(this).trigger(u.toggleRow)}))},r.parse=function(e,t){var a=l.parsers[t.type]||l.parsers.alpha;return a(e)},r.getColumnData=function(t){var a=e(t),o=a.data("hide"),i=a.index();o=o||"",o=jQuery.map(o.split(","),function(e){return jQuery.trim(e)});var n={index:i,hide:{},type:a.data("type")||"alpha",name:a.data("name")||e.trim(a.text()),ignore:a.data("ignore")||!1,toggle:a.data("toggle")||!1,className:a.data("class")||null,matches:[],names:{},group:a.data("group")||null,groupName:null};if(null!==n.group){var d=e(r.table).find('> thead > tr.footable-group-row > th[data-group="'+n.group+'"], > thead > tr.footable-group-row > td[data-group="'+n.group+'"]').first();n.groupName=r.parse(d,{type:"alpha"})}var u=parseInt(a.prev().attr("colspan")||0,10);f+=u>1?u-1:0;var p=parseInt(a.attr("colspan")||0,10),c=n.index+f;if(p>1){var g=a.data("names");g=g||"",g=g.split(",");for(var b=0;p>b;b++)n.matches.push(b+c),g.length>b&&(n.names[b+c]=g[b])}else n.matches.push(c);n.hide["default"]="all"===a.data("hide")||e.inArray("default",o)>=0;var h=!1;for(var m in l.breakpoints)n.hide[m]="all"===a.data("hide")||e.inArray(m,o)>=0,h=h||n.hide[m];n.hasBreakpoint=h;var v=r.raise(s.columnData,{column:{data:n,th:t}});return v.column.data},r.getViewportWidth=function(){return window.innerWidth||(document.body?document.body.offsetWidth:0)},r.calculateWidth=function(e,t){return jQuery.isFunction(l.calculateWidthOverride)?l.calculateWidthOverride(e,t):(t.viewportWidth<t.width&&(t.width=t.viewportWidth),t.parentWidth<t.width&&(t.width=t.parentWidth),t)},r.hasBreakpointColumn=function(e){for(var t in r.columns)if(r.columns[t].hide[e]){if(r.columns[t].ignore)continue;return!0}return!1},r.hasAnyBreakpointColumn=function(){for(var e in r.columns)if(r.columns[e].hasBreakpoint)return!0;return!1},r.resize=function(){var t=e(r.table);if(t.is(":visible")&&r.hasAnyBreakpointColumn()){var a={width:t.width(),viewportWidth:r.getViewportWidth(),parentWidth:t.parent().width()};a=r.calculateWidth(t,a);var o=t.data("footable_info");if(t.data("footable_info",a),r.raise(s.resizing,{old:o,info:a}),!o||o&&o.width&&o.width!==a.width){for(var i,n=null,l=0;r.breakpoints.length>l;l++)if(i=r.breakpoints[l],i&&i.width&&a.width<=i.width){n=i;break}var d=null===n?"default":n.name,f=r.hasBreakpointColumn(d),p=t.data("breakpoint");t.data("breakpoint",d).removeClass("default breakpoint").removeClass(r.breakpointNames).addClass(d+(f?" breakpoint":"")),d!==p&&(t.trigger(u.redraw),r.raise(s.breakpoint,{breakpoint:d,info:a}))}r.raise(s.resized,{old:o,info:a})}},r.redraw=function(){r.addRowToggle(),r.bindToggleSelectors(),r.setColumnClasses();var t=e(r.table),a=t.data("breakpoint"),o=r.hasBreakpointColumn(a);t.find("> tbody > tr:not(."+d.detail+")").data("detail_created",!1).end().find("> thead > tr:last-child > th").each(function(){var o=r.columns[e(this).index()],i="",n=!0;e.each(o.matches,function(e,t){n||(i+=", ");var a=t+1;i+="> tbody > tr:not(."+d.detail+") > td:nth-child("+a+")",i+=", > tfoot > tr:not(."+d.detail+") > td:nth-child("+a+")",i+=", > colgroup > col:nth-child("+a+")",n=!1}),i+=', > thead > tr[data-group-row="true"] > th[data-group="'+o.group+'"]';var l=t.find(i).add(this);if(""!==a&&(o.hide[a]===!1?l.addClass("footable-visible").show():l.removeClass("footable-visible").hide()),1===t.find("> thead > tr.footable-group-row").length){var s=t.find('> thead > tr:last-child > th[data-group="'+o.group+'"]:visible, > thead > tr:last-child > th[data-group="'+o.group+'"]:visible'),u=t.find('> thead > tr.footable-group-row > th[data-group="'+o.group+'"], > thead > tr.footable-group-row > td[data-group="'+o.group+'"]'),f=0;e.each(s,function(){f+=parseInt(e(this).attr("colspan")||1,10)}),f>0?u.attr("colspan",f).show():u.hide()}}).end().find("> tbody > tr."+d.detailShow).each(function(){r.createOrUpdateDetailRow(this)}),t.find("> tbody > tr."+d.detailShow+".footable-visible").each(function(){var t=e(this).next();t.hasClass(d.detail)&&(o?t.show():t.hide())}),t.find("> thead > tr > th.footable-last-column, > tbody > tr > td.footable-last-column").removeClass("footable-last-column"),t.find("> thead > tr > th.footable-first-column, > tbody > tr > td.footable-first-column").removeClass("footable-first-column"),t.find("> thead > tr, > tbody > tr").find("> th.footable-visible:last, > td.footable-visible:last").addClass("footable-last-column").end().find("> th.footable-visible:first, > td.footable-visible:first").addClass("footable-first-column"),r.raise(s.redrawn)},r.toggleDetail=function(t){var a=t.jquery?t:e(t),o=a.next();a.hasClass(d.detailShow)?(a.removeClass(d.detailShow),o.hasClass(d.detail)&&o.hide(),r.raise(s.rowCollapsed,{row:a[0]})):(r.createOrUpdateDetailRow(a[0]),a.addClass(d.detailShow).next().show(),r.raise(s.rowExpanded,{row:a[0]}))},r.removeRow=function(t){var a=t.jquery?t:e(t);a.hasClass(d.detail)&&(a=a.prev());var o=a.next();a.data("detail_created")===!0&&o.remove(),a.remove(),r.raise(s.rowRemoved)},r.appendRow=function(t){var a=t.jquery?t:e(t);e(r.table).find("tbody").append(a),r.redraw()},r.getColumnFromTdIndex=function(t){var a=null;for(var o in r.columns)if(e.inArray(t,r.columns[o].matches)>=0){a=r.columns[o];break}return a},r.createOrUpdateDetailRow=function(t){var a,o=e(t),i=o.next(),n=[];if(o.data("detail_created")===!0)return!0;if(o.is(":hidden"))return!1;if(r.raise(s.rowDetailUpdating,{row:o,detail:i}),o.find("> td:hidden").each(function(){var t=e(this).index(),a=r.getColumnFromTdIndex(t),o=a.name;return a.ignore===!0?!0:(t in a.names&&(o=a.names[t]),n.push({name:o,value:r.parse(this,a),display:e.trim(e(this).html()),group:a.group,groupName:a.groupName}),!0)}),0===n.length)return!1;var u=o.find("> td:visible").length,f=i.hasClass(d.detail);return f||(i=e('<tr class="'+d.detail+'"><td class="'+d.detailCell+'"><div class="'+d.detailInner+'"></div></td></tr>'),o.after(i)),i.find("> td:first").attr("colspan",u),a=i.find("."+d.detailInner).empty(),l.createDetail(a,n,l.createGroupedDetail,l.detailSeparator,d),o.data("detail_created",!0),r.raise(s.rowDetailUpdated,{row:o,detail:i}),!f},r.raise=function(t,a){r.options.debug===!0&&e.isFunction(r.options.log)&&r.options.log(t,"event"),a=a||{};var o={ft:r};e.extend(!0,o,a);var i=e.Event(t,o);return i.ft||e.extend(!0,i,o),e(r.table).trigger(i),i},r.reset=function(){var t=e(r.table);t.removeData("footable_info").data("breakpoint","").removeClass(d.loading).removeClass(d.loaded),t.find(l.toggleSelector).unbind(u.toggleRow).unbind("click.footable"),t.find("> tbody > tr").removeClass(d.detailShow),t.find("> tbody > tr."+d.detail).remove(),r.raise(s.reset)},r.init(),r}t.footable={options:{delay:100,breakpoints:{phone:480,tablet:1024},parsers:{alpha:function(t){return e(t).data("value")||e.trim(e(t).text())},numeric:function(t){var a=e(t).data("value")||e(t).text().replace(/[^0-9.\-]/g,"");return a=parseFloat(a),isNaN(a)&&(a=0),a}},addRowToggle:!0,calculateWidthOverride:null,toggleSelector:" > tbody > tr:not(.footable-row-detail)",columnDataSelector:"> thead > tr:last-child > th, > thead > tr:last-child > td",detailSeparator:":",toggleHTMLElement:"<span />",createGroupedDetail:function(e){for(var t={_none:{name:null,data:[]}},a=0;e.length>a;a++){var o=e[a].group;null!==o?(o in t||(t[o]={name:e[a].groupName||e[a].group,data:[]}),t[o].data.push(e[a])):t._none.data.push(e[a])}return t},createDetail:function(e,t,a,o,i){var n=a(t);for(var r in n)if(0!==n[r].data.length){"_none"!==r&&e.append('<div class="'+i.detailInnerGroup+'">'+n[r].name+"</div>");for(var l=0;n[r].data.length>l;l++){var d=n[r].data[l].name?o:"";e.append('<div class="'+i.detailInnerRow+'"><div class="'+i.detailInnerName+'">'+n[r].data[l].name+d+'</div><div class="'+i.detailInnerValue+'">'+n[r].data[l].display+"</div></div>")}}},classes:{main:"footable",loading:"footable-loading",loaded:"footable-loaded",toggle:"footable-toggle",disabled:"footable-disabled",detail:"footable-row-detail",detailCell:"footable-row-detail-cell",detailInner:"footable-row-detail-inner",detailInnerRow:"footable-row-detail-row",detailInnerGroup:"footable-row-detail-group",detailInnerName:"footable-row-detail-name",detailInnerValue:"footable-row-detail-value",detailShow:"footable-detail-show"},triggers:{initialize:"footable_initialize",resize:"footable_resize",redraw:"footable_redraw",toggleRow:"footable_toggle_row",expandFirstRow:"footable_expand_first_row",expandAll:"footable_expand_all",collapseAll:"footable_collapse_all"},events:{alreadyInitialized:"footable_already_initialized",initializing:"footable_initializing",initialized:"footable_initialized",resizing:"footable_resizing",resized:"footable_resized",redrawn:"footable_redrawn",breakpoint:"footable_breakpoint",columnData:"footable_column_data",rowDetailUpdating:"footable_row_detail_updating",rowDetailUpdated:"footable_row_detail_updated",rowCollapsed:"footable_row_collapsed",rowExpanded:"footable_row_expanded",rowRemoved:"footable_row_removed",reset:"footable_reset"},debug:!1,log:null},version:{major:0,minor:5,toString:function(){return t.footable.version.major+"."+t.footable.version.minor},parse:function(e){return version=/(\d+)\.?(\d+)?\.?(\d+)?/.exec(e),{major:parseInt(version[1],10)||0,minor:parseInt(version[2],10)||0,patch:parseInt(version[3],10)||0}}},plugins:{_validate:function(a){if(!e.isFunction(a))return t.footable.options.debug===!0&&console.error('Validation failed, expected type "function", received type "{0}".',typeof a),!1;var o=new a;return"string"!=typeof o.name?(t.footable.options.debug===!0&&console.error('Validation failed, plugin does not implement a string property called "name".',o),!1):e.isFunction(o.init)?(t.footable.options.debug===!0&&console.log('Validation succeeded for plugin "'+o.name+'".',o),!0):(t.footable.options.debug===!0&&console.error('Validation failed, plugin "'+o.name+'" does not implement a function called "init".',o),!1)},registered:[],register:function(a,o){t.footable.plugins._validate(a)&&(t.footable.plugins.registered.push(a),"object"==typeof o&&e.extend(!0,t.footable.options,o))},load:function(e){var a,o,i=[];for(o=0;t.footable.plugins.registered.length>o;o++)try{a=t.footable.plugins.registered[o],i.push(new a(e))}catch(n){t.footable.options.debug===!0&&console.error(n)}return i},init:function(e){for(var a=0;e.plugins.length>a;a++)try{e.plugins[a].init(e)}catch(o){t.footable.options.debug===!0&&console.error(o)}}}};var i=0;e.fn.footable=function(a){a=a||{};var n=e.extend(!0,{},t.footable.options,a);return this.each(function(){i++;var t=new o(this,n,i);e(this).data("footable",t)})}})(jQuery,window);
@@ -32,48 +32,50 @@
32
32
  if (ft.options.filter.enabled === true) {
33
33
  if ($(ft.table).data('filter') === false) return;
34
34
  ft.timers.register('filter');
35
- $(ft.table).bind({
36
- 'footable_initialized': function (e) {
37
- var $table = $(ft.table);
38
- var data = {
39
- 'input': $table.data('filter') || ft.options.filter.input,
40
- 'timeout': $table.data('filter-timeout') || ft.options.filter.timeout,
41
- 'minimum': $table.data('filter-minimum') || ft.options.filter.minimum,
42
- 'disableEnter': $table.data('filter-disable-enter') || ft.options.filter.disableEnter
43
- };
44
- if (data.disableEnter) {
45
- $(data.input).keypress(function (event) {
46
- if (window.event)
47
- return (window.event.keyCode !== 13);
48
- else
49
- return (event.which !== 13);
50
- });
51
- }
52
- $table.bind('footable_clear_filter', function () {
53
- $(data.input).val('');
54
- p.clearFilter();
55
- });
56
- $table.bind('footable_filter', function (event, args) {
57
- p.filter(args.filter);
58
- });
59
- $(data.input).keyup(function (eve) {
60
- ft.timers.filter.stop();
61
- if (eve.which === 27) {
35
+ $(ft.table)
36
+ .unbind('.filtering')
37
+ .bind({
38
+ 'footable_initialized.filtering': function (e) {
39
+ var $table = $(ft.table);
40
+ var data = {
41
+ 'input': $table.data('filter') || ft.options.filter.input,
42
+ 'timeout': $table.data('filter-timeout') || ft.options.filter.timeout,
43
+ 'minimum': $table.data('filter-minimum') || ft.options.filter.minimum,
44
+ 'disableEnter': $table.data('filter-disable-enter') || ft.options.filter.disableEnter
45
+ };
46
+ if (data.disableEnter) {
47
+ $(data.input).keypress(function (event) {
48
+ if (window.event)
49
+ return (window.event.keyCode !== 13);
50
+ else
51
+ return (event.which !== 13);
52
+ });
53
+ }
54
+ $table.bind('footable_clear_filter', function () {
62
55
  $(data.input).val('');
56
+ p.clearFilter();
57
+ });
58
+ $table.bind('footable_filter', function (event, args) {
59
+ p.filter(args.filter);
60
+ });
61
+ $(data.input).keyup(function (eve) {
62
+ ft.timers.filter.stop();
63
+ if (eve.which === 27) {
64
+ $(data.input).val('');
65
+ }
66
+ ft.timers.filter.start(function () {
67
+ var val = $(data.input).val() || '';
68
+ p.filter(val);
69
+ }, data.timeout);
70
+ });
71
+ },
72
+ 'footable_redrawn.filtering': function (e) {
73
+ var $table = $(ft.table),
74
+ filter = $table.data('filter-string');
75
+ if (filter) {
76
+ p.filter(filter);
63
77
  }
64
- ft.timers.filter.start(function () {
65
- var val = $(data.input).val() || '';
66
- p.filter(val);
67
- }, data.timeout);
68
- });
69
- },
70
- 'footable_redrawn': function (e) {
71
- var $table = $(ft.table),
72
- filter = $table.data('filter-string');
73
- if (filter) {
74
- p.filter(filter);
75
78
  }
76
- }
77
79
  })
78
80
  //save the filter object onto the table so we can access it later
79
81
  .data('footable-filter', p);
@@ -1 +1 @@
1
- (function(t,e,undefined){function a(){var e=this;e.name="Footable Filter",e.init=function(a){if(e.footable=a,a.options.filter.enabled===!0){if(t(a.table).data("filter")===!1)return;a.timers.register("filter"),t(a.table).bind({footable_initialized:function(){var i=t(a.table),o={input:i.data("filter")||a.options.filter.input,timeout:i.data("filter-timeout")||a.options.filter.timeout,minimum:i.data("filter-minimum")||a.options.filter.minimum,disableEnter:i.data("filter-disable-enter")||a.options.filter.disableEnter};o.disableEnter&&t(o.input).keypress(function(t){return window.event?13!==window.event.keyCode:13!==t.which}),i.bind("footable_clear_filter",function(){t(o.input).val(""),e.clearFilter()}),i.bind("footable_filter",function(t,a){e.filter(a.filter)}),t(o.input).keyup(function(i){a.timers.filter.stop(),27===i.which&&t(o.input).val(""),a.timers.filter.start(function(){var a=t(o.input).val()||"";e.filter(a)},o.timeout)})},footable_redrawn:function(){var i=t(a.table),o=i.data("filter-string");o&&e.filter(o)}}).data("footable-filter",e)}},e.filter=function(a){var i=e.footable,o=t(i.table),r=o.data("filter-minimum")||i.options.filter.minimum,n=!a,l=i.raise("footable_filtering",{filter:a,clear:n});if(!(l&&l.result===!1||l.filter&&r>l.filter.length))if(l.clear)e.clearFilter();else{var d=l.filter.split(" ");o.find("> tbody > tr").hide().addClass("footable-filtered");var s=o.find("> tbody > tr:not(.footable-row-detail)");t.each(d,function(t,e){e&&e.length>0&&(o.data("current-filter",e),s=s.filter(i.options.filter.filterFunction))}),s.each(function(){e.showRow(this,i),t(this).removeClass("footable-filtered")}),o.data("filter-string",l.filter),i.raise("footable_filtered",{filter:l.filter,clear:!1})}},e.clearFilter=function(){var a=e.footable,i=t(a.table);i.find("> tbody > tr:not(.footable-row-detail)").removeClass("footable-filtered").each(function(){e.showRow(this,a)}),i.removeData("filter-string"),a.raise("footable_filtered",{clear:!0})},e.showRow=function(e,a){var i=t(e),o=i.next(),r=t(a.table);i.is(":visible")||(r.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(e)):i.show())}}if(e.footable===undefined||null===e.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={filter:{enabled:!0,input:".footable-filter",timeout:300,minimum:2,disableEnter:!1,filterFunction:function(){var e=t(this),a=e.parents("table:first"),i=a.data("current-filter").toUpperCase(),o=e.find("td").text();return a.data("filter-text-only")||e.find("td[data-value]").each(function(){o+=t(this).data("value")}),o.toUpperCase().indexOf(i)>=0}}};e.footable.plugins.register(a,i)})(jQuery,window);
1
+ (function(e,t,undefined){function a(){var t=this;t.name="Footable Filter",t.init=function(a){if(t.footable=a,a.options.filter.enabled===!0){if(e(a.table).data("filter")===!1)return;a.timers.register("filter"),e(a.table).unbind(".filtering").bind({"footable_initialized.filtering":function(){var i=e(a.table),o={input:i.data("filter")||a.options.filter.input,timeout:i.data("filter-timeout")||a.options.filter.timeout,minimum:i.data("filter-minimum")||a.options.filter.minimum,disableEnter:i.data("filter-disable-enter")||a.options.filter.disableEnter};o.disableEnter&&e(o.input).keypress(function(e){return window.event?13!==window.event.keyCode:13!==e.which}),i.bind("footable_clear_filter",function(){e(o.input).val(""),t.clearFilter()}),i.bind("footable_filter",function(e,a){t.filter(a.filter)}),e(o.input).keyup(function(i){a.timers.filter.stop(),27===i.which&&e(o.input).val(""),a.timers.filter.start(function(){var a=e(o.input).val()||"";t.filter(a)},o.timeout)})},"footable_redrawn.filtering":function(){var i=e(a.table),o=i.data("filter-string");o&&t.filter(o)}}).data("footable-filter",t)}},t.filter=function(a){var i=t.footable,o=e(i.table),n=o.data("filter-minimum")||i.options.filter.minimum,r=!a,l=i.raise("footable_filtering",{filter:a,clear:r});if(!(l&&l.result===!1||l.filter&&n>l.filter.length))if(l.clear)t.clearFilter();else{var d=l.filter.split(" ");o.find("> tbody > tr").hide().addClass("footable-filtered");var s=o.find("> tbody > tr:not(.footable-row-detail)");e.each(d,function(e,t){t&&t.length>0&&(o.data("current-filter",t),s=s.filter(i.options.filter.filterFunction))}),s.each(function(){t.showRow(this,i),e(this).removeClass("footable-filtered")}),o.data("filter-string",l.filter),i.raise("footable_filtered",{filter:l.filter,clear:!1})}},t.clearFilter=function(){var a=t.footable,i=e(a.table);i.find("> tbody > tr:not(.footable-row-detail)").removeClass("footable-filtered").each(function(){t.showRow(this,a)}),i.removeData("filter-string"),a.raise("footable_filtered",{clear:!0})},t.showRow=function(t,a){var i=e(t),o=i.next(),n=e(a.table);i.is(":visible")||(n.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(t)):i.show())}}if(t.footable===undefined||null===t.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={filter:{enabled:!0,input:".footable-filter",timeout:300,minimum:2,disableEnter:!1,filterFunction:function(){var t=e(this),a=t.parents("table:first"),i=a.data("current-filter").toUpperCase(),o=t.find("td").text();return a.data("filter-text-only")||t.find("td[data-value]").each(function(){o+=e(this).data("value")}),o.toUpperCase().indexOf(i)>=0}}};t.footable.plugins.register(a,i)})(jQuery,window);
@@ -1,184 +1,240 @@
1
1
  (function ($, w, undefined) {
2
- if (w.footable === undefined || w.footable === null)
3
- throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.');
4
-
5
- var defaults = {
6
- paginate: true,
7
- pageSize: 10,
8
- pageNavigation: '.pagination',
9
- firstText: '&laquo;',
2
+ if (w.footable === undefined || w.footable === null)
3
+ throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.');
4
+
5
+ var defaults = {
6
+ paginate: true,
7
+ pageSize: 10,
8
+ pageNavigation: '.pagination',
9
+ firstText: '&laquo;',
10
10
  previousText: '&lsaquo;',
11
11
  nextText: '&rsaquo;',
12
- lastText: '&raquo;'
13
- };
14
-
15
- function pageInfo(ft) {
16
- var $table = $(ft.table), $tbody = $table.find('> tbody');
17
- this.pageNavigation = $table.data('page-navigation') || ft.options.pageNavigation;
18
- this.pageSize = $table.data('page-size') || ft.options.pageSize;
19
- this.firstText = $table.data('page-first-text') || ft.options.firstText;
20
- this.previousText = $table.data('page-previous-text') || ft.options.previousText;
21
- this.nextText = $table.data('page-next-text') || ft.options.nextText;
22
- this.lastText = $table.data('page-last-text') || ft.options.lastText;
23
- this.currentPage = 0;
24
- this.pages = [];
25
- this.control = false;
26
- }
27
-
28
- function Paginate() {
29
- var p = this;
30
- p.name = 'Footable Paginate';
31
-
32
- p.init = function (ft) {
33
- if (ft.options.paginate === true) {
34
- if ($(ft.table).data('page') === false) return;
35
- $(ft.table).bind({
36
- 'footable_initialized': function () {
37
- ft.pageInfo = new pageInfo(ft);
38
- ft.raise('footable_setup_paging');
39
- },
40
- 'footable_row_removed footable_redrawn footable_sorted footable_filtered footable_setup_paging': function () {
41
- if (ft.pageInfo) {
42
- p.setupPaging(ft);
43
- }
44
- }
45
- });
46
- }
47
- };
48
-
49
- p.setupPaging = function(ft) {
50
- var $tbody = $(ft.table).find('> tbody');
12
+ lastText: '&raquo;',
13
+ limitNavigation: 0,
14
+ limitPreviousText: '...',
15
+ limitNextText: '...'
16
+ };
17
+
18
+ function pageInfo(ft) {
19
+ var $table = $(ft.table), data = $table.data();
20
+ this.pageNavigation = data.pageNavigation || ft.options.pageNavigation;
21
+ this.pageSize = data.pageSize || ft.options.pageSize;
22
+ this.firstText = data.firstText || ft.options.firstText;
23
+ this.previousText = data.previousText || ft.options.previousText;
24
+ this.nextText = data.nextText || ft.options.nextText;
25
+ this.lastText = data.lastText || ft.options.lastText;
26
+ this.limitNavigation = parseInt(data.limitNavigation || ft.options.limitNavigation || defaults.limitNavigation, 10);
27
+ this.limitPreviousText = data.limitPreviousText || ft.options.limitPreviousText;
28
+ this.limitNextText = data.limitNextText || ft.options.limitNextText;
29
+ this.limit = this.limitNavigation > 0;
30
+ this.currentPage = 0;
31
+ this.pages = [];
32
+ this.control = false;
33
+ }
34
+
35
+ function Paginate() {
36
+ var p = this;
37
+ p.name = 'Footable Paginate';
38
+
39
+ p.init = function (ft) {
40
+ if (ft.options.paginate === true) {
41
+ if ($(ft.table).data('page') === false) return;
42
+ p.footable = ft;
43
+ $(ft.table)
44
+ .unbind('.paging')
45
+ .bind({
46
+ 'footable_initialized.paging footable_row_removed.paging footable_redrawn.paging footable_sorted.paging footable_filtered.paging': function () {
47
+ p.setupPaging();
48
+ }
49
+ })
50
+ //save the filter object onto the table so we can access it later
51
+ .data('footable-paging', p);
52
+ }
53
+ };
54
+
55
+ p.setupPaging = function () {
56
+ var ft = p.footable,
57
+ $tbody = $(ft.table).find('> tbody');
58
+
59
+ ft.pageInfo = new pageInfo(ft);
60
+
51
61
  p.createPages(ft, $tbody);
52
62
  p.createNavigation(ft, $tbody);
53
63
  p.fillPage(ft, $tbody, ft.pageInfo.currentPage);
54
64
  };
55
65
 
56
- p.createPages = function (ft, tbody) {
57
- var pages = 1;
58
- var info = ft.pageInfo;
59
- var pageCount = pages * info.pageSize;
60
- var page = [];
61
- var lastPage = [];
62
- info.pages = [];
63
- var rows = tbody.find('> tr:not(.footable-filtered,.footable-row-detail)');
64
- rows.each(function (i, row) {
65
- page.push(row);
66
- if (i === pageCount - 1) {
67
- info.pages.push(page);
68
- pages++;
69
- pageCount = pages * info.pageSize;
70
- page = [];
71
- } else if (i >= rows.length - (rows.length % info.pageSize)) {
72
- lastPage.push(row);
73
- }
74
- });
75
- if (lastPage.length > 0) info.pages.push(lastPage);
76
- if (info.currentPage >= info.pages.length) info.currentPage = info.pages.length - 1;
77
- if (info.currentPage < 0) info.currentPage = 0;
78
- if (info.pages.length === 1) {
79
- //we only have a single page
80
- $(ft.table).addClass('no-paging');
81
- } else {
82
- $(ft.table).removeClass('no-paging');
83
- }
84
- };
85
-
86
- p.createNavigation = function (ft, tbody) {
87
- var $nav = $(ft.table).find(ft.pageInfo.pageNavigation);
66
+ p.createPages = function (ft, tbody) {
67
+ var pages = 1;
68
+ var info = ft.pageInfo;
69
+ var pageCount = pages * info.pageSize;
70
+ var page = [];
71
+ var lastPage = [];
72
+ info.pages = [];
73
+ var rows = tbody.find('> tr:not(.footable-filtered,.footable-row-detail)');
74
+ rows.each(function (i, row) {
75
+ page.push(row);
76
+ if (i === pageCount - 1) {
77
+ info.pages.push(page);
78
+ pages++;
79
+ pageCount = pages * info.pageSize;
80
+ page = [];
81
+ } else if (i >= rows.length - (rows.length % info.pageSize)) {
82
+ lastPage.push(row);
83
+ }
84
+ });
85
+ if (lastPage.length > 0) info.pages.push(lastPage);
86
+ if (info.currentPage >= info.pages.length) info.currentPage = info.pages.length - 1;
87
+ if (info.currentPage < 0) info.currentPage = 0;
88
+ if (info.pages.length === 1) {
89
+ //we only have a single page
90
+ $(ft.table).addClass('no-paging');
91
+ } else {
92
+ $(ft.table).removeClass('no-paging');
93
+ }
94
+ };
95
+
96
+ p.createNavigation = function (ft, tbody) {
97
+ var $nav = $(ft.table).find(ft.pageInfo.pageNavigation);
88
98
  //if we cannot find the navigation control within the table, then try find it outside
89
99
  if ($nav.length === 0) {
90
100
  $nav = $(ft.pageInfo.pageNavigation);
91
101
  //if the navigation control is inside another table, then get out
92
- if ($nav.parents('table:first') !== $(ft.table)) return;
102
+ if ($nav.parents('table:first').length > 0 && $nav.parents('table:first') !== $(ft.table)) return;
93
103
  //if we found more than one navigation control, write error to console
94
104
  if ($nav.length > 1 && ft.options.debug === true) console.error('More than one pagination control was found!');
95
105
  }
96
106
  //if we still cannot find the control, then don't do anything
97
- if ($nav.length === 0) return;
107
+ if ($nav.length === 0) return;
98
108
  //if the nav is not a UL, then find or create a UL
99
109
  if (!$nav.is('ul')) {
100
- if ($nav.find('ul:first').length === 0) { $nav.append('<ul />'); }
110
+ if ($nav.find('ul:first').length === 0) {
111
+ $nav.append('<ul />');
112
+ }
101
113
  $nav = $nav.find('ul');
102
114
  }
103
- $nav.find('li').remove();
104
- var info = ft.pageInfo;
105
- info.control = $nav;
106
- if (info.pages.length > 0) {
107
- $nav.append('<li class="footable-page-arrow"><a data-page="first" href="#first">'+ft.pageInfo.firstText+'</a>');
108
- $nav.append('<li class="footable-page-arrow"><a data-page="prev" href="#prev">'+ft.pageInfo.previousText+'</a></li>');
109
- $.each(info.pages, function (i, page) {
110
- if (page.length > 0) {
111
- $nav.append('<li class="footable-page"><a data-page="' + i + '" href="#">' + (i + 1) + '</a></li>');
112
- }
113
- });
114
- $nav.append('<li class="footable-page-arrow"><a data-page="next" href="#next">'+ft.pageInfo.nextText+'</a></li>');
115
- $nav.append('<li class="footable-page-arrow"><a data-page="last" href="#last">'+ft.pageInfo.lastText+'</a></li>');
116
- }
117
- $nav.find('a').click(function (e) {
118
- e.preventDefault();
119
- var page = $(this).data('page');
120
- var newPage = info.currentPage;
121
- if (page === 'first') {
122
- newPage = 0;
123
- } else if (page === 'prev') {
124
- if (newPage > 0) newPage--;
125
- } else if (page === 'next') {
126
- if (newPage < info.pages.length - 1) newPage++;
127
- } else if (page === 'last') {
128
- newPage = info.pages.length - 1;
129
- } else {
130
- newPage = page;
131
- }
132
- p.paginate(ft, newPage);
133
- });
115
+ $nav.find('li').remove();
116
+ var info = ft.pageInfo;
117
+ info.control = $nav;
118
+ if (info.pages.length > 0) {
119
+ $nav.append('<li class="footable-page-arrow"><a data-page="first" href="#first">' + ft.pageInfo.firstText + '</a>');
120
+ $nav.append('<li class="footable-page-arrow"><a data-page="prev" href="#prev">' + ft.pageInfo.previousText + '</a></li>');
121
+ if (info.limit){
122
+ $nav.append('<li class="footable-page-arrow"><a data-page="limit-prev" href="#limit-prev">' + ft.pageInfo.limitPreviousText + '</a></li>');
123
+ }
124
+ if (!info.limit){
125
+ $.each(info.pages, function (i, page) {
126
+ if (page.length > 0) {
127
+ $nav.append('<li class="footable-page"><a data-page="' + i + '" href="#">' + (i + 1) + '</a></li>');
128
+ }
129
+ });
130
+ }
131
+ if (info.limit){
132
+ $nav.append('<li class="footable-page-arrow"><a data-page="limit-next" href="#limit-next">' + ft.pageInfo.limitNextText + '</a></li>');
133
+ p.createLimited($nav, info, 0);
134
+ }
135
+ $nav.append('<li class="footable-page-arrow"><a data-page="next" href="#next">' + ft.pageInfo.nextText + '</a></li>');
136
+ $nav.append('<li class="footable-page-arrow"><a data-page="last" href="#last">' + ft.pageInfo.lastText + '</a></li>');
137
+ }
138
+ $nav.off('click', 'a[data-page]').on('click', 'a[data-page]', function (e) {
139
+ e.preventDefault();
140
+ var page = $(this).data('page');
141
+ var newPage = info.currentPage;
142
+ if (page === 'first') {
143
+ newPage = 0;
144
+ } else if (page === 'prev') {
145
+ if (newPage > 0) newPage--;
146
+ } else if (page === 'next') {
147
+ if (newPage < info.pages.length - 1) newPage++;
148
+ } else if (page === 'last') {
149
+ newPage = info.pages.length - 1;
150
+ } else if (page === 'limit-prev') {
151
+ newPage = -1;
152
+ var first = $nav.find('.footable-page:first a').data('page');
153
+ p.createLimited($nav, info, first - info.limitNavigation);
154
+ p.setPagingClasses($nav, info.currentPage, info.pages.length);
155
+ } else if (page === 'limit-next') {
156
+ newPage = -1;
157
+ var last = $nav.find('.footable-page:last a').data('page');
158
+ p.createLimited($nav, info, last + 1);
159
+ p.setPagingClasses($nav, info.currentPage, info.pages.length);
160
+ } else {
161
+ newPage = page;
162
+ }
163
+ if (newPage >= 0){
164
+ if (info.limit && info.currentPage != newPage){
165
+ var start = newPage;
166
+ while (start % info.limitNavigation !== 0){ start -= 1; }
167
+ p.createLimited($nav, info, start);
168
+ }
169
+ p.paginate(ft, newPage);
170
+ }
171
+ });
134
172
  p.setPagingClasses($nav, info.currentPage, info.pages.length);
135
- };
173
+ };
174
+
175
+ p.createLimited = function(nav, info, start){
176
+ start = start || 0;
177
+ nav.find('li.footable-page').remove();
178
+ var i, page,
179
+ $prev = nav.find('li.footable-page-arrow > a[data-page="limit-prev"]').parent(),
180
+ $next = nav.find('li.footable-page-arrow > a[data-page="limit-next"]').parent();
181
+ for (i = info.pages.length - 1; i >=0 ; i--){
182
+ page = info.pages[i];
183
+ if (i >= start && i < start + info.limitNavigation && page.length > 0) {
184
+ $prev.after('<li class="footable-page"><a data-page="' + i + '" href="#">' + (i + 1) + '</a></li>');
185
+ }
186
+ }
187
+ if (start === 0){ $prev.hide(); }
188
+ else { $prev.show(); }
189
+ if (start + info.limitNavigation >= info.pages.length){ $next.hide(); }
190
+ else { $next.show(); }
191
+ };
136
192
 
137
- p.paginate = function (ft, newPage) {
138
- var info = ft.pageInfo;
139
- if (info.currentPage !== newPage) {
140
- var $tbody = $(ft.table).find('> tbody');
193
+ p.paginate = function (ft, newPage) {
194
+ var info = ft.pageInfo;
195
+ if (info.currentPage !== newPage) {
196
+ var $tbody = $(ft.table).find('> tbody');
141
197
 
142
- //raise a pre-pagin event so that we can cancel the paging if needed
143
- var event = ft.raise('footable_paging', { page: newPage, size: info.pageSize });
144
- if (event && event.result === false) return;
198
+ //raise a pre-pagin event so that we can cancel the paging if needed
199
+ var event = ft.raise('footable_paging', { page: newPage, size: info.pageSize });
200
+ if (event && event.result === false) return;
145
201
 
146
- p.fillPage(ft, $tbody, newPage);
147
- info.control.find('li').removeClass('active disabled');
148
- p.setPagingClasses(info.control, info.currentPage, info.pages.length);
149
- }
150
- };
202
+ p.fillPage(ft, $tbody, newPage);
203
+ info.control.find('li').removeClass('active disabled');
204
+ p.setPagingClasses(info.control, info.currentPage, info.pages.length);
205
+ }
206
+ };
151
207
 
152
- p.setPagingClasses = function(nav, currentPage, pageCount) {
153
- nav.find('li.footable-page > a[data-page=' + currentPage + ']').parent().addClass('active');
208
+ p.setPagingClasses = function (nav, currentPage, pageCount) {
209
+ nav.find('li.footable-page > a[data-page=' + currentPage + ']').parent().addClass('active');
154
210
  if (currentPage >= pageCount - 1) {
155
211
  nav.find('li.footable-page-arrow > a[data-page="next"]').parent().addClass('disabled');
156
- nav.find('li.footable-page-arrow > a[data-page="last"]').parent().addClass('disabled');
212
+ nav.find('li.footable-page-arrow > a[data-page="last"]').parent().addClass('disabled');
157
213
  }
158
214
  if (currentPage < 1) {
159
- nav.find('li.footable-page-arrow > a[data-page="first"]').parent().addClass('disabled');
215
+ nav.find('li.footable-page-arrow > a[data-page="first"]').parent().addClass('disabled');
160
216
  nav.find('li.footable-page-arrow > a[data-page="prev"]').parent().addClass('disabled');
161
217
  }
162
218
  };
163
219
 
164
- p.fillPage = function (ft, tbody, pageNumber) {
165
- ft.pageInfo.currentPage = pageNumber;
166
- tbody.find('> tr').hide();
167
- $(ft.pageInfo.pages[pageNumber]).each(function () {
168
- p.showRow(this, ft);
169
- });
170
- };
171
-
172
- p.showRow = function (row, ft) {
173
- var $row = $(row), $next = $row.next(), $table = $(ft.table);
174
- if ($table.hasClass('breakpoint') && $row.hasClass('footable-detail-show') && $next.hasClass('footable-row-detail')) {
175
- $row.add($next).show();
176
- ft.createOrUpdateDetailRow(row);
177
- }
178
- else $row.show();
179
- };
180
- }
181
-
182
- w.footable.plugins.register(Paginate, defaults);
220
+ p.fillPage = function (ft, tbody, pageNumber) {
221
+ ft.pageInfo.currentPage = pageNumber;
222
+ tbody.find('> tr').hide();
223
+ $(ft.pageInfo.pages[pageNumber]).each(function () {
224
+ p.showRow(this, ft);
225
+ });
226
+ };
227
+
228
+ p.showRow = function (row, ft) {
229
+ var $row = $(row), $next = $row.next(), $table = $(ft.table);
230
+ if ($table.hasClass('breakpoint') && $row.hasClass('footable-detail-show') && $next.hasClass('footable-row-detail')) {
231
+ $row.add($next).show();
232
+ ft.createOrUpdateDetailRow(row);
233
+ }
234
+ else $row.show();
235
+ };
236
+ }
237
+
238
+ w.footable.plugins.register(Paginate, defaults);
183
239
 
184
240
  })(jQuery, window);