Skip to content

Commit 641bbb8

Browse files
committed
Merge branch 'refactor/update/jquery'
This branch comes from git#2022. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 0a811de + 76644af commit 641bbb8

File tree

4 files changed

+27
-19
lines changed

4 files changed

+27
-19
lines changed

assets/js/application.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
1111
// about supported directives.
1212
//
13-
//= require jquery-1.7.1.min
14-
//= require jquery-ui-1.8.18.custom.min
13+
//= require jquery-3.7.1.min
14+
//= require jquery-ui-1.14.1.min
1515
//= require jquery.defaultvalue
1616
//= require session.min
1717

@@ -43,8 +43,7 @@ $(document).ready(function() {
4343

4444
function onPopState(fn) {
4545
if (window.history && window.history.pushState) {
46-
return $(window).bind('popstate', function(event) {
47-
var section;
46+
return $(window).on('popstate', function () {
4847
initialPop = !popped && location.href === initialURL;
4948
popped = true;
5049
if (initialPop) {
@@ -115,7 +114,7 @@ var GitTurns20 = {
115114
} else {
116115
let start = 0
117116
let count = 0
118-
$("#tagline").click(e => {
117+
$("#tagline").on('click', e => {
119118
if (count === 0 || e.timeStamp > start + count * 1000) {
120119
start = e.timeStamp;
121120
count = 1;
@@ -181,20 +180,20 @@ var Search = {
181180
},
182181

183182
observeFocus: function() {
184-
$('form#search input').focus(function() {
183+
$('form#search input').on('focus', function() {
185184
$(this).parent('form#search').switchClass("", "focus", 200);
186185
});
187-
$('form#search input').blur(function() {
186+
$('form#search input').on('blur', function() {
188187
Search.resetForm();
189188
});
190189
},
191190

192191
observeTextEntry: function() {
193-
$('form#search input').keyup(function(e) {
192+
$('form#search input').on('keyup', function() {
194193
Search.runSearch();
195194
});
196195

197-
$('form#search input').keydown(function(e) {
196+
$('form#search input').on('keydown', function(e) {
198197
if ($('#search-results').not(':visible') && e.which != 27) {
199198
$('#search-results').fadeIn(0.2);
200199
Search.highlight(Search.selectedIndex);
@@ -220,16 +219,16 @@ var Search = {
220219
},
221220

222221
observeResultsClicks: function() {
223-
$('#search-results').mousedown(function(e) {
222+
$('#search-results').on('mousedown', function(e) {
224223
e.preventDefault();
225224
});
226225
},
227226

228227
installKeyboardShortcuts: function() {
229-
$(document).keydown(function(e) {
228+
$(document).on('keydown', function(e) {
230229
if (e.target.tagName.toUpperCase() !== 'INPUT' && ['s', 'S', '/'].includes(e.key)) {
231230
e.preventDefault();
232-
$('form#search input').focus();
231+
$('form#search input').trigger('focus');
233232
}
234233
else if (e.target.tagName.toUpperCase() !== 'INPUT') GitTurns20.keydown(e);
235234
});
@@ -497,7 +496,7 @@ var Forms = {
497496
},
498497

499498
observeCopyableInputs: function() {
500-
$('input.copyable').click(function() {
499+
$('input.copyable').on('click', function() {
501500
$(this).select();
502501
});
503502
}
@@ -551,7 +550,7 @@ var Downloads = {
551550
},
552551

553552
observeGUIOSFilter: function() {
554-
$('a.gui-os-filter').click(function(e) {
553+
$('a.gui-os-filter').on('click', function(e) {
555554
e.preventDefault();
556555
var os = $(this).attr('data-os');
557556

@@ -654,7 +653,7 @@ var DarkMode = {
654653
}
655654
button.css("display", "block");
656655

657-
button.click(function(e) {
656+
button.on('click', function(e) {
658657
e.preventDefault();
659658
let theme
660659
if (prefersDarkScheme) {
@@ -786,12 +785,12 @@ var PostelizeAnchor = {
786785

787786
// Scroll to Top
788787
$('#scrollToTop').removeClass('no-js');
789-
$(window).scroll(function() {
788+
$(window).on('scroll', function() {
790789
$(this).scrollTop() > 150
791790
? $('#scrollToTop').fadeIn()
792791
: $('#scrollToTop').fadeOut();
793792
});
794-
$('#scrollToTop').click(function(e) {
793+
$('#scrollToTop').on('click', function(e) {
795794
e.preventDefault();
796795
$("html, body").animate({
797796
scrollTop: 0

layouts/partials/footer.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
<img src="{{ relURL "images/icons/[email protected]" }}" width="20" height="20" alt="scroll-to-top"/>
1212
</a>
1313

14-
<script src="{{ relURL "js/jquery-1.7.1.min.js" }}"></script>
15-
<script src="{{ relURL "js/jquery-ui-1.8.18.custom.min.js" }}"></script>
14+
<script src="https://code.jquery.com/jquery-migrate-3.4.1.min.js"></script>
15+
<script src="{{ relURL "js/jquery-3.7.1.min.js" }}"></script>
16+
<script src="{{ relURL "js/jquery-ui-1.14.1.min.js" }}"></script>
1617
<script src="{{ relURL "js/jquery.defaultvalue.js" }}"></script>
1718
<script src="{{ relURL "js/session.min.js" }}"></script>
1819
{{ $js := resources.Get "js/application.js" | resources.ExecuteAsTemplate "js/application.js" . | resources.Minify | fingerprint }}

static/js/jquery-3.7.1.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/jquery-ui-1.14.1.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)