Skip to content

Commit d5d75f6

Browse files
committed
join
1 parent 8a320c2 commit d5d75f6

File tree

7 files changed

+1172
-910
lines changed

7 files changed

+1172
-910
lines changed

quickblox.min.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/webrtc/config.js

Lines changed: 75 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
;(function(window) {
2-
/**
3-
* Add parameter to url search
4-
* for switch users groups
5-
*
6-
* Possible options:
7-
* https://examples.com?users=prod
8-
* https://examples.com?users=dev
9-
* https://examples.com - for qa by default
10-
*/
11-
var usersQuery = _getQueryVar('users');
2+
/**
3+
* Add parameter to url search
4+
* for switch users groups
5+
*
6+
* Possible options:
7+
* https://examples.com?users=prod
8+
* https://examples.com?users=dev
9+
* https://examples.com - for qa by default
10+
*/
11+
var usersQuery = _getQueryVar('users');
1212

13-
var CONFIG = {
14-
debug: true,
15-
webrtc: {
16-
answerTimeInterval: 30,
17-
dialingTimeInterval: 5,
18-
disconnectTimeInterval: 30,
19-
statsReportTimeInterval: 5
20-
}
21-
};
13+
var CONFIG = {
14+
debug: true,
15+
webrtc: {
16+
answerTimeInterval: 30,
17+
dialingTimeInterval: 5,
18+
disconnectTimeInterval: 30,
19+
statsReportTimeInterval: 5
20+
}
21+
};
2222

2323
/**
2424
* QBAppDefault for qa and dev
2525
* QBAppProd for production
2626
*/
27-
var QBAppProd = {
28-
appId: 92,
29-
authKey: 'wJHdOcQSxXQGWx5',
30-
authSecret: 'BTFsj7Rtt27DAmT'
31-
},
32-
QBAppDefault = {
33-
appId: 28287,
34-
authKey: 'XydaWcf8OO9xhGT',
35-
authSecret: 'JZfqTspCvELAmnW'
36-
};
27+
var QBAppProd = {
28+
appId: 92,
29+
authKey: 'wJHdOcQSxXQGWx5',
30+
authSecret: 'BTFsj7Rtt27DAmT'
31+
},
32+
QBAppDefault = {
33+
appId: 28287,
34+
authKey: 'XydaWcf8OO9xhGT',
35+
authSecret: 'JZfqTspCvELAmnW'
36+
};
3737

38-
/** set QBApp */
39-
var QBApp = usersQuery === 'prod' ? QBAppProd : QBAppDefault;
38+
/** set QBApp */
39+
var QBApp = usersQuery === 'prod' ? QBAppProd : QBAppDefault;
4040

4141
var QBUsersQA = [
4242
{
@@ -185,51 +185,54 @@
185185
}
186186
];
187187

188-
/** set QBUsers */
189-
var QBUsers = usersQuery === 'prod' ? QBUsersProd : usersQuery === 'dev' ? QBUsersDev : QBUsersQA;
188+
/** set QBUsers */
189+
var QBUsers = usersQuery === 'prod' ? QBUsersProd : usersQuery === 'dev' ? QBUsersDev : QBUsersQA;
190190

191-
var MESSAGES = {
192-
'login': 'Login as any user on this computer and another user on another computer.',
193-
'create_session': 'Creating a session...',
194-
'connect': 'Connecting...',
195-
'connect_error': 'Something wrong with connect to chat. Check internet connection or user info and trying again.',
196-
'login_as': 'Logged in as ',
197-
'title_login': 'Choose a user to login with:',
198-
'title_callee': 'Choose users to call:',
199-
'calling': 'Calling...',
200-
'webrtc_not_avaible': 'WebRTC is not available in your browser',
201-
'no_internet': 'Please check your Internet connection and try again'
202-
};
191+
var MESSAGES = {
192+
'login': 'Login as any user on this computer and another user on another computer.',
193+
'create_session': 'Creating a session...',
194+
'connect': 'Connecting...',
195+
'connect_error': 'Something wrong with connect to chat. Check internet connection or user info and trying again.',
196+
'login_as': 'Logged in as ',
197+
'title_login': 'Choose a user to login with:',
198+
'title_callee': 'Choose users to call:',
199+
'calling': 'Calling...',
200+
'webrtc_not_avaible': 'WebRTC is not available in your browser',
201+
'no_internet': 'Please check your Internet connection and try again'
202+
};
203203

204-
/**
205-
* PRIVATE
206-
*/
207-
/**
208-
* [_getQueryVar get value of key from search string of url]
209-
* @param {[string]} q [name of query]
210-
* @return {[string]} [value of query]
211-
*/
212-
function _getQueryVar(q) {
213-
var query = window.location.search.substring(1),
214-
vars = query.split("&"),
215-
answ = false;
204+
/**
205+
* PRIVATE
206+
*/
207+
/**
208+
* [_getQueryVar get value of key from search string of url]
209+
* @param {[string]} q [name of query]
210+
* @return {[string]} [value of query]
211+
*/
212+
function _getQueryVar(q) {
213+
var query = window.location.search.substring(1),
214+
vars = query.split("&"),
215+
answ = false;
216216

217-
vars.forEach(function(el, i){
218-
var pair = el.split('=');
217+
vars.forEach(function(el, i){
218+
var pair = el.split('=');
219219

220-
if(pair[0] === q) {
221-
answ = pair[1];
222-
}
223-
});
220+
if(pair[0] === q) {
221+
answ = pair[1];
222+
}
223+
});
224224

225-
return answ;
226-
}
225+
return answ;
226+
}
227227

228-
/**
229-
* set configuration variables in global
230-
*/
231-
window.QBApp = QBApp;
232-
window.CONFIG = CONFIG;
233-
window.QBUsers = QBUsers;
234-
window.MESSAGES = MESSAGES;
228+
/**
229+
* set configuration variables in global
230+
*/
231+
window.app = {};
232+
window.app.CONFIG = {
233+
'qbApp': QBApp,
234+
'config': CONFIG,
235+
'qbUsers': QBUsers,
236+
'msgs': MESSAGES
237+
};
235238
}(window));

