Commit 841c042b authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon

Bug 1741987: Update jquery - Core

Deprecated: document-ready handlers other than jQuery(function)
Breaking change: Deprecated .size() removed

behatnotneeded

Change-Id: I7c61090a3362586571855fc081847c084e398c33
parent fac1d239
......@@ -26,7 +26,7 @@ $form = privacy_form(!get_config('institutionstrictprivacy'), !get_config('insti
// JQuery logic for panel hide/show submit button.
$js = <<< EOF
$( document ).ready(function() {
$(function() {
$(".state-label").on("click", function() {
$(this).siblings( ".switch-inner" ).toggleClass("redraw-consent");
showSubmitButton();
......
......@@ -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);
......
......@@ -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();
......
......@@ -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');
......
......@@ -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;
......
......@@ -231,7 +231,7 @@ $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);
......
......@@ -171,7 +171,7 @@ function editsitepage_submit(Pieform $form, $values) {
}
$js = <<< EOF
$(document).ready(function() {
$(function() {
checkActiveTab('$selectedtab');
$('#usertypeselect_institution').on('change', reloadUsers);
});
......
......@@ -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;
......
......@@ -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;
......
......@@ -149,8 +149,7 @@ var FileBrowser = (function($) {
'class':'file',
'id':self.id+'_userfile',
'name':'userfile[]',
'multiple':'',
'size':40
'multiple':''
})
);
$('#' + self.id + '_userfile').on('change', self.upload_submit);
......
......@@ -9,7 +9,7 @@
*/
// set up the dropzone
jQuery(document).ready(function() {
jQuery(function() {
// to avoid any clashes with other javascript
var j = jQuery.noConflict();
......
......@@ -8,7 +8,7 @@
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*/
jQuery(document).ready(function($) {
jQuery(function($) {
var navigationkeys = {
LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, SPACE: 32, ENTER: 13, ESC: 27, TAB: 9
};
......
......@@ -846,7 +846,7 @@ function escapeRegExp(string) {
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
}
jQuery(document).ready(function($) {
jQuery(function($) {
// Allow the js / no-js toggle on all pages for theme styling
$('body').removeClass('no-js').addClass('js');
......@@ -1071,7 +1071,7 @@ Number.isInteger = Number.isInteger || function(value) {
/**
* Wire up the 'help' footer link so it opens help in a new window/tab
*/
jQuery(document).ready(function($) {
jQuery(function($) {
if ($('#footerhelp').length > 0) {
var link = $('#footerhelp');
link.off('click');
......@@ -1088,7 +1088,7 @@ jQuery(document).ready(function($) {
/**
* Wire up the 'help' in blocks edit page so it opens help in a new window/tab
*/
jQuery(document).ready(function($) {
jQuery(function($) {
if ($('#blockshelp').length > 0) {
var link = $('#blockshelp');
link.off('click');
......
......@@ -67,7 +67,7 @@ var SearchTable = (function($) {
});
};
$(document).ready(self.init);
$(self.init);
};
}(jQuery));
......
......@@ -186,7 +186,7 @@ return function (target, source, columns, options) {
self.doupdate();
}
else {
$(document).ready(self.doupdate.bind(null, request_args, null));
$(self.doupdate.bind(null, request_args, null));
}
};
......@@ -194,7 +194,7 @@ return function (target, source, columns, options) {
this.init();
}
else {
$(document).ready(this.init);
$(this.init);
}
};
}(jQuery));
......@@ -9,7 +9,7 @@
*
*/
jQuery(document).ready(function() {
jQuery(function() {
jQuery(this).find('textarea').each(function(i, textarea) {
var textarea = jQuery(textarea);
var maxlength = textarea.attr('maxlength');
......
......@@ -1377,7 +1377,7 @@
* Initialise
*
*/
$(document).ready(function() {
$(function() {
init();
/**
* changes the intructions so they are for ajax
......
......@@ -122,7 +122,7 @@ function pieform_element_color_get_headdata($element, Pieform $form) {
$result = '<script type="application/javascript">';
$result .= "var initjscolor = false; \n";
$result .= "PieformManager.connect('onload', null, function() {\n";
$result .= " jQuery('document').ready(function($) { \n";
$result .= " jQuery(function($) { \n";
$result .= " if (initjscolor === true) { \n";
$result .= " // rewire up the picker to show up\n";
$result .= " var jsc = new jscolor('" . $name . "'); \n";
......
......@@ -314,7 +314,7 @@ var Pieform = (function($) {
// Form configuration data passed from PHP
this.data = data;
$(document).ready(self.init);
$(self.init);
};
}(jQuery));
jQuery(document).ready(function() {
jQuery(function() {
jQuery(document).on("change", "#universalsearchresult select", function() {
var selectid = new String(jQuery(this).attr('id'));
......
......@@ -439,7 +439,7 @@ class Behat2Renderer
return "<script type='text/javascript' src='assets/Twig/js/jquery.js'></script>
<script type='text/javascript'>
$(document).ready(function(){
$(function() {
Array.prototype.diff = function(a) {
return this.filter(function(i) {return a.indexOf(i) < 0;});
};
......
......@@ -40,7 +40,7 @@ function isMaharaPageReady() {
&& (document.readyState === "complete");
}
jQuery(document).ready(function() {
jQuery(function() {
/**
* Listening for ajax events
*/
......
......@@ -100,7 +100,7 @@
</label>
<span id="{$prefix}_userfile_container">
<input type="file" class="file" {$accepts|safe} {if $capturedevice} capture="{$capturedevice}"{/if} id="{$prefix}_userfile" name="userfile[]" multiple size="20" />
<input type="file" class="file" {$accepts|safe} {if $capturedevice} capture="{$capturedevice}"{/if} id="{$prefix}_userfile" name="userfile[]" multiple />
</span>
<span id="{$prefix}_userfile_maxuploadsize" class="file-description">
......
......@@ -35,7 +35,7 @@
<script type="application/javascript">
var blockid = '{$blockid}';
{literal}
jQuery(window).ready(function() {
jQuery(function() {
jQuery("#" + blockid + " a.inbox-showmessage").each(function() {
var el = jQuery(this);
el.on("click", function(e) {
......
......@@ -2,7 +2,7 @@
{{if !$readonly}}<input type=hidden name="rating" id="{{$id}}">{{/if}}
<script type="application/javascript">
jQuery(document).ready(function() {
jQuery(function() {
jQuery("#{{$id}}_wrapper").rating('create', {
coloron:'{{$colouron}}',
coloroff:'{{$colouroff}}',
......
......@@ -115,7 +115,7 @@ var count = 0;
jQuery(function($) {
"use strict";
$(document).ready(function() {
$(function() {
// For some reasons, form validation for required select element generated by select2js
// does not work properly on Microsoft Edge
......
......@@ -1198,7 +1198,7 @@ This drop-down select box allows you to enter text which is then searched using
This drop-down select box uses the select2 library. An example can be found on the compose message page in user's inbox.
```
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(function() {
jQuery(".js-example-basic-single").select2();
});
</script>
......
......@@ -638,7 +638,7 @@ $count = count($records);
if ($count) {
$js .= <<<EOF
jQuery(function($) {
$(document).ready(function() {
$(function() {
for (i = 0; i < {$count}; i++) {
var element = document.getElementById("copytoclipboard-" + i);
try {
......
......@@ -152,21 +152,19 @@ $count = count($records);
if ($count) {
$js = <<<EOF
jQuery(function($) {
$(document).ready(function() {
for (i = 0; i < {$count}; i++) {
var element = document.getElementById("copytoclipboard-" + i);
try {
var client = new ClipboardJS(element);
client.on("error", function(e) {
var element = document.getElementById("copytoclipboard-" + e.client.id);
$(element).hide();
});
}
catch(err) {
$(element).hide();
}
}
});
for (i = 0; i < {$count}; i++) {
var element = document.getElementById("copytoclipboard-" + i);
try {
var client = new ClipboardJS(element);
client.on("error", function(e) {
var element = document.getElementById("copytoclipboard-" + e.client.id);
$(element).hide();
});
}
catch(err) {
$(element).hide();
}
}
});
EOF;
......
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