Skip to content

Instantly share code, notes, and snippets.

@liesislukas
Forked from stefanomarra/Emojics JS Code Snippet
Created February 14, 2019 15:22
Show Gist options
  • Save liesislukas/ba8d41684a97697496d2449d771964fe to your computer and use it in GitHub Desktop.
Save liesislukas/ba8d41684a97697496d2449d771964fe 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 = "//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