Fix #99 with some jquery

This commit is contained in:
Pellaeon Lin 2017-09-17 15:03:18 +08:00
parent 77b1b5d35d
commit 451bad1269
2 changed files with 9 additions and 1 deletions

7
js/form.js Normal file
View File

@ -0,0 +1,7 @@
$('#show-password').click(function () {
if ( $('#password').attr('type') == "password" ) {
$('#password').attr('type', 'text');
} else {
$('#password').attr('type', 'password');
}
});

View File

@ -1,5 +1,6 @@
<?php <?php
\OCP\Util::addStyle('registration', 'style'); \OCP\Util::addStyle('registration', 'style');
\OCP\Util::addScript('registration', 'form');
if ( \OCP\Util::getVersion()[0] >= 12 ) if ( \OCP\Util::getVersion()[0] >= 12 )
\OCP\Util::addStyle('core', 'guest'); \OCP\Util::addStyle('core', 'guest');
?><form action="<?php print_unescaped(\OC::$server->getURLGenerator()->linkToRoute('registration.register.createAccount', array('token'=>$_['token']))) ?>" method="post"> ?><form action="<?php print_unescaped(\OC::$server->getURLGenerator()->linkToRoute('registration.register.createAccount', array('token'=>$_['token']))) ?>" method="post">
@ -33,7 +34,7 @@ if ( \OCP\Util::getVersion()[0] >= 12 )
<label for="password" class="infield"><?php p($l->t( 'Password' )); ?></label> <label for="password" class="infield"><?php p($l->t( 'Password' )); ?></label>
<img id="password-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt=""/> <img id="password-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt=""/>
<input id="show" name="show" type="checkbox"> <input id="show" name="show" type="checkbox">
<label style="display: inline;" for="show"></label> <label id="show-password" style="display: inline;" for="show"></label>
</p> </p>
<input type="submit" id="submit" value="<?php p($l->t('Create account')); ?>" /> <input type="submit" id="submit" value="<?php p($l->t('Create account')); ?>" />
</fieldset> </fieldset>