Вход Регистрация
Файл: IPBMafia.ru_IPB_3.4.6_Final_Rus _Nulled/board/upload/admin/js/acp.js
Строк: 216
<?php
var IPBACP = Class.create({
    
    
autocompleteWrap: new Template("<ul id='#{id}' class='ipbmenu_content' style='width: 250px;'></ul>"),
    
autocompleteItem: new Template("<li id='#{id}'>#{itemvalue}</li>"),
    
autocompleteUrl'',
    
    
    
initialize: function()
    {
        
// Tell everyone we are ready
        
document.observe("dom:loaded", function(){
            
            
Ajax.Responders.register({
              
onLoading: function() {
                if( !$(
'ajax_loading') )
                {
                    if( !
ipb.templates['ajax_loading'] ){ return; }
                    $(
'ipboard_body').insertipb.templates['ajax_loading'] );
                }
                
                var 
effect = new Effect.Appear( $('ajax_loading'), { duration0.2 } );
              },
              
onComplete: function() {
            
                if( !$(
'ajax_loading') ){ return; }
                var 
effect = new Effect.Fade( $('ajax_loading'), { duration0.2 } );
              },
              
onSuccess: function(t){
                if( 
t.responseText == 'logout' )
                {
                    
alertipb.lang['session_timed_out'] );
                    
window.location.href ipb.vars['base_url'];
                }
                
                if( 
t.responseJSON && t.responseJSON['__session__expired__log__out__'] )
                {
                    
alertipb.lang['session_timed_out'] );
                    
window.location.href ipb.vars['base_url'];
                }
              }
            });
            
            
//this.autocompleteUrl = ipb.vars['front_url'] + 'app=core&module=ajax&section=findnames&do=get-member-names&secure_key=' + ipb.vars['md5_hash'] + '&name=';
            
this.autocompleteUrl ipb.vars['base_url'] + 'app=core&module=ajax&section=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 );
            });
            
            
/* License expired notification close */
            
if( $('license-close') )
            {
                $(
'license-close').observe'click', function( elem ) {
                    var 
cookieExpire    = new Date();
                    
cookieExpire.setDatecookieExpire.getDate()+30 );
                    
                    
ipb.Cookie.set'ignore-license-notice'1cookieExpire.toUTCString() );
                    var 
effect = new Effect.Fade( $('license_notice_expired'), { duration0.3afterFinish: function(){
                        $$(
'body')[0].removeClassName('expired_license');
                    } } );
                } );
            }
            
        }.
bind(this));
    },
    
    
/**
     * Sets up handlers for ajaxWithResultAsDialogue with as little intervention as possible
     */
    
ajaxWithResultClickThrough: function( )
    {
        
elem Event.findElement(e).up('.ajaxWithDialogueTrigger');
        
        if ( $(
elem.id) )
        {
            
urlBit = $(elem.id).readAttribute'ajaxUrl' );
            
            if ( 
urlBit )
            {
                
Event.stop(e);
                
ipb.menus.closeAll();
                
                
acp.ajaxWithResultAsDialogueurlBit );
            }
        }
    },
    
    
/**
     * 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( /&amp;/g'&' );
        
        
Debug.writeurl );
            
        
/* Send AJAX request */
        
new Ajax.Requesturl, { method'get',
                                 
evalJSON'force',
                                 
onSuccess: function(t)
                                 {
                                    if ( ! 
t.responseJSON )
                                    {
                                        
acp.errorDialogue'К сожалению, возникла проблема при обработке запроса :(' );
                                    }
                                    if ( 
t.responseJSON['error'] )
                                    {
                                        
acp.errorDialoguet.responseJSON['error'] );
                                    }
                                    else if ( 
t.responseJSON['ok'] )
                                    {
                                        
acp.okDialoguet.responseJSON['ok'] );
                                    }
                                 }
                             } );
    },
    
    
/**
     * Show an error dialogue
     * @param string
     * @returns Nothing
     */
    
