Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions assets/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery-1.7.1.min
//= require jquery-ui-1.8.18.custom.min
//= require jquery-3.7.1.min
//= require jquery-ui-1.14.1.min
//= require jquery.defaultvalue
//= require session.min

Expand Down Expand Up @@ -43,8 +43,7 @@ $(document).ready(function() {

function onPopState(fn) {
if (window.history && window.history.pushState) {
return $(window).bind('popstate', function(event) {
var section;
return $(window).on('popstate', function () {
initialPop = !popped && location.href === initialURL;
popped = true;
if (initialPop) {
Expand Down Expand Up @@ -115,7 +114,7 @@ var GitTurns20 = {
} else {
let start = 0
let count = 0
$("#tagline").click(e => {
$("#tagline").on('click', e => {
if (count === 0 || e.timeStamp > start + count * 1000) {
start = e.timeStamp;
count = 1;
Expand Down Expand Up @@ -181,20 +180,20 @@ var Search = {
},

observeFocus: function() {
$('form#search input').focus(function() {
$('form#search input').on('focus', function() {
$(this).parent('form#search').switchClass("", "focus", 200);
});
$('form#search input').blur(function() {
$('form#search input').on('blur', function() {
Search.resetForm();
});
},

observeTextEntry: function() {
$('form#search input').keyup(function(e) {
$('form#search input').on('keyup', function() {
Search.runSearch();
});

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

observeResultsClicks: function() {
$('#search-results').mousedown(function(e) {
$('#search-results').on('mousedown', function(e) {
e.preventDefault();
});
},

installKeyboardShortcuts: function() {
$(document).keydown(function(e) {
$(document).on('keydown', function(e) {
if (e.target.tagName.toUpperCase() !== 'INPUT' && ['s', 'S', '/'].includes(e.key)) {
e.preventDefault();
$('form#search input').focus();
$('form#search input').trigger('focus');
}
else if (e.target.tagName.toUpperCase() !== 'INPUT') GitTurns20.keydown(e);
});
Expand Down Expand Up @@ -491,7 +490,7 @@ var Forms = {
},

observeCopyableInputs: function() {
$('input.copyable').click(function() {
$('input.copyable').on('click', function() {
$(this).select();
});
}
Expand Down Expand Up @@ -545,7 +544,7 @@ var Downloads = {
},

observeGUIOSFilter: function() {
$('a.gui-os-filter').click(function(e) {
$('a.gui-os-filter').on('click', function(e) {
e.preventDefault();
var os = $(this).attr('data-os');

Expand Down Expand Up @@ -648,7 +647,7 @@ var DarkMode = {
}
button.css("display", "block");

button.click(function(e) {
button.on('click', function(e) {
e.preventDefault();
let theme
if (prefersDarkScheme) {
Expand Down Expand Up @@ -780,12 +779,12 @@ var PostelizeAnchor = {

// Scroll to Top
$('#scrollToTop').removeClass('no-js');
$(window).scroll(function() {
$(window).on('scroll', function() {
$(this).scrollTop() > 150
? $('#scrollToTop').fadeIn()
: $('#scrollToTop').fadeOut();
});
$('#scrollToTop').click(function(e) {
$('#scrollToTop').on('click', function(e) {
e.preventDefault();
$("html, body").animate({
scrollTop: 0
Expand Down
5 changes: 3 additions & 2 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
<img src="{{ relURL "images/icons/[email protected]" }}" width="20" height="20" alt="scroll-to-top"/>
</a>

<script src="{{ relURL "js/jquery-1.7.1.min.js" }}"></script>
<script src="{{ relURL "js/jquery-ui-1.8.18.custom.min.js" }}"></script>
<script src="https://code.jquery.com/jquery-migrate-3.4.1.min.js"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be v1.4.1 first, to upgrade across the jQuery v1.9.x boundary?

And, as per the documentation:

In your web page, load this plugin after the script for jQuery: [...]

That problem is highly likely to be the root cause of:

image

<script src="{{ relURL "js/jquery-3.7.1.min.js" }}"></script>
<script src="{{ relURL "js/jquery-ui-1.14.1.min.js" }}"></script>
<script src="{{ relURL "js/jquery.defaultvalue.js" }}"></script>
<script src="{{ relURL "js/session.min.js" }}"></script>
{{ $js := resources.Get "js/application.js" | resources.ExecuteAsTemplate "js/application.js" . | resources.Minify | fingerprint }}
Expand Down
2 changes: 2 additions & 0 deletions static/js/jquery-3.7.1.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions static/js/jquery-ui-1.14.1.min.js

Large diffs are not rendered by default.

Loading