Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

+5 -230
View File
@@ -50,82 +50,6 @@ _temp.prototype.members = {
(evt) ? el.dispatchEvent(evt) : (el.click && el.click());
},
changeAvatar: function( e, url )
{
Event.stop(e);
if ( $('m_avatar_popup') )
{
$('m_avatar_popup').remove();
}
acp.members.hideActionMenu();
url = ipb.vars['base_url'] + url + '&secure_key=' + ipb.vars['md5_hash'];
url = url.replace( /&/g, '&' );
var afterInit = function( popup )
{
if( $('avatar_gallery') )
{
$('avatar_gallery').observe('change', acp.members.updateAvatarGallery);
}
};
acp.members.popups['avatar'] = new ipb.Popup('m_avatar', { type: 'pane', modal: false, hideAtStart: false, w: '600px', ajaxURL: url }, { 'afterInit': afterInit } );
},
updateAvatarGallery: function( e )
{
Event.stop(e);
var selected_cat = $F('avatar_gallery');
var url = ipb.vars['base_url'] + "app=forums&module=ajax&section=member_editform&do=get_avatar_images&cat=" + selected_cat + '&secure_key=' + ipb.vars['md5_hash'];
new Ajax.Request( url.replace(/&/g, '&'),
{
method: 'get',
evalJSON: 'force',
onSuccess: function(t)
{
if( Object.isUndefined( t.responseJSON ) )
{
$('avatarGalleryContainer').update( t.responseText ).show();
return;
}
if( t.responseJSON['error'] )
{
alert("Проблема с получением галереи: " + t.responseJSON['error']);
return;
}
if( t.responseJSON['html'] )
{
$('avatarGalleryContainer').update( t.responseJSON['html'] ).show();
}
}
});
},
updateAvatarPreview: function()
{
var cat = $F('avatar_gallery');
var img = $F('avatar_image');
var img_url = ipb.vars['public_avatar_url'] + cat + '/' + img;
if( !$('avatarPreview') )
{
var newimg = new Element( 'img', { 'id': 'avatarPreview', src: img_url });
$('avatarContainer').insert( newimg );
}
else
{
$('avatarPreview').src = img_url;
}
},
newPhoto: function( e, url )
{
Event.stop(e);
@@ -147,46 +71,7 @@ _temp.prototype.members = {
url = ipb.vars['base_url'] + url + '&secure_key=' + ipb.vars['md5_hash'];
url = url.replace( /&/g, '&' );
acp.members.popups['photo'] = new ipb.Popup('m_ban', { type: 'pane', modal: false, hideAtStart: false, w: '600px', h: '600px', ajaxURL: url } );
},
removeAvatar: function( e, member_id )
{
Event.stop(e);
Debug.write("Calling once...");
var url = ipb.vars['base_url'] + "app=forums&module=ajax&section=member_editform&do=remove_avatar&member_id=" + member_id + '&secure_key=' + ipb.vars['md5_hash'];
new Ajax.Request( url.replace( /&/g, '&' ),
{
method: 'get',
evalJSON: 'force',
onSuccess: function(t)
{
if( Object.isUndefined( t.responseJSON ) )
{
Debug.write( t.responseText );
alert("Ошибка: " + t.responseText );
return;
}
if( t.responseJSON['error'] )
{
Debug.write( t.responseJSON['error'] );
alert("Ошибка при удалении аватара: " + t.responseJSON['error']);
return;
}
else
{
try {
$('MF__avatar').remove();
$('MF__avatar_link').remove();
} catch(err) {
Debug.write( err );
}
}
}
});
acp.members.popups['photo'] = new ipb.Popup('m_ban', { type: 'pane', modal: false, hideAtStart: false, w: '600px', h: 500, ajaxURL: url } );
},
removePhoto: function( e, member_id )
@@ -205,14 +90,14 @@ _temp.prototype.members = {
if( Object.isUndefined( t.responseJSON ) )
{
Debug.write( t.responseText );
alert("Ошибка: " + t.responseText );
alert( ipb.lang['templates_servererror'] + t.responseText );
return;
}
if( t.responseJSON['error'] )
{
Debug.write( t.responseJSON['error'] );
alert("Ошибка при удалении аватара: " + t.responseJSON['error']);
alert( ipb.lang['templates_servererror'] + t.responseJSON['error']);
return;
}
else
@@ -222,6 +107,7 @@ _temp.prototype.members = {
$('MF__pp_photo').setStyle( { width: t.responseJSON['pp_main_width'] + 'px' } );
$('MF__pp_photo').setStyle( { height: t.responseJSON['pp_main_height'] + 'px' } );
$('MF__pp_photo_container').setStyle( { width: t.responseJSON['pp_main_width'] + 'px' } );
$('MF__removephoto').remove();
} catch(err) {
Debug.write( err );
}
@@ -239,118 +125,7 @@ _temp.prototype.members = {
url = ipb.vars['base_url'] + url + '&secure_key=' + ipb.vars['md5_hash'];
url = url.replace( /&/g, '&' );
var afterInit = function( popup ){
$( id + '_save' ).observe('click', acp.members.saveField.bindAsEventListener( this, id ) );
//Debug.write("This is the callback");
}.bind(this);
var afterHide = function( popup ){
$( popup.getObj() ).remove();
acp.members.popups[ id ] = null;
}.bind(this);
acp.members.popups[ id ] = new ipb.Popup('m_' + id, { type: 'pane', modal: false, hideAtStart: false, w: '500px', ajaxURL: url }, { 'afterInit': afterInit, 'afterHide': afterHide } );
},
saveField: function( e, id )
{
// Allow "inline form" with normal form submission
// See member password inline form
if( acp.members.fields[ id ]['bypass'] )
{
return true;
}
Event.stop(e);
//firebug.d.console.cmd.dir( acp.members.fields );
var url = acp.members.fields[ id ]['url'];
if( !url ){ alert("Не удалось сохранить; отсутствует url"); return; }
url = ipb.vars['base_url'] + url + '&secure_key=' + ipb.vars['md5_hash'];
url = url.replace( /&/g, '&' );
//-----------------
var fields = acp.members.fields[ id ]['fields'];
var _params = {};
if ( fields.length )
{
for( var i = 0 ; i <= fields.length ; i++ )
{
if( $( fields[i] ) )
{
try
{
if ( $( fields[i] ).type == 'select-multiple' )
{
_params[ fields[i] + '[]' ] = $F( fields[i] );
}
else
{
_params[ fields[i] ] = $F( fields[i] ).encodeParam();
}
}
catch( e )
{
try
{
_params[ fields[i] ] = $F( fields[i] + '_yes' );
}
catch( e ){}
}
}
else if( $( fields[i] + '_yes' ) )
{
try
{
_params[ fields[i] ] = $F( fields[i] + '_yes' );
}
catch( e ){}
}
}
}
// Send request
new Ajax.Request( url, {
method: 'post',
parameters: _params,
evalJSON: 'force',
onSuccess: function(t)
{
if( Object.isUndefined( t.responseJSON ) )
{
alert("Ошибка: " + t.responseJSON);
return;
}
if( !t.responseJSON['success'] )
{
alert("Ошибка: " + t.responseJSON['error'] );
return;
}
else
{
if( acp.members.fields[ id ]['callback'] )
{
acp.members.fields[ id ]['callback']( t, t.responseJSON );
}
acp.members.popups[ id ].hide();
}
Debug.write("Success");
},
onException: function(t){ alert("Ошибка: " + t.responseText); },
onFailure: function(t){ alert("Ошибка: " + t.responseText ); }
} );
acp.members.popups[ id ] = new ipb.Popup('m_' + id, { type: 'pane', modal: false, hideAtStart: false, w: '700px', ajaxURL: url } );
},
hideActionMenu: function()