Browse Source

Base defaultavatar text on displayname

Fix #4876
tags/v6.0.0alpha2
kondou 10 years ago
parent
commit
4907685405
3 changed files with 7 additions and 2 deletions
  1. 1
    1
      core/avatar/controller.php
  2. 5
    1
      core/js/jquery.avatar.js
  3. 1
    0
      settings/js/personal.js

+ 1
- 1
core/avatar/controller.php View File

$image->show(); $image->show();
} else { } else {
// Signalizes $.avatar() to display a defaultavatar // Signalizes $.avatar() to display a defaultavatar
\OC_JSON::success();
\OC_JSON::success(array("data"=> array("displayname"=> \OC_User::getDisplayName($user)) ));
} }
} }



+ 5
- 1
core/js/jquery.avatar.js View File

var url = OC.Router.generate('core_avatar_get', {user: user, size: size})+'?requesttoken='+oc_requesttoken; var url = OC.Router.generate('core_avatar_get', {user: user, size: size})+'?requesttoken='+oc_requesttoken;
$.get(url, function(result) { $.get(url, function(result) {
if (typeof(result) === 'object') { if (typeof(result) === 'object') {
$div.placeholder(user);
if (result.data && result.data.displayname) {
$div.placeholder(user, result.data.displayname);
} else {
$div.placeholder(user);
}
} else { } else {
if (ie8fix === true) { if (ie8fix === true) {
$div.html('<img src="'+url+'#'+Math.floor(Math.random()*1000)+'">'); $div.html('<img src="'+url+'#'+Math.floor(Math.random()*1000)+'">');

+ 1
- 0
settings/js/personal.js View File

$('#oldDisplayName').text($('#displayName').val()); $('#oldDisplayName').text($('#displayName').val());
// update displayName on the top right expand button // update displayName on the top right expand button
$('#expandDisplayName').text($('#displayName').val()); $('#expandDisplayName').text($('#displayName').val());
updateAvatar();
} }
else{ else{
$('#newdisplayname').val(data.data.displayName); $('#newdisplayname').val(data.data.displayName);

Loading…
Cancel
Save