Вход Регистрация
Файл: module-assets/admin/js/main.js
Строк: 768
<?php
$(function() {

    $(
'a[rel=tooltip]').tooltip();

    
// make code pretty
    
window.prettyPrint && prettyPrint();

    
/*----------- BEGIN TABLESORTER CODE -------------------------*/
    /* required jquery.tablesorter.min.js*/
    
$(".sortableTable").tablesorter();
    
/*----------- END TABLESORTER CODE -------------------------*/

    
    
    
$('.minimize-box').on('click', function(e){
        
e.preventDefault();
        var 
$icon = $(this).children('i');
        if(
$icon.hasClass('icon-chevron-down')) {
            
$icon.removeClass('icon-chevron-down').addClass('icon-chevron-up');
        } else if(
$icon.hasClass('icon-chevron-up')) {
            
$icon.removeClass('icon-chevron-up').addClass('icon-chevron-down');
        }
    });
    $(
'.minimize-box').on('click', function(e){
        
e.preventDefault();
        var 
$icon = $(this).children('i');
        if(
$icon.hasClass('icon-minus')) {
            
$icon.removeClass('icon-minus').addClass('icon-plus');
        } else if(
$icon.hasClass('icon-plus')) {
            
$icon.removeClass('icon-plus').addClass('icon-minus');
        }
    });

    $(
'.close-box').click(function() {
        $(
this).closest('.box').hide('slow');
    });

    $(
'#changeSidebarPos').on('click', function(e) {
        $(
'body').toggleClass('hide-sidebar');
    });
});



/*--------------------------------------------------------
 BEGIN DASHBOARD SCRIPTS
 ---------------------------------------------------------*/
