1// Course Registered 2jQuery(document).ready(function() { 3 if ( jQuery( '#ld_course_info_mycourses_list .ld-course-registered-pager-container a' ).length ) { 4 jQuery( '#ld_course_info_mycourses_list' ).on( 'click', '.ld-course-registered-pager-container a', ld_course_registered_pager_handler ); 5 6 function ld_course_registered_pager_handler( e ) { 7 e.preventDefault(); 8 9 var paged = jQuery( e.currentTarget ).data('paged'); 10 11 var parent_div = jQuery( e.currentTarget ).parents('.ld_course_info' ); 12 if ( typeof parent_div === 'undefined') 13 return; 14 15 var shortcode_atts = jQuery( parent_div ).data( 'shortcode-atts' ); 16 if ( typeof parent_div === 'undefined') 17 return; 18 19 var post_data = { 20 'action': 'ld_course_registered_pager', 21 'paged': paged, 22 'shortcode_atts': shortcode_atts 23 }; 24 25 jQuery.ajax({ 26 type: "POST", 27 url: sfwd_data.ajaxurl, 28 dataType: "json", 29 cache: false, 30 data: post_data, 31 error: function(jqXHR, textStatus, errorThrown ) { 32 //console.log('init: error HTTP Status['+jqXHR.status+'] '+errorThrown); 33 }, 34 success: function( reply_data ) { 35 if ( typeof reply_data !== 'undefined') { 36 if ( typeof reply_data['content'] !== 'undefined' ) { 37 jQuery( '#ld_course_info_mycourses_list .ld-courseregistered-content-container' ).html( reply_data['content'] ); 38 } 39 40 if ( typeof reply_data['pager'] !== 'undefined' ) { 41 jQuery( '#ld_course_info_mycourses_list .ld-course-registered-pager-container' ).html( reply_data['pager'] ); 42 } 43 } 44 } 45 }); 46 } 47 } 48}); 49 50// Course Progress 51jQuery(document).ready(function() { 52 if ( jQuery( '#course_progress_details .ld-course-progress-pager-container a' ).length ) { 53 jQuery( '#course_progress_details' ).on( 'click', '.ld-course-progress-pager-container a', ld_course_content_pager_handler ); 54 55 function ld_course_content_pager_handler( e ) { 56 e.preventDefault(); 57 58 var paged = jQuery( e.currentTarget ).data('paged'); 59 60 var parent_div = jQuery( e.currentTarget ).parents('.ld_course_info' ); 61 if ( typeof parent_div === 'undefined') 62 return; 63 64 var shortcode_atts = jQuery( parent_div ).data( 'shortcode-atts' ); 65 if ( typeof parent_div === 'undefined') 66 return; 67 68 var post_data = { 69 'action': 'ld_course_progress_pager', 70 'paged': paged, 71 'shortcode_atts': shortcode_atts 72 }; 73 74 jQuery.ajax({ 75 type: "POST", 76 url: sfwd_data.ajaxurl, 77 dataType: "json", 78 cache: false, 79 data: post_data, 80 error: function(jqXHR, textStatus, errorThrown ) { 81 //console.log('init: error HTTP Status['+jqXHR.status+'] '+errorThrown); 82 }, 83 success: function( reply_data ) { 84 if ( typeof reply_data !== 'undefined') { 85 if ( typeof reply_data['content'] !== 'undefined' ) { 86 jQuery('#course_progress_details .ld-course-progress-content-container').html( reply_data['content'] ); 87 } 88 89 if ( typeof reply_data['pager'] !== 'undefined' ) { 90 jQuery('#course_progress_details .ld-course-progress-pager-container').html( reply_data['pager'] ); 91 } 92 } 93 } 94 }); 95 } 96 } 97 98}); 99 100// Quiz Progress 101jQuery(document).ready(function() { 102 103 if ( jQuery( '#quiz_progress_details .ld-quiz-progress-pager-container a' ).length ) { 104 jQuery( '#quiz_progress_details' ).on( 'click', '.ld-quiz-progress-pager-container a', ld_quiz_content_pager_handler ); 105 106 function ld_quiz_content_pager_handler( e ) { 107 e.preventDefault(); 108 109 var paged = jQuery( e.currentTarget ).data('paged'); 110 111 var parent_div = jQuery( e.currentTarget ).parents('.ld_course_info' ); 112 if ( typeof parent_div === 'undefined') 113 return; 114 115 var shortcode_atts = jQuery( parent_div ).data( 'shortcode-atts' ); 116 if ( typeof parent_div === 'undefined') 117 return; 118 119 var post_data = { 120 'action': 'ld_quiz_progress_pager', 121 'paged': paged, 122 'shortcode_atts': shortcode_atts 123 }; 124 125 jQuery.ajax({ 126 type: "POST", 127 url: sfwd_data.ajaxurl, 128 dataType: "json", 129 cache: false, 130 data: post_data, 131 error: function(jqXHR, textStatus, errorThrown ) { 132 //console.log('init: error HTTP Status['+jqXHR.status+'] '+errorThrown); 133 }, 134 success: function( reply_data ) { 135 if ( typeof reply_data !== 'undefined') { 136 if ( typeof reply_data['content'] !== 'undefined' ) { 137 jQuery('#quiz_progress_details .ld-quiz-progress-content-container').html( reply_data['content'] ); 138 } 139 140 if ( typeof reply_data['pager'] !== 'undefined' ) { 141 jQuery('#quiz_progress_details .ld-quiz-progress-pager-container').html( reply_data['pager'] ); 142 } 143 } 144 } 145 }); 146 } 147 } 148 149}); 150 151// Course List Shortcode 152jQuery(document).ready(function() { 153 154 if ( jQuery( '.ld-course-list-content .learndash-pager-course_list a' ).length ) { 155 jQuery( '.ld-course-list-content' ).on( 'click', '.learndash-pager-course_list a', ld_course_list_content_pager_handler ); 156 157 function ld_course_list_content_pager_handler( e ) { 158 e.preventDefault(); 159 160 var parent_div = jQuery( e.currentTarget ).parents('.ld-course-list-content' ); 161 if ( typeof parent_div === 'undefined') 162 return; 163 164 var shortcode_atts = jQuery( parent_div ).data( 'shortcode-atts' ); 165 if ( typeof parent_div === 'undefined') 166 return; 167 168 var paged = jQuery( e.currentTarget ).data('paged'); 169 170 var post_data = { 171 'action': 'ld_course_list_shortcode_pager', 172 'paged': paged, 173 'shortcode_atts': shortcode_atts 174 }; 175 176 jQuery.ajax({ 177 type: "POST", 178 url: sfwd_data.ajaxurl, 179 dataType: "json", 180 cache: false, 181 data: post_data, 182 error: function(jqXHR, textStatus, errorThrown ) { 183 //console.log('init: error HTTP Status['+jqXHR.status+'] '+errorThrown); 184 }, 185 success: function( reply_data ) { 186 if ( typeof reply_data !== 'undefined') { 187 if ( typeof reply_data['content'] !== 'undefined' ) { 188 jQuery( parent_div ).html( reply_data['content'] ); 189 } 190 } 191 } 192 }); 193 } 194 } 195 196}); 197 198// Course Navigation Widget 199jQuery(document).ready(function() { 200 201 if ( jQuery( '.widget_ldcoursenavigation .learndash-pager-course_navigation_widget a' ).length ) { 202 jQuery( '.widget_ldcoursenavigation' ).on( 'click', '.learndash-pager-course_navigation_widget a', ld_course_navigation_widget_pager_handler ); 203 204 function ld_course_navigation_widget_pager_handler( e ) { 205 e.preventDefault(); 206 207 var parent_div = jQuery( e.currentTarget ).parents('.course_navigation' ); 208 if ( typeof parent_div === 'undefined') 209 return; 210 211 var widget_data = jQuery( parent_div ).data( 'widget_instance' ); 212 if ( typeof widget_data === 'undefined') 213 return; 214 215 var paged = jQuery( e.currentTarget ).data('paged'); 216 217 var post_data = { 218 'action': 'ld_course_navigation_pager', 219 'paged': paged, 220 'widget_data': widget_data 221 }; 222 223 jQuery.ajax({ 224 type: "POST", 225 url: sfwd_data.ajaxurl, 226 dataType: "json", 227 cache: false, 228 data: post_data, 229 error: function(jqXHR, textStatus, errorThrown ) { 230 //console.log('init: error HTTP Status['+jqXHR.status+'] '+errorThrown); 231 }, 232 success: function( reply_data ) { 233 if ( typeof reply_data !== 'undefined') { 234 //console.log('reply_data[%o]', reply_data); 235 if ( ( typeof reply_data['content'] !== 'undefined' ) && ( reply_data['content'].length ) ) { 236 jQuery( parent_div ).html( reply_data['content'] ); 237 } 238 } 239 } 240 }); 241 } 242 } 243}); 244 245 246// Course Navigation Admin Widget 247jQuery(document).ready(function() { 248 249 if ( jQuery( '#learndash_course_navigation_admin_meta .course_navigation .learndash-pager a' ).length ) { 250 jQuery( '#learndash_course_navigation_admin_meta' ).on( 'click', '.course_navigation .learndash-pager a', ld_course_navigation_widget_pager_handler ); 251 252 function ld_course_navigation_widget_pager_handler( e ) { 253 e.preventDefault(); 254 255 console.log('course navigation admin clicked'); 256 257 var parent_div = jQuery( e.currentTarget ).parents('.course_navigation' ); 258 if ( typeof parent_div === 'undefined') 259 return; 260 261 var widget_data = jQuery( parent_div ).data( 'widget_instance' ); 262 if ( typeof widget_data === 'undefined') 263 return; 264 265 var paged = jQuery( e.currentTarget ).data('paged'); 266 267 var post_data = { 268 'action': 'ld_course_navigation_admin_pager', 269 'paged': paged, 270 'widget_data': widget_data 271 }; 272 273 jQuery.ajax({ 274 type: "POST", 275 url: sfwd_data.ajaxurl, 276 dataType: "json", 277 cache: false, 278 data: post_data, 279 error: function(jqXHR, textStatus, errorThrown ) { 280 //console.log('init: error HTTP Status['+jqXHR.status+'] '+errorThrown); 281 }, 282 success: function( reply_data ) { 283 if ( typeof reply_data !== 'undefined') { 284 //console.log('reply_data[%o]', reply_data); 285 if ( ( typeof reply_data['content'] !== 'undefined' ) && ( reply_data['content'].length ) ) { 286 jQuery( parent_div ).html( reply_data['content'] ); 287 } 288 } 289 } 290 }); 291 } 292 } 293});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.