1document.addEventListener("DOMContentLoaded", function () { 2 const modalWrappers = document.querySelectorAll(".deaddove-modal-wrapper"); 3 4 modalWrappers.forEach(function (wrapper) { 5 const modal = wrapper.querySelector(".deaddove-modal"); 6 const blurredContent = wrapper.querySelector(".deaddove-blurred-content"); 7 const blurredContentWarning = wrapper.querySelector(".deaddove-blur-overlay"); 8 const settingsLink = wrapper.querySelector(".deaddove-settings-link"); 9 10 // Open the modal when blurred content is clicked 11 if (blurredContent) { 12 blurredContent.addEventListener("click", function () { 13 const blurredRect = blurredContent.getBoundingClientRect(); 14 const scrollTop = 15 window.pageYOffset || document.documentElement.scrollTop; 16 const scrollLeft = 17 window.pageXOffset || document.documentElement.scrollLeft; 18 modal.style.top = `${blurredRect.top + scrollTop}px`; 19 modal.style.left = `${blurredRect.left + scrollLeft}px`; 20 modal.style.display = "flex"; 21 }); 22 } 23 24 // Use event delegation for modal buttons 25 wrapper.addEventListener("click", function (event) { 26 if (event.target.classList.contains("deaddove-show-content-btn")) { 27 // User agreed to view the content 28 modal.style.display = "none"; 29 blurredContent.classList.remove("deaddove-blur"); 30 blurredContent.style.pointerEvents = "none"; 31 if (blurredContentWarning) blurredContentWarning.style.display = "none"; 32 } else if (event.target.classList.contains("deaddove-hide-content-btn")) { 33 // User chose to keep the content hidden 34 modal.style.display = "none"; 35 } 36 }); 37 38 // Handle the settings link correctly 39 if (settingsLink) { 40 settingsLink.addEventListener("click", function (event) { 41 event.preventDefault(); // Prevent default link behavior 42 window.location.href = 43 "/wp-admin/profile.php#deaddove-warning-settings"; // Navigate to the settings page 44 }); 45 } 46 }); 47 48 49 jQuery(document).ready(function ($) { 50 console.log("Dead Dove script loaded"); 51 52 var hasModified = false; 53 var isProcessing = false; 54 55 if ($(".deaddove-block-description").length > 0) { 56 hasModified = true; 57 } 58 59 console.log("Has modified:", hasModified); 60 61 /* 62 Manage frontend widget 63 */ 64 $(".deaddove-blog-warning").on("click", function (event) { 65 event.preventDefault(); // Default behavior roko 66 67 const blurContent = $(this); 68 const blurContentId = blurContent.attr("id"); 69 const postId = blurContentId.match(/\d+/); 70 71 if (postId) { 72 const postIdNumber = parseInt(postId[0], 10); 73 74 ajaxCallingMethod({postIdNumber, blurContent, postType:'post'}); 75 } 76 }); 77 $(".deaddove-block-description").on("click", function(event){ 78 const descriptionText = $(this); 79 const postParent = descriptionText.closest(".post"); 80 console.log(postParent) 81 const postParentId = postParent.attr("id"); 82 const postId = postParentId.match(/\d+/); 83 84 if (postId) { 85 const postIdNumber = parseInt(postId[0], 10); 86 const tags = descriptionText.attr('tags'); 87 ajaxCallingMethod({postIdNumber, blurContent:descriptionText, tags, postType:'postDescription'}); 88 } 89 }) 90 /* 91 ajax calling helper function 92 */ 93 function ajaxCallingMethod({postIdNumber, blurContent, tags='', postType = 'post'}){ 94 console.log("checking tags:",tags); 95 96 $.ajax({ 97 url: deaddove_ajax.ajaxurl, 98 type: "POST", 99 data: { 100 action: "deaddove_get_post_description", 101 post_id: postIdNumber, 102 postTags:tags, 103 security: deaddove_ajax.nonce, 104 }, 105 success: function (response) { 106 console.log("AJAX Response:", response); 107 if (response.success) { 108 $(".deaddove-modal-wrapper-multiple-posts").each(function () { 109 const wrapper = $(this); 110 const modal = wrapper.find(".deaddove-modal"); 111 const showContentButton = wrapper.find(".deaddove-show-content-btn"); 112 const hideContentButton = wrapper.find(".deaddove-hide-content-btn"); 113 const descriptionText = wrapper.find(".description-text"); 114 descriptionText.text(response.data); 115 modal.show(); 116 showContentButton.on("click", function () { 117 modal.hide(); 118 if(postType ==='post'){ 119 blurContent.removeClass("deaddove-blog-warning"); 120 }else{ 121 console.log(blurContent,"hellokdsflj"); 122 blurContent.removeClass("deaddove-block-description"); 123 } 124 blurContent.off("click"); 125 }); 126 hideContentButton.on("click", function () { 127 modal.hide(); 128 }); 129 }); 130 } else { 131 alert("Error: " + response.data); 132 } 133 }, 134 error: function (xhr, status, error) { 135 console.error("AJAX Error:", error); 136 }, 137 }); 138 } 139}); 140 141}); 142console.log("checking file file running or not ");
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.