function dashboard() {

    
/*----------- BEGIN SPARKLINE CODE -------------------------*/
    /* required jquery.sparkline.min.js*/

    /** This code runs when everything has been loaded on the page */
    /* Inline sparklines take their values from the contents of the tag */
    
$('.inlinesparkline').sparkline();

    
/* Sparklines can also take their values from the first argument
     passed to the sparkline() function */
    
var myvalues = [10857441];
    $(
'.dynamicsparkline').sparkline(myvalues);

    
/* The second argument gives options such as chart type */
    
$('.dynamicbar').sparkline(myvalues, {type'bar'barColor'green'});

    
/* Use 'html' instead of an array of values to pass options
     to a sparkline with data in the tag */
    
$('.inlinebar').sparkline('html', {type'bar'barColor'red'});


    $(
".sparkline.bar_week").sparkline([56720, -4, -24], {
        
type'bar',
        
height'40',
        
barWidth5,
        
barColor'#4d6189',
        
negBarColor'#a20051'
    
});

    $(
".sparkline.line_day").sparkline([567995466467], {
        
type'line',
        
height'40',
        
drawNormalOnTopfalse
    
});

    $(
".sparkline.pie_week").sparkline([112], {
        
type'pie',
        
width'40',
        
height'40'
    
});

    $(
'.sparkline.stacked_month').sparkline(['0:2''2:4''4:2''4:1'], {
        
type'bar',
        
height'40',
        
barWidth10,
        
barColor'#4d6189',
        
negBarColor'#a20051'
    
});
    
/*----------- END SPARKLINE CODE -------------------------*/


    /*----------- BEGIN FULLCALENDAR CODE -------------------------*/

    
if (jQuery().fullCalendar) {
        var 
date = new Date();
        var 
date.getDate();
        var 
date.getMonth();
        var 
date.getFullYear();

        var 
calendar = $('#calendar').fullCalendar({
            
header: {
                
left'prev,today,next,',
                
center'title',
                
right'month,agendaWeek,agendaDay'
            
},
            
selectabletrue,
            
selectHelpertrue,
            
select: function(startendallDay) {
                var 
title prompt('Event Title:');
                if (
title) {
                    
calendar.fullCalendar('renderEvent',
                            {
                                
titletitle,
                                
startstart,
                                
endend,
                                
allDayallDay
                            
},
                    
true // make the event "stick"
                            
);
                }
                
calendar.fullCalendar('unselect');
            },
            
editabletrue,
            
events: [
                {
                    
title'All Day Event',
                    
start: new Date(ym1),
                    
className'label label-success'
                
},
                {
                    
title'Long Event',
                    
start: new Date(ym5),
                    
end: new Date(ym2),
                    
className'label label-info'
                
},
                {
                    
id999,
                    
title'Repeating Event',
                    
start: new Date(ym3160),
                    
allDayfalse,
                    
className'label label-warning'
                
},
                {
                    
id999,
                    
title'Repeating Event',
                    
start: new Date(ym4160),
                    
allDayfalse,
                    
className'label label-inverse'
                
},
                {
                    
title'Meeting',
                    
start: new Date(ymd1030),
                    
allDayfalse,
                    
className'label label-important'
                
},
                {
                    
title'Lunch',
                    
start: new Date(ymd120),
                    
end: new Date(ymd140),
                    
allDayfalse
                
},
                {
                    
title'Birthday Party',
                    
start: new Date(ym1190),
                    
end: new Date(ym12230),
                    
allDayfalse
                
},
                {
                    
title'Click for Google',
                    
start: new Date(ym28),
                    
end: new Date(ym29),
                    
url'http://google.com/'
                
}
            ]
        });
    } else {
        
console.log('could not load fullcalendar.min.js');
    }
    
/*----------- END FULLCALENDAR CODE -------------------------*/



    /*----------- BEGIN CHART CODE -------------------------*/
    
var sin = [], cos = [];
    for (var 
014+= 0.5) {
        
sin.push([iMath.sin(i)]);
        
cos.push([iMath.cos(i)]);
    }

    var 
plot = $.plot($("#trigo"),
            [
                {
                    
datasin,
                    
label"sin(x)",
                    
points: {
                        
fillColor"#4572A7",
                        
size5
                    
},
                    
color'#4572A7'
                
},
                {
                    
datacos,
                    
label"cos(x)",
                    
points: {
                        
fillColor"#333",
                        
size35
                    
},
                    
color'#AA4643'
                
}
            ], {
        
series: {
            
lines: {
                
showtrue
            
},
            
points: {
                
showtrue
            
}
        },
        
grid: {
            
hoverabletrue,
            
clickabletrue
        
},
        
yaxis: {
            
min: -1.2,
            
max1.2
        
}
    });

    function 
showTooltip(xycontents) {
        $(
'<div id="tooltip">' contents '</div>').css({
            
position'absolute',
            
display'none',
            
top5,
            
left5,
            
border'1px solid #fdd',
            
padding'2px',
            
'background-color''#000',
            
color'#fff'
        
}).appendTo("body").fadeIn(200);
    }

    var 
previousPoint null;
    $(
"#trigo").bind("plothover", function(eventpositem) {
        $(
"#x").text(pos.x.toFixed(2));
        $(
"#y").text(pos.y.toFixed(2));

        if (
item) {
            if (
previousPoint != item.dataIndex) {
                
previousPoint item.dataIndex;

                $(
"#tooltip").remove();
                var 
item.datapoint[0].toFixed(2),
                        
item.datapoint[1].toFixed(2);

                
showTooltip(item.pageXitem.pageY,
                        
item.series.label " of " " = " y);
            }
        }
        else {
            $(
"#tooltip").remove();
            
previousPoint null;
        }
    });
    
/*----------- END CHART CODE -------------------------*/


}
/*--------------------------------------------------------
 END DASHBOARD SCRIPTS
 ---------------------------------------------------------*/


/*--------------------------------------------------------
 BEGIN PROGRESS.HTML SCRIPTS
 ---------------------------------------------------------*/

function progRess() {
    
/* required bootstrap-progressbar.min.js*/
    
        
$('.progress .bar.text-no').progressbar();
        $(
'.progress .bar.text-filled').progressbar({
            
display_text1
        
});
        $(
'.progress .bar.text-centered').progressbar({
            
display_text2
        
});
}
/*--------------------------------------------------------
 END PROGRESS.HTML SCRIPTS
 ---------------------------------------------------------*/

/*--------------------------------------------------------
 BEGIN CALENDAR.HTML SCRIPTS
 ---------------------------------------------------------*/
