From f2e079f53240a406650c8d0fdd21ff7abec1408b Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 15:04:51 -0700 Subject: [PATCH 1/3] Revert "Move the include of splunklogging into the appconfig check" This reverts commit 25752e9f93a48bdeb292438208bba0e51f6fed0c. --- config/initializers/_splunk_logger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/_splunk_logger.rb b/config/initializers/_splunk_logger.rb index 3c13a8c5a..5cb075836 100644 --- a/config/initializers/_splunk_logger.rb +++ b/config/initializers/_splunk_logger.rb @@ -1,5 +1,5 @@ if AppConfig[:enable_splunk_logging] require File.expand_path('../../../lib/log_overrider', __FILE__) - Rails.logger.class.send(:include, SplunkLogging) end +Rails.logger.class.send(:include, SplunkLogging) From a5d9d6d212d5793af21b13587e5c895f6016b628 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 15:07:25 -0700 Subject: [PATCH 2/3] Remove reference to invites counter from db seeds, close #1778 --- db/seeds.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 53e29fd9a..1800ec806 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -15,9 +15,9 @@ require 'factory_girl_rails' require File.join(File.dirname(__FILE__), "..", "spec", "helper_methods") include HelperMethods -alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth', :invites => 10) -bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth', :invites => 10) -eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth', :invites => 10) +alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth') +bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth') +eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth') print "Creating seeded users... " alice.person.profile.update_attributes(:first_name => "Alice", :last_name => "Smith", From 97ab077e04a11765c6dbc849d44922ea2c65f20a Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 16 Aug 2011 15:31:02 -0700 Subject: [PATCH 3/3] Abort old aspectFilters requests, close issue 1759. --- public/javascripts/aspect-filters.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/public/javascripts/aspect-filters.js b/public/javascripts/aspect-filters.js index 4d14c82a8..35134a89e 100644 --- a/public/javascripts/aspect-filters.js +++ b/public/javascripts/aspect-filters.js @@ -5,7 +5,7 @@ var AspectFilters = { selectedGUIDS: [], - requests: 0, + activeRequest: null, initialize: function(){ AspectFilters.initializeSelectedGUIDS(); AspectFilters.interceptAspectLinks(); @@ -39,8 +39,6 @@ var AspectFilters = { $('html, body').animate({scrollTop:0}, 'fast'); }, switchToAspect: function(aspectLi){ - AspectFilters.requests++; - var guid = aspectLi.attr('data-guid'); // select correct aspect in filter list & deselect others @@ -55,8 +53,6 @@ var AspectFilters = { $("#aspect_nav a.aspect_selector").click(function(e){ e.preventDefault(); - AspectFilters.requests++; - // loading animation AspectFilters.fadeOut(); @@ -128,11 +124,15 @@ var AspectFilters = { history.pushState(null, document.title, newURL); } - $.ajax({ + try { + AspectFilters.activeRequest.abort(); + } catch(e) {} finally { + AspectFilters.activeRequest = null; + } + AspectFilters.activeRequest = $.ajax({ url : newURL, dataType : 'script', success : function(data){ - AspectFilters.requests--; // fill in publisher // (not cached because this element changes) @@ -155,9 +155,7 @@ var AspectFilters = { Diaspora.widgets.publish("stream/reloaded"); // fade contents back in - if(AspectFilters.requests === 0){ - AspectFilters.fadeIn(); - } + AspectFilters.fadeIn(); } }); },