Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump jQuery to v3.6.0 #1397

Closed
wants to merge 3 commits into from
Closed
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
3 changes: 3 additions & 0 deletions docs/Templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ YARD's `fulldoc` template defines three javascript files:
| | | |-- app.js
| | | |-- full_list.js
| | | |-- jquery.js
| | | |-- jquery-migrate.js

The `app.js` is the primary javascript file for the HTML output.

Expand All @@ -339,6 +340,8 @@ search field menus (i.e. class list, method list, and file list).

The `jquery.js` is copy of the jquery javascript library.

The `jquery-migrate.js` is copy of the jquery migrate helper javascript library.

### Adding a Custom Stylesheet or Javascript

To load additional stylesheets and javascripts with every page (except the search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="stylesheet" href="<%= abs_url('css', 'style.css') %>?<%= mtime('css/style.css') %>" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="<%= abs_url('css', 'custom.css') %>?<%= mtime('css/custom.css') %>" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" charset="utf-8" src="<%= abs_url('js', 'jquery.js') %>?<%= mtime('js/jquery.js') %>"></script>
<script type="text/javascript" charset="utf-8" src="<%= abs_url('js', 'jquery-migrate.js') %>?<%= mtime('js/jquery-migrate.js') %>"></script>
<script type="text/javascript" charset="utf-8">
function checkPage(process) {
$.ajax({cache: false, url: "<%= router.request.path %>" + (process ? "?process=true" : ""),
Expand Down
44 changes: 23 additions & 21 deletions templates/default/fulldoc/html/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,46 @@ try { sessionStorage = window.sessionStorage; } catch (e) { }
function createSourceLinks() {
$('.method_details_list .source_code').
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
$('.toggleSource').toggle(function() {
trivikr marked this conversation as resolved.
Show resolved Hide resolved
$(this).parent().nextAll('.source_code').slideDown(100);
$(this).text("Hide source");
},
function() {
$('.toggleSource').click(function() {
if ($(this).text() === "View source") {
$(this).parent().nextAll('.source_code').slideDown(100);
$(this).text("Hide source");
} else {
$(this).parent().nextAll('.source_code').slideUp(100);
$(this).text("View source");
}
});
}

function createDefineLinks() {
var tHeight = 0;
$('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
$('.toggleDefines').toggle(function() {
$('.toggleDefines').click(function() {
if ($(this).text() === "more...") {
tHeight = $(this).parent().prev().height();
$(this).prev().css('display', 'inline');
$(this).parent().prev().height($(this).parent().height());
$(this).text("(less)");
},
function() {
} else {
$(this).prev().hide();
$(this).parent().prev().height(tHeight);
$(this).text("more...");
}
});
}

function createFullTreeLinks() {
var tHeight = 0;
$('.inheritanceTree').toggle(function() {
$('.inheritanceTree').click(function() {
if($(this).text() === "show all") {
tHeight = $(this).parent().prev().height();
$(this).parent().toggleClass('showAll');
$(this).text("(hide)");
$(this).parent().prev().height($(this).parent().height());
},
function() {
$(this).parent().toggleClass('showAll');
} else {
$(this).parent().prev().height(tHeight);
$(this).text("show all");
}
$(this).parent().toggleClass('showAll');
});
}

Expand Down Expand Up @@ -216,14 +218,14 @@ function generateTOC() {
html = '<div id="toc"><p class="title hide_toc"><a href="#"><strong>Table of Contents</strong></a></p></div>';
$('#content').prepend(html);
$('#toc').append(_toc);
$('#toc .hide_toc').toggle(function() {
$('#toc .top').slideUp('fast');
$('#toc').toggleClass('hidden');
$('#toc .title small').toggle();
}, function() {
$('#toc .top').slideDown('fast');
$('#toc').toggleClass('hidden');
$('#toc .title small').toggle();
$('#toc .title.hide_toc').click(function() {
if ($(this).parent().hasClass('hidden')) {
$(this).next().slideDown('fast');
} else {
$(this).next().slideUp('fast');
}
$(this).parent().toggleClass('hidden');
$(this).find('small').toggle();
});
}

Expand Down
2 changes: 2 additions & 0 deletions templates/default/fulldoc/html/js/jquery-migrate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions templates/default/fulldoc/html/js/jquery.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/default/fulldoc/html/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def stylesheets_full_list
# searchable full lists, e.g., Class List, Method List, File List.
# @since 0.7.0
def javascripts_full_list
%w(js/jquery.js js/full_list.js)
%w(js/jquery.js js/jquery-migrate.js js/full_list.js)
end

def menu_lists
Expand Down
2 changes: 1 addition & 1 deletion templates/default/layout/html/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def diskfile
# @return [Array<String>] core javascript files for layout
# @since 0.7.0
def javascripts
%w(js/jquery.js js/app.js)
%w(js/jquery.js js/jquery-migrate.js js/app.js)
end

# @return [Array<String>] core stylesheets for the layout
Expand Down
2 changes: 1 addition & 1 deletion templates/guide/fulldoc/html/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class << options.serializer
end

def generate_assets
%w(js/jquery.js js/app.js css/style.css css/common.css).each do |file|
%w(js/jquery.js js/jquery-migrate.js js/app.js css/style.css css/common.css).each do |file|
asset(file, file(file, true))
end
end
Expand Down