From d65fc17223b71d7bcbefd89a5f06f4190c58dec5 Mon Sep 17 00:00:00 2001 From: Fabian Rodriguez Date: Sun, 2 Feb 2014 21:03:51 -0200 Subject: [PATCH 1/6] bump kaminari (cherry picked from commit b5e6c2a149d0e7f84193ac08cd7b9d10af5662de) --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 405b9fd8b9274d91d0864dede25fe785cb7e9032 Mon Sep 17 00:00:00 2001 From: arlogn Date: Sat, 25 Jan 2014 23:26:53 +0100 Subject: [PATCH 2/6] embedding youtube videos over https (cherry picked from commit 1563d088bc8ff4aa7b44fe9c1d3bdf4f0e83f0be) --- config/initializers/oembed.rb | 2 ++ features/step_definitions/oembed_steps.rb | 4 ++-- spec/controllers/jasmine_fixtures/aspects_spec.rb | 2 +- spec/helpers/o_embed_helper_spec.rb | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) 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" => " @@ -41,7 +41,7 @@ describe OEmbedHelper do ", }, "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" => " @@ -81,7 +81,7 @@ describe OEmbedHelper do ", }, "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" => { From d8dd727588da4f25fda97d0de6dcccdf7591f27b Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Sun, 26 Jan 2014 19:51:12 +0100 Subject: [PATCH 3/6] fix regression caused by updating backbone.js without updating changed parameters (cherry picked from commit 09a840ea418b0a3e567a495da79abdf3f87f748c) --- app/assets/javascripts/app/models/stream.js | 13 ++++++--- .../javascripts/app/models/stream_aspects.js | 7 ++--- .../app/models/stream_aspects_spec.js | 28 +++++++++++++++++++ 3 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 spec/javascripts/app/models/stream_aspects_spec.js 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/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); + }); + }); +}); From ab9e7d80351de573f0b51eae14d73b0045c18bf7 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Fri, 14 Feb 2014 22:10:38 +0100 Subject: [PATCH 4/6] fix hovercards (cherry picked from commit a51c4f0ddccea1a8010d058b8de3281f73442ac4) Conflicts: Changelog.md --- Changelog.md | 26 +++++++++++++++++++ .../javascripts/app/views/hovercard_view.js | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 38e26bf25..3c5d535d2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,29 @@ +# Head + +## Refactor +* Drop number of followers from tags page [#4717](https://github.com/diaspora/diaspora/issues/4717) +* Remove some unused beta code [#4738](https://github.com/diaspora/diaspora/issues/4738) +* Style improvements for SPV, use original author's avatar for reshares [#4754](https://github.com/diaspora/diaspora/issue/4754) +* Update image branding to the new decided standard [#4702](https://github.com/diaspora/diaspora/pull/4702) +* Consistent naming of conversations and messages [#4756](https://github.com/diaspora/diaspora/pull/4756) +* Improve stream generation time [#4769](https://github.com/diaspora/diaspora/pull/4769) +* Port help pages to backbone [#4768](https://github.com/diaspora/diaspora/pull/4768) +* Add participants to conversations menu [#4656](https://github.com/diaspora/diaspora/pull/4656) +* Update forgot_password and reset_password pages [#4707](https://github.com/diaspora/diaspora/pull/4707) +* Change jQuery CDN to jquery.com from googleapis.com [#4765](https://github.com/diaspora/diaspora/pull/4765) + +## Bug fixes +* Improve time agos by updating the plugin [#4280](https://github.com/diaspora/diaspora/issues/4280) +* 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) +* Do not add a space after adding a mention [#4767](https://github.com/diaspora/diaspora/issues/4767) +* Fix hovercards [#4782](https://github.com/diaspora/diaspora/pull/4782) + +## Features +* You can report a single post by clicking the correct icon in the controler section [#4517](https://github.com/diaspora/diaspora/pull/4517) +* Add permalinks for comments [#4577](https://github.com/diaspora/diaspora/pull/4577) +* New menu for the mobile version [#4673](https://github.com/diaspora/diaspora/pull/4673) + # 0.3.0.1 ## Bug fixes 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(); From d6d97c17b078b58ba421b1bde5b0c9ca1bbdaffa Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Sat, 15 Feb 2014 17:04:18 +0200 Subject: [PATCH 5/6] Changelogs for 0.3.0.2, changelog for #4714 --- Changelog.md | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/Changelog.md b/Changelog.md index 3c5d535d2..3ef922a2e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,28 +1,10 @@ -# Head - -## Refactor -* Drop number of followers from tags page [#4717](https://github.com/diaspora/diaspora/issues/4717) -* Remove some unused beta code [#4738](https://github.com/diaspora/diaspora/issues/4738) -* Style improvements for SPV, use original author's avatar for reshares [#4754](https://github.com/diaspora/diaspora/issue/4754) -* Update image branding to the new decided standard [#4702](https://github.com/diaspora/diaspora/pull/4702) -* Consistent naming of conversations and messages [#4756](https://github.com/diaspora/diaspora/pull/4756) -* Improve stream generation time [#4769](https://github.com/diaspora/diaspora/pull/4769) -* Port help pages to backbone [#4768](https://github.com/diaspora/diaspora/pull/4768) -* Add participants to conversations menu [#4656](https://github.com/diaspora/diaspora/pull/4656) -* Update forgot_password and reset_password pages [#4707](https://github.com/diaspora/diaspora/pull/4707) -* Change jQuery CDN to jquery.com from googleapis.com [#4765](https://github.com/diaspora/diaspora/pull/4765) +# 0.3.0.2 ## Bug fixes -* Improve time agos by updating the plugin [#4280](https://github.com/diaspora/diaspora/issues/4280) * 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) -* Do not add a space after adding a mention [#4767](https://github.com/diaspora/diaspora/issues/4767) * Fix hovercards [#4782](https://github.com/diaspora/diaspora/pull/4782) - -## Features -* You can report a single post by clicking the correct icon in the controler section [#4517](https://github.com/diaspora/diaspora/pull/4517) -* Add permalinks for comments [#4577](https://github.com/diaspora/diaspora/pull/4577) -* New menu for the mobile version [#4673](https://github.com/diaspora/diaspora/pull/4673) +* Bump kaminari to fix admin panel [#4714](https://github.com/diaspora/diaspora/issues/4714) # 0.3.0.1 From 2a15339f444c256198c5c8780bc79f6229086041 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Sat, 15 Feb 2014 17:04:48 +0200 Subject: [PATCH 6/6] Bump version to 0.3.0.2 --- config/defaults.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/"