Skip to content

Commit 8465930

Browse files
committed
refactor: update to jquery 3.7.1 (closes tjcsl#1164)
1 parent 1d1ff53 commit 8465930

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+214
-235
lines changed

Ion.egg-info/SOURCES.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,6 @@ intranet/static/js/vendor/Chart.min.js
11671167
intranet/static/js/vendor/backbone-min.js
11681168
intranet/static/js/vendor/backbone-min.map
11691169
intranet/static/js/vendor/chrono.min.js
1170-
intranet/static/js/vendor/jquery-1.10.2.min.js
1171-
intranet/static/js/vendor/jquery-1.10.2.min.map
11721170
intranet/static/js/vendor/jquery.are-you-sure.js
11731171
intranet/static/js/vendor/jquery.cookie.js
11741172
intranet/static/js/vendor/jquery.csv.min.js

intranet/static/js/about.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global $ */
22
$(function() {
3-
$(".logo").click(function() {
3+
$(".logo").on("click", function() {
44
location.href = '/';
55
});
66

intranet/static/js/announcement.form.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $(function() {
1717
maxItems: 2
1818
});
1919

20-
$("form#announcement_form").bind("submit", function (e) {
20+
$("form#announcement_form").on("submit", function (e) {
2121
if($("#id_notify_email_all").prop("checked")) {
2222
if(!confirm("This will send an email to ALL users who can see this post. If you have not selected a group, this will email the entire school. Are you sure you want to do this?")) {
2323
e.preventDefault();
@@ -32,7 +32,7 @@ $(function() {
3232
}
3333

3434
var button = $("button#submit_announcement");
35-
button.click(function(ev) { ev.preventDefault(); })
35+
button.on("click", function(ev) { ev.preventDefault(); })
3636
button.append(" <i class=\"fas fa-spinner fa-spin\" aria-hidden=\"true\"></i>");
3737

3838
if ($("input#id_title").val() === "") {

intranet/static/js/bus-afternoon.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ $(function() {
700700
});
701701

702702
if(isAdmin) {
703-
$(".bus-announcement-save").click(function() {
703+
$(".bus-announcement-save").on("click", function() {
704704
bus.sendUpdate({
705705
announcement: $(".bus-announcement").text()
706706
});
@@ -709,7 +709,7 @@ $(function() {
709709
$(".bus-announcement-save").text("Save").css("color", "");
710710
}, 1500);
711711
});
712-
$(".bus-announcement-clear").click(function() {
712+
$(".bus-announcement-clear").on("click", function() {
713713
$(".bus-announcement").text("");
714714
bus.sendUpdate({
715715
announcement: "",
@@ -734,7 +734,7 @@ $(function() {
734734
let socket = getSocket(base_url, location, document, window, 'afternoon');
735735

736736
if (enableBusDriver) {
737-
$(window).unload(function () {
737+
$(window).on("unload", function () {
738738
alert('hello');
739739
alert(`You drove ${window.appView.mapView.busDriverBus.elapsedTime} milliseconds!`);
740740
Backbone.trigger('recordScore', e);

intranet/static/js/bus-morning.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ $(function() {
44
let base_url = window.location.host;
55
let socket = getSocket(base_url, location, document, window, "morning");
66

7-
$("#a-button").click(function() {sendMorningUpdate({"status":"a"}, socket); });
8-
$("#o-button").click(function() {sendMorningUpdate({"status":"o"}, socket); });
9-
$("#d-button").click(function() {sendMorningUpdate({"status":"d"}, socket); });
7+
$("#a-button").on("click", function() {sendMorningUpdate({"status":"a"}, socket); });
8+
$("#o-button").on("click", function() {sendMorningUpdate({"status":"o"}, socket); });
9+
$("#d-button").on("click", function() {sendMorningUpdate({"status":"d"}, socket); });
1010

1111
$("select").selectize({
1212
create: false,
1313
sortField: "text"
1414
});
1515

1616
if(isAdmin) {
17-
$(".bus-announcement-save").click(function() {
17+
$(".bus-announcement-save").on("click", function() {
1818
sendMorningUpdate({
1919
announcement: $(".bus-announcement").text()
2020
}, socket);
@@ -23,7 +23,7 @@ $(function() {
2323
$(".bus-announcement-save").text("Save").css("color", "");
2424
}, 1500);
2525
});
26-
$(".bus-announcement-clear").click(function() {
26+
$(".bus-announcement-clear").on("click", function() {
2727
$(".bus-announcement").text("");
2828
sendMorningUpdate({
2929
announcement: "",

intranet/static/js/common.header.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ $(function() {
1818
}
1919

2020
var clickOutside = function(e) {
21-
if ($(e.target).parents().andSelf().hasClass("dropdown-allow")) return;
21+
if ($(e.target).parents().addBack().hasClass("dropdown-allow")) return;
2222

23-
if (!$(e.target).parents().andSelf().hasClass("dropdown-item-wrapper")) {
23+
if (!$(e.target).parents().addBack().hasClass("dropdown-item-wrapper")) {
2424
closeMenu($(".dropdown-open .dropdown-menu"), true);
2525
$(".has-dropdown").removeClass("dropdown-open");
2626
}
@@ -33,8 +33,8 @@ $(function() {
3333
opacity: 1
3434
}, time, "easeInQuart", function() {
3535
if (bindEvents) {
36-
$(document).bind("click tap", clickOutside);
37-
$(".dropdown-menu").bind("click", clickInside);
36+
$(document).on("click tap", clickOutside);
37+
$(".dropdown-menu").on("click", clickInside);
3838
}
3939
});
4040
}
@@ -47,13 +47,13 @@ $(function() {
4747
menu.hide();
4848

4949
if (unbindEvents) {
50-
$(".dropdown-menu").unbind("click", clickInside);
51-
$(document).unbind("click tap", clickOutside);
50+
$(".dropdown-menu").off("click", clickInside);
51+
$(document).off("click tap", clickOutside);
5252
}
5353
});
5454
}
5555

56-
$(".has-dropdown").click(function(event) {
56+
$(".has-dropdown").on("click", function(event) {
5757
var menu_clicked = $(this).children(".dropdown-menu");
5858
var already_open = $(".dropdown-open .dropdown-menu")
5959
var clicked_subgroups = menu_clicked.children(".has-dropdown-subgroup");
@@ -65,8 +65,8 @@ $(function() {
6565
clicked_subgroups.children("a.subgroup-arrow-parent").children("i.subgroup-arrow").addClass("fa-caret-down");
6666
clicked_subgroups.children("a.subgroup-arrow-parent").children("i.subgroup-arrow").removeClass("fa-caret-left");
6767

68-
$(document).unbind("click tap", clickOutside);
69-
$(".dropdown-menu").unbind("click", clickInside);
68+
$(document).off("click tap", clickOutside);
69+
$(".dropdown-menu").off("click", clickInside);
7070
$(".has-dropdown").removeClass("dropdown-open");
7171
} else if (already_open.length === 0) {
7272
// All menus closed, opening one of them
@@ -81,7 +81,7 @@ $(function() {
8181
}
8282
});
8383

84-
$(".has-dropdown-subgroup").click(function(event) {
84+
$(".has-dropdown-subgroup").on("click", function(event) {
8585
var subgroup = $(this).children(".dropdown-subgroup");
8686
var arrow = $(this).children("a.subgroup-arrow-parent").children("i.subgroup-arrow");
8787
subgroup.toggle();

intranet/static/js/common.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* Common JS */
22
/* global $ */
3+
34
function csrfSafeMethod(method) {
45
// these HTTP methods do not require CSRF protection
56
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
@@ -17,7 +18,7 @@ $.ajaxSetup({
1718
// UI Stuff
1819
function initUIElementBehavior() {
1920
// Call this function whenever relevant UI elements are dynamically added to the page
20-
$("button, .button, input[type='button'], input[type='submit'], input[type='reset']").mouseup(function() {
21+
$("button, .button, input[type='button'], input[type='submit'], input[type='reset']").on("mouseup", function() {
2122
$(this).blur();
2223
});
2324
}
@@ -29,25 +30,25 @@ function showWaitScreen() {
2930
$(function() {
3031
initUIElementBehavior();
3132

32-
$(".nav a").click(function(event) {
33+
$(".nav a").on("click", function(event) {
3334
if (event.metaKey) return;
3435
$(".nav .selected").removeClass("selected");
3536
$(this).parent().addClass("selected");
3637
});
3738

38-
$(".header h1").click(function() {
39+
$(".header h1").on("click", function() {
3940
if (event.metaKey) return;
4041
$(".nav .selected").removeClass("selected");
4142
$(".nav li").slice(0, 1).addClass("selected");
4243
});
4344

4445
// On sortable tables, use the data-auto-sort parameter to
4546
// automatically sort by that field.
46-
$("table[data-sortable] thead th[data-auto-sort]").click();
47+
$("table[data-sortable] thead th[data-auto-sort]").trigger("click");
4748

4849

4950
let collapseWarning = $.cookie("collapseWarning") === "true";
50-
$(".warning-title").click(function() {
51+
$(".warning-title").on("click", function() {
5152
$(".warning-content").slideToggle();
5253
$(".warning-toggle-icon").toggleClass("fa-chevron-down fa-chevron-up");
5354
$.cookie("collapseWarning", !collapseWarning, {path: "/", expires: 14})
@@ -152,7 +153,7 @@ try {
152153
};
153154
return udlr
154155
})(window.creffettMode = function() {
155-
$("body").addClass("fire").click(function() {
156+
$("body").addClass("fire").on("click", function() {
156157
$("iframe#udlr").remove();
157158
$("body").removeClass('fire');
158159
});

intranet/static/js/common.nav.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global $ */
22
$(function() {
3-
$.extend($.expr[":"], {
3+
$.extend($.expr.pseudos, {
44
horizontallyscrollable(element) {
55
var e = $(element);
66
return (e.css("overflow") === "scroll" || e.css("overflowX") === "scroll" || e.css("overflow") === "auto" || e.css("overflowX") === "auto");

intranet/static/js/dashboard/announcements.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $(document).ready(function() {
2525
var content = $(this).find(".announcement-content");
2626
if(content.height() > 200) {
2727
$(this).addClass("partially-hidden");
28-
content.click(function() {
28+
content.on("click", function() {
2929
announcementToggle.call($(this).closest(".announcement"));
3030
});
3131
}
@@ -35,7 +35,7 @@ $(document).ready(function() {
3535
});
3636
}
3737
updatePartiallyHidden();
38-
$(window).resize(function() {setTimeout(updatePartiallyHidden, 0);});
38+
$(window).on("resize", function() {setTimeout(updatePartiallyHidden, 0);});
3939

4040
function announcementToggle() {
4141
var announcement = $(this).closest(".announcement");
@@ -101,18 +101,18 @@ $(document).ready(function() {
101101
}
102102
};
103103

104-
$(".announcement[data-id] h3").click(function(e) {
104+
$(".announcement[data-id] h3").on("click", function(e) {
105105
if (e.target !== this) return;
106106
var btn = $(".announcement-toggle", $(this));
107107
announcementToggle.call(btn);
108108
});
109109

110-
$(".announcement[data-id] h3 .announcement-toggle").click(function(e) {
110+
$(".announcement[data-id] h3 .announcement-toggle").on("click", function(e) {
111111
e.preventDefault();
112112
announcementToggle.call($(this));
113113
});
114114

115-
$(".announcement[data-id] h3 .dashboard-item-icon").click(function(e) {
115+
$(".announcement[data-id] h3 .dashboard-item-icon").on("click", function(e) {
116116
e.preventDefault();
117117
var btn = $(".announcement-toggle", $(this).parent());
118118
announcementToggle.call(btn);

intranet/static/js/dashboard/common.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* global $ */
22
$(function() {
3-
$('.widget.extra-widgets-show').click(function() {
3+
$('.widget.extra-widgets-show').on("click", function() {
44
$('body').addClass('show-extra-widgets');
55
});
66

7-
$(".new-feature-close").click(function(e) {
7+
$(".new-feature-close").on("click", function(e) {
88
$(e.target).closest(".new-feature").hide("slow");
99
});
1010

intranet/static/js/dashboard/eighth-widget.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* global $ */
22
$(function() {
3-
$(".eighth-widget .block-header").click(function() {
3+
$(".eighth-widget .block-header").on("click", function() {
44
var link = $("a", $(this));
55
if (link.length > 0) location.href = link.attr("href");
66
});
77

8-
$(".sponsor-widget .block-header").click(function() {
8+
$(".sponsor-widget .block-header").on("click", function() {
99
var link = $("a", $(this));
1010
if (link.length > 0) location.href = link.attr("href");
1111
});
@@ -32,13 +32,13 @@ $(function() {
3232
}
3333

3434
sponsor_schedule_bind = function() {
35-
$(".sponsor-widget #eighth-sponsor-left").click(function() {
35+
$(".sponsor-widget #eighth-sponsor-left").on("click", function() {
3636
var date = $(".sponsor-widget").attr("data-prev-date");
3737
sponsor_schedule_jump(date);
3838
sponsor_schedule_pushstate(date);
3939
});
4040

41-
$(".sponsor-widget #eighth-sponsor-right").click(function() {
41+
$(".sponsor-widget #eighth-sponsor-right").on("click", function() {
4242
var date = $(".sponsor-widget").attr("data-next-date");
4343
sponsor_schedule_jump(date);
4444
sponsor_schedule_pushstate(date);

intranet/static/js/dashboard/events.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ $(function() {
4444
}
4545
}
4646

47-
$(".event[data-id] h3").click(function(e) {
47+
$(".event[data-id] h3").on("click", function(e) {
4848
if (e.target !== this) return;
4949
var btn = $(".event-toggle", $(this));
5050
eventToggle.call(btn);
5151
});
5252

53-
$(".event[data-id] h3 .event-toggle").click(function(e) {
53+
$(".event[data-id] h3 .event-toggle").on("click", function(e) {
5454
e.preventDefault();
5555
eventToggle.call($(this));
5656
});
5757

58-
$(".event[data-id] h3 .dashboard-item-icon").click(function(e) {
58+
$(".event[data-id] h3 .dashboard-item-icon").on("click", function(e) {
5959
e.preventDefault();
6060
var btn = $(".event-toggle", $(this).parent());
6161
eventToggle.call(btn);

intranet/static/js/eighth/admin.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ $(function() {
7979
} catch (e) {}
8080
}
8181

82-
$selectAllBlocksCheckbox.click(updateBlockCheckboxes);
83-
$blockCheckboxes.click(updateSelectAllCheckbox);
82+
$selectAllBlocksCheckbox.on("click", updateBlockCheckboxes);
83+
$blockCheckboxes.on("click", updateSelectAllCheckbox);
8484
updateSelectAllCheckbox();
8585

8686
// Set up select blocks popover
87-
$(".select-blocks-popover-toggle").click(function() {
87+
$(".select-blocks-popover-toggle").on("click", function() {
8888
var $popover = $(".select-blocks-popover"),
8989
$toggle = $(".select-blocks-popover-toggle");
9090

@@ -106,7 +106,7 @@ $(function() {
106106
};
107107
};
108108

109-
$(".select-blocks-popover a.block-type").click(function() {
109+
$(".select-blocks-popover a.block-type").on("click", function() {
110110
var blockType = $(this).text();
111111

112112
var blockTypeFilter = blockTypeRowFilter(blockType);
@@ -149,17 +149,17 @@ $(function() {
149149
var select = $("#id_users_blacklisted").parent("td").find("select")[0].selectize.enable();
150150
}
151151

152-
$("#id_restricted").click(updateRestrictedFormFields);
152+
$("#id_restricted").on("click", updateRestrictedFormFields);
153153

154154
if ($("#id_restricted").length > 0) {
155155
updateRestrictedFormFields();
156156
}
157157

158-
$("#only-show-overbooked").click(function() {
158+
$("#only-show-overbooked").on("click", function() {
159159
$("tr.underbooked").toggle();
160160
});
161161

162-
$("#hide-administrative").click(function() {
162+
$("#hide-administrative").on("click", function() {
163163
$("tr.administrative").toggle();
164164
});
165165
});

intranet/static/js/eighth/attendance.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ $(function() {
2525
$membersCheckboxes.prop("checked", $(this).prop("checked"));
2626
}
2727

28-
$selectAllMembersCheckbox.click(updateBlockCheckboxes);
29-
$membersCheckboxes.click(updateSelectAllCheckbox);
28+
$selectAllMembersCheckbox.on("click", updateBlockCheckboxes);
29+
$membersCheckboxes.on("click", updateSelectAllCheckbox);
3030
updateSelectAllCheckbox();
3131

3232
// Set up accept pass links
33-
$(".pass-form-submit-link").click(function() {
33+
$(".pass-form-submit-link").on("click", function() {
3434
var form = document.forms[$(this).data("form")];
3535
form.status.value = $(this).data("status");
3636

0 commit comments

Comments
 (0)