2016-12-01 18:55:42 +00:00
|
|
|
/* global $ */
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2016-12-05 11:02:31 +00:00
|
|
|
function enterRoom() {
|
|
|
|
const $enterRoomField = $("#enter_room_field");
|
|
|
|
|
|
|
|
var val = $enterRoomField.val();
|
2015-01-07 14:54:03 +00:00
|
|
|
if(!val) {
|
2016-12-01 18:55:42 +00:00
|
|
|
val = $enterRoomField.data("room-name");
|
2015-01-07 14:54:03 +00:00
|
|
|
}
|
|
|
|
if (val) {
|
|
|
|
window.location.pathname = "/" + val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-28 21:52:32 +00:00
|
|
|
function setupWelcomePage() {
|
2016-12-16 03:00:06 +00:00
|
|
|
// XXX: We left only going to conference page here because transitions via
|
|
|
|
// React Router isn't implemented yet.
|
2015-01-07 14:54:03 +00:00
|
|
|
|
2015-07-28 21:52:32 +00:00
|
|
|
$("#enter_room_button").click(function() {
|
2016-12-05 11:02:31 +00:00
|
|
|
enterRoom();
|
2015-01-07 14:54:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
$("#enter_room_field").keydown(function (event) {
|
|
|
|
if (event.keyCode === 13 /* enter */) {
|
2016-12-05 11:02:31 +00:00
|
|
|
enterRoom();
|
2015-01-07 14:54:03 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2016-02-25 13:52:15 +00:00
|
|
|
module.exports = setupWelcomePage;
|