diff --git a/app/app.js b/app/app.js index 439d816a..fdbe660b 100644 --- a/app/app.js +++ b/app/app.js @@ -66,8 +66,8 @@ var App = Ember.Application.extend(Ember.Evented, { if (config.pro) { this.identifyCustomer(user); } - if (config.userlike) { - this.setupUserlike(user); + if (config.beacon) { + this.setupHsBeacon(); } return this.subscribePusher(user); }, @@ -90,28 +90,20 @@ var App = Ember.Application.extend(Ember.Evented, { return Travis.pusher.subscribeAll(channels); }, - setupUserlike(user) { - var btn, s, userlikeData; - btn = document.getElementById('userlikeCustomTab'); - btn.classList.add("logged-in"); - userlikeData = window.userlikeData = {}; - userlikeData.user = {}; - userlikeData.user.name = user.login; - userlikeData.user.email = user.email; - if (!document.getElementById('userlike-script')) { - s = document.createElement('script'); - s.id = 'userlike-script'; - s.src = '//userlike-cdn-widgets.s3-eu-west-1.amazonaws.com/0327dbb23382ccbbb91b445b76e8a91d4b37d90ef9f2faf84e11177847ff7bb9.js'; + setupHsBeacon() { + if (!document.getElementById('beacon-script')) { + let s = document.createElement('script'); + s.id = 'beacon-script'; + let code = '!function(e,o,n){window.HSCW=o,window.HS=n,n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={},t.readyQueue=[],t.config=function(e){this.userConfig=e},t.ready=function(e){this.readyQueue.push(e)},o.config={docs:{enabled:!1,baseUrl:""},contact:{enabled:!0,formId:"f48f821c-fb20-11e5-a329-0ee2467769ff"}};var r=e.getElementsByTagName("script")[0],c=e.createElement("script");c.type="text/javascript",c.async=!0,c.src="https://djtflbt20bdde.cloudfront.net/",r.parentNode.insertBefore(c,r)}(document,window.HSCW||{},window.HS||{});'; + try { + s.appendChild(document.createTextNode(code)); + } catch (e) { + s.text = code; + } return document.body.appendChild(s); } }, - removeUserlike() { - var btn; - btn = document.getElementById('userlikeCustomTab'); - return btn.classList.remove("logged-in"); - }, - identifyCustomer(user) { if (_cio && _cio.identify) { return _cio.identify({ diff --git a/app/index.html b/app/index.html index 13836526..9c65af82 100644 --- a/app/index.html +++ b/app/index.html @@ -36,7 +36,5 @@ {{content-for "body-footer"}} - - Do you have a question? diff --git a/app/initializers/hs-beacon.js b/app/initializers/hs-beacon.js new file mode 100644 index 00000000..1374bc5c --- /dev/null +++ b/app/initializers/hs-beacon.js @@ -0,0 +1,11 @@ +export function initialize(/* application */) { + var data = {}; + return data; +} + +export default { + name: 'hs-beacon', + initialize: initialize +}; + + diff --git a/app/initializers/userlike.js b/app/initializers/userlike.js deleted file mode 100644 index 4db20b0e..00000000 --- a/app/initializers/userlike.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.10.0 -import config from 'travis/config/environment'; -var UserlikeInitializer, initialize; - -initialize = function(application) { - var userlikeData; - return userlikeData = {}; -}; - -UserlikeInitializer = { - name: 'userlike', - initialize: initialize -}; - -export {initialize}; - -export default UserlikeInitializer; diff --git a/app/styles/app.scss b/app/styles/app.scss index f848da8c..8285d57a 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -6,7 +6,6 @@ @import "app/data"; @import "app/mixins"; @import "app/base"; -@import "app/userlike"; @import "app/modules/logo"; @import "app/modules/tofuburger"; diff --git a/app/styles/app/userlike.sass b/app/styles/app/userlike.sass deleted file mode 100644 index 14bf7f0c..00000000 --- a/app/styles/app/userlike.sass +++ /dev/null @@ -1,26 +0,0 @@ -.feedback-button - display: none - position: fixed - right: 9% - left: auto - bottom: 0 - margin: 0 - padding: .5em 1em 1em 1em - border-radius: 4px - border: solid 1px #399399 - transform: translateY(20%) - will-change: transform - transition: transform ease 200ms - background: white - font-size: 16px - color: #399399 - z-index: 89 - - @media #{$medium-up} - right: 5% - -.feedback-button:hover - transform: translateY(5%) - -.logged-in.feedback-button - display: inline-block diff --git a/config/environment.js b/config/environment.js index 62a462c8..7a976b2b 100644 --- a/config/environment.js +++ b/config/environment.js @@ -54,6 +54,7 @@ module.exports = function(environment) { caches: true }; ENV.userlike = true; + ENV.beacon = true; ENV.urls = { legal: ENV.billingEndpoint + "/pages/legal", imprint: ENV.billingEndpoint + "/pages/imprint",