1jQuery(document).ready(function($) { 2 // Function to handle shortcode sequentially 3 function handleShortcode($modules, index) { 4 if (index < $modules.length) { 5 var $module = $modules.eq(index); 6 var activityName = $module.data('shortcode-id'); 7 var idActivity = $module.data('shortcode-id-activity'); 8 var shortcode = $module.data('shortcode'); 9 10 if (shortcode && activityName && idActivity) { 11 // Fetch cached data directly 12 var cachedData = JSON.parse($module.data('cached-data')); 13 14 if (cachedData) { 15 // Find the activity in cached data 16 var availableSpots = 'Aktivita nenalezena'; 17 for (var i = 0; i < cachedData.length; i++) { 18 if (cachedData[i]['activity_name'] === activityName && cachedData[i]['id_activity'] === idActivity) { 19 availableSpots = cachedData[i]['available']; 20 break; 21 } 22 } 23 24 $module.html(availableSpots); 25 } else { 26 $module.html('Error: Data not available.'); 27 } 28 29 // Proceed to the next shortcode 30 handleShortcode($modules, index + 1); 31 } else { 32 // Proceed to the next shortcode 33 handleShortcode($modules, index + 1); 34 } 35 } 36 } 37 38 $('.et_pb_toggle').on('click', function() { 39 var $modules = $(this).find('.et_pb_toggle_content .et_pb_module[data-shortcode="jojogym_spots"]'); 40 // Start handling shortcodes sequentially from the first one 41 handleShortcode($modules, 0); 42 }); 43});
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.