|
|
@ -236,6 +236,11 @@ function initIndex(){ |
|
|
|
// Submit the main form to create a room
|
|
|
|
// Submit the main form to create a room
|
|
|
|
$('#createRoom').submit(function(e){ |
|
|
|
$('#createRoom').submit(function(e){ |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
// Do not submit if we know the name is invalid
|
|
|
|
|
|
|
|
if (!$('#roomName').val().match(/^[\w\-]{0,49}$/)){ |
|
|
|
|
|
|
|
$('#roomName').notify('ERROR_NAME_INVALID', 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'create', |
|
|
|
url: rootUrl + 'create', |
|
|
|
type: 'POST', |
|
|
|
type: 'POST', |
|
|
@ -260,6 +265,7 @@ function initIndex(){ |
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Handle join confirmation
|
|
|
|
// Handle join confirmation
|
|
|
|