Commit 09f8cbb4 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge changes from topics 'Library update', 'dont review'

* changes:
  Bug 1779040: Upgrade Select2 library to v4.0.5
  Bug 1776816: Update jquery-mobile - fix bind/unbind
  Bug 1776816: Update jquery-mobile to 1.5.0-alpha1
  Bug 1776798: Update jquery-ui to version v1.12.1
  Bug 1741987: Update jquery - tinymce/imagebrowser
  Bug 1741987: Update jquery - Core
  Bug 1741987: Update jquery - Attributes
  Bug 1741987: Update jquery - Events
  jQuery3: adding migration tool for debugging
  Bug 1741987: Update jquery to version 3.3.1
parents 287d8b67 d9cf9f89
......@@ -26,8 +26,8 @@ $form = privacy_form(!get_config('institutionstrictprivacy'), !get_config('insti
// JQuery logic for panel hide/show submit button.
$js = <<< EOF
$( document ).ready(function() {
$(".state-label").click(function() {
$(function() {
$(".state-label").on("click", function() {
$(this).siblings( ".switch-inner" ).toggleClass("redraw-consent");
showSubmitButton();
});
......
......@@ -250,7 +250,7 @@ function process_allowed_iframe_url($url) {
$js = <<<EOF
jQuery(function($) {
$('.url-open-editform').click(function(e) {
$('.url-open-editform').on("click", function(e) {
e.preventDefault();
$('#' + this.id).addClass('collapse-indicator');
$('#' + this.id).toggleClass('open');
......
......@@ -48,7 +48,7 @@ else {
list($html, $columns, $pagination, $search) = build_admin_archived_submissions_results($search, $offset, $limit);
$js = <<<EOF
jQuery(document).ready(function() {
jQuery(function() {
var p = {$pagination['javascript']}
new UserSearch(p);
......
......@@ -87,7 +87,7 @@ jQuery(function($) {
$('#menuitemlist').empty().append(form);
if (data.focusid) {
$('#item' + data.focusid).focus();
$('#item' + data.focusid).trigger("focus");
}
}
......@@ -166,7 +166,7 @@ jQuery(function($) {
// A text field for the name
var label = $('<label>', {'for':'name'+item.id,'class':'accessible-hidden'}).text(item.label);
var name = $('<input>', {'type':'text','class':'text form-control input-sm','id':'name'+item.id,'value':item.name});
name.keydown(function(e) {
name.on('keydown', function(e) {
if (e.keyCode == 13) {
save.trigger('click');
e.preventDefault();
......@@ -199,7 +199,7 @@ jQuery(function($) {
menuitem.addClass('hidden');
var newrow = editform(item);
newrow.insertBefore(menuitem)
$('#name' + item.id).focus();
$('#name' + item.id).trigger("focus");
}
// Receive standard json error message
......
......@@ -74,7 +74,7 @@ $searchform = pieform(array(
));
$js = <<< EOF
jQuery(document).ready(function() {
jQuery(function() {
p = {$data['pagination_js']}
jQuery('#search_submit').on('click', function(event) {
jQuery('#messages').empty();
......
......@@ -141,12 +141,12 @@ $form = pieform(array(
$inlinejs = <<<EOF
jQuery(function($) {
$('#addfontform_fontfileZip').change(function() {
$('#addfontform_fontfileZip').on('change', function() {
// need to hide the 'font files' fieldset
$('fieldset.individualfiles').hide(500);
});
$('fieldset.individualfiles input').each(function() {
$(this).change(function() {
$(this).on('change', function() {
// need to hide the 'zip archive' fieldset
$('fieldset.zipfile').hide(500);
});
......
......@@ -144,7 +144,7 @@ EOF;
if ($offset > 0) {
$js .= <<< EOF
if ($('#fontlist').length) {
$('#fontlist a:first').focus();
$('#fontlist a:first').trigger("focus");
}
EOF;
}
......@@ -154,7 +154,7 @@ else {
$('#searchresultsheading')
.addClass('hidefocus')
.prop('tabIndex', 0)
.focus();
.trigger("focus");
}
EOF;
}
......
......@@ -1011,7 +1011,7 @@ $usermultipleinstitutions = (!empty(users_in_multiple_institutions()) ? "true" :
$js = <<<EOF
var usersinmultipleinstitutions = {$usermultipleinstitutions};
jQuery(document).ready(function() {
jQuery(function() {
var j = jQuery.noConflict();
var overrideuseraccountlifetime = j('#siteoptions input[name=defaultaccountlifetimeupdate]');
var defaultaccountlifetime = j('#siteoptions_defaultaccountlifetime_units');
......@@ -1041,16 +1041,16 @@ jQuery(document).ready(function() {
}
}
// when default account lifetime changes rerun the override account lifetime checks
defaultaccountlifetime.change(function() {
defaultaccountlifetime.on("change", function() {
overrideuseraccountlife(defaultaccountlifetime.val());
});
// initial setup
overrideuseraccountlife(defaultaccountlifetime.val());
jQuery('#siteoptions_institutionstrictprivacy').click(function() {
jQuery('#siteoptions_institutionstrictprivacy').on("click", function() {
multipleinstitutionscheckallowed();
});
jQuery('#siteoptions_usersallowedmultipleinstitutions').click(function() {
jQuery('#siteoptions_usersallowedmultipleinstitutions').on("click", function() {
strictprivacycheckallowed();
});
multipleinstitutionscheckallowed();
......
......@@ -129,7 +129,7 @@ function editsitepage_submit(Pieform $form, $values) {
// JQuery logic for tab hide/show and to keep the same tab active on page refresh.
$js = <<< EOF
$(document).ready(function() {
$(function() {
checkActiveTab('$selectedtab');
})
EOF;
......
......@@ -41,7 +41,7 @@ EOF;
if ($offset > 0) {
$js .= <<< EOF
if ($('#myviews')) {
$('#myviews a:first').focus();
$('#myviews a:first').trigger("focus");
}
EOF;
}
......@@ -51,7 +51,7 @@ else {
$('#searchresultsheading')
.addClass('hidefocus')
.prop('tabIndex', -1)
.focus();
.trigger("focus");
}
EOF;
}
......
......@@ -231,13 +231,13 @@ $remoteusernames = json_encode(get_records_menu('auth_remote_user', 'localusr',
$js = "<script type='application/javascript'>
var externalauths = ['" . implode("','", $externalauthjs) . "'];
var remoteusernames = " . $remoteusernames . ";
jQuery(document).ready(function() {
jQuery(function() {
// set up initial display
var authinstanceid = jQuery('#edituser_site_authinstance :selected').val();
is_external(authinstanceid);
// update display as auth method dropdown changes
jQuery('#edituser_site_authinstance').change(function() {
jQuery('#edituser_site_authinstance').on('change', function() {
authinstanceid = jQuery('#edituser_site_authinstance :selected').val();
is_external(authinstanceid);
});
......
......@@ -171,7 +171,7 @@ function editsitepage_submit(Pieform $form, $values) {
}
$js = <<< EOF
$(document).ready(function() {
$(function() {
checkActiveTab('$selectedtab');
$('#usertypeselect_institution').on('change', reloadUsers);
});
......
......@@ -1293,7 +1293,7 @@ jQuery(function($) {
if ($("#institution_theme").val() === "custom") {
$(".customtheme").removeClass("js-hidden");
}
$("#institution_theme").change(function() {
$("#institution_theme").on("change", function() {
if ($(this).val() === "custom") {
$(".customtheme").removeClass("js-hidden");
}
......
......@@ -51,7 +51,7 @@ $js = <<< EOF
function reloadTags() {
window.location.href = '{$wwwroot}admin/users/institutiontags.php?institution='+$('#usertypeselect_institution').val();
}
$(document).ready(function() {
$(function() {
$('#usertypeselect_institution').on('change', reloadTags);
});
EOF;
......
......@@ -211,7 +211,7 @@ jQuery(function ($) {
// We need to show/hide modal explicitly so the on 'show.bs.modal' fires allowing
// us to do ajax call for form as modal opens
$('#configbtn').click(function() {
$('#configbtn').on("click", function() {
$("#modal-configs").modal("show");
});
$("#modal-configs").on('show.bs.modal', function () {
......
......@@ -41,7 +41,7 @@ if ($userid) {
$link = get_config('wwwroot') . 'admin/users/statisticsuseragreements.php?userid=' . $userid;
$js = <<< EOF
$(document).ready(function(){
$(function() {
checkActiveTab('$activetab');
})
EOF;
......
......@@ -159,14 +159,14 @@ jQuery(function ($) {
show_buttons('$type');
var wireselectall = function() {
$("#selectall").click(function(e) {
$("#selectall").on("click", function(e) {
e.preventDefault();
$("#suspendedlist :checkbox").prop("checked", true);
});
};
var wireselectnone = function() {
$("#selectnone").click(function(e) {
$("#selectnone").on("click", function(e) {
e.preventDefault();
$("#suspendedlist :checkbox").prop("checked", false);
});
......
function addNewPostShortcut(blockid) {
var addentry = jQuery('#blockinstance_' + blockid + ' .blockinstance-content');
addentry.find('a').first().click(function(e) {
addentry.find('a').first().on("click", function(e) {
e.preventDefault();
var blogselect = addentry.find('select').first().val();
if (!blogselect) {
......
......@@ -12,7 +12,7 @@ var addNewTaggedPostShortcut = (function($) {
var myForm = $('<form>', {'action': config.wwwroot + 'artefact/blog/post.php', 'method': 'POST'});
myForm.append(BlogIDInput[0], TagInput);
document.body.appendChild(myForm[0]);
myForm.submit();
myForm.trigger('submit');
});
}
);
......
$j('#instconf_select_container input[type="radio"][value="0"]').click(function() {
$j('#instconf_select_container input[type="radio"][value="0"]').on("click", function() {
$j('#instconf_images_header').addClass('hidden');
$j('#instconf_images_container').addClass('hidden');
$j('#instconf_external_header').addClass('hidden');
......@@ -8,7 +8,7 @@ $j('#instconf_select_container input[type="radio"][value="0"]').click(function()
$j('#instconf_folder_header').removeClass('hidden');
$j('#instconf_folder_container').removeClass('hidden');
});
$j('#instconf_select_container input[type="radio"][value="1"]').click(function() {
$j('#instconf_select_container input[type="radio"][value="1"]').on("click", function() {
$j('#instconf_folder_header').addClass('hidden');
$j('#instconf_folder_container').addClass('hidden');
$j('#instconf_external_header').addClass('hidden');
......@@ -18,7 +18,7 @@ $j('#instconf_select_container input[type="radio"][value="1"]').click(function()
$j('#instconf_images_header').removeClass('hidden');
$j('#instconf_images_container').removeClass('hidden');
});
$j('#instconf_select_container input[type="radio"][value="2"]').click(function() {
$j('#instconf_select_container input[type="radio"][value="2"]').on("click", function() {
$j('#instconf_images_header').addClass('hidden');
$j('#instconf_images_container').addClass('hidden');
$j('#instconf_folder_header').addClass('hidden');
......@@ -28,12 +28,12 @@ $j('#instconf_select_container input[type="radio"][value="2"]').click(function()
$j('#instconf_external').removeClass('hidden');
$j('#externalgalleryhelp').removeClass('hidden');
});
$j('#instconf_style_container input[type="radio"][value="0"]').click(function () {
$j('#instconf_style_container input[type="radio"][value="0"]').on("click", function () {
$j('#instconf_width').val('75');
});
$j('#instconf_style_container input[type="radio"][value="1"]').click(function () {
$j('#instconf_style_container input[type="radio"][value="1"]').on("click", function () {
$j('#instconf_width').val('400');
});
$j('#instconf_style_container input[type="radio"][value="2"]').click(function () {
$j('#instconf_style_container input[type="radio"][value="2"]').on("click", function () {
$j('#instconf_width').val('75');
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment