summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <JanCBorchardt@fsfe.org>2011-08-08 11:45:01 +0200
committerJan-Christoph Borchardt <JanCBorchardt@fsfe.org>2011-08-08 11:46:39 +0200
commitc572de6276104d7041b288585f29e1ed39fdbb26 (patch)
treeb6feb6039c24a16099f4e1590af4b0e3912c62b6 /core
parent5382ec66a2ec0491b8d8a3882f78fdc9443d0ab5 (diff)
downloadnextcloud-server-c572de6276104d7041b288585f29e1ed39fdbb26.tar.gz
nextcloud-server-c572de6276104d7041b288585f29e1ed39fdbb26.zip
hide log in button etc when form fields not filled
Diffstat (limited to 'core')
-rw-r--r--core/css/styles.css6
-rw-r--r--core/js/js.js26
-rw-r--r--core/templates/login.php4
3 files changed, 30 insertions, 6 deletions
diff --git a/core/css/styles.css b/core/css/styles.css
index dc405f7131f..bf02fe89a57 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -15,14 +15,14 @@ input, select { font-size:1em; width:10em; margin:.3em; padding:.5em; background
input[type="text"], input[type="password"] { background:#f8f8f8; color:#555; cursor:text; }
input[type="text"]:hover, input[type="text"]:focus, input[type="password"]:hover, input[type="password"]:focus { background:#fff; color:#333; }
-input[type="submit"] { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
+input[type="submit"] { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
input[type="submit"]:hover, input[type="submit"]:focus { background:#fff; color:#333; }
input[type="checkbox"] { width:auto; }
#body-login input { font-size:1.5em; }
#body-login input[type="submit"] { float:right; margin-right:.8em; }
#remember_login { margin:.8em .2em 0 1em; }
-form.searchbox input[type="search"] { position:fixed; font-size:1.2em; top:.3em; right:7em; padding:.2em .5em .2em 1.5em; background:#f8f8f8 url('../img/actions/search.png') .5em center no-repeat; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; }
+form.searchbox input[type="search"] { position:fixed; font-size:1.2em; top:.3em; right:7em; padding:.2em .5em .2em 1.5em; background:#f8f8f8 url('../img/actions/search.png') .5em center no-repeat; border:0; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; }
form#user_settings { max-width:600px; }
form#user_settings p label { display:block; float:left; width:35%; padding:0.4em 0.5em 0 0; text-align:right; }
@@ -56,7 +56,7 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', end
#login form fieldset { background-color:transparent; border:0; margin:0; padding:0; }
#login form p { position:relative; padding:0; }
#login form label { position:absolute; margin:.8em .8em; font-size:1.5em; color:#666; }
-#login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; }
+#login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; }
#setup_form { margin:3em auto; text-align:left; width:720px; }
#setup_form #use_mysql { font-size:0.9em; margin:0 0 0 1em; }
diff --git a/core/js/js.js b/core/js/js.js
index 9eff3815211..9e2ae8d7104 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -238,8 +238,32 @@ $(document).ready(function(){
}
}
});
-
+
+ // 'show password' checkbox
$('#pass2').showPassword();
+
+ // hide log in button etc. when form fields not filled
+ $('#submit').hide();
+ $('#remember_login').hide();
+ $('#remember_login+label').hide();
+ $('#body-login input').keyup(function() {
+ var empty = false;
+ $('#body-login input').each(function() {
+ if ($(this).val() == '') {
+ empty = true;
+ }
+ });
+
+ if(empty) {
+ $('#submit').fadeOut();
+ $('#remember_login').fadeOut();
+ $('#remember_login+label').fadeOut();
+ } else {
+ $('#submit').fadeIn();
+ $('#remember_login').fadeIn();
+ $('#remember_login+label').fadeIn();
+ }
+ });
});
diff --git a/core/templates/login.php b/core/templates/login.php
index 6206a8f34e0..19f25f033d3 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -10,11 +10,11 @@
<?php if(empty($_["username"])){?>
<input type="text" name="user" id="user" placeholder="Username" value="" autocomplete="off" required autofocus />
<input type="password" name="password" id="password" placeholder="Password" value="" required />
- <input type="checkbox" name="remember_login" id="remember_login" /> <?php echo $l->t('remember'); ?>
+ <input type="checkbox" name="remember_login" id="remember_login" /><label for="remember_login"><?php echo $l->t('remember'); ?></label>
<?php }else{ ?>
<input type="text" name="user" id="user" placeholder="Username" value="<?php echo $_['username']; ?>" autocomplete="off" required >
<input type="password" name="password" id="password" placeholder="Password" value="" required autofocus />
- <input type="checkbox" name="remember_login" id="remember_login" checked /> <?php echo $l->t('remember'); ?>
+ <input type="checkbox" name="remember_login" id="remember_login" checked /><label for="remember_login"><?php echo $l->t('remember'); ?></label>
<?php } ?>
<input type="submit" id="submit" value="Log in" />
</fieldset>