o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1355857733.169548: @value"®{I" class:EFI"ProcessedAsset;FI"logical_path;FI"*woople-theme/pagination/pagination.js;TI" pathname;FI"u/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/pagination/pagination.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2012-12-05T15:46:45-05:00;FI" length;Fi I" digest;F"%bd0dca2bdfb1023988a523a4945980d5I" source;FI" (function() { var Pagination; Pagination = (function() { function Pagination() {} Pagination.prototype.init = function(selector, options, debugMode) { this.selector = selector; if (options == null) { options = {}; } this.debugMode = debugMode != null ? debugMode : false; this.log('initialize'); this.options = $.extend({ container: null, timeout: 2500, scrollTo: 0 }, options); return this.setupListeners(); }; Pagination.prototype.pushStateSupported = function() { return $.support.pjax; }; Pagination.prototype.setupListeners = function() { this.log('setup listeners'); if (this.pushStateSupported()) { return this.configureWithPushState(); } else { return this.configureWithoutPushState(); } }; Pagination.prototype.configureWithPushState = function() { var _this = this; this.log('configuring with pushState support'); $.pjax.defaults.scrollTo = this.options.scrollTo; return $(document).pjax(this.selector, this.options).on('pjax:beforeSend', function(e, xhr, err) { return _this.requestStart(e, xhr, err); }).on('pjax:success', function(e, xhr, err) { return _this.requestEnd(e, xhr, err); }); }; Pagination.prototype.configureWithoutPushState = function() { var _this = this; this.log('configuring without pushState support'); return $(document).on('click', this.selector, function(e) { e.preventDefault(); return $.ajax({ url: $(e.target).attr('href'), context: _this, beforeSend: function(xhr) { xhr.setRequestHeader('X-PJAX', 'true'); return this.requestStart(e, xhr, null); }, success: function(data, textStatus, xhr) { return this.requestEnd(e, xhr, null); } }); }); }; Pagination.prototype.requestStart = function(e, xhr, err) { this.log('request is starting'); return $(this.options.container).find('table tbody').css('opacity', 0.5); }; Pagination.prototype.requestEnd = function(e, xhr, err) { this.log('request has finished'); if (!this.pushStateSupported()) { $(this.options.container).html(xhr.responseText); this.log(typeof this.options.scrollTo); if (typeof this.options.scrollTo === 'number') { $(document).scrollTop(this.options.scrollTo); } } return $(this.options.container).find('table tbody').css('opacity', 1); }; Pagination.prototype.log = function(message) { if (this.debugMode) { return console.log("[Pagination] " + message); } }; return Pagination; })(); this.Pagination = Pagination; }).call(this); ;TI"dependency_digest;F"%6b5750151fe59869e3ab179d7e694bc7I"required_paths;F[I"u/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/pagination/pagination.js.coffee;TI"dependency_paths;F[{I" path;FI"u/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/pagination/pagination.js.coffee;TI" mtime;FI"2012-12-05T15:46:45-05:00;FI" digest;F"%0e48a093aae22fb63b5c490bfbb10339I" _version;F"%6776f581a4329e299531e1d52aa59832