Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -27,6 +27,17 @@ _quickpm.prototype.quickpm = {
|
||||
},
|
||||
launchPMform: function(e, target)
|
||||
{
|
||||
if( DISABLE_AJAX ){
|
||||
return false;
|
||||
}
|
||||
|
||||
// If user is holding ctrl or command, just submit since they
|
||||
// want to open a new tab (requested by Luke)
|
||||
if( e.ctrlKey == true || e.metaKey == true || e.keyCode == 91 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Debug.write("Launching PM form");
|
||||
pmInfo = target.id.match( /pm_([0-9a-z]+)_([0-9]+)/ );
|
||||
|
||||
@@ -95,8 +106,9 @@ _quickpm.prototype.quickpm = {
|
||||
popup.show();
|
||||
|
||||
// Time to attach events
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].observe('click', ipb.quickpm.doSend) }
|
||||
if( $( popup.getObj() ).select('.cancel')[0] ){ $( popup.getObj() ).select('.cancel')[0].observe('click', ipb.quickpm.cancelForm) }
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].observe('click', ipb.quickpm.doSend); }
|
||||
if( $( popup.getObj() ).select('.use_full')[0] ){ $( popup.getObj() ).select('.use_full')[0].observe('click', ipb.quickpm.useFull); }
|
||||
if( $( popup.getObj() ).select('.cancel')[0] ){ $( popup.getObj() ).select('.cancel')[0].observe('click', ipb.quickpm.cancelForm); }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -113,6 +125,32 @@ _quickpm.prototype.quickpm = {
|
||||
|
||||
Event.stop(e);
|
||||
},
|
||||
useFull: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
// Build a new form
|
||||
var form = new Element('form', {
|
||||
'method': 'post',
|
||||
'action': ipb.vars['base_url'] + '&app=members&module=messaging§ion=send&do=form&preview=1&_from=quickPM&fromMemberID=' + ipb.quickpm.sendingToUser
|
||||
});
|
||||
var post = new Element('textarea', {
|
||||
'name': 'Post'
|
||||
});
|
||||
var subject = new Element('input', {
|
||||
'type': 'text',
|
||||
'value': $F('pm_subject_' + ipb.quickpm.sendingToUser),
|
||||
'name': 'msg_title'
|
||||
});
|
||||
|
||||
var val = $F('pm_textarea_' + ipb.quickpm.sendingToUser).replace( /<script/ig, '< script' ).replace( /<\/script/ig, '< /script' );
|
||||
|
||||
$( form ).insert( post ).insert( subject ).setStyle('position: absolute; left: -500px; top: 0');
|
||||
$( post ).update( val );
|
||||
$$('body')[0].insert( form );
|
||||
$( form ).submit();
|
||||
|
||||
},
|
||||
doSend: function(e)
|
||||
{
|
||||
Debug.write( "Sending" );
|
||||
@@ -133,7 +171,7 @@ _quickpm.prototype.quickpm = {
|
||||
|
||||
// Disable submit
|
||||
var popup = ipb.quickpm.popupObj;
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].disabled = true };
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].disabled = true; };
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + '&app=members&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=messenger&do=PMSend&toMemberID=' + ipb.quickpm.sendingToUser,
|
||||
{
|
||||
@@ -169,7 +207,7 @@ _quickpm.prototype.quickpm = {
|
||||
else if ( t.responseJSON['inlineError'] )
|
||||
{
|
||||
ipb.quickpm.showError( t.responseJSON['inlineError'] );
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].disabled = false };
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].disabled = false; };
|
||||
return;
|
||||
}
|
||||
else if( t.responseJSON['status'] )
|
||||
@@ -207,7 +245,7 @@ _quickpm.prototype.quickpm = {
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
ipb.quickpm.init();
|
||||
}
|
||||
};
|
||||
|
||||
ipb.quickpm.init();
|
||||
Reference in new issue
Block a user