diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-15 21:06:29 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-15 21:09:13 +0200 |
commit | 523b0966d22d0fc149ca64afb32995a0eb29a6d3 (patch) | |
tree | 80525dab3705396fe527ec5b5da2e4fe817b2016 /settings/js | |
parent | 6173c0fbc262f0d02c45d9cf4e81b020ad839145 (diff) | |
download | nextcloud-server-523b0966d22d0fc149ca64afb32995a0eb29a6d3.tar.gz nextcloud-server-523b0966d22d0fc149ca64afb32995a0eb29a6d3.zip |
add option to set user quota
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/users.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/settings/js/users.js b/settings/js/users.js index bc1b8fc3ed0..3122f5614c7 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -75,6 +75,45 @@ $(document).ready(function(){ $('td.password').live('click',function(event){ $(this).children('img').click(); }); + + $('td.quota>img').live('click',function(event){ + event.stopPropagation(); + var img=$(this); + var uid=img.parent().parent().data('uid'); + var input=$('<input>'); + var quota=img.parent().children('span').text(); + img + if(quota=='None'){ + quota=''; + } + input.val(quota); + img.css('display','none'); + img.parent().children('span').replaceWith(input); + input.focus(); + input.keypress(function(event) { + if(event.keyCode == 13) { + $(this).parent().attr('data-quota',$(this).val()); + if($(this).val().length>0){ + $.post( + OC.filePath('settings','ajax','setquota.php'), + {username:uid,quota:$(this).val()}, + function(result){} + ); + input.blur(); + }else{ + input.blur(); + } + } + }); + input.blur(function(){ + var quota=$(this).parent().data('quota'); + $(this).replaceWith($('<span>'+quota+'</span>')); + img.css('display',''); + }); + }); + $('td.quota').live('click',function(event){ + $(this).children('img').click(); + }); $('#newuser').submit(function(event){ event.preventDefault(); |