Current state
This commit is contained in:
41
public/assets/js/account.js
Normal file
41
public/assets/js/account.js
Normal file
@@ -0,0 +1,41 @@
|
||||
$(function(){
|
||||
|
||||
if($('body').attr('data-page') == 'login' || $('body').attr('data-page') == 'signup' || $('body').attr('data-page') == 'password'){
|
||||
|
||||
/* For icon rotation on input box foxus */
|
||||
$('.input-field').focus(function() {
|
||||
$('.page-icon img').addClass('rotate-icon');
|
||||
});
|
||||
|
||||
/* For icon rotation on input box blur */
|
||||
$('.input-field').blur(function() {
|
||||
$('.page-icon img').removeClass('rotate-icon');
|
||||
});
|
||||
};
|
||||
|
||||
/* Background slide for lockscreen page */
|
||||
if($('body').attr('data-page') == 'lockscreen'){
|
||||
$.backstretch([ "assets/img/background/01.png", "assets/img/background/02.png", "assets/img/background/03.png", "assets/img/background/04.png", "assets/img/background/05.png", "assets/img/background/06.png",
|
||||
"assets/img/background/07.png", "assets/img/background/08.png", "assets/img/background/09.png" ],
|
||||
{
|
||||
fade: 600,
|
||||
duration: 4000
|
||||
});
|
||||
}
|
||||
|
||||
/* Background slide for lockscreen page */
|
||||
if($('body').attr('data-page') == 'login' || $('body').attr('data-page') == 'signup'){
|
||||
$('#submit-form').click(function(e){
|
||||
e.preventDefault();
|
||||
var l = Ladda.create(this);
|
||||
l.start();
|
||||
setTimeout(function () {
|
||||
window.location.href = "index.html";
|
||||
}, 2000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
19
public/assets/js/animations.js
Normal file
19
public/assets/js/animations.js
Normal file
@@ -0,0 +1,19 @@
|
||||
$(function(){
|
||||
|
||||
$('.js_triggerAnimation').click(function () {
|
||||
var anim = $('.js_animations').val();
|
||||
testAnim(anim);
|
||||
});
|
||||
|
||||
$('.js_animations').change(function () {
|
||||
var anim = $(this).val();
|
||||
testAnim(anim);
|
||||
});
|
||||
|
||||
function testAnim(x) {
|
||||
$('#animationSandbox').removeClass().addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
|
||||
$(this).removeClass();
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
717
public/assets/js/application.js
Normal file
717
public/assets/js/application.js
Normal file
@@ -0,0 +1,717 @@
|
||||
/**** Variables Initiation ****/
|
||||
var doc = document;
|
||||
var docEl = document.documentElement;
|
||||
var page = $("body").data("page");
|
||||
|
||||
|
||||
/**** Break Points Creation ****/
|
||||
if ($.fn.setBreakpoints) {
|
||||
$(window).setBreakpoints({
|
||||
distinct: true,
|
||||
breakpoints: [320, 480, 768, 1200]
|
||||
});
|
||||
}
|
||||
//******************************** PROGRESS BAR *******************************//
|
||||
|
||||
NProgress.configure({
|
||||
showSpinner: false
|
||||
}).start();
|
||||
setTimeout(function () {
|
||||
NProgress.done();
|
||||
$('.fade').removeClass('out');
|
||||
}, 1000);
|
||||
|
||||
|
||||
//******************************** RETINA READY *******************************//
|
||||
|
||||
Modernizr.addTest('retina', function () {
|
||||
return ( !! navigator.userAgent.match(/Macintosh|Mac|iPhone|iPad/i) && window.devicePixelRatio == 2);
|
||||
});
|
||||
|
||||
Modernizr.load([{
|
||||
test: Modernizr.retina,
|
||||
yep: 'assets/plugins/retina.js'
|
||||
}]);
|
||||
|
||||
|
||||
//******************************** MAIN SIDEBAR ******************************//
|
||||
|
||||
var $html = $('html');
|
||||
var $wrapper = $('#wrapper');
|
||||
var $sidebar = $('#sidebar');
|
||||
var $sidebar_toggle = $('.sidebar-toggle');
|
||||
var $sidebar_submenu = $('.submenu');
|
||||
|
||||
function manageSidebar() {
|
||||
|
||||
/* We change sidebar type on resize event */
|
||||
$(window).bind('enterBreakpoint1200', function () {
|
||||
$html.removeClass().addClass('sidebar-large');
|
||||
$('.sidebar-nav li.current').addClass('active');
|
||||
$('.sidebar-nav li.current .submenu').addClass('in').height('auto');
|
||||
$sidebar_toggle.attr('id', 'menu-medium');
|
||||
$sidebar.removeClass('collapse');
|
||||
sidebarHeight();
|
||||
createSideScroll();
|
||||
});
|
||||
|
||||
$(window).bind('enterBreakpoint768', function () {
|
||||
$html.removeClass('sidebar-hidden').removeClass('sidebar-large').removeClass('sidebar-thin').addClass('sidebar-medium');
|
||||
$('.sidebar-nav li.current').removeClass('active');
|
||||
$('.sidebar-nav li.current .submenu').removeClass('in');
|
||||
$sidebar_toggle.attr('id', 'menu-thin');
|
||||
sidebarHeight();
|
||||
$sidebar.removeClass('collapse');
|
||||
$("#menu-right").trigger("close");
|
||||
destroySideScroll();
|
||||
});
|
||||
|
||||
$(window).bind('enterBreakpoint480', function () {
|
||||
$html.removeClass('sidebar-medium').removeClass('sidebar-large').removeClass('sidebar-hidden').addClass('sidebar-thin');
|
||||
$('.sidebar-nav li.current').removeClass('active');
|
||||
$('.sidebar-nav li.current .submenu').removeClass('in');
|
||||
$sidebar.removeClass('collapse');
|
||||
sidebarHeight();
|
||||
destroySideScroll();
|
||||
});
|
||||
|
||||
$(window).bind('enterBreakpoint320', function () {
|
||||
$html.removeClass('sidebar-medium').removeClass('sidebar-large').removeClass('sidebar-thin').addClass('sidebar-hidden');
|
||||
sidebarHeight();
|
||||
destroySideScroll();
|
||||
});
|
||||
|
||||
/* We change sidebar type on click event */
|
||||
$(document).on("click", "#menu-large", function () {
|
||||
$html.removeClass('sidebar-medium').removeClass('sidebar-hidden').removeClass('sidebar-thin').addClass('sidebar-large');
|
||||
$sidebar_toggle.attr('id', 'menu-medium');
|
||||
$('.sidebar-nav li.current').addClass('active');
|
||||
$('.sidebar-nav li.current .submenu').addClass('in').height('auto');
|
||||
sidebarHeight();
|
||||
createSideScroll();
|
||||
});
|
||||
|
||||
$(document).on("click", "#menu-medium", function () {
|
||||
$html.removeClass('sidebar-hidden').removeClass('sidebar-large').removeClass('sidebar-thin').addClass('sidebar-medium');
|
||||
$sidebar_toggle.attr('id', 'menu-thin');
|
||||
$('.sidebar-nav li.current').removeClass('active');
|
||||
$('.sidebar-nav li.current .submenu').removeClass('in');
|
||||
sidebarHeight();
|
||||
destroySideScroll();
|
||||
});
|
||||
|
||||
$(document).on("click", "#menu-thin", function () {
|
||||
$html.removeClass('sidebar-medium').removeClass('sidebar-large').removeClass('sidebar-thin').addClass('sidebar-thin');
|
||||
$sidebar_toggle.attr('id', 'menu-large');
|
||||
$('.sidebar-nav li.current').removeClass('active');
|
||||
$('.sidebar-nav li.current .submenu').removeClass('in');
|
||||
sidebarHeight();
|
||||
if ($('body').hasClass('breakpoint-768')) $sidebar_toggle.attr('id', 'menu-medium');
|
||||
destroySideScroll();
|
||||
});
|
||||
|
||||
function destroySideScroll() {
|
||||
$sidebar.mCustomScrollbar("destroy");
|
||||
}
|
||||
|
||||
function createSideScroll() {
|
||||
destroySideScroll();
|
||||
$sidebar.mCustomScrollbar({
|
||||
scrollButtons: {
|
||||
enable: false
|
||||
},
|
||||
autoHideScrollbar: true,
|
||||
scrollInertia: 150,
|
||||
theme: "light-thin",
|
||||
advanced: {
|
||||
updateOnContentResize: true
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* Toggle submenu open */
|
||||
function toggleSidebarMenu() {
|
||||
var $this = $('.sidebar-nav');
|
||||
$this.find('li.active').has('ul').children('ul').addClass('collapse in');
|
||||
$this.find('li').not('.active').has('ul').children('ul').addClass('collapse');
|
||||
$this.find('li').has('ul').children('a').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).parent('li').toggleClass('active').children('ul').collapse('toggle');
|
||||
$(this).parent('li').siblings().removeClass('active').children('ul.in').collapse('hide');
|
||||
});
|
||||
}
|
||||
|
||||
/* Adjust sidebar height */
|
||||
function sidebarHeight() {
|
||||
var sidebar_height;
|
||||
var mainMenuHeight = parseInt($('#main-menu').height());
|
||||
var windowHeight = parseInt($(window).height());
|
||||
var mainContentHeight = parseInt($('#main-content').height());
|
||||
if (windowHeight > mainMenuHeight && windowHeight > mainContentHeight) sidebar_height = windowHeight;
|
||||
if (mainMenuHeight > windowHeight && mainMenuHeight > mainContentHeight) sidebar_height = mainMenuHeight;
|
||||
if (mainContentHeight > mainMenuHeight && mainContentHeight > windowHeight) sidebar_height = mainContentHeight;
|
||||
if ($html.hasClass('sidebar-large') || $html.hasClass('sidebar-hidden')) {
|
||||
$sidebar.height('');
|
||||
} else {
|
||||
$sidebar.height(sidebar_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Sidebar Statistics */
|
||||
if ($.fn.sparkline) {
|
||||
|
||||
sparkline1_color = '#159077';
|
||||
sparkline2_color = '#00699e';
|
||||
sparkline3_color = '#9e494e';
|
||||
|
||||
if($.cookie('style-color') == 'dark') { sparkline1_color = '#159077'; sparkline2_color = '#00699e'; sparkline3_color = '#9e494e';}
|
||||
if($.cookie('style-color') == 'red') { sparkline1_color = '#121212'; sparkline2_color = '#4AB2F8'; sparkline3_color = '#E0A832';}
|
||||
if($.cookie('style-color') == 'blue') { sparkline1_color = '#E0A832'; sparkline2_color = '#D9534F'; sparkline3_color = '#121212';}
|
||||
if($.cookie('style-color') == 'green') { sparkline1_color = '#E0A832'; sparkline2_color = '#D9534F'; sparkline3_color = '#121212';}
|
||||
if($.cookie('style-color') == 'dark') { sparkline1_color = '#159077'; sparkline2_color = '#00699e'; sparkline3_color = '#9e494e';}
|
||||
|
||||
/* Sparklines can also take their values from the first argument passed to the sparkline() function */
|
||||
var myvalues1 = [13, 14, 16, 15, 11, 14, 20, 14, 12, 16, 11, 17, 19, 16];
|
||||
var myvalues2 = [14, 17, 16, 12, 18, 16, 22, 15, 14, 17, 11, 18, 11, 12];
|
||||
var myvalues3 = [18, 14, 15, 14, 15, 12, 21, 16, 18, 14, 12, 15, 17, 19];
|
||||
var sparkline1 = $('.dynamicbar1').sparkline(myvalues1, {
|
||||
type: 'bar',
|
||||
barColor: sparkline1_color,
|
||||
barWidth: 4,
|
||||
barSpacing: 1,
|
||||
height: '28px'
|
||||
});
|
||||
var sparkline2 = $('.dynamicbar2').sparkline(myvalues2, {
|
||||
type: 'bar',
|
||||
barColor: sparkline2_color,
|
||||
barWidth: 4,
|
||||
barSpacing: 1,
|
||||
height: '28px'
|
||||
});
|
||||
var sparkline3 = $('.dynamicbar3').sparkline(myvalues3, {
|
||||
type: 'bar',
|
||||
barColor: sparkline3_color,
|
||||
barWidth: 4,
|
||||
barSpacing: 1,
|
||||
height: '28px'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
//******************************** CHAT MENU SIDEBAR ******************************//
|
||||
function chatSidebar() {
|
||||
|
||||
/* Manage the right sidebar */
|
||||
if ($.fn.mmenu) {
|
||||
var $menu = $('nav#menu-right');
|
||||
$menu.mmenu({
|
||||
position: 'right',
|
||||
dragOpen: true,
|
||||
counters: false,
|
||||
searchfield: {
|
||||
add: true,
|
||||
search: true,
|
||||
showLinksOnly: false
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* Open / Close right sidebar */
|
||||
$('#chat-toggle').on('click', function () {
|
||||
$menu.hasClass('mm-opened') ? $menu.trigger("close") : $menu.trigger("open");
|
||||
$('#chat-notification').hide();
|
||||
setTimeout(function () {
|
||||
$('.mm-panel .badge-danger').each(function () {
|
||||
$(this).removeClass('hide').addClass('animated bounceIn');
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
/* Remove current message when opening */
|
||||
$('.have-message').on('click', function () {
|
||||
$(this).removeClass('have-message');
|
||||
$(this).find('.badge-danger').fadeOut();
|
||||
});
|
||||
|
||||
/* Send messages */
|
||||
$('.send-message').keypress(function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
var chat_message = '<li class="img">' +
|
||||
'<span>' +
|
||||
'<div class="chat-detail chat-right">' +
|
||||
'<img src="assets/img/avatars/avatar1.png" data-retina-src="assets/img/avatars/avatar1_2x.png"/>' +
|
||||
'<div class="chat-detail">' +
|
||||
'<div class="chat-bubble">' +
|
||||
$(this).val() +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</span>' +
|
||||
'</li>';
|
||||
$(chat_message).hide().appendTo($(this).parent().parent()).fadeIn();
|
||||
$(this).val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//******************************** SKIN COLORS SWITCH ******************************//
|
||||
|
||||
var setColor = function (color) {
|
||||
var color_ = 'color-'+color;
|
||||
$('#theme-color').attr("href", "assets/css/colors/" + color_ + ".css");
|
||||
if ($.cookie) {
|
||||
$.cookie('style-color', color);
|
||||
}
|
||||
}
|
||||
|
||||
/* Change theme color onclick on menu */
|
||||
$('.theme-color').click(function (e) {
|
||||
e.preventDefault();
|
||||
var color = $(this).attr("data-style");
|
||||
setColor(color);
|
||||
$('.theme-color').parent().removeClass("c-white w-600");
|
||||
$(this).parent().addClass("c-white w-600");
|
||||
|
||||
if($.cookie('style-color') == 'dark') { sparkline1_color = '#159077'; sparkline2_color = '#00699e'; sparkline3_color = '#9e494e';}
|
||||
if($.cookie('style-color') == 'red') { sparkline1_color = '#E0A832'; sparkline2_color = '#4AB2F8'; sparkline3_color = '#121212';}
|
||||
if($.cookie('style-color') == 'blue') { sparkline1_color = '#E0A832'; sparkline2_color = '#D9534F'; sparkline3_color = '#121212';}
|
||||
if($.cookie('style-color') == 'green') { sparkline1_color = '#E0A832'; sparkline2_color = '#D9534F'; sparkline3_color = '#121212';}
|
||||
if($.cookie('style-color') == 'cafe') { sparkline1_color = '#159077'; sparkline2_color = '#00699e'; sparkline3_color = '#9e494e';}
|
||||
|
||||
/* We update Sparkline colors */
|
||||
$('.dynamicbar1').sparkline(myvalues1, {type: 'bar', barColor: sparkline1_color, barWidth: 4, barSpacing: 1, height: '28px'});
|
||||
$('.dynamicbar2').sparkline(myvalues2, {type: 'bar', barColor: sparkline2_color, barWidth: 4, barSpacing: 1, height: '28px'});
|
||||
$('.dynamicbar3').sparkline(myvalues3, {type: 'bar', barColor: sparkline3_color, barWidth: 4, barSpacing: 1, height: '28px'});
|
||||
|
||||
});
|
||||
|
||||
/* If skin color selected in menu, we display it */
|
||||
if($.cookie('style-color')){
|
||||
var color_ = 'color-'+$.cookie('style-color');
|
||||
$('#theme-color').attr("href", "assets/css/colors/" + color_ + ".css");
|
||||
}
|
||||
else{
|
||||
$('#theme-color').attr("href", "assets/css/colors/color-dark.css");
|
||||
}
|
||||
|
||||
//*********************************** CUSTOM FUNCTIONS *****************************//
|
||||
|
||||
/**** Custom Scrollbar ****/
|
||||
function customScroll() {
|
||||
$('.withScroll').each(function () {
|
||||
$(this).mCustomScrollbar("destroy");
|
||||
var scroll_height = $(this).data('height') ? $(this).data('height') : 'auto';
|
||||
var data_padding = $(this).data('padding') ? $(this).data('padding') : 0;
|
||||
if ($(this).data('height') == 'window') scroll_height = $(window).height() - data_padding;
|
||||
$(this).mCustomScrollbar({
|
||||
scrollButtons: {
|
||||
enable: false
|
||||
},
|
||||
autoHideScrollbar: true,
|
||||
scrollInertia: 150,
|
||||
theme: "dark-2",
|
||||
set_height: scroll_height,
|
||||
advanced: {
|
||||
updateOnContentResize: true
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**** Back to top on menu click when screen size < 480px (to see menu content) ****/
|
||||
$('.navbar-toggle').click(function () {
|
||||
$("html, body").animate({
|
||||
scrollTop: 0
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
/**** Animated Panels ****/
|
||||
function liveTile() {
|
||||
$('.live-tile').each(function () {
|
||||
$(this).liveTile("destroy", true); /* To get new size if resize event */
|
||||
tile_height = $(this).data("height") ? $(this).data("height") : $(this).find('.panel-body').height() + 52;
|
||||
$(this).height(tile_height);
|
||||
$(this).liveTile({
|
||||
speed: $(this).data("speed") ? $(this).data("speed") : 500, // Start after load or not
|
||||
mode: $(this).data("animation-easing") ? $(this).data("animation-easing") : 'carousel', // Animation type: carousel, slide, fade, flip, none
|
||||
playOnHover: $(this).data("play-hover") ? $(this).data("play-hover") : false, // Play live tile on hover
|
||||
repeatCount: $(this).data("repeat-count") ? $(this).data("repeat-count") : -1, // Repeat or not (-1 is infinite
|
||||
delay: $(this).data("delay") ? $(this).data("delay") : 0, // Time between two animations
|
||||
startNow: $(this).data("start-now") ? $(this).data("start-now") : true, //Start after load or not
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**** Full Screen Toggle ****/
|
||||
function toggleFullScreen() {
|
||||
if (!doc.fullscreenElement && !doc.msFullscreenElement && !doc.webkitIsFullScreen && !doc.mozFullScreenElement) {
|
||||
if (docEl.requestFullscreen) {
|
||||
docEl.requestFullscreen();
|
||||
} else if (docEl.webkitRequestFullScreen) {
|
||||
docEl.webkitRequestFullscreen();
|
||||
} else if (docEl.webkitRequestFullScreen) {
|
||||
docEl.webkitRequestFullScreen();
|
||||
} else if (docEl.msRequestFullscreen) {
|
||||
docEl.msRequestFullscreen();
|
||||
} else if (docEl.mozRequestFullScreen) {
|
||||
docEl.mozRequestFullScreen();
|
||||
}
|
||||
} else {
|
||||
if (doc.exitFullscreen) {
|
||||
doc.exitFullscreen();
|
||||
} else if (doc.webkitExitFullscreen) {
|
||||
doc.webkitExitFullscreen();
|
||||
} else if (doc.webkitCancelFullScreen) {
|
||||
doc.webkitCancelFullScreen();
|
||||
} else if (doc.msExitFullscreen) {
|
||||
doc.msExitFullscreen();
|
||||
} else if (doc.mozCancelFullScreen) {
|
||||
doc.mozCancelFullScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
$('.toggle_fullscreen').click(function () {
|
||||
toggleFullScreen();
|
||||
});
|
||||
|
||||
/**** Animate numbers onload ****/
|
||||
if ($('.animate-number').length && $.fn.numerator) {
|
||||
$('.animate-number').each(function () {
|
||||
$(this).numerator({
|
||||
easing: $(this).data("animation-easing") ? $(this).data("animation-easing") : 'linear', // easing options.
|
||||
duration: $(this).data("animation-duration") ? $(this).data("animation-duration") : 700, // the length of the animation.
|
||||
toValue: $(this).data("value"), // animate to this value.
|
||||
delimiter: ','
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**** Custom Select Input ****/
|
||||
if ($('select').length && $.fn.selectpicker) {
|
||||
setTimeout(function(){
|
||||
$('select').selectpicker();
|
||||
},50);
|
||||
}
|
||||
/**** Show Tooltip ****/
|
||||
if ($('[data-rel="tooltip"]').length && $.fn.tooltip) {
|
||||
$('[data-rel="tooltip"]').tooltip();
|
||||
}
|
||||
|
||||
/**** Show Popover ****/
|
||||
if ($('[rel="popover"]').length && $.fn.popover) {
|
||||
$('[rel="popover"]').popover();
|
||||
$('[rel="popover_dark"]').popover({
|
||||
template: '<div class="popover popover-dark"><div class="arrow"></div><h3 class="popover-title popover-title"></h3><div class="popover-content popover-content"></div></div>',
|
||||
});
|
||||
}
|
||||
|
||||
/**** Improve Dropdown effect ****/
|
||||
if ($('[data-hover="dropdown"]').length && $.fn.popover) {
|
||||
$('[data-hover="dropdown"]').popover();
|
||||
}
|
||||
|
||||
/**** Add to favorite ****/
|
||||
$('.favorite').on('click', function () {
|
||||
($(this).hasClass('btn-default')) ? $(this).removeClass('btn-default').addClass('btn-danger') : $(this).removeClass('btn-danger').addClass('btn-default');
|
||||
});
|
||||
|
||||
/**** Add to favorite ****/
|
||||
$('.favs').on('click', function () {
|
||||
event.preventDefault();
|
||||
($(this).hasClass('fa-star-o')) ? $(this).removeClass('fa-star-o').addClass('fa-star c-orange') : $(this).removeClass('fa-star c-orange').addClass('fa-star-o');
|
||||
});
|
||||
|
||||
/* Toggle All Checkbox Function */
|
||||
$('.toggle_checkbox').on('click', function () {
|
||||
|
||||
if ($(this).prop('checked') == true){
|
||||
$(this).closest('#task-manager').find('input:checkbox').prop('checked', true);
|
||||
} else {
|
||||
$(this).closest('#task-manager').find('input:checkbox').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**** Form Validation with Icons ****/
|
||||
if ($('.icon-validation').length && $.fn.parsley) {
|
||||
|
||||
$('.icon-validation').each(function () {
|
||||
|
||||
icon_validation = $(this);
|
||||
|
||||
$(this).parsley().subscribe('parsley:field:success', function (formInstance) {
|
||||
|
||||
formInstance.$element.prev().removeClass('fa-exclamation c-red').addClass('fa-check c-green');
|
||||
|
||||
});
|
||||
$(this).parsley().subscribe('parsley:field:error', function (formInstance) {
|
||||
|
||||
formInstance.$element.prev().removeClass('fa-check c-green').addClass('fa-exclamation c-red');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**** Custom Range Slider ****/
|
||||
if ($('.range-slider').length && $.fn.rangeSlider) {
|
||||
$('.range-slider').each(function () {
|
||||
$(this).rangeSlider({
|
||||
delayOut: $(this).data('slider-delay-out') ? $(this).data('slider-delay-out') : '0',
|
||||
valueLabels: $(this).data('slider-value-label') ? $(this).data('slider-value-label') : 'show',
|
||||
step: $(this).data('slider-step') ? $(this).data('slider-step') : 1,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**** Custom Slider ****/
|
||||
function handleSlider() {
|
||||
if ($('.slide').length && $.fn.slider) {
|
||||
$('.slide').each(function () {
|
||||
$(this).slider();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**** Custom Switch ****/
|
||||
if ($('.switch').length && $.fn.bootstrapSwitch) {
|
||||
$('.switch').each(function () {
|
||||
var switch_size = $(this).data('size') ? $(this).data('size') : '';
|
||||
var switch_on_color = $(this).data('on-color') ? $(this).data('on-color') : 'primary';
|
||||
var switch_off_color = $(this).data('off-color') ? $(this).data('off-color') : 'primary';
|
||||
$(this).bootstrapSwitch('size', switch_size);
|
||||
$(this).bootstrapSwitch('onColor', switch_on_color);
|
||||
$(this).bootstrapSwitch('offColor', switch_off_color);
|
||||
});
|
||||
}
|
||||
|
||||
/**** Datepicker ****/
|
||||
if ($('.datepicker').length && $.fn.datepicker) {
|
||||
$('.datepicker').each(function () {
|
||||
var datepicker_inline = $(this).data('inline') ? $(this).data('inline') : false;
|
||||
$(this).datepicker({
|
||||
inline: datepicker_inline
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**** Datetimepicker ****/
|
||||
if ($('.datetimepicker').length && $.fn.datetimepicker) {
|
||||
$('.datetimepicker').each(function () {
|
||||
var datetimepicker_inline = $(this).data('inline') ? $(this).data('inline') : false;
|
||||
$(this).datetimepicker({
|
||||
inline: datetimepicker_inline
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**** Pickadate ****/
|
||||
if ($('.pickadate').length && $.fn.pickadate) {
|
||||
$('.pickadate').each(function () {
|
||||
$(this).pickadate();
|
||||
});
|
||||
}
|
||||
|
||||
/**** Pickatime ****/
|
||||
if ($('.pickatime').length && $.fn.pickatime) {
|
||||
$('.pickatime').each(function () {
|
||||
$(this).pickatime();
|
||||
});
|
||||
}
|
||||
|
||||
/**** Sortable Panels ****/
|
||||
if ($('.sortable').length && $.fn.sortable) {
|
||||
$(".sortable").sortable({
|
||||
connectWith: '.sortable',
|
||||
iframeFix: false,
|
||||
items: 'div.panel',
|
||||
opacity: 0.8,
|
||||
helper: 'original',
|
||||
revert: true,
|
||||
forceHelperSize: true,
|
||||
placeholder: 'sortable-box-placeholder round-all',
|
||||
forcePlaceholderSize: true,
|
||||
tolerance: 'pointer'
|
||||
});
|
||||
}
|
||||
|
||||
/**** Tables Responsive ****/
|
||||
function tableResponsive(){
|
||||
$('.table').each(function () {
|
||||
table_width = $(this).width();
|
||||
content_width = $(this).parent().width();
|
||||
if(table_width > content_width) {
|
||||
$(this).parent().addClass('force-table-responsive');
|
||||
}
|
||||
else{
|
||||
$(this).parent().removeClass('force-table-responsive');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**** Sortable Tables ****/
|
||||
if ($('.sortable_table').length && $.fn.sortable) {
|
||||
$(".sortable_table").sortable({
|
||||
itemPath: '> tbody',
|
||||
itemSelector: 'tbody tr',
|
||||
placeholder: '<tr class="placeholder"/>'
|
||||
});
|
||||
}
|
||||
|
||||
/**** Nestable List ****/
|
||||
if ($('.nestable').length && $.fn.nestable) {
|
||||
$(".nestable").nestable();
|
||||
}
|
||||
|
||||
/**** Sparkline Inline Charts ****/
|
||||
if ($('.sparkline').length && $.fn.sparkline) {
|
||||
$('.sparkline').each(function () {
|
||||
$(this).sparkline(
|
||||
$(this).data("sparkline-value"), {
|
||||
type: $(this).data("sparkline-type") ? $(this).data("sparkline-type") : 'bar',
|
||||
barWidth: $(this).data("sparkline-bar-width") ? $(this).data("sparkline-bar-width") : 5,
|
||||
barSpacing: $(this).data("sparkline-bar-spacing") ? $(this).data("sparkline-bar-spacing") : 2,
|
||||
height: $(this).data("sparkline-height") ? $(this).data("sparkline-height") : '20px',
|
||||
barColor: $(this).data("sparkline-color") ? $(this).data("sparkline-color") : '#7BB2B4',
|
||||
enableTagOptions: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**** Animation CSS3 ****/
|
||||
if ($('.animated').length) {
|
||||
$('.animated').each(function () {
|
||||
delay_animation = parseInt($(this).attr("data-delay") ? $(this).attr("data-delay") : 500);
|
||||
$(this).addClass('hide').removeClass('hide', delay_animation);
|
||||
});
|
||||
}
|
||||
|
||||
/**** Summernote Editor ****/
|
||||
if ($('.summernote').length && $.fn.summernote) {
|
||||
$('.summernote').each(function () {
|
||||
$(this).summernote({
|
||||
height: 300,
|
||||
toolbar: [
|
||||
["style", ["style"]],
|
||||
["style", ["bold", "italic", "underline", "clear"]],
|
||||
["fontsize", ["fontsize"]],
|
||||
["color", ["color"]],
|
||||
["para", ["ul", "ol", "paragraph"]],
|
||||
["height", ["height"]],
|
||||
["table", ["table"]]
|
||||
]
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**** CKE Editor ****/
|
||||
if ($('.cke-editor').length && $.fn.ckeditor) {
|
||||
$('.cke-editor').each(function () {
|
||||
$(this).ckeditor();
|
||||
});
|
||||
}
|
||||
|
||||
/**** Tables Dynamic ****/
|
||||
if ($('.table-dynamic').length && $.fn.dataTable) {
|
||||
$('.table-dynamic').each(function () {
|
||||
var opt = {};
|
||||
// Tools: export to Excel, CSV, PDF & Print
|
||||
if ($(this).hasClass('table-tools')) {
|
||||
opt.sDom = "<'row'<'col-md-6'f><'col-md-6'T>r>t<'row'<'col-md-6'i><'spcol-md-6an6'p>>",
|
||||
opt.oTableTools = {
|
||||
"sSwfPath": "assets/plugins/datatables/swf/copy_csv_xls_pdf.swf",
|
||||
"aButtons": ["csv", "xls", "pdf", "print"]
|
||||
};
|
||||
}
|
||||
if ($(this).hasClass('no-header')) {
|
||||
opt.bFilter = false;
|
||||
opt.bLengthChange = false;
|
||||
}
|
||||
if ($(this).hasClass('no-footer')) {
|
||||
opt.bInfo = false;
|
||||
opt.bPaginate = false;
|
||||
}
|
||||
var oTable = $(this).dataTable(opt);
|
||||
oTable.fnDraw();
|
||||
});
|
||||
}
|
||||
|
||||
/**** Table progress bar ****/
|
||||
if ($('body').data('page') == 'tables' || $('body').data('page') == 'products' || $('body').data('page') == 'blog') {
|
||||
$('.progress-bar').progressbar();
|
||||
}
|
||||
|
||||
/**** Gallery Images ****/
|
||||
if ($('.gallery').length && $.fn.mixItUp) {
|
||||
$('.gallery').each(function () {
|
||||
|
||||
$(this).mixItUp({
|
||||
animation: {
|
||||
enable: false
|
||||
},
|
||||
callbacks: {
|
||||
onMixLoad: function(){
|
||||
$('.mix').hide();
|
||||
$(this).mixItUp('setOptions', {
|
||||
animation: {
|
||||
enable: true,
|
||||
effects: "fade",
|
||||
},
|
||||
});
|
||||
$(window).bind("load", function() {
|
||||
$('.mix').fadeIn();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if ($('.magnific').length && $.fn.magnificPopup) {
|
||||
$('.magnific').magnificPopup({
|
||||
type:'image',
|
||||
gallery: {
|
||||
enabled: true
|
||||
},
|
||||
removalDelay: 300,
|
||||
mainClass: 'mfp-fade'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**** Initiation of Main Functions ****/
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
manageSidebar();
|
||||
toggleSidebarMenu();
|
||||
chatSidebar();
|
||||
customScroll();
|
||||
liveTile();
|
||||
handleSlider();
|
||||
tableResponsive();
|
||||
|
||||
});
|
||||
|
||||
|
||||
/**** On Resize Functions ****/
|
||||
$(window).bind('resize', function (e) {
|
||||
window.resizeEvt;
|
||||
$(window).resize(function () {
|
||||
clearTimeout(window.resizeEvt);
|
||||
window.resizeEvt = setTimeout(function () {
|
||||
sidebarHeight();
|
||||
liveTile();
|
||||
customScroll();
|
||||
handleSlider();
|
||||
tableResponsive();
|
||||
}, 250);
|
||||
});
|
||||
});
|
||||
352
public/assets/js/blog.js
Normal file
352
public/assets/js/blog.js
Normal file
@@ -0,0 +1,352 @@
|
||||
$(function () {
|
||||
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
/*------------------------------ BLOG DASHBOARD --------------------------------*/
|
||||
|
||||
if($('body').data('page') == 'blog'){
|
||||
|
||||
//jvectormap data
|
||||
var visitorsData = {
|
||||
"US": 398, //USA
|
||||
"SA": 400, //Saudi Arabia
|
||||
"CA": 1000, //Canada
|
||||
"DE": 500, //Germany
|
||||
"FR": 760, //France
|
||||
"CN": 300, //China
|
||||
"AU": 700, //Australia
|
||||
"BR": 600, //Brazil
|
||||
"IN": 800, //India
|
||||
"GB": 320, //Great Britain
|
||||
"RU": 3000 //Russia
|
||||
};
|
||||
//World map by jvectormap
|
||||
$('#world-map').vectorMap({
|
||||
map: 'world_mill_en',
|
||||
backgroundColor: "#fff",
|
||||
regionStyle: {
|
||||
initial: {
|
||||
fill: '#e4e4e4',
|
||||
"fill-opacity": 1,
|
||||
stroke: 'none',
|
||||
"stroke-width": 0,
|
||||
"stroke-opacity": 1
|
||||
}
|
||||
},
|
||||
series: {
|
||||
regions: [{
|
||||
values: visitorsData,
|
||||
scale: ["#3c8dbc", "#2D79A6"], //['#3E5E6B', '#A6BAC2'],
|
||||
normalizeFunction: 'polynomial'
|
||||
}]
|
||||
},
|
||||
onRegionLabelShow: function(e, el, code) {
|
||||
if (typeof visitorsData[code] != "undefined")
|
||||
el.html(el.html() + ': ' + visitorsData[code] + ' new visitors');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//Sparkline charts
|
||||
var myvalues = [15, 19, 20, -22, -33, 27, 31, 27, 19, 30, 21];
|
||||
$('#sparkline-1').sparkline(myvalues, {
|
||||
type: 'bar',
|
||||
barColor: '#18A689',
|
||||
negBarColor: "#cd6a6a",
|
||||
height: '20px'
|
||||
});
|
||||
myvalues = [15, 19, 20, 22, -2, -10, -7, 27, 19, 30, 21];
|
||||
$('#sparkline-2').sparkline(myvalues, {
|
||||
type: 'bar',
|
||||
barColor: '#18A689',
|
||||
negBarColor: "#cd6a6a",
|
||||
height: '20px'
|
||||
});
|
||||
myvalues = [15, -19, -20, 22, 33, 27, 31, 27, 19, 30, 21];
|
||||
$('#sparkline-3').sparkline(myvalues, {
|
||||
type: 'bar',
|
||||
barColor: '#18A689',
|
||||
negBarColor: "#cd6a6a",
|
||||
height: '20px'
|
||||
});
|
||||
myvalues = [15, 19, 20, 22, 33, -27, -31, 27, 19, 30, 21];
|
||||
$('#sparkline-4').sparkline(myvalues, {
|
||||
type: 'bar',
|
||||
barColor: '#18A689',
|
||||
negBarColor: "#cd6a6a",
|
||||
height: '20px'
|
||||
});
|
||||
myvalues = [15, 19, 20, 22, 33, 27, 31, -27, -19, 30, 21];
|
||||
$('#sparkline-5').sparkline(myvalues, {
|
||||
type: 'bar',
|
||||
barColor: '#18A689',
|
||||
negBarColor: "#cd6a6a",
|
||||
height: '20px'
|
||||
});
|
||||
myvalues = [15, 19, -20, 22, -13, 27, 31, 27, 19, 30, 21];
|
||||
$('#sparkline-6').sparkline(myvalues, {
|
||||
type: 'bar',
|
||||
barColor: '#18A689',
|
||||
negBarColor: "#cd6a6a",
|
||||
height: '20px'
|
||||
});
|
||||
|
||||
|
||||
//******************** VISITS CHART ********************//
|
||||
function randomValue() {
|
||||
return (Math.floor(Math.random() * (1 + 24))) + 8;
|
||||
}
|
||||
|
||||
var data1 = [
|
||||
[1, 5 + randomValue()], [2, 10 + randomValue()], [3, 10 + randomValue()], [4, 15 + randomValue()], [5, 20 + randomValue()], [6, 25 + randomValue()], [7, 30 + randomValue()], [8, 35 + randomValue()], [9, 40 + randomValue()], [10, 45 + randomValue()], [11, 50 + randomValue()], [12, 55 + randomValue()], [13, 60 + randomValue()], [14, 70 + randomValue()], [15, 75 + randomValue()], [16, 80 + randomValue()], [17, 85 + randomValue()], [18, 90 + randomValue()], [19, 95 + randomValue()], [20, 100 + randomValue()]
|
||||
];
|
||||
var data2 = [
|
||||
[1, 1425], [2, 1754], [3, 1964], [4, 2145], [5, 2550], [6, 2210], [7, 1760], [8, 1820], [9, 1880], [10, 1985], [11, 2240], [12, 2435]
|
||||
];
|
||||
|
||||
var plot = $.plot(
|
||||
$('#chart_visits'), [{
|
||||
data: data2,
|
||||
label: [
|
||||
["January"],
|
||||
["February"],
|
||||
["March"],
|
||||
["April"],
|
||||
["May"],
|
||||
["June"],
|
||||
["July"],
|
||||
["August"],
|
||||
["September"],
|
||||
["October"],
|
||||
["November"],
|
||||
["December"]
|
||||
],
|
||||
showLabels: true,
|
||||
color: '#3584b2',
|
||||
points: {
|
||||
fillColor: "#3584b2"
|
||||
}
|
||||
}], {
|
||||
grid: {
|
||||
color: '#fff',
|
||||
borderColor: "transparent",
|
||||
clickable: true,
|
||||
hoverable: true
|
||||
},
|
||||
series: {
|
||||
bars: {
|
||||
show: true,
|
||||
barWidth: 0.4,
|
||||
fill: true,
|
||||
fillColor: 'rgba(53,132,178,0.7)'
|
||||
},
|
||||
points: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
mode: "time",
|
||||
monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
||||
axisLabel: 'Month',
|
||||
},
|
||||
yaxis: {
|
||||
tickColor: '#e8e8e8'
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
tooltip: true
|
||||
});
|
||||
|
||||
var previousPoint = null;
|
||||
$("#chart_visits").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(0));
|
||||
$("#y").text(pos.y.toFixed(0));
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
$("#flot-tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(0),
|
||||
y = item.datapoint[1].toFixed(0);
|
||||
showTooltip(item.pageX, item.pageY, y + " visits in " + item.series.label[item.dataIndex]);
|
||||
}
|
||||
} else {
|
||||
$("#flot-tooltip").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
|
||||
function showTooltip(x, y, contents) {
|
||||
$('<div id="flot-tooltip">' + contents + '</div>').css({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
top: y + 5,
|
||||
left: x + 5,
|
||||
color: '#fff',
|
||||
padding: '2px 5px',
|
||||
'background-color': '#717171',
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(200);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
/*------------------------------- POSTS / ARTICLES ----------------------------------*/
|
||||
|
||||
/* Select checked row */
|
||||
$('input:checkbox').on('click', function () {
|
||||
if ($(this).prop('checked') == true){
|
||||
$(this).prop('checked', true);
|
||||
$(this).parent().parent().parent().addClass('selected');
|
||||
} else {
|
||||
$(this).prop('checked', false);
|
||||
$(this).parent().parent().parent().removeClass('selected');
|
||||
}
|
||||
});
|
||||
|
||||
/* Toggle All Checkbox Function */
|
||||
$('.check_all').on('click', function () {
|
||||
if ($(this).prop('checked') == true){
|
||||
$(this).closest('table').find('input:checkbox').prop('checked', true);
|
||||
$(this).closest('table').find('tr').addClass('selected');
|
||||
} else {
|
||||
$(this).closest('table').find('input:checkbox').prop('checked', false);
|
||||
$(this).closest('table').find('tr').removeClass('selected');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if($('body').data('page') == 'posts'){
|
||||
|
||||
var opt = {};
|
||||
// Tools: export to Excel, CSV, PDF & Print
|
||||
opt.sDom = "<'row m-t-10'<'col-md-6'><'col-md-6'Tf>r>t<'row'<'col-md-6'><'col-md-6 align-right'p>>",
|
||||
opt.oLanguage = { "sSearch": "","sZeroRecords": "No articles found" } ,
|
||||
opt.iDisplayLength = 15,
|
||||
opt.oTableTools = {
|
||||
"sSwfPath": "assets/plugins/datatables/swf/copy_csv_xls_pdf.swf",
|
||||
"aButtons": ["csv", "xls"]
|
||||
};
|
||||
opt.aaSorting = [[ 4, 'asc' ]];
|
||||
opt.aoColumnDefs = [
|
||||
{ 'bSortable': false, 'aTargets': [0] }
|
||||
];
|
||||
|
||||
var oTable = $('#posts-table').dataTable(opt);
|
||||
oTable.fnDraw();
|
||||
|
||||
/* Add a placeholder to searh input */
|
||||
$('.dataTables_filter input').attr("placeholder", "Search an article...");
|
||||
|
||||
/* Delete a product */
|
||||
$('#posts-table a.delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this article ?") == false) {
|
||||
return;
|
||||
}
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
oTable.fnDeleteRow(nRow);
|
||||
// alert("Deleted! Do not forget to do some ajax to sync with backend :)");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
/*------------------------------------ EVENTS ----------------------------------------*/
|
||||
|
||||
if($('body').data('page') == 'events'){
|
||||
|
||||
$('#reportrange').daterangepicker( {
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
|
||||
'Last 7 Days': [moment().subtract('days', 6), moment()],
|
||||
'Last 30 Days': [moment().subtract('days', 29), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
|
||||
},
|
||||
startDate: moment().subtract('days', 29),
|
||||
endDate: moment()
|
||||
},
|
||||
function(start, end) {
|
||||
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
var opt = {};
|
||||
// Tools: export to Excel, CSV, PDF & Print
|
||||
opt.sDom = "<'row m-t-10'<'col-md-6'><'col-md-6'T>r>t<'row'<'col-md-6'><'col-md-6 align-right'p>>",
|
||||
opt.oLanguage = { "sSearch": "","sZeroRecords": "No event found" } ,
|
||||
opt.iDisplayLength = 6,
|
||||
opt.oTableTools = {
|
||||
"sSwfPath": "assets/plugins/datatables/swf/copy_csv_xls_pdf.swf",
|
||||
"aButtons": []
|
||||
};
|
||||
opt.aaSorting = [[ 5, 'asc' ]];
|
||||
opt.aoColumnDefs = [
|
||||
{ 'bSortable': false, 'aTargets': [0] }
|
||||
];
|
||||
|
||||
var oTable = $('#events-table').dataTable(opt);
|
||||
oTable.fnDraw();
|
||||
|
||||
/* Add a placeholder to searh input */
|
||||
$('.dataTables_filter input').attr("placeholder", "Search an event...");
|
||||
|
||||
/* Delete a product */
|
||||
$('#events-table a.delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this event ?") == false) {
|
||||
return;
|
||||
}
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
oTable.fnDeleteRow(nRow);
|
||||
// alert("Deleted! Do not forget to do some ajax to sync with backend :)");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($('body').data('page') == 'event'){
|
||||
|
||||
$('#reportrange').daterangepicker( {
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
|
||||
'Last 7 Days': [moment().subtract('days', 6), moment()],
|
||||
'Last 30 Days': [moment().subtract('days', 29), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
|
||||
},
|
||||
startDate: moment().subtract('days', 29),
|
||||
endDate: moment()
|
||||
},
|
||||
function(start, end) {
|
||||
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
var opt = {};
|
||||
|
||||
/* Delete a product */
|
||||
$('#comments-table a.delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this event ?") == false) {
|
||||
return;
|
||||
}
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
oTable.fnDeleteRow(nRow);
|
||||
// alert("Deleted! Do not forget to do some ajax to sync with backend :)");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
126
public/assets/js/calendar.js
Normal file
126
public/assets/js/calendar.js
Normal file
@@ -0,0 +1,126 @@
|
||||
$(function () {
|
||||
|
||||
function runCalendar() {
|
||||
var $modal = $('#event-modal');
|
||||
$('#external-events div.external-event').each(function () {
|
||||
// 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($(this).text()) // use the element's text as the event title
|
||||
};
|
||||
// store the Event Object in the DOM element so we can get to it later
|
||||
$(this).data('eventObject', eventObject);
|
||||
// make the event draggable using jQuery UI
|
||||
$(this).draggable({
|
||||
zIndex: 999,
|
||||
revert: true, // will cause the event to go back to its
|
||||
revertDuration: 20 // original position after the drag
|
||||
});
|
||||
});
|
||||
/* Initialize the calendar */
|
||||
var date = new Date();
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth();
|
||||
var y = date.getFullYear();
|
||||
var form = '';
|
||||
var calendar = $('#calendar').fullCalendar({
|
||||
slotDuration: '00:15:00', /* If we want to split day time each 15minutes */
|
||||
minTime: '08:00:00',
|
||||
maxTime: '19:00:00',
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
events: [{
|
||||
title: 'Bring Files!',
|
||||
start: new Date(y, m, 2),
|
||||
className: 'bg-purple'
|
||||
}, {
|
||||
title: 'See John',
|
||||
start: '2014-05-05 10:00:00',
|
||||
start: '2014-05-05 11:00:00',
|
||||
className: 'bg-red'
|
||||
}],
|
||||
editable: true,
|
||||
droppable: true, // this allows things to be dropped onto the calendar !!!
|
||||
drop: function (date, allDay) { // this function is called when something is dropped
|
||||
// retrieve the dropped element's stored Event Object
|
||||
var originalEventObject = $(this).data('eventObject');
|
||||
var $categoryClass = $(this).attr('data-class');
|
||||
// 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;
|
||||
if ($categoryClass)
|
||||
copiedEventObject['className'] = [$categoryClass];
|
||||
// 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', copiedEventObject, true);
|
||||
// is the "remove after drop" checkbox checked?
|
||||
if ($('#drop-remove').is(':checked')) {
|
||||
// if so, remove the element from the "Draggable Events" list
|
||||
$(this).remove();
|
||||
}
|
||||
},
|
||||
|
||||
selectable: true,
|
||||
eventClick: function (calEvent, jsEvent, view) {
|
||||
var form = $("<form></form>");
|
||||
form.append("<label>Change event name</label>");
|
||||
form.append("<div class='input-group'><input class='form-control' type=text value='" + calEvent.title + "' /><span class='input-group-btn'><button type='submit' class='btn btn-success'><i class='fa fa-check'></i> Save</button></span></div>");
|
||||
$modal.modal({
|
||||
backdrop: 'static'
|
||||
});
|
||||
$modal.find('.delete-event').show().end().find('.save-event').hide().end().find('.modal-body').empty().prepend(form).end().find('.delete-event').unbind('click').click(function () {
|
||||
calendar.fullCalendar('removeEvents', function (ev) {
|
||||
return (ev._id == calEvent._id);
|
||||
});
|
||||
$modal.modal('hide');
|
||||
});
|
||||
$modal.find('form').on('submit', function () {
|
||||
calEvent.title = form.find("input[type=text]").val();
|
||||
calendar.fullCalendar('updateEvent', calEvent);
|
||||
$modal.modal('hide');
|
||||
return false;
|
||||
});
|
||||
},
|
||||
select: function (start, end, allDay) {
|
||||
$modal.modal({
|
||||
backdrop: 'static'
|
||||
});
|
||||
form = $("<form></form>");
|
||||
form.append("<div class='row'></div>");
|
||||
form.find(".row").append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Event Name</label><input class='form-control' placeholder='Insert Event Name' type='text' name='title'/></div></div>").append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Category</label><select class='form-control' name='category'></select></div></div>").find("select[name='category']").append("<option value='bg-red'>Work</option>")
|
||||
.append("<option value='bg-green'>Sport</option>").append("<option value='bg-purple'>Meeting</option>").append("<option value='bg-blue'>Lunch</option>").append("<option value='bg-yellow'>Children</option>");
|
||||
$modal.find('.delete-event').hide().end().find('.save-event').show().end().find('.modal-body').empty().prepend(form).end().find('.save-event').unbind('click').click(function () {
|
||||
form.submit();
|
||||
});
|
||||
$modal.find('form').on('submit', function () {
|
||||
title = form.find("input[name='title']").val();
|
||||
$categoryClass = form.find("select[name='category'] option:checked").val();
|
||||
if (title !== null && title.length != 0) {
|
||||
calendar.fullCalendar('renderEvent', {
|
||||
title: title,
|
||||
start: start,
|
||||
end: end,
|
||||
allDay: false,
|
||||
className: $categoryClass
|
||||
}, true);
|
||||
}
|
||||
else{
|
||||
alert('You have to give a title to your event');
|
||||
}
|
||||
$modal.modal('hide');
|
||||
return false;
|
||||
});
|
||||
calendar.fullCalendar('unselect');
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
runCalendar();
|
||||
|
||||
});
|
||||
492
public/assets/js/charts.js
Normal file
492
public/assets/js/charts.js
Normal file
@@ -0,0 +1,492 @@
|
||||
$(function () {
|
||||
|
||||
/* ==============================================
|
||||
CHART 1: D3 STACKED AREA CHART
|
||||
=============================================== */
|
||||
var histcatexplong = [
|
||||
{
|
||||
"key" : "Consumer Discretionary" ,
|
||||
"values" : [ [ 1138683600000 , 27.38478809681] , [ 1141102800000 , 27.371377218208] , [ 1143781200000 , 26.309915460827] , [ 1146369600000 , 26.425199957521] , [ 1149048000000 , 26.823411519395] , [ 1151640000000 , 23.850443591584] , [ 1154318400000 , 23.158355444054] , [ 1156996800000 , 22.998689393694] , [ 1159588800000 , 27.977128511299] , [ 1162270800000 , 29.073672469721] , [ 1164862800000 , 28.587640408904] , [ 1167541200000 , 22.788453687638] , [ 1170219600000 , 22.429199073597] , [ 1172638800000 , 22.324103271051] , [ 1175313600000 , 17.558388444186] , [ 1177905600000 , 16.769518096208] , [ 1180584000000 , 16.214738201302] , [ 1183176000000 , 18.729632971228] , [ 1185854400000 , 18.814523318848] , [ 1188532800000 , 19.789986451358] , [ 1191124800000 , 17.070049054933] , [ 1193803200000 , 16.121349575715] , [ 1196398800000 , 15.141659430091] , [ 1199077200000 , 17.175388025298] , [ 1201755600000 , 17.286592443521] , [ 1204261200000 , 16.323141626569] , [ 1206936000000 , 19.231263773952] , [ 1209528000000 , 18.446256391094] , [ 1212206400000 , 17.822632399764] , [ 1214798400000 , 15.539366475979] , [ 1217476800000 , 15.255131790216] , [ 1220155200000 , 15.660963922593] , [ 1222747200000 , 13.254482273697] , [ 1225425600000 , 11.920796202299] , [ 1228021200000 , 12.122809090925] , [ 1230699600000 , 15.691026271393] , [ 1233378000000 , 14.720881635107] , [ 1235797200000 , 15.387939360044] , [ 1238472000000 , 13.765436672229] , [ 1241064000000 , 14.6314458648] , [ 1243742400000 , 14.292446536221] , [ 1246334400000 , 16.170071367016] , [ 1249012800000 , 15.948135554337] , [ 1251691200000 , 16.612872685134] , [ 1254283200000 , 18.778338719091] , [ 1256961600000 , 16.75602606542] , [ 1259557200000 , 19.385804443147] , [ 1262235600000 , 22.950590240168] , [ 1264914000000 , 23.61159018141] , [ 1267333200000 , 25.708586989581] , [ 1270008000000 , 26.883915999885] , [ 1272600000000 , 25.893486687065] , [ 1275278400000 , 24.678914263176] , [ 1277870400000 , 25.937275793023] , [ 1280548800000 , 29.46138169384] , [ 1283227200000 , 27.357322961862] , [ 1285819200000 , 29.057235285673] , [ 1288497600000 , 28.549434189386] , [ 1291093200000 , 28.506352379723] , [ 1293771600000 , 29.449241421597] , [ 1296450000000 , 25.796838168807] , [ 1298869200000 , 28.740145449189] , [ 1301544000000 , 22.091744141872] , [ 1304136000000 , 25.079662545409] , [ 1306814400000 , 23.674906973064] , [ 1309406400000 , 23.41800274293] , [ 1312084800000 , 23.243644138871] , [ 1314763200000 , 31.591854066817] , [ 1317355200000 , 31.497112374114] , [ 1320033600000 , 26.672380820431] , [ 1322629200000 , 27.297080015495] , [ 1325307600000 , 20.174315530051] , [ 1327986000000 , 19.631084213899] , [ 1330491600000 , 20.366462219462] , [ 1333166400000 , 17.429019937289] , [ 1335758400000 , 16.75543633539] , [ 1338436800000 , 16.182906906042]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Consumer Staples" ,
|
||||
"values" : [ [ 1138683600000 , 7.2800122043237] , [ 1141102800000 , 7.1187787503354] , [ 1143781200000 , 8.351887016482] , [ 1146369600000 , 8.4156698763993] , [ 1149048000000 , 8.1673298604231] , [ 1151640000000 , 5.5132447126042] , [ 1154318400000 , 6.1152537710599] , [ 1156996800000 , 6.076765091942] , [ 1159588800000 , 4.6304473798646] , [ 1162270800000 , 4.6301068469402] , [ 1164862800000 , 4.3466656309389] , [ 1167541200000 , 6.830104897003] , [ 1170219600000 , 7.241633040029] , [ 1172638800000 , 7.1432372054153] , [ 1175313600000 , 10.608942063374] , [ 1177905600000 , 10.914964549494] , [ 1180584000000 , 10.933223880565] , [ 1183176000000 , 8.3457524851265] , [ 1185854400000 , 8.1078413081882] , [ 1188532800000 , 8.2697185922474] , [ 1191124800000 , 8.4742436475968] , [ 1193803200000 , 8.4994601179319] , [ 1196398800000 , 8.7387319683243] , [ 1199077200000 , 6.8829183612895] , [ 1201755600000 , 6.984133637885] , [ 1204261200000 , 7.0860136043287] , [ 1206936000000 , 4.3961787956053] , [ 1209528000000 , 3.8699674365231] , [ 1212206400000 , 3.6928925238305] , [ 1214798400000 , 6.7571718894253] , [ 1217476800000 , 6.4367313362344] , [ 1220155200000 , 6.4048441521454] , [ 1222747200000 , 5.4643833239669] , [ 1225425600000 , 5.3150786833374] , [ 1228021200000 , 5.3011272612576] , [ 1230699600000 , 4.1203601430809] , [ 1233378000000 , 4.0881783200525] , [ 1235797200000 , 4.1928665957189] , [ 1238472000000 , 7.0249415663205] , [ 1241064000000 , 7.006530880769] , [ 1243742400000 , 6.994835633224] , [ 1246334400000 , 6.1220222336254] , [ 1249012800000 , 6.1177436137653] , [ 1251691200000 , 6.1413396231981] , [ 1254283200000 , 4.8046006145874] , [ 1256961600000 , 4.6647600660544] , [ 1259557200000 , 4.544865006255] , [ 1262235600000 , 6.0488249316539] , [ 1264914000000 , 6.3188669540206] , [ 1267333200000 , 6.5873958262306] , [ 1270008000000 , 6.2281189839578] , [ 1272600000000 , 5.8948915746059] , [ 1275278400000 , 5.5967320482214] , [ 1277870400000 , 0.99784432084837] , [ 1280548800000 , 1.0950794175359] , [ 1283227200000 , 0.94479734407491] , [ 1285819200000 , 1.222093988688] , [ 1288497600000 , 1.335093106856] , [ 1291093200000 , 1.3302565104985] , [ 1293771600000 , 1.340824670897] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 4.4583692315] , [ 1320033600000 , 3.6493043348059] , [ 1322629200000 , 3.8610064091761] , [ 1325307600000 , 5.5144800685202] , [ 1327986000000 , 5.1750695220792] , [ 1330491600000 , 5.6710066952691] , [ 1333166400000 , 8.5658461590953] , [ 1335758400000 , 8.6135447714243] , [ 1338436800000 , 8.0231460925212]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Energy" ,
|
||||
"values" : [ [ 1138683600000 , 1.544303464167] , [ 1141102800000 , 1.4387289432421] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 1.328626801128] , [ 1154318400000 , 1.2874050802627] , [ 1156996800000 , 1.0872743105593] , [ 1159588800000 , 0.96042562635813] , [ 1162270800000 , 0.93139372870616] , [ 1164862800000 , 0.94432167305385] , [ 1167541200000 , 1.277750166208] , [ 1170219600000 , 1.2204893886811] , [ 1172638800000 , 1.207489123122] , [ 1175313600000 , 1.2490651414113] , [ 1177905600000 , 1.2593129913052] , [ 1180584000000 , 1.373329808388] , [ 1183176000000 , 0] , [ 1185854400000 , 0] , [ 1188532800000 , 0] , [ 1191124800000 , 0] , [ 1193803200000 , 0] , [ 1196398800000 , 0] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , 0] , [ 1209528000000 , 0] , [ 1212206400000 , 0] , [ 1214798400000 , 0] , [ 1217476800000 , 0] , [ 1220155200000 , 0] , [ 1222747200000 , 1.4516108933695] , [ 1225425600000 , 1.1856025268225] , [ 1228021200000 , 1.3430470355439] , [ 1230699600000 , 2.2752595354509] , [ 1233378000000 , 2.4031560010523] , [ 1235797200000 , 2.0822430731926] , [ 1238472000000 , 1.5640902826938] , [ 1241064000000 , 1.5812873972356] , [ 1243742400000 , 1.9462448548894] , [ 1246334400000 , 2.9464870223957] , [ 1249012800000 , 3.0744699383222] , [ 1251691200000 , 2.9422304628446] , [ 1254283200000 , 2.7503075599999] , [ 1256961600000 , 2.6506701800427] , [ 1259557200000 , 2.8005425319977] , [ 1262235600000 , 2.6816184971185] , [ 1264914000000 , 2.681206271327] , [ 1267333200000 , 2.8195488011259] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 1.0687057346382] , [ 1280548800000 , 1.2539400544134] , [ 1283227200000 , 1.1862969445955] , [ 1285819200000 , 0] , [ 1288497600000 , 0] , [ 1291093200000 , 0] , [ 1293771600000 , 0] , [ 1296450000000 , 1.941972859484] , [ 1298869200000 , 2.1142247697552] , [ 1301544000000 , 2.3788590206824] , [ 1304136000000 , 2.5337302877545] , [ 1306814400000 , 2.3163370395199] , [ 1309406400000 , 2.0645451843195] , [ 1312084800000 , 2.1004446672411] , [ 1314763200000 , 3.6301875804303] , [ 1317355200000 , 2.454204664652] , [ 1320033600000 , 2.196082370894] , [ 1322629200000 , 2.3358418255202] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0.39001201038526] , [ 1335758400000 , 0.30945472725559] , [ 1338436800000 , 0.31062439305591]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Financials" ,
|
||||
"values" : [ [ 1138683600000 , 13.356778764352] , [ 1141102800000 , 13.611196863271] , [ 1143781200000 , 6.895903006119] , [ 1146369600000 , 6.9939633271352] , [ 1149048000000 , 6.7241510257675] , [ 1151640000000 , 5.5611293669516] , [ 1154318400000 , 5.6086488714041] , [ 1156996800000 , 5.4962849907033] , [ 1159588800000 , 6.9193153169279] , [ 1162270800000 , 7.0016334389777] , [ 1164862800000 , 6.7865422443273] , [ 1167541200000 , 9.0006454225383] , [ 1170219600000 , 9.2233916171431] , [ 1172638800000 , 8.8929316009479] , [ 1175313600000 , 10.345937520404] , [ 1177905600000 , 10.075914677026] , [ 1180584000000 , 10.089006188111] , [ 1183176000000 , 10.598330295008] , [ 1185854400000 , 9.968954653301] , [ 1188532800000 , 9.7740580198146] , [ 1191124800000 , 10.558483060626] , [ 1193803200000 , 9.9314651823603] , [ 1196398800000 , 9.3997715873769] , [ 1199077200000 , 8.4086493387262] , [ 1201755600000 , 8.9698309085926] , [ 1204261200000 , 8.2778357995396] , [ 1206936000000 , 8.8585045600123] , [ 1209528000000 , 8.7013756413322] , [ 1212206400000 , 7.7933605469443] , [ 1214798400000 , 7.0236183483064] , [ 1217476800000 , 6.9873088186829] , [ 1220155200000 , 6.8031713070097] , [ 1222747200000 , 6.6869531315723] , [ 1225425600000 , 6.138256993963] , [ 1228021200000 , 5.6434994016354] , [ 1230699600000 , 5.495220262512] , [ 1233378000000 , 4.6885326869846] , [ 1235797200000 , 4.4524349883438] , [ 1238472000000 , 5.6766520778185] , [ 1241064000000 , 5.7675774480752] , [ 1243742400000 , 5.7882863168337] , [ 1246334400000 , 7.2666010034924] , [ 1249012800000 , 7.519182132226] , [ 1251691200000 , 7.849651451445] , [ 1254283200000 , 10.383992037985] , [ 1256961600000 , 9.0653691861818] , [ 1259557200000 , 9.6705248324159] , [ 1262235600000 , 10.856380561349] , [ 1264914000000 , 11.27452370892] , [ 1267333200000 , 11.754156529088] , [ 1270008000000 , 8.2870811422456] , [ 1272600000000 , 8.0210264360699] , [ 1275278400000 , 7.5375074474865] , [ 1277870400000 , 8.3419527338039] , [ 1280548800000 , 9.4197471818443] , [ 1283227200000 , 8.7321733185797] , [ 1285819200000 , 9.6627062648126] , [ 1288497600000 , 10.187962234549] , [ 1291093200000 , 9.8144201733476] , [ 1293771600000 , 10.275723361713] , [ 1296450000000 , 16.796066079353] , [ 1298869200000 , 17.543254984075] , [ 1301544000000 , 16.673660675084] , [ 1304136000000 , 17.963944353609] , [ 1306814400000 , 16.637740867211] , [ 1309406400000 , 15.84857094609] , [ 1312084800000 , 14.767303362182] , [ 1314763200000 , 24.778452182432] , [ 1317355200000 , 18.370353229999] , [ 1320033600000 , 15.2531374291] , [ 1322629200000 , 14.989600840649] , [ 1325307600000 , 16.052539160125] , [ 1327986000000 , 16.424390322793] , [ 1330491600000 , 17.884020741105] , [ 1333166400000 , 7.1424929577921] , [ 1335758400000 , 7.8076213051482] , [ 1338436800000 , 7.2462684949232]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Health Care" ,
|
||||
"values" : [ [ 1138683600000 , 14.212410956029] , [ 1141102800000 , 13.973193618249] , [ 1143781200000 , 15.218233920665] , [ 1146369600000 , 14.38210972745] , [ 1149048000000 , 13.894310878491] , [ 1151640000000 , 15.593086090032] , [ 1154318400000 , 16.244839695188] , [ 1156996800000 , 16.017088850646] , [ 1159588800000 , 14.183951830055] , [ 1162270800000 , 14.148523245697] , [ 1164862800000 , 13.424326059972] , [ 1167541200000 , 12.974450435753] , [ 1170219600000 , 13.23247041802] , [ 1172638800000 , 13.318762655574] , [ 1175313600000 , 15.961407746104] , [ 1177905600000 , 16.287714639805] , [ 1180584000000 , 16.246590583889] , [ 1183176000000 , 17.564505594809] , [ 1185854400000 , 17.872725373165] , [ 1188532800000 , 18.018998508757] , [ 1191124800000 , 15.584518016603] , [ 1193803200000 , 15.480850647181] , [ 1196398800000 , 15.699120036984] , [ 1199077200000 , 19.184281817226] , [ 1201755600000 , 19.691226605207] , [ 1204261200000 , 18.982314051295] , [ 1206936000000 , 18.707820309008] , [ 1209528000000 , 17.459630929761] , [ 1212206400000 , 16.500616076782] , [ 1214798400000 , 18.086324003979] , [ 1217476800000 , 18.929464156258] , [ 1220155200000 , 18.233728682084] , [ 1222747200000 , 16.315776297325] , [ 1225425600000 , 14.63289219025] , [ 1228021200000 , 14.667835024478] , [ 1230699600000 , 13.946993947308] , [ 1233378000000 , 14.394304684397] , [ 1235797200000 , 13.724462792967] , [ 1238472000000 , 10.930879035806] , [ 1241064000000 , 9.8339915513708] , [ 1243742400000 , 10.053858541872] , [ 1246334400000 , 11.786998438287] , [ 1249012800000 , 11.780994901769] , [ 1251691200000 , 11.305889670276] , [ 1254283200000 , 10.918452290083] , [ 1256961600000 , 9.6811395055706] , [ 1259557200000 , 10.971529744038] , [ 1262235600000 , 13.330210480209] , [ 1264914000000 , 14.592637568961] , [ 1267333200000 , 14.605329141157] , [ 1270008000000 , 13.936853794037] , [ 1272600000000 , 12.189480759072] , [ 1275278400000 , 11.676151385046] , [ 1277870400000 , 13.058852800017] , [ 1280548800000 , 13.62891543203] , [ 1283227200000 , 13.811107569918] , [ 1285819200000 , 13.786494560787] , [ 1288497600000 , 14.04516285753] , [ 1291093200000 , 13.697412447288] , [ 1293771600000 , 13.677681376221] , [ 1296450000000 , 19.961511864531] , [ 1298869200000 , 21.049198298158] , [ 1301544000000 , 22.687631094008] , [ 1304136000000 , 25.469010617433] , [ 1306814400000 , 24.883799437121] , [ 1309406400000 , 24.203843814248] , [ 1312084800000 , 22.138760964038] , [ 1314763200000 , 16.034636966228] , [ 1317355200000 , 15.394958944556] , [ 1320033600000 , 12.625642461969] , [ 1322629200000 , 12.973735699739] , [ 1325307600000 , 15.786018336149] , [ 1327986000000 , 15.227368020134] , [ 1330491600000 , 15.899752650734] , [ 1333166400000 , 18.994731295388] , [ 1335758400000 , 18.450055817702] , [ 1338436800000 , 17.863719889669]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Industrials" ,
|
||||
"values" : [ [ 1138683600000 , 7.1590087090398] , [ 1141102800000 , 7.1297210970108] , [ 1143781200000 , 5.5774588290586] , [ 1146369600000 , 5.4977254491156] , [ 1149048000000 , 5.5138153113634] , [ 1151640000000 , 4.3198084032122] , [ 1154318400000 , 3.9179295839125] , [ 1156996800000 , 3.8110093051479] , [ 1159588800000 , 5.5629020916939] , [ 1162270800000 , 5.7241673711336] , [ 1164862800000 , 5.4715049695004] , [ 1167541200000 , 4.9193763571618] , [ 1170219600000 , 5.136053947247] , [ 1172638800000 , 5.1327258759766] , [ 1175313600000 , 5.1888943925082] , [ 1177905600000 , 5.5191481293345] , [ 1180584000000 , 5.6093625614921] , [ 1183176000000 , 4.2706312987397] , [ 1185854400000 , 4.4453235132117] , [ 1188532800000 , 4.6228003109761] , [ 1191124800000 , 5.0645764756954] , [ 1193803200000 , 5.0723447230959] , [ 1196398800000 , 5.1457765818846] , [ 1199077200000 , 5.4067851597282] , [ 1201755600000 , 5.472241916816] , [ 1204261200000 , 5.3742740389688] , [ 1206936000000 , 6.251751933664] , [ 1209528000000 , 6.1406852153472] , [ 1212206400000 , 5.8164385627465] , [ 1214798400000 , 5.4255846656171] , [ 1217476800000 , 5.3738499417204] , [ 1220155200000 , 5.1815627753979] , [ 1222747200000 , 5.0305983235349] , [ 1225425600000 , 4.6823058607165] , [ 1228021200000 , 4.5941481589093] , [ 1230699600000 , 5.4669598474575] , [ 1233378000000 , 5.1249037357] , [ 1235797200000 , 4.3504421250742] , [ 1238472000000 , 4.6260881026002] , [ 1241064000000 , 5.0140402458946] , [ 1243742400000 , 4.7458462454774] , [ 1246334400000 , 6.0437019654564] , [ 1249012800000 , 6.4595216249754] , [ 1251691200000 , 6.6420468254155] , [ 1254283200000 , 5.8927271960913] , [ 1256961600000 , 5.4712108838003] , [ 1259557200000 , 6.1220254207747] , [ 1262235600000 , 5.5385935169255] , [ 1264914000000 , 5.7383377612639] , [ 1267333200000 , 6.1715976730415] , [ 1270008000000 , 4.0102262681174] , [ 1272600000000 , 3.769389679692] , [ 1275278400000 , 3.5301571031152] , [ 1277870400000 , 2.7660252652526] , [ 1280548800000 , 3.1409983385775] , [ 1283227200000 , 3.0528024863055] , [ 1285819200000 , 4.3126123157971] , [ 1288497600000 , 4.594654041683] , [ 1291093200000 , 4.5424126126793] , [ 1293771600000 , 4.7790043987302] , [ 1296450000000 , 7.4969154058289] , [ 1298869200000 , 7.9424751557821] , [ 1301544000000 , 7.1560736250547] , [ 1304136000000 , 7.9478117337855] , [ 1306814400000 , 7.4109214848895] , [ 1309406400000 , 7.5966457641101] , [ 1312084800000 , 7.165754444071] , [ 1314763200000 , 5.4816702524302] , [ 1317355200000 , 4.9893656089584] , [ 1320033600000 , 4.498385105327] , [ 1322629200000 , 4.6776090358151] , [ 1325307600000 , 8.1350814368063] , [ 1327986000000 , 8.0732769990652] , [ 1330491600000 , 8.5602340387277] , [ 1333166400000 , 5.1293714074325] , [ 1335758400000 , 5.2586794619016] , [ 1338436800000 , 5.1100853569977]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Information Technology" ,
|
||||
"values" : [ [ 1138683600000 , 13.242301508051] , [ 1141102800000 , 12.863536342042] , [ 1143781200000 , 21.034044171629] , [ 1146369600000 , 21.419084618803] , [ 1149048000000 , 21.142678863691] , [ 1151640000000 , 26.568489677529] , [ 1154318400000 , 24.839144939905] , [ 1156996800000 , 25.456187462167] , [ 1159588800000 , 26.350164502826] , [ 1162270800000 , 26.47833320519] , [ 1164862800000 , 26.425979547847] , [ 1167541200000 , 28.191461582256] , [ 1170219600000 , 28.930307448808] , [ 1172638800000 , 29.521413891117] , [ 1175313600000 , 28.188285966466] , [ 1177905600000 , 27.704619625832] , [ 1180584000000 , 27.490862424829] , [ 1183176000000 , 28.770679721286] , [ 1185854400000 , 29.060480671449] , [ 1188532800000 , 28.240998844973] , [ 1191124800000 , 33.004893194127] , [ 1193803200000 , 34.075180359928] , [ 1196398800000 , 32.548560664833] , [ 1199077200000 , 30.629727432728] , [ 1201755600000 , 28.642858788159] , [ 1204261200000 , 27.973575227842] , [ 1206936000000 , 27.393351882726] , [ 1209528000000 , 28.476095288523] , [ 1212206400000 , 29.29667866426] , [ 1214798400000 , 29.222333802896] , [ 1217476800000 , 28.092966093843] , [ 1220155200000 , 28.107159262922] , [ 1222747200000 , 25.482974832098] , [ 1225425600000 , 21.208115993834] , [ 1228021200000 , 20.295043095268] , [ 1230699600000 , 15.925754618401] , [ 1233378000000 , 17.162864628346] , [ 1235797200000 , 17.084345773174] , [ 1238472000000 , 22.246007102281] , [ 1241064000000 , 24.530543998509] , [ 1243742400000 , 25.084184918242] , [ 1246334400000 , 16.606166527358] , [ 1249012800000 , 17.239620011628] , [ 1251691200000 , 17.336739127379] , [ 1254283200000 , 25.478492475753] , [ 1256961600000 , 23.017152085245] , [ 1259557200000 , 25.617745423683] , [ 1262235600000 , 24.061133998642] , [ 1264914000000 , 23.223933318644] , [ 1267333200000 , 24.425887263937] , [ 1270008000000 , 35.501471156693] , [ 1272600000000 , 33.775013878676] , [ 1275278400000 , 30.417993630285] , [ 1277870400000 , 30.023598978467] , [ 1280548800000 , 33.327519522436] , [ 1283227200000 , 31.963388450371] , [ 1285819200000 , 30.498967232092] , [ 1288497600000 , 32.403696817912] , [ 1291093200000 , 31.47736071922] , [ 1293771600000 , 31.53259666241] , [ 1296450000000 , 41.760282761548] , [ 1298869200000 , 45.605771243237] , [ 1301544000000 , 39.986557966215] , [ 1304136000000 , 43.846330510051] , [ 1306814400000 , 39.857316881857] , [ 1309406400000 , 37.675127768208] , [ 1312084800000 , 35.775077970313] , [ 1314763200000 , 48.631009702577] , [ 1317355200000 , 42.830831754505] , [ 1320033600000 , 35.611502589362] , [ 1322629200000 , 35.320136981738] , [ 1325307600000 , 31.564136901516] , [ 1327986000000 , 32.074407502433] , [ 1330491600000 , 35.053013769976] , [ 1333166400000 , 26.434568573937] , [ 1335758400000 , 25.305617871002] , [ 1338436800000 , 24.520919418236]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Materials" ,
|
||||
"values" : [ [ 1138683600000 , 5.5806167415681] , [ 1141102800000 , 5.4539047069985] , [ 1143781200000 , 7.6728842432362] , [ 1146369600000 , 7.719946716654] , [ 1149048000000 , 8.0144619912942] , [ 1151640000000 , 7.942223133434] , [ 1154318400000 , 8.3998279827444] , [ 1156996800000 , 8.532324572605] , [ 1159588800000 , 4.7324285199763] , [ 1162270800000 , 4.7402397487697] , [ 1164862800000 , 4.9042069355168] , [ 1167541200000 , 5.9583963430882] , [ 1170219600000 , 6.3693899239171] , [ 1172638800000 , 6.261153903813] , [ 1175313600000 , 5.3443942184584] , [ 1177905600000 , 5.4932111235361] , [ 1180584000000 , 5.5747393101109] , [ 1183176000000 , 5.3833633060013] , [ 1185854400000 , 5.5125898831832] , [ 1188532800000 , 5.8116112661327] , [ 1191124800000 , 4.3962296939996] , [ 1193803200000 , 4.6967663605521] , [ 1196398800000 , 4.7963004350914] , [ 1199077200000 , 4.1817985183351] , [ 1201755600000 , 4.3797643870182] , [ 1204261200000 , 4.6966642197965] , [ 1206936000000 , 4.3609995132565] , [ 1209528000000 , 4.4736290996496] , [ 1212206400000 , 4.3749762738128] , [ 1214798400000 , 3.3274661194507] , [ 1217476800000 , 3.0316184691337] , [ 1220155200000 , 2.5718140204728] , [ 1222747200000 , 2.7034994044603] , [ 1225425600000 , 2.2033786591364] , [ 1228021200000 , 1.9850621240805] , [ 1230699600000 , 0] , [ 1233378000000 , 0] , [ 1235797200000 , 0] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , 0] , [ 1249012800000 , 0] , [ 1251691200000 , 0] , [ 1254283200000 , 0.44495950017788] , [ 1256961600000 , 0.33945469262483] , [ 1259557200000 , 0.38348269455195] , [ 1262235600000 , 0] , [ 1264914000000 , 0] , [ 1267333200000 , 0] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 0] , [ 1288497600000 , 0] , [ 1291093200000 , 0] , [ 1293771600000 , 0] , [ 1296450000000 , 0.52216435716176] , [ 1298869200000 , 0.59275786698454] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 0] , [ 1320033600000 , 0] , [ 1322629200000 , 0] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0] , [ 1335758400000 , 0] , [ 1338436800000 , 0]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Telecommunication Services" ,
|
||||
"values" : [ [ 1138683600000 , 3.7056975170243] , [ 1141102800000 , 3.7561118692318] , [ 1143781200000 , 2.861913700854] , [ 1146369600000 , 2.9933744103381] , [ 1149048000000 , 2.7127537218463] , [ 1151640000000 , 3.1195497076283] , [ 1154318400000 , 3.4066964004508] , [ 1156996800000 , 3.3754571113569] , [ 1159588800000 , 2.2965579982924] , [ 1162270800000 , 2.4486818633018] , [ 1164862800000 , 2.4002308848517] , [ 1167541200000 , 1.9649579750349] , [ 1170219600000 , 1.9385263638056] , [ 1172638800000 , 1.9128975336387] , [ 1175313600000 , 2.3412869836298] , [ 1177905600000 , 2.4337870351445] , [ 1180584000000 , 2.62179703171] , [ 1183176000000 , 3.2642864957929] , [ 1185854400000 , 3.3200396223709] , [ 1188532800000 , 3.3934212707572] , [ 1191124800000 , 4.2822327088179] , [ 1193803200000 , 4.1474964228541] , [ 1196398800000 , 4.1477082879801] , [ 1199077200000 , 5.2947122916128] , [ 1201755600000 , 5.2919843508028] , [ 1204261200000 , 5.1989783050309] , [ 1206936000000 , 3.5603057673513] , [ 1209528000000 , 3.3009087690692] , [ 1212206400000 , 3.1784852603792] , [ 1214798400000 , 4.5889503538868] , [ 1217476800000 , 4.401779617494] , [ 1220155200000 , 4.2208301828278] , [ 1222747200000 , 3.89396671475] , [ 1225425600000 , 3.0423832241354] , [ 1228021200000 , 3.135520611578] , [ 1230699600000 , 1.9631418164089] , [ 1233378000000 , 1.8963543874958] , [ 1235797200000 , 1.8266636017025] , [ 1238472000000 , 0.93136635895188] , [ 1241064000000 , 0.92737801918888] , [ 1243742400000 , 0.97591889805002] , [ 1246334400000 , 2.6841193805515] , [ 1249012800000 , 2.5664341140531] , [ 1251691200000 , 2.3887523699873] , [ 1254283200000 , 1.1737801663681] , [ 1256961600000 , 1.0953582317281] , [ 1259557200000 , 1.2495674976653] , [ 1262235600000 , 0.36607452464754] , [ 1264914000000 , 0.3548719047291] , [ 1267333200000 , 0.36769242398939] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 0.85450741275337] , [ 1288497600000 , 0.91360317921637] , [ 1291093200000 , 0.89647678692269] , [ 1293771600000 , 0.87800687192639] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0.43668720882994] , [ 1304136000000 , 0.4756523602692] , [ 1306814400000 , 0.46947368328469] , [ 1309406400000 , 0.45138896152316] , [ 1312084800000 , 0.43828726648117] , [ 1314763200000 , 2.0820861395316] , [ 1317355200000 , 0.9364411075395] , [ 1320033600000 , 0.60583907839773] , [ 1322629200000 , 0.61096950747437] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0] , [ 1335758400000 , 0] , [ 1338436800000 , 0]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Utilities" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 0] , [ 1162270800000 , 0] , [ 1164862800000 , 0] , [ 1167541200000 , 0] , [ 1170219600000 , 0] , [ 1172638800000 , 0] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , 0] , [ 1185854400000 , 0] , [ 1188532800000 , 0] , [ 1191124800000 , 0] , [ 1193803200000 , 0] , [ 1196398800000 , 0] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , 0] , [ 1209528000000 , 0] , [ 1212206400000 , 0] , [ 1214798400000 , 0] , [ 1217476800000 , 0] , [ 1220155200000 , 0] , [ 1222747200000 , 0] , [ 1225425600000 , 0] , [ 1228021200000 , 0] , [ 1230699600000 , 0] , [ 1233378000000 , 0] , [ 1235797200000 , 0] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , 0] , [ 1249012800000 , 0] , [ 1251691200000 , 0] , [ 1254283200000 , 0] , [ 1256961600000 , 0] , [ 1259557200000 , 0] , [ 1262235600000 , 0] , [ 1264914000000 , 0] , [ 1267333200000 , 0] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 0] , [ 1288497600000 , 0] , [ 1291093200000 , 0] , [ 1293771600000 , 0] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 0] , [ 1320033600000 , 0] , [ 1322629200000 , 0] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0] , [ 1335758400000 , 0] , [ 1338436800000 , 0]]
|
||||
}
|
||||
];
|
||||
|
||||
var histcatexpshort = [
|
||||
{
|
||||
"key" : "Consumer Staples" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 0] , [ 1162270800000 , 0] , [ 1164862800000 , 0] , [ 1167541200000 , -0.24102139376003] , [ 1170219600000 , -0.69960584365035] , [ 1172638800000 , -0.67365051426185] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , -0.31429312464988] , [ 1185854400000 , -0.90018700397153] , [ 1188532800000 , -0.96926214328714] , [ 1191124800000 , -1.1343386468131] , [ 1193803200000 , -1.1335426595455] , [ 1196398800000 , -1.2327663032424] , [ 1199077200000 , -0.41027135492155] , [ 1201755600000 , -0.41779167524802] , [ 1204261200000 , -0.38133883625885] , [ 1206936000000 , 0] , [ 1209528000000 , -0.32550520320253] , [ 1212206400000 , -0.33185144615505] , [ 1214798400000 , -0.68609668877894] , [ 1217476800000 , -0.70001207744308] , [ 1220155200000 , -0.68378680840919] , [ 1222747200000 , -0.40908783182034] , [ 1225425600000 , -0.39074266525646] , [ 1228021200000 , -0.40358490474562] , [ 1230699600000 , -0.85752207262267] , [ 1233378000000 , -0.74395750438805] , [ 1235797200000 , -0.70718832429489] , [ 1238472000000 , -0.76244465406965] , [ 1241064000000 , -0.67618572591984] , [ 1243742400000 , -0.67649596761402] , [ 1246334400000 , -0.94618002703247] , [ 1249012800000 , -0.95408485581014] , [ 1251691200000 , -0.96272139504276] , [ 1254283200000 , 0] , [ 1256961600000 , 0] , [ 1259557200000 , 0] , [ 1262235600000 , 0] , [ 1264914000000 , 0] , [ 1267333200000 , 0] , [ 1270008000000 , -0.25516420149471] , [ 1272600000000 , -0.24106264576017] , [ 1275278400000 , -0.22802547751448] , [ 1277870400000 , -0.62187524046697] , [ 1280548800000 , -0.72155608677106] , [ 1283227200000 , -0.70221659944774] , [ 1285819200000 , -1.1117002584543] , [ 1288497600000 , -1.190911001336] , [ 1291093200000 , -1.1781082003972] , [ 1293771600000 , -1.2125860264875] , [ 1296450000000 , -1.7748010365657] , [ 1298869200000 , -1.8919594178596] , [ 1301544000000 , -1.7077946421533] , [ 1304136000000 , -2.024238803094] , [ 1306814400000 , -1.9769844081819] , [ 1309406400000 , -2.0730275464065] , [ 1312084800000 , -1.9690128240888] , [ 1314763200000 , -5.5557852269348] , [ 1317355200000 , -7.2527933190641] , [ 1320033600000 , -5.7367677053109] , [ 1322629200000 , -6.0409316206662] , [ 1325307600000 , -4.6511525539195] , [ 1327986000000 , -4.526116059083] , [ 1330491600000 , -4.846292325197] , [ 1333166400000 , -2.2663198779425] , [ 1335758400000 , -2.4172072568564] , [ 1338436800000 , -2.3204729601189]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Consumer Discretionary" ,
|
||||
"values" : [ [ 1138683600000 , -0.62238434102863] , [ 1141102800000 , -0.61484565039024] , [ 1143781200000 , -1.0769367918668] , [ 1146369600000 , -1.2221156604129] , [ 1149048000000 , -1.2434858263377] , [ 1151640000000 , -0.58606435489597] , [ 1154318400000 , -0.61478911495141] , [ 1156996800000 , -0.61429362688591] , [ 1159588800000 , -1.1168614112788] , [ 1162270800000 , -1.1510268716612] , [ 1164862800000 , -1.1104724164222] , [ 1167541200000 , -1.2298338563471] , [ 1170219600000 , -1.5053664389104] , [ 1172638800000 , -1.5535266372193] , [ 1175313600000 , -3.1690472535854] , [ 1177905600000 , -3.1273013967041] , [ 1180584000000 , -3.155466271777] , [ 1183176000000 , -3.7158562579437] , [ 1185854400000 , -3.8244546635586] , [ 1188532800000 , -3.5524464859972] , [ 1191124800000 , -3.0472339109128] , [ 1193803200000 , -3.064978140815] , [ 1196398800000 , -3.0818130124986] , [ 1199077200000 , -2.9806791138312] , [ 1201755600000 , -3.7360958775824] , [ 1204261200000 , -3.4687841733263] , [ 1206936000000 , -3.3702018615806] , [ 1209528000000 , -3.1982756208679] , [ 1212206400000 , -3.0489433155104] , [ 1214798400000 , -3.7008275605963] , [ 1217476800000 , -3.8980507260892] , [ 1220155200000 , -3.7680083260241] , [ 1222747200000 , -3.2061890012391] , [ 1225425600000 , -2.6727551440484] , [ 1228021200000 , -2.4469327462935] , [ 1230699600000 , -3.0192419668784] , [ 1233378000000 , -2.892958553476] , [ 1235797200000 , -3.1153570053479] , [ 1238472000000 , -2.9927580570711] , [ 1241064000000 , -3.5061796706294] , [ 1243742400000 , -3.2944159516725] , [ 1246334400000 , -3.4154213240617] , [ 1249012800000 , -3.6492125438171] , [ 1251691200000 , -3.6674164998394] , [ 1254283200000 , -4.6271484977727] , [ 1256961600000 , -4.2433407292676] , [ 1259557200000 , -4.4742625247274] , [ 1262235600000 , -5.2078214612359] , [ 1264914000000 , -5.2209579214469] , [ 1267333200000 , -5.4596395756061] , [ 1270008000000 , -5.6906459276584] , [ 1272600000000 , -6.4981737808665] , [ 1275278400000 , -6.2563044048578] , [ 1277870400000 , -6.175479487959] , [ 1280548800000 , -6.6641002427295] , [ 1283227200000 , -6.3648667745556] , [ 1285819200000 , -5.0270168607884] , [ 1288497600000 , -5.1186072976233] , [ 1291093200000 , -5.1127601587872] , [ 1293771600000 , -5.3015262972641] , [ 1296450000000 , -4.4295728671596] , [ 1298869200000 , -4.5488139745696] , [ 1301544000000 , -2.9021260315957] , [ 1304136000000 , -3.1482096241139] , [ 1306814400000 , -2.8648831814763] , [ 1309406400000 , -2.8149423433441] , [ 1312084800000 , -2.6350669145713] , [ 1314763200000 , -5.9871754759038] , [ 1317355200000 , -8.6127555816399] , [ 1320033600000 , -7.0712887348892] , [ 1322629200000 , -7.3930257999857] , [ 1325307600000 , -6.5183071556304] , [ 1327986000000 , -7.4388913793503] , [ 1330491600000 , -8.2134465182649] , [ 1333166400000 , -7.7836036697105] , [ 1335758400000 , -8.0955053683936] , [ 1338436800000 , -8.0981845818893]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Energy" ,
|
||||
"values" : [ [ 1138683600000 , -0.95707527558303] , [ 1141102800000 , -0.78324346694487] , [ 1143781200000 , -1.2905241058019] , [ 1146369600000 , -1.3880880486779] , [ 1149048000000 , -1.3337247185993] , [ 1151640000000 , -1.0342112071924] , [ 1154318400000 , -1.1264764100183] , [ 1156996800000 , -1.0001002640852] , [ 1159588800000 , -0.85341153093953] , [ 1162270800000 , -0.88452017844596] , [ 1164862800000 , -0.84305725300642] , [ 1167541200000 , -1.0874455682301] , [ 1170219600000 , -1.1714969043168] , [ 1172638800000 , -1.1445856467934] , [ 1175313600000 , -1.1928513334073] , [ 1177905600000 , -1.2365691634265] , [ 1180584000000 , -1.2690940962478] , [ 1183176000000 , -1.662233774695] , [ 1185854400000 , -1.745760538781] , [ 1188532800000 , -1.5209200931271] , [ 1191124800000 , -1.7874791820886] , [ 1193803200000 , -1.7755668105117] , [ 1196398800000 , -1.5456069064618] , [ 1199077200000 , -1.7077541586335] , [ 1201755600000 , -1.6462081650757] , [ 1204261200000 , -1.8624735339628] , [ 1206936000000 , -0.71073453533048] , [ 1209528000000 , -0.75380709640219] , [ 1212206400000 , -0.71020554911716] , [ 1214798400000 , -1.2077850914504] , [ 1217476800000 , -1.0505576787644] , [ 1220155200000 , -0.97804595164878] , [ 1222747200000 , -0.34591294663671] , [ 1225425600000 , -0.19958331514025] , [ 1228021200000 , -0.17599782216296] , [ 1230699600000 , -0.49577714121027] , [ 1233378000000 , -0.51644059173978] , [ 1235797200000 , -0.48576859637083] , [ 1238472000000 , -0.75596531126452] , [ 1241064000000 , -0.72073358315801] , [ 1243742400000 , -0.82125996732294] , [ 1246334400000 , -1.4933216860121] , [ 1249012800000 , -1.5003760525933] , [ 1251691200000 , -1.4744921420596] , [ 1254283200000 , -1.8197844060652] , [ 1256961600000 , -1.6558574419626] , [ 1259557200000 , -1.7256149254159] , [ 1262235600000 , -2.7667194124217] , [ 1264914000000 , -2.9113351806903] , [ 1267333200000 , -3.0172806042796] , [ 1270008000000 , -2.8607175559701] , [ 1272600000000 , -2.629226972169] , [ 1275278400000 , -2.1855196883832] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , -1.3788733828844] , [ 1288497600000 , -1.4136792139765] , [ 1291093200000 , -1.5176522942901] , [ 1293771600000 , -1.5776651933208] , [ 1296450000000 , -1.7171675182182] , [ 1298869200000 , -1.8121885250566] , [ 1301544000000 , -1.2221934283206] , [ 1304136000000 , -1.2910715239439] , [ 1306814400000 , -1.1492301612576] , [ 1309406400000 , -1.0613891302841] , [ 1312084800000 , -0.99605193205308] , [ 1314763200000 , -1.7324212072278] , [ 1317355200000 , -1.5226856867477] , [ 1320033600000 , -1.3159138896549] , [ 1322629200000 , -1.3925952659299] , [ 1325307600000 , -1.59624913621] , [ 1327986000000 , -1.5235879880296] , [ 1330491600000 , -1.7315573519279] , [ 1333166400000 , -0.86883431220926] , [ 1335758400000 , -0.90144871282829] , [ 1338436800000 , -0.7010492182517]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Financials" ,
|
||||
"values" : [ [ 1138683600000 , -0.56797103580254] , [ 1141102800000 , -0.57324319174933] , [ 1143781200000 , -1.1014818753272] , [ 1146369600000 , -1.1480256918118] , [ 1149048000000 , -1.0709335336775] , [ 1151640000000 , -0.84876993929658] , [ 1154318400000 , -0.88122638919979] , [ 1156996800000 , -0.86421146074279] , [ 1159588800000 , -0.95093689377974] , [ 1162270800000 , -0.96646862382248] , [ 1164862800000 , -0.96726919442167] , [ 1167541200000 , -0.99874655234936] , [ 1170219600000 , -1.0004843898938] , [ 1172638800000 , -0.9925349676815] , [ 1175313600000 , -1.1888941931287] , [ 1177905600000 , -1.9402228220929] , [ 1180584000000 , -2.03915987194] , [ 1183176000000 , -2.4620526931074] , [ 1185854400000 , -2.2423544651877] , [ 1188532800000 , -1.8790998536037] , [ 1191124800000 , -0.43246873489492] , [ 1193803200000 , -0.40142684216371] , [ 1196398800000 , -0.35646635110466] , [ 1199077200000 , -0.90385702817642] , [ 1201755600000 , -0.86997575249605] , [ 1204261200000 , -0.80101406775415] , [ 1206936000000 , 0] , [ 1209528000000 , 0] , [ 1212206400000 , 0] , [ 1214798400000 , -0.31816167663298] , [ 1217476800000 , -0.309250081849] , [ 1220155200000 , -0.27723698582762] , [ 1222747200000 , -0.32001379372079] , [ 1225425600000 , -0.1940212908561] , [ 1228021200000 , -0.051964569203423] , [ 1230699600000 , -0.68342686502452] , [ 1233378000000 , -0.57645644730726] , [ 1235797200000 , -0.50860972184555] , [ 1238472000000 , -0.44405217759605] , [ 1241064000000 , -0.45224333626901] , [ 1243742400000 , -0.41691818252313] , [ 1246334400000 , -2.4654561579904] , [ 1249012800000 , -2.5473566378551] , [ 1251691200000 , -2.8340604021307] , [ 1254283200000 , -1.8452445924041] , [ 1256961600000 , -1.5626544265386] , [ 1259557200000 , -1.707842764916] , [ 1262235600000 , -1.2237258567344] , [ 1264914000000 , -1.9756896168227] , [ 1267333200000 , -2.0920321696833] , [ 1270008000000 , -1.9782327706952] , [ 1272600000000 , -2.0416328165753] , [ 1275278400000 , -1.7816736134798] , [ 1277870400000 , -0.66092275437689] , [ 1280548800000 , -0.73608099025756] , [ 1283227200000 , -0.63686713461189] , [ 1285819200000 , -0.0024159482973197] , [ 1288497600000 , -0.0023052643588188] , [ 1291093200000 , -0.0023008251965446] , [ 1293771600000 , -0.002247807834351] , [ 1296450000000 , -0.62004345920743] , [ 1298869200000 , -0.69634926653235] , [ 1301544000000 , -0.76013525555354] , [ 1304136000000 , -1.505368495849] , [ 1306814400000 , -1.3456949237707] , [ 1309406400000 , -1.3013934898695] , [ 1312084800000 , -1.183199519395] , [ 1314763200000 , -0.0074317809719494] , [ 1317355200000 , -0.019430458325379] , [ 1320033600000 , -0.015777413509084] , [ 1322629200000 , -0.016463879837718] , [ 1325307600000 , -0.0031338919976225] , [ 1327986000000 , -0.0029770278967514] , [ 1330491600000 , -0.003048902987439] , [ 1333166400000 , -0.71171545945298] , [ 1335758400000 , -0.72003299240508] , [ 1338436800000 , -0.72961974845039]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Health Care" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 0] , [ 1162270800000 , 0] , [ 1164862800000 , 0] , [ 1167541200000 , 0] , [ 1170219600000 , 0] , [ 1172638800000 , 0] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , -0.16816074963595] , [ 1185854400000 , -0.19318598121302] , [ 1188532800000 , -0.20130864403797] , [ 1191124800000 , 0] , [ 1193803200000 , 0] , [ 1196398800000 , 0] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , 0] , [ 1209528000000 , 0] , [ 1212206400000 , 0] , [ 1214798400000 , -0.30476443991021] , [ 1217476800000 , -0.31836730824777] , [ 1220155200000 , -0.30797427879366] , [ 1222747200000 , -0.48318623977865] , [ 1225425600000 , -0.50834562674351] , [ 1228021200000 , -0.47936068182503] , [ 1230699600000 , -0.61753010081956] , [ 1233378000000 , -0.59493587396819] , [ 1235797200000 , -0.62664324339064] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , 0] , [ 1249012800000 , 0] , [ 1251691200000 , 0] , [ 1254283200000 , -1.3076157801726] , [ 1256961600000 , -1.2306204787628] , [ 1259557200000 , -1.4728435992801] , [ 1262235600000 , -1.7729831226837] , [ 1264914000000 , -1.7711733839842] , [ 1267333200000 , -1.8233584472099] , [ 1270008000000 , -1.8505979461969] , [ 1272600000000 , -1.5989071613823] , [ 1275278400000 , -1.6636770720413] , [ 1277870400000 , -1.4523909758725] , [ 1280548800000 , -1.503771584105] , [ 1283227200000 , -1.5458561450475] , [ 1285819200000 , -1.457331837483] , [ 1288497600000 , -1.4217332434071] , [ 1291093200000 , -1.4687927303394] , [ 1293771600000 , -1.437223057967] , [ 1296450000000 , -0.72221871524334] , [ 1298869200000 , -0.7399575414588] , [ 1301544000000 , -1.9712239746745] , [ 1304136000000 , -2.2360949351942] , [ 1306814400000 , -2.2147572530541] , [ 1309406400000 , -2.0440932285023] , [ 1312084800000 , -1.9438209561938] , [ 1314763200000 , -4.9035620630386] , [ 1317355200000 , -4.9036674804213] , [ 1320033600000 , -4.1900706458801] , [ 1322629200000 , -4.5602615827955] , [ 1325307600000 , -1.9194421885814] , [ 1327986000000 , -1.8854470816382] , [ 1330491600000 , -1.9514785018245] , [ 1333166400000 , -0.65282205870454] , [ 1335758400000 , -0.57068368199209] , [ 1338436800000 , -0.55902563384907]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Industrials" ,
|
||||
"values" : [ [ 1138683600000 , -0.390983707093] , [ 1141102800000 , -0.38471122730537] , [ 1143781200000 , -0.22897173467143] , [ 1146369600000 , -0.23798946472286] , [ 1149048000000 , -0.20721233428173] , [ 1151640000000 , -0.54577697700394] , [ 1154318400000 , -0.50300252995937] , [ 1156996800000 , -0.49609518628103] , [ 1159588800000 , -0.19582276889273] , [ 1162270800000 , -0.60399139945108] , [ 1164862800000 , -0.61477368082886] , [ 1167541200000 , -0.13665869881705] , [ 1170219600000 , -0.13147565243332] , [ 1172638800000 , -0.11819441593356] , [ 1175313600000 , -0.41610825689528] , [ 1177905600000 , -0.38815419659358] , [ 1180584000000 , -0.3703838943035] , [ 1183176000000 , -1.6193903804534] , [ 1185854400000 , -1.6502660417328] , [ 1188532800000 , -1.481875010149] , [ 1191124800000 , -0.96180099322536] , [ 1193803200000 , -0.97017301394967] , [ 1196398800000 , -0.97432971260093] , [ 1199077200000 , -0.36071934518387] , [ 1201755600000 , -0.42150070991777] , [ 1204261200000 , -0.41784042793202] , [ 1206936000000 , -0.70494708349169] , [ 1209528000000 , -0.73449590911984] , [ 1212206400000 , -0.7400163600788] , [ 1214798400000 , -0.52584502195668] , [ 1217476800000 , -0.56224806965368] , [ 1220155200000 , -0.50830855192741] , [ 1222747200000 , -0.79494637898049] , [ 1225425600000 , -0.70391433947286] , [ 1228021200000 , -0.61420660317009] , [ 1230699600000 , -0.41699636242004] , [ 1233378000000 , -0.3779041158185] , [ 1235797200000 , -0.34282498854047] , [ 1238472000000 , -0.83845630450592] , [ 1241064000000 , -0.85937944918912] , [ 1243742400000 , -0.85530287999615] , [ 1246334400000 , -1.2819866264007] , [ 1249012800000 , -1.4598491663715] , [ 1251691200000 , -1.5261472177779] , [ 1254283200000 , -1.2503948993549] , [ 1256961600000 , -1.1767079775724] , [ 1259557200000 , -1.2585538260386] , [ 1262235600000 , -3.420972598165] , [ 1264914000000 , -3.3381337072954] , [ 1267333200000 , -3.7043129330694] , [ 1270008000000 , -4.6924500756609] , [ 1272600000000 , -4.6880683704908] , [ 1275278400000 , -4.3335249071719] , [ 1277870400000 , -3.6545810416445] , [ 1280548800000 , -4.1639787701262] , [ 1283227200000 , -3.8249597612047] , [ 1285819200000 , -0.33221815335641] , [ 1288497600000 , -0.33346468179047] , [ 1291093200000 , -0.34546911228789] , [ 1293771600000 , -0.36609971997147] , [ 1296450000000 , -0.42502545672607] , [ 1298869200000 , -0.38192733348507] , [ 1301544000000 , -0.01991033447621] , [ 1304136000000 , -0.020319195299659] , [ 1306814400000 , -0.018147820835144] , [ 1309406400000 , -0.017923186209383] , [ 1312084800000 , -0.016133999253684] , [ 1314763200000 , -0.72058656278977] , [ 1317355200000 , -0.42812646564889] , [ 1320033600000 , -0.35896134792589] , [ 1322629200000 , -0.38637896444549] , [ 1325307600000 , -0.31794663984021] , [ 1327986000000 , -0.32220831831888] , [ 1330491600000 , -0.37107872672214] , [ 1333166400000 , -0.81968633933695] , [ 1335758400000 , -0.77148300885994] , [ 1338436800000 , -0.77392261735539]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Information Technology" ,
|
||||
"values" : [ [ 1138683600000 , -0.86346955704548] , [ 1141102800000 , -0.88352373534584] , [ 1143781200000 , -1.2630802711685] , [ 1146369600000 , -1.2352593999242] , [ 1149048000000 , -1.2086379045093] , [ 1151640000000 , -1.0416778473647] , [ 1154318400000 , -0.99326278105154] , [ 1156996800000 , -1.0095045907007] , [ 1159588800000 , -2.0762515478576] , [ 1162270800000 , -2.13066829429] , [ 1164862800000 , -2.2458400474235] , [ 1167541200000 , -2.1315262677135] , [ 1170219600000 , -2.4063108252146] , [ 1172638800000 , -2.3753290631454] , [ 1175313600000 , -2.1119577565913] , [ 1177905600000 , -2.1546804750397] , [ 1180584000000 , -2.3768374034303] , [ 1183176000000 , -1.244878330098] , [ 1185854400000 , -1.2233210265236] , [ 1188532800000 , -1.1715073644317] , [ 1191124800000 , -1.0036136395928] , [ 1193803200000 , -0.9510676777939] , [ 1196398800000 , -0.97553526602196] , [ 1199077200000 , -1.9083849411912] , [ 1201755600000 , -1.855965027796] , [ 1204261200000 , -1.7343633512402] , [ 1206936000000 , -2.1847032903649] , [ 1209528000000 , -2.2095446284368] , [ 1212206400000 , -2.2060678671735] , [ 1214798400000 , -1.0941627910924] , [ 1217476800000 , -1.0004352405294] , [ 1220155200000 , -0.93563501378075] , [ 1222747200000 , 0] , [ 1225425600000 , -0.65155092645953] , [ 1228021200000 , -0.66021585164047] , [ 1230699600000 , 0] , [ 1233378000000 , 0] , [ 1235797200000 , 0] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , 0] , [ 1249012800000 , 0] , [ 1251691200000 , 0] , [ 1254283200000 , -0.29297573068109] , [ 1256961600000 , -0.75043756379084] , [ 1259557200000 , -0.85690846482745] , [ 1262235600000 , -0.21937480770873] , [ 1264914000000 , -0.93232569935343] , [ 1267333200000 , -0.94180327525084] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , -0.21253553193891] , [ 1288497600000 , -0.23178244747722] , [ 1291093200000 , -0.21481706129968] , [ 1293771600000 , -0.23306463011242] , [ 1296450000000 , -0.90244048159158] , [ 1298869200000 , -1.0410052083529] , [ 1301544000000 , -2.209350937089] , [ 1304136000000 , -2.6540796712932] , [ 1306814400000 , -3.2481210590957] , [ 1309406400000 , -3.0717986354635] , [ 1312084800000 , -2.7493296528921] , [ 1314763200000 , -2.1973991293256] , [ 1317355200000 , -0.86403111842659] , [ 1320033600000 , -0.87824756160219] , [ 1322629200000 , -0.80812571482871] , [ 1325307600000 , -1.6419820357151] , [ 1327986000000 , -1.6893790342619] , [ 1330491600000 , -1.8614499455474] , [ 1333166400000 , -1.814727017516] , [ 1335758400000 , -1.8744942128618] , [ 1338436800000 , -1.7880124850882]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Materials" ,
|
||||
"values" : [ [ 1138683600000 , -0.26079769654951] , [ 1141102800000 , -0.23368425410881] , [ 1143781200000 , -0.46285283466193] , [ 1146369600000 , -0.4588429059205] , [ 1149048000000 , -0.43055120080853] , [ 1151640000000 , -0.26428963363642] , [ 1154318400000 , -0.26203611963364] , [ 1156996800000 , -0.26706156717825] , [ 1159588800000 , -0.024613610779192] , [ 1162270800000 , -0.024351047945929] , [ 1164862800000 , -0.031497065480344] , [ 1167541200000 , 0] , [ 1170219600000 , 0] , [ 1172638800000 , 0] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , 0] , [ 1185854400000 , 0] , [ 1188532800000 , 0] , [ 1191124800000 , 0] , [ 1193803200000 , 0] , [ 1196398800000 , 0] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , -0.83875613435932] , [ 1209528000000 , -0.84367445572656] , [ 1212206400000 , -0.78928126005463] , [ 1214798400000 , -1.1075954825404] , [ 1217476800000 , -1.2704836497926] , [ 1220155200000 , -1.307504052056] , [ 1222747200000 , -0.70440409992826] , [ 1225425600000 , -0.74122140007729] , [ 1228021200000 , -0.82224393045109] , [ 1230699600000 , -1.8719055314571] , [ 1233378000000 , -1.5200311233975] , [ 1235797200000 , -1.5552386899059] , [ 1238472000000 , -1.1576593040773] , [ 1241064000000 , -1.0757811060575] , [ 1243742400000 , -1.0250125722511] , [ 1246334400000 , -2.2747597224127] , [ 1249012800000 , -2.3125499227974] , [ 1251691200000 , -2.2784386530745] , [ 1254283200000 , -1.1518806233757] , [ 1256961600000 , -1.0075503399018] , [ 1259557200000 , -1.1400577929481] , [ 1262235600000 , -0.50677891891165] , [ 1264914000000 , -0.54332908490051] , [ 1267333200000 , -0.55473181189807] , [ 1270008000000 , -0.3633796157757] , [ 1272600000000 , -0.30361861470847] , [ 1275278400000 , -0.24614951229153] , [ 1277870400000 , -1.0959443687647] , [ 1280548800000 , -1.1881529264637] , [ 1283227200000 , -1.1835349242596] , [ 1285819200000 , -0.92507477884561] , [ 1288497600000 , -0.94531016133473] , [ 1291093200000 , -0.93519433603434] , [ 1293771600000 , -1.009221344252] , [ 1296450000000 , -2.3640716285835] , [ 1298869200000 , -2.4914494188556] , [ 1301544000000 , -1.7979456141716] , [ 1304136000000 , -2.1389760840247] , [ 1306814400000 , -1.9721362241269] , [ 1309406400000 , -1.9170229522382] , [ 1312084800000 , -1.8076246545605] , [ 1314763200000 , -2.1010686108381] , [ 1317355200000 , -2.2396373791195] , [ 1320033600000 , -1.8469012813015] , [ 1322629200000 , -2.0079125997321] , [ 1325307600000 , -1.9170007806182] , [ 1327986000000 , -1.9239118384243] , [ 1330491600000 , -2.0649464738798] , [ 1333166400000 , -0.88385747789351] , [ 1335758400000 , -0.91438087144161] , [ 1338436800000 , -0.96513752020965]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Telecommunication Services" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , -0.077395192503573] , [ 1146369600000 , -0.079342784160835] , [ 1149048000000 , -0.07376956808809] , [ 1151640000000 , -0.041850521681201] , [ 1154318400000 , -0.037598545052499] , [ 1156996800000 , -0.040984079427717] , [ 1159588800000 , -0.19335817797448] , [ 1162270800000 , -0.18578493919925] , [ 1164862800000 , -0.1769473933101] , [ 1167541200000 , -0.57245352054975] , [ 1170219600000 , -0.61554187332911] , [ 1172638800000 , -0.63016714701151] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , -0.12118014109021] , [ 1185854400000 , -0.11085831487208] , [ 1188532800000 , -0.10901265358445] , [ 1191124800000 , -0.17205583275088] , [ 1193803200000 , -0.16573676303991] , [ 1196398800000 , -0.17954841680392] , [ 1199077200000 , -0.82703336198161] , [ 1201755600000 , -0.76741763304227] , [ 1204261200000 , -0.79430844816827] , [ 1206936000000 , -1.0279404050708] , [ 1209528000000 , -1.0342425093761] , [ 1212206400000 , -1.0903083860383] , [ 1214798400000 , -1.0895432841007] , [ 1217476800000 , -1.1392703218146] , [ 1220155200000 , -0.98872086340391] , [ 1222747200000 , -1.227654651568] , [ 1225425600000 , -1.0527419580394] , [ 1228021200000 , -0.84338280322309] , [ 1230699600000 , -0.5982617279246] , [ 1233378000000 , -0.74123723862634] , [ 1235797200000 , -0.81665712408277] , [ 1238472000000 , -0.89868760705228] , [ 1241064000000 , -0.86338472153689] , [ 1243742400000 , -0.85040889603889] , [ 1246334400000 , -0.82872733882926] , [ 1249012800000 , -1.2797824676355] , [ 1251691200000 , -1.152043882336] , [ 1254283200000 , -0.70125890680538] , [ 1256961600000 , -0.69496338525418] , [ 1259557200000 , -0.81982038022784] , [ 1262235600000 , -0.42841700219624] , [ 1264914000000 , -0.43298861575253] , [ 1267333200000 , -0.46951194437705] , [ 1270008000000 , -0.46723980191721] , [ 1272600000000 , -0.43139262322841] , [ 1275278400000 , -0.4052075794202] , [ 1277870400000 , -0.45399431179247] , [ 1280548800000 , -0.50492374473014] , [ 1283227200000 , -0.49032976375464] , [ 1285819200000 , -0.95769381063728] , [ 1288497600000 , -0.92968381683254] , [ 1291093200000 , -0.90984207437415] , [ 1293771600000 , -0.91448295661871] , [ 1296450000000 , -1.3204103334172] , [ 1298869200000 , -1.3896989018] , [ 1301544000000 , -1.8536993972883] , [ 1304136000000 , -1.9901582471947] , [ 1306814400000 , -1.8731097808809] , [ 1309406400000 , -1.8109819859122] , [ 1312084800000 , -1.7946593386661] , [ 1314763200000 , -1.6002716669781] , [ 1317355200000 , -0.056479286204019] , [ 1320033600000 , -0.046232413998891] , [ 1322629200000 , -0.051182355563531] , [ 1325307600000 , -0.032858749040145] , [ 1327986000000 , -0.032326418106178] , [ 1330491600000 , -0.033980477379241] , [ 1333166400000 , -0.053069550536519] , [ 1335758400000 , -0.055741850564434] , [ 1338436800000 , -0.055851808568252]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Utilities" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , -0.073769471773675] , [ 1146369600000 , -0.077824496315782] , [ 1149048000000 , -0.080696288096361] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 0] , [ 1162270800000 , 0] , [ 1164862800000 , 0] , [ 1167541200000 , 0] , [ 1170219600000 , 0] , [ 1172638800000 , 0] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , -0.16073291656515] , [ 1185854400000 , -0.1646253606633] , [ 1188532800000 , -0.1655815581449] , [ 1191124800000 , -0.74417496631713] , [ 1193803200000 , -0.76230340423681] , [ 1196398800000 , -0.73882938190048] , [ 1199077200000 , -0.3820573391806] , [ 1201755600000 , -0.360757285179] , [ 1204261200000 , -0.38081058463615] , [ 1206936000000 , -0.92767439811083] , [ 1209528000000 , -0.92774728028789] , [ 1212206400000 , -0.85273481694714] , [ 1214798400000 , -1.69407085613] , [ 1217476800000 , -1.5179726219101] , [ 1220155200000 , -1.3576700600738] , [ 1222747200000 , -1.0404839864076] , [ 1225425600000 , -0.95251478838915] , [ 1228021200000 , -1.0610509118017] , [ 1230699600000 , -0.3316792294278] , [ 1233378000000 , -0.33745002288524] , [ 1235797200000 , -0.28806366796683] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , -0.6338555382785] , [ 1249012800000 , -0.62797265130959] , [ 1251691200000 , -0.60264057253794] , [ 1254283200000 , -0.28687231077181] , [ 1256961600000 , -0.22215649778327] , [ 1259557200000 , -0.24027664555676] , [ 1262235600000 , 0] , [ 1264914000000 , 0] , [ 1267333200000 , 0] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 0] , [ 1288497600000 , 0] , [ 1291093200000 , 0] , [ 1293771600000 , 0] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 0] , [ 1320033600000 , 0] , [ 1322629200000 , 0] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0] , [ 1335758400000 , 0] , [ 1338436800000 , 0]]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
if (typeof d3 !== 'undefined') {
|
||||
var colors = d3.scale.category20();
|
||||
keyColor = function (d, i) {
|
||||
return colors(d.key)
|
||||
};
|
||||
|
||||
var chart;
|
||||
nv.addGraph(function () {
|
||||
chart = nv.models.stackedAreaChart()
|
||||
.useInteractiveGuideline(true)
|
||||
.x(function (d) {
|
||||
return d[0]
|
||||
})
|
||||
.y(function (d) {
|
||||
return d[1]
|
||||
})
|
||||
.color(keyColor)
|
||||
.transitionDuration(300);
|
||||
|
||||
chart.xAxis
|
||||
.tickFormat(function (d) {
|
||||
return d3.time.format('%x')(new Date(d))
|
||||
});
|
||||
|
||||
chart.yAxis
|
||||
.tickFormat(d3.format(',.2f'));
|
||||
|
||||
d3.select('#d3_chart1')
|
||||
.datum(histcatexplong)
|
||||
.transition().duration(1000)
|
||||
.call(chart)
|
||||
// .transition().duration(0)
|
||||
.each('start', function () {
|
||||
setTimeout(function () {
|
||||
d3.selectAll('#d3_chart2 *').each(function () {
|
||||
console.log('start', this.__transition__, this)
|
||||
if (this.__transition__)
|
||||
this.__transition__.duration = 1;
|
||||
})
|
||||
}, 0)
|
||||
})
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ==============================================
|
||||
CHART 2: D3 LINE AND BAR CHARTS
|
||||
=============================================== */
|
||||
var testdata = [
|
||||
{
|
||||
"key" : "Quantity" ,
|
||||
"bar": true,
|
||||
"values" : [ [ 1136005200000 , 1271000.0] , [ 1138683600000 , 1271000.0] , [ 1141102800000 , 1271000.0] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 3899486.0] , [ 1162270800000 , 3899486.0] , [ 1164862800000 , 3899486.0] , [ 1167541200000 , 3564700.0] , [ 1170219600000 , 3564700.0] , [ 1172638800000 , 3564700.0] , [ 1175313600000 , 2648493.0] , [ 1177905600000 , 2648493.0] , [ 1180584000000 , 2648493.0] , [ 1183176000000 , 2522993.0] , [ 1185854400000 , 2522993.0] , [ 1188532800000 , 2522993.0] , [ 1191124800000 , 2906501.0] , [ 1193803200000 , 2906501.0] , [ 1196398800000 , 2906501.0] , [ 1199077200000 , 2206761.0] , [ 1201755600000 , 2206761.0] , [ 1204261200000 , 2206761.0] , [ 1206936000000 , 2287726.0] , [ 1209528000000 , 2287726.0] , [ 1212206400000 , 2287726.0] , [ 1214798400000 , 2732646.0] , [ 1217476800000 , 2732646.0] , [ 1220155200000 , 2732646.0] , [ 1222747200000 , 2599196.0] , [ 1225425600000 , 2599196.0] , [ 1228021200000 , 2599196.0] , [ 1230699600000 , 1924387.0] , [ 1233378000000 , 1924387.0] , [ 1235797200000 , 1924387.0] , [ 1238472000000 , 1756311.0] , [ 1241064000000 , 1756311.0] , [ 1243742400000 , 1756311.0] , [ 1246334400000 , 1743470.0] , [ 1249012800000 , 1743470.0] , [ 1251691200000 , 1743470.0] , [ 1254283200000 , 1519010.0] , [ 1256961600000 , 1519010.0] , [ 1259557200000 , 1519010.0] , [ 1262235600000 , 1591444.0] , [ 1264914000000 , 1591444.0] , [ 1267333200000 , 1591444.0] , [ 1270008000000 , 1543784.0] , [ 1272600000000 , 1543784.0] , [ 1275278400000 , 1543784.0] , [ 1277870400000 , 1309915.0] , [ 1280548800000 , 1309915.0] , [ 1283227200000 , 1309915.0] , [ 1285819200000 , 1331875.0] , [ 1288497600000 , 1331875.0] , [ 1291093200000 , 1331875.0] , [ 1293771600000 , 1331875.0] , [ 1296450000000 , 1154695.0] , [ 1298869200000 , 1154695.0] , [ 1301544000000 , 1194025.0] , [ 1304136000000 , 1194025.0] , [ 1306814400000 , 1194025.0] , [ 1309406400000 , 1194025.0] , [ 1312084800000 , 1194025.0] , [ 1314763200000 , 1244525.0] , [ 1317355200000 , 475000.0] , [ 1320033600000 , 475000.0] , [ 1322629200000 , 475000.0] , [ 1325307600000 , 690033.0] , [ 1327986000000 , 690033.0] , [ 1330491600000 , 690033.0] , [ 1333166400000 , 514733.0] , [ 1335758400000 , 514733.0]]
|
||||
},
|
||||
{
|
||||
"key" : "Price" ,
|
||||
"values" : [ [ 1136005200000 , 71.89] , [ 1138683600000 , 75.51] , [ 1141102800000 , 68.49] , [ 1143781200000 , 62.72] , [ 1146369600000 , 70.39] , [ 1149048000000 , 59.77] , [ 1151640000000 , 57.27] , [ 1154318400000 , 67.96] , [ 1156996800000 , 67.85] , [ 1159588800000 , 76.98] , [ 1162270800000 , 81.08] , [ 1164862800000 , 91.66] , [ 1167541200000 , 84.84] , [ 1170219600000 , 85.73] , [ 1172638800000 , 84.61] , [ 1175313600000 , 92.91] , [ 1177905600000 , 99.8] , [ 1180584000000 , 121.191] , [ 1183176000000 , 122.04] , [ 1185854400000 , 131.76] , [ 1188532800000 , 138.48] , [ 1191124800000 , 153.47] , [ 1193803200000 , 189.95] , [ 1196398800000 , 182.22] , [ 1199077200000 , 198.08] , [ 1201755600000 , 135.36] , [ 1204261200000 , 125.02] , [ 1206936000000 , 143.5] , [ 1209528000000 , 173.95] , [ 1212206400000 , 188.75] , [ 1214798400000 , 167.44] , [ 1217476800000 , 158.95] , [ 1220155200000 , 169.53] , [ 1222747200000 , 113.66] , [ 1225425600000 , 107.59] , [ 1228021200000 , 92.67] , [ 1230699600000 , 85.35] , [ 1233378000000 , 90.13] , [ 1235797200000 , 89.31] , [ 1238472000000 , 105.12] , [ 1241064000000 , 125.83] , [ 1243742400000 , 135.81] , [ 1246334400000 , 142.43] , [ 1249012800000 , 163.39] , [ 1251691200000 , 168.21] , [ 1254283200000 , 185.35] , [ 1256961600000 , 188.5] , [ 1259557200000 , 199.91] , [ 1262235600000 , 210.732] , [ 1264914000000 , 192.063] , [ 1267333200000 , 204.62] , [ 1270008000000 , 235.0] , [ 1272600000000 , 261.09] , [ 1275278400000 , 256.88] , [ 1277870400000 , 251.53] , [ 1280548800000 , 257.25] , [ 1283227200000 , 243.1] , [ 1285819200000 , 283.75] , [ 1288497600000 , 300.98] , [ 1291093200000 , 311.15] , [ 1293771600000 , 322.56] , [ 1296450000000 , 339.32] , [ 1298869200000 , 353.21] , [ 1301544000000 , 348.5075] , [ 1304136000000 , 350.13] , [ 1306814400000 , 347.83] , [ 1309406400000 , 335.67] , [ 1312084800000 , 390.48] , [ 1314763200000 , 384.83] , [ 1317355200000 , 381.32] , [ 1320033600000 , 404.78] , [ 1322629200000 , 382.2] , [ 1325307600000 , 405.0] , [ 1327986000000 , 456.48] , [ 1330491600000 , 542.44] , [ 1333166400000 , 599.55] , [ 1335758400000 , 583.98] ]
|
||||
}
|
||||
].map(function(series) {
|
||||
series.values = series.values.map(function(d) { return {x: d[0], y: d[1] } });
|
||||
return series;
|
||||
});
|
||||
|
||||
var chart;
|
||||
|
||||
if (typeof nv !== 'undefined') {
|
||||
|
||||
nv.addGraph(function () {
|
||||
chart = nv.models.linePlusBarChart()
|
||||
.margin({
|
||||
top: 30,
|
||||
right: 60,
|
||||
bottom: 50,
|
||||
left: 70
|
||||
})
|
||||
.x(function (d, i) {
|
||||
return i
|
||||
})
|
||||
.color(d3.scale.category10().range());
|
||||
|
||||
chart.xAxis.tickFormat(function (d) {
|
||||
var dx = testdata[0].values[d] && testdata[0].values[d].x || 0;
|
||||
return dx ? d3.time.format('%x')(new Date(dx)) : '';
|
||||
})
|
||||
.showMaxMin(false);
|
||||
|
||||
chart.y1Axis
|
||||
.tickFormat(d3.format(',f'));
|
||||
|
||||
chart.y2Axis
|
||||
.tickFormat(function (d) {
|
||||
return '$' + d3.format(',.2f')(d)
|
||||
});
|
||||
|
||||
chart.bars.forceY([0]).padData(false);
|
||||
//chart.lines.forceY([0]);
|
||||
|
||||
d3.select('#d3_chart2 svg')
|
||||
.datum(testdata)
|
||||
.transition().duration(500).call(chart);
|
||||
nv.utils.windowResize(chart.update);
|
||||
chart.dispatch.on('stateChange', function (e) {
|
||||
nv.log('New State:', JSON.stringify(e));
|
||||
});
|
||||
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ==============================================
|
||||
CHART 3: D3 BUBBLE CHARTS
|
||||
=============================================== */
|
||||
var chart;
|
||||
|
||||
if (typeof nv !== 'undefined') {
|
||||
nv.addGraph(function () {
|
||||
chart = nv.models.scatterChart()
|
||||
.showDistX(true)
|
||||
.showDistY(true)
|
||||
.useVoronoi(true)
|
||||
.color(d3.scale.category10().range())
|
||||
.transitionDuration(500);
|
||||
|
||||
chart.xAxis.tickFormat(d3.format('.02f'));
|
||||
chart.yAxis.tickFormat(d3.format('.02f'));
|
||||
chart.tooltipContent(function (key) {
|
||||
return '<h2>' + key + '</h2>';
|
||||
});
|
||||
|
||||
d3.select('#d3_chart3 svg')
|
||||
.datum(randomData(4, 40))
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
chart.dispatch.on('stateChange', function (e) {
|
||||
('New State:', JSON.stringify(e));
|
||||
});
|
||||
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
function randomData(groups, points) { //# groups,# points per group
|
||||
var data = [],
|
||||
shapes = ['circle', 'cross', 'triangle-up', 'triangle-down', 'diamond', 'square'],
|
||||
random = d3.random.normal();
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
data.push({
|
||||
key: 'Group ' + i,
|
||||
values: []
|
||||
});
|
||||
|
||||
for (j = 0; j < points; j++) {
|
||||
data[i].values.push({
|
||||
x: random(),
|
||||
y: random(),
|
||||
size: Math.random(),
|
||||
shape: shapes[j % 6]
|
||||
});
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
/* ==============================================
|
||||
CHART 4: FLOT LINE CHARTS
|
||||
=============================================== */
|
||||
var d2 = [
|
||||
[1, 30],
|
||||
[2, 20],
|
||||
[3, 10],
|
||||
[4, 30],
|
||||
[5, 15],
|
||||
[6, 25]
|
||||
];
|
||||
var d1 = [
|
||||
[1, 30],
|
||||
[2, 30],
|
||||
[3, 20],
|
||||
[4, 40],
|
||||
[5, 30],
|
||||
[6, 45]
|
||||
];
|
||||
|
||||
|
||||
if($('#flot_chart1').length){
|
||||
var plot = $.plotAnimator($("#flot_chart1"), [{
|
||||
label: "Line 1",
|
||||
data: d1,
|
||||
lines: {
|
||||
lineWidth: 2
|
||||
},
|
||||
shadowSize: 0,
|
||||
color: '#3598DB'
|
||||
}, {
|
||||
label: "Line 1",
|
||||
data: d1,
|
||||
points: {
|
||||
show: true,
|
||||
fill: true,
|
||||
radius: 6,
|
||||
fillColor: "#3598DB",
|
||||
lineWidth: 3
|
||||
},
|
||||
color: '#fff'
|
||||
}, {
|
||||
label: "Line 2",
|
||||
data: d2,
|
||||
animator: {
|
||||
steps: 300,
|
||||
duration: 1000,
|
||||
start: 0
|
||||
},
|
||||
lines: {
|
||||
fill: 0.6,
|
||||
lineWidth: 0,
|
||||
},
|
||||
color: '#99cbed'
|
||||
}, {
|
||||
label: "Line 2",
|
||||
data: d2,
|
||||
points: {
|
||||
show: true,
|
||||
fill: true,
|
||||
radius: 6,
|
||||
fillColor: "#badcf3",
|
||||
lineWidth: 3
|
||||
},
|
||||
color: '#fff'
|
||||
}, ], {
|
||||
xaxis: {
|
||||
tickLength: 0,
|
||||
tickDecimals: 0,
|
||||
min: 2,
|
||||
font: {
|
||||
lineHeight: 12,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#8D8D8D"
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
ticks: 3,
|
||||
tickDecimals: 0,
|
||||
tickColor: "#f3f3f3",
|
||||
font: {
|
||||
lineHeight: 13,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#8D8D8D"
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
backgroundColor: {
|
||||
colors: ["#fff", "#fff"]
|
||||
},
|
||||
borderColor: "#f3f3f3",
|
||||
margin: 0,
|
||||
minBorderMargin: 0,
|
||||
labelMargin: 15,
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
mouseActiveRadius: 4
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
});
|
||||
|
||||
$("#flot_chart1").bind("plothover", function (event, pos, item) {
|
||||
if (item) {
|
||||
var x = item.datapoint[0].toFixed(2),
|
||||
y = item.datapoint[1].toFixed(2);
|
||||
|
||||
$("#tooltip").html(item.series.label + " of " + x + " = " + y)
|
||||
.css({
|
||||
top: item.pageY + 5,
|
||||
left: item.pageX + 5
|
||||
})
|
||||
.fadeIn(200);
|
||||
} else {
|
||||
$("#tooltip").hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ==============================================
|
||||
CHART 5: MORRIS DONUT CHARTS
|
||||
=============================================== */
|
||||
|
||||
if (typeof Morris !== 'undefined') {
|
||||
new Morris.Donut({
|
||||
element: 'donut-chart1',
|
||||
data: [{
|
||||
label: "Chrome",
|
||||
value: 34
|
||||
}, {
|
||||
label: "Firefox",
|
||||
value: 24
|
||||
}, {
|
||||
label: "Opera",
|
||||
value: 12
|
||||
}, {
|
||||
label: "Safari",
|
||||
value: 25
|
||||
}, {
|
||||
label: "Internet Explorer",
|
||||
value: 5
|
||||
}],
|
||||
colors: ['#C75757', '#18A689', '#0090D9', '#2B2E33', '#0090D9'],
|
||||
formatter: function (x) {
|
||||
return x + "%"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
/* ==============================================
|
||||
CHART 6: CIRCLIFUL CIRCLE CHARTS
|
||||
=============================================== */
|
||||
$(window).scroll(function () {
|
||||
if ($('#pie_chart1').visible()) {
|
||||
if ($('.circle-text-half').length == 0) {
|
||||
$('#pie_chart1').circliful();
|
||||
$('#pie_chart2').circliful();
|
||||
$('#pie_chart3').circliful();
|
||||
$('#pie_chart4').circliful();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$(window).resize(function () {
|
||||
new Morris.Donut({
|
||||
element: 'donut-chart1',
|
||||
data: [{
|
||||
label: "Chrome",
|
||||
value: 34
|
||||
}, {
|
||||
label: "Firefox",
|
||||
value: 24
|
||||
}, {
|
||||
label: "Opera",
|
||||
value: 12
|
||||
}, {
|
||||
label: "Safari",
|
||||
value: 25
|
||||
}, {
|
||||
label: "Internet Explorer",
|
||||
value: 5
|
||||
}],
|
||||
colors: ['#C75757', '#18A689', '#0090D9', '#2B2E33', '#0090D9'],
|
||||
formatter: function (x) {
|
||||
return x + "%"
|
||||
}
|
||||
});
|
||||
$('#pie_chart1').html('');
|
||||
$('#pie_chart2').html('');
|
||||
$('#pie_chart3').html('');
|
||||
$('#pie_chart4').html('');
|
||||
if ($('.circle-text-half').length == 0) {
|
||||
$('#pie_chart1').circliful();
|
||||
$('#pie_chart2').circliful();
|
||||
$('#pie_chart3').circliful();
|
||||
$('#pie_chart4').circliful();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
26
public/assets/js/coming_soon.js
Normal file
26
public/assets/js/coming_soon.js
Normal file
@@ -0,0 +1,26 @@
|
||||
$(function(){
|
||||
|
||||
/* Initiation of Countdown (time in timestamp) */
|
||||
$('.countdown').final_countdown({
|
||||
'start': 1362139200,
|
||||
'end': 1394662920,
|
||||
'now': 1387461319
|
||||
});
|
||||
|
||||
/* Background slide */
|
||||
if($('body').attr('data-page') == 'coming-soon'){
|
||||
$.backstretch([
|
||||
"assets/img/background/05.png",
|
||||
"assets/img/background/04.png",
|
||||
"assets/img/background/06.png",
|
||||
"assets/img/background/07.png",
|
||||
"assets/img/background/08.png"],
|
||||
{
|
||||
fade: 3000,
|
||||
duration: 0
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
39
public/assets/js/comments.js
Normal file
39
public/assets/js/comments.js
Normal file
@@ -0,0 +1,39 @@
|
||||
$(function () {
|
||||
|
||||
/* Show / Hide action buttons on hover */
|
||||
var myTimeout;
|
||||
$('.comment').mouseenter(function() {
|
||||
var comment_footer = $(this).find('.comment-footer');
|
||||
myTimeout = setTimeout(function() {
|
||||
comment_footer.slideDown();
|
||||
}, 200);
|
||||
}).mouseleave(function() {
|
||||
clearTimeout(myTimeout);
|
||||
$(this).find('.comment-footer').slideUp();
|
||||
});
|
||||
|
||||
/* Edit a comment */
|
||||
$('.edit').on('click', function(e){
|
||||
e.preventDefault();
|
||||
$('#modal-edit-comment').modal('show');
|
||||
});
|
||||
|
||||
/* Delete a comment */
|
||||
$('.delete').on('click', function(){
|
||||
$(this).closest('.comment').hide();
|
||||
});
|
||||
|
||||
/* Checkbox select */
|
||||
$('input:checkbox').on('ifClicked', function () {
|
||||
if ($(this).parent().hasClass('checked')) {
|
||||
$(this).closest('.comment').removeClass('selected');
|
||||
$(this).closest('.comment').find(':checkbox').attr('checked', false);
|
||||
} else {
|
||||
$(this).parent().addClass('checked');
|
||||
$(this).closest('.comment').addClass('selected');
|
||||
$(this).closest('.comment').find(':checkbox').attr('checked', true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
186
public/assets/js/contact.js
Normal file
186
public/assets/js/contact.js
Normal file
@@ -0,0 +1,186 @@
|
||||
$(function () {
|
||||
|
||||
var contact_map;
|
||||
|
||||
var ny = new google.maps.LatLng(40.7142700, -74.0059700);
|
||||
|
||||
var neighborhoods = [
|
||||
new google.maps.LatLng(40.7232700, -73.8059700),
|
||||
new google.maps.LatLng(40.7423500, -74.0656600),
|
||||
new google.maps.LatLng(40.7314600, -74.0458500),
|
||||
new google.maps.LatLng(40.7151800, -74.1557400)
|
||||
];
|
||||
|
||||
var markers = [];
|
||||
var iterator = 0;
|
||||
|
||||
var map;
|
||||
|
||||
function initialize() {
|
||||
var mapOptions = {
|
||||
zoom: 12,
|
||||
center: ny,
|
||||
panControl: false,
|
||||
streetViewControl: false,
|
||||
mapTypeControl: false,
|
||||
overviewMapControl: false,
|
||||
styles: [
|
||||
{
|
||||
"featureType": "water",
|
||||
"stylers": [
|
||||
{
|
||||
"saturation": 43
|
||||
},
|
||||
{
|
||||
"lightness": -11
|
||||
},
|
||||
{
|
||||
"hue": "#0088ff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road",
|
||||
"elementType": "geometry.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"hue": "#ff0000"
|
||||
},
|
||||
{
|
||||
"saturation": -100
|
||||
},
|
||||
{
|
||||
"lightness": 99
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road",
|
||||
"elementType": "geometry.stroke",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#808080"
|
||||
},
|
||||
{
|
||||
"lightness": 54
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "landscape.man_made",
|
||||
"elementType": "geometry.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#ece2d9"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi.park",
|
||||
"elementType": "geometry.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#ccdca1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road",
|
||||
"elementType": "labels.text.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#767676"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road",
|
||||
"elementType": "labels.text.stroke",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#ffffff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "landscape.natural",
|
||||
"elementType": "geometry.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "on"
|
||||
},
|
||||
{
|
||||
"color": "#b8cb93"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi.park",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "on"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi.sports_complex",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "on"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi.medical",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "on"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi.business",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "simplified"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
map = new google.maps.Map(document.getElementById('contact-map'), mapOptions);
|
||||
}
|
||||
|
||||
function drop() {
|
||||
setTimeout(function () {
|
||||
for (var i = 0; i < neighborhoods.length; i++) {
|
||||
setTimeout(function() {
|
||||
addMarker();
|
||||
}, i * 350);
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
function addMarker() {
|
||||
markers.push(new google.maps.Marker({
|
||||
position: neighborhoods[iterator],
|
||||
map: map,
|
||||
draggable: false,
|
||||
animation: google.maps.Animation.DROP
|
||||
}));
|
||||
iterator++;
|
||||
}
|
||||
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
|
||||
drop();
|
||||
|
||||
});
|
||||
1
public/assets/js/custom.js
Normal file
1
public/assets/js/custom.js
Normal file
@@ -0,0 +1 @@
|
||||
//****************** YOUR CUSTOMIZED JAVASCRIPT **********************//
|
||||
561
public/assets/js/dashboard.js
Normal file
561
public/assets/js/dashboard.js
Normal file
@@ -0,0 +1,561 @@
|
||||
$(function () {
|
||||
|
||||
/* Display message header */
|
||||
setTimeout(function () {
|
||||
$('#chat-notification').removeClass('hide').addClass('animated bounceIn');
|
||||
$('#chat-popup').removeClass('hide').addClass('animated fadeIn');
|
||||
}, 5000);
|
||||
|
||||
/* Hide message header */
|
||||
setTimeout(function () {
|
||||
$('#chat-popup').removeClass('animated fadeIn').addClass('animated fadeOut').delay(800).hide(0);
|
||||
}, 8000);
|
||||
|
||||
//****************** LINE & BAR SWITCH CHART ******************//
|
||||
var d1 = [
|
||||
[0, 950], [1, 1300], [2, 1600], [3, 1900], [4, 2100], [5, 2500], [6, 2200], [7, 2000], [8, 1950], [9, 1900], [10, 2000], [11, 2120]
|
||||
];
|
||||
var d2 = [
|
||||
[0, 450], [1, 500], [2, 600], [3, 550], [4, 600], [5, 800], [6, 900], [7, 800], [8, 850], [9, 830], [10, 1000], [11, 1150]
|
||||
];
|
||||
|
||||
var tickArray = ['Janv', 'Fev', 'Mars', 'Apri', 'May', 'June', 'July', 'Augu', 'Sept', 'Nov'];
|
||||
|
||||
/**** Line Chart ****/
|
||||
var graph_lines = [{
|
||||
label: "Line 1",
|
||||
data: d1,
|
||||
lines: {
|
||||
lineWidth: 2
|
||||
},
|
||||
shadowSize: 0,
|
||||
color: '#0090D9'
|
||||
}, {
|
||||
label: "Line 1",
|
||||
data: d1,
|
||||
points: {
|
||||
show: true,
|
||||
fill: true,
|
||||
radius: 6,
|
||||
fillColor: "#0090D9",
|
||||
lineWidth: 3
|
||||
},
|
||||
color: '#fff'
|
||||
}, {
|
||||
label: "Line 2",
|
||||
data: d2,
|
||||
animator: {
|
||||
steps: 300,
|
||||
duration: 1000,
|
||||
start: 0
|
||||
},
|
||||
lines: {
|
||||
fill: 0.7,
|
||||
lineWidth: 0,
|
||||
},
|
||||
color: '#18A689'
|
||||
}, {
|
||||
label: "Line 2",
|
||||
data: d2,
|
||||
points: {
|
||||
show: true,
|
||||
fill: true,
|
||||
radius: 6,
|
||||
fillColor: "#18A689",
|
||||
lineWidth: 3
|
||||
},
|
||||
color: '#fff'
|
||||
}, ];
|
||||
|
||||
function lineCharts(){
|
||||
var line_chart = $.plotAnimator($('#graph-lines'), graph_lines, {
|
||||
xaxis: {
|
||||
tickLength: 0,
|
||||
tickDecimals: 0,
|
||||
min: 0,
|
||||
ticks: [
|
||||
[0, 'Jan'], [1, 'Fev'], [2, 'Mar'], [3, 'Apr'], [4, 'May'], [5, 'Jun'], [6, 'Jul'], [7, 'Aug'], [8, 'Sept'], [9, 'Oct'], [10, 'Nov'], [11, 'Dec']
|
||||
],
|
||||
font: {
|
||||
lineHeight: 12,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#8D8D8D"
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
ticks: 3,
|
||||
tickDecimals: 0,
|
||||
tickColor: "#f3f3f3",
|
||||
font: {
|
||||
lineHeight: 13,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#8D8D8D"
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
backgroundColor: {
|
||||
colors: ["#fff", "#fff"]
|
||||
},
|
||||
borderColor: "transparent",
|
||||
margin: 0,
|
||||
minBorderMargin: 0,
|
||||
labelMargin: 15,
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
mouseActiveRadius: 4
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
});
|
||||
}
|
||||
lineCharts();
|
||||
|
||||
/**** Bars Chart ****/
|
||||
var graph_bars = [{
|
||||
// Visitors
|
||||
data: d1,
|
||||
color: '#00b5f3'
|
||||
}, {
|
||||
// Returning Visitors
|
||||
data: d2,
|
||||
color: '#008fc0',
|
||||
points: {
|
||||
radius: 4,
|
||||
fillColor: '#008fc0'
|
||||
}
|
||||
}];
|
||||
|
||||
function barCharts(){
|
||||
bar_chart = $.plotAnimator($('#graph-bars'), graph_bars, {
|
||||
series: {
|
||||
bars: {
|
||||
fill: 1,
|
||||
show: true,
|
||||
barWidth: .6,
|
||||
align: 'center'
|
||||
},
|
||||
shadowSize: 0
|
||||
},
|
||||
xaxis: {
|
||||
tickColor: 'transparent',
|
||||
ticks: [
|
||||
[0, 'Jan'], [1, 'Fev'], [2, 'Mar'], [3, 'Apr'], [4, 'May'], [5, 'Jun'], [6, 'Jul'], [7, 'Aug'], [8, 'Sept'], [9, 'Oct'], [10, 'Nov'], [11, 'Dec']
|
||||
],
|
||||
font: {
|
||||
lineHeight: 12,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#9a9a9a"
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
ticks: 3,
|
||||
tickDecimals: 0,
|
||||
tickColor: "#f3f3f3",
|
||||
font: {
|
||||
lineHeight: 13,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#9a9a9a"
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
backgroundColor: {
|
||||
colors: ["#fff", "#fff"]
|
||||
},
|
||||
borderColor: "transparent",
|
||||
margin: 0,
|
||||
minBorderMargin: 0,
|
||||
labelMargin: 15,
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
mouseActiveRadius: 4
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#graph-lines").on("animatorComplete", function () {
|
||||
$("#lines, #bars").removeAttr("disabled");
|
||||
});
|
||||
|
||||
$("#lines").on("click", function () {
|
||||
$('#bars').removeClass('active');
|
||||
$('#graph-bars').fadeOut();
|
||||
$(this).addClass('active');
|
||||
$("#lines, #bars").attr("disabled", "disabled");
|
||||
$('#graph-lines').fadeIn();
|
||||
lineCharts();
|
||||
});
|
||||
|
||||
$("#graph-bars").on("animatorComplete", function () {
|
||||
$("#bars, #lines").removeAttr("disabled")
|
||||
});
|
||||
|
||||
$("#bars").on("click", function () {
|
||||
$("#bars, #lines").attr("disabled", "disabled");
|
||||
$('#lines').removeClass('active');
|
||||
$('#graph-lines').fadeOut();
|
||||
$(this).addClass('active');
|
||||
$('#graph-bars').fadeIn().removeClass('hidden');
|
||||
barCharts();
|
||||
});
|
||||
|
||||
$('#graph-bars').hide();
|
||||
|
||||
function showTooltip(x, y, contents) {
|
||||
$('<div id="flot-tooltip">' + contents + '</div>').css({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
top: y + 5,
|
||||
left: x + 5,
|
||||
color: '#fff',
|
||||
padding: '2px 5px',
|
||||
'background-color': '#717171',
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(200);
|
||||
};
|
||||
|
||||
$("#graph-lines, #graph-bars").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(0));
|
||||
$("#y").text(pos.y.toFixed(0));
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
$("#flot-tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(0),
|
||||
y = item.datapoint[1].toFixed(0);
|
||||
showTooltip(item.pageX, item.pageY, y + " visitors");
|
||||
}
|
||||
} else {
|
||||
$("#flot-tooltip").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//******************** DONUT CHART ********************//
|
||||
new Morris.Donut({
|
||||
element: 'donut-chart1',
|
||||
data: [{
|
||||
label: "Chrome",
|
||||
value: 34
|
||||
}, {
|
||||
label: "Firefox",
|
||||
value: 24
|
||||
}, {
|
||||
label: "Opera",
|
||||
value: 12
|
||||
}, {
|
||||
label: "Safari",
|
||||
value: 25
|
||||
}, {
|
||||
label: "Internet Explorer",
|
||||
value: 5
|
||||
}],
|
||||
colors: ['#C75757', '#18A689', '#0090D9', '#2B2E33', '#0090D9'],
|
||||
formatter: function (x) {
|
||||
return x + "%"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//************** SPARKLINE SMALL CHART *****************//
|
||||
$(function () {
|
||||
/* Sparklines can also take their values from the first argument passed to the sparkline() function */
|
||||
var myvalues1 = [13, 14, 16, 15, 11, 14, 20, 14, 12, 16, 11, 17];
|
||||
var myvalues2 = [14, 17, 16, 12, 18, 16, 22, 15, 14, 17, 11, 18];
|
||||
$('.spark-chart-1').sparkline(myvalues1, {
|
||||
type: 'line',
|
||||
lineColor: '#18A689',
|
||||
fillColor: '#18A689',
|
||||
spotColor: '#18A689',
|
||||
height: '32px',
|
||||
width: '100%'
|
||||
});
|
||||
$('.spark-chart-2').sparkline(myvalues2, {
|
||||
type: 'line',
|
||||
lineColor: '#6B787F',
|
||||
fillColor: '#0090D9',
|
||||
spotColor: '#6B787F',
|
||||
height: '32px',
|
||||
width: '100%'
|
||||
});
|
||||
});
|
||||
|
||||
/* We have to recreate charts on resize to make them responsive */
|
||||
$(window).resize(function () {
|
||||
var myvalues1 = [13, 14, 16, 15, 11, 14, 20, 14, 12, 16, 11, 17];
|
||||
var myvalues2 = [14, 17, 16, 12, 18, 16, 22, 15, 14, 17, 11, 18];
|
||||
$('.spark-chart-1').sparkline(myvalues1, {
|
||||
type: 'line',
|
||||
lineColor: '#18A689',
|
||||
fillColor: '#18A689',
|
||||
spotColor: '#18A689',
|
||||
height: '32px',
|
||||
width: '100%'
|
||||
});
|
||||
$('.spark-chart-2').sparkline(myvalues2, {
|
||||
type: 'line',
|
||||
lineColor: '#6B787F',
|
||||
fillColor: '#0090D9',
|
||||
spotColor: '#6B787F',
|
||||
height: '32px',
|
||||
width: '100%'
|
||||
});
|
||||
new Morris.Donut({
|
||||
element: 'donut-chart1',
|
||||
data: [{
|
||||
label: "Chrome",
|
||||
value: 30
|
||||
}, {
|
||||
label: "Firefox",
|
||||
value: 20
|
||||
}, {
|
||||
label: "Opera",
|
||||
value: 20
|
||||
}, {
|
||||
label: "Safari",
|
||||
value: 20
|
||||
}, {
|
||||
label: "Internet Explorer",
|
||||
value: 10
|
||||
}],
|
||||
colors: ['#C75757', '#18A689', '#0090D9', '#2B2E33', '#0090D9']
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//******************** TO DO LIST ********************//
|
||||
$("#sortable-todo").sortable();
|
||||
|
||||
$('.my_checkbox_all').on('click', function (event) {
|
||||
if ($(this).prop('checked') == true){
|
||||
$(this).closest('#task-manager').find('input:checkbox').prop('checked', true);
|
||||
} else {
|
||||
$(this).closest('#task-manager').find('input:checkbox').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//******************** REVENUE CHART ********************//
|
||||
function randomValue() {
|
||||
return (Math.floor(Math.random() * (1 + 24))) + 8;
|
||||
}
|
||||
|
||||
var data1 = [
|
||||
[1, 5 + randomValue()], [2, 10 + randomValue()], [3, 10 + randomValue()], [4, 15 + randomValue()], [5, 20 + randomValue()], [6, 25 + randomValue()], [7, 30 + randomValue()], [8, 35 + randomValue()], [9, 40 + randomValue()], [10, 45 + randomValue()], [11, 50 + randomValue()], [12, 55 + randomValue()], [13, 60 + randomValue()], [14, 70 + randomValue()], [15, 75 + randomValue()], [16, 80 + randomValue()], [17, 85 + randomValue()], [18, 90 + randomValue()], [19, 95 + randomValue()], [20, 100 + randomValue()]
|
||||
];
|
||||
var data2 = [
|
||||
[6, 1425], [7, 1754], [8, 1964], [9, 2145], [10, 2550], [11, 2210], [12, 1760], [13, 1820], [14, 1880], [15, 1985], [16, 2240]
|
||||
];
|
||||
|
||||
var plot = $.plot(
|
||||
$('#chart_revenue'), [{
|
||||
label: "Revenue",
|
||||
data: data1,
|
||||
color: '#fff',
|
||||
points: {
|
||||
fillColor: "#9182d4"
|
||||
}
|
||||
}], {
|
||||
grid: {
|
||||
color: '#fff',
|
||||
borderColor: "transparent",
|
||||
clickable: true,
|
||||
hoverable: true
|
||||
},
|
||||
series: {
|
||||
lines: {
|
||||
show: true,
|
||||
fill: false,
|
||||
},
|
||||
points: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
show: false
|
||||
},
|
||||
yaxis: {
|
||||
tickColor: '#B992DB'
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
tooltip: true
|
||||
});
|
||||
|
||||
var previousPoint = null;
|
||||
$("#chart_revenue").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(2));
|
||||
$("#y").text(pos.y.toFixed(2));
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
$("#flot-tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(2),
|
||||
y = item.datapoint[1].toFixed(2);
|
||||
showTooltip(item.pageX, item.pageY, y + "0 $");
|
||||
}
|
||||
} else {
|
||||
$("#flot-tooltip").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//**************** GOOGLE MAP WIDGET WITH FINDER ****************//
|
||||
if ($('#geocoding-map').length) {
|
||||
var geocoding_map;
|
||||
geocoding_map = new GMaps({
|
||||
el: '#geocoding-map',
|
||||
lat: 25.771912,
|
||||
lng: -80.186868,
|
||||
panControl: false,
|
||||
streetViewControl: false,
|
||||
mapTypeControl: false,
|
||||
overviewMapControl: false,
|
||||
zoom: 11,
|
||||
styles: [{
|
||||
"featureType": "water",
|
||||
"stylers": [{
|
||||
"color": "#0090d9"
|
||||
}, {
|
||||
"visibility": "on"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "landscape",
|
||||
"stylers": [{
|
||||
"color": "#ccdae5"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "road",
|
||||
"stylers": [{
|
||||
"saturation": -100
|
||||
}, {
|
||||
"lightness": 45
|
||||
}]
|
||||
}, {
|
||||
"featureType": "road.highway",
|
||||
"stylers": [{
|
||||
"visibility": "simplified"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "road.arterial",
|
||||
"elementType": "labels.icon",
|
||||
"stylers": [{
|
||||
"visibility": "off"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "administrative",
|
||||
"elementType": "labels.text.fill",
|
||||
"stylers": [{
|
||||
"color": "#444444"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "transit",
|
||||
"stylers": [{
|
||||
"visibility": "off"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "poi",
|
||||
"stylers": [{
|
||||
"visibility": "off"
|
||||
}]
|
||||
}]
|
||||
});
|
||||
$('#geocoding_form').submit(function (e) {
|
||||
e.preventDefault();
|
||||
GMaps.geocode({
|
||||
address: $('#address').val().trim(),
|
||||
callback: function (results, status) {
|
||||
if (status == 'OK') {
|
||||
var latlng = results[0].geometry.location;
|
||||
geocoding_map.setCenter(latlng.lat(), latlng.lng());
|
||||
geocoding_map.addMarker({
|
||||
lat: latlng.lat(),
|
||||
lng: latlng.lng()
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//******************** WEATHER WIDGET ********************//
|
||||
|
||||
/* We initiate widget with a city (can be changed) */
|
||||
var city = 'Miami';
|
||||
$.simpleWeather({
|
||||
location: city,
|
||||
woeid: '',
|
||||
unit: 'f',
|
||||
success: function (weather) {
|
||||
city = weather.city;
|
||||
region = weather.country;
|
||||
tomorrow_date = weather.tomorrow.date;
|
||||
weather_icon = '<i class="icon-' + weather.code + '"></i>';
|
||||
$(".weather-city").html(city);
|
||||
$(".weather-currently").html(weather.currently);
|
||||
$(".today-img").html('<i class="big-img-weather icon-' + weather.code + '"></i>');
|
||||
$(".today-temp").html(weather.low + '° / ' + weather.high + '°');
|
||||
$(".weather-region").html(region);
|
||||
$(".weather-day").html(tomorrow_date);
|
||||
$(".weather-icon").html(weather_icon);
|
||||
$(".1-days-day").html(weather.forecasts.one.day);
|
||||
$(".1-days-image").html('<i class="icon-' + weather.forecasts.one.code + '"></i>');
|
||||
$(".1-days-temp").html(weather.forecasts.one.low + '° / ' + weather.forecasts.one.high + '°');
|
||||
$(".2-days-day").html(weather.forecasts.two.day);
|
||||
$(".2-days-image").html('<i class="icon-' + weather.forecasts.two.code + '"></i>');
|
||||
$(".2-days-temp").html(weather.forecasts.two.low + '° / ' + weather.forecasts.two.high + '°');
|
||||
$(".3-days-day").html(weather.forecasts.three.day);
|
||||
$(".3-days-image").html('<i class="icon-' + weather.forecasts.three.code + '"></i>');
|
||||
$(".3-days-temp").html(weather.forecasts.three.low + '° / ' + weather.forecasts.three.high + '°');
|
||||
$(".4-days-day").html(weather.forecasts.four.day);
|
||||
$(".4-days-image").html('<i class="icon-' + weather.forecasts.four.code + '"></i>');
|
||||
$(".4-days-temp").html(weather.forecasts.four.low + '° / ' + weather.forecasts.four.high + '°');
|
||||
}
|
||||
});
|
||||
|
||||
/* We get city from input on change */
|
||||
$("#city-form").change(function () {
|
||||
city = document.getElementById("city-form").value;
|
||||
$.simpleWeather({
|
||||
location: city,
|
||||
woeid: '',
|
||||
unit: 'f',
|
||||
success: function (weather) {
|
||||
city = weather.city;
|
||||
region = weather.country;
|
||||
tomorrow_date = weather.tomorrow.date;
|
||||
weather_icon = '<i class="icon-' + weather.code + '"></i>';
|
||||
$(".weather-city").html(city);
|
||||
$(".weather-currently").html(weather.currently);
|
||||
$(".today-img").html('<i class="big-img-weather icon-' + weather.code + '"></i>');
|
||||
$(".today-temp").html(weather.low + '° / ' + weather.high + '°');
|
||||
$(".weather-region").html(region);
|
||||
$(".weather-day").html(tomorrow_date);
|
||||
$(".weather-icon").html(weather_icon);
|
||||
$(".1-days-day").html(weather.forecasts.one.day);
|
||||
$(".1-days-image").html('<i class="icon-' + weather.forecasts.one.code + '"></i>');
|
||||
$(".1-days-temp").html(weather.forecasts.one.low + '° / ' + weather.forecasts.one.high + '°');
|
||||
$(".2-days-day").html(weather.forecasts.two.day);
|
||||
$(".2-days-image").html('<i class="icon-' + weather.forecasts.two.code + '"></i>');
|
||||
$(".2-days-temp").html(weather.forecasts.two.low + '° / ' + weather.forecasts.two.high + '°');
|
||||
$(".3-days-day").html(weather.forecasts.three.day);
|
||||
$(".3-days-image").html('<i class="icon-' + weather.forecasts.three.code + '"></i>');
|
||||
$(".3-days-temp").html(weather.forecasts.three.low + '° / ' + weather.forecasts.three.high + '°');
|
||||
$(".4-days-day").html(weather.forecasts.four.day);
|
||||
$(".4-days-image").html('<i class="icon-' + weather.forecasts.four.code + '"></i>');
|
||||
$(".4-days-temp").html(weather.forecasts.four.low + '° / ' + weather.forecasts.four.high + '°');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
337
public/assets/js/ecommerce.js
Normal file
337
public/assets/js/ecommerce.js
Normal file
@@ -0,0 +1,337 @@
|
||||
$(function () {
|
||||
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
/*------------------------------ ECOMMERCE DASHBOARD --------------------------------*/
|
||||
|
||||
if($('body').data('page') == 'ecommerce_dashboard'){
|
||||
|
||||
|
||||
/* Delete a product */
|
||||
$('#products-table a.delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this product ?") == false) {
|
||||
return;
|
||||
}
|
||||
$(this).parent().parent().fadeOut();
|
||||
});
|
||||
|
||||
/* Delete a review */
|
||||
$('#product-review a.delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this comment ?") == false) {
|
||||
return;
|
||||
}
|
||||
$(this).parent().parent().fadeOut();
|
||||
});
|
||||
|
||||
/* Validate a review */
|
||||
$('#product-review a.edit').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$(this).parent().parent().find('.label').removeClass('label-info').addClass('label-success').html('Approved');
|
||||
$(this).fadeOut();
|
||||
});
|
||||
|
||||
/*
|
||||
<span class="label label-success w-300">Approved</span>
|
||||
|
||||
*/
|
||||
|
||||
/* We have to recreate charts on resize to make them responsive */
|
||||
$(window).resize(function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
//******************** REVENUE CHART ********************//
|
||||
function randomValue() {
|
||||
return (Math.floor(Math.random() * (1 + 24))) + 8;
|
||||
}
|
||||
|
||||
var data1 = [
|
||||
[1, 5 + randomValue()], [2, 10 + randomValue()], [3, 10 + randomValue()], [4, 15 + randomValue()], [5, 20 + randomValue()], [6, 25 + randomValue()], [7, 30 + randomValue()], [8, 35 + randomValue()], [9, 40 + randomValue()], [10, 45 + randomValue()], [11, 50 + randomValue()], [12, 55 + randomValue()], [13, 60 + randomValue()], [14, 70 + randomValue()], [15, 75 + randomValue()], [16, 80 + randomValue()], [17, 85 + randomValue()], [18, 90 + randomValue()], [19, 95 + randomValue()], [20, 100 + randomValue()]
|
||||
];
|
||||
var data2 = [
|
||||
[6, 1425], [7, 1754], [8, 1964], [9, 2145], [10, 2550], [11, 2210], [12, 1760], [13, 1820], [14, 1880], [15, 1985], [16, 2240]
|
||||
];
|
||||
|
||||
var plot = $.plot(
|
||||
$('#chart_revenue'), [{
|
||||
label: "Revenue",
|
||||
data: data1,
|
||||
color: '#0090D9',
|
||||
points: {
|
||||
fillColor: "#0090D9"
|
||||
}
|
||||
}], {
|
||||
grid: {
|
||||
color: '#fff',
|
||||
borderColor: "transparent",
|
||||
clickable: true,
|
||||
hoverable: true
|
||||
},
|
||||
series: {
|
||||
lines: {
|
||||
show: true,
|
||||
fill: false,
|
||||
},
|
||||
points: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
show: false
|
||||
},
|
||||
yaxis: {
|
||||
tickColor: '#e8e8e8'
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
tooltip: true
|
||||
});
|
||||
|
||||
var previousPoint = null;
|
||||
$("#chart_revenue").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(2));
|
||||
$("#y").text(pos.y.toFixed(2));
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
$("#flot-tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(2),
|
||||
y = item.datapoint[1].toFixed(2);
|
||||
showTooltip(item.pageX, item.pageY, y + "0 $");
|
||||
}
|
||||
} else {
|
||||
$("#flot-tooltip").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
|
||||
function showTooltip(x, y, contents) {
|
||||
$('<div id="flot-tooltip">' + contents + '</div>').css({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
top: y + 5,
|
||||
left: x + 5,
|
||||
color: '#fff',
|
||||
padding: '2px 5px',
|
||||
'background-color': '#717171',
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(200);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
/*----------------------------------- PRODUCTS --------------------------------------*/
|
||||
|
||||
if($('body').data('page') == 'products'){
|
||||
|
||||
var opt = {};
|
||||
|
||||
// Tools: export to Excel, CSV, PDF & Print
|
||||
opt.sDom = "<'row m-t-10'<'col-md-6'f><'col-md-6'T>r>t<'row'<'col-md-6'><'col-md-6 align-right'p>>",
|
||||
opt.oLanguage = { "sSearch": "" } ,
|
||||
opt.iDisplayLength = 15,
|
||||
|
||||
opt.oTableTools = {
|
||||
"sSwfPath": "assets/plugins/datatables/swf/copy_csv_xls_pdf.swf",
|
||||
"aButtons": ["csv", "xls", "pdf", "print"]
|
||||
};
|
||||
opt.aoColumnDefs = [
|
||||
{ 'bSortable': false, 'aTargets': [ 6,7,8,9 ] }
|
||||
];
|
||||
|
||||
|
||||
var oTable = $('#products-table').dataTable(opt);
|
||||
oTable.fnDraw();
|
||||
|
||||
/* Add a placeholder to searh input */
|
||||
$('.dataTables_filter input').attr("placeholder", "Search a product...");
|
||||
|
||||
/* Delete a product */
|
||||
$('#products-table a.delete').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this product ?") == false) {
|
||||
return;
|
||||
}
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
oTable.fnDeleteRow(nRow);
|
||||
// alert("Deleted! Do not forget to do some ajax to sync with backend :)");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if($('body').data('page') == 'products-ajax'){
|
||||
|
||||
var opt = {};
|
||||
opt.ajax = "assets/ajax/data-table.txt";
|
||||
|
||||
|
||||
// Tools: export to Excel, CSV, PDF & Print
|
||||
opt.sDom = "<'row m-t-10'<'col-md-6'f><'col-md-6'T>r>t<'row'<'col-md-6'><'col-md-6 align-right'p>>",
|
||||
opt.oLanguage = { "sSearch": "" } ,
|
||||
opt.iDisplayLength = 15,
|
||||
opt.fnDrawCallback = function( oSettings ) {
|
||||
$('.progress-bar').progressbar();
|
||||
};
|
||||
opt.oTableTools = {
|
||||
"sSwfPath": "assets/plugins/datatables/swf/copy_csv_xls_pdf.swf",
|
||||
"aButtons": ["csv", "xls", "pdf", "print"]
|
||||
};
|
||||
opt.aoColumnDefs = [
|
||||
{ 'bSortable': false, 'aTargets': [ 6,7,8,9 ] }
|
||||
];
|
||||
|
||||
|
||||
var oTable = $('#products-table').dataTable(opt);
|
||||
oTable.fnDraw();
|
||||
|
||||
/* Add a placeholder to searh input */
|
||||
$('.dataTables_filter input').attr("placeholder", "Search a product...");
|
||||
|
||||
/* Delete a product */
|
||||
$('#products-table a.delete').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this product ?") == false) {
|
||||
return;
|
||||
}
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
oTable.fnDeleteRow(nRow);
|
||||
// alert("Deleted! Do not forget to do some ajax to sync with backend :)");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if($('body').data('page') == 'product_view'){
|
||||
|
||||
|
||||
/* Delete a review */
|
||||
$('#product-review a.delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this comment ?") == false) {
|
||||
return;
|
||||
}
|
||||
$(this).parent().parent().fadeOut();
|
||||
});
|
||||
|
||||
/* Delete an image */
|
||||
$('#product-review a.delete-img').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this image ?") == false) {
|
||||
return;
|
||||
}
|
||||
$(this).parent().parent().fadeOut();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------------*/
|
||||
/*------------------------------------ ORDERS ---------------------------------------*/
|
||||
|
||||
if($('body').data('page') == 'orders'){
|
||||
|
||||
var opt = {};
|
||||
// Tools: export to Excel, CSV, PDF & Print
|
||||
opt.sDom = "<'row m-t-10'<'col-md-6'f><'col-md-6'T>r>t<'row'<'col-md-6'><'col-md-6 align-right'p>>",
|
||||
opt.oLanguage = { "sSearch": "" } ,
|
||||
opt.iDisplayLength = 15,
|
||||
opt.oTableTools = {
|
||||
"sSwfPath": "assets/plugins/datatables/swf/copy_csv_xls_pdf.swf",
|
||||
"aButtons": ["csv", "xls", "pdf", "print"]
|
||||
};
|
||||
opt.aoColumnDefs = [
|
||||
{ 'bSortable': false, 'aTargets': [ 9 ] }
|
||||
];
|
||||
|
||||
var oTable = $('#products-table').dataTable(opt);
|
||||
oTable.fnDraw();
|
||||
|
||||
/* Add a placeholder to searh input */
|
||||
$('.dataTables_filter input').attr("placeholder", "Search an order...");
|
||||
|
||||
/* Delete a product */
|
||||
$('#products-table a.delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure to delete this product ?") == false) {
|
||||
return;
|
||||
}
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
oTable.fnDeleteRow(nRow);
|
||||
// alert("Deleted! Do not forget to do some ajax to sync with backend :)");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if($('body').data('page') == 'shopping_cart'){
|
||||
|
||||
var pop = $('.popbtn');
|
||||
var main_image = $('#main-image');
|
||||
|
||||
pop.popover({
|
||||
trigger: 'manual',
|
||||
html: true,
|
||||
container: 'body',
|
||||
placement: 'bottom',
|
||||
animation: false,
|
||||
content: function() {
|
||||
return $('#popover').html();
|
||||
}
|
||||
});
|
||||
|
||||
pop.on('click', function(e) {
|
||||
pop.popover('toggle');
|
||||
pop.not(this).popover('hide');
|
||||
});
|
||||
|
||||
$(window).on('resize', function() {
|
||||
pop.popover('hide');
|
||||
});
|
||||
|
||||
/* Show Image item onclick */
|
||||
$('.shop-item').on('click', function(){
|
||||
current_image = $(this).data('image');
|
||||
current_image_src = 'assets/img/shopping/' + current_image + '.png';
|
||||
main_image.fadeOut(200);
|
||||
setTimeout(function() {
|
||||
main_image.attr('src', current_image_src);
|
||||
main_image.fadeIn();
|
||||
}, 350);
|
||||
});
|
||||
|
||||
|
||||
function setCurrentProgressTab($rootwizard, $nav, $tab, $progress, index) {
|
||||
$tab.prevAll().addClass('completed');
|
||||
$tab.nextAll().removeClass('completed');
|
||||
var items = $nav.children().length,
|
||||
pct = parseInt((index + 1) / items * 100, 10),
|
||||
$first_tab = $nav.find('li:first-child'),
|
||||
margin = (1 / (items * 2) * 100) + '%';
|
||||
if ($first_tab.hasClass('active')) {
|
||||
$progress.width(0);
|
||||
} else {
|
||||
$progress.width(((index - 1) / (items - 1)) * 100 + '%');
|
||||
|
||||
}
|
||||
$progress.parent().css({
|
||||
marginLeft: margin,
|
||||
marginRight: margin
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#rootwizard').bootstrapWizard({
|
||||
'tabClass': 'bwizard-steps',
|
||||
'nextSelector': '.button-next',
|
||||
'previousSelector': '.button-prev',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
11
public/assets/js/editor.js
Normal file
11
public/assets/js/editor.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/* Summernote inline editing functions */
|
||||
var edit = function () {
|
||||
$('.click2edit').summernote({
|
||||
focus: true
|
||||
});
|
||||
};
|
||||
|
||||
var save = function () {
|
||||
var aHTML = $('.click2edit').code(); //save HTML If you need(aHTML: array).
|
||||
$('.click2edit').destroy();
|
||||
};
|
||||
23
public/assets/js/faq.js
Normal file
23
public/assets/js/faq.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
$(function() {
|
||||
manageGallery();
|
||||
});
|
||||
|
||||
function manageGallery(){
|
||||
function mixitup() {
|
||||
$("#faq").mixItUp({
|
||||
animation: {
|
||||
duration: 400,
|
||||
effects: "fade translateZ(-360px) stagger(34ms)",
|
||||
easing: "ease",
|
||||
queueLimit: 3,
|
||||
animateChangeLayout: true,
|
||||
animateResizeTargets: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
mixitup();
|
||||
}
|
||||
|
||||
*/
|
||||
222
public/assets/js/form_wizard.js
Normal file
222
public/assets/js/form_wizard.js
Normal file
@@ -0,0 +1,222 @@
|
||||
$(function () {
|
||||
|
||||
/**** Inline Form Wizard with Validation ****/
|
||||
$(".form-wizard").steps({
|
||||
bodyTag: "section",
|
||||
onStepChanging: function (event, currentIndex, newIndex) {
|
||||
// Always allow going backward even if the current step contains invalid fields!
|
||||
if (currentIndex > newIndex) {
|
||||
return true;
|
||||
}
|
||||
// Forbid suppressing "Warning" step if the user is to young
|
||||
if (newIndex === 3 && Number($("#age").val()) < 18) {
|
||||
return false;
|
||||
}
|
||||
var form = $(this);
|
||||
// Clean up if user went backward before
|
||||
if (currentIndex < newIndex) {
|
||||
// To remove error styles
|
||||
$(".body:eq(" + newIndex + ") label.error", form).remove();
|
||||
$(".body:eq(" + newIndex + ") .error", form).removeClass("error");
|
||||
}
|
||||
// Disable validation on fields that are disabled or hidden.
|
||||
form.validate().settings.ignore = ":disabled,:hidden";
|
||||
// Start validation; Prevent going forward if false
|
||||
return form.valid();
|
||||
},
|
||||
onStepChanged: function (event, currentIndex, priorIndex) {
|
||||
// Suppress (skip) "Warning" step if the user is old enough.
|
||||
if (currentIndex === 2 && Number($("#age").val()) >= 18) {
|
||||
$(this).steps("next");
|
||||
}
|
||||
// Suppress (skip) "Warning" step if the user is old enough and wants to the previous step.
|
||||
if (currentIndex === 2 && priorIndex === 3) {
|
||||
$(this).steps("previous");
|
||||
}
|
||||
},
|
||||
onFinishing: function (event, currentIndex) {
|
||||
var form = $(this);
|
||||
// Disable validation on fields that are disabled.
|
||||
// At this point it's recommended to do an overall check (mean ignoring only disabled fields)
|
||||
form.validate().settings.ignore = ":disabled";
|
||||
|
||||
// Start validation; Prevent form submission if false
|
||||
return form.valid();
|
||||
},
|
||||
onFinished: function (event, currentIndex) {
|
||||
var form = $(this);
|
||||
// Submit form input
|
||||
form.submit();
|
||||
}
|
||||
}).validate({
|
||||
errorPlacement: function (error, element) {
|
||||
element.before(error);
|
||||
},
|
||||
rules: {
|
||||
confirm: {
|
||||
equalTo: "#password"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**** Modal Form Wizard with Validation ****/
|
||||
|
||||
|
||||
$.fn.wizard.logging = true;
|
||||
var wizard = $('#satellite-wizard').wizard({
|
||||
keyboard: false,
|
||||
contentHeight: 400,
|
||||
contentWidth: 700,
|
||||
backdrop: 'static'
|
||||
});
|
||||
|
||||
$('#fqdn').on('input', function () {
|
||||
if ($(this).val().length != 0) {
|
||||
$('#ip').val('').attr('disabled', 'disabled');
|
||||
$('#fqdn, #ip').parents('.form-group').removeClass('has-error has-success');
|
||||
} else {
|
||||
$('#ip').val('').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
var pattern = /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/;
|
||||
x = 46;
|
||||
|
||||
$('#ip').on('input', function () {
|
||||
if ($(this).val().length != 0) {
|
||||
$('#fqdn').val('').attr('disabled', 'disabled');
|
||||
} else {
|
||||
$('#fqdn').val('').removeAttr('disabled');
|
||||
}
|
||||
}).keypress(function (e) {
|
||||
if (e.which != 8 && e.which != 0 && e.which != x && (e.which < 48 || e.which > 57)) {
|
||||
console.log(e.which);
|
||||
return false;
|
||||
}
|
||||
}).keyup(function () {
|
||||
var $this = $(this);
|
||||
if (!pattern.test($this.val())) {
|
||||
//$('#validate_ip').text('Not Valid IP');
|
||||
console.log('Not Valid IP');
|
||||
$this.parents('.form-group').removeClass('has-error has-success').addClass('has-error');
|
||||
while ($this.val().indexOf("..") !== -1) {
|
||||
$this.val($this.val().replace('..', '.'));
|
||||
}
|
||||
x = 46;
|
||||
} else {
|
||||
x = 0;
|
||||
var lastChar = $this.val().substr($this.val().length - 1);
|
||||
if (lastChar == '.') {
|
||||
$this.val($this.val().slice(0, -1));
|
||||
}
|
||||
var ip = $this.val().split('.');
|
||||
if (ip.length == 4) {
|
||||
//$('#validate_ip').text('Valid IP');
|
||||
console.log('Valid IP');
|
||||
$this.parents('.form-group').removeClass('has-error').addClass('has-success');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
wizard.on('closed', function () {
|
||||
wizard.reset();
|
||||
});
|
||||
|
||||
wizard.on("reset", function () {
|
||||
wizard.modal.find(':input').val('').removeAttr('disabled');
|
||||
wizard.modal.find('.form-group').removeClass('has-error').removeClass('has-succes');
|
||||
wizard.modal.find('#fqdn').data('is-valid', 0).data('lookup', 0);
|
||||
});
|
||||
|
||||
wizard.on("submit", function (wizard) {
|
||||
var submit = {
|
||||
"hostname": $("#new-server-fqdn").val()
|
||||
};
|
||||
|
||||
this.log('seralize()');
|
||||
this.log(this.serialize());
|
||||
this.log('serializeArray()');
|
||||
this.log(this.serializeArray());
|
||||
|
||||
setTimeout(function () {
|
||||
wizard.trigger("success");
|
||||
wizard.hideButtons();
|
||||
wizard._submitting = false;
|
||||
wizard.showSubmitCard("success");
|
||||
wizard.updateProgressBar(0);
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
wizard.el.find(".wizard-success .im-done").click(function () {
|
||||
wizard.hide();
|
||||
setTimeout(function () {
|
||||
wizard.reset();
|
||||
}, 250);
|
||||
|
||||
});
|
||||
|
||||
wizard.el.find(".wizard-success .create-another-server").click(function () {
|
||||
wizard.reset();
|
||||
});
|
||||
|
||||
$(".wizard-group-list").click(function () {
|
||||
alert("Disabled for demo.");
|
||||
});
|
||||
|
||||
$('#open-wizard').click(function (e) {
|
||||
e.preventDefault();
|
||||
wizard.show();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
function validateServerLabel(el) {
|
||||
var name = el.val();
|
||||
var retValue = {};
|
||||
|
||||
if (name == "") {
|
||||
retValue.status = false;
|
||||
retValue.msg = "Please enter a label";
|
||||
} else {
|
||||
retValue.status = true;
|
||||
}
|
||||
|
||||
return retValue;
|
||||
};
|
||||
|
||||
function validateFQDN(el) {
|
||||
var $this = $(el);
|
||||
var retValue = {};
|
||||
|
||||
if ($this.is(':disabled')) {
|
||||
// FQDN Disabled
|
||||
retValue.status = true;
|
||||
} else {
|
||||
if ($this.data('lookup') === 0) {
|
||||
retValue.status = false;
|
||||
retValue.msg = "Preform lookup first";
|
||||
} else {
|
||||
if ($this.data('is-valid') === 0) {
|
||||
retValue.status = false;
|
||||
retValue.msg = "Lookup Failed";
|
||||
} else {
|
||||
retValue.status = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return retValue;
|
||||
};
|
||||
|
||||
function lookup() {
|
||||
// Normally a ajax call to the server to preform a lookup
|
||||
$('#fqdn').data('lookup', 1);
|
||||
$('#fqdn').data('is-valid', 1);
|
||||
$('#ip').val('127.0.0.1');
|
||||
};
|
||||
125
public/assets/js/forum.js
Normal file
125
public/assets/js/forum.js
Normal file
@@ -0,0 +1,125 @@
|
||||
$(function(){
|
||||
|
||||
/* We initiate calendar for filter search */
|
||||
jQuery('#calendar').datetimepicker();
|
||||
|
||||
$('.forum-questions .message-item').on('click', function(){
|
||||
$('.forum-questions').fadeOut("slow", function(){
|
||||
window.location="forum_answer.html";
|
||||
});
|
||||
});
|
||||
|
||||
$('.forum-category li').on('click', function(){
|
||||
$('.forum-answer').fadeOut("slow", function(){
|
||||
window.location="forum.html";
|
||||
});
|
||||
});
|
||||
|
||||
if($('.forum-questions').length){
|
||||
$('.forum-questions').fadeIn("slow");
|
||||
}
|
||||
|
||||
if($('.forum-answer').length){
|
||||
$('.forum-answer').fadeIn("slow");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Questions Chart */
|
||||
function randomValue() {
|
||||
return (Math.floor(Math.random() * (1 + 24))) + 8;
|
||||
}
|
||||
|
||||
var data1 = [
|
||||
[1, 5 + randomValue()],
|
||||
[2, 10 + randomValue()],
|
||||
[3, 10 + randomValue()],
|
||||
[4, 15 + randomValue()],
|
||||
[5, 20 + randomValue()],
|
||||
[6, 25 + randomValue()],
|
||||
[7, 30 + randomValue()],
|
||||
[8, 35 + randomValue()],
|
||||
[9, 40 + randomValue()],
|
||||
[10, 45 + randomValue()],
|
||||
[11, 50 + randomValue()],
|
||||
[12, 55 + randomValue()]
|
||||
];
|
||||
|
||||
var plot = $.plot($("#chart_1"), [{
|
||||
data: data1,
|
||||
label: [
|
||||
["January"],
|
||||
["February"],
|
||||
["March"],
|
||||
["April"],
|
||||
["May"],
|
||||
["June"],
|
||||
["July"],
|
||||
["August"],
|
||||
["September"],
|
||||
["October"],
|
||||
["November"],
|
||||
["December"]
|
||||
],
|
||||
showLabels: true,
|
||||
labelPlacement: "below",
|
||||
canvasRender: true,
|
||||
cColor: "#FFFFFF"
|
||||
}], {
|
||||
series: {
|
||||
lines: {
|
||||
show: true,
|
||||
fill: true,
|
||||
fill: 1
|
||||
},
|
||||
fillColor: "rgba(0, 0, 0 , 1)",
|
||||
points: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
hoverable: true
|
||||
},
|
||||
colors: ["#428BCA"]
|
||||
});
|
||||
|
||||
|
||||
function showTooltip(x, y, contents) {
|
||||
$('<div id="flot-tooltip">' + contents + '</div>').css({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
top: y + 5,
|
||||
left: x + 5,
|
||||
color: '#fff',
|
||||
padding: '2px 5px',
|
||||
'background-color': '#717171',
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(200);
|
||||
}
|
||||
|
||||
var previousPoint = null;
|
||||
$("#chart_1").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(0));
|
||||
$("#y").text(pos.y.toFixed(0));
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
$("#flot-tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(0),
|
||||
y = item.datapoint[1].toFixed(0);
|
||||
showTooltip(item.pageX, item.pageY, y + " questions in " + item.series.label[item.dataIndex]);
|
||||
}
|
||||
} else {
|
||||
$("#flot-tooltip").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
0
public/assets/js/gallery.js
Normal file
0
public/assets/js/gallery.js
Normal file
8
public/assets/js/icons.js
Normal file
8
public/assets/js/icons.js
Normal file
@@ -0,0 +1,8 @@
|
||||
$(function () {
|
||||
|
||||
/* Search Icons Function */
|
||||
if ($('input#icon-finder').length) {
|
||||
$('input#icon-finder').val('').quicksearch('#glyphicons-list .glyphicon-item,#fontawesome-list .fa-item,#zocial-list .social-btn,#zocial-list .social-btn-small');
|
||||
}
|
||||
|
||||
});
|
||||
134
public/assets/js/image_croping.js
Normal file
134
public/assets/js/image_croping.js
Normal file
@@ -0,0 +1,134 @@
|
||||
var crop_1;
|
||||
|
||||
$(function () {
|
||||
cropImage();
|
||||
});
|
||||
|
||||
$(window).resize(function () {
|
||||
img_width = $('.jcrop-holder img').parent().parent().parent().width() - 40;
|
||||
$('.jcrop-holder img').width(img_width);
|
||||
$('.jcrop-holder img').height('auto');
|
||||
});
|
||||
|
||||
$('#chat-toggle').on('click', function () {
|
||||
|
||||
$('#main-content .col-md-6').fadeOut().fadeIn();
|
||||
|
||||
setTimeout(function () {
|
||||
if($('#menu-right').hasClass('mm-opened')){
|
||||
img_width = $('.jcrop-holder img').parent().parent().parent().width() - 40;
|
||||
$('.jcrop-holder img').width(img_width);
|
||||
$('.jcrop-holder img').height('auto');
|
||||
$('#preview-pane').css('margin-right', '135px');
|
||||
}
|
||||
else{
|
||||
img_width = $('.jcrop-holder img').parent().parent().parent().width() - 40;
|
||||
$('.jcrop-holder img').width(img_width);
|
||||
$('.jcrop-holder img').height('auto');
|
||||
$('#preview-pane').css('margin-right', '10px');
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
|
||||
function cropImage() {
|
||||
// Create variables (in this scope) to hold the API and image size
|
||||
var boundx,
|
||||
boundy,
|
||||
api;
|
||||
|
||||
// Grab some information about the preview pane
|
||||
$preview = $('#preview-pane'),
|
||||
$pcnt = $('#preview-pane .preview-container'),
|
||||
$pimg = $('#preview-pane .preview-container img'),
|
||||
|
||||
xsize = $pcnt.width(),
|
||||
ysize = $pcnt.height();
|
||||
|
||||
console.log('init', [xsize, ysize]);
|
||||
|
||||
$('#image_crop1').Jcrop({
|
||||
onChange: updatePreview,
|
||||
onSelect: updatePreview,
|
||||
aspectRatio: xsize / ysize
|
||||
}, function () {
|
||||
// Use the API to get the real image size
|
||||
var bounds = this.getBounds();
|
||||
boundx = bounds[0];
|
||||
boundy = bounds[1];
|
||||
// Store the API in the jcrop_api variable
|
||||
crop_1 = this;
|
||||
|
||||
// Move the preview into the jcrop container for css positioning
|
||||
$preview.appendTo(crop_1.ui.holder);
|
||||
});
|
||||
|
||||
function updatePreview(c) {
|
||||
if (parseInt(c.w) > 0) {
|
||||
var rx = xsize / c.w;
|
||||
var ry = ysize / c.h;
|
||||
|
||||
$pimg.css({
|
||||
width: Math.round(rx * boundx) + 'px',
|
||||
height: Math.round(ry * boundy) + 'px',
|
||||
marginLeft: '-' + Math.round(rx * c.x) + 'px',
|
||||
marginTop: '-' + Math.round(ry * c.y) + 'px'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$('#image_crop2').Jcrop({
|
||||
// start off with jcrop-light class
|
||||
bgOpacity: 0.5,
|
||||
bgColor: 'transparent',
|
||||
addClass: 'jcrop-light'
|
||||
}, function () {
|
||||
crop_2 = this;
|
||||
crop_2.setSelect([130, 65, 130 + 350, 65 + 285]);
|
||||
crop_2.setOptions({
|
||||
bgFade: true
|
||||
});
|
||||
crop_2.ui.selection.addClass('jcrop-selection');
|
||||
});
|
||||
|
||||
|
||||
/* Change Background Opacity on Button click */
|
||||
$('#buttonbar').on('click', 'button', function (e) {
|
||||
var $t = $(this),
|
||||
$g = $t.closest('.btn-group');
|
||||
$g.find('button.active').removeClass('active');
|
||||
$t.addClass('active');
|
||||
$g.find('[data-setclass]').each(function () {
|
||||
var $th = $(this),
|
||||
c = $th.data('setclass'),
|
||||
a = $th.hasClass('active');
|
||||
if (a) {
|
||||
crop_2.ui.holder.addClass(c);
|
||||
switch (c) {
|
||||
|
||||
case 'jcrop-light':
|
||||
crop_2.setOptions({
|
||||
bgColor: 'white',
|
||||
bgOpacity: 0.5
|
||||
});
|
||||
break;
|
||||
|
||||
case 'jcrop-dark':
|
||||
crop_2.setOptions({
|
||||
bgColor: 'black',
|
||||
bgOpacity: 0.4
|
||||
});
|
||||
break;
|
||||
|
||||
case 'jcrop-normal':
|
||||
crop_2.setOptions({
|
||||
bgColor: $.Jcrop.defaults.bgColor,
|
||||
bgOpacity: $.Jcrop.defaults.bgOpacity
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else crop_2.ui.holder.removeClass(c);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
49
public/assets/js/intro.js
Normal file
49
public/assets/js/intro.js
Normal file
@@ -0,0 +1,49 @@
|
||||
$(function(){
|
||||
|
||||
$("html, body").animate({
|
||||
scrollTop: 0
|
||||
}, 100);
|
||||
|
||||
function startIntro(){
|
||||
|
||||
var intro = introJs();
|
||||
intro.setOptions({
|
||||
showBullets : true,
|
||||
steps: [
|
||||
{
|
||||
element: '#sidebar', position: "right",
|
||||
intro: "This menu permit you to navigate through all pages."
|
||||
},{
|
||||
element: '#panel-visitors', position: "bottom",
|
||||
intro: "Here you can view number your visits stats."
|
||||
},{
|
||||
element: '#panel-pages', position: "bottom",
|
||||
intro: "If you want to play again Intro demo."
|
||||
},{
|
||||
element: '#browser-stats', position: "left",
|
||||
intro: "You will have more details here with the visitors chart."
|
||||
},{
|
||||
element: '#to-do-list', position: "right",
|
||||
intro: "Here you can edit your tasks."
|
||||
}
|
||||
,{
|
||||
element: '#contact-list', position: "left",
|
||||
intro: "You can manage your contacts list and send them emails."
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
intro.start();
|
||||
$("html, body").scrollTop(0);
|
||||
}
|
||||
|
||||
startIntro();
|
||||
|
||||
/* Replay Intro on Button click */
|
||||
$('#start-intro').click(function () {
|
||||
startIntro();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
114
public/assets/js/invoice.js
Normal file
114
public/assets/js/invoice.js
Normal file
@@ -0,0 +1,114 @@
|
||||
function print_today() {
|
||||
|
||||
var now = new Date();
|
||||
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
|
||||
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
|
||||
function fourdigits(number) {
|
||||
return (number < 1000) ? number + 1900 : number;
|
||||
}
|
||||
var today = months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear()));
|
||||
return today;
|
||||
}
|
||||
|
||||
function roundNumber(number,decimals) {
|
||||
var newString;// The new rounded number
|
||||
decimals = Number(decimals);
|
||||
if (decimals < 1) {
|
||||
newString = (Math.round(number)).toString();
|
||||
} else {
|
||||
var numString = number.toString();
|
||||
if (numString.lastIndexOf(".") == -1) {// If there is no decimal point
|
||||
numString += ".";// give it one at the end
|
||||
}
|
||||
var cutoff = numString.lastIndexOf(".") + decimals;// The point at which to truncate the number
|
||||
var d1 = Number(numString.substring(cutoff,cutoff+1));// The value of the last decimal place that we'll end up with
|
||||
var d2 = Number(numString.substring(cutoff+1,cutoff+2));// The next decimal, after the last one we want
|
||||
if (d2 >= 5) {// Do we need to round up at all? If not, the string will just be truncated
|
||||
if (d1 == 9 && cutoff > 0) {// If the last digit is 9, find a new cutoff point
|
||||
while (cutoff > 0 && (d1 == 9 || isNaN(d1))) {
|
||||
if (d1 != ".") {
|
||||
cutoff -= 1;
|
||||
d1 = Number(numString.substring(cutoff,cutoff+1));
|
||||
} else {
|
||||
cutoff -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
d1 += 1;
|
||||
}
|
||||
if (d1 == 10) {
|
||||
numString = numString.substring(0, numString.lastIndexOf("."));
|
||||
var roundedNum = Number(numString) + 1;
|
||||
newString = roundedNum.toString() + '.';
|
||||
} else {
|
||||
newString = numString.substring(0,cutoff) + d1.toString();
|
||||
}
|
||||
}
|
||||
if (newString.lastIndexOf(".") == -1) {// Do this again, to the new string
|
||||
newString += ".";
|
||||
}
|
||||
var decs = (newString.substring(newString.lastIndexOf(".")+1)).length;
|
||||
for(var i=0;i<decimals-decs;i++) newString += "0";
|
||||
//var newNumber = Number(newString);// make it a number if you like
|
||||
return newString; // Output the result to the form field (change for your purposes)
|
||||
}
|
||||
|
||||
function update_total() {
|
||||
var total = 0;
|
||||
$('.price').each(function(i){
|
||||
price = $(this).html().replace("$","");
|
||||
if (!isNaN(price)) total += Number(price);
|
||||
});
|
||||
|
||||
total = roundNumber(total,2);
|
||||
$('#subtotal').html("$"+total);
|
||||
|
||||
total_with_shipping();
|
||||
|
||||
}
|
||||
|
||||
function total_with_shipping() {
|
||||
var total_with_shipping = Number($("#subtotal").html().replace("$","")) + Number($("#shipping").val().replace("$",""));
|
||||
total_with_shipping = roundNumber(total_with_shipping,2);
|
||||
$('#total').html("$"+total_with_shipping);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function update_price() {
|
||||
var row = $(this).parents('.item-row');
|
||||
var price = row.find('.cost').val().replace("$","") * row.find('.qty').val();
|
||||
price = roundNumber(price,2);
|
||||
isNaN(price) ? row.find('.price').html("N/A") : row.find('.price').html("$"+price);
|
||||
|
||||
update_total();
|
||||
}
|
||||
|
||||
function bind() {
|
||||
$(".cost").blur(update_price);
|
||||
$(".qty").blur(update_price);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('input').click(function(){
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
$("#addrow").click(function(){
|
||||
$(".item-row:last").after('<tr class="item-row"><td class="delete-wpr"><textarea class="qty text-center">1</textarea><a class="delete" href="javascript:;" title="Remove row"><i class="fa fa-times"></i></a></td><td><div class="text-primary"><strong><textarea>Item Name</textarea></strong></div><small><textarea class="width-100p">Item description</textarea></small></td> <td><textarea class="text-right cost">$0.00</textarea></td><td><textarea class="text-right price">$0.00</textarea></td></tr>');
|
||||
if ($(".delete").length > 0) $(".delete").show();
|
||||
bind();
|
||||
});
|
||||
|
||||
bind();
|
||||
|
||||
$(".delete").live('click',function(){
|
||||
$(this).parents('.item-row').remove();
|
||||
update_total();
|
||||
if ($(".delete").length < 2) $(".delete").hide();
|
||||
});
|
||||
|
||||
$("#date").val(print_today());
|
||||
|
||||
});
|
||||
47
public/assets/js/mailbox.js
Normal file
47
public/assets/js/mailbox.js
Normal file
@@ -0,0 +1,47 @@
|
||||
var messages_list = $('#messages-list');
|
||||
var message_detail = $('#message-detail');
|
||||
|
||||
$(window).bind('enterBreakpoint768', function () {
|
||||
|
||||
$('.page-mailbox .withScroll').each(function () {
|
||||
$(this).mCustomScrollbar("destroy");
|
||||
$(this).removeClass('withScroll');
|
||||
$(this).height('');
|
||||
});
|
||||
|
||||
if (messages_list.height() > message_detail.height()) $('#message-detail .panel-body').height(messages_list.height() - 119);
|
||||
if (messages_list.height() < message_detail.height()) $('#messages-list .panel-body').height(message_detail.height());
|
||||
|
||||
});
|
||||
|
||||
$(window).bind('enterBreakpoint1200', function () {
|
||||
messages_list.addClass('withScroll');
|
||||
message_detail.addClass('withScroll');
|
||||
customScroll();
|
||||
});
|
||||
|
||||
$('.message-item').on('click', function () {
|
||||
if ($(window).width() < 991) {
|
||||
$('.list-messages').fadeOut();
|
||||
$('.detail-message').css('padding-left', '15px');
|
||||
$('.detail-message').fadeIn();
|
||||
}
|
||||
});
|
||||
|
||||
$('#go-back').on('click', function () {
|
||||
$('.list-messages').fadeIn();
|
||||
$('.detail-message').css('padding-left', '0');
|
||||
$('.detail-message').fadeOut();
|
||||
});
|
||||
|
||||
|
||||
/**** On Resize Functions ****/
|
||||
$(window).resize(function () {
|
||||
|
||||
if ($(window).width() > 991) {
|
||||
$('.list-messages').show();
|
||||
$('.detail-message').css('padding-left', '0');
|
||||
$('.detail-message').show();
|
||||
}
|
||||
|
||||
});
|
||||
199
public/assets/js/maps-google.js
Normal file
199
public/assets/js/maps-google.js
Normal file
@@ -0,0 +1,199 @@
|
||||
$(function () {
|
||||
|
||||
var simple_map;
|
||||
var styled_map;
|
||||
var route_map;
|
||||
var cluster_map;
|
||||
var geocoding_map;
|
||||
|
||||
if($("#simple-map").length){
|
||||
simple_map = new GMaps({
|
||||
el: '#simple-map',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
zoomControl: true,
|
||||
zoomControlOpt: {
|
||||
style: 'SMALL',
|
||||
position: 'TOP_LEFT'
|
||||
},
|
||||
panControl: false,
|
||||
streetViewControl: false,
|
||||
mapTypeControl: false,
|
||||
overviewMapControl: false
|
||||
});
|
||||
simple_map.addMarker({
|
||||
lat: -12.042,
|
||||
lng: -77.028333,
|
||||
title: 'Marker with InfoWindow',
|
||||
infoWindow: {
|
||||
content: '<p>Here we are!</p>'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if($("#style-map").length){
|
||||
styled_map = new GMaps({
|
||||
el: '#style-map',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
zoomControl: true,
|
||||
zoomControlOpt: {
|
||||
style: 'SMALL',
|
||||
position: 'TOP_LEFT'
|
||||
},
|
||||
panControl: false,
|
||||
streetViewControl: false,
|
||||
mapTypeControl: false,
|
||||
overviewMapControl: false,
|
||||
styles: [{
|
||||
"featureType": "water",
|
||||
"elementType": "geometry",
|
||||
"stylers": [{
|
||||
"color": "#193341"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "landscape",
|
||||
"elementType": "geometry",
|
||||
"stylers": [{
|
||||
"color": "#2c5a71"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "road",
|
||||
"elementType": "geometry",
|
||||
"stylers": [{
|
||||
"color": "#29768a"
|
||||
}, {
|
||||
"lightness": -37
|
||||
}]
|
||||
}, {
|
||||
"featureType": "poi",
|
||||
"elementType": "geometry",
|
||||
"stylers": [{
|
||||
"color": "#406d80"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "transit",
|
||||
"elementType": "geometry",
|
||||
"stylers": [{
|
||||
"color": "#406d80"
|
||||
}]
|
||||
}, {
|
||||
"elementType": "labels.text.stroke",
|
||||
"stylers": [{
|
||||
"visibility": "on"
|
||||
}, {
|
||||
"color": "#3e606f"
|
||||
}, {
|
||||
"weight": 2
|
||||
}, {
|
||||
"gamma": 0.84
|
||||
}]
|
||||
}, {
|
||||
"elementType": "labels.text.fill",
|
||||
"stylers": [{
|
||||
"color": "#ffffff"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "administrative",
|
||||
"elementType": "geometry",
|
||||
"stylers": [{
|
||||
"weight": 0.6
|
||||
}, {
|
||||
"color": "#1a3541"
|
||||
}]
|
||||
}, {
|
||||
"elementType": "labels.icon",
|
||||
"stylers": [{
|
||||
"visibility": "off"
|
||||
}]
|
||||
}, {
|
||||
"featureType": "poi.park",
|
||||
"elementType": "geometry",
|
||||
"stylers": [{
|
||||
"color": "#2c5a71"
|
||||
}]
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
if($("#route-map").length){
|
||||
map = new GMaps({
|
||||
el: '#route-map',
|
||||
zoom: 13,
|
||||
lat: -12.043333,
|
||||
lng: -77.028333
|
||||
});
|
||||
map.travelRoute({
|
||||
origin: [-12.044012922866312, -77.02470665341184],
|
||||
destination: [-12.090814532191756, -77.02271108990476],
|
||||
travelMode: 'driving',
|
||||
step: function (e) {
|
||||
$('#instructions').append('<li>' + e.instructions + '</li>');
|
||||
$('#instructions li:eq(' + e.step_number + ')').delay(450 * e.step_number).fadeIn(200, function () {
|
||||
map.drawPolyline({
|
||||
path: e.path,
|
||||
strokeColor: '#131540',
|
||||
strokeOpacity: 0.6,
|
||||
strokeWeight: 6
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($("#cluster-map").length){
|
||||
cluster_map = new GMaps({
|
||||
div: '#cluster-map',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
markerClusterer: function (map) {
|
||||
return new MarkerClusterer(map);
|
||||
}
|
||||
});
|
||||
|
||||
var lat_span = -12.035988012939503 - -12.050677786181573;
|
||||
var lng_span = -77.01528673535154 - -77.04137926464841;
|
||||
|
||||
for (var i = 0; i < 100; i++) {
|
||||
var latitude = Math.random() * (lat_span) + -12.050677786181573;
|
||||
var longitude = Math.random() * (lng_span) + -77.04137926464841;
|
||||
|
||||
cluster_map.addMarker({
|
||||
lat: latitude,
|
||||
lng: longitude,
|
||||
title: 'Marker #' + i
|
||||
});
|
||||
};
|
||||
|
||||
geocoding_map = new GMaps({
|
||||
el: '#geocoding-map',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333
|
||||
});
|
||||
}
|
||||
|
||||
if($("#geocoding_form").length){
|
||||
|
||||
$('#geocoding_form').submit(function (e) {
|
||||
e.preventDefault();
|
||||
GMaps.geocode({
|
||||
address: $('#address').val().trim(),
|
||||
callback: function (results, status) {
|
||||
if (status == 'OK') {
|
||||
var latlng = results[0].geometry.location;
|
||||
geocoding_map.setCenter(latlng.lat(), latlng.lng());
|
||||
geocoding_map.addMarker({
|
||||
lat: latlng.lat(),
|
||||
lng: latlng.lng()
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
8
public/assets/js/members.js
Normal file
8
public/assets/js/members.js
Normal file
@@ -0,0 +1,8 @@
|
||||
$(function () {
|
||||
|
||||
/* Search Icons Function */
|
||||
if ($('input#member-finder').length) {
|
||||
$('input#member-finder').val('').quicksearch('.member-entry');
|
||||
}
|
||||
|
||||
});
|
||||
185
public/assets/js/notes.js
Normal file
185
public/assets/js/notes.js
Normal file
@@ -0,0 +1,185 @@
|
||||
|
||||
$(function (){
|
||||
|
||||
var notes = notes || {};
|
||||
|
||||
/* Display current datetime and hours */
|
||||
function CurrentDate(container){
|
||||
var monthNames = [ "January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December" ];
|
||||
var dayNames= ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
|
||||
var date = new Date();
|
||||
date.setDate(date.getDate() + 1);
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth();
|
||||
var hours = date.getHours();
|
||||
var minutes = date.getMinutes();
|
||||
var ampm = hours >= 12 ? 'pm' : 'am';
|
||||
hours = hours % 12;
|
||||
hours = hours ? hours : 12; // the hour '0' should be '12'
|
||||
minutes = minutes < 10 ? '0'+minutes : minutes;
|
||||
var strTime = dayNames[date.getDay()] + " " + date.getDate() + ' ' + monthNames[date.getMonth()] + ', ' + hours + ':' + minutes + ' ' + ampm;
|
||||
$(container).text(strTime);
|
||||
}
|
||||
|
||||
CurrentDate('#currentDate');
|
||||
|
||||
/* Search Notes Function */
|
||||
if ($('input#notes-finder').length) {
|
||||
$('input#notes-finder').val('').quicksearch('.note-item');
|
||||
}
|
||||
|
||||
notes.$container = $(".page-notes");
|
||||
$.extend(notes, {
|
||||
noTitleText: "No title",
|
||||
noDescriptionText: "(No content)",
|
||||
$currentNote: $(null),
|
||||
$currentNoteTitle: $(null),
|
||||
$currentNoteDescription: $(null),
|
||||
addNote: function () {
|
||||
var $note = $('<div class="note-item media current fade in"><button class="close" data-dismiss="alert">×</button><div><div><h4 class="note-name">Untitled</h4></div><p class="note-desc">No content</p><p><small class="pull-right note-date"></small></p></div></div>');
|
||||
notes.$notesList.prepend($note);
|
||||
notes.$notesList.find('.note-item').removeClass('current');
|
||||
$note.addClass('current');
|
||||
notes.$writeNote.focus();
|
||||
notes.checkCurrentNote();
|
||||
CurrentDate('.note-date');
|
||||
customScroll();
|
||||
},
|
||||
checkCurrentNote: function () {
|
||||
var $current_note = notes.$notesList.find('div.current').first();
|
||||
|
||||
if ($current_note.length) {
|
||||
notes.$currentNote = $current_note;
|
||||
notes.$currentNoteTitle = $current_note.find('.note-name');
|
||||
notes.$currentNoteDescription = $current_note.find('.note-desc');
|
||||
var $space = notes.$currentNoteTitle.text().indexOf( "\r" );
|
||||
$note_title = notes.$currentNoteTitle.html();
|
||||
/* If there are no breaklines, we add one */
|
||||
if($space == -1) {
|
||||
$note_title = notes.$currentNoteTitle.append(' ').html();
|
||||
}
|
||||
var completeNote = $note_title + $.trim(notes.$currentNoteDescription.html());
|
||||
$space = $note_title.indexOf( "\r" );
|
||||
notes.$writeNote.val(completeNote).trigger('autosize.resize');
|
||||
|
||||
} else {
|
||||
var first = notes.$notesList.find('div:first:not(.no-notes)');
|
||||
if (first.length) {
|
||||
first.addClass('current');
|
||||
notes.checkCurrentNote();
|
||||
} else {
|
||||
notes.$writeNote.val('');
|
||||
notes.$currentNote = $(null);
|
||||
notes.$currentNoteTitle = $(null);
|
||||
notes.$currentNoteDescription = $(null);
|
||||
}
|
||||
}
|
||||
},
|
||||
updateCurrentNoteText: function () {
|
||||
var text = $.trim(notes.$writeNote.val());
|
||||
if (notes.$currentNote.length) {
|
||||
var title = '',
|
||||
description = '';
|
||||
if (text.length) {
|
||||
var _text = text.split("\n"),
|
||||
currline = 1;
|
||||
for (var i = 0; i < _text.length; i++) {
|
||||
if (_text[i]) {
|
||||
if (currline == 1) {
|
||||
title = _text[i];
|
||||
} else
|
||||
if (currline == 2) {
|
||||
description = _text[i];
|
||||
}
|
||||
currline++;
|
||||
}
|
||||
if (currline > 2)
|
||||
break;
|
||||
}
|
||||
}
|
||||
notes.$currentNoteTitle.text(title.length ? title : notes.noTitleText);
|
||||
notes.$currentNoteDescription.text(description.length ? description : notes.noDescriptionText);
|
||||
|
||||
} else
|
||||
if (text.length) {
|
||||
notes.addNote();
|
||||
}
|
||||
}
|
||||
});
|
||||
if (notes.$container.length > 0) {
|
||||
notes.$notesList = notes.$container.find('#notes-list');
|
||||
notes.$txtContainer = notes.$container.find('.note-write');
|
||||
notes.$writeNote = notes.$txtContainer.find('textarea');
|
||||
notes.$addNote = notes.$container.find('#add-note');
|
||||
notes.$addNote.on('click', function (ev) {
|
||||
notes.addNote();
|
||||
notes.$writeNote.val('');
|
||||
});
|
||||
notes.$writeNote.on('keyup', function (ev) {
|
||||
notes.updateCurrentNoteText();
|
||||
});
|
||||
notes.checkCurrentNote();
|
||||
notes.$notesList.on('click', '.note-item', function (ev) {
|
||||
ev.preventDefault();
|
||||
notes.$notesList.find('.note-item').removeClass('current');
|
||||
$(this).addClass('current');
|
||||
notes.checkCurrentNote();
|
||||
});
|
||||
}
|
||||
|
||||
var messages_list = $('.list-notes');
|
||||
var message_detail = $('.detail-note');
|
||||
|
||||
noteTextarea();
|
||||
|
||||
$(window).bind('enterBreakpoint768', function () {
|
||||
$('.page-notes .withScroll').each(function () {
|
||||
$(this).mCustomScrollbar("destroy");
|
||||
$(this).removeClass('withScroll');
|
||||
$(this).height('');
|
||||
});
|
||||
|
||||
if (messages_list.height() > message_detail.height()) $('.detail-note .panel-body').height(messages_list.height() - 119);
|
||||
if (messages_list.height() < message_detail.height()) $('.list-notes .panel-body').height(message_detail.height() - 2);
|
||||
|
||||
});
|
||||
|
||||
$(window).bind('enterBreakpoint1200', function () {
|
||||
messages_list.addClass('withScroll');
|
||||
message_detail.addClass('withScroll');
|
||||
customScroll();
|
||||
});
|
||||
|
||||
/* Show / hide note if screen size < 991 px */
|
||||
$('#notes-list').on('click', '.note-item', function () {
|
||||
if ($(window).width() < 991) {
|
||||
$('.list-notes').fadeOut();
|
||||
$('.detail-note').css('padding-left', '15px');
|
||||
$('.detail-note').fadeIn();
|
||||
}
|
||||
});
|
||||
|
||||
$('#go-back').on('click', function () {
|
||||
$('.list-notes').fadeIn();
|
||||
$('.detail-note').css('padding-left', '0');
|
||||
$('.detail-note').fadeOut();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
function noteTextarea(){
|
||||
$('.note-write textarea').height($(window).height() - 144);
|
||||
}
|
||||
|
||||
/**** On Resize Functions ****/
|
||||
$(window).resize(function () {
|
||||
|
||||
if ($(window).width() > 991) {
|
||||
noteTextarea();
|
||||
$('.list-notes').show();
|
||||
$('.detail-note').css('padding-left', '0');
|
||||
$('.detail-note').show();
|
||||
}
|
||||
|
||||
});
|
||||
63
public/assets/js/notifications.js
Normal file
63
public/assets/js/notifications.js
Normal file
@@ -0,0 +1,63 @@
|
||||
$(function () {
|
||||
|
||||
/* We create a click event for notifications, but you can modify easily this event to fit your needs */
|
||||
$(".notification").click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
/**** INFO MESSAGE TYPE ****/
|
||||
if ($(this).data("type") == 'info') {
|
||||
jNotify(
|
||||
$(this).data("message"), {
|
||||
HorizontalPosition: $(this).data("horiz-pos"),
|
||||
VerticalPosition: $(this).data("verti-pos"),
|
||||
ShowOverlay: $(this).data("overlay") ? $(this).data("overlay") : false,
|
||||
TimeShown: $(this).data("timeshown") ? $(this).data("timeshown") : 2000,
|
||||
OpacityOverlay: $(this).data("opacity") ? $(this).data("opacity") : 0.5,
|
||||
MinWidth: $(this).data("min-width") ? $(this).data("min-width") : 250
|
||||
});
|
||||
}
|
||||
|
||||
/**** SUCCESS MESSAGE TYPE ****/
|
||||
else if ($(this).data("type") == 'success') {
|
||||
jSuccess(
|
||||
$(this).data("message"), {
|
||||
HorizontalPosition: $(this).data("horiz-pos"),
|
||||
VerticalPosition: $(this).data("verti-pos"),
|
||||
ShowOverlay: $(this).data("overlay") ? $(this).data("overlay") : false,
|
||||
TimeShown: $(this).data("timeshown") ? $(this).data("timeshown") : 2000,
|
||||
OpacityOverlay: $(this).data("opacity") ? $(this).data("opacity") : 0.5,
|
||||
MinWidth: $(this).data("min-width") ? $(this).data("min-width") : 250
|
||||
});
|
||||
}
|
||||
|
||||
/**** ERROR MESSAGE TYPE ****/
|
||||
else if ($(this).data("type") == 'error') {
|
||||
jError(
|
||||
$(this).data("message"), {
|
||||
HorizontalPosition: $(this).data("horiz-pos"),
|
||||
VerticalPosition: $(this).data("verti-pos"),
|
||||
ShowOverlay: $(this).data("overlay") ? $(this).data("overlay") : false,
|
||||
TimeShown: $(this).data("timeshown") ? $(this).data("timeshown") : 2000,
|
||||
OpacityOverlay: $(this).data("opacity") ? $(this).data("opacity") : 0.5,
|
||||
MinWidth: $(this).data("min-width") ? $(this).data("min-width") : 250
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**** Example with Callback Function ****/
|
||||
$("#notif-callback").click(function (e) {
|
||||
e.preventDefault();
|
||||
jNotify(
|
||||
'<i class="fa fa-info-circle" style="color:#00A2D9;padding-right:8px"></i> You have successfully clicked on the notification button. Congratulation!', {
|
||||
HorizontalPosition: 'right',
|
||||
VerticalPosition: 'bottom',
|
||||
ShowOverlay: false,
|
||||
TimeShown: 3000,
|
||||
onClosed: function () {
|
||||
alert('I am a function called when notif is closed !')
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
20
public/assets/js/search.js
Normal file
20
public/assets/js/search.js
Normal file
@@ -0,0 +1,20 @@
|
||||
$(function () {
|
||||
|
||||
$('#reportrange').daterangepicker( {
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
|
||||
'Last 7 Days': [moment().subtract('days', 6), moment()],
|
||||
'Last 30 Days': [moment().subtract('days', 29), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
|
||||
},
|
||||
startDate: moment().subtract('days', 29),
|
||||
endDate: moment()
|
||||
},
|
||||
function(start, end) {
|
||||
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
42
public/assets/js/session_timeout.js
Normal file
42
public/assets/js/session_timeout.js
Normal file
@@ -0,0 +1,42 @@
|
||||
$(function () {
|
||||
|
||||
function sessionTimeout() {
|
||||
|
||||
var $countdown;
|
||||
|
||||
$('body').append('<div class="modal fade" id="session-timeout" tabindex="-1" role="dialog"><div class="modal-dialog"><div class="modal-content"><div class="modal-header bg-blue"><h4 class="modal-title" id="myModalLabel">Your session is about to expire</h4></div><div class="modal-body">The screen will be locked in <span id="idle-timeout-counter" class="w-700"></span> seconds.</p><p>Do you want to stay connected?</p></div><div class="modal-footer"><button id="idle-timeout-dialog-logout" type="button" class="btn btn-default">No, Logout</button><button id="idle-timeout-dialog-keepalive" type="button" class="btn btn-blue" data-dismiss="modal">Yes, Keep Working</button></div></div></div></div>');
|
||||
|
||||
/* Start the idle timer plugin */
|
||||
$.idleTimeout('#session-timeout', '.modal-content button:last', {
|
||||
idleAfter: 5, // 5 seconds before a dialog appear (very short for demo purpose)
|
||||
timeout: 30000, // 30 seconds to timeout
|
||||
pollingInterval: 5, // 5 seconds
|
||||
keepAliveURL: 'assets/plugins/idle-timeout/keepalive.php',
|
||||
serverResponseEquals: 'OK',
|
||||
onTimeout: function () {
|
||||
window.location = "lockscreen.html";
|
||||
},
|
||||
onIdle: function () {
|
||||
$('#session-timeout').modal('show');
|
||||
$countdown = $('#idle-timeout-counter');
|
||||
|
||||
$('#idle-timeout-dialog-keepalive').on('click', function () {
|
||||
$('#session-timeout').modal('hide');
|
||||
});
|
||||
|
||||
$('#idle-timeout-dialog-logout').on('click', function () {
|
||||
$('#session-timeout').modal('hide');
|
||||
$.idleTimeout.options.onTimeout.call(this);
|
||||
});
|
||||
},
|
||||
onCountdown: function (counter) {
|
||||
/* We update the counter */
|
||||
$countdown.html(counter);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
sessionTimeout();
|
||||
|
||||
});
|
||||
94
public/assets/js/slider.js
Normal file
94
public/assets/js/slider.js
Normal file
@@ -0,0 +1,94 @@
|
||||
$(function () {
|
||||
|
||||
/* Slider with decimal option */
|
||||
$("#slider3").rangeSlider({
|
||||
formatter: function (val) {
|
||||
var value = Math.round(val),
|
||||
decimal = value - Math.round(val);
|
||||
return decimal == 0 ? value.toString() + ".0" : value.toString();
|
||||
}
|
||||
});
|
||||
|
||||
/* Slider with min and max values */
|
||||
$("#slider4").rangeSlider({
|
||||
range: {
|
||||
min: 10,
|
||||
max: 40
|
||||
}
|
||||
});
|
||||
|
||||
/* Slider with ruler */
|
||||
$("#slider5").rangeSlider({
|
||||
scales: [
|
||||
// Primary scale
|
||||
{
|
||||
first: function (val) {
|
||||
return val;
|
||||
},
|
||||
next: function (val) {
|
||||
return val + 10;
|
||||
},
|
||||
stop: function (val) {
|
||||
return false;
|
||||
},
|
||||
label: function (val) {
|
||||
return val;
|
||||
},
|
||||
format: function (tickContainer, tickStart, tickEnd) {
|
||||
tickContainer.addClass("myCustomClass");
|
||||
}
|
||||
},
|
||||
// Secondary scale
|
||||
{
|
||||
first: function (val) {
|
||||
return val;
|
||||
},
|
||||
next: function (val) {
|
||||
if (val % 10 === 9) {
|
||||
return val + 2;
|
||||
}
|
||||
return val + 1;
|
||||
},
|
||||
stop: function (val) {
|
||||
return false;
|
||||
},
|
||||
label: function () {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
/* Slider with date ruler */
|
||||
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"];
|
||||
|
||||
$("#slider6").dateRangeSlider({
|
||||
bounds: {
|
||||
min: new Date(2012, 0, 1),
|
||||
max: new Date(2012, 11, 31, 12, 59, 59)
|
||||
},
|
||||
defaultValues: {
|
||||
min: new Date(2012, 1, 10),
|
||||
max: new Date(2012, 7, 22)
|
||||
},
|
||||
scales: [{
|
||||
first: function (value) {
|
||||
return value;
|
||||
},
|
||||
end: function (value) {
|
||||
return value;
|
||||
},
|
||||
next: function (value) {
|
||||
var next = new Date(value);
|
||||
return new Date(next.setMonth(value.getMonth() + 2));
|
||||
},
|
||||
label: function (value) {
|
||||
return months[value.getMonth()];
|
||||
},
|
||||
format: function (tickContainer, tickStart, tickEnd) {
|
||||
tickContainer.addClass("myCustomClass");
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
});
|
||||
152
public/assets/js/style-switcher.js
Normal file
152
public/assets/js/style-switcher.js
Normal file
@@ -0,0 +1,152 @@
|
||||
/* Okler Themes - Style Switcher - 2.9.0 - 2014-03-19 */
|
||||
var styleSwitcher = {
|
||||
initialized: !1,
|
||||
options: {
|
||||
color: "#CCC",
|
||||
gradient: "true"
|
||||
},
|
||||
initialize: function () {
|
||||
var a = this;
|
||||
this.initialized || (jQuery.styleSwitcherCachedScript = function (a, b) {
|
||||
return b = $.extend(b || {}, {
|
||||
dataType: "script",
|
||||
cache: !0,
|
||||
url: a
|
||||
}), jQuery.ajax(b)
|
||||
}, $("head").append($('<link rel="stylesheet">').attr("href", "master/style-switcher/style-switcher.css")), $("head").append($('<link rel="stylesheet/less">').attr("href", "master/less/skin.less")), $("head").append($('<link rel="stylesheet">').attr("href", "master/style-switcher/colorpicker/css/colorpicker.css")), $.styleSwitcherCachedScript("master/style-switcher/colorpicker/js/colorpicker.js").done(function () {
|
||||
less = {
|
||||
env: "development"
|
||||
}, $.styleSwitcherCachedScript("master/less/less.js").done(function () {
|
||||
a.build(), a.events(), null != $.cookie("colorGradient") && (a.options.gradient = $.cookie("colorGradient")), null != $.cookie("skin") ? a.setColor($.cookie("skin")) : a.container.find("ul[data-type=colors] li:first a").click(), null != $.cookie("layout") && a.setLayoutStyle($.cookie("layout")), null != $.cookie("pattern") && a.setPattern($.cookie("pattern")), null == $.cookie("initialized") && (a.container.find("h4 a").click(), $.cookie("initialized", !0)), a.initialized = !0
|
||||
})
|
||||
}), $.styleSwitcherCachedScript("master/style-switcher/cssbeautify/cssbeautify.js").done(function () {}))
|
||||
},
|
||||
build: function () {
|
||||
var a = this,
|
||||
b = $("<div />").attr("id", "styleSwitcher").addClass("style-switcher visible-lg").append($("<h4 />").html("Style Switcher").append($("<a />").attr("href", "#").append($("<i />").addClass("icon icon-cogs"))), $("<div />").addClass("style-switcher-mode").append($("<div />").addClass("options-links mode").append($("<a />").attr("href", "#").attr("data-mode", "basic").addClass("active").html("Basic"), $("<a />").attr("href", "#").attr("data-mode", "advanced").html("Advanced"))), $("<div />").addClass("style-switcher-wrap").append($("<h5 />").html("Colors"), $("<ul />").addClass("options colors").attr("data-type", "colors"), $("<h5 />").html("Layout Style"), $("<div />").addClass("options-links layout").append($("<a />").attr("href", "#").attr("data-layout-type", "wide").addClass("active").html("Wide"), $("<a />").attr("href", "#").attr("data-layout-type", "boxed").html("Boxed")), $("<h5 />").html("Website Type"), $("<div />").addClass("options-links website-type").append($("<a />").attr("href", "index.html").attr("data-website-type", "normal").html("Normal"), $("<a />").attr("href", "index-one-page.html").attr("data-website-type", "one-page").html("One Page")), $("<div />").hide().addClass("patterns").append($("<h5 />").html("Background Patterns"), $("<ul />").addClass("options").attr("data-type", "patterns")), $("<hr />"), $("<div />").addClass("options-links").append($("<a />").addClass("reset").attr("href", "#").html("Reset"), $("<a />").addClass("get-css").attr("href", "#getCSSModal").html("Get Skin CSS"))));
|
||||
$("body").append(b);
|
||||
var c = '<div class="modal fade" id="getCSSModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="cssModalLabel">Skin CSS</h4> </div> <div class="modal-body"> <div class="alert alert-info fade in" id="addBoxedClassInfo">Please add the <strong>"boxed"</strong> class to the <body> element.</div><textarea id="getCSSTextarea" class="get-css" readonly></textarea></div> </div> </div> </div> </div>';
|
||||
$("body").append(c), this.container = $("#styleSwitcher"), this.container.find("div.options-links.mode a").click(function (a) {
|
||||
a.preventDefault();
|
||||
var b = $(this).parents(".mode");
|
||||
b.find("a.active").removeClass("active"), $(this).addClass("active"), "advanced" == $(this).attr("data-mode") ? $("#styleSwitcher").addClass("advanced").removeClass("basic") : $("#styleSwitcher").addClass("basic").removeClass("advanced")
|
||||
});
|
||||
var d = [{
|
||||
Hex: "#0088CC",
|
||||
colorName: "Blue"
|
||||
}, {
|
||||
Hex: "#2BAAB1",
|
||||
colorName: "Green"
|
||||
}, {
|
||||
Hex: "#4A5B7D",
|
||||
colorName: "Navy"
|
||||
}, {
|
||||
Hex: "#E36159",
|
||||
colorName: "Red"
|
||||
}, {
|
||||
Hex: "#B8A279",
|
||||
colorName: "Beige"
|
||||
}, {
|
||||
Hex: "#c71c77",
|
||||
colorName: "Pink"
|
||||
}, {
|
||||
Hex: "#734BA9",
|
||||
colorName: "Purple"
|
||||
}, {
|
||||
Hex: "#2BAAB1",
|
||||
colorName: "Cyan"
|
||||
}],
|
||||
e = this.container.find("ul[data-type=colors]");
|
||||
if ($.each(d, function (a) {
|
||||
var b = $("<li />").append($("<a />").css("background-color", d[a].Hex).attr({
|
||||
"data-color-hex": d[a].Hex,
|
||||
"data-color-name": d[a].colorName,
|
||||
href: "#",
|
||||
title: d[a].colorName
|
||||
}));
|
||||
e.append(b)
|
||||
}), null != $.cookie("skin")) var f = $.cookie("skin");
|
||||
else var f = d[0].Hex;
|
||||
var g = $("<div />").addClass("color-gradient").append($("<input />").attr("id", "colorGradient").attr("checked", a.options.gradient).attr("type", "checkbox"), $("<label />").attr("for", "colorGradient").html("Gradient")),
|
||||
h = $("<div />").attr("id", "colorPickerHolder").attr("data-color", f).attr("data-color-format", "hex").addClass("color-picker");
|
||||
e.before(g, h), e.find("a").click(function (b) {
|
||||
b.preventDefault(), a.setColor($(this).attr("data-color-hex")), $("#colorPickerHolder").ColorPickerSetColor($(this).attr("data-color-hex"))
|
||||
}), $("#colorPickerHolder").ColorPicker({
|
||||
color: f,
|
||||
flat: !0,
|
||||
livePreview: !1,
|
||||
onChange: function (b, c) {
|
||||
a.setColor("#" + c)
|
||||
}
|
||||
}), $("#colorPickerHolder .colorpicker_color, #colorPickerHolder .colorpicker_hue").on("mousedown", function (b) {
|
||||
b.preventDefault(), a.isChanging = !0
|
||||
}).on("mouseup", function (b) {
|
||||
b.preventDefault(), a.isChanging = !1, setTimeout(function () {
|
||||
a.setColor("#" + $("#colorPickerHolder .colorpicker_hex input").val())
|
||||
}, 100)
|
||||
}), "false" == $.cookie("colorGradient") && $("#colorGradient").removeAttr("checked"), $("#colorGradient").on("change", function () {
|
||||
var b = $(this).is(":checked").toString();
|
||||
a.options.gradient = b, a.setColor(a.options.color), $.cookie("colorGradient", b)
|
||||
}), this.container.find("div.options-links.layout a").click(function (b) {
|
||||
b.preventDefault(), a.setLayoutStyle($(this).attr("data-layout-type"), !0)
|
||||
}), this.container.find("div.options-links.website-type a").click(function (a) {
|
||||
a.preventDefault(), $.cookie("showSwitcher", !0), self.location = $(this).attr("href")
|
||||
}), $("body").hasClass("one-page") ? (this.container.find("div.options-links.website-type a:last").addClass("active"), this.container.find("div.options-links.layout").prev().remove(), this.container.find("div.options-links.layout").remove()) : this.container.find("div.options-links.website-type a:first").addClass("active");
|
||||
var i = ["gray_jean", "linedpaper", "az_subtle", "blizzard", "denim", "fancy_deboss", "honey_im_subtle", "linen", "pw_maze_white", "skin_side_up", "stitched_wool", "straws", "subtle_grunge", "textured_stripes", "wild_oliva", "worn_dots", "bright_squares", "random_grey_variations"],
|
||||
j = this.container.find("ul[data-type=patterns]");
|
||||
$.each(i, function (a, b) {
|
||||
var c = $("<li />").append($("<a />").addClass("pattern").css("background-image", "url(img/patterns/" + b + ".png)").attr({
|
||||
"data-pattern": b,
|
||||
href: "#",
|
||||
title: b.charAt(0).toUpperCase() + b.slice(1)
|
||||
}));
|
||||
j.append(c)
|
||||
}), j.find("a").click(function (b) {
|
||||
b.preventDefault(), a.setPattern($(this).attr("data-pattern"))
|
||||
}), a.container.find("a.reset").click(function (b) {
|
||||
b.preventDefault(), a.reset()
|
||||
}), a.container.find("a.get-css").click(function (b) {
|
||||
b.preventDefault(), a.getCss()
|
||||
})
|
||||
},
|
||||
events: function () {
|
||||
var a = this;
|
||||
a.container.find("h4 a").click(function (b) {
|
||||
b.preventDefault(), a.container.hasClass("active") ? a.container.animate({
|
||||
left: "-" + a.container.width() + "px"
|
||||
}, 300).removeClass("active") : a.container.animate({
|
||||
left: "0"
|
||||
}, 300).addClass("active")
|
||||
}), (null != $.cookie("showSwitcher") || $("body").hasClass("one-page")) && (a.container.find("h4 a").click(), $.removeCookie("showSwitcher"))
|
||||
},
|
||||
setColor: function (a) {
|
||||
var b = this;
|
||||
return this.isChanging ? !1 : (b.options.color = a, less.modifyVars({
|
||||
gradient: b.options.gradient,
|
||||
skinColor: a
|
||||
}), $.cookie("skin", a), void(a == this.container.find("ul[data-type=colors] li:first a").attr("data-color-hex") ? $("h1.logo img").attr("src", "img/logo-default.png") : $("h1.logo img").attr("src", "img/logo.png")))
|
||||
},
|
||||
setLayoutStyle: function (a, b) {
|
||||
if ($("body").hasClass("one-page")) return !1;
|
||||
if ($.cookie("layout", a), b) return $.cookie("showSwitcher", !0), window.location.reload(), !1;
|
||||
var c = this.container.find("div.options-links.layout"),
|
||||
d = this.container.find("div.patterns");
|
||||
c.find("a.active").removeClass("active"), c.find("a[data-layout-type=" + a + "]").addClass("active"), "wide" == a ? (d.hide(), $("body").removeClass("boxed"), $("link[href*='bootstrap-responsive']").attr("href", "css/bootstrap-responsive.css"), $.removeCookie("pattern")) : (d.show(), $("body").addClass("boxed"), $("link[href*='bootstrap-responsive']").attr("href", "css/bootstrap-responsive-boxed.css"), null == $.cookie("pattern") && this.container.find("ul[data-type=patterns] li:first a").click())
|
||||
},
|
||||
setPattern: function (a) {
|
||||
var b = $("body").hasClass("boxed");
|
||||
b && $("body").css("background-image", "url(img/patterns/" + a + ".png)"), $.cookie("pattern", a)
|
||||
},
|
||||
reset: function () {
|
||||
$.removeCookie("skin"), $.removeCookie("layout"), $.removeCookie("pattern"), $.removeCookie("colorGradient"), $.cookie("showSwitcher", !0), window.location.reload()
|
||||
},
|
||||
getCss: function () {
|
||||
raw = "";
|
||||
var a = $("body").hasClass("boxed");
|
||||
a ? (raw = 'body { background-image: url("img/patterns/' + $.cookie("pattern") + '.png"); }', $("#addBoxedClassInfo").show()) : $("#addBoxedClassInfo").hide(), $("#getCSSTextarea").text(""), $("#getCSSTextarea").text($('style[id^="less:"]').text()), $("#getCSSModal").modal("show"), options = {
|
||||
indent: " ",
|
||||
autosemicolon: !0
|
||||
}, raw += $("#getCSSTextarea").text(), $("#getCSSTextarea").text(cssbeautify(raw, options))
|
||||
}
|
||||
};
|
||||
styleSwitcher.initialize();
|
||||
52
public/assets/js/table_dynamic.js
Normal file
52
public/assets/js/table_dynamic.js
Normal file
@@ -0,0 +1,52 @@
|
||||
$(function () {
|
||||
|
||||
function fnFormatDetails(oTable, nTr) {
|
||||
var aData = oTable.fnGetData(nTr);
|
||||
var sOut = '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">';
|
||||
sOut += '<tr><td>Rendering engine:</td><td>' + aData[1] + ' ' + aData[4] + '</td></tr>';
|
||||
sOut += '<tr><td>Link to source:</td><td>Could provide a link here</td></tr>';
|
||||
sOut += '<tr><td>Extra info:</td><td>And any further details here (images etc)</td></tr>';
|
||||
sOut += '</table>';
|
||||
return sOut;
|
||||
}
|
||||
|
||||
/* Insert a 'details' column to the table */
|
||||
var nCloneTh = document.createElement('th');
|
||||
var nCloneTd = document.createElement('td');
|
||||
nCloneTd.innerHTML = '<i style="color: #C75757" class="fa fa-plus-square-o"></i>';
|
||||
nCloneTd.className = "center";
|
||||
|
||||
$('#table2 thead tr').each(function () {
|
||||
this.insertBefore(nCloneTh, this.childNodes[0]);
|
||||
});
|
||||
|
||||
$('#table2 tbody tr').each(function () {
|
||||
this.insertBefore(nCloneTd.cloneNode(true), this.childNodes[0]);
|
||||
});
|
||||
|
||||
/* Initialse DataTables, with no sorting on the 'details' column */
|
||||
var oTable = $('#table2').dataTable({
|
||||
"aoColumnDefs": [{
|
||||
"bSortable": false,
|
||||
"aTargets": [0]
|
||||
}],
|
||||
"aaSorting": [
|
||||
[1, 'asc']
|
||||
]
|
||||
});
|
||||
|
||||
/* Add event listener for opening and closing details */
|
||||
$(document).on('click', '#table2 tbody td i', function () {
|
||||
var nTr = $(this).parents('tr')[0];
|
||||
if (oTable.fnIsOpen(nTr)) {
|
||||
/* This row is already open - close it */
|
||||
$(this).removeClass().addClass('fa fa-plus-square-o');
|
||||
oTable.fnClose(nTr);
|
||||
} else {
|
||||
/* Open this row */
|
||||
$(this).removeClass().addClass('fa fa-minus-square-o');
|
||||
oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'details');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
160
public/assets/js/table_editable.js
Normal file
160
public/assets/js/table_editable.js
Normal file
@@ -0,0 +1,160 @@
|
||||
$(function () {
|
||||
|
||||
function editableTable() {
|
||||
|
||||
function restoreRow(oTable, nRow) {
|
||||
var aData = oTable.fnGetData(nRow);
|
||||
var jqTds = $('>td', nRow);
|
||||
|
||||
for (var i = 0, iLen = jqTds.length; i < iLen; i++) {
|
||||
oTable.fnUpdate(aData[i], nRow, i, false);
|
||||
}
|
||||
|
||||
oTable.fnDraw();
|
||||
}
|
||||
|
||||
function editRow(oTable, nRow) {
|
||||
var aData = oTable.fnGetData(nRow);
|
||||
var jqTds = $('>td', nRow);
|
||||
jqTds[0].innerHTML = '<input type="text" class="form-control small" value="' + aData[0] + '">';
|
||||
jqTds[1].innerHTML = '<input type="text" class="form-control small" value="' + aData[1] + '">';
|
||||
jqTds[2].innerHTML = '<input type="text" class="form-control small" value="' + aData[2] + '">';
|
||||
jqTds[3].innerHTML = '<input type="text" class="form-control small" value="' + aData[3] + '">';
|
||||
jqTds[4].innerHTML = '<div class="text-center"><a class="edit btn btn-success" href="">Save</a> <a class="delete btn btn-danger" href=""><i class="fa fa-times-circle"></i> Remove</a></div>';
|
||||
}
|
||||
|
||||
function saveRow(oTable, nRow) {
|
||||
var jqInputs = $('input', nRow);
|
||||
oTable.fnUpdate(jqInputs[0].value, nRow, 0, false);
|
||||
oTable.fnUpdate(jqInputs[1].value, nRow, 1, false);
|
||||
oTable.fnUpdate(jqInputs[2].value, nRow, 2, false);
|
||||
oTable.fnUpdate(jqInputs[3].value, nRow, 3, false);
|
||||
oTable.fnUpdate('<div class="text-center"><a class="edit btn btn-dark" href=""><i class="fa fa-pencil-square-o"></i>Edit</a> <a class="delete btn btn-danger" href=""><i class="fa fa-times-circle"></i> Remove</a></div>', nRow, 4, false);
|
||||
oTable.fnDraw();
|
||||
}
|
||||
|
||||
function cancelEditRow(oTable, nRow) {
|
||||
var jqInputs = $('input', nRow);
|
||||
oTable.fnUpdate(jqInputs[0].value, nRow, 0, false);
|
||||
oTable.fnUpdate(jqInputs[1].value, nRow, 1, false);
|
||||
oTable.fnUpdate(jqInputs[2].value, nRow, 2, false);
|
||||
oTable.fnUpdate(jqInputs[3].value, nRow, 3, false);
|
||||
oTable.fnUpdate('<a class="edit btn btn-dark" href=""><i class="fa fa-pencil-square-o"></i>Edit</a>', nRow, 4, false);
|
||||
oTable.fnDraw();
|
||||
}
|
||||
|
||||
var oTable = $('#table-editable').dataTable({
|
||||
"aLengthMenu": [
|
||||
[5, 15, 20, -1],
|
||||
[5, 15, 20, "All"] // change per page values here
|
||||
],
|
||||
"sDom" : "<'row'<'col-md-6 filter-left'f><'col-md-6'T>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
|
||||
"oTableTools" : {
|
||||
"sSwfPath": "assets/plugins/datatables/swf/copy_csv_xls_pdf.swf",
|
||||
"aButtons":[
|
||||
{
|
||||
"sExtends":"pdf",
|
||||
"mColumns":[0, 1, 2, 3],
|
||||
"sPdfOrientation":"landscape"
|
||||
},
|
||||
{
|
||||
"sExtends":"print",
|
||||
"mColumns":[0, 1, 2, 3],
|
||||
"sPdfOrientation":"landscape"
|
||||
},{
|
||||
"sExtends":"xls",
|
||||
"mColumns":[0, 1, 2, 3],
|
||||
"sPdfOrientation":"landscape"
|
||||
},{
|
||||
"sExtends":"csv",
|
||||
"mColumns":[0, 1, 2, 3],
|
||||
"sPdfOrientation":"landscape"
|
||||
}
|
||||
]
|
||||
},
|
||||
// set the initial value
|
||||
"iDisplayLength": 10,
|
||||
"bPaginate": false,
|
||||
"sPaginationType": "bootstrap",
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "_MENU_ records per page",
|
||||
"oPaginate": {
|
||||
"sPrevious": "Prev",
|
||||
"sNext": "Next"
|
||||
},
|
||||
"sSearch": ""
|
||||
},
|
||||
"aoColumnDefs": [{
|
||||
'bSortable': false,
|
||||
'aTargets': [0]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
jQuery('#table-edit_wrapper .dataTables_filter input').addClass("form-control medium"); // modify table search input
|
||||
jQuery('#table-edit_wrapper .dataTables_length select').addClass("form-control xsmall"); // modify table per page dropdown
|
||||
|
||||
var nEditing = null;
|
||||
|
||||
$('#table-edit_new').click(function (e) {
|
||||
e.preventDefault();
|
||||
var aiNew = oTable.fnAddData(['', '', '', '',
|
||||
'<p class="text-center"><a class="edit btn btn-dark" href=""><i class="fa fa-pencil-square-o"></i>Edit</a> <a class="delete btn btn-danger" href=""><i class="fa fa-times-circle"></i> Remove</a></p>'
|
||||
]);
|
||||
var nRow = oTable.fnGetNodes(aiNew[0]);
|
||||
editRow(oTable, nRow);
|
||||
nEditing = nRow;
|
||||
});
|
||||
|
||||
$('#table-editable a.delete').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (confirm("Are you sure to delete this row ?") == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
oTable.fnDeleteRow(nRow);
|
||||
|
||||
// alert("Deleted! Do not forget to do some ajax to sync with backend :)");
|
||||
});
|
||||
|
||||
$('#table-editable a.cancel').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
if ($(this).attr("data-mode") == "new") {
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
oTable.fnDeleteRow(nRow);
|
||||
} else {
|
||||
restoreRow(oTable, nEditing);
|
||||
nEditing = null;
|
||||
}
|
||||
});
|
||||
|
||||
$('#table-editable a.edit').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
/* Get the row as a parent of the link that was clicked on */
|
||||
var nRow = $(this).parents('tr')[0];
|
||||
|
||||
if (nEditing !== null && nEditing != nRow) {
|
||||
restoreRow(oTable, nEditing);
|
||||
editRow(oTable, nRow);
|
||||
nEditing = nRow;
|
||||
} else if (nEditing == nRow && this.innerHTML == "Save") {
|
||||
/* This row is being edited and should be saved */
|
||||
saveRow(oTable, nEditing);
|
||||
nEditing = null;
|
||||
// alert("Updated! Do not forget to do some ajax to sync with backend :)");
|
||||
} else {
|
||||
/* No row currently being edited */
|
||||
editRow(oTable, nRow);
|
||||
nEditing = nRow;
|
||||
}
|
||||
});
|
||||
|
||||
$('.dataTables_filter input').attr("placeholder", "Search a user...");
|
||||
|
||||
};
|
||||
|
||||
editableTable();
|
||||
|
||||
});
|
||||
28
public/assets/js/timeline.js
Normal file
28
public/assets/js/timeline.js
Normal file
@@ -0,0 +1,28 @@
|
||||
$(function () {
|
||||
|
||||
/* Google Maps example */
|
||||
var simple_map;
|
||||
simple_map = new GMaps({
|
||||
el: '#map',
|
||||
lat: -12.043333,
|
||||
lng: -77.028333,
|
||||
zoomControl: true,
|
||||
zoomControlOpt: {
|
||||
style: 'SMALL',
|
||||
position: 'TOP_LEFT'
|
||||
},
|
||||
panControl: false,
|
||||
streetViewControl: false,
|
||||
mapTypeControl: false,
|
||||
overviewMapControl: false
|
||||
});
|
||||
simple_map.addMarker({
|
||||
lat: -12.042,
|
||||
lng: -77.028333,
|
||||
title: 'Marker with InfoWindow',
|
||||
infoWindow: {
|
||||
content: '<p>Here we are!</p>'
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
170
public/assets/js/tree_view.js
Normal file
170
public/assets/js/tree_view.js
Normal file
@@ -0,0 +1,170 @@
|
||||
$(function () {
|
||||
|
||||
/* Simple tree with colored icons */
|
||||
$('#tree1').jstree({
|
||||
'core': {
|
||||
'data': [{
|
||||
'text': 'My pictures',
|
||||
"icon": "fa fa-picture-o c-red",
|
||||
'state': {
|
||||
'selected': false
|
||||
}
|
||||
}, {
|
||||
'text': 'My videos',
|
||||
"icon": "fa fa-film c-orange",
|
||||
'state': {
|
||||
'opened': true,
|
||||
'selected': false
|
||||
},
|
||||
'children': [{
|
||||
'text': 'Video 1',
|
||||
"icon": "fa fa-film c-orange"
|
||||
}, {
|
||||
'text': 'Video 2',
|
||||
"icon": "fa fa-film c-orange"
|
||||
}]
|
||||
}, {
|
||||
'text': 'My documents',
|
||||
"icon": "fa fa-folder-o c-purple",
|
||||
'state': {
|
||||
'selected': false
|
||||
},
|
||||
'children': [{
|
||||
'text': 'Document 1',
|
||||
"icon": "fa fa-folder-o c-purple",
|
||||
}, {
|
||||
'text': 'Document 2',
|
||||
"icon": "fa fa-folder-o c-purple",
|
||||
}]
|
||||
}, {
|
||||
'text': 'Events',
|
||||
"icon": "fa fa-calendar c-green",
|
||||
'state': {
|
||||
'opened': false,
|
||||
'selected': false
|
||||
}
|
||||
}, {
|
||||
'text': 'Messages',
|
||||
"icon": "fa fa-envelope-o",
|
||||
'state': {
|
||||
'opened': false,
|
||||
'selected': false
|
||||
}
|
||||
}, ]
|
||||
}
|
||||
});
|
||||
|
||||
/* Tree with checkbox option */
|
||||
$('#tree2').jstree({
|
||||
'core': {
|
||||
'data': [{
|
||||
'text': 'My pictures',
|
||||
"icon": "fa fa-picture-o",
|
||||
'state': {
|
||||
'selected': false
|
||||
}
|
||||
}, {
|
||||
'text': 'My videos',
|
||||
"icon": "fa fa-film",
|
||||
'state': {
|
||||
'opened': true,
|
||||
'selected': false
|
||||
},
|
||||
'children': [{
|
||||
'text': 'Video 1',
|
||||
"icon": "fa fa-film"
|
||||
}, {
|
||||
'text': 'Video 2',
|
||||
"icon": "fa fa-film"
|
||||
}]
|
||||
}, {
|
||||
'text': 'My documents',
|
||||
"icon": "fa fa-folder-o",
|
||||
'state': {
|
||||
'selected': false
|
||||
},
|
||||
'children': [{
|
||||
'text': 'Document 1',
|
||||
"icon": "fa fa-folder-o",
|
||||
}, {
|
||||
'text': 'Document 2',
|
||||
"icon": "fa fa-folder-o",
|
||||
}]
|
||||
}, {
|
||||
'text': 'Events',
|
||||
"icon": "fa fa-calendar",
|
||||
'state': {
|
||||
'opened': false,
|
||||
'selected': false
|
||||
}
|
||||
}, {
|
||||
'text': 'Messages',
|
||||
"icon": "fa fa-envelope-o",
|
||||
'state': {
|
||||
'opened': false,
|
||||
'selected': false
|
||||
}
|
||||
}, ]
|
||||
},
|
||||
"plugins": ["checkbox"],
|
||||
});
|
||||
|
||||
/* Tree with drag & drop */
|
||||
$('#tree3').jstree({
|
||||
'core': {
|
||||
"check_callback": true,
|
||||
'data': [{
|
||||
'text': 'My pictures',
|
||||
"icon": "fa fa-picture-o c-red",
|
||||
'state': {
|
||||
'selected': false
|
||||
}
|
||||
}, {
|
||||
'text': 'My videos',
|
||||
"icon": "fa fa-film c-red",
|
||||
'state': {
|
||||
'opened': true,
|
||||
'selected': false
|
||||
},
|
||||
'children': [{
|
||||
'text': 'Video 1',
|
||||
"icon": "fa fa-film c-red"
|
||||
}, {
|
||||
'text': 'Video 2',
|
||||
"icon": "fa fa-film c-red"
|
||||
}]
|
||||
}, {
|
||||
'text': 'My documents',
|
||||
"icon": "fa fa-folder-o c-red",
|
||||
'state': {
|
||||
'selected': false
|
||||
},
|
||||
'children': [{
|
||||
'text': 'Document 1',
|
||||
"icon": "fa fa-folder-o c-red",
|
||||
}, {
|
||||
'text': 'Document 2',
|
||||
"icon": "fa fa-folder-o c-red",
|
||||
}]
|
||||
}, {
|
||||
'text': 'Events',
|
||||
"icon": "fa fa-calendar c-red",
|
||||
'state': {
|
||||
'opened': false,
|
||||
'selected': false
|
||||
}
|
||||
}, {
|
||||
'text': 'Messages',
|
||||
"icon": "fa fa-envelope-o c-red",
|
||||
'state': {
|
||||
'opened': false,
|
||||
'selected': false
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
"plugins": ["dnd"]
|
||||
});
|
||||
|
||||
});
|
||||
660
public/assets/js/widgets.js
Normal file
660
public/assets/js/widgets.js
Normal file
@@ -0,0 +1,660 @@
|
||||
if ($('body').data('page') == 'widgets2'){
|
||||
|
||||
function randomValue() {
|
||||
return (Math.floor(Math.random() * (1 + 24))) + 8;
|
||||
}
|
||||
|
||||
var data2 = [[1, randomValue()],[2, randomValue()],[3, 2 + randomValue()],[4, 5 + randomValue()],[5, 7 + randomValue()],[6, 10 + randomValue()],[7, 15 + randomValue()],[8, 28 + randomValue()],[9, 30 + randomValue()],[10, 38 + randomValue()],[11, 40 + randomValue()],[12, 50 + randomValue()],[13, 52 + randomValue()],[14, 60 + randomValue()],[15, 62 + randomValue()],[16, 65 + randomValue()],[17, 70 + randomValue()],[18, 80 + randomValue()],[19, 85 + randomValue()],[20, 90 + randomValue()]];
|
||||
|
||||
var plot = $.plot($("#products-example"), [{
|
||||
data: data2, showLabels: true, label: "Product 1", labelPlacement: "below", canvasRender: true, cColor: "#FFFFFF"
|
||||
}], {
|
||||
series: {
|
||||
lines: {show: true, fill: true, fill: 1},
|
||||
fillColor: "rgba(0, 0, 0 , 1)",
|
||||
points: {show: true}
|
||||
},
|
||||
legend: {show: false},
|
||||
grid: {show: false, hoverable: true},
|
||||
colors: ["#00A2D9"]
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//************************* WEATHER WIDGET *************************//
|
||||
/* We initiate widget with a city (can be changed) */
|
||||
var city = 'Miami';
|
||||
$.simpleWeather({
|
||||
location: city,
|
||||
woeid: '',
|
||||
unit: 'f',
|
||||
success: function (weather) {
|
||||
city = weather.city;
|
||||
region = weather.country;
|
||||
tomorrow_date = weather.tomorrow.date;
|
||||
weather_icon = '<i class="icon-' + weather.code + '"></i>';
|
||||
$(".weather-city").html(city);
|
||||
$(".weather-currently").html(weather.currently);
|
||||
$(".today-img").html('<i class="big-img-weather icon-' + weather.code + '"></i>');
|
||||
$(".today-temp").html(weather.low + '° / ' + weather.high + '°');
|
||||
$(".weather-region").html(region);
|
||||
$(".weather-day").html(tomorrow_date);
|
||||
$(".weather-icon").html(weather_icon);
|
||||
$(".1-days-day").html(weather.forecasts.one.day);
|
||||
$(".1-days-image").html('<i class="icon-' + weather.forecasts.one.code + '"></i>');
|
||||
$(".1-days-temp").html(weather.forecasts.one.low + '° / ' + weather.forecasts.one.high + '°');
|
||||
$(".2-days-day").html(weather.forecasts.two.day);
|
||||
$(".2-days-image").html('<i class="icon-' + weather.forecasts.two.code + '"></i>');
|
||||
$(".2-days-temp").html(weather.forecasts.two.low + '° / ' + weather.forecasts.two.high + '°');
|
||||
$(".3-days-day").html(weather.forecasts.three.day);
|
||||
$(".3-days-image").html('<i class="icon-' + weather.forecasts.three.code + '"></i>');
|
||||
$(".3-days-temp").html(weather.forecasts.three.low + '° / ' + weather.forecasts.three.high + '°');
|
||||
$(".4-days-day").html(weather.forecasts.four.day);
|
||||
$(".4-days-image").html('<i class="icon-' + weather.forecasts.four.code + '"></i>');
|
||||
$(".4-days-temp").html(weather.forecasts.four.low + '° / ' + weather.forecasts.four.high + '°');
|
||||
}
|
||||
});
|
||||
|
||||
/* We get city from input on change */
|
||||
$("#city-form").change(function () {
|
||||
city = document.getElementById("city-form").value;
|
||||
$.simpleWeather({
|
||||
location: city,
|
||||
woeid: '',
|
||||
unit: 'f',
|
||||
success: function (weather) {
|
||||
city = weather.city;
|
||||
region = weather.country;
|
||||
tomorrow_date = weather.tomorrow.date;
|
||||
weather_icon = '<i class="icon-' + weather.code + '"></i>';
|
||||
$(".weather-city").html(city);
|
||||
$(".weather-currently").html(weather.currently);
|
||||
$(".today-img").html('<i class="big-img-weather icon-' + weather.code + '"></i>');
|
||||
$(".today-temp").html(weather.low + '° / ' + weather.high + '°');
|
||||
$(".weather-region").html(region);
|
||||
$(".weather-day").html(tomorrow_date);
|
||||
$(".weather-icon").html(weather_icon);
|
||||
$(".1-days-day").html(weather.forecasts.one.day);
|
||||
$(".1-days-image").html('<i class="icon-' + weather.forecasts.one.code + '"></i>');
|
||||
$(".1-days-temp").html(weather.forecasts.one.low + '° / ' + weather.forecasts.one.high + '°');
|
||||
$(".2-days-day").html(weather.forecasts.two.day);
|
||||
$(".2-days-image").html('<i class="icon-' + weather.forecasts.two.code + '"></i>');
|
||||
$(".2-days-temp").html(weather.forecasts.two.low + '° / ' + weather.forecasts.two.high + '°');
|
||||
$(".3-days-day").html(weather.forecasts.three.day);
|
||||
$(".3-days-image").html('<i class="icon-' + weather.forecasts.three.code + '"></i>');
|
||||
$(".3-days-temp").html(weather.forecasts.three.low + '° / ' + weather.forecasts.three.high + '°');
|
||||
$(".4-days-day").html(weather.forecasts.four.day);
|
||||
$(".4-days-image").html('<i class="icon-' + weather.forecasts.four.code + '"></i>');
|
||||
$(".4-days-temp").html(weather.forecasts.four.low + '° / ' + weather.forecasts.four.high + '°');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//************************* SALE PRODUCT 1 CHART *************************//
|
||||
function randomValue() {
|
||||
return (Math.floor(Math.random() * (1 + 24))) + 8;
|
||||
}
|
||||
|
||||
var data1 = [
|
||||
[1, 5 + randomValue()],
|
||||
[2, 10 + randomValue()],
|
||||
[3, 10 + randomValue()],
|
||||
[4, 15 + randomValue()],
|
||||
[5, 20 + randomValue()],
|
||||
[6, 25 + randomValue()],
|
||||
[7, 30 + randomValue()],
|
||||
[8, 35 + randomValue()],
|
||||
[9, 40 + randomValue()],
|
||||
[10, 45 + randomValue()],
|
||||
[11, 50 + randomValue()],
|
||||
[12, 55 + randomValue()],
|
||||
[13, 60 + randomValue()],
|
||||
[14, 70 + randomValue()],
|
||||
[15, 75 + randomValue()],
|
||||
[16, 80 + randomValue()],
|
||||
[17, 85 + randomValue()],
|
||||
[18, 90 + randomValue()],
|
||||
[19, 95 + randomValue()],
|
||||
[20, 100 + randomValue()]
|
||||
];
|
||||
var data2 = [
|
||||
[1, randomValue()],
|
||||
[2, randomValue()],
|
||||
[3, 2 + randomValue()],
|
||||
[4, 5 + randomValue()],
|
||||
[5, 7 + randomValue()],
|
||||
[6, 10 + randomValue()],
|
||||
[7, 15 + randomValue()],
|
||||
[8, 28 + randomValue()],
|
||||
[9, 30 + randomValue()],
|
||||
[10, 38 + randomValue()],
|
||||
[11, 40 + randomValue()],
|
||||
[12, 50 + randomValue()],
|
||||
[13, 52 + randomValue()],
|
||||
[14, 60 + randomValue()],
|
||||
[15, 62 + randomValue()],
|
||||
[16, 65 + randomValue()],
|
||||
[17, 70 + randomValue()],
|
||||
[18, 80 + randomValue()],
|
||||
[19, 85 + randomValue()],
|
||||
[20, 90 + randomValue()]
|
||||
];
|
||||
|
||||
var plot = $.plot($("#chart_1"), [{
|
||||
data: data1,
|
||||
showLabels: true,
|
||||
label: "Product 1",
|
||||
labelPlacement: "below",
|
||||
canvasRender: true,
|
||||
cColor: "#FFFFFF"
|
||||
}], {
|
||||
series: {
|
||||
lines: {
|
||||
show: true,
|
||||
fill: true,
|
||||
fill: 1
|
||||
},
|
||||
fillColor: "rgba(0, 0, 0 , 1)",
|
||||
points: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
hoverable: true
|
||||
},
|
||||
colors: ["#00A2D9"]
|
||||
});
|
||||
|
||||
|
||||
//************************* SALE PRODUCT 2 CHART *************************//
|
||||
var plot = $.plot($("#chart_2"), [{
|
||||
data: data2,
|
||||
showLabels: true,
|
||||
label: "Product 2",
|
||||
labelPlacement: "below",
|
||||
color: '#C75757',
|
||||
canvasRender: true,
|
||||
cColor: "#FFFFFF"
|
||||
}], {
|
||||
bars: {
|
||||
show: true,
|
||||
fill: true,
|
||||
lineWidth: 1,
|
||||
lineColor: '#121212',
|
||||
|
||||
order: 1,
|
||||
fill: 0.8
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
hoverable: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//************************* SALE PRODUCT 1 & 2 CHART *************************//
|
||||
var chartColor = $(this).parent().parent().css("color");
|
||||
var plot = $.plot($("#chart_3"), [{
|
||||
data: data1,
|
||||
label: "Visits",
|
||||
lines: {
|
||||
show: true,
|
||||
fill: true,
|
||||
fillColor: "rgba(0, 162, 217, 0.1)",
|
||||
lineWidth: 3
|
||||
},
|
||||
points: {
|
||||
show: true,
|
||||
lineWidth: 3,
|
||||
fill: true
|
||||
},
|
||||
shadowSize: 0
|
||||
}, {
|
||||
data: data2,
|
||||
bars: {
|
||||
show: true,
|
||||
fill: false,
|
||||
barWidth: 0.1,
|
||||
align: "center",
|
||||
lineWidth: 8
|
||||
}
|
||||
}], {
|
||||
grid: {
|
||||
show: false,
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
tickColor: "#eee",
|
||||
borderWidth: 0
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
colors: ['#00A2D9', '#C75757'],
|
||||
xaxis: {
|
||||
ticks: 5,
|
||||
tickDecimals: 0
|
||||
},
|
||||
yaxis: {
|
||||
ticks: 5,
|
||||
tickDecimals: 0
|
||||
},
|
||||
});
|
||||
|
||||
function showTooltip(x, y, contents) {
|
||||
$('<div id="flot-tooltip">' + contents + '</div>').css({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
top: y + 5,
|
||||
left: x + 5,
|
||||
color: '#fff',
|
||||
padding: '2px 5px',
|
||||
'background-color': '#717171',
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(200);
|
||||
}
|
||||
|
||||
var previousPoint = null;
|
||||
$("#chart_1, #chart_2, #chart_3").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(2));
|
||||
$("#y").text(pos.y.toFixed(2));
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
$("#flot-tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(2),
|
||||
y = item.datapoint[1].toFixed(2);
|
||||
showTooltip(item.pageX, item.pageY, y + "0 $");
|
||||
}
|
||||
} else {
|
||||
$("#flot-tooltip").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//********************** LINE & BAR SWITCH CHART *********************//
|
||||
var d1 = [
|
||||
[0, 950],
|
||||
[1, 1300],
|
||||
[2, 1600],
|
||||
[3, 1900],
|
||||
[4, 2100],
|
||||
[5, 2500],
|
||||
[6, 2200],
|
||||
[7, 2000],
|
||||
[8, 1950],
|
||||
[9, 1900],
|
||||
[10, 2000],
|
||||
[11, 2120]
|
||||
];
|
||||
var d2 = [
|
||||
[0, 450],
|
||||
[1, 500],
|
||||
[2, 600],
|
||||
[3, 550],
|
||||
[4, 600],
|
||||
[5, 800],
|
||||
[6, 900],
|
||||
[7, 800],
|
||||
[8, 850],
|
||||
[9, 830],
|
||||
[10, 1000],
|
||||
[11, 1150]
|
||||
];
|
||||
|
||||
var tickArray = ['Janv', 'Fev', 'Mars', 'Apri', 'May', 'June', 'July', 'Augu', 'Sept', 'Nov'];
|
||||
|
||||
var graph_lines = [{
|
||||
label: "Line 1",
|
||||
data: d1,
|
||||
lines: {
|
||||
lineWidth: 2
|
||||
},
|
||||
shadowSize: 0,
|
||||
color: '#3598DB'
|
||||
}, {
|
||||
label: "Line 1",
|
||||
data: d1,
|
||||
points: {
|
||||
show: true,
|
||||
fill: true,
|
||||
radius: 6,
|
||||
fillColor: "#3598DB",
|
||||
lineWidth: 3
|
||||
},
|
||||
color: '#fff'
|
||||
}, {
|
||||
label: "Line 2",
|
||||
data: d2,
|
||||
animator: {
|
||||
steps: 300,
|
||||
duration: 1000,
|
||||
start: 0
|
||||
},
|
||||
lines: {
|
||||
fill: 0.4,
|
||||
lineWidth: 0,
|
||||
},
|
||||
color: '#18a689'
|
||||
}, {
|
||||
label: "Line 2",
|
||||
data: d2,
|
||||
points: {
|
||||
show: true,
|
||||
fill: true,
|
||||
radius: 6,
|
||||
fillColor: "#99dbbb",
|
||||
lineWidth: 3
|
||||
},
|
||||
color: '#fff'
|
||||
}, ];
|
||||
var graph_bars = [{
|
||||
// Visits
|
||||
data: d1,
|
||||
color: '#5CB85C'
|
||||
}, {
|
||||
// Returning Visits
|
||||
data: d2,
|
||||
color: '#00A2D9',
|
||||
points: {
|
||||
radius: 4,
|
||||
fillColor: '#00A2D9'
|
||||
}
|
||||
}];
|
||||
|
||||
/** Line Chart **/
|
||||
var line_chart = $.plotAnimator($('#graph-lines'), graph_lines, {
|
||||
xaxis: {
|
||||
tickLength: 0,
|
||||
tickDecimals: 0,
|
||||
min: 0,
|
||||
ticks: [
|
||||
[0, 'Jan'],
|
||||
[1, 'Fev'],
|
||||
[2, 'Mar'],
|
||||
[3, 'Apr'],
|
||||
[4, 'May'],
|
||||
[5, 'Jun'],
|
||||
[6, 'Jul'],
|
||||
[7, 'Aug'],
|
||||
[8, 'Sept'],
|
||||
[9, 'Oct'],
|
||||
[10, 'Nov'],
|
||||
[11, 'Dec']
|
||||
],
|
||||
font: {
|
||||
lineHeight: 12,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#8D8D8D"
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
ticks: 3,
|
||||
tickDecimals: 0,
|
||||
tickColor: "#f3f3f3",
|
||||
font: {
|
||||
lineHeight: 13,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#8D8D8D"
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
backgroundColor: {
|
||||
colors: ["#fff", "#fff"]
|
||||
},
|
||||
borderColor: "transparent",
|
||||
borderWidth: 20,
|
||||
margin: 0,
|
||||
minBorderMargin: 10,
|
||||
labelMargin: 15,
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
mouseActiveRadius: 4
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
});
|
||||
|
||||
$("#graph-lines").on("animatorComplete", function () {
|
||||
$("#lines, #bars").removeAttr("disabled");
|
||||
});
|
||||
|
||||
$("#lines").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$('#bars').removeClass('active');
|
||||
$('#graph-bars').fadeOut();
|
||||
$(this).addClass('active');
|
||||
$("#lines, #bars").attr("disabled", "disabled");
|
||||
$('#graph-lines').fadeIn();
|
||||
line_chart = $.plotAnimator($('#graph-lines'),
|
||||
graph_lines, {
|
||||
xaxis: {
|
||||
tickLength: 0,
|
||||
tickDecimals: 0,
|
||||
min: 0,
|
||||
ticks: [
|
||||
[0, 'Jan'],
|
||||
[1, 'Fev'],
|
||||
[2, 'Mar'],
|
||||
[3, 'Apr'],
|
||||
[4, 'May'],
|
||||
[5, 'Jun'],
|
||||
[6, 'Jul'],
|
||||
[7, 'Aug'],
|
||||
[8, 'Sept'],
|
||||
[9, 'Oct'],
|
||||
[10, 'Nov'],
|
||||
[11, 'Dec']
|
||||
],
|
||||
font: {
|
||||
lineHeight: 12,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#8D8D8D"
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
ticks: 3,
|
||||
tickDecimals: 0,
|
||||
tickColor: "#f3f3f3",
|
||||
font: {
|
||||
lineHeight: 13,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#8D8D8D"
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
backgroundColor: {
|
||||
colors: ["#fff", "#fff"]
|
||||
},
|
||||
borderColor: "transparent",
|
||||
borderWidth: 20,
|
||||
margin: 0,
|
||||
minBorderMargin: 0,
|
||||
labelMargin: 15,
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
mouseActiveRadius: 4
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#graph-bars").on("animatorComplete", function () {
|
||||
$("#bars, #lines").removeAttr("disabled")
|
||||
});
|
||||
|
||||
$("#bars").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$("#bars, #lines").attr("disabled", "disabled");
|
||||
$('#lines').removeClass('active');
|
||||
$('#graph-lines').fadeOut();
|
||||
$(this).addClass('active');
|
||||
$('#graph-bars').fadeIn().removeClass('hidden');
|
||||
bar_chart = $.plotAnimator($('#graph-bars'), graph_bars, {
|
||||
series: {
|
||||
bars: {
|
||||
show: true,
|
||||
barWidth: .9,
|
||||
align: 'center'
|
||||
},
|
||||
shadowSize: 0
|
||||
},
|
||||
xaxis: {
|
||||
tickColor: 'transparent',
|
||||
ticks: [
|
||||
[0, 'Jan'],
|
||||
[1, 'Fev'],
|
||||
[2, 'Mar'],
|
||||
[3, 'Apr'],
|
||||
[4, 'May'],
|
||||
[5, 'Jun'],
|
||||
[6, 'Jul'],
|
||||
[7, 'Aug'],
|
||||
[8, 'Sept'],
|
||||
[9, 'Oct'],
|
||||
[10, 'Nov'],
|
||||
[11, 'Dec']
|
||||
],
|
||||
font: {
|
||||
lineHeight: 12,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#9a9a9a"
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
ticks: 3,
|
||||
tickDecimals: 0,
|
||||
tickColor: "#f3f3f3",
|
||||
font: {
|
||||
lineHeight: 13,
|
||||
weight: "bold",
|
||||
family: "Open sans",
|
||||
color: "#9a9a9a"
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
backgroundColor: {
|
||||
colors: ["#fff", "#fff"]
|
||||
},
|
||||
borderColor: "transparent",
|
||||
margin: 0,
|
||||
minBorderMargin: 0,
|
||||
labelMargin: 15,
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
mouseActiveRadius: 4
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#graph-bars').hide();
|
||||
|
||||
function showTooltip(x, y, contents) {
|
||||
$('<div id="flot-tooltip">' + contents + '</div>').css({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
top: y + 5,
|
||||
left: x + 5,
|
||||
color: '#fff',
|
||||
padding: '2px 5px',
|
||||
'background-color': '#717171',
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(200);
|
||||
};
|
||||
|
||||
$("#graph-lines, #graph-bars").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(0));
|
||||
$("#y").text(pos.y.toFixed(0));
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
$("#flot-tooltip").remove();
|
||||
var x = item.datapoint[0].toFixed(0),
|
||||
y = item.datapoint[1].toFixed(0);
|
||||
showTooltip(item.pageX, item.pageY, y + " visitors");
|
||||
}
|
||||
} else {
|
||||
$("#flot-tooltip").remove();
|
||||
previousPoint = null;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//********************** REALTIME DATA CHART *********************//
|
||||
var seriesData = [
|
||||
[],
|
||||
[]
|
||||
];
|
||||
var random = new Rickshaw.Fixtures.RandomData(60);
|
||||
|
||||
for (var i = 0; i < 60; i++) {
|
||||
random.addData(seriesData);
|
||||
}
|
||||
|
||||
var graph = new Rickshaw.Graph({
|
||||
element: document.getElementById("chart"),
|
||||
height: 310,
|
||||
renderer: 'area',
|
||||
series: [{
|
||||
color: '#C75757',
|
||||
data: seriesData[0],
|
||||
name: 'Server Load'
|
||||
}, {
|
||||
color: '#00A2D9',
|
||||
data: seriesData[1],
|
||||
name: 'CPU'
|
||||
}]
|
||||
});
|
||||
|
||||
graph.render();
|
||||
|
||||
var hoverDetail = new Rickshaw.Graph.HoverDetail({
|
||||
graph: graph,
|
||||
xFormatter: function (x) {
|
||||
return new Date(x * 1000).toString();
|
||||
}
|
||||
});
|
||||
|
||||
var legend = new Rickshaw.Graph.Legend({
|
||||
graph: graph,
|
||||
element: document.getElementById('legend')
|
||||
});
|
||||
|
||||
var shelving = new Rickshaw.Graph.Behavior.Series.Toggle({
|
||||
graph: graph,
|
||||
legend: legend
|
||||
});
|
||||
|
||||
var controls = new RenderControls({
|
||||
element: document.querySelector('form'),
|
||||
graph: graph
|
||||
});
|
||||
|
||||
setInterval(function () {
|
||||
random.removeData(seriesData);
|
||||
random.addData(seriesData);
|
||||
graph.update();
|
||||
}, 1000);
|
||||
|
||||
setTimeout(1000);
|
||||
Reference in New Issue
Block a user