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 694B

1234567891011121314151617181920212223242526272829303132
  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. /*
  14. * XXX: We left only going to conference page here because transitions via
  15. * React Router isn't implemented yet.
  16. */
  17. $("#enter_room_button").click(function() {
  18. enterRoom();
  19. });
  20. $("#enter_room_field").keydown(function (event) {
  21. if (event.keyCode === 13 /* enter */) {
  22. enterRoom();
  23. }
  24. });
  25. }
  26. module.exports = setupWelcomePage;