Skip to content

Commit

Permalink
Replaces intercom with gitter sidecar on the ember app
Browse files Browse the repository at this point in the history
  • Loading branch information
discorick committed Jan 23, 2017
1 parent 4a0b533 commit c5ddec5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
20 changes: 20 additions & 0 deletions app/assets/stylesheets/_gitter.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.gitter-open-chat-button {
background-color: $hb-purple;
font-size: 9px;
right: 16px;
padding: 0.5em 2em;
&:hover {
background-color: $hb-purple-dark;
}
&:focus {
background-color: $hb-purple-dark;
}

.ui-icon-x-thin {
position: relative;
margin-left: -4px;
font-size: 7px;
float: right;
left: 14px;
}
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/flex_layout.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
@import "milestone";
@import "date_picker";
@import "sidebar";
@import "gitter";

body {
word-wrap: break-word;
Expand Down
3 changes: 1 addition & 2 deletions app/views/layouts/ember.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
</head>
<body class="flex-body" id="application">

<%= render partial: "shared/analytics" %>
<script>
window.EMOJIS = <%= emojis.to_json.html_safe %>;
window.HUBOARD_ENV = <%= Rails.application.config.client_environment.to_json.html_safe %>;
</script>
<%= content_for :javascripts %>

<%= render partial: "shared/gitter" %>

<script>
$(function() {
Expand Down
17 changes: 17 additions & 0 deletions app/views/shared/_gitter.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script>
((window.gitter = {}).chat = {}).options = {
room: "huboard/huboard",
activationElement: ".gitter-open-chat-button"
};

function hideGitter(){
var gitter = document.getElementsByClassName("gitter-open-chat-button")[0];
gitter.style.display = "none";
window.gitter.chat.defaultChat.destroy();
}
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>

<a href="https://gitter.im/huboard/huboard" class="gitter-open-chat-button">
Chat with us!<i class="ui-icon-x-thin" onclick="hideGitter()"></i>
</a>

0 comments on commit c5ddec5

Please sign in to comment.