-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
134 lines (117 loc) · 4.16 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>NetSuite - WebRTC</title>
<link angus href="/css/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link angus href="/css/styles.css" rel="stylesheet">
<script angus type="text/javascript" src="/js/cue/webrtc-adapter/adapter.js"></script>
<script angus type="text/javascript" src="/js/cue/render_engine.js"></script>
<!-- <script angus type="text/javascript" src="/js/cue/generic-rtc.js"></script> -->
<script angus type="text/javascript" src="/js/cue/EventEmitter.js"></script>
<script angus type="text/javascript" src="/js/cue/RTCSession.js"></script>
<script angus type="text/javascript" src="/js/cue/netsuite-rtc.js"></script>
<script angus type="text/javascript" src="/js/cue/ChatSession.js"></script>
<script angus type="text/javascript" src="/js/cue/chat.js"></script>
<script angus type="text/javascript" src="/js/cue/index.js"></script>
</head>
<body>
<div class="container-fluid row top-buffer">
<div class="col-sm-3 col-md-3 col-lg-3 col-xl-3">
<ul class="list-group">
<a class="list-group-item active">
Active Employees
</a>
<div id="active-channels-list">
</div>
</ul>
</div>
<div class="col-sm-5 col-md-5 col-lg-5 col-xl-5">
<div id="video-container">
<video id="remoteVideo"></video>
</div>
<div style="text-align:center; padding-top:15px">
<button class="btn btn-primary btn-nd" onclick="chat_module.startVideo()">Start Video</button>
</div>
</div>
<div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
<div class="panel panel-default">
<div class="panel-heading top-bar">
<div class="col-md-8 col-xs-8">
<h3 class="panel-title"><span class="glyphicon">💬</span> Chat</h3>
</div>
</div>
<div id="message-container" class="panel-body msg_container_base">
<!-- chat messages go here -->
</div>
<div class="panel-footer">
<div class="input-group">
<input id="btn-input" type="text" class="form-control input-sm chat_input" placeholder="Write your message here...">
<span class="input-group-btn">
<button class="btn btn-primary btn-sm" id="btn-chat" onclick="chat_module.sendMessage()">Send</button>
</span>
</div>
</div>
</div>
</div>
</div>
</body>
<footer class="navbar navbar-fixed-bottom" style="text-align:center;">
<p style="float:none;margin: 0 auto;">
</> with ♥
<br/>
<i>-- Angus --</i>
</p>
</footer>
<script type="text/javascript">
;(function () {
window.gitBaseURL = "https://raw.githubusercontent.com/Angus-McLean/netsuite-rtc/master";
if(window.location.host.indexOf('netsuite') > -1) {
// inside netsuite context.. lazy load all files
cloneCSS();
evalAllScripts();
}
function fetchRespText(url, asyncOrCb) {
var execAsync = typeof asyncOrCb === 'function';
var xhr = new XMLHttpRequest();
xhr.open('GET', url, execAsync);
xhr.send()
xhr.onload = function () {
console.log('loaded ', url);
if(execAsync) {
asyncOrCb(xhr.responseText);
} else {
return xhr.responseText;
}
};
return xhr.responseText;
}
function evalAllScripts() {
getScriptURLs().forEach(function (u) {
var jsText = fetchRespText(u, false);
//console.dir({text : jsText});
eval.call(window, jsText);
});
}
function getScriptURLs() {
return Array.prototype.map.call(document.querySelectorAll('script[angus][src]'), function (e) {
return gitBaseURL + e.src.replace(location.origin, '') + '?nochache=' + (''+Math.random()).slice(2);
});
}
function cloneCSS() {
Array.prototype.forEach.call(document.querySelectorAll('link[angus][href]'), function (e) {
var cssElem = document.createElement('style');
cssElem.type = 'text/css';
fetchRespText(gitBaseURL + e.href.replace(location.origin, ''), function (rawCssText) {
if (cssElem.styleSheet){
cssElem.styleSheet.cssText = rawCssText;
} else {
cssElem.appendChild(document.createTextNode(rawCssText));
}
document.head.appendChild(cssElem);
});
});
}
})();
</script>
</html>