Вход Регистрация
Файл: js/script.js
Строк: 317
<?php
var oTable;

$(function(){
    try{
        
// Tooltips
        
$('.hints').tooltip({trigger'hover'});
        $(
'.tips').tooltip({placement'left'});
        $(
'.tip-top').tooltip({placement'top'});
        $(
'.tip-right').tooltip({placement'right'});
        $(
'.tip-bottom').tooltip({placement'bottom'});
        
// Tour tip
        //$('#joyRideTipContent').joyride({'nextButton': false});
    
} catch (e){
        
errorMessage(e);
    }

    
// Drop down menu
    
$('.breadcrumb li').hover(
        function () {
            
//show its submenu
            
$('.submenu'this).slideDown(100);
        },
        function () {
            
//hide its submenu
            
$('.submenu'this).slideUp(100);
        }
    );

    
// Date picker
    
try{
        var 
nowTemp = new Date();
        var 
now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0000);
        $(
'.dpicker').datepicker({
                
format'dd.mm.yyyy',
                
weekStart'1',
                
autoclosetrue,
                
language'ru'
        
});
        $(
'.dpicker').datepicker("setDate" now);
    } catch (
e){
        
errorMessage(e);
    }

    
// Mask input http://digitalbush.com/projects/masked-input-plugin/
    
try{
        $(
"#phone").mask("+9 999 999 9999");
    } catch (
e){
        
errorMessage(e);
    }

    
// Data table js call
    
try{
        
oTable = $('.dynamicTable_one').dataTable({
            
"bPaginate"true,
            
"sPaginationType""two_button",
            
"bLengthChange"false,
            
"bFilter"false,
            
"bSort"true,
            
"bInfo"true,
            
"bAutoWidth"false,
            
"sInfo""Показано с _START_ по _END_ из _TOTAL_ записей",
            
"oLanguage": {
            
"sLengthMenu""Показывать _MENU_ записей на страницу",
            
"sZeroRecords""Ничего не найдено - извините",
            
"sInfo""Показано с _START_ по _END_ из _TOTAL_ записей",
            
"sInfoEmpty""Показано с 0 по 0 из 0 записей",
            
"sInfoFiltered""(выбрано из _MAX_ записей)",
            
"sSearch""Поиск:",
            
"oPaginate": { 
                 
"sFirst""Первая"
                 
"sPrevious""Предыдущая"
                 
"sNext""Следующая"
                 
"sLast""Последняя" 
             
}
            }
        });
    } catch (
e){
        
errorMessage(e);
    }
    try{
        $(
'.dynamicTable_two').dataTable({
            
"bAutoWidth"true,
            
"aaSorting": [[ 0"desc" ]],
            
"bPaginate"true,
            
"sPaginationType""full_numbers",
            
"bLengthChange"true,
            
"bFilter"true,
            
"bSort"true,
            
"bInfo"true,
            
"oLanguage": {
            
"sLengthMenu""Показывать _MENU_ записей на страницу",
            
"sZeroRecords""Ничего не найдено - извините",
            
"sInfo""Показано с _START_ по _END_ из _TOTAL_ записей",
            
"sInfoEmpty""Показано с 0 по 0 из 0 записей",
            
"sInfoFiltered""(выбрано из _MAX_ записей)",
            
"sSearch""Поиск:",
            
"oPaginate": { 
                 
"sFirst""Первая"
                 
"sPrevious""Предыдущая"
                 
"sNext""Следующая"
                 
"sLast""Последняя" 
             
}
            }
        });
    } catch (
e){
        
alert(e);
    }

    
// Uniform selects
    
try{
        $(
".u_select").uniform();
    } catch (
e){
        
errorMessage(e);
    }

    
// iButton call
    
try{
        $(
".chkbox1").iButton({className"on_off"labelOn""labelOff""easing"swing"});
    } catch (
e){
        
errorMessage(e);
    }

    try{
        $(
".chkbox2").iButton({className"enabled_disabled"labelOn"ВКЛ."labelOff"ВЫКЛ."easing"swing"});
    } catch (
e){
        
errorMessage(e);
    }

    try{
        $(
".radio1").iButton({className"on_off"labelOn""labelOff""easing"swing"});
    } catch (
e){
        
errorMessage(e);
    }
    try{
        $(
".radio2").iButton({className"yes_no"labelOn"ON"labelOff"OFF"easing"swing"});
    } catch (
e){
        
errorMessage(e);
    }

    
// Spinner input call
    
try{
        $( 
".decimal" ).spinner({
            
min3,
            
max32,
            
step1,
            
start8
        
});
    } catch (
e){
        
errorMessage(e);
    }
    try{
        $( 
".spinner_list" ).spinner();
    } catch (
e){
        
errorMessage(e);
    }
    try{
        $( 
".currency" ).spinner({currency:'$'});
    } catch (
e){
        
errorMessage(e);
    }

    
// Wizard form
    
try{
        $(
'.wizard').smartWizard({
            
transitionEffect:'slide',
            
labelNext:'Далее'// label for Next button
            
labelPrevious:'Назад'// label for Previous button
            
labelFinish:'Готово',  // label for Finish button        
            
noForwardJumping:false,
            
//onShowStep: function(){alert('Show')},
            
onLeaveStepleaveAStepCallback,
            
ajaxType'POST'            
        
});
    } catch (
e){
        
errorMessage(e);
    }

    function 
leaveAStepCallback(obj){
        var 
step_num obj.attr('rel');
        return 
validateSteps(step_num);
    }

    function 
validateSteps(step)
    {
        var 
isStepValid true;

        if(
step == 1)
        {
            if($(
'#pwd').val() == $('#pwd1').val())
            {
                if(($(
'#pwd').val().length >= 5) || ($('#pwd').val()==""))
                {
                    return 
true;
                }
                else
                {
                    $(
"#pwd").css("border-color""red");
                    $(
"#pwd1").css("border-color""red");
                    $(
'.wizard').smartWizard('showMessage','Длина пароля не должна быть меньше 5ти символов');
                    return 
false;
                }
            }
            else
            {
                $(
"#pwd").css("border-color""red");
                $(
"#pwd1").css("border-color""red");
                $(
'.wizard').smartWizard('showMessage','Пожалуйста проверьте правильность ввода нового пароля и его повторения.');
                return 
false;
            }
        }

        if (
step == 2
        {
            return 
true;
        }

        if (
step == 3)
        {
            return 
true;
        }

        if (
step == 4)
        {
            return 
true;
        }

        return 
false;
    }

    
// BlockSit Js Call Script Starts

    
$(window).load( function() {
        $(
'#bolt-containers').BlocksIt({
            
numOfCol5,
            
offsetX8,
            
offsetY8
        
});
    });

    
//window resize
    
var currentWidth 1100;
    $(
window).resize(function() {
        var 
winWidth = $(window).width();
        var 
conWidth;
        if(
winWidth 660) {
            
conWidth 440;
            
col 2
        
} else if(winWidth 880) {
            
conWidth 630;
            
col 3
        
} else if(winWidth 1100) {
            
conWidth 860;
            
col 4;
        } else {
            
conWidth 1100;
            
col 5;
        }

        if(
conWidth != currentWidth) {
            
currentWidth conWidth;
            $(
'#bolt-containers').width(conWidth);
            $(
'#bolt-containers').BlocksIt({
                
numOfColcol,
                
offsetX8,
                
offsetY8
            
});
        }
    });

    
// BlockSit Js Call Script Ends

    // Responsiveness

    
responsiveWindow();

    function 
errorMessage(e){
        
//console.log(e);
    
}

    if ($.
browser.msie  && parseInt($.browser.version10) === 8) {
        
ie8();
    }
});

