diff options
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/apps.js | 30 | ||||
-rw-r--r-- | settings/js/personal.js | 43 | ||||
-rw-r--r-- | settings/js/users.js | 2 |
3 files changed, 66 insertions, 9 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index a55c55e24cf..2c6f77d9314 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -37,6 +37,30 @@ OC.Settings.Apps = OC.Settings.Apps || { } page.find('span.licence').text(appLicense); + var userDocumentation = false; + var adminDocumentation = false; + if (typeof(app.documentation) !== 'undefined') { + if (typeof(app.documentation.user) !== 'undefined') { + userDocumentation = true; + page.find('span.userDocumentation').html("<a id='userDocumentation' href='" + app.documentation.user + "'>" + t('settings', 'User Documentation') + "</a>"); + page.find('p.documentation').show(); + } + if (typeof(app.documentation.admin) !== 'undefined') { + adminDocumentation = true; + page.find('span.adminDocumentation').html("<a id='adminDocumentation' href='" + app.documentation.admin + "'>" + t('settings', 'Admin Documentation') + "</a>"); + page.find('p.documentation').show(); + } + + if(userDocumentation && adminDocumentation) { + page.find('span.userDocumentation').after(', '); + } + } + + if (typeof(app.website) !== 'undefined') { + page.find('p.website').show(); + page.find('a#websitelink').attr('href', app.website); + } + if (app.update !== false) { page.find('input.update').show(); page.find('input.update').data('appid', app.id); @@ -51,8 +75,8 @@ OC.Settings.Apps = OC.Settings.Apps || { page.find('input.enable').data('active', app.active); if (app.internal === false) { page.find('span.score').show(); - page.find('p.appslink').show(); - page.find('a').attr('href', 'http://apps.owncloud.com/content/show.php?content=' + app.id); + page.find('p.appstore').show(); + page.find('a#appstorelink').attr('href', 'http://apps.owncloud.com/content/show.php?content=' + app.id); page.find('small.externalapp').hide(); } else { page.find('p.appslink').hide(); @@ -110,7 +134,7 @@ OC.Settings.Apps = OC.Settings.Apps || { element.val(t('settings','Disable')); } },'json') - .fail(function() { + .fail(function() { OC.Settings.Apps.showErrorMessage(t('settings', 'Error while enabling app')); appitem.data('errormsg', t('settings', 'Error while enabling app')); appitem.data('active',false); diff --git a/settings/js/personal.js b/settings/js/personal.js index 2934677f256..3b876467756 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -1,5 +1,6 @@ /** * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com> + * 2013, Morris Jobke <morris.jobke@gmail.com> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ @@ -157,20 +158,37 @@ $(document).ready(function(){ if(typeof timeout !== 'undefined'){ clearTimeout(timeout); } - timeout = setTimeout('changeDisplayName()',1000); + timeout = setTimeout(changeDisplayName, 1000); } }); $('#email').keyup(function(){ if ($('#email').val() !== '' ){ + // if this is the enter key changeEmailAddress() is already invoked + // so it doesn't need to be triggered again + if(event.keyCode === 13) { + return; + } if(typeof timeout !== 'undefined'){ clearTimeout(timeout); } - timeout = setTimeout('changeEmailAddress()',1000); + timeout = setTimeout(changeEmailAddress, 1000); } }); + $('#email').keypress(function(event){ + // check for enter key and non empty email + if (event.keyCode === 13 && $('#email').val() !== '' ){ + event.preventDefault() + // clear timeout of previous keyup event - prevents duplicate changeEmailAddress call + if(typeof timeout !== 'undefined'){ + clearTimeout(timeout); + } + changeEmailAddress(); + } + }); + $("#languageinput").change( function(){ // Serialize the data var post = $( "#languageinput" ).serialize(); @@ -188,6 +206,8 @@ $(document).ready(function(){ $('button:button[name="submitDecryptAll"]').click(function() { var privateKeyPassword = $('#decryptAll input:password[id="privateKeyPassword"]').val(); + $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true); + $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true); OC.Encryption.decryptAll(privateKeyPassword); }); @@ -196,6 +216,8 @@ $(document).ready(function(){ if (privateKeyPassword !== '' ) { $('#decryptAll button:button[name="submitDecryptAll"]').removeAttr("disabled"); if(event.which === 13) { + $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true); + $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true); OC.Encryption.decryptAll(privateKeyPassword); } } else { @@ -243,6 +265,17 @@ $(document).ready(function(){ $('#sendcropperbutton').click(function(){ sendCropData(); }); + + $('#pass2').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') + ] + }); } ); OC.Encryption = { @@ -251,13 +284,13 @@ OC.Encryption = { $.post('ajax/decryptall.php', {password:password}, function(data) { if (data.status === "error") { OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data); + $('#decryptAll input:password[name="privateKeyPassword"]').removeAttr("disabled"); } else { OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data); } - } - ); + }); } -} +}; OC.Encryption.msg={ startDecrypting:function(selector){ diff --git a/settings/js/users.js b/settings/js/users.js index 5ae157b07c6..6886db668b5 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -44,7 +44,7 @@ var UserList = { // Provide user with option to undo $('#notification').data('deleteuser', true); - OC.Notification.showHtml(t('users', 'deleted') + ' ' + escapeHTML(uid) + '<span class="undo">' + t('users', 'undo') + '</span>'); + OC.Notification.showHtml(t('settings', 'deleted') + ' ' + escapeHTML(uid) + '<span class="undo">' + t('settings', 'undo') + '</span>'); }, /** |