|
|
|
@ -1,15 +1,13 @@
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
/* globals define, ajaxify, app, utils, socket, bootbox */
|
|
|
|
|
/* globals define, ajaxify, app, socket, bootbox */
|
|
|
|
|
|
|
|
|
|
define('forum/account/profile', [
|
|
|
|
|
'forum/account/header',
|
|
|
|
|
'forum/infinitescroll',
|
|
|
|
|
'translator',
|
|
|
|
|
'coverPhoto',
|
|
|
|
|
'uploader',
|
|
|
|
|
'components'
|
|
|
|
|
], function(header, infinitescroll, translator, coverPhoto, uploader, components) {
|
|
|
|
|
], function(header, infinitescroll, translator) {
|
|
|
|
|
var Account = {},
|
|
|
|
|
yourid,
|
|
|
|
|
theirid,
|
|
|
|
@ -48,10 +46,6 @@ define('forum/account/profile', [
|
|
|
|
|
socket.on('event:user_status_change', onUserStatusChange);
|
|
|
|
|
|
|
|
|
|
infinitescroll.init(loadMorePosts);
|
|
|
|
|
|
|
|
|
|
if (parseInt(yourid, 10) === parseInt(theirid, 10)) {
|
|
|
|
|
setupCoverPhoto();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function processPage() {
|
|
|
|
@ -172,22 +166,5 @@ define('forum/account/profile', [
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setupCoverPhoto() {
|
|
|
|
|
coverPhoto.init(components.get('account/cover'),
|
|
|
|
|
function(imageData, position, callback) {
|
|
|
|
|
socket.emit('user.updateCover', {
|
|
|
|
|
uid: yourid,
|
|
|
|
|
imageData: imageData,
|
|
|
|
|
position: position
|
|
|
|
|
}, callback);
|
|
|
|
|
},
|
|
|
|
|
function() {
|
|
|
|
|
uploader.open(RELATIVE_PATH + '/api/user/uploadcover', { uid: yourid }, 0, function(imageUrlOnServer) {
|
|
|
|
|
components.get('account/cover').css('background-image', 'url(' + imageUrlOnServer + ')');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Account;
|
|
|
|
|
});
|
|
|
|
|