Update JQuery source to jquery.com

This commit is contained in:
goobertron 2014-02-05 22:07:38 +00:00
parent 11b3fe7df4
commit 23e8bfa082
4 changed files with 8 additions and 8 deletions

View file

@ -7,7 +7,7 @@
* Update image branding to the new decided standard [#4702](https://github.com/diaspora/diaspora/pull/4702) * 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) * 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) * Improve stream generation time [#4769](https://github.com/diaspora/diaspora/pull/4769)
* Change jQuery CDN to jquery.com from googleapis.com [#4765](https://github.com/diaspora/diaspora/pull/4765)
## Bug fixes ## Bug fixes
* Improve time agos by updating the plugin [#4280](https://github.com/diaspora/diaspora/issues/4280) * Improve time agos by updating the plugin [#4280](https://github.com/diaspora/diaspora/issues/4280)

View file

@ -55,7 +55,7 @@ module ApplicationHelper
buf = [] buf = []
if AppConfig.privacy.jquery_cdn? if AppConfig.privacy.jquery_cdn?
version = Jquery::Rails::JQUERY_VERSION version = Jquery::Rails::JQUERY_VERSION
buf << [ javascript_include_tag("//ajax.googleapis.com/ajax/libs/jquery/#{version}/jquery.min.js") ] buf << [ javascript_include_tag("//code.jquery.com/jquery-#{version}.min.js") ]
buf << [ javascript_tag("!window.jQuery && document.write(unescape('#{j javascript_include_tag("jquery")}'));") ] buf << [ javascript_tag("!window.jQuery && document.write(unescape('#{j javascript_include_tag("jquery")}'));") ]
else else
buf << [ javascript_include_tag('jquery') ] buf << [ javascript_include_tag('jquery') ]

View file

@ -170,7 +170,7 @@ configuration: ## Section
## Settings probably affecting the privacy of your users ## Settings probably affecting the privacy of your users
privacy: ## Section privacy: ## Section
## Include jQuery from Google's CDN ## Include jQuery from jquery.com's CDN
## This potentially saves you some traffic and speeds up ## This potentially saves you some traffic and speeds up
## load time since most clients already have this one cached ## load time since most clients already have this one cached
#jquery_cdn: true #jquery_cdn: true

View file

@ -55,13 +55,13 @@ describe ApplicationHelper do
end end
describe "#jquery_include_tag" do describe "#jquery_include_tag" do
describe "with google cdn" do describe "with jquery cdn" do
before do before do
AppConfig.privacy.jquery_cdn = true AppConfig.privacy.jquery_cdn = true
end end
it 'inclues jquery.js from google cdn' do it 'inclues jquery.js from jquery cdn' do
jquery_include_tag.should match(/googleapis\.com/) jquery_include_tag.should match(/jquery\.com/)
end end
it 'falls back to asset pipeline on cdn failure' do it 'falls back to asset pipeline on cdn failure' do
@ -69,14 +69,14 @@ describe ApplicationHelper do
end end
end end
describe "without google cdn" do describe "without jquery cdn" do
before do before do
AppConfig.privacy.jquery_cdn = false AppConfig.privacy.jquery_cdn = false
end end
it 'includes jquery.js from asset pipeline' do it 'includes jquery.js from asset pipeline' do
jquery_include_tag.should match(/jquery\.js/) jquery_include_tag.should match(/jquery\.js/)
jquery_include_tag.should_not match(/googleapis\.com/) jquery_include_tag.should_not match(/jquery\.com/)
end end
end end