diff --git a/Brocfile.js b/Brocfile.js index 89133ebc..1ff72870 100644 --- a/Brocfile.js +++ b/Brocfile.js @@ -37,7 +37,6 @@ app.import('bower_components/JavaScript-MD5/js/md5.js'); app.import('vendor/ansiparse.js'); app.import('vendor/log.js'); app.import('vendor/customerio.js'); -app.import('vendor/charmscout.js'); app.import('bower_components/moment/moment.js'); // Use `app.import` to add additional libraries to the generated // output files. diff --git a/app/app.coffee b/app/app.coffee index 40da63a3..8aa55baa 100644 --- a/app/app.coffee +++ b/app/app.coffee @@ -58,13 +58,18 @@ App = Ember.Application.extend(Ember.Evented, @on 'user:synced', (user) -> Travis.onUserUpdate(user) + @on 'user:signed_out', () -> + if config.userlike + Travis.removeUserlike() + currentDate: -> new Date() onUserUpdate: (user) -> if config.pro @identifyCustomer(user) - @setupCharm(user) + if config.userlike + @setupUserlike(user) @subscribePusher(user) @@ -80,14 +85,26 @@ App = Ember.Application.extend(Ember.Evented, Travis.pusher.subscribeAll(channels) - setupCharm: (user) -> - $.extend window.__CHARM, - customer: user.login, - customer_id: user.id, - email: user.email + setupUserlike: (user) -> - displayCharm: -> - __CHARM.show() + btn = document.getElementById('userlikeCustomTab') + btn.classList.add("logged-in") + + userlikeData = window.userlikeData = {} + userlikeData.user = {} + + userlikeData.user.name= user.login; + userlikeData.user.email = user.email; + + unless 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' + document.body.appendChild(s) + + removeUserlike: () -> + btn = document.getElementById('userlikeCustomTab') + btn.classList.remove("logged-in") identifyCustomer: (user) -> if _cio && _cio.identify diff --git a/app/index.html b/app/index.html index c6a62dfc..969f7c65 100644 --- a/app/index.html +++ b/app/index.html @@ -23,5 +23,7 @@ {{content-for 'body-footer'}} + + Do you have a question? diff --git a/app/initializers/charm.coffee b/app/initializers/charm.coffee deleted file mode 100644 index 68088671..00000000 --- a/app/initializers/charm.coffee +++ /dev/null @@ -1,17 +0,0 @@ -`import config from 'travis/config/environment'` - -initialize = (container, app) -> - if config.charmKey - window.__CHARM = - key: config.charmKey - url: window.location.protocol + "//charmscout.herokuapp.com/feedback" - - window.bootstrapCharm() - # $('head').append $('') - -Initializer = - name: 'charm' - initialize: initialize - -`export {initialize}` -`export default Initializer` diff --git a/app/styles/app.scss b/app/styles/app.scss index 3fc4fcbe..f0f266bc 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -8,10 +8,10 @@ @import "app/ansi"; @import "app/auth"; -@import "app/charm"; @import "app/forms"; @import "app/github"; @import "app/main/annotations"; +@import "app/userlike"; @import "app/main/list"; @import "app/main/log"; diff --git a/app/styles/app/charm.sass b/app/styles/app/charm.sass deleted file mode 100644 index 1dae943d..00000000 --- a/app/styles/app/charm.sass +++ /dev/null @@ -1,104 +0,0 @@ - -.feedback-button - display: none - -.pro - .feedback-button - display: inline-block - -.feedback-button - display: inline-block - position: fixed - right: 4% - left: auto - bottom: 0 - margin: 0 - padding: .5em 1em .5em - border-radius: 4px - // transform: rotate(90deg) translateY(-140%) - transform: translateY(20%) - will-change: transform - transition: transform ease 200ms - background: $white - font-size: 13px - color: #a2afb3 - text-transform: uppercase - box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.15) - z-index: 89 - &.hidden - display: none - -.feedback-button:hover - // transform: rotate(90deg) translateY(-130%) - transform: translateY(5%) - -.feedback-popup - position: fixed - top: 50% - left: 50% - width: 30em - transform: translate(-50%, -50%) - padding: 1em 1.3em - background-color: #ffffff - border-radius: 5px - z-index: 85 - box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.15) - h1 - margin: 0 0 .4em - padding-left: .4em - color: #347389 - font-size: 22px - textarea - box-sizing: border-box - display: block - width: 100% - height: 10em - margin-bottom: .8em - padding: .5em .6em - resize: vertical - background-color: #f4f3eb - font-size: 16px - color: #7d7e80 - border: none - font-family: $font-family-sans-serif - .submit - margin-right: 1em - padding: .3em .7em - background-color: #37a766 - color: $white - font-size: 16px - border: none - border-radius: 4px - font-family: $font-family-sans-serif - cursor: pointer - p - padding-left: 0.7em - margin: 0.3em 0 0 - a - color: #7d7e80 - font-size: 16px - text-decoration: none - a:hover - text-decoration: underline - - .closed & - display: none - -.feedback-overlay - display: block - position: fixed - top: 0 - right: 0 - bottom: 0 - left: 0 - width: 100% - height: 100% - background-color: rgba(#D5D5CE, 0.7) - z-index: 84 - .closed & - display: none - - -#CHARM_FORM_TARGET - display: none - diff --git a/app/styles/app/userlike.sass b/app/styles/app/userlike.sass new file mode 100644 index 00000000..e1f809bf --- /dev/null +++ b/app/styles/app/userlike.sass @@ -0,0 +1,24 @@ + +.feedback-button + display: none + position: fixed + right: 1% + 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 + +.feedback-button:hover + transform: translateY(5%) + +.logged-in.feedback-button + display: inline-block diff --git a/app/templates/footer.hbs b/app/templates/footer.hbs index 1d68f837..a20bf15f 100644 --- a/app/templates/footer.hbs +++ b/app/templates/footer.hbs @@ -20,9 +20,6 @@
  • Documentation
  • Blog
  • Email
  • - {{#if config.pro}} -
  • Live Chat
  • - {{/if}}
  • Twitter
  • diff --git a/app/templates/top.hbs b/app/templates/top.hbs index 4f82ad45..2e7716b2 100644 --- a/app/templates/top.hbs +++ b/app/templates/top.hbs @@ -6,26 +6,23 @@