Вход Регистрация
Файл: IPBMafia.ru_IPB_3.4.6_Final_Rus _Nulled/board/upload/public/js/ips.board.js
Строк: 196
<?php
/************************************************/
/* IPB3 Javascript                                */
/* -------------------------------------------- */
/* ips.board.js - Board index code                */
/* (c) IPS, Inc 2008                            */
/* -------------------------------------------- */
/* Author: Rikki Tissier                        */
/************************************************/

var _idx window.IPBoard;

_idx.prototype.board = {
    
_statusClick0,
    
_statusDefaultValue'',
    
count_sbars0,
    
count_hidden0,
    
    
/*------------------------------*/
    /* Constructor                     */
    
init: function()
    {
        
Debug.write("Initializing ips.board.js");
        
        
document.observe("dom:loaded", function(){
            
ipb.board.setUpForumTables();
            
ipb.board.initSidebar();
            
            
ipb.board._statusDefaultValue = ( $('hookStatusTextField') ) ? $F('hookStatusTextField') : '';
            if( $(
'updateStatusForm') ){
                $(
'updateStatusForm').observe'submit'ipb.board.statusHookSubmit );
            }
        });
    },
    
    
/* ------------------------------ */
    /**
     * Hook: Status update
    */
    
statusHookClick: function()
    {
        if ( ! 
ipb.board._statusClick )
        {
            if( $(
'hookStatusTextField') ){
                $(
'hookStatusTextField').value '';
            }
            
            
ipb.board._statusClick 1;
        }
    },
    
    
/* ------------------------------ */
    /**
     * Hook: Status update
    */
    
statusHookSubmit: function(e)
    {
        
Event.stop(e);
        
        if ( 
ipb.board._statusClick && $F('hookStatusTextField') && $F('hookStatusTextField') != ipb.board._statusDefaultValue )
        { 
            $(
'updateStatusForm').submit();
        }
        else
        {
            return 
false;
        }
    },

    
/* ------------------------------ */
    /**
     * Inits the forum tables ready for collapsing
    */
    
setUpForumTables: function()
    {
        
ipb.delegate.register(".category_block .toggle"ipb.board.toggleCat);
        var 
cookie            ipb.Cookie.get('toggleCats');
        
        if( 
cookie )
        {
            var 
cookies        cookie.split',' );
            var 
newCookies    = new Array();
            var 
resetCookie    false;
                        
            for( var 
abcdefg=0abcdefg cookies.lengthabcdefg++ )
            {
                if( 
cookiesabcdefg ] )
                {
                    if( $( 
'category_' cookiesabcdefg ] ) )
                    {
                        var 
wrapper    = $( 'category_' cookiesabcdefg ] ).down('.table_wrap');
                        
                        
wrapper.hide();
                        $( 
'category_' cookiesabcdefg ] ).addClassName('collapsed');
                        
                        
newCookies.pushcookiesabcdefg ] );
                    }
                    else
                    {
                        
resetCookie    true;
                    }
                }
            }
            
            if( 
resetCookie )
            {
                
ipb.Cookie.set'toggleCats'newCookies.join',' ) );
            }
        }
    },
    
    
/* ------------------------------ */
    /**
     * Show/hide a category
     * 
     * @var        {event}        e    The event
    */
    
toggleCat: function(eelem)
    {
        if( 
ipb.board.animating ){ return false; }
        
        var 
remove $A();
        var 
catname = $( elem ).up('.category_block');
        var 
wrapper = $( catname ).down('.table_wrap');
        $( 
wrapper ).identify(); // IE8 fix
        
var catid catname.id.replace('category_''');
        
        
ipb.board.animating true;

        
// Get cookie
        
var cookie ipb.Cookie.get('toggleCats');
        
        if( 
cookie == null ){
            
cookie $A();
        } else {
            
_cookie cookie.split(',');
            
cookie  $A();
            
            
_cookie.each( function( item )
            {
                if ( 
item )
                {
                    
cookie.pushitem );
                }
            } );
        }
        
        
