Skip to content

Instantly share code, notes, and snippets.

@stefanomarra
Last active February 14, 2019 15:31
Show Gist options
  • Select an option

  • Save stefanomarra/11efd710da5f48cc0e5cd5f97d1ba894 to your computer and use it in GitHub Desktop.

Select an option

Save stefanomarra/11efd710da5f48cc0e5cd5f97d1ba894 to your computer and use it in GitHub Desktop.

Revisions

  1. stefanomarra revised this gist Feb 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Emojics JS Code Snippet
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    (function(d, e, id) {
    function s() {var js, a = d.getElementsByTagName("script")[0];js = d.createElement("script");js.id = id;js.src = "http://connect.emojics.com/dist/sdk.js";a.parentNode.insertBefore(js, a);}
    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");
  2. stefanomarra created this gist Feb 14, 2019.
    28 changes: 28 additions & 0 deletions Emojics JS Code Snippet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    (function(d, e, id) {
    function s() {var js, a = d.getElementsByTagName("script")[0];js = d.createElement("script");js.id = id;js.src = "http://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();
    });