Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -12,6 +12,7 @@ var _profile = window.IPBoard;
|
||||
_profile.prototype.profile = {
|
||||
activeTab: '',
|
||||
viewingProfile: 0,
|
||||
customization: 0,
|
||||
|
||||
init: function()
|
||||
{
|
||||
@@ -19,6 +20,12 @@ _profile.prototype.profile = {
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.profile.initEvents();
|
||||
|
||||
/* Profile pics */
|
||||
if ( ipb.profile.customization )
|
||||
{
|
||||
ipb.profile.updateBgImage();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -48,13 +55,6 @@ _profile.prototype.profile = {
|
||||
$('dname_history').observe('click', ipb.profile.showDNameHistory );
|
||||
}
|
||||
|
||||
if( $('update_status_form') )
|
||||
{
|
||||
$('update_status_form').hide();
|
||||
$('status_box').insert( { bottom: "<a href='#' id='update_status' title='" + ipb.lang['prof_update_tooltip'] + "'>" + ipb.lang['prof_update_button'] + "</a>" } );
|
||||
$('update_status').observe('click', ipb.profile.initStatusEdit );
|
||||
}
|
||||
|
||||
if( $('view-all-friends') )
|
||||
{
|
||||
$('view-all-friends').observe('click', ipb.profile.retrieveFriends );
|
||||
@@ -64,6 +64,17 @@ _profile.prototype.profile = {
|
||||
/*ipb.delegate.register('.bbc_spoiler_show', ipb.global.toggleSpoiler);*/
|
||||
},
|
||||
|
||||
/**
|
||||
* Resize and set BG image
|
||||
*/
|
||||
updateBgImage: function()
|
||||
{
|
||||
var main = $('main_profile_body');
|
||||
|
||||
$('userBg').setStyle( { 'height': main.getHeight() + 'px' } );
|
||||
|
||||
},
|
||||
|
||||
deleteComment: function(e, elem)
|
||||
{
|
||||
if( !confirm( ipb.lang['delete_confirm'] ) )
|
||||
@@ -91,35 +102,15 @@ _profile.prototype.profile = {
|
||||
onSuccess: function(t)
|
||||
{
|
||||
$('friend_list').innerHTML = t.responseText;
|
||||
Debug.write( t.responseText);
|
||||
/* if we have an opaque bg, make it fit */
|
||||
$('userBg').setStyle( { 'height': $('main_profile_body').getHeight() + 'px' } );
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Shows the text box for updating the users status
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
initStatusEdit: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if( !$('status_holder') ){ return; }
|
||||
|
||||
var old_status = $('status_holder').innerHTML;
|
||||
$('status_holder').insert( { before: ipb.templates['edit_status'] } ).hide();
|
||||
|
||||
$('updated_status').value = old_status.unescapeHTML();
|
||||
$('update_status').hide();
|
||||
|
||||
$('cancel_status').observe('click', ipb.profile.cancelStatus);
|
||||
$('save_status').observe('click', ipb.profile.saveStatus);
|
||||
$('updated_status').observe('keypress', ipb.profile.watchForKeypress);
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Responds to Enter and Esc keys
|
||||
@@ -136,57 +127,7 @@ _profile.prototype.profile = {
|
||||
ipb.profile.cancelStatus( e );
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Saves a users status
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
saveStatus: function(e)
|
||||
{
|
||||
var new_status = $('updated_status').value
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
parameters: {
|
||||
new_status: new_status.encodeParam()
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseJSON['error'] )
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('edit_status').remove();
|
||||
$('status_holder').innerHTML = t.responseJSON['new_status'];
|
||||
$('status_holder').show();
|
||||
$('update_status').show();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Cancels a status edit and puts back the old one
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
cancelStatus: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('edit_status').remove();
|
||||
|
||||
$('status_holder').show();
|
||||
$('update_status').show();
|
||||
},
|
||||
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
@@ -261,6 +202,11 @@ _profile.prototype.profile = {
|
||||
|
||||
saveComment: function(e)
|
||||
{
|
||||
if( DISABLE_AJAX )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !$('comment_text') ){ Event.stop(e); return; }
|
||||
|
||||
// Check for comment
|
||||
@@ -336,7 +282,6 @@ _profile.prototype.profile = {
|
||||
|
||||
changeTabContent: function(e)
|
||||
{
|
||||
|
||||
Event.stop(e);
|
||||
elem = Event.findElement(e, 'li');
|
||||
if( !elem.hasClassName('tab_toggle') || !elem.id ){ return; }
|
||||
@@ -370,6 +315,8 @@ _profile.prototype.profile = {
|
||||
if( t.responseText != 'error' )
|
||||
{
|
||||
newdiv = new Element('div', { 'id': 'tab_' + id } ).hide();
|
||||
newdiv.addClassName( 'tab_' + id.replace( ':', '_' ) );
|
||||
|
||||
newdiv.update( t.responseText );
|
||||
|
||||
$('tab_content').insert( newdiv );
|
||||
@@ -379,8 +326,6 @@ _profile.prototype.profile = {
|
||||
new Effect.BlindDown( $('tab_' + ipb.profile.activeTab), { sync: true } )
|
||||
], { duration: 0.4, afterFinish: function(){ // Re-execute JS for various things in posts
|
||||
ipb.profile.executeJavascript( $( newdiv ) ); } } );
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -392,10 +337,12 @@ _profile.prototype.profile = {
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.write( "Just showing " + ipb.profile.activeTab );
|
||||
new Effect.Parallel( [
|
||||
new Effect.BlindUp( $('tab_' + oldTab), { sync: true } ),
|
||||
new Effect.BlindDown( $('tab_' + ipb.profile.activeTab), { sync: true } )
|
||||
], { duration: 0.4 } );
|
||||
], { duration: 0.4, afterFinish: function(){ // Re-execute JS for various things in posts
|
||||
ipb.profile.executeJavascript( $( 'tab_' + id ) ); } } );
|
||||
}
|
||||
|
||||
$$('.tab_toggle').each( function(otherelem){
|
||||
@@ -403,7 +350,6 @@ _profile.prototype.profile = {
|
||||
});
|
||||
|
||||
$(elem).addClassName('active');
|
||||
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
@@ -416,11 +362,14 @@ _profile.prototype.profile = {
|
||||
{
|
||||
// Image resize
|
||||
ipb.global.findImgs( wrapper );
|
||||
|
||||
|
||||
//Code highlighting
|
||||
//dp.SyntaxHighlighter.HighlightAll('bbcode_code');
|
||||
prettyPrint();
|
||||
|
||||
/* if we have an opaque bg, make it fit */
|
||||
$('userBg').setStyle( { 'height': $('main_profile_body').getHeight() + 'px' } );
|
||||
|
||||
},
|
||||
|
||||
checkCommentLength: function(e)
|
||||
@@ -435,5 +384,6 @@ _profile.prototype.profile = {
|
||||
|
||||
$('char_remain').update( newTotal );
|
||||
}
|
||||
}
|
||||
ipb.profile.init();
|
||||
};
|
||||
|
||||
ipb.profile.init();
|
||||
Reference in new issue
Block a user