Effect.togglewrapper'blind', {duration0.4afterFinish: function(){ ipb.board.animating false; } } );
        
Effect.togglewrapper'appear', {duration0.3});
        
        if( 
catname.hasClassName('collapsed') )
        {
            
catname.removeClassName('collapsed');
            
remove.pushcatid );
        }
        else
        {
            new 
Effect.Morph( $(catname), {style'collapsed'duration0.4afterFinish: function(){
                $( 
catname ).addClassName('collapsed');
                
ipb.board.animating false;
            } });
            
            
cookie.pushcatid );
        }

        
/* without not so hot in Chrome */
        
_cookie cookie;
        
cookie  $A();
        
        
_cookie.each( function( item )
        {
            
ok true;
            
            
remove.each( function( ritem )
            {
                if ( 
ritem == item )
                {
                    
ok false;
                }
            } )
            
            if ( 
ok === true )
            {
                
cookie.pushitem );
            }
        } );
            
        
cookie "," cookie.uniq().join(',') + ",";
        
        
ipb.Cookie.set('toggleCats'cookie1);
        
        
Event.stop);
    },
    
    
/* ------------------------------ */
    /**
     * Sets up the sidebar
    */
    
initSidebar: function()
    {
        if( $(
'toggle_sidebar') )
        {
            $(
'toggle_sidebar').on('click'ipb.board.toggleSidebar);
            
            if( $(
'index_stats').visible() ){
                $(
'toggle_sidebar').update( $('toggle_sidebar').readAttribute("data-open") );
            } else {
                $(
'toggle_sidebar').update( $('toggle_sidebar').readAttribute("data-closed") );
            }
        }
        
        
ipb.board.setUpSideBarBlocks();
    },
    
    
toggleSidebar: function(e){
        if( $(
'index_stats').visible() )
        {
            
ipb.Cookie.set('hide_sidebar'11);
            
            new 
Effect.Fade( $('index_stats'), { duration0.4afterFinish: function(){
                new 
Effect.Morph( $('board_index'), { duration0.3style:'no_sidebar' });
            } } );
            
            $(
'toggle_sidebar').update("&laquo;");
        }
        else
        {
            
ipb.Cookie.set('hide_sidebar'01);
            
            new 
Effect.Morph( $('board_index'), { duration0.3style:'force_sidebar'afterFinish: function(){
                new 
Effect.Appear( $('index_stats'), { duration0.4afterFinish: function(){
                    $(
'board_index').removeClassName('no_sidebar').removeClassName('force_sidebar');
                }});
            } } );
            
            $(
'toggle_sidebar').update("&times;");
        }
        
        
Event.stop(e);
    },
    
    
/**
     * Add in collapsable icons
     */
    
setUpSideBarBlocks: function()
    {
        if ( $(
'index_stats') && $('index_stats').visible() )
        {
            $$(
'#index_stats h3').each( function(h3)
            {
                $( 
h3 ).identify();
                
                
ipb.board.count_sbars++;
                
                
/* Set title - fugly 
                   Here we run through escape first to change foreign chars to %xx with xx being latin, and then we remove % after */
                
title escape( $( h3 ).innerHTML.replace( /<(/)?([^>]+?)>/g'' ) ).replace( /%/g'' );
                
title title.replace( / /g'' ).replace( /[^a-zA-Z0-9]/, '' ).toLowerCase();

                $( 
h3 ).up('div').addClassName'__xX' title );
                
                
/* insert the image */
                
$( h3 ).update'<a href="#" class="ipsSidebar_trigger ipsType_smaller right desc mod_links">' ipb.lang['hide'] + '</a>' h3.innerHTML );
            });
            
            
