PluginProbe
Hostinger Tools / 3.0.76
Hostinger Tools v3.0.76
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
hostinger / src / js / global-scripts.js

global-scripts.js in Hostinger Tools 3.0.76, at src/js/global-scripts.js

41 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 document.addEventListener('DOMContentLoaded', function() {
2
3 const pluginSplitClose = document.getElementById('plugin-split-close');
4
5 if(pluginSplitClose) {
6 pluginSplitClose.addEventListener('click', function () {
7 let nonceElement = document.getElementById('hts_close_plugin_split_nonce');
8
9 if (!nonceElement) {
10 console.error('Nonce element not found.');
11 return;
12 }
13
14 let nonce = nonceElement.value;
15
16 fetch(ajaxurl, {
17 method: 'POST',
18 headers: {
19 'Content-Type': 'application/x-www-form-urlencoded',
20 },
21 body: new URLSearchParams({
22 'action': 'hostinger_dismiss_plugin_split_notice',
23 'nonce': nonce
24 }),
25 })
26 .then(response => {
27 if (!response.ok) {
28 throw new Error('Network response was not ok ' + response.statusText);
29 }
30 return response.json();
31 })
32 .then(data => {
33 document.getElementById('hostinger-plugin-split-notice').style.display = 'none';
34 })
35 .catch(error => {
36 console.error('Error:', error);
37 });
38 });
39 }
40 });
41