// Search box toggle
$('.user_search').on('click', function(){
    $(
'.search').toggle();
    $(
'.search > .search_form').toggleClass('visible');
});

$(
'.menuDrop').on('click', function(){
    if($(
'.search > .search_form').hasClass('visible')){
        $(
'.search_form').removeClass('visible');
        $(
'.search').css({display'none'});
    }
});

// Show all js
$(".list_expand a").on('click', function(e){
    
e.preventDefault();
    
e.stopPropagation();
    var 
elem = $(this).parents('li');
    
elem.find('.list .list_expand').html('<img src="img/loading.gif" alt="Loading...">');
    
setTimeout(function() {
        
elem.find('.list .list_expand').parent().hide();
        
elem.find('.list_hidden').removeClass('list_hidden');
    }, 
500);
});

// Form drop menu js fix
$(document).mouseup(function(e) {
    if(
jQuery(e.target).parents().index() < || jQuery(e.target).parents().index() > 6){
        $(
'.search_form').removeClass('visible');
        $(
'.search').hide();
    }
});


// Text area counter
$('.counter').keyup(function(){
    var 
max = $(this).data('limit'),
        
len = $(this).val().length;

    if (
len >= max) {
        $(
this).val($(this).val().substring(0max));
        $(
'.counter_info').text('You have reached the limit');
    }else {
        var 
char max len;
        $(
'.counter_info').textchar ' characters left');
    }
});

