Skip to content

Commit 5d2fe34

Browse files
committed
Add chat fr to bottom right
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
1 parent 073572d commit 5d2fe34

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

themes/vue/source/css/_common.styl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,16 @@ a.button
204204
border-left 4px solid transparent
205205
border-right 4px solid transparent
206206
border-top 5px solid #ccc
207+
208+
.gitter-open-chat-button
209+
background-color: #4fc08d;
210+
text-transform: none;
211+
-webkit-transition: opacity 1s ease;
212+
-moz-transition: opacity 1s ease;
213+
-ms-transition: opacity 1s ease;
214+
-o-transition: opacity 1s ease;
215+
transition: opacity 1s ease;
216+
opacity: 0
217+
218+
&is-displayed
219+
opacity: 1;

themes/vue/source/js/common.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@
77
initApiSpecLinks()
88
initLocationHashFuzzyMatching()
99
}
10+
initChat()
11+
12+
function initChat () {
13+
var script = document.createElement("script");
14+
window.gitter = {
15+
chat: {
16+
options: {
17+
room: "vuejs-fr/vue"
18+
}
19+
}
20+
};
21+
script.src = "https://sidecar.gitter.im/dist/sidecar.v1.js";
22+
script.async = true;
23+
script.defer = true;
24+
document.body.appendChild(script);
25+
(function changeOpenChat() {
26+
var name = document.getElementsByClassName("gitter-open-chat-button")[0];
27+
if (name) {
28+
name.innerHTML = 'Chat rapide';
29+
name.classList.add("is-displayed");
30+
} else {
31+
setTimeout(changeOpenChat, 200);
32+
}
33+
}());
34+
}
1035

1136
function initApiSpecLinks () {
1237
var apiContent = document.querySelector('.content.api')

0 commit comments

Comments
 (0)