aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-12-10 16:59:03 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-16 18:45:37 +0100
commit51a22431ee824357dce0100cb000032f29aabd47 (patch)
tree339aa12a968c1738ed19a6edec8df81451f162b1 /core
parent3cc33a98a898f247499896ae0674ae680564fb12 (diff)
downloadnextcloud-server-51a22431ee824357dce0100cb000032f29aabd47.tar.gz
nextcloud-server-51a22431ee824357dce0100cb000032f29aabd47.zip
load showpassord.js conditionally in the template only if needed
Diffstat (limited to 'core')
-rw-r--r--core/js/installation.js5
-rw-r--r--core/js/js.js29
-rw-r--r--core/templates/installation.php6
3 files changed, 11 insertions, 29 deletions
diff --git a/core/js/installation.js b/core/js/installation.js
new file mode 100644
index 00000000000..20ff346215f
--- /dev/null
+++ b/core/js/installation.js
@@ -0,0 +1,5 @@
+
+$(document).ready(function() {
+ $('#adminpass').showPassword().keyup();
+ $('#dbpass').showPassword().keyup();
+});
diff --git a/core/js/js.js b/core/js/js.js
index f01c0eb77c1..57ce1ab6955 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1081,35 +1081,6 @@ function initCore() {
}
});
- var setShowPassword = function(input, label) {
- input.showPassword().keyup();
- };
- setShowPassword($('#adminpass'), $('label[for=show]'));
- setShowPassword($('#pass2'), $('label[for=personal-show]'));
- setShowPassword($('#dbpass'), $('label[for=dbpassword]'));
-
- var checkShowCredentials = function() {
- var empty = false;
- $('input#user, input#password').each(function() {
- if ($(this).val() === '') {
- empty = true;
- }
- });
- if(empty) {
- $('#submit').fadeOut();
- $('#remember_login').hide();
- $('#remember_login+label').fadeOut();
- } else {
- $('#submit').fadeIn();
- $('#remember_login').show();
- $('#remember_login+label').fadeIn();
- }
- };
- // hide log in button etc. when form fields not filled
- // commented out due to some browsers having issues with it
- // checkShowCredentials();
- // $('input#user, input#password').keyup(checkShowCredentials);
-
// user menu
$('#settings #expand').keydown(function(event) {
if (event.which === 13 || event.which === 32) {
diff --git a/core/templates/installation.php b/core/templates/installation.php
index 9ef63dbfe8c..0b3b0d46c5c 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -1,3 +1,9 @@
+<?php
+script('core', [
+ 'jquery-showpassword',
+ 'installation'
+]);
+?>
<input type='hidden' id='hasMySQL' value='<?php p($_['hasMySQL']) ?>'>
<input type='hidden' id='hasSQLite' value='<?php p($_['hasSQLite']) ?>'>
<input type='hidden' id='hasPostgreSQL' value='<?php p($_['hasPostgreSQL']) ?>'>