From 523b0966d22d0fc149ca64afb32995a0eb29a6d3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 15 Aug 2011 21:06:29 +0200 Subject: add option to set user quota --- settings/js/users.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'settings/js') 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=$(''); + 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($(''+quota+'')); + img.css('display',''); + }); + }); + $('td.quota').live('click',function(event){ + $(this).children('img').click(); + }); $('#newuser').submit(function(event){ event.preventDefault(); -- cgit v1.2.3