o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1383740409.3479931: @value"g {I" class:EFI"BundledAsset;FI"logical_path;FI")iugu-ux/components/base_resources.js;TI" pathname;FI"k/Users/alezonez/Projetos/iugu-ux/vendor/assets/javascripts/iugu-ux/components/base_resources.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-07-12T09:50:36-03:00;FI" length;Fig I" digest;F"%a442f8ff8230d966e42605eb912083f2I" source;FI"g (function() { window.app.BaseResources = Backbone.Paginator.requestPager.extend({ initialize: function() { return this.server_api = { 'limit': function() { return this.perPage; }, 'start': function() { return (this.currentPage - 1) * this.perPage; }, 'api_token': function() { return api_token; } }; }, paginator_ui: { firstPage: 1, currentPage: 1, perPage: 30 }, configureFilter: function(param, value) { this.server_api[param] = value; return this.trigger('configured-filter', param); }, configureAjax: function() { return app.ajaxSetup({ headers: { Authorization: $.base64.encode(api_token) } }); }, getFilter: function(param) { return this.server_api[param]; }, removeFilter: function(param) { delete this.server_api[param]; return this.trigger("removed-filter:" + param); }, removeFiltersEndingWith: function(param) { var self; self = this; return _.each(this.server_api, function(value, key) { var _regex; _regex = new RegExp("" + param + "$"); if (key.match(_regex)) { return self.removeFilter(key); } }); }, parse: function(response) { this.totalRecords = response.totalItems; this.facets = response.facets; this.totalPages = Math.ceil(this.totalRecords / this.perPage); return response.items || response; }, buildChangedPageEventOptions: function() { var that; that = this; return { success: (function(collection, response) { return that.trigger('changed-page:success'); }), error: (function(collection, response) { return that.trigger('changed-page:error'); }) }; }, gotoFirst: function() { return this.goTo(this.information.firstPage, this.buildChangedPageEventOptions()); }, gotoLast: function() { return this.goTo(this.information.lastPage, this.buildChangedPageEventOptions()); }, gotoPage: function(page) { return this.goTo(page, this.buildChangedPageEventOptions()); }, gotoNext: function() { if (this.information.currentPage < this.information.lastPage) { return this.requestNextPage(this.buildChangedPageEventOptions()); } }, gotoPrevious: function() { if (this.information.currentPage > 1) { return this.requestPreviousPage(this.buildChangedPageEventOptions()); } }, disablePagination: function() { return this.perPage = 9223372036854775807; }, destroy: function(object) { if (object.id != null) { object.set('_destroy', true); return this.trigger('remove'); } else { return this.remove(object); } } }); }).call(this); ;FI"required_assets_digest;F"%ab16dfe8e28eb2cf398e6cc8cc4fd45dI" _version;F"%6776f581a4329e299531e1d52aa59832