Skip to content

Instantly share code, notes, and snippets.

@stefanomarra
Last active February 14, 2019 15:31
Show Gist options
  • Save stefanomarra/11efd710da5f48cc0e5cd5f97d1ba894 to your computer and use it in GitHub Desktop.
Save stefanomarra/11efd710da5f48cc0e5cd5f97d1ba894 to your computer and use it in GitHub Desktop.
(function(d, e, id) {
function s() {var js, a = d.getElementsByTagName("script")[0];js = d.createElement("script");js.id = id;js.src = "https://connect.emojics.com/dist/sdk.js";a.parentNode.insertBefore(js, a);}
window.emojics=e;e.readyQueue=[];e.ready=function(b){e.readyQueue.push(b)}
window.attachEvent?window.attachEvent("onload",s):window.addEventListener("load",s)
})(document, window.emojics||{}, "emojics-js");
emojics.ready(function() {
console.log('Emojics Ready');
// The following event will fire whenever a visitor clicks on a reaction.
emojics.on('reaction_clicked', function(data) {
console.log('Reaction Clicked', data);
});
// The following event will fire whenever a visitor submits an interaction.
emojics.on('interaction_submitted', function(data) {
console.log('Interaction Submitted', data);
});
// The following will hide the widget completely by setting it's display to none.
emojics.hide();
// The following will show the widget by toggling the display back to block. This method will show the widget in it's last state.
emojics.show();
// The following will initialize/reload the widget.
emojics.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment