| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) : |
| 3 |
exit; |
| 4 |
endif; |
| 5 |
?> |
| 6 |
<!--Start-- Upgrade Plan Overlay And Message--> |
| 7 |
<div id="__tagembed__upgrade_plan_overlay" style="position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.1);z-index:999;display:none;"></div> |
| 8 |
<div id="__tagembed__plan_upgrade_message" class="__tagembed__plan_upgrade_message"></div> |
| 9 |
<!--End-- Upgrade Plan Overlay And Message--> |
| 10 |
|
| 11 |
<!--Start-- Call Tagembed Chat And Plugin Version Script After Login And Register--> |
| 12 |
<?php if (!empty($__tagembed__user_details)) : ?> |
| 13 |
<script type="text/javascript"> |
| 14 |
/*--Start-- Manage Intercom Chat And Setting Data */ |
| 15 |
window.addEventListener ? window.addEventListener("load", __tagembed__getAndManageIntercomSetting, false) : window.attachEvent && window.attachEvent("onload", __tagembed__getAndManageIntercomSetting); |
| 16 |
|
| 17 |
function __tagembed__getAndManageIntercomSetting() { |
| 18 |
let formData = new FormData(); |
| 19 |
formData.append('action', 'tagembed_data'); |
| 20 |
formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones); |
| 21 |
formData.append('__tagembed__ajax_action', '__tagembed__get_and_manage_intercom_chat_setting'); |
| 22 |
fetch(__tagembed__ajax_url, { |
| 23 |
method: 'POST', |
| 24 |
headers: { |
| 25 |
'x-requested-with': 'XMLHttpRequest' |
| 26 |
}, |
| 27 |
body: formData, |
| 28 |
}).then(response => { |
| 29 |
return response.json(); |
| 30 |
}).then(response => { |
| 31 |
if (response.status == true) { |
| 32 |
/*--Start--Manage Intercom Setting Data*/ |
| 33 |
window.intercomSettings = { |
| 34 |
api_base: "https://api-iam.intercom.io", |
| 35 |
app_id: "veiaqij8", |
| 36 |
email: response.data.email, |
| 37 |
user_id: response.data.userId, |
| 38 |
user_hash: response.data.userHash, |
| 39 |
name: response.data.name, |
| 40 |
}; |
| 41 |
/*--End--Manage Intercom Setting Data*/ |
| 42 |
/*--Start--Manage Intercom Calling Script*/ |
| 43 |
var w = window; |
| 44 |
var ic = w.Intercom; |
| 45 |
if (typeof ic === "function") { |
| 46 |
ic('reattach_activator'); |
| 47 |
ic('update', w.intercomSettings); |
| 48 |
} else { |
| 49 |
var d = document; |
| 50 |
var i = function() { |
| 51 |
i.c(arguments); |
| 52 |
}; |
| 53 |
i.q = []; |
| 54 |
i.c = function(args) { |
| 55 |
i.q.push(args); |
| 56 |
}; |
| 57 |
w.Intercom = i; |
| 58 |
var l = function() { |
| 59 |
var s = d.createElement('script'); |
| 60 |
s.type = 'text/javascript'; |
| 61 |
s.async = true; |
| 62 |
s.src = 'https://widget.intercom.io/widget/veiaqij8'; |
| 63 |
var x = d.getElementsByTagName('script')[0]; |
| 64 |
x.parentNode.insertBefore(s, x); |
| 65 |
}; |
| 66 |
if (document.readyState === 'complete') { |
| 67 |
l(); |
| 68 |
} else if (w.attachEvent) { |
| 69 |
w.attachEvent('onload', l); |
| 70 |
} else { |
| 71 |
w.addEventListener('load', l, false); |
| 72 |
} |
| 73 |
} |
| 74 |
/*--End--Manage Intercom Calling Script*/ |
| 75 |
} |
| 76 |
}).catch((error) => { |
| 77 |
console.log(error); |
| 78 |
}); |
| 79 |
} |
| 80 |
/*--Start-- Open Intercom Chat*/ |
| 81 |
document.addEventListener('click', function(e) { |
| 82 |
if (e.target.closest('.__tagembed__intercom_chat_btn')) { |
| 83 |
e.preventDefault(); |
| 84 |
if (typeof window.Intercom === "function") { |
| 85 |
window.Intercom('show'); |
| 86 |
} else { |
| 87 |
console.log('Intercom not loaded yet'); |
| 88 |
} |
| 89 |
} |
| 90 |
}); |
| 91 |
/*--End-- Open Intercom Chat*/ |
| 92 |
/*--End-- Manage Intercom Chat And Setting Data */ |
| 93 |
/*--Start-- Manage Hide And Show plugin Upgrade Message*/ |
| 94 |
window.addEventListener ? window.addEventListener("load", __tagembed__plugin_version, false) : window.attachEvent && window.attachEvent("onload", __tagembed__plugin_version); |
| 95 |
|
| 96 |
function __tagembed__plugin_version() { |
| 97 |
let __tagembed__toast = new TagembedToast; |
| 98 |
let formData = new FormData(); |
| 99 |
formData.append('action', 'tagembed_data'); |
| 100 |
formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones); |
| 101 |
formData.append('__tagembed__ajax_action', '__tagembed__plugin_version'); |
| 102 |
fetch(__tagembed__ajax_url, { |
| 103 |
method: 'POST', |
| 104 |
headers: { |
| 105 |
'x-requested-with': 'XMLHttpRequest', |
| 106 |
}, |
| 107 |
body: formData, |
| 108 |
}).then(response => { |
| 109 |
return response.json() |
| 110 |
}).then(response => { |
| 111 |
if (response.status == true) { |
| 112 |
if (response.data.installedPluginVersion != response.data.livePluginVersion) { |
| 113 |
/* Built with DOM methods : the version string and the upgrade URL are |
| 114 |
assigned as a text node and an attribute, never as markup. */ |
| 115 |
let popupWrap = document.createElement("div"); |
| 116 |
popupWrap.className = "__tagembed__popupwrap __tagembed__popup_md"; |
| 117 |
let closeBtn = document.createElement("button"); |
| 118 |
closeBtn.setAttribute("type", "button"); |
| 119 |
closeBtn.className = "__tagembed__closebtn"; |
| 120 |
closeBtn.addEventListener("click", __tagembed__hide_plugin_upgrade_message); |
| 121 |
let popupInn = document.createElement("div"); |
| 122 |
popupInn.className = "__tagembed__popupinn"; |
| 123 |
let header = document.createElement("div"); |
| 124 |
header.className = "__tagembed__header"; |
| 125 |
let heading = document.createElement("h2"); |
| 126 |
heading.textContent = "Update Plugin For Free"; |
| 127 |
header.appendChild(heading); |
| 128 |
let horizontalBorder = document.createElement("hr"); |
| 129 |
horizontalBorder.className = "__tagembed__horizontaborder"; |
| 130 |
let formBody = document.createElement("div"); |
| 131 |
formBody.className = "__tagembed__formwbody"; |
| 132 |
let formRow = document.createElement("div"); |
| 133 |
formRow.className = "__tagembed__formwrow"; |
| 134 |
let note = document.createElement("p"); |
| 135 |
let noteLabel = document.createElement("strong"); |
| 136 |
noteLabel.textContent = " Note : "; |
| 137 |
let versionLabel = document.createElement("strong"); |
| 138 |
versionLabel.textContent = " " + response.data.livePluginVersion + " "; |
| 139 |
note.appendChild(noteLabel); |
| 140 |
note.appendChild(document.createTextNode(" There is a new version of Tagembed Widget available. ")); |
| 141 |
note.appendChild(versionLabel); |
| 142 |
note.appendChild(document.createTextNode(" is a recommended Update For Performance Improvements. ")); |
| 143 |
formRow.appendChild(note); |
| 144 |
formBody.appendChild(formRow); |
| 145 |
let btnWrap = document.createElement("div"); |
| 146 |
btnWrap.className = "__tagembed__btnwrap text-center"; |
| 147 |
let updateLink = document.createElement("a"); |
| 148 |
updateLink.setAttribute("style", "background: #d63638;"); |
| 149 |
updateLink.setAttribute("href", response.data.pluginUpgradeURL); |
| 150 |
updateLink.className = "__tagembed__okaybtn"; |
| 151 |
updateLink.textContent = "Update Plugin"; |
| 152 |
btnWrap.appendChild(updateLink); |
| 153 |
popupInn.appendChild(header); |
| 154 |
popupInn.appendChild(horizontalBorder); |
| 155 |
popupInn.appendChild(formBody); |
| 156 |
popupInn.appendChild(btnWrap); |
| 157 |
popupWrap.appendChild(closeBtn); |
| 158 |
popupWrap.appendChild(popupInn); |
| 159 |
document.getElementById("__tagembed__plugin_upgrade_message").replaceChildren(popupWrap); |
| 160 |
} |
| 161 |
} else { |
| 162 |
__tagembed__toast.danger({ |
| 163 |
message: "Something went wrong. Please try after sometime", |
| 164 |
position: '__tagembed__is-top-right' |
| 165 |
}); |
| 166 |
} |
| 167 |
}).catch((error) => { |
| 168 |
console.log(error); |
| 169 |
__tagembed__toast.danger({ |
| 170 |
message: "Something went wrong. Please try after sometime", |
| 171 |
position: '__tagembed__is-top-right' |
| 172 |
}); |
| 173 |
}); |
| 174 |
} |
| 175 |
|
| 176 |
function __tagembed__hide_plugin_upgrade_message() { |
| 177 |
let __tagembed__plugin_upgrade_message = document.querySelector("#__tagembed__plugin_upgrade_message") |
| 178 |
__tagembed__plugin_upgrade_message.style.display = "none"; |
| 179 |
} |
| 180 |
/*--End-- Manage Hide And Show plugin Upgrade Message*/ |
| 181 |
</script> |
| 182 |
<?php endif; ?> |
| 183 |
<!--End-- Call Tagembed Chat And Plugin Version Script After Login And Register--> |
| 184 |
</div> |
| 185 |
</div> |
| 186 |
<!--Start-- Manage Next And Back Button On All Pages --> |
| 187 |
<div id="__tagembed__next_and_back_link_main_section"></div> |
| 188 |
<!--End-- Manage Next And Back Button On All Pages --> |
| 189 |
</div> |
| 190 |
</div> |
| 191 |
<!-- Other Default WordPress Css --> |
| 192 |
<style> |
| 193 |
#footer-thankyou { |
| 194 |
font-style: normal !important; |
| 195 |
} |
| 196 |
</style> |
| 197 |
<?php if (4 != $__tagembed__active_menue_id) : ?> |
| 198 |
<style> |
| 199 |
body { |
| 200 |
min-height: auto !important; |
| 201 |
} |
| 202 |
</style> |
| 203 |
<?php endif; ?> |
| 204 |
<?php if (6 == $__tagembed__active_menue_id) : ?> |
| 205 |
<script> |
| 206 |
/*--Start-- Manage Embed Accordion Section*/ |
| 207 |
let __tagembed__accordionItem = document.getElementsByClassName('__tagembed__accordionItem'); |
| 208 |
let __tagembed__accordionItemHeading = document.getElementsByClassName('__tagembed__accordionItemHeading'); |
| 209 |
for (i = 0; i < __tagembed__accordionItemHeading.length; i++) |
| 210 |
__tagembed__accordionItemHeading[i].addEventListener('click', __tagembed__toggleAccodionSection, false); |
| 211 |
|
| 212 |
function __tagembed__toggleAccodionSection() { |
| 213 |
let __tagembed__accordionSectionClass = this.parentNode.className; |
| 214 |
for (i = 0; i < __tagembed__accordionItem.length; i++) |
| 215 |
__tagembed__accordionItem[i].className = '__tagembed__accordionItem __tagembed__close'; |
| 216 |
if (__tagembed__accordionSectionClass == '__tagembed__accordionItem __tagembed__close') |
| 217 |
this.parentNode.className = '__tagembed__accordionItem __tagembed__open'; |
| 218 |
} |
| 219 |
/*--End-- Manage Embed Accordion Section*/ |
| 220 |
</script> |
| 221 |
<?php endif; ?> |
| 222 |
<script> |
| 223 |
/*--Start-- Manage And Generate Next And Back Link In Footer*/ |
| 224 |
function __tagembed__manageNextAndBackButon() { |
| 225 |
let __tagembed__nextLink = null; |
| 226 |
let __tagembed__backLink = null; |
| 227 |
let __tagembed__nextAndBackLinkHtml = ""; |
| 228 |
let __tagembed__next_and_back_link_main_section = document.querySelector("#__tagembed__next_and_back_link_main_section"); |
| 229 |
__tagembed__next_and_back_link_main_section.innerHTML = ""; |
| 230 |
let __tagembed__nextAndBackLinkSectionStyle = "block"; |
| 231 |
let __tagembed__widgets_count = <?php echo wp_json_encode((string) $__tagembed__widgets_count); ?>; |
| 232 |
let __tagembed__active_menue_id = <?php echo wp_json_encode((string) $__tagembed__active_menue_id); ?>; |
| 233 |
if (__tagembed__widgets_count == 0) { |
| 234 |
__tagembed__nextAndBackLinkSectionStyle = "none"; |
| 235 |
} |
| 236 |
switch (__tagembed__active_menue_id) { |
| 237 |
case "1": |
| 238 |
__tagembed__nextLink = "2"; |
| 239 |
__tagembed__backLink = null; |
| 240 |
break; |
| 241 |
case "2": |
| 242 |
__tagembed__nextLink = "3"; |
| 243 |
__tagembed__backLink = "1"; |
| 244 |
__tagembed__nextAndBackLinkSectionStyle = "none"; /* Show In tagembed.feed.script.js */ |
| 245 |
break; |
| 246 |
case "3": |
| 247 |
__tagembed__nextLink = "4"; |
| 248 |
__tagembed__backLink = "2"; |
| 249 |
break; |
| 250 |
case "4": |
| 251 |
__tagembed__nextLink = "5"; |
| 252 |
__tagembed__backLink = "3"; |
| 253 |
break; |
| 254 |
case "5": |
| 255 |
__tagembed__nextLink = "6"; |
| 256 |
__tagembed__backLink = "4"; |
| 257 |
break; |
| 258 |
case "6": |
| 259 |
__tagembed__nextLink = null; |
| 260 |
__tagembed__backLink = "5"; |
| 261 |
break; |
| 262 |
} |
| 263 |
/* Manage Next And Back */ |
| 264 |
if (__tagembed__nextLink != null || __tagembed__backLink != null) { |
| 265 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<div class="__tagembed__foot_nextprevious" id="__tagembed__next_and_back_link_section" style="display:${__tagembed__nextAndBackLinkSectionStyle}">`; |
| 266 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<div class="__tagembed__footnp_inn">`; |
| 267 |
if (__tagembed__backLink != null) { |
| 268 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<button class="__tagembed__btn __tagembed__backbtn" onclick="__tagembed__menus(${__tagembed__backLink});"> <i class="fas fa-angle-left"></i> Back </button>`; |
| 269 |
} |
| 270 |
if (__tagembed__nextLink != null) { |
| 271 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<button class="__tagembed__btn" onclick="__tagembed__menus(${__tagembed__nextLink});">Next <i class="fas fa-angle-right"></i> </button>`; |
| 272 |
} |
| 273 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}</div></div>`; |
| 274 |
__tagembed__next_and_back_link_main_section.innerHTML = __tagembed__nextAndBackLinkHtml; |
| 275 |
} |
| 276 |
} |
| 277 |
window.onload = __tagembed__manageNextAndBackButon(); |
| 278 |
/*--End-- Manage And Generate Next And Back Link In Footer*/ |
| 279 |
</script> |