1jQuery(document).ready(function ($) { 2 $(".add-site").on("click", function () { 3 let parentDiv = $(this).closest("tr"); 4 let licenseId = parentDiv.data("license-id"); 5 let siteUrl = parentDiv.find(".new-site-url").val(); 6 console.log(siteUrl); 7 8 if (!siteUrl) { 9 alert("Please enter a valid URL."); 10 return; 11 } 12 13 $.post( 14 hosterAjax.ajaxurl, 15 { 16 action: "hoster_add_site", 17 license_id: licenseId, 18 site_url: siteUrl, 19 nonce: hosterAjax.nonce, 20 }, 21 function (response) { 22 if (response.success) { 23 parentDiv 24 .find(".used-sites") 25 .append( 26 `<li>${siteUrl} <button class="remove-site" data-site="${siteUrl}">â</button></li>` 27 ); 28 parentDiv.find(".new-site-url").val(""); 29 } else { 30 alert(response.data.message); 31 } 32 } 33 ); 34 }); 35 36 $(document).on("click", ".remove-site", function () { 37 if (confirm("Are you sure you want to remove this website?")) { 38 let parentDiv = $(this).closest("tr"); 39 let licenseId = parentDiv.data("license-id"); 40 let siteUrl = $(this).data("site"); 41 42 $.post( 43 hosterAjax.ajaxurl, 44 { 45 action: "hoster_remove_site", 46 license_id: licenseId, 47 site_url: siteUrl, 48 nonce: hosterAjax.nonce, 49 }, 50 function (response) { 51 if (response.success) { 52 $(`button[data-site="${siteUrl}"]`).closest("li").remove(); 53 } else { 54 alert(response.data.message); 55 } 56 } 57 ); 58 } 59 }); 60});
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.