// Check or un-check all checkboxes
$('.selectAll').on('click', function() {
    var 
$this = $(this);
    
//console.log($(this).parents('.widget_header').next('.widget_content').find('input:checkbox').attr('checked', $(this).is(':checked')));
    
$this.parents('.widget_header').next('.widget_content').find('input:checkbox').attr('checked'$this.is(':checked'));
    if(
$this.is(':checked')){
        
$this.parents('.widget_header').next('.widget_content').find('input:checkbox').attr('checked'$this.is(':checked')).parent().addClass('checked');
    }else{
        
$this.parents('.widget_header').next('.widget_content').find('input:checkbox').attr('checked'$this.is(':checked')).parent().removeClass('checked');
    }
});

/* Widget hover event */
// show arrow image in the right side of the title upon hover
jQuery('.collapsible').hover(function(){
    var 
= $(this).children('h3').outerWidth(true)+5;
    
jQuery(this).prepend('<span class="collapse-widget" style="left: '+w+'px">&nbsp;&nbsp;</span>');
}, function(){
    
jQuery(this).children('.collapse-widget').remove()
});


//show/hide widget content when widget title is clicked
jQuery('.collapsible').click(function(){
    if(
jQuery(this).next().is(':visible')) {
        
jQuery(this).next().slideUp('fast');
    } else {
        
jQuery(this).next().slideDown('fast');
    }
});

// Responsive js
jQuery(window).load(function(){
    
responsiveWindow();
});

//screen resize
jQuery(window).resize(function(){
    
responsiveWindow();
});

function 
responsiveWindow(){
    if(
jQuery(this).width() < 600 || jQuery(this).width() <= 1152) {
        
jQuery('.sidebar_navigation ul li a > span').css({visibility'hidden'});
        
jQuery('.sidebar_navigation ul li').css({height'55px'});
    }else if(
jQuery(this).width() > 1152){
        
jQuery('.sidebar_navigation ul li a > span').css({visibility'visible'});
        
jQuery('.sidebar_navigation ul li').css({height'auto'});
    }
}

function 
ie8(){
    $(
".header_wrapper .user_nav > li:first-child").css({borderLeft'none'});
    $(
".header_wrapper .user_nav > li:first-child, .header_wrapper .user_nav > li:last-child").css({height'38px'padding0});
    $(
".header_wrapper .user_nav > li:last-child").css({borderRight:"none"});
}
?>
Онлайн: 1
Реклама