Changeset 2308886
- Timestamp:
- 05/20/2020 03:14:07 PM (6 years ago)
- Location:
- snatchbot-webchat/trunk
- Files:
-
- 3 edited
-
assets/js/embedCode.js (modified) (1 diff)
-
assets/js/embedCode.min.js (modified) (1 diff)
-
client/client.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
snatchbot-webchat/trunk/assets/js/embedCode.js
r2287525 r2308886 1 (function( $) {2 if (typeof snatchBot !== 'undefined') { 3 const footer = $("footer")4 const body = $("body")1 (function() { 2 if (typeof snatchBot !== 'undefined') { 3 const footer = document.getElementsByTagName("footer") 4 const body = document.getElementsByTagName("body") 5 5 if(footer.length) { 6 footer .append('<script>window.sntchChat.Init('+ snatchBot.botID +')</script>')6 footer[0].append('<script>window.sntchChat.Init('+ snatchBot.botID +')</script>') 7 7 } else { 8 body .append('<script>window.sntchChat.Init('+ snatchBot.botID +')</script>')8 body[0].append('<script>window.sntchChat.Init('+ snatchBot.botID +')</script>') 9 9 } 10 10 } else { 11 11 console.log("ERROR: doesn't given SnatchBot ID") 12 12 } 13 })( jQuery);13 })(); -
snatchbot-webchat/trunk/assets/js/embedCode.min.js
r2287525 r2308886 1 !function(t){if("undefined"!=typeof snatchBot){const n=t("footer"),o=t("body");n.length?n.append("<script>window.sntchChat.Init("+snatchBot.botID+")<\/script>"):o.append("<script>window.sntchChat.Init("+snatchBot.botID+")<\/script>")}else console.log("ERROR: doesn't given SnatchBot ID")}(jQuery); 1 (function() 2 { 3 if("undefined"!=typeof snatchBot) { 4 const n = document.getElementsByTagName('footer'), 5 o = document.getElementsByTagName('body'); 6 n.length ? n[0].append("<script>window.sntchChat.Init("+snatchBot.botID+")<\/script>") : o[0].append("<script>window.sntchChat.Init("+snatchBot.botID+")<\/script>") 7 } else console.log("ERROR: doesn't given SnatchBot ID") 8 })(); -
snatchbot-webchat/trunk/client/client.php
r2253009 r2308886 50 50 if (!empty($bot_id)) { 51 51 wp_register_script('EmbedCode', 'https://account.snatchbot.me/script.js', '', '', false ); 52 wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3'); 52 53 wp_enqueue_script('SnatchEmbedCodeDeploy', $assetsPath['files']['embedCodeJS'], array('EmbedCode'), '', true ); 53 54 wp_localize_script( 'SnatchEmbedCodeDeploy' , 'snatchBot',
Note: See TracChangeset
for help on using the changeset viewer.