Replace $(document).ready with shortcut version

pull/2874/head
Julio 7 years ago
parent ddac454615
commit c07b9958a4
  1. 2
      main/attendance/attendance_sheet.php
  2. 2
      main/auth/courses_categories.php
  3. 2
      main/auth/inscription.php
  4. 4
      main/auth/profile.php
  5. 2
      main/badge/assign.php
  6. 2
      main/course_home/course_home.php
  7. 2
      main/course_progress/index.php
  8. 2
      main/document/create_audio.php
  9. 6
      main/document/document.php
  10. 2
      main/dropbox/dropbox_functions.inc.php
  11. 4
      main/exercise/exercise.class.php
  12. 2
      main/exercise/exercise_admin.php
  13. 2
      main/exercise/exercise_report.php
  14. 4
      main/exercise/exercise_show.php
  15. 2
      main/exercise/export/scorm/ScormQuestion.php
  16. 3
      main/exercise/hotpotatoes_exercise_report.php
  17. 2
      main/exercise/hotspot_admin.inc.php
  18. 2
      main/exercise/savescores.php
  19. 2
      main/exercise/showinframes.php
  20. 2
      main/forum/editpost.php
  21. 2
      main/forum/editthread.php
  22. 2
      main/forum/forumqualify.php
  23. 2
      main/forum/index.php
  24. 2
      main/forum/newthread.php
  25. 2
      main/forum/reply.php
  26. 2
      main/forum/viewforumcategory.php
  27. 2
      main/glossary/index.php
  28. 2
      main/gradebook/get_badges.php
  29. 6
      main/gradebook/gradebook.php
  30. 2
      main/gradebook/gradebook_add_eval.php
  31. 2
      main/gradebook/gradebook_add_link.php
  32. 2
      main/gradebook/gradebook_edit_eval.php
  33. 2
      main/gradebook/gradebook_edit_link.php
  34. 2
      main/gradebook/index.php
  35. 2
      main/group/group.php
  36. 2
      main/group/group_category.php
  37. 2
      main/group/member_settings.php
  38. 2
      main/group/tutor_settings.php
  39. 2
      main/inc/ajax/lang.ajax.php
  40. 2
      main/inc/lib/api.lib.php
  41. 2
      main/inc/lib/document.lib.php
  42. 8
      main/inc/lib/exercise.lib.php
  43. 2
      main/inc/lib/extra_field.lib.php
  44. 2
      main/inc/lib/fixlinks.js
  45. 2
      main/inc/lib/formvalidator/Element/Color.php
  46. 2
      main/inc/lib/formvalidator/FormValidator.class.php
  47. 2
      main/inc/lib/pear/HTML/QuickForm/advmultiselect.php
  48. 6
      main/inc/lib/social.lib.php
  49. 2
      main/inc/lib/statistics.lib.php
  50. 7
      main/install/index.php
  51. 2
      main/link/link.php
  52. 2
      main/lp/lp_add_item.php
  53. 2
      main/lp/lp_controller.php
  54. 14
      main/lp/lp_edit.php
  55. 4
      main/lp/lp_edit_item.php
  56. 4
      main/lp/lp_view.php
  57. 4
      main/lp/scorm_api.php
  58. 2
      main/mySpace/exercise_category_report.php
  59. 2
      main/mySpace/slider.js
  60. 2
      main/notebook/index.php
  61. 2
      main/session/session_add.php
  62. 4
      main/session/session_edit.php
  63. 2
      main/social/group_topics.php
  64. 2
      main/social/myfiles.php
  65. 2
      main/social/profile.php
  66. 2
      main/survey/fillsurvey.php
  67. 2
      main/survey/question.php
  68. 2
      main/ticket/new_ticket.php
  69. 2
      main/ticket/report.php
  70. 2
      main/ticket/ticket_details.php
  71. 2
      main/ticket/tickets.php
  72. 2
      main/ticket/tutor.php
  73. 2
      main/timeline/view.php
  74. 2
      main/tracking/courseLog.php
  75. 2
      main/user/class.php
  76. 2
      main/wiki/index.php
  77. 4
      main/work/work.lib.php

