Bump to jQuery 2

This commit is contained in:
Augier 2016-08-07 11:30:29 +02:00
parent d835cc4b1b
commit 2e175c4be5
9 changed files with 13 additions and 39 deletions

View file

@ -96,7 +96,7 @@ gem "js_image_paths", "0.1.0"
gem "js-routes", "1.2.6"
source "https://rails-assets.org" do
gem "rails-assets-jquery", "1.12.0" # Should be kept in sync with jquery-rails
gem "rails-assets-jquery", "2.2.1" # Should be kept in sync with jquery-rails
gem "rails-assets-markdown-it", "6.0.5"
gem "rails-assets-markdown-it-hashtag", "0.4.0"

View file

@ -658,7 +658,7 @@ GEM
rails-assets-jasmine (2.4.1)
rails-assets-jasmine-ajax (3.2.0)
rails-assets-jasmine (~> 2)
rails-assets-jquery (1.12.0)
rails-assets-jquery (2.2.1)
rails-assets-jquery-colorbox (1.6.4)
rails-assets-jquery (>= 1.3.2)
rails-assets-jquery-fullscreen-plugin (0.5.0)
@ -999,7 +999,7 @@ DEPENDENCIES
rails-assets-diaspora_jsxc (= 0.1.5.develop.1)!
rails-assets-highlightjs (= 9.4.0)!
rails-assets-jasmine-ajax (= 3.2.0)!
rails-assets-jquery (= 1.12.0)!
rails-assets-jquery (= 2.2.1)!
rails-assets-jquery-placeholder (= 2.3.1)!
rails-assets-jquery-textchange (= 0.2.3)!
rails-assets-markdown-it (= 6.0.5)!

View file

@ -476,8 +476,8 @@ app.views.Publisher = Backbone.View.extend({
setButtonsEnabled: function(bool) {
if (bool) {
this.submitEl.removeProp("disabled");
this.previewEl.removeProp("disabled");
this.submitEl.removeAttr("disabled");
this.previewEl.removeAttr("disabled");
} else {
this.submitEl.prop("disabled", true);
this.previewEl.prop("disabled", true);
@ -486,8 +486,8 @@ app.views.Publisher = Backbone.View.extend({
setInputEnabled: function(bool) {
if (bool) {
this.inputEl.removeProp("disabled");
this.hiddenInputEl.removeProp("disabled");
this.inputEl.removeAttr("disabled");
this.hiddenInputEl.removeAttr("disabled");
} else {
this.inputEl.prop("disabled", true);
this.hiddenInputEl.prop("disabled", true);

View file

@ -1,4 +1,4 @@
//= require jquery
//= require jquery2
//= require handlebars.runtime
//= require templates
//= require main

View file

@ -52,11 +52,11 @@ module ApplicationHelper
def jquery_include_tag
buf = []
if AppConfig.privacy.jquery_cdn?
version = Jquery::Rails::JQUERY_VERSION
version = Jquery::Rails::JQUERY_2_VERSION
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('jquery2')}'));")]
else
buf << [ javascript_include_tag('jquery') ]
buf << [javascript_include_tag("jquery2")]
end
buf << [ javascript_include_tag('jquery_ujs') ]
buf << [ javascript_tag("jQuery.ajaxSetup({'cache': false});") ]

View file

@ -70,7 +70,7 @@ module Diaspora
contact-list.js
ie.js
inbox.js
jquery.js
jquery2.js
jquery_ujs.js
jquery-textchange.js
main.js

View file

@ -1,20 +0,0 @@
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require "spec_helper"
describe CommentsController, type: :controller do
describe "#comments" do
before do
sign_in :user, alice
end
context "jasmine fixtures" do
it "generates a jasmine fixture with the mobile comment box", fixture: true do
get :new, format: :mobile, post_id: 1
save_fixture(html_for("div"), "comments_mobile_commentbox")
end
end
end
end

View file

@ -74,7 +74,7 @@ describe ApplicationHelper, :type => :helper do
end
it 'includes jquery.js from asset pipeline' do
expect(jquery_include_tag).to match(/jquery\.js/)
expect(jquery_include_tag).to match(/jquery2\.js/)
expect(jquery_include_tag).not_to match(/jquery\.com/)
end
end

View file

@ -82,14 +82,8 @@ describe("Diaspora.Mobile.Comments", function(){
describe("createComment", function () {
beforeEach(function() {
spec.loadFixture("aspects_index_mobile_post_with_comments");
var commentBoxHtml = spec.fixtureHtml("comments_mobile_commentbox");
var link = $(".stream .comment-action").first();
Diaspora.Mobile.Comments.showCommentBox(link);
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200,
contentType: "text/html",
responseText: commentBoxHtml
});
$(".stream .new_comment").submit(Diaspora.Mobile.Comments.submitComment);
});