forked from mreidsma/chatbutton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatbutton.js
23 lines (21 loc) · 999 Bytes
/
chatbutton.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(function() {
var li = document.createElement('li');
li.id = 'library-chat';
li.className = 'library-chat';
var libChatDiv = document.createElement('a');
libChatDiv.appendChild(document.createTextNode('Ask a Question'));
libChatDiv.className = 'btn btn-default';
li.appendChild(libChatDiv);
document.getElementById('cms-navigation').getElementsByTagName('ul')[0].appendChild(li);
var chatWindow = function() {
window.open('https://www.gvsu.edu/library/chat', 'Ask a Question', 'menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=20,top=20,width=460,height=460');
}
/*var chatWindow = function() {
window.open('https://v2.libanswers.com/widget_chat.php?hash=6290b3d40228a9e708fa7066d01f56bf', 'Ask a Question', 'menubar=yes,location=yes,resizable=yes,scrollbars=yes,left=20,top=20,width=460,height=460');
}*/
if (libChatDiv.addEventListener) {
libChatDiv.addEventListener('click', chatWindow, false);
} else {
libChatDiv.attachEvent('onclick', chatWindow);
}
})();