Вход Регистрация
Файл: IPBMafia.ru_IPB_3.4.6_Final_Rus _Nulled/board/upload/public/ipc_blocks/core.js
Строк: 197
<?php
if( typeof(_ccsjQ) == 'undefined' )
{
    var 
_ccsjQ jQuery.noConflict();
}

(function($){
    $.
ccs = {
        
//----------------------------------------------
        // $.ccs.register method; based on jQuery UI
        //----------------------------------------------
        
register: function( widgetbaseobjshort){    
            var 
bits widget.split('.');
            var namespace = 
bits[0];
            var 
name bits[1];

            if( 
obj && !short ){
                
short obj;
                
obj base;
                
base = $.ccsBase;
            } else if( !
obj && !short ){
                
obj base;
                
base = $.ccsBase;
            }

            $[ namespace ] = $[ namespace ] || {};
            
            if( $[ namespace ][ 
name ] ){
                return;
            }

            $[ namespace ][ 
name ] = function( optionselement){
                if( 
arguments.length ){
                    
this._instantiateoptionselement );
                }
            };

            var 
newBase = new base();
            
newBase.options = $.extendtrue, {}, newBase.options );
            $[ namespace ][ 
name ].prototype = $.extendtruenewBaseobj );

            if( !
short ){
                
short = namespace + name;
            }

            $.
ccs.bridgeshort, $[ namespace ][ name ] );
        },

        
//----------------------------------------------
        // $.ccs.bridge method; taken from jQuery UI
        //
        // jQuery UI Widget 1.8.16
        //
        // Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
        // Dual licensed under the MIT or GPL Version 2 licenses.
        // http://jquery.org/license
        //
        // http://docs.jquery.com/UI/Widget
        //----------------------------------------------
        
bridge: function( nameobject ) {
            $.
fnname ] = function( options ) {
                var 
isMethodCall typeof options === "string",
                    
args = Array.prototype.slice.callarguments),
                    
returnValue this;

                
// allow multiple hashes to be passed on init
                
options = !isMethodCall && args.length ?
                    $.
extend.applynull, [ trueoptions ].concat(args) ) :
                    
options;

                
// prevent calls to internal methods
                
if ( isMethodCall && options.charAt) === "_" ) {
                    return 
returnValue;
                }

                if ( 
isMethodCall ) {
                    
this.each(function() {
                        var 
instance = $.datathisname ),
                            
methodValue instance && $.isFunctioninstance[options] ) ?
                                
instanceoptions ].applyinstanceargs ) :
                                
instance;

                        if ( 
methodValue !== instance && methodValue !== undefined ) {
                            
returnValue methodValue;
                            return 
false;
                        }
                    });
                } else {
                    
this.each(function() {
                        var 
instance = $.datathisname );
                        if ( 
instance ) {
                            
instance.optionoptions || {} )._init();
                        } else {
                            $.
datathisname, new objectoptionsthis ) );
                        }
                    });
                }

                return 
returnValue;
            };
        },

        
util: {
            
//----------------------------------------------
            // Fits an image (or other box) inside a bigger box
            //----------------------------------------------
            
fitImage: function( imageDimsboxDims ){
                
                var 
newSize = {},
                    
aspect imageDims['w'] / imageDims['h'];

                if( (
imageDims['w'] <= boxDims['w']) || (imageDims['h'] <= boxDims['h']) ){
                    return {
'w'imageDims['w'], 'h'imageDims['h']};
                }

                
newSize['w'] = boxDims['w'];
                
newSize['h'] = newSize['w'] / aspect;

                if( 
newSize['h'] < boxDims['h'] ){
                    
newSize['h'] = boxDims['h'];
                    
newSize['w'] = newSize['h'] * aspect;
                }

                return { 
                    
'w'newSize['w'],
                    
'h'newSize['h'],
                    
'l'Math.ceil( ( boxDims['w'] - newSize['w'] ) / ),
                    
't'Math.ceil( ( boxDims['h'] - newSize['h'] ) / )
                };
            }
        }
    };

    
//----------------------------------------------
    // Base object for ccs widgets
    //----------------------------------------------
    
$.ccsBase = function( optionselement ){
        if( 
arguments.length ){
            
this._instantiateoptionselement );
        }
    };

    $.
ccsBase.prototype = {
        
name'ccsWidget',
        
options: { },

        
//----------------------------------------------
        // Called when widget is instantiated
        //----------------------------------------------
        
_instantiate: function( optionselement ){
            $.
dataelementthis.namethis );
            
this.element = $(element);
            
this.options = $.extendtrue, {}, this.optionsoptions );
            
this._init();
        },

        
//----------------------------------------------
        // Called after initial setup
        //----------------------------------------------
        
_init: function(){},

        
//----------------------------------------------
        // Getter/setter for options
        //----------------------------------------------
        
option: function( keyvalue )
        {
            if( $.
isPlainObjectkey ) ){
                 
this.options = $.extend(truethis.optionskey);
            } else if( 
key && typeof value === 'undefined' ) {
                return 
this.optionskey ];
            } else {
                
this.optionskey ] = value;
            }

            return 
this;
        }
    };
})(
_ccsjQ);

if( 
typeof(jsDebug) == 'undefined' )
{
    var 
jsDebug false;
}

var 
Debug = {
    
write: function( text ){
        if( 
jsDebug && window.console ){
            
console.logtext );
        }
    },
    
dir: function( values ){
        if( 
jsDebug && window.console ){
            
console.dirvalues );
        }
    }
};
?>
Онлайн: 0
Реклама