Вход Регистрация
Файл: Main Website Files/assets/bower_components/datatables-plugins/integration/bootstrap/2/dataTables.bootstrap.js
Строк: 165
<?php
/*! DataTables Bootstrap 2 integration
 * ©2011-2014 SpryMedia Ltd - datatables.net/license
 */

/**
 * DataTables integration for Bootstrap 2. This requires Bootstrap 2 and
 * DataTables 1.10 or newer.
 *
 * This file sets the defaults and adds options to DataTables to style its
 * controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
 * for further information.
 */
(function(windowdocument, $, DataTableundefined){

$.
extendtrueDataTable.defaults, {
    
"dom":
        
"<'row-fluid'<'span6'l><'span6'f>r>" +
        
"<'row-fluid'<'span12't>>" +
        
"<'row-fluid'<'span6'i><'span6'p>>",
    
renderer'bootstrap'
} );


/* Default class modification */
$.extendDataTable.ext.classes, {
    
sWrapper"dataTables_wrapper form-inline dt-bootstrap"
} );


/* Bootstrap paging button renderer */
DataTable.ext.renderer.pageButton.bootstrap = function ( settingshostidxbuttonspagepages ) {
    var 
api     = new DataTable.Apisettings );
    var 
classes settings.oClasses;
    var 
lang    settings.oLanguage.oPaginate;
    var 
btnDisplaybtnClass;

    var 
attach = function( containerbuttons ) {
        var 
iiennodebutton;
        var 
clickHandler = function ( ) {
            
e.preventDefault();
            if ( !$(
e.currentTarget).hasClass('disabled') ) {
                
api.pagee.data.action ).drawfalse );
            }
        };

        for ( 
i=0ien=buttons.length i<ien i++ ) {
            
button buttons[i];

            if ( $.
isArraybutton ) ) {
                
attachcontainerbutton );
            }
            else {
                
btnDisplay '';
                
btnClass '';

                switch ( 
button ) {
                    case 
'ellipsis':
                        
btnDisplay '&hellip;';
                        
btnClass 'disabled';
                        break;

                    case 
'first':
                        
btnDisplay lang.sFirst;
                        
btnClass button + (page ?
                            
'' ' disabled');
                        break;

                    case 
'previous':
                        
btnDisplay lang.sPrevious;
                        
btnClass button + (page ?
                            
'' ' disabled');
                        break;

                    case 
'next':
                        
btnDisplay lang.sNext;
                        
btnClass button + (page pages-?
                            
'' ' disabled');
                        break;

                    case 
'last':
                        
btnDisplay lang.sLast;
                        
btnClass button + (page pages-?
                            
'' ' disabled');
                        break;

                    default:
                        
btnDisplay button 1;
                        
btnClass page === button ?
                            
'active' '';
                        break;
                }

                if ( 
btnDisplay ) {
                    
node = $('<li>', {
                            
'class'classes.sPageButton+' '+btnClass,
                            
'aria-controls'settings.sTableId,
                            
'tabindex'settings.iTabIndex,
                            
'id'idx === && typeof button === 'string' ?
                                
settings.sTableId +'_'button :
                                
null
                        
} )
                        .
append( $('<a>', {
                                
'href''#'
                            
} )
                            .
htmlbtnDisplay )
                        )
                        .
appendTocontainer );

                    
settings.oApi._fnBindAction(
                        
node, {actionbutton}, clickHandler
                    
);
                }
            }
        }
    };

    
attach(
        $(
host).empty().html('<div class="pagination"><ul/></div>').find('ul'),
        
buttons
    
);
};


/*
 * TableTools Bootstrap compatibility
 * Required TableTools 2.1+
 */
if ( DataTable.TableTools ) {
    
// Set the classes that TableTools uses to something suitable for Bootstrap
    
$.extendtrueDataTable.TableTools.classes, {
        
"container""DTTT btn-group",
        
"buttons": {
            
"normal""btn",
            
"disabled""disabled"
        
},
        
"collection": {
            
"container""DTTT_dropdown dropdown-menu",
            
"buttons": {
                
"normal""",
                
"disabled""disabled"
            
}
        },
        
"print": {
            
"info""DTTT_print_info modal"
        
},
        
"select": {
            
"row""active"
        
}
    } );

    
// Have the collection use a bootstrap compatible dropdown
    
$.extendtrueDataTable.TableTools.DEFAULTS.oTags, {
        
"collection": {
            
"container""ul",
            
"button""li",
            
"liner""a"
        
}
    } );
}


})(
windowdocumentjQueryjQuery.fn.dataTable);
?>
Онлайн: 1
Реклама