Skip to content

Fixed bugs for sprint 1 #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions samples/webrtc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ <h2 class="header__title">JavaScript WebRTC Sample</h2>
<h3 class="join__title">
<p>Please enter your username and chat room name.</p>
<p>You can join existed chat room.</p>
<p class="join__notice">Use several browsers to simulate several users.</p>
</h3>

<div class="join__body">
<div class="join__row">
<input type="text" class="join__input" name="username" placeholder="Username" autofocus required title="Should contain only latin characters and alphanumeric characters in a range from 3 to 20, starts with a letter." pattern="^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$">
<input type="text" class="join__input" name="username" placeholder="Username" autofocus required title="Should contain only latin characters and alphanumeric characters in a range from 3 to 20, starts with a letter." pattern="^[a-zA-Z\s][a-zA-Z\d-_\.\s]{3,20}$">
</div>

<div class="join__row">
<input type="text" class="join__input" name="room" placeholder="Chat room name" required title="Should contain only latin characters and alphanumeric characters in a range from 3 to 15, without space." pattern="^[a-zA-Z0-9]{3,15}">
<input type="text" class="join__input" name="room" placeholder="Chat room name" required title="Should contain only latin characters and alphanumeric characters in a range from 3 to 15, without space." pattern="^[a-zA-Z\s][a-zA-Z\d\s]{3,15}$">
</div>

<div class="join__row">
Expand Down
19 changes: 12 additions & 7 deletions samples/webrtc/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
'container': $('.page'),
'relocated': function() {
var path = app.user ? 'dashboard' : 'join';
var path = app.caller ? 'dashboard' : 'join';

app.router.navigate(path, {'trigger': true});
},
Expand Down Expand Up @@ -471,13 +471,18 @@

/** LOGOUT */
$(document).on('click', '.j-logout', function() {
app.user = null;
app.users = [];
QB.users.delete(app.caller.id, function(err, user){
if (user) {
app.caller = {};
app.users = [];

QB.chat.disconnect();
app.router.navigate('join', {'trigger': true});

app.helpers.setFooterPosition();
QB.chat.disconnect();
app.router.navigate('join', {'trigger': true});
app.helpers.setFooterPosition();
} else {
console.error('Logout failed:', err);
}
});
});

/**
Expand Down
5 changes: 5 additions & 0 deletions samples/webrtc/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ b {
text-align: center;
}

.join__notice {
margin: 10px 0 0 0;
font-size: 14px;
}

.join__body {
width: 90%;
max-width: 410px;
Expand Down