Skip to content

Commit

Permalink
Update jQuery used in specs page to 3.4.1
Browse files Browse the repository at this point in the history
Fixes scala/bug#11594

I used jQuery Migrate (https://github.com/jquery/jquery-migrate/) to let it print out deprecation warnings, and updated `.bind` to `.on`.

Here's how I locally tested the page:

```
bundle exec jekyll build -s spec/ -d build/spec
ruby -run -e httpd build/spec -p 9090
```
  • Loading branch information
eed3si9n committed Jul 22, 2019
1 parent d37ff07 commit 0fe8209
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions spec/_layouts/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<link rel="icon" type="image/png" href="public/favicon.ico">
<link rel="shortcut icon" type="image/png" href="public/favicon.ico">

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
Expand All @@ -15,9 +16,8 @@
}
});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/default.min.css">
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/default.min.css">
<!-- need to use include to see value of page.chapter variable -->
<style type="text/css">
{% include numbering.css %}
Expand Down
2 changes: 1 addition & 1 deletion spec/_layouts/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/png" href="public/favicon.ico">
<link rel="shortcut icon" type="image/png" href="public/favicon.ico">

<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<title>{{ page.title }}</title>

<link rel="stylesheet" type="text/css" href="public/stylesheets/screen.css">
Expand Down
8 changes: 4 additions & 4 deletions spec/public/scripts/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $.fn.toc = function(options) {
}, 50);
};
if (opts.highlightOnScroll) {
$(window).bind('scroll', highlightOnScroll);
$(window).on('scroll', highlightOnScroll);
highlightOnScroll();
}

Expand All @@ -69,10 +69,10 @@ $.fn.toc = function(options) {
var a = $('<a/>')
.text(opts.headerText(i, heading, $h))
.attr('href', '#' + anchorName)
.bind('click', function(e) {
$(window).unbind('scroll', highlightOnScroll);
.on('click', function(e) {
$(window).off('scroll', highlightOnScroll);
scrollTo(e, function() {
$(window).bind('scroll', highlightOnScroll);
$(window).on('scroll', highlightOnScroll);
});
el.trigger('selected', $(this).attr('href'));
});
Expand Down

0 comments on commit 0fe8209

Please sign in to comment.