| 1 |
<!--Start-- Call Tagembed Chat And Plugin Version Script After Login And Register--> |
| 2 |
<?php if (!empty($__tagembed__user_details)): ?> |
| 3 |
<script type="text/javascript"> |
| 4 |
/*--Start-- Manage Intercom Chat And Setting Data */ |
| 5 |
window.addEventListener ? window.addEventListener("load", __tagembed__getAndManageIntercomSetting, false) : window.attachEvent && window.attachEvent("onload", __tagembed__getAndManageIntercomSetting); |
| 6 |
function __tagembed__getAndManageIntercomSetting() { |
| 7 |
let formData = new FormData(); |
| 8 |
formData.append('action', 'data'); |
| 9 |
formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones); |
| 10 |
formData.append('__tagembed__ajax_action', '__tagembed__get_and_manage_intercom_chat_setting'); |
| 11 |
fetch(__tagembed__ajax_url, {method: 'POST', headers: {'x-requested-with': 'XMLHttpRequest'}, body: formData, |
| 12 |
}).then(response => { |
| 13 |
return response.json(); |
| 14 |
}).then(response => { |
| 15 |
if (response.status == true) { |
| 16 |
/*--Start--Manage Intercom Setting Data*/ |
| 17 |
window.intercomSettings = { |
| 18 |
api_base: "https://api-iam.intercom.io", |
| 19 |
app_id: "t8e1b7uq", |
| 20 |
email: response.data.email, |
| 21 |
user_id: response.data.userId, |
| 22 |
user_hash: response.data.userHash, |
| 23 |
billing_email: response.data.billingEmail, |
| 24 |
name: response.data.name, |
| 25 |
created_at: response.data.created, |
| 26 |
user_type: response.data.type, |
| 27 |
plan: response.data.plan, |
| 28 |
active_plan: response.data.activePlan, |
| 29 |
product: response.data.product, |
| 30 |
active_product: response.data.activeProduct |
| 31 |
}; |
| 32 |
/*--End--Manage Intercom Setting Data*/ |
| 33 |
/*--Start--Manage Intercom Calling Script*/ |
| 34 |
var w = window; |
| 35 |
var ic = w.Intercom; |
| 36 |
if (typeof ic === "function") { |
| 37 |
ic('reattach_activator'); |
| 38 |
ic('update', w.intercomSettings); |
| 39 |
} else { |
| 40 |
var d = document; |
| 41 |
var i = function () { |
| 42 |
i.c(arguments); |
| 43 |
}; |
| 44 |
i.q = []; |
| 45 |
i.c = function (args) { |
| 46 |
i.q.push(args); |
| 47 |
}; |
| 48 |
w.Intercom = i; |
| 49 |
var l = function () { |
| 50 |
var s = d.createElement('script'); |
| 51 |
s.type = 'text/javascript'; |
| 52 |
s.async = true; |
| 53 |
s.src = 'https://widget.intercom.io/widget/t8e1b7uq'; |
| 54 |
var x = d.getElementsByTagName('script')[0]; |
| 55 |
x.parentNode.insertBefore(s, x); |
| 56 |
}; |
| 57 |
if (document.readyState === 'complete') { |
| 58 |
l(); |
| 59 |
} else if (w.attachEvent) { |
| 60 |
w.attachEvent('onload', l); |
| 61 |
} else { |
| 62 |
w.addEventListener('load', l, false); |
| 63 |
} |
| 64 |
} |
| 65 |
/*--End--Manage Intercom Calling Script*/ |
| 66 |
} |
| 67 |
}).catch((error) => { |
| 68 |
console.log(error); |
| 69 |
}); |
| 70 |
} |
| 71 |
/*--End-- Manage Intercom Chat And Setting Data */ |
| 72 |
/*--Start-- Manage Hide And Show plugin Upgrade Message*/ |
| 73 |
window.addEventListener ? window.addEventListener("load", __tagembed__plugin_version, false) : window.attachEvent && window.attachEvent("onload", __tagembed__plugin_version); |
| 74 |
function __tagembed__plugin_version() { |
| 75 |
let __tagembed__toast = new TagembedToast; |
| 76 |
let formData = new FormData(); |
| 77 |
formData.append('action', 'data'); |
| 78 |
formData.append('__tagembed__ajax_call_nones', __tagembed__ajax_call_nones); |
| 79 |
formData.append('__tagembed__ajax_action', '__tagembed__plugin_version'); |
| 80 |
fetch(__tagembed__ajax_url, { |
| 81 |
method: 'POST', |
| 82 |
headers: { |
| 83 |
'x-requested-with': 'XMLHttpRequest', |
| 84 |
}, |
| 85 |
body: formData, |
| 86 |
}).then(response => { |
| 87 |
return response.json() |
| 88 |
}).then(response => { |
| 89 |
if (response.status == true) { |
| 90 |
if (response.data.installedPluginVersion != response.data.livePluginVersion) { |
| 91 |
let elemHTML = `<div class="__tagembed__popupwrap __tagembed__popup_md">`; |
| 92 |
elemHTML = `${elemHTML}<button onclick="__tagembed__hide_plugin_upgrade_message();" type="button" class="__tagembed__closebtn"></button>`; |
| 93 |
elemHTML = `${elemHTML}<div class="__tagembed__popupinn">`; |
| 94 |
elemHTML = `${elemHTML}<div class="__tagembed__header"><h2>Update Plugin For Free</h2></div>`; |
| 95 |
elemHTML = `${elemHTML}<hr class="__tagembed__horizontaborder">`; |
| 96 |
elemHTML = `${elemHTML}<div class="__tagembed__formwbody">`; |
| 97 |
elemHTML = `${elemHTML}<div class="__tagembed__formwrow">`; |
| 98 |
elemHTML = `${elemHTML}<p><strong> Note : </strong> There is a new version of Tagembed Widget available. <strong> ${response.data.livePluginVersion} </strong> is a recommended Update For Performance Improvements. </p>`; |
| 99 |
elemHTML = `${elemHTML}</div></div>`; |
| 100 |
elemHTML = `${elemHTML}<div class = "__tagembed__btnwrap text-center">`; |
| 101 |
elemHTML = `${elemHTML}<a style="background: #d63638;" href="${response.data.pluginUpgradeURL}" class="__tagembed__okaybtn">Update Plugin</a>`; |
| 102 |
elemHTML = `${elemHTML}</div></div></div>`; |
| 103 |
document.getElementById("__tagembed__plugin_upgrade_message").innerHTML = elemHTML; |
| 104 |
} |
| 105 |
} else { |
| 106 |
__tagembed__toast.danger({message: "Something went wrong. Please try after sometime", position: '__tagembed__is-top-right'}); |
| 107 |
} |
| 108 |
}).catch((error) => { |
| 109 |
console.log(error); |
| 110 |
__tagembed__toast.danger({message: "Something went wrong. Please try after sometime", position: '__tagembed__is-top-right'}); |
| 111 |
}); |
| 112 |
} |
| 113 |
function __tagembed__hide_plugin_upgrade_message() { |
| 114 |
let __tagembed__plugin_upgrade_message = document.querySelector("#__tagembed__plugin_upgrade_message") |
| 115 |
__tagembed__plugin_upgrade_message.style.display = "none"; |
| 116 |
} |
| 117 |
/*--End-- Manage Hide And Show plugin Upgrade Message*/ |
| 118 |
</script> |
| 119 |
<?php endif; ?> |
| 120 |
<!--End-- Call Tagembed Chat And Plugin Version Script After Login And Register--> |
| 121 |
</div> |
| 122 |
</div> |
| 123 |
<!--Start-- Manage Next And Back Button On All Pages --> |
| 124 |
<div id="__tagembed__next_and_back_link_main_section"></div> |
| 125 |
<!--End-- Manage Next And Back Button On All Pages --> |
| 126 |
</div> |
| 127 |
</div> |
| 128 |
<!-- Other Default WordPress Css --> |
| 129 |
<style> #footer-thankyou {font-style: normal !important;}</style> |
| 130 |
<?php if ($__tagembed__active_menue_id != 4): ?> |
| 131 |
<style> body{min-height: auto!important;} </style> |
| 132 |
<?php endif; ?> |
| 133 |
<?php if ($__tagembed__active_menue_id == 6): ?> |
| 134 |
<script> |
| 135 |
/*--Start-- Manage Embed Accordion Section*/ |
| 136 |
let __tagembed__accordionItem = document.getElementsByClassName('__tagembed__accordionItem'); |
| 137 |
let __tagembed__accordionItemHeading = document.getElementsByClassName('__tagembed__accordionItemHeading'); |
| 138 |
for (i = 0; i < __tagembed__accordionItemHeading.length; i++) |
| 139 |
__tagembed__accordionItemHeading[i].addEventListener('click', __tagembed__toggleAccodionSection, false); |
| 140 |
function __tagembed__toggleAccodionSection() { |
| 141 |
let __tagembed__accordionSectionClass = this.parentNode.className; |
| 142 |
for (i = 0; i < __tagembed__accordionItem.length; i++) |
| 143 |
__tagembed__accordionItem[i].className = '__tagembed__accordionItem __tagembed__close'; |
| 144 |
if (__tagembed__accordionSectionClass == '__tagembed__accordionItem __tagembed__close') |
| 145 |
this.parentNode.className = '__tagembed__accordionItem __tagembed__open'; |
| 146 |
} |
| 147 |
/*--End-- Manage Embed Accordion Section*/ |
| 148 |
</script> |
| 149 |
<?php endif; ?> |
| 150 |
<script> |
| 151 |
/*--Start-- Manage And Generate Next And Back Link In Footer*/ |
| 152 |
function __tagembed__manageNextAndBackButon() { |
| 153 |
let __tagembed__nextLink = null; |
| 154 |
let __tagembed__backLink = null; |
| 155 |
let __tagembed__nextAndBackLinkHtml = ""; |
| 156 |
let __tagembed__next_and_back_link_main_section = document.querySelector("#__tagembed__next_and_back_link_main_section"); |
| 157 |
__tagembed__next_and_back_link_main_section.innerHTML = ""; |
| 158 |
let __tagembed__nextAndBackLinkSectionStyle = "block"; |
| 159 |
let __tagembed__widgets_count = "<?php echo esc_html($__tagembed__widgets_count); ?>"; |
| 160 |
let __tagembed__active_menue_id = "<?php echo esc_html($__tagembed__active_menue_id); ?>"; |
| 161 |
if (__tagembed__widgets_count == 0) { |
| 162 |
__tagembed__nextAndBackLinkSectionStyle = "none"; |
| 163 |
} |
| 164 |
switch (__tagembed__active_menue_id) { |
| 165 |
case "1" : |
| 166 |
__tagembed__nextLink = "2"; |
| 167 |
__tagembed__backLink = null; |
| 168 |
break; |
| 169 |
case "2" : |
| 170 |
__tagembed__nextLink = "3"; |
| 171 |
__tagembed__backLink = "1"; |
| 172 |
__tagembed__nextAndBackLinkSectionStyle = "none"; /* Show In tagembed.feed.script.js */ |
| 173 |
break; |
| 174 |
case "3" : |
| 175 |
__tagembed__nextLink = "4"; |
| 176 |
__tagembed__backLink = "2"; |
| 177 |
break; |
| 178 |
case "4" : |
| 179 |
__tagembed__nextLink = "5"; |
| 180 |
__tagembed__backLink = "3"; |
| 181 |
break; |
| 182 |
case "5" : |
| 183 |
__tagembed__nextLink = "6"; |
| 184 |
__tagembed__backLink = "4"; |
| 185 |
break; |
| 186 |
case "6" : |
| 187 |
__tagembed__nextLink = null; |
| 188 |
__tagembed__backLink = "5"; |
| 189 |
break; |
| 190 |
} |
| 191 |
/* Manage Next And Back */ |
| 192 |
if (__tagembed__nextLink != null || __tagembed__backLink != null) { |
| 193 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<div class="__tagembed__foot_nextprevious" id="__tagembed__next_and_back_link_section" style="display:${__tagembed__nextAndBackLinkSectionStyle}">`; |
| 194 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<div class="__tagembed__footnp_inn">`; |
| 195 |
if (__tagembed__backLink != null) { |
| 196 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<button class="__tagembed__btn __tagembed__backbtn" onclick="__tagembed__menus(${__tagembed__backLink});"> <i class="fas fa-angle-left"></i> Back </button>`; |
| 197 |
} |
| 198 |
if (__tagembed__nextLink != null) { |
| 199 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}<button class="__tagembed__btn" onclick="__tagembed__menus(${__tagembed__nextLink});">Next <i class="fas fa-angle-right"></i> </button>`; |
| 200 |
} |
| 201 |
__tagembed__nextAndBackLinkHtml = `${__tagembed__nextAndBackLinkHtml}</div></div>`; |
| 202 |
__tagembed__next_and_back_link_main_section.innerHTML = __tagembed__nextAndBackLinkHtml; |
| 203 |
} |
| 204 |
} |
| 205 |
window.onload = __tagembed__manageNextAndBackButon(); |
| 206 |
/*--End-- Manage And Generate Next And Back Link In Footer*/ |
| 207 |
</script> |
| 208 |
|