From 77edc5105eb3b5aad219b0d988dc51ec5e658d81 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Sun, 4 Oct 2020 13:38:59 +0530 Subject: [PATCH 1/2] Update jquery to 3.5.1 (jquery-rails 4.4.0 and rails-assets-jquery 3.5.1) --- Gemfile | 4 ++-- Gemfile.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index ac98f6f82..a363c4adf 100644 --- a/Gemfile +++ b/Gemfile @@ -94,12 +94,12 @@ gem "entypo-rails", "3.0.0" # JavaScript gem "handlebars_assets", "0.23.8" -gem "jquery-rails", "4.3.5" +gem "jquery-rails", "4.4.0" gem "js-routes", "1.4.9" gem "js_image_paths", "0.1.1" source "https://gems.diasporafoundation.org" do - gem "rails-assets-jquery", "3.4.1" # Should be kept in sync with jquery-rails + gem "rails-assets-jquery", "3.5.1" # Should be kept in sync with jquery-rails gem "rails-assets-jquery.ui", "1.11.4" gem "rails-assets-highlightjs", "9.12.0" diff --git a/Gemfile.lock b/Gemfile.lock index 730320fb3..4f8053454 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -348,7 +348,7 @@ GEM rake jasmine-core (3.7.1) jasmine-jquery-rails (2.0.3) - jquery-rails (4.3.5) + jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -556,7 +556,7 @@ GEM rails-assets-jasmine (3.4.0) rails-assets-jasmine-ajax (4.0.0) rails-assets-jasmine (~> 3) - rails-assets-jquery (3.4.1) + rails-assets-jquery (3.5.1) rails-assets-jquery-colorbox (1.6.4) rails-assets-jquery (>= 1.3.2) rails-assets-jquery-fullscreen-plugin (0.5.0) @@ -830,7 +830,7 @@ DEPENDENCIES i18n-inflector-rails (= 1.0.7) jasmine (= 3.7.0) jasmine-jquery-rails (= 2.0.3) - jquery-rails (= 4.3.5) + jquery-rails (= 4.4.0) js-routes (= 1.4.9) js_image_paths (= 0.1.1) json (= 2.3.0) @@ -875,7 +875,7 @@ DEPENDENCIES rails-assets-fine-uploader (= 5.13.0)! rails-assets-highlightjs (= 9.12.0)! rails-assets-jasmine-ajax (= 4.0.0)! - rails-assets-jquery (= 3.4.1)! + rails-assets-jquery (= 3.5.1)! rails-assets-jquery-placeholder (= 2.3.1)! rails-assets-jquery-textchange (= 0.2.3)! rails-assets-jquery.are-you-sure (= 1.9.0)! From b375bfa630d8ef148f6d3c8d9d1f7abd65b0af97 Mon Sep 17 00:00:00 2001 From: Akshay S Dinesh Date: Fri, 25 Jun 2021 22:41:56 +0530 Subject: [PATCH 2/2] Add more closing tags to fix specs closes #8159 --- app/assets/javascripts/app/views/hovercard_view.js | 2 +- app/assets/javascripts/app/views/locator.js | 2 +- app/assets/javascripts/app/views/publisher_view.js | 2 +- app/assets/javascripts/mobile/mobile_comments.js | 10 ++++++---- app/assets/javascripts/mobile/publisher.js | 2 +- spec/javascripts/app/app_spec.js | 2 +- spec/javascripts/app/views_spec.js | 8 ++++---- spec/javascripts/mobile/mobile_comments_spec.js | 4 ++-- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/assets/javascripts/app/views/hovercard_view.js b/app/assets/javascripts/app/views/hovercard_view.js index 72ebe121a..9fe895bfe 100644 --- a/app/assets/javascripts/app/views/hovercard_view.js +++ b/app/assets/javascripts/app/views/hovercard_view.js @@ -130,7 +130,7 @@ app.views.Hovercard = app.views.Base.extend({ // set hashtags this.hashtags.empty(); this.hashtags.html($(_.map(person.profile.tags, function(tag) { - return $("", {href: Routes.tag(tag)}).text("#" + tag)[0]; + return $("", {href: Routes.tag(tag)}).text("#" + tag)[0]; }))); } }, diff --git a/app/assets/javascripts/app/views/locator.js b/app/assets/javascripts/app/views/locator.js index 364f3fa39..56de93746 100644 --- a/app/assets/javascripts/app/views/locator.js +++ b/app/assets/javascripts/app/views/locator.js @@ -19,7 +19,7 @@ app.views.Location = Backbone.View.extend({ var locator = new OSM.Locator(); locator.getAddress(function(address, latlng){ $(element).empty(); - $("", + $("", { id: "location_address", value: address, type: "text", diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 84f957395..3dcd4ff50 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -351,7 +351,7 @@ app.views.Publisher = Backbone.View.extend({ }; var previewPost = new app.views.PreviewPost({model: new app.models.Post(previewMessage)}).render().el; - return $("
").append(previewPost).html(); + return $("
").append(previewPost).html(); }, keyDown : function(evt) { diff --git a/app/assets/javascripts/mobile/mobile_comments.js b/app/assets/javascripts/mobile/mobile_comments.js index 78dbe5e15..270799f7b 100644 --- a/app/assets/javascripts/mobile/mobile_comments.js +++ b/app/assets/javascripts/mobile/mobile_comments.js @@ -185,8 +185,8 @@ addNewComments: function(bottomBar, data) { if ($(".comment-container", bottomBar).length === 0) { - $(".show-comments", bottomBar).after($("
", {"class": "comment-container"})); - $(".comment-container", bottomBar).append($("
    ", {"class": "comments"})); + $(".show-comments", bottomBar).after($("
    ", {"class": "comment-container"})); + $(".comment-container", bottomBar).append($("
      ", {"class": "comments"})); } $(".comment-container .comments", bottomBar).append(data); }, @@ -212,8 +212,10 @@ var postGuid = bottomBar.parents(".stream-element").data("guid"); toggleReactionsLink.remove(); - toggleReactionsLink = $("", {"class": "show-comments", "href": Routes.postComments(postGuid) + ".mobile"}) - .html(text + ""); + toggleReactionsLink = $("", { + "class": "show-comments", + "href": Routes.postComments(postGuid) + ".mobile" + }).html(text + ""); parent.prepend(toggleReactionsLink); bottomBar.removeClass("inactive").addClass("active"); } diff --git a/app/assets/javascripts/mobile/publisher.js b/app/assets/javascripts/mobile/publisher.js index f50c6aa71..9bac0f0bf 100644 --- a/app/assets/javascripts/mobile/publisher.js +++ b/app/assets/javascripts/mobile/publisher.js @@ -33,7 +33,7 @@ $(document).ready(function(){ if(hiddenField.length > 0) { hiddenField.remove(); } else { $("#new_status_message").append( - $("", { + $("", { name: "services[]", type: "hidden", value: provider diff --git a/spec/javascripts/app/app_spec.js b/spec/javascripts/app/app_spec.js index 378ab84f3..1848f20a7 100644 --- a/spec/javascripts/app/app_spec.js +++ b/spec/javascripts/app/app_spec.js @@ -47,7 +47,7 @@ describe("app", function() { describe("setupForms", function() { beforeEach(function() { - spec.content().append(" "); }); it("calls jQuery.placeholder() for inputs", function() { diff --git a/spec/javascripts/app/views_spec.js b/spec/javascripts/app/views_spec.js index 370912436..5aa731840 100644 --- a/spec/javascripts/app/views_spec.js +++ b/spec/javascripts/app/views_spec.js @@ -62,8 +62,8 @@ describe("app.views.Base", function(){ }, postRenderTemplate : function(){ - $(this.el).append("
      "); - $(this.el).append("
      "); + $(this.el).append("
      "); + $(this.el).append("
      "); }, createSubview2 : function(){ @@ -121,7 +121,7 @@ describe("app.views.Base", function(){ it("replaces .time with relative time ago in words", function() { this.view.templateName = false; spyOn($.fn, "timeago"); - this.view.$el.append("