From 5c1a9f35f16a8a871bcef24a45478ac92af9a9e1 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 13 Mar 2013 11:03:52 +0100 Subject: Indicate password strength using strengthify * uses zxcvbn * outsourced to separate jquery plugin * async loading * hide strength meter if input is empty * feedback if user enters weakest password * fade in and out * show tipsy with strength * Opera 12, IE8-10, FF 23, Chromium 29 --- core/js/setup.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'core/js') diff --git a/core/js/setup.js b/core/js/setup.js index 0863be35886..279b5fbebb9 100644 --- a/core/js/setup.js +++ b/core/js/setup.js @@ -7,9 +7,9 @@ $(document).ready(function() { oracle:!!$('#hasOracle').val(), mssql:!!$('#hasMSSQL').val() }; - + $('#selectDbType').buttonset(); - + if($('#hasSQLite').val()){ $('#use_other_db').hide(); $('#use_oracle_db').hide(); @@ -63,17 +63,27 @@ $(document).ready(function() { form.submit(); return false; }); - + // Expand latest db settings if page was reloaded on error var currentDbType = $('input[type="radio"]:checked').val(); - + if (currentDbType === undefined){ $('input[type="radio"]').first().click(); } - + if (currentDbType === 'sqlite' || (dbtypes.sqlite && currentDbType === undefined)){ $('#datadirContent').hide(250); $('#databaseField').hide(250); } - + + $('#adminpass').strengthify({ + zxcvbn: OC.linkTo('3rdparty','zxcvbn/js/zxcvbn.js'), + titles: [ + t('core', 'Very weak password'), + t('core', 'Weak password'), + t('core', 'So-so password'), + t('core', 'Good password'), + t('core', 'Strong password') + ] + }); }); -- cgit v1.2.3