[{"id":"498a155","elType":"container","settings":{"flex_direction":"column","ha_cmc_text":"Happy Addons","_title":"kod wrapowanie","content_width":"full"},"elements":[{"id":"7642c86","elType":"widget","settings":{"html":"<script>\n\n\n\njQuery( document ).ready(function() {\n    console.log( \"ready! w elementorze\" );\n    \n    \njQuery( \".events_admin .gv-list-view-content-description\" ).addClass( \"row\");\njQuery( \".events_admin .dt-buttons\" ).addClass( \"btn btn-outline-secondary  btn-sm\");\n\n\njQuery( \".wrap-card-1\" ).wrapAll\n( \"<div id='heats-list' class='container xy-4 card-1 col-md-7 col-12 ' \/><div class='card' \/>\");\njQuery( \".wrap-card-2\" ).wrapAll\n( \"<div id='participants-list' class='container xy-4 card-2 ' \/><div class='card' \/>\");\njQuery( \".wrap-card-3\" ).wrapAll\n( \"<div id='heats-timeline' class='container xy-4 card-3  col-md-5 col-12' \/><div class='card' \/>\");\njQuery( \".wrap-card-4\" ).wrapAll\n( \"<div id='heats-raports' class='container xy-4 card-3  col-12' \/><div class='card' \/>\");\n\n\n\n\njQuery( \".wrap-card-body-1\" ).wrapAll( \"<div class='card-body' \/>\");\njQuery( \".wrap-card-body-2\" ).wrapAll( \"<div class='card-body' \/>\");\njQuery( \".wrap-card-body-4\" ).wrapAll( \"<div class='card-body' \/>\");\n    \n});\n\n    \n    \n     jQuery( window ).on( \"load\", function() {\n        console.log( \"window loaded\" );\n         \/\/ Reference to the DataTable instance\nvar table_HeatsList = jQuery('#heats-list table.gv-datatables').DataTable();\nvar table_HeatsStamps = jQuery('.table_HeatsStamps table.gv-datatables').DataTable();\nvar table_ResultsHeats = jQuery('.table_ResultsHeats table.gv-datatables').DataTable();\n\/\/ Variable to track the auto-update state\nvar autoUpdate = true;\n\n\/\/ Function to auto-update the table\nfunction autoUpdateTable() {\n    if (autoUpdate) {\n        table_HeatsList.ajax.reload(null, false); \/\/ Reloads without resetting pagination\n        table_HeatsStamps.ajax.reload(null, false); \/\/ Reloads without resetting pagination\n       table_ResultsHeats.ajax.reload(null, false); \/\/ Reloads without resetting pagination\n    }\n}\n\n\/\/ Set an interval for auto-updating (e.g., every 5 seconds)\nvar updateInterval = setInterval(autoUpdateTable, 5000);\n\n\/\/ Toggle button functionality\njQuery('.toggle-update').on('click', function () {\n    autoUpdate = !autoUpdate; \/\/ Toggle auto-update state\n\n    \/\/ Update button appearance and text based on state\n    if (autoUpdate) {\n        jQuery(this)\n            .removeClass('text-bg-primary')\n            .addClass('text-bg-success')\n            .html('<span id=\"toggle-update\" class=\"badge text-bg-success\"> Updating ...<\/span>');\n    } else {\n        jQuery(this)\n            .removeClass('text-bg-success')\n            .addClass('text-bg-primary')\n            .text('Resume Updates');\n    }\n});\n\n\njQuery(\".dataTables_processing\").addClass('syled-spinner-datatable').html('<div class=\"spinner-grow text-success\" role=\"status\">  <span class=\"visually-hidden\">Loading...<\/span><\/div>');\n\n\n\n\/\/ Initialize tooltips\n  const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]');\n  const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));\n\n\n    });\n    \n   \n\n<\/script>","ha_cmc_text":"Happy Addons"},"elements":[],"widgetType":"html"}],"isInner":false},{"id":"3c860c3","elType":"section","settings":{"ha_cmc_text":"Happy Addons","layout":"full_width"},"elements":[{"id":"2cf6208","elType":"column","settings":{"_column_size":100,"_inline_size":null,"ha_cmc_text":"Happy Addons"},"elements":[{"id":"2a5ce58","elType":"widget","settings":{"shortcode":"[gravityview id=\"131\"]","_css_classes":"events_admin","ha_cmc_text":"Happy Addons"},"elements":[],"widgetType":"shortcode"},{"id":"a147209","elType":"widget","settings":{"shortcode":"[gravityview id=\"602\"]","_css_classes":"events_admin","ha_cmc_text":"Happy Addons"},"elements":[],"widgetType":"shortcode"},{"id":"4d0809a","elType":"widget","settings":{"shortcode":"[gravityview id=\"1003\"]","_css_classes":"events_admin","ha_cmc_text":"Happy Addons"},"elements":[],"widgetType":"shortcode"},{"id":"f6713d5","elType":"widget","settings":{"html":"<script>\n\n    \tjQuery( document ).ready(function() {\n    jQuery('.athlets-list table').addClass('table-bordered table table-striped');\n});\n\n\n\/\/ Run the function on page load\njQuery(document).ready(function () {\n    jQuery('.athlets-list table tbody tr').each(function () {\n        applyStylesToTableRow(this);\n    });\n});\n<\/script>","ha_cmc_text":"Happy Addons"},"elements":[],"widgetType":"html"},{"id":"3ad8390","elType":"widget","settings":{"html":"<button id=\"sendRequest\" class=\"btn btn-primary\" \n    data-run-id=\"1234\" \n    data-event-id=\"5678\" \n    data-top-count=\"2\" \n    data-player-id=\"8\" \n    data-cat-id=\"senior\" \n    data-range=\"\">\n    Send Request\n  <\/button>\n\n  <div id=\"responseContainer\" class=\"mt-4\"><\/div>\n\n<script>\njQuery(document).ready(function() {\n      jQuery('#sendRequest').click(function() {\n        \/\/ Get all data-* attributes from the button\n        const data = $(this).data();\n\n        jQuery.ajax({\n          url: 'https:\/\/live-biegi.sport-timing.pl\/app-functions\/render_rank\/',\n          type: 'POST',\n          data: data,\n          success: function(response) {\n            \/\/ Display the response as a Bootstrap information alert\n            jQuery('#responseContainer').html(\n              `<div class=\"alert alert-info\" role=\"alert\">\n                 ${response}\n               <\/div>`\n            );\n          },\n          error: function(xhr, status, error) {\n            \/\/ Handle errors\n            jQuery('#responseContainer').html(\n              `<div class=\"alert alert-danger\" role=\"alert\">\n                 An error occurred: ${error}\n               <\/div>`\n            );\n          }\n        });\n      });\n    });\n  <\/script>","ha_cmc_text":"Happy Addons","_title":"add button to approve bib to render"},"elements":[],"widgetType":"html"}],"isInner":false}],"isInner":false}]