summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-01-28 14:09:11 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-01-28 14:09:11 +0100
commite0f2ed2757b698448d49fa3e73340ce9ced25e7a (patch)
treea786746e555089386efae118277c031f7524be0a /settings
parent022a7b13b828fd1ffb4beb7f63cca45bf4ffff1e (diff)
downloadnextcloud-server-e0f2ed2757b698448d49fa3e73340ce9ced25e7a.tar.gz
nextcloud-server-e0f2ed2757b698448d49fa3e73340ce9ced25e7a.zip
interface and API to change display names
Diffstat (limited to 'settings')
-rw-r--r--settings/js/users.js37
-rw-r--r--settings/routes.php2
-rw-r--r--settings/templates/users.php2
3 files changed, 40 insertions, 1 deletions
diff --git a/settings/js/users.js b/settings/js/users.js
index fa6f058d923..835f46f6ed3 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -300,6 +300,43 @@ $(document).ready(function () {
$('td.password').live('click', function (event) {
$(this).children('img').click();
});
+
+ $('td.displayName>img').live('click', function (event) {
+ event.stopPropagation();
+ var img = $(this);
+ var uid = img.parent().parent().attr('data-uid');
+ var input = $('<input type="text">');
+ img.css('display', 'none');
+ img.parent().children('span').replaceWith(input);
+ input.focus();
+ input.keypress(function (event) {
+ console.log("event!");
+ if (event.keyCode == 13) {
+ console.log("13");
+ if ($(this).val().length > 0) {
+ console.log("post");
+ $.post(
+ OC.filePath('settings', 'ajax', 'changedisplayname.php'),
+ {username:uid, displayName:$(this).val()},
+ function (result) {
+ console.log("come back!");
+ }
+ );
+ input.blur();
+ } else {
+ input.blur();
+ }
+ }
+ });
+ input.blur(function () {
+ $(this).replaceWith($(this).val());
+ img.css('display', '');
+ });
+ });
+ $('td.displayName').live('click', function (event) {
+ $(this).children('img').click();
+ });
+
$('select.quota, select.quota-user').live('change', function () {
var select = $(this);
diff --git a/settings/routes.php b/settings/routes.php
index 9b5bf809230..c9156f9a115 100644
--- a/settings/routes.php
+++ b/settings/routes.php
@@ -39,6 +39,8 @@ $this->create('settings_ajax_removegroup', '/settings/ajax/removegroup.php')
->actionInclude('settings/ajax/removegroup.php');
$this->create('settings_ajax_changepassword', '/settings/ajax/changepassword.php')
->actionInclude('settings/ajax/changepassword.php');
+$this->create('settings_ajax_changedisplayname', '/settings/ajax/changedisplayname.php')
+->actionInclude('settings/ajax/changedisplayname.php');
// personel
$this->create('settings_ajax_lostpassword', '/settings/ajax/lostpassword.php')
->actionInclude('settings/ajax/lostpassword.php');
diff --git a/settings/templates/users.php b/settings/templates/users.php
index 64dce38ba31..2ba57fb4a7c 100644
--- a/settings/templates/users.php
+++ b/settings/templates/users.php
@@ -93,7 +93,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
<?php foreach($_["users"] as $user): ?>
<tr data-uid="<?php echo $user["name"] ?>">
<td class="name"><?php echo $user["name"]; ?></td>
- <td class="displayName"><?php echo $user["displayName"]; ?> <img class="svg action"
+ <td class="displayName"><span><?php echo $user["displayName"]; ?></span> <img class="svg action"
src="<?php echo image_path('core', 'actions/rename.svg')?>"
alt="change display name" title="change display name"/>
</td>