summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/avatar/controller.php2
-rw-r--r--core/js/avatar.js4
-rw-r--r--core/js/jquery.avatar.js24
3 files changed, 14 insertions, 16 deletions
diff --git a/core/avatar/controller.php b/core/avatar/controller.php
index b4ee791130c..9666fd879fb 100644
--- a/core/avatar/controller.php
+++ b/core/avatar/controller.php
@@ -79,8 +79,6 @@ class OC_Core_Avatar_Controller {
}
public static function getTmpAvatar($args) {
- // TODO deliver actual size here as well, so Jcrop can do its magic and we have the actual coordinates here again
- // TODO or don't have a size parameter and only resize client sided (looks promising)
$user = OC_User::getUser();
$tmpavatar = \OC_Cache::get('tmpavatar');
diff --git a/core/js/avatar.js b/core/js/avatar.js
index 22ebf295999..afcd7e9f2ce 100644
--- a/core/js/avatar.js
+++ b/core/js/avatar.js
@@ -4,7 +4,7 @@ $(document).ready(function(){
$('#avatar .avatardiv').avatar(OC.currentUser, 128);
// User settings
$.each($('td.avatar .avatardiv'), function(i, data) {
- $(data).avatar($(data).parent().parent().data('uid'), 32); // TODO maybe a better way of getting the current name …
+ $(data).avatar($(data).parent().parent().data('uid'), 32); // TODO maybe a better way of getting the current name … – may be fixed by new-user-mgmt
});
- // TODO when creating a new user, he gets a previously used avatar
+ // TODO when creating a new user, he gets a previously used avatar – may be fixed by new user-mgmt
});
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index f6181e1c9e2..bd57a542fa7 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -6,17 +6,17 @@
*/
(function ($) {
- $.fn.avatar = function(user, height) {
- // TODO there has to be a better way …
- if (typeof(height) === 'undefined') {
- height = this.height();
- }
- if (height === 0) {
- height = 64;
+ $.fn.avatar = function(user, size) {
+ if (typeof(size) === 'undefined') {
+ if (this.height() > 0) {
+ size = this.height();
+ } else {
+ size = 64;
+ }
}
- this.height(height);
- this.width(height);
+ this.height(size);
+ this.width(size);
if (typeof(user) === 'undefined') {
this.placeholder('x');
@@ -25,12 +25,12 @@
var $div = this;
- //$.get(OC.Router.generate('core_avatar_get', {user: user, size: height}), function(result) { // TODO does not work "Uncaught TypeError: Cannot use 'in' operator to search for 'core_avatar_get' in undefined" router.js L22
- $.get(OC.router_base_url+'/avatar/'+user+'/'+height, function(result) {
+ //$.get(OC.Router.generate('core_avatar_get', {user: user, size: size}), function(result) { // TODO does not work "Uncaught TypeError: Cannot use 'in' operator to search for 'core_avatar_get' in undefined" router.js L22
+ $.get(OC.router_base_url+'/avatar/'+user+'/'+size, function(result) {
if (typeof(result) === 'object') {
$div.placeholder(result.user);
} else {
- $div.html('<img src="'+OC.Router.generate('core_avatar_get', {user: user, size: height})+'">');
+ $div.html('<img src="'+OC.Router.generate('core_avatar_get', {user: user, size: size})+'">');
}
});
};