You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WelcomePage.js 682B

123456789101112131415161718192021222324252627282930
  1. /* global $ */
  2. function enterRoom() {
  3. const $enterRoomField = $("#enter_room_field");
  4. var val = $enterRoomField.val();
  5. if(!val) {
  6. val = $enterRoomField.data("room-name");
  7. }
  8. if (val) {
  9. window.location.pathname = "/" + val;
  10. }
  11. }
  12. function setupWelcomePage() {
  13. // XXX: We left only going to conference page here because transitions via
  14. // React Router isn't implemented yet.
  15. $("#enter_room_button").click(function() {
  16. enterRoom();
  17. });
  18. $("#enter_room_field").keydown(function (event) {
  19. if (event.keyCode === 13 /* enter */) {
  20. enterRoom();
  21. }
  22. });
  23. }
  24. module.exports = setupWelcomePage;