text: /*
    backgrid-paginator
    http://github.com/wyuenho/backgrid
  
    Copyright (c) 2013 Jimmy Yuen Ho Wong
    Licensed under the MIT @license.
  */
  (function(e,t,a,s){"use strict";s.Extension.Paginator=s.Footer.extend({className:"paginator",windowSize:10,fastForwardHandleLabels:{first:"《",prev:"〈",next:"〉",last:"》"},template:t.template('<tr><td colspan="<%= colspan %>"><ul><% _.each(handles, function (handle) { %><li <% if (handle.className) { %>class="<%= handle.className %>"<% } %>><a href="#" <% if (handle.title) {%> title="<%= handle.title %>"<% } %>><%= handle.label %></a></li><% }); %></ul></td></tr>'),events:{"click a":"changePage"},initialize:function(e){s.Footer.prototype.initialize.call(this,e);var t=this.columns;this.listenTo(t,"add",this.render),this.listenTo(t,"remove",this.render),this.listenTo(t,"change:renderable",this.render);var a=this.collection,i=a.fullCollection;i?(this.listenTo(i,"add",this.render),this.listenTo(i,"remove",this.render),this.listenTo(i,"reset",this.render)):(this.listenTo(a,"add",this.render),this.listenTo(a,"remove",this.render),this.listenTo(a,"reset",this.render))},changePage:function(t){t.preventDefault();var a=e(t.target).text(),s=this.fastForwardHandleLabels,i=this.collection;if(s)switch(a){case s.first:return i.getFirstPage(),void 0;case s.prev:return i.hasPrevious()&&i.getPreviousPage(),void 0;case s.next:return i.hasNext()&&i.getNextPage(),void 0;case s.last:return i.getLastPage(),void 0}var r=i.state,l=1*e(t.target).text();i.getPage(0===r.firstPage?l-1:l)},makeHandles:function(){var e=[],t=this.collection,a=t.state,s=a.lastPage?a.lastPage:a.firstPage;s=0===a.firstPage?s:s-1;var i=0===a.firstPage?a.currentPage:a.currentPage-1,r=Math.floor(i/this.windowSize)*this.windowSize,l=r+this.windowSize;if(l=s>=l?l:s+1,"infinite"!==t.mode)for(var n=r;l>n;n++)e.push({label:n+1,title:"No. "+(n+1),className:i===n?"active":void 0});var o=this.fastForwardHandleLabels;return o&&(o.prev&&e.unshift({label:o.prev,className:t.hasPrevious()?void 0:"disabled"}),o.first&&e.unshift({label:o.first,className:t.hasPrevious()?void 0:"disabled"}),o.next&&e.push({label:o.next,className:t.hasNext()?void 0:"disabled"}),o.last&&e.push({label:o.last,className:t.hasNext()?void 0:"disabled"})),e},render:function(){this.$el.empty();var a=t.reduce(this.columns.pluck("renderable"),function(e,t){return t?e+1:e},0);return this.$el.append(e(this.template({colspan:a,handles:this.makeHandles()}))),this.delegateEvents(),this}})})(jQuery,_,Backbone,Backgrid);