cookie ipb.Cookie.get('toggleSBlocks');
        
            if( 
cookie )
            {
                var 
cookies cookie.split',' );
                
                for( var 
abcdefg=0abcdefg cookies.lengthabcdefg++ )
                {
                    if( 
cookiesabcdefg ] )
                    {
                        var 
top     = $('index_stats').down('.__xX' cookiesabcdefg ] );
                        
                        if ( 
top )
                        {
                            var 
wrapper    top.down('._sbcollapsable');
                            
                            if ( ! 
wrapper )
                            {
                                
wrapper top.down('ul');
                            }
                            
                            if ( ! 
wrapper )
                            {
                                
wrapper top.down('ol');
                            }
                            
                            if ( ! 
wrapper )
                            {
                                
wrapper top.down('div');
                            }
                            
                            if ( ! 
wrapper )
                            {
                                
wrapper top.down('table');
                            }

                            if ( 
wrapper )
                            {
                                if ( 
top.hasClassName('alt') )
                                {
                                    
top._isAlt true;
                                    
top.removeClassName('alt');
                                }
                                
                                
ipb.board.count_hidden++;
                                
top.down('.ipsSidebar_trigger').updateipb.lang['unhide'] );
                                
wrapper.hide();
                            }
                        }
                    }
                }
            }
        }
        
        
ipb.delegate.register(".ipsSidebar_trigger"ipb.board.toggleSideBarBlock);
    },
    
    
/**
     * Toggle the block
     */
    
toggleSideBarBlock: function( eelem )
    {
        
Event.stop(e);
        
elem.identify();
        
        var 
remove $A();
        
cookie ipb.Cookie.get('toggleSBlocks');
        
        if( 
cookie == null ){
            
cookie $A();
        } else {
            
_cookie cookie.split(',');
            
cookie  $A();
            
            
_cookie.each( function( item )
            {
                if ( 
item )
                {
                    
cookie.pushitem );
                }
            } );
        }
        
        
/* Test for known class name */
        
var top   elem.up('div');
        
        
moo   top.className.match('__xX([0-9A-Za-z]+)');
        
topId moo[1]; 
        
        
block top.down('._sbcollapsable');
        
        if ( ! $( 
block ) )
        {
            
block elem.up('div').down('ul');
        }
        
        if ( ! $( 
block ) )
        {
            
block elem.up('div').down('ol');
        }
        
        if ( ! $( 
block ) )
        {
            
block elem.up('div').down('div');
        }
        
        if ( ! $( 
block ) )
        {
            
block elem.up('div').down('table');
        }
        
        if ( $( 
block ) )
        {
            $( 
block ).identify();
            
            
ipb.board.animating true;
            
            if ( $( 
block ).visible() )
            {
                if ( $( 
top ).hasClassName('alt') )
                {
                    $( 
top )._isAlt true;
                    $( 
top ).removeClassName('alt');
                }
                
                
top.down('.ipsSidebar_trigger').updateipb.lang['unhide'] );
                
ipb.board.count_hidden--;
                
Debug.write"Adding " topId );
                
cookie.pushtopId );
            }
            else
            {
                if ( $( 
top )._isAlt )
                {
                    $( 
top ).addClassName('alt');
                }
                
                
top.down('.ipsSidebar_trigger').updateipb.lang['hide'] );
                
                
ipb.board.count_hidden--;
                
                
Debug.write"Removing " topId );
                
remove.pushtopId );
            }
        
            
Effect.toggleblock'blind', {duration0.4afterFinish: function(){ ipb.board.animating false; } } );
        }
        
        
/* without not so hot in Chrome */
        
_cookie cookie;
        
cookie  $A();
        
        
_cookie.each( function( item )
        {
            
ok true;
            
            
remove.each( function( ritem )
            {
                if ( 
ritem == item )
                {
                    
ok false;
                }
            } )
            
            if ( 
ok === true )
            {
                
cookie.pushitem );
            }
        } );
            
        
cookie "," cookie.uniq().join(',') + ",";
        
        
ipb.Cookie.set('toggleSBlocks'cookie1);
    }
};

ipb.board.init();
?>
Онлайн: 2
Реклама