@ -182,7 +182,7 @@ if (api_is_allowed_to_edit(null, true) ||
}); });
} }
$(document).ready(function() { $(function() {
$("table.tableWithFloatingHeader").each(function() { $("table.tableWithFloatingHeader").each(function() {
$(this).wrap("<div class=\"divTableWithFloatingHeader\" style=\"position:relative\"></div>"); $(this).wrap("<div class=\"divTableWithFloatingHeader\" style=\"position:relative\"></div>");

@ -36,7 +36,7 @@ $code = isset($code) ? $code : null;
?> ?>
<script> <script>
$(document).ready( function() { $(function() {
$('.star-rating li a').on('click', function(event) { $('.star-rating li a').on('click', function(event) {
var id = $(this).parents('ul').attr('id'); var id = $(this).parents('ul').attr('id');
$('#vote_label2_' + id).html("<?php echo get_lang('Loading'); ?>"); $('#vote_label2_' + id).html("<?php echo get_lang('Loading'); ?>");

@ -586,7 +586,7 @@ $allowDoubleValidation = api_get_configuration_value('allow_double_validation_in
$formContainsSendButton = false; $formContainsSendButton = false;
if ($allowDoubleValidation && $showTerms == false) { if ($allowDoubleValidation && $showTerms == false) {
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$("#pre_validation").click(function() { $("#pre_validation").click(function() {
$(this).hide(); $(this).hide();
$("#final_button").show(); $("#final_button").show();

@ -40,7 +40,7 @@ $htmlHeadXtra[] = api_get_password_checker_js('#username', '#password1');
$htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css'); $htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css');
$htmlHeadXtra[] = api_get_asset('cropper/dist/cropper.min.js'); $htmlHeadXtra[] = api_get_asset('cropper/dist/cropper.min.js');
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$("#id_generate_api_key").on("click", function (e) { $("#id_generate_api_key").on("click", function (e) {
e.preventDefault(); e.preventDefault();
@ -332,7 +332,7 @@ $jquery_ready_content = $return['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that // the $jquery_ready_content variable collects all functions that
// will be load in the $(document).ready javascript function // will be load in the $(document).ready javascript function
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function(){ $(function() {
'.$jquery_ready_content.' '.$jquery_ready_content.'
}); });
</script>'; </script>';

@ -418,7 +418,7 @@ if ($disableList) {
} }
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$("#skill").on("change", function() { $("#skill").on("change", function() {
$(location).attr("href", "'.$url.'&id="+$(this).val()); $(location).attr("href", "'.$url.'&id="+$(this).val());
}); });

@ -34,7 +34,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
/* option show/hide thematic-block */ /* option show/hide thematic-block */
$(document).ready(function(){ $(function() {
$("#thematic-show").click(function(){ $("#thematic-show").click(function(){
$(".btn-hide-thematic").hide(); $(".btn-hide-thematic").hide();
$(".btn-show-thematic").show(); //show using class $(".btn-show-thematic").show(); //show using class

@ -89,7 +89,7 @@ $default_thematic_plan_title = $thematic->get_default_thematic_plan_title();
// Only when I see the 3 columns. Avoids double or triple click binding for onclick event // Only when I see the 3 columns. Avoids double or triple click binding for onclick event
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$(".thematic_advance_actions, .thematic_tools ").hide(); $(".thematic_advance_actions, .thematic_tools ").hide();
$(".thematic_content").mouseover(function() { $(".thematic_content").mouseover(function() {
var id = parseInt(this.id.split("_")[3]); var id = parseInt(this.id.split("_")[3]);

@ -162,7 +162,7 @@ echo '</div>';
<!-- javascript and styles for textareaCounter--> <!-- javascript and styles for textareaCounter-->
<script> <script>
var info; var info;
$(document).ready(function () { $(function() {
var options = { var options = {
'maxCharacterSize': 100, 'maxCharacterSize': 100,
'originalStyle': 'originalTextareaInfo', 'originalStyle': 'originalTextareaInfo',

@ -778,7 +778,7 @@ function confirmation (name) {
} }
} }
$(document).ready(function() { $(function() {
$(".convertAction").click(function() { $(".convertAction").click(function() {
var id = $(this).attr("data-documentId"); var id = $(this).attr("data-documentId");
var format = $(this).attr("data-formatType"); var format = $(this).attr("data-formatType");
@ -944,7 +944,7 @@ if (!empty($documentAndFolders)) {
$htmlHeadXtra[] = ' $htmlHeadXtra[] = '
<script> <script>
$(document).ready( function() { $(function() {
//Experimental changes to preview mp3, ogg files' //Experimental changes to preview mp3, ogg files'
.$jquery.' .$jquery.'
}); });
@ -2162,7 +2162,7 @@ $ajaxURL = api_get_path(WEB_AJAX_PATH).'document.ajax.php?a=get_document_quota&'
if (count($documentAndFolders) > 1) { if (count($documentAndFolders) > 1) {
echo '<script> echo '<script>
$(document).ready(function() { $(function() {
$.ajax({ $.ajax({
url:"'.$ajaxURL.'", url:"'.$ajaxURL.'",
success:function(data){ success:function(data){

@ -16,7 +16,7 @@ $htmlHeadXtra[] = '<script>
function setFocus(){ function setFocus(){
$("#category_title").focus(); $("#category_title").focus();
} }
$(document).ready(function () { $(function() {
setFocus(); setFocus();
}); });
</script>'; </script>';

@ -3223,7 +3223,7 @@ class Exercise
openClockWarning(); openClockWarning();
} }
$(document).ready(function() { $(function() {
// time in seconds when using minutes there are some seconds lost // time in seconds when using minutes there are some seconds lost
var time_left = parseInt(".$time_left."); var time_left = parseInt(".$time_left.");
$('#exercise_clock_warning').epiclock({ $('#exercise_clock_warning').epiclock({
@ -5498,7 +5498,7 @@ class Exercise
<p><em>".get_lang('HotSpot')."</em></p> <p><em>".get_lang('HotSpot')."</em></p>
<div id=\"hotspot-solution-$questionId\"></div> <div id=\"hotspot-solution-$questionId\"></div>
<script> <script>
$(document).on('ready', function () { $(function() {
new HotspotQuestion({ new HotspotQuestion({
questionId: $questionId, questionId: $questionId,
exerciseId: {$this->id}, exerciseId: {$this->id},

@ -119,7 +119,7 @@ $htmlHeadXtra[] = '<script>
function setFocus(){ function setFocus(){
$("#exercise_title").focus(); $("#exercise_title").focus();
} }
$(document).ready(function () { $(function() {
setFocus(); setFocus();
}); });
</script>'; </script>';

@ -495,7 +495,7 @@ $token = Security::get_token();
$actions = Display::div($actions, ['class' => 'actions']); $actions = Display::div($actions, ['class' => 'actions']);
$extra = '<script> $extra = '<script>
$(document).ready(function() { $(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" ); $( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-confirm" ).dialog({ $( "#dialog-confirm" ).dialog({
autoOpen: false, autoOpen: false,

@ -489,7 +489,7 @@ foreach ($questionList as $questionId) {
<td colspan=\"2\"> <td colspan=\"2\">
<div id=\"hotspot-solution-$questionId-$id\"></div> <div id=\"hotspot-solution-$questionId-$id\"></div>
<script> <script>
$(document).on('ready', function () { $(function() {
new HotspotQuestion({ new HotspotQuestion({
questionId: $questionId, questionId: $questionId,
exerciseId: {$objExercise->id}, exerciseId: {$objExercise->id},
@ -658,7 +658,7 @@ foreach ($questionList as $questionId) {
<td colspan=\"2\"> <td colspan=\"2\">
<div id=\"hotspot-solution\"></div> <div id=\"hotspot-solution\"></div>
<script> <script>
$(document).on('ready', function () { $(function() {
new HotspotQuestion({ new HotspotQuestion({
questionId: $questionId, questionId: $questionId,
exerciseId: {$objExercise->id}, exerciseId: {$objExercise->id},

@ -196,7 +196,7 @@ class ScormQuestion extends Question
$weight = $this->selectWeighting(); $weight = $this->selectWeighting();
$js = ' $js = '
questions.push('.$this->js_id.'); questions.push('.$this->js_id.');
$(document).ready(function() { $(function() {
if (exerciseInfo.randomAnswers == true) { if (exerciseInfo.randomAnswers == true) {
$("#question_'.$this->js_id.'").shuffleRows(); $("#question_'.$this->js_id.'").shuffleRows();
} }

@ -107,8 +107,7 @@ Display :: display_header($nameTools);
$actions = Display::div($actions, ['class' => 'actions']); $actions = Display::div($actions, ['class' => 'actions']);
$extra = '<script> $extra = '<script>
$(document).ready(function() { $(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" ); $( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-confirm" ).dialog({ $( "#dialog-confirm" ).dialog({
autoOpen: false, autoOpen: false,

@ -1109,7 +1109,7 @@ if (isset($modifyAnswers)) {
</div> </div>
</form> </form>
<script> <script>
$(document).on('ready', function () { $(function() {
<?php if ($answerType == HOT_SPOT_DELINEATION) { <?php if ($answerType == HOT_SPOT_DELINEATION) {
?> ?>
new DelineationQuestion({ new DelineationQuestion({

@ -70,7 +70,7 @@ function save_scores($file, $score)
global $jscript2run; global $jscript2run;
//record the results in the learning path, using the SCORM interface (API) //record the results in the learning path, using the SCORM interface (API)
$jscript2run .= "<script> $jscript2run .= "<script>
$(document).ready(function() { $(function() {
//API_obj = window.frames.window.content.API; //API_obj = window.frames.window.content.API;
//API_obj = $('content_id').context.defaultView.content.API; //works only in FF //API_obj = $('content_id').context.defaultView.content.API; //works only in FF
//API_obj = window.parent.frames.window.top.API; //API_obj = window.parent.frames.window.top.API;

@ -93,7 +93,7 @@ $htmlHeadXtra[] = <<<HTML
iframe.height = maxheight; iframe.height = maxheight;
} }
$(document).on('ready', function () { $(function() {
var iframe = document.getElementById('hotpotatoe'); var iframe = document.getElementById('hotpotatoe');
iframe.onload = function () { iframe.onload = function () {
// this.height = $(this.contentDocument.body).outerHeight(true) // this.height = $(this.contentDocument.body).outerHeight(true)

@ -110,7 +110,7 @@ $table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
/* Header */ /* Header */
$htmlHeadXtra[] = <<<JS $htmlHeadXtra[] = <<<JS
<script> <script>
$(document).on('ready', function() { $(function() {
$('#reply-add-attachment').on('click', function(e) { $('#reply-add-attachment').on('click', function(e) {
e.preventDefault(); e.preventDefault();

@ -123,7 +123,7 @@ $tableLink = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
/* Header */ /* Header */
$htmlHeadXtra[] = <<<JS $htmlHeadXtra[] = <<<JS
<script> <script>
$(document).on('ready', function() { $(function() {
$('[name="thread_qualify_gradebook"]:checkbox').change(function () { $('[name="thread_qualify_gradebook"]:checkbox').change(function () {
if (this.checked) { if (this.checked) {
$('#options_field').show(); $('#options_field').show();

@ -77,7 +77,7 @@ if (isset($_POST['idtextqualify'])) {
/* Including necessary files */ /* Including necessary files */
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function(){ $(function() {
$(\'.hide-me\').slideUp() $(\'.hide-me\').slideUp()
}); });

@ -30,7 +30,7 @@ api_protect_course_script(true);
$current_course_tool = TOOL_FORUM; $current_course_tool = TOOL_FORUM;
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$(\'.hide-me\').slideUp(); $(\'.hide-me\').slideUp();
}); });

@ -138,7 +138,7 @@ if (!empty($groupId)) {
$htmlHeadXtra[] = " $htmlHeadXtra[] = "
<script> <script>
$(document).on('ready', function() { $(function() {
$('#reply-add-attachment').on('click', function(e) { $('#reply-add-attachment').on('click', function(e) {
e.preventDefault(); e.preventDefault();

@ -132,7 +132,7 @@ if (!empty($groupId)) {
/* Header */ /* Header */
$htmlHeadXtra[] = <<<JS $htmlHeadXtra[] = <<<JS
<script> <script>
$(document).on('ready', function() { $(function() {
$('#reply-add-attachment').on('click', function(e) { $('#reply-add-attachment').on('click', function(e) {
e.preventDefault(); e.preventDefault();

@ -32,7 +32,7 @@ Session::erase('_gid');
api_protect_course_script(true); api_protect_course_script(true);
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function(){ $(function() {
$(\'.hide-me\').slideUp() $(\'.hide-me\').slideUp()
}); });

@ -26,7 +26,7 @@ function setFocus(){
$("#glossary_title").focus(); $("#glossary_title").focus();
} }
$(document).ready(function () { $(function() {
setFocus(); setFocus();
$( "#dialog:ui-dialog" ).dialog( "destroy" ); $( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-confirm" ).dialog({ $( "#dialog-confirm" ).dialog({

@ -56,7 +56,7 @@ $tpl = new Template(get_lang('Badges'), false, false);
$tpl->assign( $tpl->assign(
'content', 'content',
"<script> "<script>
$(document).on('ready', function (){ $(function() {
OpenBadges.issue_no_modal(".json_encode($assertions)."); OpenBadges.issue_no_modal(".json_encode($assertions).");
}); });
</script>" </script>"

@ -25,14 +25,14 @@ if (!empty($_GET['course'])) {
$selectcat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0; $selectcat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
for (i=0;i<$(".actions").length;i++) { for (i=0;i<$(".actions").length;i++) {
if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) { if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) {
$(".actions:eq("+i+")").hide(); $(".actions:eq("+i+")").hide();
} }
} }
} ); });
</script>'; </script>';
api_block_anonymous_users(); api_block_anonymous_users();
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>

@ -109,7 +109,7 @@ $interbreadcrumb[] = [
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("#hid_category_id").change(function() { $("#hid_category_id").change(function() {
$("#hid_category_id option:selected").each(function () { $("#hid_category_id option:selected").each(function () {
var cat_id = $(this).val(); var cat_id = $(this).val();

@ -175,7 +175,7 @@ $interbreadcrumb[] = [
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("#hide_category_id").change(function() { $("#hide_category_id").change(function() {
$("#hide_category_id option:selected").each(function () { $("#hide_category_id option:selected").each(function () {
var cat_id = $(this).val(); var cat_id = $(this).val();

@ -64,7 +64,7 @@ $interbreadcrumb[] = [
]; ];
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("#hid_category_id").change(function() { $("#hid_category_id").change(function() {
$("#hid_category_id option:selected").each(function () { $("#hid_category_id option:selected").each(function () {
var cat_id = $(this).val(); var cat_id = $(this).val();

@ -124,7 +124,7 @@ $interbreadcrumb[] = [
]; ];
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("#hide_category_id").change(function() { $("#hide_category_id").change(function() {
$("#hide_category_id option:selected").each(function () { $("#hide_category_id option:selected").each(function () {
var cat_id = $(this).val(); var cat_id = $(this).val();

@ -94,7 +94,7 @@ function confirmation() {
} }
} }
$(document).ready(function() { $(function() {
$("body").on("click", ".view_children", function() { $("body").on("click", ".view_children", function() {
var id = $(this).attr("data-cat-id"); var id = $(this).attr("data-cat-id");
$(".hidden_"+id).removeClass("hidden"); $(".hidden_"+id).removeClass("hidden");

@ -30,7 +30,7 @@ $sessionId = api_get_session_id();
api_protect_course_script(true); api_protect_course_script(true);
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
var i; var i;
for (i=0; i<$(".actions").length; i++) { for (i=0; i<$(".actions").length; i++) {
if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) { if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) {

@ -84,7 +84,7 @@ if (isset($_GET['id'])) {
} }
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("#max_member").on("focus", function() { $("#max_member").on("focus", function() {
$("#max_member_selected").attr("checked", true); $("#max_member_selected").attr("checked", true);
}); });

@ -115,7 +115,7 @@ function check_group_members($value)
} }
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("#max_member").on("focus", function() { $("#max_member").on("focus", function() {
$("#max_member_selected").attr("checked", true); $("#max_member_selected").attr("checked", true);
}); });

@ -99,7 +99,7 @@ function sort_users($user_a, $user_b)
} }
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("#max_member").on("focus", function() { $("#max_member").on("focus", function() {
$("#max_member_selected").attr("checked", true); $("#max_member_selected").attr("checked", true);
}); });

@ -33,7 +33,7 @@ switch ($action) {
$languageInfo = api_get_language_info($languageId); $languageInfo = api_get_language_info($languageId);
echo ' echo '
$(document).ready(function() { $(function() {
'.$hideAll.' '.$hideAll.'
var defaultLanguageFromUser = "'.$languageInfo['isocode'].'"; var defaultLanguageFromUser = "'.$languageInfo['isocode'].'";
$("span:lang('.$languageInfo['isocode'].')").filter( $("span:lang('.$languageInfo['isocode'].')").filter(

@ -8094,7 +8094,7 @@ function api_get_password_checker_js($usernameInputId, $passwordInputId)
same_as_username : \"".get_lang('YourPasswordCannotBeTheSameAsYourUsername')."\" same_as_username : \"".get_lang('YourPasswordCannotBeTheSameAsYourUsername')."\"
}; };
$(document).ready(function() { $(function() {
var lang = ".json_encode($translations)."; var lang = ".json_encode($translations).";
var options = { var options = {
onLoad : function () { onLoad : function () {

@ -3455,7 +3455,7 @@ class DocumentManager
if ($lp_id === false) { if ($lp_id === false) {
$url = $lpAjaxUrl.'?a=get_documents&lp_id=&cidReq='.$course_info['code']; $url = $lpAjaxUrl.'?a=get_documents&lp_id=&cidReq='.$course_info['code'];
$return .= "<script> $return .= "<script>
$(document).ready(function () { $(function() {
$('.close_div').click(function() { $('.close_div').click(function() {
var course_id = this.id.split('_')[2]; var course_id = this.id.split('_')[2];
var session_id = this.id.split('_')[3]; var session_id = this.id.split('_')[3];

@ -295,7 +295,7 @@ class ExerciseLib
RadioValidator(question_id, answer_id); RadioValidator(question_id, answer_id);
} }
$(document).ready(function() { $(function() {
var ShowAlert = ''; var ShowAlert = '';
var typeRadioB = ''; var typeRadioB = '';
var question_id = $('input[name=question_id]').val(); var question_id = $('input[name=question_id]').val();
@ -1257,7 +1257,7 @@ HTML;
if (!$freeze) { if (!$freeze) {
$s .= " $s .= "
<script> <script>
$(document).on('ready', function() { $(function() {
jsPlumb.ready(function() { jsPlumb.ready(function() {
jsPlumb.connect({ jsPlumb.connect({
source: 'window_$windowId', source: 'window_$windowId',
@ -1483,7 +1483,7 @@ HOTSPOT;
$s .= "<div class=\"col-sm-8 col-md-9\"> $s .= "<div class=\"col-sm-8 col-md-9\">
<div class=\"hotspot-image\"></div> <div class=\"hotspot-image\"></div>
<script> <script>
$(document).on('ready', function() { $(function() {
new ".($answerType == HOT_SPOT_DELINEATION ? 'DelineationQuestion' : 'HotspotQuestion')."({ new ".($answerType == HOT_SPOT_DELINEATION ? 'DelineationQuestion' : 'HotspotQuestion')."({
questionId: $questionId, questionId: $questionId,
exerciseId: $exe_id, exerciseId: $exe_id,
@ -3037,7 +3037,7 @@ HOTSPOT;
spanTag.addClass(optionClass); spanTag.addClass(optionClass);
} }
$(document).ready( function() { $(function() {
// Loading values // Loading values
$('.exercise_mark_select').on('loaded.bs.select', function() { $('.exercise_mark_select').on('loaded.bs.select', function() {
updateSelect($(this)); updateSelect($(this));

@ -1656,7 +1656,7 @@ class ExtraField extends Model
$deleteId = $field_details['variable'].'_delete'; $deleteId = $field_details['variable'].'_delete';
$form->addHtml(" $form->addHtml("
<script> <script>
$(document).ready(function() { $(function() {
$('#".$deleteId."').on('click', function() { $('#".$deleteId."').on('click', function() {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',

@ -1,4 +1,4 @@
$(document).ready(function() { $(function() {
var objects = $(document).find('object'); var objects = $(document).find('object');
var pathname = location.pathname; var pathname = location.pathname;
var coursePath = pathname.substr(0, pathname.indexOf('/courses/')); var coursePath = pathname.substr(0, pathname.indexOf('/courses/'));

@ -36,7 +36,7 @@ class Color extends HTML_QuickForm_text
{ {
return parent::toHtml().<<<JS return parent::toHtml().<<<JS
<script> <script>
$(document).on('ready', function () { $(function() {
var txtColor = $('#{$this->getAttribute('id')}'), var txtColor = $('#{$this->getAttribute('id')}'),
lblColor = txtColor.parent().next(); lblColor = txtColor.parent().next();

@ -1622,7 +1622,7 @@ EOT;
$this->addHtml('</div>'); $this->addHtml('</div>');
$this->addHtml("<script> $this->addHtml("<script>
$(document).on('ready', function() { $(function() {
var defaultValue = '$defaultId'; var defaultValue = '$defaultId';
$('#$typeNoDots').val(defaultValue); $('#$typeNoDots').val(defaultValue);
$('#$typeNoDots').selectpicker('render'); $('#$typeNoDots').selectpicker('render');

@ -919,7 +919,7 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
'<input type="text" name="q" class="form-control" placeholder="'.addslashes(get_lang('Search')).'" /><br />'; '<input type="text" name="q" class="form-control" placeholder="'.addslashes(get_lang('Search')).'" /><br />';
$js .= '<script> $js .= '<script>
$(document).ready(function() { $(function() {
$(\'#'.$name.'\').multiselect({ $(\'#'.$name.'\').multiselect({
search: { search: {
left: \''.$search.'\', left: \''.$search.'\',

@ -2904,7 +2904,7 @@ class SocialManager extends UserManager
if ($countPost > self::DEFAULT_WALL_POSTS) { if ($countPost > self::DEFAULT_WALL_POSTS) {
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
var container = $("#wallMessages"); var container = $("#wallMessages");
container.jscroll({ container.jscroll({
loadingHtml: "<div class=\"well_border\">'.get_lang('Loading').' </div>", loadingHtml: "<div class=\"well_border\">'.get_lang('Loading').' </div>",
@ -2966,8 +2966,8 @@ class SocialManager extends UserManager
}); });
} }
$(document).ready(function() { $(function() {
timeAgo(); timeAgo();
/*$(".delete_message").on("click", function() { /*$(".delete_message").on("click", function() {
var id = $(this).attr("id"); var id = $(this).attr("id");

@ -1130,7 +1130,7 @@ class Statistics
{ {
$chartCode = ' $chartCode = '
<script> <script>
$(document).ready(function() { $(function() {
$.ajax({ $.ajax({
url: "'.$url.'", url: "'.$url.'",
type: "POST", type: "POST",

@ -320,8 +320,7 @@ if ($encryptPassForm == '1') {
<script type="text/javascript" src="../../web/assets/bootstrap/dist/js/bootstrap.min.js"></script> <script type="text/javascript" src="../../web/assets/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="../../web/assets/bootstrap-select/dist/js/bootstrap-select.min.js"></script> <script src="../../web/assets/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready( function() { $(function() {
$("#details_button").click(function() { $("#details_button").click(function() {
$( "#details" ).toggle("slow", function() { $( "#details" ).toggle("slow", function() {
}); });
@ -346,7 +345,7 @@ if ($encryptPassForm == '1') {
}); });
init_visibility=0; init_visibility=0;
$(document).ready( function() { $(function() {
$(".advanced_parameters").click(function() { $(".advanced_parameters").click(function() {
if ($("#id_contact_form").css("display") == "none") { if ($("#id_contact_form").css("display") == "none") {
$("#id_contact_form").css("display","block"); $("#id_contact_form").css("display","block");
@ -631,7 +630,7 @@ if (@$_POST['step2']) {
</p> </p>
</div> </div>
<script> <script>
$(document).on('ready', function () { $(function() {
$.post('<?php echo api_get_path(WEB_CODE_PATH); ?>install/ajax.php', { $.post('<?php echo api_get_path(WEB_CODE_PATH); ?>install/ajax.php', {
a: 'check_crs_tables', a: 'check_crs_tables',
db_host: '<?php echo $dbHostForm; ?>', db_host: '<?php echo $dbHostForm; ?>',

@ -25,7 +25,7 @@ $this_section = SECTION_COURSES;
api_protect_course_script(true); api_protect_course_script(true);
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
for (i=0;i<$(".actions").length;i++) { for (i=0;i<$(".actions").length;i++) {
if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) { if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) {
$(".actions:eq("+i+")").hide(); $(".actions:eq("+i+")").hide();

@ -159,7 +159,7 @@ function confirmation(name) {
} }
} }
$(document).ready(function() { $(function() {
jQuery('.scrollbar-inner').scrollbar(); jQuery('.scrollbar-inner').scrollbar();
$('#subtab ').on('click', 'a:first', function() { $('#subtab ').on('click', 'a:first', function() {

@ -62,7 +62,7 @@ $htmlHeadXtra[] = '
// uncomment for some debug display utility // uncomment for some debug display utility
/* /*
$(document).ready(function() { $(function() {
buildLPtree_debug($("#lp_item_list"), 0, 0); buildLPtree_debug($("#lp_item_list"), 0, 0);
alert(lp_id_list+"\n\n"+lptree_debug); alert(lp_id_list+"\n\n"+lptree_debug);
}); });

@ -284,13 +284,13 @@ echo Display::return_icon('course_setting_layout.png');
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo " echo "
<script> <script>
$(document).on('ready', function () { $(function() {
$('[name=\'hide_toc_frame\']').on('change', function() { $('[name=\'hide_toc_frame\']').on('change', function() {
$('#pnl-frm').toggleClass('col-md-8').toggleClass('col-sm-12'); $('#pnl-frm').toggleClass('col-md-8').toggleClass('col-sm-12');
$('#pnl-toc').toggleClass('col-md-4').toggleClass('hide'); $('#pnl-toc').toggleClass('col-md-4').toggleClass('hide');
});
}); });
</script> });
</script>
"; ";
Display::display_footer(); Display::display_footer();

@ -22,7 +22,7 @@ $learnPath = Session::read('oLP');
/* Header and action code */ /* Header and action code */
$htmlHeadXtra[] = '<script>'.$learnPath->get_js_dropdown_array().' $htmlHeadXtra[] = '<script>'.$learnPath->get_js_dropdown_array().'
$(document).on("ready", function() { $(function() {
CKEDITOR.on("instanceReady", function (e) { CKEDITOR.on("instanceReady", function (e) {
showTemplates("content_lp"); showTemplates("content_lp");
}); });
@ -96,7 +96,7 @@ function confirmation(name) {
} }
} }
$(document).ready(function() { $(function() {
jQuery('.scrollbar-inner').scrollbar(); jQuery('.scrollbar-inner').scrollbar();
expandColumnToogle('#hide_bar_template', { expandColumnToogle('#hide_bar_template', {
selector: '#lp_sidebar' selector: '#lp_sidebar'

@ -126,7 +126,7 @@ $htmlHeadXtra[] = api_get_css_asset('qtip2/jquery.qtip.min.css');
$htmlHeadXtra[] = api_get_asset('qtip2/jquery.qtip.min.js'); $htmlHeadXtra[] = api_get_asset('qtip2/jquery.qtip.min.js');
$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js"></script>'; $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js"></script>';
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$("div#log_content_cleaner").bind("click", function() { $("div#log_content_cleaner").bind("click", function() {
$("div#log_content").empty(); $("div#log_content").empty();
}); });
@ -137,7 +137,7 @@ var chamilo_xajax_handler = window.oxajax;
$allowLpItemTip = api_get_configuration_value('hide_accessibility_label_on_lp_item') === false; $allowLpItemTip = api_get_configuration_value('hide_accessibility_label_on_lp_item') === false;
if ($allowLpItemTip) { if ($allowLpItemTip) {
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$(".scorm_item_normal").qtip({ $(".scorm_item_normal").qtip({
content: { content: {
text: function(event, api) { text: function(event, api) {

@ -223,7 +223,7 @@ var courseUrl = '?cidReq='+olms.lms_course_code+'&id_session='+olms.lms_session_
addEvent(window, 'load', addListeners, false); addEvent(window, 'load', addListeners, false);
// Initialize stuff when the page is loaded // Initialize stuff when the page is loaded
$(document).ready(function() { $(function() {
logit_lms('document.ready event starts'); logit_lms('document.ready event starts');
logit_lms('These logs are generated by the main/lp/scorm_api.php JS ' logit_lms('These logs are generated by the main/lp/scorm_api.php JS '
+ 'library when the admin has clicked on the debug icon in the ' + 'library when the admin has clicked on the debug icon in the '
@ -2273,7 +2273,7 @@ function attach_glossary_into_scorm(type) {
} }
if (type == 'fix_links') { if (type == 'fix_links') {
$(document).ready(function() { $(function() {
var objects = $("iframe").contents().find('object'); var objects = $("iframe").contents().find('object');
var pathname = location.pathname; var pathname = location.pathname;

@ -27,7 +27,7 @@ $defaults['course_id'] = $courseId;
$htmlHeadXtra[] = api_get_jqgrid_js(); $htmlHeadXtra[] = api_get_jqgrid_js();
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("#exercise_course_id").on("change", function(e) { $("#exercise_course_id").on("change", function(e) {
var data = $(this).select2(\'data\'); var data = $(this).select2(\'data\');
var option = data[0]; var option = data[0];

@ -31,7 +31,7 @@ function sliderClose()
$(".slider").animate({"height": sliderHeight}, {duration: "fast" }); $(".slider").animate({"height": sliderHeight}, {duration: "fast" });
} }
$(document).ready(function () { $(function() {
// Show the slider content // Show the slider content
$('.slider').show(); $('.slider').show();
$('.slider').each(function () { $('.slider').each(function () {

@ -26,7 +26,7 @@ $htmlHeadXtra[] = '<script>
function setFocus(){ function setFocus(){
$("#note_title").focus(); $("#note_title").focus();
} }
$(document).ready(function () { $(function() {
setFocus(); setFocus();
}); });
</script>'; </script>';

@ -84,7 +84,7 @@ $xajax->processRequests();
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/'); $htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
$htmlHeadXtra[] = " $htmlHeadXtra[] = "
<script> <script>
$(document).ready( function() { $(function() {
accessSwitcher(0); accessSwitcher(0);
}); });

@ -205,7 +205,7 @@ $form->display();
?> ?>
<script> <script>
$(document).ready( function() { $(function() {
<?php <?php
if (!empty($sessionInfo['duration'])) { if (!empty($sessionInfo['duration'])) {
@ -239,7 +239,7 @@ function emptyDuration() {
} }
} }
$(document).on('ready', function (){ $(function() {
$('#show-options').on('click', function (e) { $('#show-options').on('click', function (e) {
e.preventDefault(); e.preventDefault();
var display = $('#options').css('display'); var display = $('#options').css('display');

@ -149,7 +149,7 @@ function add_image_form() {
} }
} }
$(document).ready(function() { $(function() {
if ($("#msg_'.$message_id.'").length) { if ($("#msg_'.$message_id.'").length) {
$("html,body").animate({ $("html,body").animate({
scrollTop: $("#msg_'.$message_id.'").offset().top scrollTop: $("#msg_'.$message_id.'").offset().top

@ -62,7 +62,7 @@ function register_friend(element_input) {
} }
} }
$(document).on("ready", function () { $(function() {
$("#el-finder") $("#el-finder")
.elfinder({ .elfinder({
url: "'.api_get_path(WEB_LIBRARY_PATH).'elfinder/php/connector.php", url: "'.api_get_path(WEB_LIBRARY_PATH).'elfinder/php/connector.php",

@ -180,7 +180,7 @@ $socialAutoExtendLink = SocialManager::getAutoExtendLink($user_id, $countPost);
// Added a Jquery Function to return the Preview of OpenGraph URL Content // Added a Jquery Function to return the Preview of OpenGraph URL Content
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
var getUrl = $("[name=\'social_wall_new_msg_main\']"); var getUrl = $("[name=\'social_wall_new_msg_main\']");
var matchUrl = /https?:\/\/w{0,3}\w*?\.(\w*?\.)?\w{2,3}\S*|www\.(\w*?\.)?\w*?\.\w{2,3}\S*|(\w*?\.)?\w*?\.\w{2,3}[\/\?]\S*/ ; var matchUrl = /https?:\/\/w{0,3}\w*?\.(\w*?\.)?\w{2,3}\S*|www\.(\w*?\.)?\w*?\.\w{2,3}\S*|(\w*?\.)?\w*?\.\w{2,3}[\/\?]\S*/ ;

@ -530,7 +530,7 @@ if ($survey_data['form_fields'] != '' &&
// the $jquery_ready_content variable collects all functions // the $jquery_ready_content variable collects all functions
// that will be load in the $(document).ready javascript function // that will be load in the $(document).ready javascript function
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function(){ $(function() {
'.$jquery_ready_content.' '.$jquery_ready_content.'
}); });
</script>'; </script>';

@ -11,7 +11,7 @@
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready( function() { $(function() {
$("button").click(function() { $("button").click(function() {
$("#is_executable").attr("value",$(this).attr("name")); $("#is_executable").attr("value",$(this).attr("name"));
}); });

@ -43,7 +43,7 @@ function updateCourseList(sessionId) {
}, "json"); }, "json");
} }
$(document).on("ready", function () { $(function() {
$("select#session_id").on("change", function () { $("select#session_id").on("change", function () {
var sessionId = parseInt(this.value, 10); var sessionId = parseInt(this.value, 10);
updateCourseList(sessionId); updateCourseList(sessionId);

@ -21,7 +21,7 @@ $this_section = 'Reports';
Session::erase('this_section'); Session::erase('this_section');
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function(){ $(function() {
$( "#keyword_start_date_start" ).datepicker({ dateFormat: '."'yy-mm-dd'".' }); $( "#keyword_start_date_start" ).datepicker({ dateFormat: '."'yy-mm-dd'".' });
$( "#keyword_start_date_end" ).datepicker({ dateFormat: '."'yy-mm-dd'".' }); $( "#keyword_start_date_end" ).datepicker({ dateFormat: '."'yy-mm-dd'".' });
}); });

@ -20,7 +20,7 @@ $interbreadcrumb[] = ['url' => '#', 'name' => get_lang('TicketDetail')];
$disableReponseButtons = ''; $disableReponseButtons = '';
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function() { $(function() {
$("#dialog-form").dialog({ $("#dialog-form").dialog({
autoOpen: false, autoOpen: false,
height: 450, height: 450,

@ -36,7 +36,7 @@ function clear_course_list(div_course) {
$("div#"+div_course).hide(""); $("div#"+div_course).hide("");
} }
$(document).ready(function() { $(function() {
$("#advanced_search_form").css("display","none"); $("#advanced_search_form").css("display","none");
}); });

@ -9,7 +9,7 @@ require_once __DIR__.'/../inc/global.inc.php';
require_once __DIR__.'/tutor_report.lib.php'; require_once __DIR__.'/tutor_report.lib.php';
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function (){ $(function() {
$(".ajax").click(function() { $(".ajax").click(function() {
var url = this.href; var url = this.href;
var dialog = $("#dialog"); var dialog = $("#dialog");

@ -21,7 +21,7 @@ $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/timelin
$htmlHeadXtra[] = api_get_js('timeline/timeline-min.js'); $htmlHeadXtra[] = api_get_js('timeline/timeline-min.js');
$htmlHeadXtra[] = ' $htmlHeadXtra[] = '
<script> <script>
$(document).ready(function() { $(function() {
var timeline = new VMM.Timeline(); var timeline = new VMM.Timeline();
timeline.init("'.$url.'"); timeline.init("'.$url.'");
}); });

@ -121,7 +121,7 @@ $js = "<script>
// be sure that these columns always exists // be sure that these columns always exists
// see headers = array(); // see headers = array();
// tab of header texts // tab of header texts
$(document).ready( function() { $(function() {
init_hide(); init_hide();
var columnsToHide = ".$columnsToHide."; var columnsToHide = ".$columnsToHide.";
if (columnsToHide) { if (columnsToHide) {

@ -30,7 +30,7 @@ $groupFilter = isset($_GET['group_filter']) ? intval($_GET['group_filter']) : 0;
$htmlHeadXtra[] = ' $htmlHeadXtra[] = '
<script> <script>
$(document).ready( function() { $(function() {
$("#group_filter").change(function() { $("#group_filter").change(function() {
window.location = "class.php?'.api_get_cidreq().'&type='.$type.'" +"&group_filter=" + $(this).val(); window.location = "class.php?'.api_get_cidreq().'&type='.$type.'" +"&group_filter=" + $(this).val();
}); });

@ -34,7 +34,7 @@ function setFocus() {
$("#search_title").focus(); $("#search_title").focus();
} }
$(document).ready(function() { $(function() {
setFocus(); setFocus();
$("#start_date_toggle").click(function() { $("#start_date_toggle").click(function() {
$("#start_date").toggle(); $("#start_date").toggle();

@ -1005,7 +1005,7 @@ function to_javascript_work()
$("#work_title").focus(); $("#work_title").focus();
} }
$(document).ready(function() { $(function() {
setFocus(); setFocus();
var checked = $("#expiry_date").attr("checked"); var checked = $("#expiry_date").attr("checked");
if (checked) { if (checked) {
@ -2101,7 +2101,7 @@ function get_work_user_list(
'; ';
$correction .= "<script> $correction .= "<script>
$(document).ready(function() { $(function() {
$('.work_correction_file_upload').each(function () { $('.work_correction_file_upload').each(function () {
$(this).fileupload({ $(this).fileupload({
dropZone: $(this) dropZone: $(this)

Loading…
Cancel
Save