Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
bdf48a6d
Commit
bdf48a6d
authored
11 years ago
by
Christopher Schäpers
Browse files
Options
Downloads
Patches
Plain Diff
Use OC.Router.generate, TODO use cache, prepare for defaultavatars
parent
67c5be9f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
core/avatar/controller.php
+1
-1
1 addition, 1 deletion
core/avatar/controller.php
lib/cleanupavatarjob.php
+0
-13
0 additions, 13 deletions
lib/cleanupavatarjob.php
settings/js/personal.js
+4
-4
4 additions, 4 deletions
settings/js/personal.js
settings/personal.php
+2
-0
2 additions, 0 deletions
settings/personal.php
with
7 additions
and
18 deletions
core/avatar/controller.php
+
1
−
1
View file @
bdf48a6d
...
...
@@ -91,7 +91,7 @@ class OC_Core_Avatar_Controller {
// 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)
//
// TODO m
ake a cronjob that cleans up the tmpavatar after it's older than 2 hours, should be run every hour
// TODO m
ove the tmpavatar to the cache instead, so it's cleaned up after some time
$user
=
OC_User
::
getUser
();
$view
=
new
\OC\Files\View
(
'/'
.
$user
);
...
...
This diff is collapsed.
Click to expand it.
lib/cleanupavatarjob.php
deleted
100644 → 0
+
0
−
13
View file @
67c5be9f
<?php
class
CleanUpAvatarJob
extends
\OC\BackgroundJob\TimedJob
{
public
function
__construct
()
{
$this
->
setInterval
(
7200
);
// 2 hours
}
public
function
run
(
$argument
)
{
// TODO $view
// TODO remove ALL the tmpavatars
}
}
This diff is collapsed.
Click to expand it.
settings/js/personal.js
+
4
−
4
View file @
bdf48a6d
...
...
@@ -45,7 +45,7 @@ function changeDisplayName(){
}
function
selectAvatar
(
path
)
{
$
.
post
(
OC
.
r
outer
_base_url
+
'
/avatar/
'
,
{
path
:
path
},
avatarResponseHandler
);
$
.
post
(
OC
.
R
outer
.
generate
(
'
core_avatar_post
'
)
,
{
path
:
path
},
avatarResponseHandler
);
}
function
updateAvatar
()
{
...
...
@@ -74,7 +74,7 @@ function showAvatarCropper() {
onSelect
:
saveCoords
,
aspectRatio
:
1
});
}).
attr
(
'
src
'
,
OC
.
r
outer
_base_url
+
'
/avatartmp/
512
'
);
}).
attr
(
'
src
'
,
OC
.
R
outer
.
generate
(
'
core_avatar_get_tmp
'
,
{
size
:
512
})
);
}
function
sendCropData
()
{
...
...
@@ -86,7 +86,7 @@ function sendCropData() {
w
:
cropperdata
.
w
,
h
:
cropperdata
.
h
};
$
.
post
(
OC
.
r
outer
_base_url
+
'
/avatar/
cropped
'
,
{
crop
:
data
},
avatarResponseHandler
);
$
.
post
(
OC
.
R
outer
.
generate
(
'
core_avatar_post_
cropped
'
)
,
{
crop
:
data
},
avatarResponseHandler
);
}
function
saveCoords
(
c
)
{
...
...
@@ -214,7 +214,7 @@ $(document).ready(function(){
$
(
'
#removeavatar
'
).
click
(
function
(){
$
.
ajax
({
type
:
'
DELETE
'
,
url
:
OC
.
r
outer
_base_url
+
'
/avatar/
'
,
url
:
OC
.
R
outer
.
generate
(
'
core_avatar_delete
'
)
,
success
:
function
(
msg
)
{
updateAvatar
();
}
...
...
This diff is collapsed.
Click to expand it.
settings/personal.php
+
2
−
0
View file @
bdf48a6d
...
...
@@ -18,6 +18,8 @@ OC_Util::addStyle( '3rdparty', 'chosen' );
\OC_Util
::
addScript
(
'files'
,
'jquery.fileupload'
);
\OC_Util
::
addScript
(
'3rdparty/Jcrop'
,
'jquery.Jcrop.min'
);
\OC_Util
::
addStyle
(
'3rdparty/Jcrop'
,
'jquery.Jcrop.min'
);
//OC_Util::addScript('3rdparty', 'md5/md5.min');
//OC_Util::addScript('core', 'placeholder');
OC_App
::
setActiveNavigationEntry
(
'personal'
);
$storageInfo
=
OC_Helper
::
getStorageInfo
(
'/'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment