Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
+107
-1
@@ -35,10 +35,116 @@ var IPBACP = Class.create({
|
||||
}
|
||||
});
|
||||
|
||||
this.autocompleteUrl = ipb.vars['front_url'] + 'app=core&module=ajax§ion=findnames&do=get-member-names&secure_key=' + ipb.vars['md5_hash'] + '&name=';
|
||||
//this.autocompleteUrl = ipb.vars['front_url'] + 'app=core&module=ajax§ion=findnames&do=get-member-names&secure_key=' + ipb.vars['md5_hash'] + '&name=';
|
||||
this.autocompleteUrl = ipb.vars['base_url'] + 'app=core&module=ajax§ion=findnames&do=get-member-names&secure_key=' + ipb.vars['md5_hash'] + '&name=';
|
||||
|
||||
/* Check ajax ping dialogues */
|
||||
$$('.ajaxWithDialogueTrigger').each( function( elem ) {
|
||||
elem.identify();
|
||||
elem.observe( 'click', acp.ajaxWithResultClickThrough );
|
||||
})
|
||||
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets up handlers for ajaxWithResultAsDialogue with as little intervention as possible
|
||||
*/
|
||||
ajaxWithResultClickThrough: function( e )
|
||||
{
|
||||
elem = Event.findElement(e).up('.ajaxWithDialogueTrigger');
|
||||
|
||||
if ( $(elem.id) )
|
||||
{
|
||||
urlBit = $(elem.id).readAttribute( 'ajaxUrl' );
|
||||
|
||||
if ( urlBit )
|
||||
{
|
||||
Event.stop(e);
|
||||
ipb.menus.closeAll();
|
||||
|
||||
acp.ajaxWithResultAsDialogue( urlBit );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* AJAX PHP function is expected to return JSON['error'] (msg) or JSON['ok'] (msg)
|
||||
*/
|
||||
ajaxWithResultAsDialogue: function( url )
|
||||
{
|
||||
if ( ! url.match( 'http://') )
|
||||
{
|
||||
url = ipb.vars['base_url'] + url;
|
||||
}
|
||||
|
||||
if ( ! url.match( 'md5check' ) )
|
||||
{
|
||||
url += '&md5check=' + ipb.vars['md5_hash'];
|
||||
}
|
||||
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
Debug.write( url );
|
||||
|
||||
/* Send AJAX request */
|
||||
new Ajax.Request( url, { method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( ! t.responseJSON )
|
||||
{
|
||||
acp.errorDialogue( 'Oops, something has gone wrong. Sadly I am unable to tell you what. :(' );
|
||||
}
|
||||
if ( t.responseJSON['error'] )
|
||||
{
|
||||
acp.errorDialogue( t.responseJSON['error'] );
|
||||
}
|
||||
else if ( t.responseJSON['ok'] )
|
||||
{
|
||||
acp.okDialogue( t.responseJSON['ok'] );
|
||||
}
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Show an error dialogue
|
||||
* @param string
|
||||
* @returns Nothing
|
||||
*/
|
||||
errorDialogue: function( text )
|
||||
{
|
||||
content = "<h3>Error</h3><div class='ajax-inline-error' style='height: 20px; text-align:center'><p>" + text + "</p></div>";
|
||||
|
||||
new ipb.Popup( 'generic__errorDialogue', { type: 'pane',
|
||||
initial: content,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
hideClose: false,
|
||||
defer: false,
|
||||
warning: true,
|
||||
w: 400 } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Show an OK dialogue
|
||||
* @param string
|
||||
* @returns Nothing
|
||||
*/
|
||||
okDialogue: function( text )
|
||||
{
|
||||
content = "<h3>Message</h3><div class='ajax-inline-message' style='height: 20px; text-align:center'><p>" + text + "</p></div>";
|
||||
|
||||
new ipb.Popup( 'generic__okDialogue', { type: 'pane',
|
||||
initial: content,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
hideClose: false,
|
||||
defer: false,
|
||||
w: 400 } );
|
||||
},
|
||||
|
||||
confirmDelete: function( url, msg )
|
||||
{
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
Reference in new issue
Block a user