function metisCalendar() {
    if (!
jQuery.fullCalendar) {
        return;
    }

    var 
date = new Date();
    var 
date.getDate();
    var 
date.getMonth();
    var 
date.getFullYear();

    var 
hdr = {};

    if ($(
window).width() <= 767) {
        
hdr = {
            
left'title',
            
center'',
            
right'prev,today,month,agendaWeek,agendaDay,next'
        
}
    } else {
        
hdr = {
            
left'',
            
center'title',
            
right'prev,today,month,agendaWeek,agendaDay,next'
        
}
    }

    var 
initDrag = function(e) {
        
// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
        // it doesn't need to have a start or end



        
var eventObject = {
            
title: $.trim(e.text()), // use the element's text as the event title

            
className: $.trim(e.children('span').attr('class')) // use the element's children as the event class
        
};
        
// store the Event Object in the DOM element so we can get to it later
        
e.data('eventObject'eventObject);

        
// make the event draggable using jQuery UI
        
e.draggable({
            
zIndex999,
            
reverttrue// will cause the event to go back to its
            
revertDuration0  //  original position after the drag
        
});
    }

    var 
addEvent = function(titlepriority) {
        
title title.length == "Untitled Event" title;

        
priority priority.length == "label" priority;

        var 
html = $('<li class="external-event"><span class="' priority '">' title '</span></li>');

        
jQuery('#external-events').append(html);
        
initDrag(html);
    }

    
/* initialize the external events
     -----------------------------------------------------------------*/

    
$('#external-events li.external-event').each(function() {
        
initDrag($(this));
    });

    $(
'#add-event').click(function() {
        var 
title = $('#title').val();
        var 
priority = $('input:radio[name=priority]:checked').val();

        
addEvent(titlepriority);
    });
    
/* initialize the calendar
     -----------------------------------------------------------------*/

    
$('#calendar').fullCalendar({
        
headerhdr,
        
buttonText: {
            
prev'<i class="icon-chevron-left"></i>',
            
next'<i class="icon-chevron-right"></i>'
        
},
        
editabletrue,
        
droppabletrue// this allows things to be dropped onto the calendar !!!
        
drop: function(dateallDay) { // this function is called when something is dropped

            // retrieve the dropped element's stored Event Object
            
var originalEventObject = $(this).data('eventObject');

            
// we need to copy it, so that multiple events don't have a reference to the same object
            
var copiedEventObject = $.extend({}, originalEventObject);

            
// assign it the date that was reported
            
copiedEventObject.start date;
            
copiedEventObject.allDay allDay;

            
// render the event on the calendar
            // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
            
$('#calendar').fullCalendar('renderEvent'copiedEventObjecttrue);


            
// is the "remove after drop" checkbox checked?
            
if ($('#drop-remove').is(':checked')) {
                
// if so, remove the element from the "Draggable Events" list
                
$(this).remove();
            }

        },
        
windowResize: function(eventui) {
            $(
'#calendar').fullCalendar('render');
        }
    });
}

/*--------------------------------------------------------
 END CALENDAR.HTML SCRIPTS
 ---------------------------------------------------------*/

/*--------------------------------------------------------
 BEGIN FORM-GENERAL.HTML SCRIPTS
 ---------------------------------------------------------*/
