o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1372441620.9449651: @value"“ {I" class:EFI"ProcessedAsset;FI"logical_path;F"4iugu-ux/components/usecode/iugu-ui-paginator.jsI" pathname;F"|/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-paginator.js.coffeeI"content_type;FI"application/javascript;FI" mtime;FI"2013-01-08T11:07:36-02:00;FI" length;Fiè I" digest;F"%b8023b3f5ceb4c0b283b97ba6620ad53I" source;FI"è (function() { var _ref, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; IuguUI.Paginator = (function(_super) { __extends(Paginator, _super); function Paginator() { _ref = Paginator.__super__.constructor.apply(this, arguments); return _ref; } Paginator.prototype.layout = "iugu-ui-paginator"; Paginator.prototype.defaults = { numberOfPageButtons: 9, enableAdditionalButtons: true }; Paginator.prototype.events = { 'click a.page': 'gotoPage', 'click a.next': function() { this.handleEvent('next'); return false; }, 'click a.previous': function() { this.handleEvent('previous'); return false; } }; Paginator.prototype.initialize = function() { return Paginator.__super__.initialize.apply(this, arguments); }; Paginator.prototype.context = function() { return { currentPage: 1, firstPage: 1, lastPage: 1, enableAdditionalButtons: this.options.enableAdditionalButtons, pageButtons: this.pageButtonsToShow(10, 1, 10, 1) }; }; Paginator.prototype.currentPage = 1; Paginator.prototype.gotoPage = function(e) { e.preventDefault(); if ($(e.target).text() === '...') { return; } this.currentPage = $(e.target).text(); return this.handleEvent('change-page'); }; Paginator.prototype.pageButtonsToShow = function(numberOfButtons, firstPage, totalPages, currentPage) { var begin, end, offset, surrounding; if (!totalPages) { return; } if (numberOfButtons > totalPages) { return _.range(2, totalPages); } surrounding = (numberOfButtons - 3) / 2; begin = currentPage - Math.floor(surrounding); end = currentPage + Math.ceil(surrounding); if (begin <= firstPage + 1) { offset = firstPage + 1 - begin; begin += offset; end += offset; } else if (end >= totalPages - 1) { offset = totalPages - end - 1; begin += offset; end += offset; } return _.range(begin, end + 1); }; return Paginator; })(IuguUI.Base); this.IuguUI.Paginator = IuguUI.Paginator; }).call(this); ;TI"dependency_digest;F"%a04d6e37b8cdf9372a9fbc8a08cac8afI"required_paths;F["|/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-paginator.js.coffeeI"dependency_paths;F[{I" path;F"|/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-paginator.js.coffeeI" mtime;FI"2013-01-08T11:07:36-02:00;FI" digest;F"%0b4a1f78c4e65cf8626867a50866cf60I" _version;F"%6776f581a4329e299531e1d52aa59832