Server IP : 192.158.238.246 / Your IP : 3.129.23.57 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/jenniferflocom/www/wp-content/themes/open-shop/lib/notification/js/ |
Upload File : |
jQuery(document).ready(function($) { // Handle button clicks for activating plugins $('#activate-open-shop-pro').on('click', function() { var pluginSlug = $(this).data('slug'); handlePluginAction(pluginSlug, 'activate'); }); $('#activate-hunk-companion').on('click', function() { var pluginSlug = $(this).data('slug'); handlePluginAction(pluginSlug, 'activate'); }); $('#install-hunk-companion').on('click', function() { var pluginSlug = $(this).data('slug'); handlePluginAction(pluginSlug, 'install'); }); $('#go-to-starter-sites').on('click', function() { window.location.href = theme_data.redirectUrl; }); function handlePluginAction(pluginSlug, action) { $('.left .loader').show(); $.ajax({ url: theme_data.ajax_url, type: 'POST', dataType: 'html', data: { action: 'open_shop_install_and_activate_callback', security: theme_data.security, plugin_slug: pluginSlug }, success: function(response) { // Check if the request was successful if (response) { // location.reload(); $('.left .loader').hide(); $('#go-to-starter-sites').prop('disabled', false); $('p + button').text('Activated').prop('disabled', true); // window.location.href = theme_data.redirectUrl; // setTimeout(function() { // $('.left .loader').hide(); // }, 2000); } else { // Error occurred during installation and activation alert('Error: ' + response.data.message); } }, error: function(xhr, status, error) { $('.left .loader').hide(); // Error occurred during AJAX request console.error('Error:', error); } }); } $('.notice-dismiss').on('click', function(e) { e.preventDefault(); var confirmation = confirm('Are you sure you want to close the banner?'); if (confirmation) { var link = $(this).attr('href'); if (link) { // Set the cookie to prevent the notice from showing again for 12 days var date = new Date(); date.setTime(date.getTime() + (12 * 24 * 60 * 60 * 1000)); document.cookie = "open_shop_thms_time=" + date.getTime() + "; expires=" + date.toUTCString() + "; path=/"; // Redirect to set the cookie window.location.href = link; } } }); });