@ -11,26 +11,22 @@ define([
'/common/common-feedback.js' ,
'/common/common-feedback.js' ,
'/common/outer/local-store.js' ,
'/common/outer/local-store.js' ,
'/common/hyperscript.js' ,
'/common/hyperscript.js' ,
'/api/config' ,
'css!/bower_components/components-font-awesome/css/font-awesome.min.css' ,
'css!/bower_components/components-font-awesome/css/font-awesome.min.css' ,
] , function ( $ , Login , Cryptpad , Test , Cred , UI , Util , Realtime , Constants , Feedback , LocalStore , h ) {
] , function ( $ , Login , Cryptpad , Test , Cred , UI , Util , Realtime , Constants , Feedback , LocalStore , h , ApiConfig ) {
var Messages = Cryptpad . Messages ;
var Messages = Cryptpad . Messages ;
Messages . register _registrationIsClosed = "REGISTRATION IS CLOSED ON THIS INSTANCE." ; // XXX
$ ( function ( ) {
$ ( function ( ) {
var $main = $ ( '#mainBlock' ) ;
if ( ApiConfig . restrictRegistration ) {
return void UI . alert ( Messages . register _registrationIsClosed ) ; // XXX restricted-registration better UI ?
// main block is hidden in case javascript is disabled
// remove the form and display text instead of an alert that people will probably dismiss?
$main . removeClass ( 'hidden' ) ;
}
// Make sure we don't display non-translated content (empty button)
$main . find ( '#data' ) . removeClass ( 'hidden' ) ;
if ( LocalStore . isLoggedIn ( ) ) {
if ( LocalStore . isLoggedIn ( ) ) {
// already logged in, redirect to drive
// already logged in, redirect to drive
document . location . href = '/drive/' ;
document . location . href = '/drive/' ;
return ;
return ;
} else {
$main . find ( '#userForm' ) . removeClass ( 'hidden' ) ;
}
}
// text and password input fields
// text and password input fields