samples/webrtc/index.html

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<body>
1717
<div class="wrapper j-wrapper">
1818
<header class="header">
19-
<div class="fw-inner clearfix">
19+
<div class="inner">
2020
<div class="header__logo">
2121
<img class="header__logo_img" src="images/Logo_qb.svg">
2222
</img>
@@ -26,10 +26,39 @@ <h2 class="header__title">JavaScript WebRTC Sample</h2>
2626
</div>
2727
</header>
2828

29-
<aside class="msg_board" id="msg_board"></aside>
29+
<main class="app" id="app">
30+
<div class="page page-join" id="page-join">
31+
<form class="join j-join">
32+
<h3 class="join__title">
33+
<p>Please enter your username and chat room name.</p>
34+
<p>You can join existed chat room.</p>
35+
</h3>
36+
37+
<div class="join__body">
38+
<div class="join__row">
39+
<input type="text" class="join__input" name="username" placeholder="Username" autofocus required title="Enter a username">
40+
</div>
41+
42+
<div class="join__row">
43+
<input type="text" class="join__input" name="room" placeholder="Chat room name" required title="Enter a chat room">
44+
</div>
45+
46+
<div class="join__row">
47+
<button type="submit" class="join__btn">Login</button>
48+
</div>
49+
</div>
50+
</form>
51+
</div>
3052

31-
<main class="main j-main">
32-
<div class="fw-inner">
53+
<div class="page page-dashboard invisible" id="page-dashboard">
54+
Hello
55+
</div>
56+
</main>
57+
58+
<!-- <aside class="msg_board" id="msg_board"></aside> -->
59+
60+
<!-- <main class="main j-main">
61+
<div class="inner">
3362
<aside class="users">
3463
<h5 class="users__title j-users__title"></h5>
3564
@@ -116,16 +145,14 @@ <h5 class="users__title j-users__title"></h5>
116145
</div>
117146
</div>
118147
</div>
119-
</main>
148+
</main> -->
120149

121150
<footer class="footer j-footer invisible">
122-
<div class="footer__inner">
123-
<h4>
124-
<a class="fw-link" href="https://github.com/QuickBlox/quickblox-javascript-sdk/tree/gh-pages/samples/webrtc">
125-
Source code
126-
</a>
127-
</h4>
128-
</div>
151+
<h4>
152+
<a class="fw-link" href="https://github.com/QuickBlox/quickblox-javascript-sdk/tree/gh-pages/samples/webrtc">
153+
Source code
154+
</a>
155+
</h4>
129156
</footer>
130157

131158
<!-- SOUNDS -->
@@ -254,9 +281,12 @@ <h4>Call from <strong class="j-ic_initiator"></strong></h4>
254281
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
255282

256283
<script src="../../quickblox.js"></script>
284+
<!-- Routing lib -->
285+
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.3/backbone-min.js"></script>
257286

258287
<script src="config.js"></script>
259-
<script src="js/msgBoard.js"></script>
288+
<script src="js/helpers.js"></script>
289+
<!-- <script src="js/msgBoard.js"></script> -->
260290
<script src="js/app.js"></script>
261291
</body>
262292
</html>

0 commit comments

Comments
 (0)