function formGeneral() {

    $(
'.with-tooltip').tooltip({
        
selector".input-tooltip"
    
});

    
/*----------- BEGIN autosize CODE -------------------------*/
    
$('#autosize').autosize();
    
/*----------- END autosize CODE -------------------------*/

    /*----------- BEGIN inputlimiter CODE -------------------------*/
    
$('#limiter').inputlimiter({
        
limit140,
        
remText'You only have %n character%s remaining...',
        
limitText'You're allowed to input %n character%s into this field.'
    });
    /*----------- END inputlimiter CODE -------------------------*/

    /*----------- BEGIN tagsInput CODE -------------------------*/
    $('
#tags').tagsInput();
    /*----------- END tagsInput CODE -------------------------*/

    /*----------- BEGIN chosen CODE -------------------------*/

    
$(".chzn-select").chosen();
    $(
".chzn-select-deselect").chosen({
        
allow_single_deselecttrue
    
});
    
/*----------- END chosen CODE -------------------------*/

    /*----------- BEGIN spinner CODE -------------------------*/

    
$('#spin1').spinner();
    $(
"#spin2").spinner({
        
step0.01,
        
numberFormat"n"
    
});
    $(
"#spin3").spinner({
        
culture'en-US',
        
min5,
        
max2500,
        
step25,
        
start1000,
        
numberFormat"C"
    
});
    
/*----------- END spinner CODE -------------------------*/

    /*----------- BEGIN uniform CODE -------------------------*/
    
$('.uniform').uniform();
    
/*----------- END uniform CODE -------------------------*/

    /*----------- BEGIN validVal CODE -------------------------*/
    
$('#validVal').validVal();
    
/*----------- END validVal CODE -------------------------*/

    /*----------- BEGIN colorpicker CODE -------------------------*/
    
$('#cp1').colorpicker({
        
format'hex'
    
});
    $(
'#cp2').colorpicker();
    $(
'#cp3').colorpicker();
    $(
'#cp4').colorpicker().on('changeColor', function(ev) {
        $(
'#colorPickerBlock').css('background-color'ev.color.toHex());
    });
    
/*----------- END colorpicker CODE -------------------------*/

    /*----------- BEGIN datepicker CODE -------------------------*/
    
$('#dp1').datepicker({
        
format'mm-dd-yyyy'
    
});
    $(
'#dp2').datepicker();
    $(
'#dp3').datepicker();
    $(
'#dp3').datepicker();
    $(
'#dpYears').datepicker();
    $(
'#dpMonths').datepicker();


    var 
startDate = new Date(2012120);
    var 
endDate = new Date(2012125);
    $(
'#dp4').datepicker()
            .
on('changeDate', function(ev) {
        if (
ev.date.valueOf() > endDate.valueOf()) {
            $(
'#alert').show().find('strong').text('The start date can not be greater then the end date');
        } else {
            $(
'#alert').hide();
            
startDate = new Date(ev.date);
            $(
'#startDate').text($('#dp4').data('date'));
        }
        $(
'#dp4').datepicker('hide');
    });
    $(
'#dp5').datepicker()
            .
on('changeDate', function(ev) {
        if (
ev.date.valueOf() < startDate.valueOf()) {
            $(
'#alert').show().find('strong').text('The end date can not be less then the start date');
        } else {
            $(
'#alert').hide();
            
endDate = new Date(ev.date);
            $(
'#endDate').text($('#dp5').data('date'));
        }
        $(
'#dp5').datepicker('hide');
    });
    
/*----------- END datepicker CODE -------------------------*/

    /*----------- BEGIN daterangepicker CODE -------------------------*/
    
$('#reservation').daterangepicker();

    $(
'#reportrange').daterangepicker(
            {
                
ranges: {
                    
'Today': ['today''today'],
                    
'Yesterday': ['yesterday''yesterday'],
                    
'Last 7 Days': [Date.today().add({days: -6}), 'today'],
                    
'Last 30 Days': [Date.today().add({days: -29}), 'today'],
                    
'This Month': [Date.today().moveToFirstDayOfMonth(), Date.today().moveToLastDayOfMonth()],
                    
'Last Month': [Date.today().moveToFirstDayOfMonth().add({months: -1}), Date.today().moveToFirstDayOfMonth().add({days: -1})]
                }
            },
    function(
startend) {
        $(
'#reportrange span').html(start.toString('MMMM d, yyyy') + ' - ' end.toString('MMMM d, yyyy'));
    });
    
/*----------- END daterangepicker CODE -------------------------*/

    /*----------- BEGIN timepicker CODE -------------------------*/
    
$('.timepicker-default').timepicker();

    $(
'.timepicker-24').timepicker({
        
minuteStep1,
        
showSecondstrue,
        
showMeridianfalse
    
});
    
/*----------- END timepicker CODE -------------------------*/

    /*----------- BEGIN toggleButtons CODE -------------------------*/
    
$('#normal-toggle-button').toggleButtons();

    $(
'#callback-toggle-button').toggleButtons({
        
onChange: function($elstatuse) {
            
console.log($elstatuse);
            $(
'#magic-text').text("Status is: " status);
        }
    });
    $(
'#text-toggle-button').toggleButtons({
        
width220,
        
label: {
            
enabled"Metis",
            
disabled"Admin"
        
}
    });
    $(
'#danger-toggle-button').toggleButtons({
        
style: {
            
// Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
            
enabled"danger",
            
disabled"info"
        
}
    });
    
/*----------- END toggleButtons CODE -------------------------*/

    /*----------- BEGIN dualListBox CODE -------------------------*/
    
$.configureBoxes();
    
/*----------- END dualListBox CODE -------------------------*/
}
/*--------------------------------------------------------
 END FORM-GENERAL.HTML SCRIPTS
 ---------------------------------------------------------*/

/*--------------------------------------------------------
 BEGIN FORM-VALIDATION.HTML SCRIPTS
 ---------------------------------------------------------*/

function formValidation() {
    
/*----------- BEGIN validationEngine CODE -------------------------*/
    
$('#popup-validation').validationEngine();
    
/*----------- END validationEngine CODE -------------------------*/

    /*----------- BEGIN validate CODE -------------------------*/
    
$('#inline-validate').validate({
        
rules: {
            
required"required",
            
email: {
                
requiredtrue,
                
emailtrue
            
},
            
date: {
                
requiredtrue,
                
datetrue
            
},
            
url: {
                
requiredtrue,
                
urltrue
            
},
            
password: {
                
requiredtrue,
                
minlength5
            
},
            
confirm_password: {
                
requiredtrue,
                
minlength5,
                
equalTo"#password"
            
},
            
agree"required",
            
minsize: {
                
requiredtrue,
                
minlength3
            
},
            
maxsize: {
                
requiredtrue,
                
maxlength6
            
},
            
minNum: {
                
requiredtrue,
                
min3
            
},
            
maxNum: {
                
requiredtrue,
                
max16
            
}
        },
        
errorClass'help-inline',
        
errorElement'span',
        
highlight: function(elementerrorClassvalidClass) {
            $(
element).parents('.control-group').removeClass('success').addClass('error');
        },
        
unhighlight: function(elementerrorClassvalidClass) {
            $(
element).parents('.control-group').removeClass('error').addClass('success');
        }
    });


    $(
'#block-validate').validate({
        
rules: {
            
required2"required",
            
email2: {
                
requiredtrue,
                
emailtrue
            
},
            
date2: {
                
requiredtrue,
                
datetrue
            
},
            
url2: {
                
requiredtrue,
                
urltrue
            
},
            
password2: {
                
requiredtrue,
                
minlength5
            
},
            
confirm_password2: {
                
requiredtrue,
                
minlength5,
                
equalTo"#password2"
            
},
            
agree2"required",
            
digits: {
                
requiredtrue,
                
digitstrue
            
},
            
range: {
                
requiredtrue,
                
range: [516]
            }
        },
        
errorClass'help-block',
        
errorElement'span',
        
highlight: function(elementerrorClassvalidClass) {
            $(
element).parents('.control-group').removeClass('success').addClass('error');
        },
        
unhighlight: function(elementerrorClassvalidClass) {
            $(
element).parents('.control-group').removeClass('error').addClass('success');
        }
    });
    
/*----------- END validate CODE -------------------------*/
}

/*--------------------------------------------------------
 END FORM-VALIDATION.HTML SCRIPTS
 ---------------------------------------------------------*/

/*--------------------------------------------------------
 BEGIN FORM-WYSIWYG.HTML SCRIPTS
 ---------------------------------------------------------*/
function formWysiwyg() {

    
/*----------- BEGIN wysihtml5 CODE -------------------------*/
    
$('#wysihtml5').wysihtml5();
    
/*----------- END wysihtml5 CODE -------------------------*/

    /*----------- BEGIN Markdown.Editor CODE -------------------------*/
    
var converter Markdown.getSanitizingConverter();
    var 
editor = new Markdown.Editor(converter);
    
editor.run();
    
/*----------- END Markdown.Editor CODE -------------------------*/

    /*----------- BEGIN cleditor CODE -------------------------*/
    
editor = $("#cleditor").cleditor({width"100%"height"100%"})[0].focus();
    $(
window).resize();

    $(
window).resize(function() {
        var 
$win = $('#cleditorDiv');
        $(
"#cleditor").width($win.width() - 24).height($win.height() - 24).offset({
            
left15,
            
top15
        
});
        
editor.refresh();
    });
    
/*----------- END cleditor CODE -------------------------*/

}
/*--------------------------------------------------------
 END FORM-WYSIWYG.HTML SCRIPTS
 ---------------------------------------------------------*/

/*--------------------------------------------------------
 BEGIN FORM-WIZARD.HTML SCRIPTS
 ---------------------------------------------------------*/

function formWizard() {

    
/*----------- BEGIN uniform CODE -------------------------*/
    
$('#fileUpload').uniform();
    
/*----------- END uniform CODE -------------------------*/

    /*----------- BEGIN plupload CODE -------------------------*/
    
$("#uploader").pluploadQueue({
        
runtimes'html5,html4',
        
url'form-wysiwyg.html',
        
max_file_size'128kb',
        
unique_namestrue,
        
filters: [
            {
                
title"Image files",
                
extensions"jpg,gif,png"
            
}
        ]
    });
    
/*----------- END plupload CODE -------------------------*/

    /*----------- BEGIN formwizard CODE -------------------------*/
    
$("#wizardForm").formwizard({
        
formPluginEnabledtrue,
        
validationEnabledtrue,
        
focusFirstInputtrue,
        
formOptions: {
            
beforeSubmit: function(data) {
                $.
gritter.add({
                    
// (string | mandatory) the heading of the notification
                    
title'data sent to the server',
                    
// (string | mandatory) the text inside the notification
                    
text: $.param(data),
                    
stickyfalse
                
});

                return 
false;
            },
            
dataType'json',
            
resetFormtrue
        
},
        
validationOptions: {
            
rules: {
                
server_host"required",
                
server_name"required",
                
server_user"required",
                
server_password"required",
                
table_prefix"required",
                
table_collation"required",
                
username: {
                    
requiredtrue,
                    
minlength3
                
},
                
usermail: {
                    
requiredtrue,
                    
emailtrue
                
},
                
pass: {
                    
requiredtrue,
                    
minlength6
                
},
                
pass2: {
                    
requiredtrue,
                    
minlength6,
                    
equalTo"#pass"
                
}
            },
            
errorClass'help-inline',
            
errorElement'span',
            
highlight: function(elementerrorClassvalidClass) {
                $(
element).parents('.control-group').removeClass('success').addClass('error');
            },
            
unhighlight: function(elementerrorClassvalidClass) {
                $(
element).parents('.control-group').removeClass('error').addClass('success');
            }
        }
    });
    
/*----------- END formwizard CODE -------------------------*/

}

/*--------------------------------------------------------
 END FORM-WIZARD.HTML SCRIPTS
 ---------------------------------------------------------*/

/*--------------------------------------------------------
 BEGIN TABLES.HTML SCRIPTS
 ---------------------------------------------------------*/
function metisTable() {

    
/*----------- BEGIN datatable CODE -------------------------*/
    
$('#dataTable').dataTable({
        
"sDom""<'pull-right'l>t<'row-fluid'<'span6'f><'span6'p>>",
        
"sPaginationType""bootstrap",
        
"oLanguage": {
            
"sLengthMenu""Show _MENU_ entries"
        
}
    });
    
/*----------- END datatable CODE -------------------------*/

    /*----------- BEGIN action table CODE -------------------------*/
    
$('#actionTable button.remove').on('click', function() {
        $(
this).closest('tr').remove();
    });
    $(
'#actionTable button.edit').on('click', function() {
        $(
'#editModal').modal({
            
showtrue
        
});
        var 
val1 = $(this).closest('tr').children('td').eq(1),
                
val2 = $(this).closest('tr').children('td').eq(2),
                
val3 = $(this).closest('tr').children('td').eq(3);
        $(
'#editModal #fName').val(val1.html());
        $(
'#editModal #lName').val(val2.html());
        $(
'#editModal #uName').val(val3.html());


        $(
'#editModal #sbmtBtn').on('click', function() {
            
val1.html($('#editModal #fName').val());
            
val2.html($('#editModal #lName').val());
            
val3.html($('#editModal #uName').val());
        });

    });
    
/*----------- END action table CODE -------------------------*/

}
/*--------------------------------------------------------
 END TABLES.HTML SCRIPTS
 ---------------------------------------------------------*/


/*--------------------------------------------------------
 BEGIN FILE.HTML SCRIPTS
 ---------------------------------------------------------*/
function metisFile() {

    
/*----------- BEGIN elfinder CODE -------------------------*/
    
var elf = $('#elfinder').elfinder({
        
url'assets/php/connector.php'  // connector URL (REQUIRED)
                // lang: 'de',             // language (OPTIONAL)
    
}).elfinder('instance');
    
/*----------- END elfinder CODE -------------------------*/

}
/*--------------------------------------------------------
 END FILE.HTML SCRIPTS
 ---------------------------------------------------------*/


/*--------------------------------------------------------
 BEGIN MAPS.HTML SCRIPTS
 ---------------------------------------------------------*/
function metisMaps() {

    var 
map1map2map3map4map5map6;

    
map1 = new GMaps({
        
el'#gmaps-basic',
        
lat: -12.043333,
        
lng: -77.028333,
        
zoomControltrue,
        
zoomControlOpt: {
            
style'SMALL',
            
position'TOP_LEFT'
        
},
        
panControlfalse,
        
streetViewControlfalse,
        
mapTypeControlfalse,
        
overviewMapControlfalse
    
});

    
map2 = new GMaps({
        
el'#gmaps-marker',
        
lat: -12.043333,
        
lng: -77.028333
    
});
    
map2.addMarker({
        
lat: -12.043333,
        
lng: -77.03,
        
title'Lima',
        
details: {
            
database_id42,
            
author'HPNeo'
        
},
        
click: function(e) {
            if (
console.log)
                
console.log(e);
            
alert('You clicked in this marker');
        },
        
mouseover: function(e) {
            if (
console.log)
                
console.log(e);
        }
    });
    
map2.addMarker({
        
lat: -12.042,
        
lng: -77.028333,
        
title'Marker with InfoWindow',
        
infoWindow: {
            
content'<p>HTML Content</p>'
        
}
    });

    
map3 = new GMaps({
        
el'#gmaps-geolocation',
        
lat: -12.043333,
        
lng: -77.028333
    
});

    
GMaps.geolocate({
        
success: function(position) {
            
map3.setCenter(position.coords.latitudeposition.coords.longitude);
        },
        
error: function(error) {
            
alert('Geolocation failed: ' error.message);
        },
        
not_supported: function() {
            
alert("Your browser does not support geolocation");
        },
        
always: function() {
            
//alert("Done!");
        
}
    });

    
map4 = new GMaps({
        
el'#gmaps-polylines',
        
lat: -12.043333,
        
lng: -77.028333,
        
click: function(e) {
            
console.log(e);
        }
    });

    
path = [[-12.044012922866312, -77.02470665341184], [-12.05449279282314, -77.03024273281858], [-12.055122327623378, -77.03039293652341], [-12.075917129727586, -77.02764635449216], [-12.07635776902266, -77.02792530422971], [-12.076819390363665, -77.02893381481931], [-12.088527520066453, -77.0241058385925], [-12.090814532191756, -77.02271108990476]];

    
map4.drawPolyline({
        
pathpath,
        
strokeColor'#131540',
        
strokeOpacity0.6,
        
strokeWeight6
    
});

    
map5 = new GMaps({
        
el'#gmaps-route',
        
lat: -12.043333,
        
lng: -77.028333
    
});
    
map5.drawRoute({
        
origin: [-12.044012922866312, -77.02470665341184],
        
destination: [-12.090814532191756, -77.02271108990476],
        
travelMode'driving',
        
strokeColor'#131540',
        
strokeOpacity0.6,
        
strokeWeight6
    
});

    
map6 = new GMaps({
        
el'#gmaps-geocoding',
        
lat: -12.043333,
        
lng: -77.028333
    
});
    $(
'#geocoding_form').submit(function(e) {
        
e.preventDefault();
        
GMaps.geocode({
            
address: $('#address').val().trim(),
            
callback: function(resultsstatus) {
                if (
status === 'OK') {
                    var 
latlng results[0].geometry.location;
                    
map6.setCenter(latlng.lat(), latlng.lng());
                    
map6.addMarker({
                        
latlatlng.lat(),
                        
lnglatlng.lng()
                    });
                }
            }
        });
    });

}
/*--------------------------------------------------------
 END MAPS.HTML SCRIPTS
 ---------------------------------------------------------*/
?>
Онлайн: 0
Реклама