Skip to content

Commit

Permalink
Upgrade jQuery to 3.5.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed May 4, 2020
1 parent f4b97b3 commit 8900bb7
Show file tree
Hide file tree
Showing 22 changed files with 178 additions and 174 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Show error page when submitting with web param to /import.
- Add a daemon option for sending reports and updates.
- Update Getopt::Long::Descriptive to stop warning.
- Drop support for IE8, upgrade jQuery. #3017
- Open311 improvements:
- match response templates on external status code over state
- Add flag to protect category/group names from Open311 overwrite.
Expand Down
2 changes: 1 addition & 1 deletion templates/web/base/common_header_tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
[% IF bodyclass.match('frontpage') %]
<link rel="prefetch" href="[% version('/js/validation_rules.js') %]">
[%~ IF NOT c.user_exists OR NOT (c.user.from_body OR c.user.is_superuser) %]
<link rel="prefetch" href="[% version('/vendor/jquery-2.2.4.min.js') %]">
<link rel="prefetch" href="[% version('/vendor/jquery-3.5.0.min.js') %]">
[%~ END %]
<link rel="prefetch" href="[% version('/vendor/jquery.multi-select.min.js') %]">
<link rel="prefetch" href="[% version('/vendor/jquery.validate.min.js') %]">
Expand Down
4 changes: 2 additions & 2 deletions templates/web/base/common_scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
ELSE;
scripts.push(
version('/js/validation_rules.js'),
version('/vendor/jquery-2.2.4.min.js'),
version('/vendor/jquery-3.5.0.min.js'),
version('/vendor/jquery.multi-select.min.js'),
version('/vendor/jquery.validate.min.js'),
version('/cobrands/fixmystreet/fixmystreet.js'),
Expand All @@ -36,7 +36,7 @@
IF c.user_exists AND (c.user.from_body OR c.user.is_superuser);
scripts.push(
version('/js/geolocation.js'),
version('/vendor/jquery-2.2.4.min.js'),
version('/vendor/jquery-3.5.0.min.js'),
version('/cobrands/fixmystreet/staff.js')
);
IF bodyclass.match('mappage') AND c.cobrand.suggest_duplicates AND NOT login_success AND NOT oauth_need_email;
Expand Down
2 changes: 1 addition & 1 deletion templates/web/bromley/footer_extra_js.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[% scripts.push(
version('/vendor/jquery-2.2.4.min.js'),
version('/vendor/jquery-3.5.0.min.js'),
version('/cobrands/bromley/a-z-nav.js'),
) %]
[% PROCESS 'footer_extra_js_base.html' cobrand_js=1 validation=1 tfl=1 %]
Expand Down
2 changes: 1 addition & 1 deletion templates/web/tfl/footer_extra_js.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[% scripts.push(
version('/vendor/jquery-2.2.4.min.js'),
version('/vendor/jquery-3.5.0.min.js'),
) %]
[% PROCESS 'footer_extra_js_base.html' highways=1 cobrand_js=1 %]
[%~
Expand Down
2 changes: 1 addition & 1 deletion templates/web/zurich/footer_extra_js.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[% scripts.push(
version('/vendor/jquery-2.2.4.min.js'),
version('/vendor/jquery-3.5.0.min.js'),
version('/cobrands/zurich/validation_rules.js'),
'//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js',
version('/cobrands/zurich/js.js'),
Expand Down
4 changes: 2 additions & 2 deletions web/cobrands/borsetshire/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
}
}

$('#demo-user-list button').click(function(){
$('#demo-user-list button').on('click', function(){
var form = document.forms.general_auth;
form.username.value = $(this).data('email');
form.password_sign_in.value = 'password';
set_redirect(form);
form.submit();
form.trigger('submit');
});

$('form[name=general_auth]').on('submit', function() {
Expand Down
4 changes: 2 additions & 2 deletions web/cobrands/bromley/a-z-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$('.custom-side-nav > ul > li > ul').hide();

// Stops the toggle links going off to their actual link. Make the links actual links though for non js users.
$('.custom-side-nav > ul > li > a').click(function(e) {
$('.custom-side-nav > ul > li > a').on('click', function(e) {
e.preventDefault();
// When an item is clicked this checks to see if any other items are down and strips the class of active and toggles them up.
if( !$(this).hasClass('active') ) {
Expand All @@ -19,4 +19,4 @@
.slideToggle(300);
});
});
})(window.jQuery);
})(window.jQuery);
18 changes: 9 additions & 9 deletions web/cobrands/fixmystreet/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $(function(){
}

// Some lists of checkboxes have 'select all/none' links at the top
$("a[data-select-none], a[data-select-all]").click(function(e) {
$("a[data-select-none], a[data-select-all]").on('click', function(e) {
e.preventDefault();
var checked = $(this).filter('[data-select-all]').length > 0;
$(this).closest("ul").find('input[type=checkbox]').prop('checked', checked);
Expand Down Expand Up @@ -66,21 +66,21 @@ $(function(){
});
}

$("#start_date").change(function(){
$("#start_date").on('change', function(){
$('#end_date').attr('min', $(this).val());
});
$("#end_date").change(function(){
$("#end_date").on('change', function(){
$('#start_date').attr('max', $(this).val());
});

// On user edit page, hide the area/categories fields if body changes
$("form#user_edit select#body").change(function() {
$("form#user_edit select#body").on('change', function() {
var show_area = $(this).val() == $(this).find("[data-originally-selected]").val();
$("form#user_edit select#area_ids").closest("li").toggle(show_area);
$("form#user_edit .js-user-categories").toggle(show_area);
});

$('form#user_edit select#roles').change(function() {
$('form#user_edit select#roles').on('change', function() {
var $perms = $('.permissions-checkboxes');
if ($(this).val()) {
var selected_perms = {};
Expand All @@ -103,12 +103,12 @@ $(function(){
});
$perms.find('input').prop('disabled', false);
}
}).change();
}).trigger('change');

// Bits for the report extra fields form builder:

// Reveal the UI when 'show' link is clicked
$(".js-show-extra-fields").click(function(e) {
$(".js-show-extra-fields").on('click', function(e) {
e.preventDefault();
$(this).hide();
$(".js-extra-fields-ui").removeClass("hidden-js");
Expand All @@ -121,7 +121,7 @@ $(function(){
var $new_item = $template_item.clone();
$new_item.removeClass("hidden-js js-group-item-template");
$new_item.insertBefore($template_item);
$new_item.focus();
$new_item.trigger('focus');
return true;
});

Expand Down Expand Up @@ -194,7 +194,7 @@ $(function(){
// On the manifest theme editing page we have tickboxes for deleting individual
// icons - ticking one of these should grey out that row to indicate it will be
// deleted upon form submission.
$("input[name=delete_icon]").change(function() {
$("input[name=delete_icon]").on('change', function() {
$(this).closest("tr").toggleClass("is-deleted", this.checked);
});
});
Expand Down
2 changes: 1 addition & 1 deletion web/cobrands/fixmystreet/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function check_zoom_message_visibility() {
if ($p.length === 0) {
$p = $("<p>").prop("id", id).prop('class', 'category_meta_message');
if ($('html').hasClass('mobile')) {
$p.click(function() {
$p.on('click', function() {
$("#mob_ok").trigger('click');
}).addClass("btn");
}
Expand Down

0 comments on commit 8900bb7

Please sign in to comment.