diff options
author | Jason Robinson <mail@jasonrobinson.me> | 2014-02-19 00:10:09 +0400 |
---|---|---|
committer | Jason Robinson <mail@jasonrobinson.me> | 2014-02-19 00:10:09 +0400 |
commit | a8431430f045d15c684e5ae7f2fe249af82df24b (patch) | |
tree | 47f9696c375e52cb157c808e72274828aa33f177 | |
parent | d5a9939c31044009aa5566ab656aef6764b64c28 (diff) | |
parent | 2a15339f444c256198c5c8780bc79f6229086041 (diff) |
Merge branch 'hotfix/0.3.0.2'v0.3.0.2
-rw-r--r-- | Changelog.md | 8 | ||||
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | app/assets/javascripts/app/models/stream.js | 13 | ||||
-rw-r--r-- | app/assets/javascripts/app/models/stream_aspects.js | 7 | ||||
-rw-r--r-- | app/assets/javascripts/app/views/hovercard_view.js | 2 | ||||
-rw-r--r-- | config/defaults.yml | 2 | ||||
-rw-r--r-- | config/initializers/oembed.rb | 2 | ||||
-rw-r--r-- | features/step_definitions/oembed_steps.rb | 4 | ||||
-rw-r--r-- | spec/controllers/jasmine_fixtures/aspects_spec.rb | 2 | ||||
-rw-r--r-- | spec/helpers/o_embed_helper_spec.rb | 8 | ||||
-rw-r--r-- | spec/javascripts/app/models/stream_aspects_spec.js | 28 |
11 files changed, 59 insertions, 19 deletions
diff --git a/Changelog.md b/Changelog.md index 38e26bf25..3ef922a2e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,11 @@ +# 0.3.0.2 + +## Bug fixes +* Use youtube HTTPS scheme for oEmbed [#4743](https://github.com/diaspora/diaspora/pull/4743) +* Fix infinite scroll on aspect streams [#4729](https://github.com/diaspora/diaspora/issues/4729) +* Fix hovercards [#4782](https://github.com/diaspora/diaspora/pull/4782) +* Bump kaminari to fix admin panel [#4714](https://github.com/diaspora/diaspora/issues/4714) + # 0.3.0.1 ## Bug fixes diff --git a/Gemfile.lock b/Gemfile.lock index f0069cccd..5dd83dfa5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -208,7 +208,7 @@ GEM json (1.8.1) jwt (0.1.10) multi_json (>= 1.5) - kaminari (0.15.0) + kaminari (0.15.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.8.1) diff --git a/app/assets/javascripts/app/models/stream.js b/app/assets/javascripts/app/models/stream.js index f417016fc..4cf5ff737 100644 --- a/app/assets/javascripts/app/models/stream.js +++ b/app/assets/javascripts/app/models/stream.js @@ -15,13 +15,18 @@ app.models.Stream = Backbone.Collection.extend({ return _.any(this.items.models) ? this.timeFilteredPath() : this.basePath() }, + _fetchOpts: function(opts) { + var defaultOpts = { + remove: false // tell backbone to keep existing items in the collection + }; + return _.extend({}, defaultOpts, opts); + }, + fetch: function() { if( this.isFetching() ) return false; var url = this.url(); - this.deferred = this.items.fetch({ - remove : false, - url : url - }).done(_.bind(this.triggerFetchedEvents, this)) + this.deferred = this.items.fetch(this._fetchOpts({url : url})) + .done(_.bind(this.triggerFetchedEvents, this)); }, isFetching : function() { diff --git a/app/assets/javascripts/app/models/stream_aspects.js b/app/assets/javascripts/app/models/stream_aspects.js index f8536c65d..4dc97899e 100644 --- a/app/assets/javascripts/app/models/stream_aspects.js +++ b/app/assets/javascripts/app/models/stream_aspects.js @@ -18,10 +18,7 @@ app.models.StreamAspects = app.models.Stream.extend({ if(this.isFetching()){ return false } var url = this.url(); var ids = this.aspects_ids; - this.deferred = this.items.fetch({ - add : true, - url : url, - data : { 'a_ids': ids } - }).done(_.bind(this.triggerFetchedEvents, this)) + this.deferred = this.items.fetch(this._fetchOpts({url : url, data : { 'a_ids': ids }})) + .done(_.bind(this.triggerFetchedEvents, this)); } }); diff --git a/app/assets/javascripts/app/views/hovercard_view.js b/app/assets/javascripts/app/views/hovercard_view.js index 28fd274da..89d76cd3f 100644 --- a/app/assets/javascripts/app/views/hovercard_view.js +++ b/app/assets/javascripts/app/views/hovercard_view.js @@ -69,7 +69,7 @@ app.views.Hovercard = Backbone.View.extend({ hc.prependTo(el); this._positionHovercard(); this._populateHovercard(); - }, 500, true), + }, 500), _populateHovercard: function() { var href = this.href(); diff --git a/config/defaults.yml b/config/defaults.yml index d798a4155..f9c2a2e93 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -4,7 +4,7 @@ defaults: version: - number: "0.3.0.1" # Do not touch unless doing a release, do not backport the version number that's in master but keep develop to always say "head" + number: "0.3.0.2" # Do not touch unless doing a release, do not backport the version number that's in master but keep develop to always say "head" heroku: false environment: url: "http://localhost:3000/" diff --git a/config/initializers/oembed.rb b/config/initializers/oembed.rb index e8334cdad..bf0fc2092 100644 --- a/config/initializers/oembed.rb +++ b/config/initializers/oembed.rb @@ -15,6 +15,8 @@ oembed_provider_list = [ OEmbed::Providers::Flickr ] +OEmbed::Providers::Youtube.endpoint += "?scheme=https" + oembed_providers = YAML.load_file(Rails.root.join("config", "oembed_providers.yml")) oembed_providers.each do |provider_name, provider| diff --git a/features/step_definitions/oembed_steps.rb b/features/step_definitions/oembed_steps.rb index 9a6bc29b8..7732146a0 100644 --- a/features/step_definitions/oembed_steps.rb +++ b/features/step_definitions/oembed_steps.rb @@ -41,7 +41,7 @@ Given /^I have several oEmbed data in cache$/ do "thumbnail_width" => 480, }, "link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json", - "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", + "oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", }, "unsecure_video" => { @@ -86,7 +86,7 @@ Given /^I have several oEmbed data in cache$/ do "thumbnail_width" => 480, }, "link_url" => "http://yourichtube.com/watch?v=M3r2XDceM6A&format=json", - "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", + "oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", }, "unsecure_rich" => { diff --git a/spec/controllers/jasmine_fixtures/aspects_spec.rb b/spec/controllers/jasmine_fixtures/aspects_spec.rb index 30454e1b8..7cb66843b 100644 --- a/spec/controllers/jasmine_fixtures/aspects_spec.rb +++ b/spec/controllers/jasmine_fixtures/aspects_spec.rb @@ -79,7 +79,7 @@ describe StreamsController do stub_request( :get, - "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://www.youtube.com/watch?v=UYrkQL1bX4A" + "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://www.youtube.com/watch?v=UYrkQL1bX4A" ).with( :headers => {'Accept'=>'*/*'} ).to_return( diff --git a/spec/helpers/o_embed_helper_spec.rb b/spec/helpers/o_embed_helper_spec.rb index 36bf4ded9..3668a6783 100644 --- a/spec/helpers/o_embed_helper_spec.rb +++ b/spec/helpers/o_embed_helper_spec.rb @@ -29,7 +29,7 @@ describe OEmbedHelper do "type" => "video", "width" => 425, "height" => 344, - 'trusted_endpoint_url' => ::OEmbed::Providers::Youtube.endpoint, + "trusted_endpoint_url" => ::OEmbed::Providers::Youtube.endpoint, "title" => "Amazing Nintendo Facts", "html" => "<object width=\"425\" height=\"344\"> <param name=\"movie\" value=\"http://www.youtube.com/v/M3r2XDceM6A&fs=1\"></param> @@ -41,7 +41,7 @@ describe OEmbedHelper do </object>", }, "link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json", - "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", + "oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", }, "unsecure_video" => { @@ -69,7 +69,7 @@ describe OEmbedHelper do "type" => "rich", "width" => 425, "height" => 344, - 'trusted_endpoint_url' => ::OEmbed::Providers::Youtube.endpoint, + "trusted_endpoint_url" => ::OEmbed::Providers::Youtube.endpoint, "title" => "Amazing Nintendo Facts", "html" => "<object width=\"425\" height=\"344\"> <param name=\"movie\" value=\"http://www.youtube.com/v/M3r2XDceM6A&fs=1\"></param> @@ -81,7 +81,7 @@ describe OEmbedHelper do </object>", }, "link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json", - "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", + "oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", }, "unsecure_rich" => { diff --git a/spec/javascripts/app/models/stream_aspects_spec.js b/spec/javascripts/app/models/stream_aspects_spec.js new file mode 100644 index 000000000..f6d99195c --- /dev/null +++ b/spec/javascripts/app/models/stream_aspects_spec.js @@ -0,0 +1,28 @@ +describe("app.models.StreamAspects", function() { + describe("#fetch", function(){ + var fetch, + stream; + + beforeEach(function(){ + fetch = new $.Deferred(); + stream = new app.models.StreamAspects([], {aspects_ids: [1,2]}); + spyOn(stream.items, "fetch").andCallFake(function(options){ + stream.items.set([{name: 'a'}, {name: 'b'}, {name: 'c'}], options); + fetch.resolve(); + return fetch; + }); + }); + + it("fetches some posts", function(){ + stream.fetch(); + expect(stream.items.length).toEqual(3); + }); + + it("fetches more posts", function(){ + stream.fetch(); + expect(stream.items.length).toEqual(3); + stream.fetch(); + expect(stream.items.length).toEqual(6); + }); + }); +}); |