This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
gist.identify("<%= current_user.id %>", { | |
"name": "<%= current_user.name %>", // Full name | |
"email": "<%= current_user.email %>", // Email address | |
"created_at": "<%= current_user.created_at.to_i %>" // Signup date as a Unix timestamp | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="shortcut icon" href="https://getgist.com/wp-content/themes/convertfox/assets/favicon/favicon.ico"> | |
<title>Gist Chat</title> | |
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/url-polyfill@1.1.12/url-polyfill.min.js"></script> | |
<script type="text/javascript"> | |
var workspace_id = new URL(window.location.href).searchParams.get("key"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user = wp_get_current_user(); | |
if ( in_array( 'ROLE_NAME', (array) $user->roles ) ) { | |
?> | |
<script> | |
document.addEventListener('gistReady', function () { | |
gist.chat('hide'); | |
}); | |
</script> | |
<?php } ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PASTE THIS AFTER GIST TRACKING CODE | |
function isMobile() { | |
// credit to Timothy Huang for this regex test: | |
// https://dev.to/timhuang/a-simple-way-to-detect-if-browser-is-on-a-mobile-device-with-javascript-44j3 | |
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); | |
} | |
document.addEventListener('gistReady', function () { | |
gist.chat('hide'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Make sure you add Gist snippet above this --> | |
<!-- This example shows listening to a variety of Gist client side events and logging their contents whenever they happen. --> | |
<script type="text/javascript"> | |
document.addEventListener("gistChatReady", function(e) { | |
// Triggers when a new conversation has started | |
document.addEventListener('conversation:started', function (data) { | |
console.log('Conversation Started: ' + JSON.stringify(data.detail)); | |
}, false); | |
// Triggers when a conversation has been opened |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
@media only screen and (max-width: 480px) { | |
.gist-messenger-bubble-iframe iframe, .gist-notification-iframe iframe, .gist-post-small-iframe iframe, .gist-prompt-iframe iframe { | |
bottom: 80px!important; // Change the 80px to move the Messenger vertically from bottom edge fo the screen | |
right: 40px!important; // Change the 40px to move the Messenger horizontally from right edge fo the screen | |
// left: 40px!important; // Change the 40px to move the Messenger horizontally from left edge fo the screen | |
} | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery(".elementor-button").click(function() { | |
var gist_email = jQuery(this).closest("form").find("input[type=email]").val(); | |
gist.identify(gist_email); | |
}); | |
</script> |
NewerOlder