diff options
author | kondou <kondou@ts.unde.re> | 2013-08-21 21:20:25 +0400 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-08-21 21:20:25 +0400 |
commit | 0ce35af02acb2fa9fe0ef401dc75345b5114e3d6 (patch) | |
tree | 5ff19a7cc1bce5901cfeec7e11179ed2682b9e78 /settings/js | |
parent | 7c296a6cf915da6630422ceb8e253ebf9f004964 (diff) | |
parent | a89199cc7bd19f6ba3e76fcd510219b2bd930ae6 (diff) |
Merge branch 'master' into improve_app-management
Conflicts:
settings/js/apps.js
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/apps-custom.php | 2 | ||||
-rw-r--r-- | settings/js/isadmin.php | 2 | ||||
-rw-r--r-- | settings/js/log.js | 3 | ||||
-rw-r--r-- | settings/js/personal.js | 56 | ||||
-rw-r--r-- | settings/js/users.js | 38 |
5 files changed, 82 insertions, 19 deletions
diff --git a/settings/js/apps-custom.php b/settings/js/apps-custom.php index d827dfc7058..c25148cdde5 100644 --- a/settings/js/apps-custom.php +++ b/settings/js/apps-custom.php @@ -23,4 +23,4 @@ foreach($combinedApps as $app) { echo("\n"); } -echo ("var appid =".json_encode($_GET['appid']).";");
\ No newline at end of file +echo ("var appid =".json_encode($_GET['appid']).";"); diff --git a/settings/js/isadmin.php b/settings/js/isadmin.php index 8b31f8a7cf9..13a8ba1d312 100644 --- a/settings/js/isadmin.php +++ b/settings/js/isadmin.php @@ -17,4 +17,4 @@ if (OC_User::isAdminUser(OC_User::getUser())) { echo("var isadmin = true;"); } else { echo("var isadmin = false;"); -}
\ No newline at end of file +} diff --git a/settings/js/log.js b/settings/js/log.js index 1ef9b419cdb..5832c698ad5 100644 --- a/settings/js/log.js +++ b/settings/js/log.js @@ -35,8 +35,9 @@ OC.Log={ $('#moreLog').show(); // remove all non-remaining items $('#log tr').slice(OC.Log.loaded).remove(); - if(OC.Log.loaded <= 3) + if(OC.Log.loaded <= 3) { $('#lessLog').hide(); + } }, addEntries:function(entries){ for(var i=0;i<entries.length;i++){ diff --git a/settings/js/personal.js b/settings/js/personal.js index 099c1426dc0..8ad26c086b5 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -8,7 +8,7 @@ * Post the email address change to the server. */ function changeEmailAddress(){ - emailInfo = $('#email'); + var emailInfo = $('#email'); if (emailInfo.val() === emailInfo.defaultValue){ return; } @@ -110,8 +110,62 @@ $(document).ready(function(){ }); return false; }); + + $('button:button[name="submitDecryptAll"]').click(function() { + var privateKeyPassword = $('#decryptAll input:password[id="privateKeyPassword"]').val(); + OC.Encryption.decryptAll(privateKeyPassword); + }); + + $('#decryptAll input:password[name="privateKeyPassword"]').keyup(function(event) { + var privateKeyPassword = $('#decryptAll input:password[id="privateKeyPassword"]').val(); + if (privateKeyPassword !== '' ) { + $('#decryptAll button:button[name="submitDecryptAll"]').removeAttr("disabled"); + if(event.which === 13) { + OC.Encryption.decryptAll(privateKeyPassword); + } + } else { + $('#decryptAll button:button[name="submitDecryptAll"]').attr("disabled", "true"); + } + }); + } ); +OC.Encryption = { + decryptAll: function(password) { + OC.Encryption.msg.startDecrypting('#decryptAll .msg'); + $.post('ajax/decryptall.php', {password:password}, function(data) { + if (data.status === "error") { + OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data); + } else { + OC.Encryption.msg.finishedDecrypting('#decryptAll .msg', data); + } + } + ); + } +} + +OC.Encryption.msg={ + startDecrypting:function(selector){ + $(selector) + .html( t('files_encryption', 'Decrypting files... Please wait, this can take some time.') ) + .removeClass('success') + .removeClass('error') + .stop(true, true) + .show(); + }, + finishedDecrypting:function(selector, data){ + if( data.status === "success" ){ + $(selector).html( data.data.message ) + .addClass('success') + .stop(true, true) + .delay(3000) + .fadeOut(900); + }else{ + $(selector).html( data.data.message ).addClass('error'); + } + } +}; + OC.msg={ startSaving:function(selector){ $(selector) diff --git a/settings/js/users.js b/settings/js/users.js index 6a8afc4ca36..ab08d7099c6 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -89,10 +89,15 @@ var UserList = { tr.attr('data-displayName', displayname); tr.find('td.name').text(username); tr.find('td.displayName > span').text(displayname); - var groupsSelect = $('<select multiple="multiple" class="groupsselect" data-placehoder="Groups" title="' + t('settings', 'Groups') + '"></select>').attr('data-username', username).attr('data-user-groups', groups); + var groupsSelect = $('<select multiple="multiple" class="groupsselect" data-placehoder="Groups" title="' + t('settings', 'Groups') + '"></select>') + .attr('data-username', username) + .attr('data-user-groups', [groups]); tr.find('td.groups').empty(); if (tr.find('td.subadmins').length > 0) { - var subadminSelect = $('<select multiple="multiple" class="subadminsselect" data-placehoder="subadmins" title="' + t('settings', 'Group Admin') + '">').attr('data-username', username).attr('data-user-groups', groups).attr('data-subadmin', subadmin); + var subadminSelect = $('<select multiple="multiple" class="subadminsselect" data-placehoder="subadmins" title="' + t('settings', 'Group Admin') + '">') + .attr('data-username', username) + .attr('data-user-groups', [groups]) + .attr('data-subadmin', [subadmin]); tr.find('td.subadmins').empty(); } $.each(this.availableGroups, function (i, group) { @@ -166,7 +171,9 @@ var UserList = { var c = Number(aa[x]), d = Number(bb[x]); if (c === aa[x] && d === bb[x]) { return c - d; - } else return (aa[x] > bb[x]) ? 1 : -1; + } else { + return (aa[x] > bb[x]) ? 1 : -1; + } } } return aa.length - bb.length; @@ -227,7 +234,7 @@ var UserList = { var user = element.attr('data-username'); if ($(element).attr('class') === 'groupsselect') { if (element.data('userGroups')) { - checked = String(element.data('userGroups')).split(', '); + checked = element.data('userGroups'); } if (user) { var checkHandeler = function (group) { @@ -244,11 +251,12 @@ var UserList = { group: group }, function (response) { - if(response.status === 'success') { - if(UserList.availableGroups.indexOf(response.data.groupname) === -1 && response.data.action === 'add') { - UserList.availableGroups.push(response.data.groupname); - } - } else { + if(response.status === 'success' + && UserList.availableGroups.indexOf(response.data.groupname) === -1 + && response.data.action === 'add') { + UserList.availableGroups.push(response.data.groupname); + } + if(response.data.message) { OC.Notification.show(response.data.message); } } @@ -262,7 +270,7 @@ var UserList = { if ($(element).find('option[value="' + group + '"]').length === 0 && select.data('msid') !== $(element).data('msid')) { $(element).append('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>'); } - }) + }); }; var label; if (isadmin) { @@ -282,7 +290,7 @@ var UserList = { } if ($(element).attr('class') === 'subadminsselect') { if (element.data('subadmin')) { - checked = String(element.data('subadmin')).split(', '); + checked = element.data('subadmin'); } var checkHandeler = function (group) { if (group === 'admin') { @@ -304,7 +312,7 @@ var UserList = { if ($(element).find('option[value="' + group + '"]').length === 0) { $(element).append('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>'); } - }) + }); }; element.multiSelect({ createCallback: addSubAdmin, @@ -321,7 +329,7 @@ var UserList = { $(document).ready(function () { UserList.doSort(); - UserList.availableGroups = $('#content table').attr('data-groups').split(', '); + UserList.availableGroups = $('#content table').data('groups'); $('tbody tr:last').bind('inview', function (event, isInView, visiblePartX, visiblePartY) { OC.Router.registerLoadedCallback(function () { UserList.update(); @@ -450,7 +458,7 @@ $(document).ready(function () { t('settings', 'Error creating user')); } else { if (result.data.groups) { - var addedGroups = result.data.groups.split(', '); + var addedGroups = result.data.groups; UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups)); } if($('tr[data-uid="' + username + '"]').length === 0) { @@ -469,7 +477,7 @@ $(document).ready(function () { } OC.Notification.hide(); }); - UserList.useUndo = ('onbeforeunload' in window) + UserList.useUndo = ('onbeforeunload' in window); $(window).bind('beforeunload', function () { UserList.finishDelete(null); }); |