Common.js

From Online Support Wiki
Revision as of 21:01, 8 December 2020 by PSaeger (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Any JavaScript here will be loaded for all users on every page load. */
//Start of HappyFox Live Chat Script
window.HFCHAT_CONFIG = {
    EMBED_TOKEN: 'ea83d280-c091-11ea-a122-a18adb1b3bea',
    ASSETS_URL: 'https://widget.happyfoxchat.com/v2/visitor'
  };
  (function () {
    var scriptTag = document.createElement('script')
    scriptTag.type = 'text/javascript'
    scriptTag.async = true
    scriptTag.src = window.HFCHAT_CONFIG.ASSETS_URL + '/js/widget-loader.js'

    var s = document.getElementsByTagName('script')[0]
    s.parentNode.insertBefore(scriptTag, s)
  })()

HFCHAT_CONFIG.options = {
   showBadgeOnLoad: false, // Will hide badge only on load
};

window.HFCHAT_CONFIG.onload = function() {
   var HappyFoxChat = this;
   document.getElementById('hf-chat').addEventListener('click', function(e){
      e.preventDefault();
      HappyFoxChat.showWidget();
      HappyFoxChat.expandChatbox();
   });
};