errorDialogue: function( text )
    {
        
content "<h3>Ошибка</h3><div class='ajax-inline-error' style='height: 40px; text-align:center'><p class='ipsPad'>" text "</p></div>";
        
        new 
ipb.Popup'generic__errorDialogue', {  type'pane',
                                                    
initialcontent,
                                                    
stemtrue,
                                                    
hideAtStartfalse,
                                                    
hideClosefalse,
                                                    
deferfalse,
                                                    
warningtrue,
                                                    
w400 } );
    },
    
    
/**
     * Show an OK dialogue
     * @param string
     * @returns Nothing
     */
    
okDialogue: function( text )
    {
        
content "<h3>Сообщение</h3><div class='ajax-inline-message' style='height: 40px; text-align:center'><p class='ipsPad'>" text "</p></div>";
        
        new 
ipb.Popup'generic__okDialogue', {  type'pane',
                                                 
initialcontent,
                                                 
stemtrue,
                                                 
hideAtStartfalse,
                                                 
hideClosefalse,
                                                 
deferfalse,
                                                 
w400 } );
    },
    
    
confirmDelete: function( urlmsg )
    {
        
url url.replace( /&amp;/g'&' );
        
        if ( ! 
msg )
        {
            
msg ipb.lang['ok_to_delete'];
        }
        
        if ( 
confirmmsg ) )
        {
            
window.location.href url;
        }
        else
        {
            return 
false;
        }
    },
    
    
openWindow: function( urlwidthheightname )
    {
        if ( ! 
name )
        {
            var 
mydate = new Date();
            
name mydate.getTime();
        }
        
        var 
Win window.openurlname'width='+width+',height='+height ',resizable=1,scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no');
        
        return 
false;
    },
    
    
redirect: function( urlfull )
    {
        
url url.replace( /&amp;/g'&' );
        
        if ( ! 
full )
        {
            
url ipb.vars['base_url'] + url;
        }
        
        
window.location.href url;
    },
    
    
// Todo: language abstraction
    
pageJump: function( url_bittotal_postsper_page )
    {
        
pages 1;
        
cur_st ipb.vars['st'];
        
cur_page  1;
        
        if ( 
total_posts per_page == )
        {
            
pages total_posts per_page;
        }
        else
        {
            
pages Math.ceiltotal_posts per_page );
        }
        
        
msg ipb.lang['page_multijump'] + pages;
        
        if ( 
cur_st )
        {
            
cur_page cur_st per_pagecur_page cur_page -1;
        }
        
        
show_page 1;
        
        if ( 
cur_page pages )
        {
            
show_page cur_page 1;
        }
        
        if ( 
cur_page >= pages )
        {
            
show_page cur_page 1;
        }
        else
        {
            
show_page cur_page 1;
        }
        
        
userPage promptmsgshow_page );
        
        if ( 
userPage 0  )
        {
            if ( 
userPage )     {    userPage 1;  }
            if ( 
userPage pages ) { userPage pages; }
            if ( 
userPage == )    {     start 0;    }
            else { 
start = (userPage 1) * per_page; }

            
window.location url_bit "&st=" start;
        }
    },
    
    
ajaxRefresh: function( urltextaddtotext )
    {
        new 
Ajax.Request(
                            
url '&__notabsave=1',
                            {
                                
method'post',
                                
onSuccess: function( )
                                {
                                    var 
html t.responseText;
            
                                    eval( 
html );
                                },
                                
onFailure: function()
                                {
                                },
                                
onException: function()
                                {
                                }
                            }
                );
        
        if ( 
text )
        {
            
// Put it to the top
            
if ( addtotext )
            {
                $(
'refreshbox').innerHTML text '<br />' + $('refreshbox').innerHTML;
            }
            else
            {
                $(
'refreshbox').innerHTML text;
            }
        }
    },
    
    
location_jump: function( urlfull )
    {
        
url=url.replace( /&amp;/g,'&');
        
        if(
full){
            
window.location.href=url;
        } else {
            
window.location.href=ipb.vars['base_url']+url;
        }
    }
});
?>
Онлайн: 3
Реклама