definicao de layout
This commit is contained in:
23
public/assets/js/animation/animate-custom.js
Normal file
23
public/assets/js/animation/animate-custom.js
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
function testAnim(x) {
|
||||
$('#animation-box').removeClass().addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
|
||||
$(this).removeClass();
|
||||
});
|
||||
};
|
||||
var animate_custom = {
|
||||
init: function() {
|
||||
$('.js-triggeraNimation').click(function(e){
|
||||
e.preventDefault();
|
||||
var anim = $('.js-animations').val();
|
||||
testAnim(anim);
|
||||
});
|
||||
$('.js-animations').change(function(){
|
||||
var anim = $(this).val();
|
||||
testAnim(anim);
|
||||
});
|
||||
}
|
||||
};
|
||||
(function($) {
|
||||
"use strict";
|
||||
animate_custom.init()
|
||||
})(jQuery);
|
||||
7
public/assets/js/animation/aos/aos-init.js
Normal file
7
public/assets/js/animation/aos/aos-init.js
Normal file
@@ -0,0 +1,7 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
$('.grid').isotope({
|
||||
itemSelector: '.grid-item'
|
||||
});
|
||||
AOS.init();
|
||||
})(jQuery);
|
||||
2
public/assets/js/animation/aos/aos.js
Normal file
2
public/assets/js/animation/aos/aos.js
Normal file
File diff suppressed because one or more lines are too long
17
public/assets/js/animation/scroll-reveal/reveal-custom.js
Normal file
17
public/assets/js/animation/scroll-reveal/reveal-custom.js
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
/*----------------------------------------------------
|
||||
Scroll reveal animation
|
||||
----------------------------------------------------*/
|
||||
(function($) {
|
||||
"use strict";
|
||||
if (Modernizr.csstransforms3d) {
|
||||
window.sr = ScrollReveal();
|
||||
sr.reveal('.reveal', {
|
||||
duration: 800,
|
||||
delay: 400,
|
||||
reset: true,
|
||||
easing: 'linear',
|
||||
scale: 1
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
1
public/assets/js/animation/scroll-reveal/scrollreveal.min.js
vendored
Normal file
1
public/assets/js/animation/scroll-reveal/scrollreveal.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
22
public/assets/js/animation/tilt/tilt-custom.js
Normal file
22
public/assets/js/animation/tilt/tilt-custom.js
Normal file
@@ -0,0 +1,22 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
var tilt_custom = {
|
||||
init: function() {
|
||||
const tilt = $('.js-tilt').tilt();
|
||||
$('.js-destroy').on('click', function () {
|
||||
const element = $(this).closest('.js-parent').find('.js-tilt');
|
||||
element.tilt.destroy.call(element);
|
||||
});
|
||||
$('.js-getvalue').on('click', function () {
|
||||
const element = $(this).closest('.js-parent').find('.js-tilt');
|
||||
const test = element.tilt.getValues.call(element);
|
||||
console.log(test[0]);
|
||||
});
|
||||
$('.js-reset').on('click', function () {
|
||||
const element = $(this).closest('.js-parent').find('.js-tilt');
|
||||
element.tilt.reset.call(element);
|
||||
});
|
||||
}
|
||||
};
|
||||
tilt_custom.init()
|
||||
})(jQuery);
|
||||
193
public/assets/js/animation/tilt/tilt.jquery.js
Normal file
193
public/assets/js/animation/tilt/tilt.jquery.js
Normal file
@@ -0,0 +1,193 @@
|
||||
'use strict';
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
} else if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports) {
|
||||
module.exports = function (root, jQuery) {
|
||||
if (jQuery === undefined) {
|
||||
if (typeof window !== 'undefined') {
|
||||
jQuery = require('jquery');
|
||||
} else {
|
||||
jQuery = require('jquery')(root);
|
||||
}
|
||||
}
|
||||
factory(jQuery);
|
||||
return jQuery;
|
||||
};
|
||||
} else {
|
||||
factory(jQuery);
|
||||
}
|
||||
})(function ($) {
|
||||
$.fn.tilt = function (options) {
|
||||
var requestTick = function requestTick() {
|
||||
if (this.ticking) return;
|
||||
requestAnimationFrame(updateTransforms.bind(this));
|
||||
this.ticking = true;
|
||||
};
|
||||
var bindEvents = function bindEvents() {
|
||||
var _this = this;
|
||||
$(this).on('mousemove', mouseMove);
|
||||
$(this).on('mouseenter', mouseEnter);
|
||||
if (this.settings.reset) $(this).on('mouseleave', mouseLeave);
|
||||
if (this.settings.glare) $(window).on('resize', updateGlareSize.bind(_this));
|
||||
};
|
||||
var setTransition = function setTransition() {
|
||||
var _this2 = this;
|
||||
if (this.timeout !== undefined) clearTimeout(this.timeout);
|
||||
$(this).css({ 'transition': this.settings.speed + 'ms ' + this.settings.easing });
|
||||
if (this.settings.glare) this.glareElement.css({ 'transition': 'opacity ' + this.settings.speed + 'ms ' + this.settings.easing });
|
||||
this.timeout = setTimeout(function () {
|
||||
$(_this2).css({ 'transition': '' });
|
||||
if (_this2.settings.glare) _this2.glareElement.css({ 'transition': '' });
|
||||
}, this.settings.speed);
|
||||
};
|
||||
var mouseEnter = function mouseEnter(event) {
|
||||
this.ticking = false;
|
||||
$(this).css({ 'will-change': 'transform' });
|
||||
setTransition.call(this);
|
||||
$(this).trigger("tilt.mouseEnter");
|
||||
};
|
||||
var getMousePositions = function getMousePositions(event) {
|
||||
if (typeof event === "undefined") {
|
||||
event = {
|
||||
pageX: $(this).offset().left + $(this).outerWidth() / 2,
|
||||
pageY: $(this).offset().top + $(this).outerHeight() / 2
|
||||
};
|
||||
}
|
||||
return { x: event.pageX, y: event.pageY };
|
||||
};
|
||||
var mouseMove = function mouseMove(event) {
|
||||
this.mousePositions = getMousePositions(event);
|
||||
requestTick.call(this);
|
||||
};
|
||||
var mouseLeave = function mouseLeave() {
|
||||
setTransition.call(this);
|
||||
this.reset = true;
|
||||
requestTick.call(this);
|
||||
$(this).trigger("tilt.mouseLeave");
|
||||
};
|
||||
var getValues = function getValues() {
|
||||
var width = $(this).outerWidth();
|
||||
var height = $(this).outerHeight();
|
||||
var left = $(this).offset().left;
|
||||
var top = $(this).offset().top;
|
||||
var percentageX = (this.mousePositions.x - left) / width;
|
||||
var percentageY = (this.mousePositions.y - top) / height;
|
||||
var tiltX = (this.settings.maxTilt / 2 - percentageX * this.settings.maxTilt).toFixed(2);
|
||||
var tiltY = (percentageY * this.settings.maxTilt - this.settings.maxTilt / 2).toFixed(2);
|
||||
var angle = Math.atan2(this.mousePositions.x - (left + width / 2), -(this.mousePositions.y - (top + height / 2))) * (180 / Math.PI);
|
||||
return { tiltX: tiltX, tiltY: tiltY, 'percentageX': percentageX * 100, 'percentageY': percentageY * 100, angle: angle };
|
||||
};
|
||||
var updateTransforms = function updateTransforms() {
|
||||
this.transforms = getValues.call(this);
|
||||
if (this.reset) {
|
||||
this.reset = false;
|
||||
$(this).css('transform', 'perspective(' + this.settings.perspective + 'px) rotateX(0deg) rotateY(0deg)');
|
||||
if (this.settings.glare) {
|
||||
this.glareElement.css('transform', 'rotate(180deg) translate(-50%, -50%)');
|
||||
this.glareElement.css('opacity', '0');
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
$(this).css('transform', 'perspective(' + this.settings.perspective + 'px) rotateX(' + (this.settings.disableAxis === 'x' ? 0 : this.transforms.tiltY) + 'deg) rotateY(' + (this.settings.disableAxis === 'y' ? 0 : this.transforms.tiltX) + 'deg) scale3d(' + this.settings.scale + ',' + this.settings.scale + ',' + this.settings.scale + ')');
|
||||
if (this.settings.glare) {
|
||||
this.glareElement.css('transform', 'rotate(' + this.transforms.angle + 'deg) translate(-50%, -50%)');
|
||||
this.glareElement.css('opacity', '' + this.transforms.percentageY * this.settings.maxGlare / 100);
|
||||
}
|
||||
}
|
||||
$(this).trigger("change", [this.transforms]);
|
||||
this.ticking = false;
|
||||
};
|
||||
var prepareGlare = function prepareGlare() {
|
||||
var glarePrerender = this.settings.glarePrerender;
|
||||
if (!glarePrerender)
|
||||
$(this).append('<div class="js-tilt-glare"><div class="js-tilt-glare-inner"></div></div>');
|
||||
this.glareElementWrapper = $(this).find(".js-tilt-glare");
|
||||
this.glareElement = $(this).find(".js-tilt-glare-inner");
|
||||
if (glarePrerender) return;
|
||||
var stretch = {
|
||||
'position': 'absolute',
|
||||
'top': '0',
|
||||
'left': '0',
|
||||
'width': '100%',
|
||||
'height': '100%'
|
||||
};
|
||||
this.glareElementWrapper.css(stretch).css({
|
||||
'overflow': 'hidden',
|
||||
'pointer-events': 'none'
|
||||
});
|
||||
this.glareElement.css({
|
||||
'position': 'absolute',
|
||||
'top': '50%',
|
||||
'left': '50%',
|
||||
'background-image': 'linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)',
|
||||
'width': '' + $(this).outerWidth() * 2,
|
||||
'height': '' + $(this).outerWidth() * 2,
|
||||
'transform': 'rotate(180deg) translate(-50%, -50%)',
|
||||
'transform-origin': '0% 0%',
|
||||
'opacity': '0'
|
||||
});
|
||||
};
|
||||
var updateGlareSize = function updateGlareSize() {
|
||||
this.glareElement.css({
|
||||
'width': '' + $(this).outerWidth() * 2,
|
||||
'height': '' + $(this).outerWidth() * 2
|
||||
});
|
||||
};
|
||||
$.fn.tilt.destroy = function () {
|
||||
$(this).each(function () {
|
||||
$(this).find('.js-tilt-glare').remove();
|
||||
$(this).css({ 'will-change': '', 'transform': '' });
|
||||
$(this).off('mousemove mouseenter mouseleave');
|
||||
});
|
||||
};
|
||||
$.fn.tilt.getValues = function () {
|
||||
var results = [];
|
||||
$(this).each(function () {
|
||||
this.mousePositions = getMousePositions.call(this);
|
||||
results.push(getValues.call(this));
|
||||
});
|
||||
return results;
|
||||
};
|
||||
$.fn.tilt.reset = function () {
|
||||
$(this).each(function () {
|
||||
var _this3 = this;
|
||||
|
||||
this.mousePositions = getMousePositions.call(this);
|
||||
this.settings = $(this).data('settings');
|
||||
mouseLeave.call(this);
|
||||
setTimeout(function () {
|
||||
_this3.reset = false;
|
||||
}, this.settings.transition);
|
||||
});
|
||||
};
|
||||
return this.each(function () {
|
||||
var _this4 = this;
|
||||
this.settings = $.extend({
|
||||
maxTilt: $(this).is('[data-tilt-max]') ? $(this).data('tilt-max') : 20,
|
||||
perspective: $(this).is('[data-tilt-perspective]') ? $(this).data('tilt-perspective') : 300,
|
||||
easing: $(this).is('[data-tilt-easing]') ? $(this).data('tilt-easing') : 'cubic-bezier(.03,.98,.52,.99)',
|
||||
scale: $(this).is('[data-tilt-scale]') ? $(this).data('tilt-scale') : '1',
|
||||
speed: $(this).is('[data-tilt-speed]') ? $(this).data('tilt-speed') : '400',
|
||||
transition: $(this).is('[data-tilt-transition]') ? $(this).data('tilt-transition') : true,
|
||||
disableAxis: $(this).is('[data-tilt-disable-axis]') ? $(this).data('tilt-disable-axis') : null,
|
||||
axis: $(this).is('[data-tilt-axis]') ? $(this).data('tilt-axis') : null,
|
||||
reset: $(this).is('[data-tilt-reset]') ? $(this).data('tilt-reset') : true,
|
||||
glare: $(this).is('[data-tilt-glare]') ? $(this).data('tilt-glare') : false,
|
||||
maxGlare: $(this).is('[data-tilt-maxglare]') ? $(this).data('tilt-maxglare') : 1
|
||||
}, options);
|
||||
if (this.settings.axis !== null) {
|
||||
this.settings.disableAxis = this.settings.axis;
|
||||
}
|
||||
this.init = function () {
|
||||
$(_this4).data('settings', _this4.settings);
|
||||
if (_this4.settings.glare) prepareGlare.call(_this4);
|
||||
bindEvents.call(_this4);
|
||||
};
|
||||
this.init();
|
||||
});
|
||||
};
|
||||
$('[data-tilt]').tilt();
|
||||
return true;
|
||||
});
|
||||
12
public/assets/js/animation/wow/wow-init.js
Normal file
12
public/assets/js/animation/wow/wow-init.js
Normal file
@@ -0,0 +1,12 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
var wow_init = {
|
||||
init: function() {
|
||||
$('.grid').isotope({
|
||||
itemSelector: '.grid-item'
|
||||
});
|
||||
new WOW().init();
|
||||
}
|
||||
};
|
||||
wow_init.init()
|
||||
})(jQuery);
|
||||
3
public/assets/js/animation/wow/wow.min.js
vendored
Normal file
3
public/assets/js/animation/wow/wow.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
225
public/assets/js/bkp.js
Normal file
225
public/assets/js/bkp.js
Normal file
@@ -0,0 +1,225 @@
|
||||
$(".toggle-nav").click(function () {
|
||||
$('.nav-menu').css("left", "0px");
|
||||
});
|
||||
$(".mobile-back").click(function () {
|
||||
$('.nav-menu').css("left", "-410px");
|
||||
});
|
||||
|
||||
|
||||
$(".page-wrapper").attr("class", "page-wrapper "+localStorage.getItem("page-wrapper"));
|
||||
$(".page-body-wrapper").attr("class", "page-body-wrapper "+localStorage.getItem("page-body-wrapper"));
|
||||
|
||||
|
||||
if (localStorage.getItem("page-wrapper") === null) {
|
||||
$(".page-wrapper").addClass("compact-wrapper");
|
||||
}
|
||||
|
||||
// left sidebar and horizotal menu
|
||||
if($('#pageWrapper').hasClass('compact-wrapper')){
|
||||
jQuery('.submenu-title').append('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
jQuery('.submenu-title').click(function () {
|
||||
jQuery('.submenu-title').removeClass('active');
|
||||
jQuery('.submenu-title').find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
jQuery('.submenu-content').slideUp('normal');
|
||||
if (jQuery(this).next().is(':hidden') == true) {
|
||||
jQuery(this).addClass('active');
|
||||
jQuery(this).find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-down"></i></div>');
|
||||
jQuery(this).next().slideDown('normal');
|
||||
} else {
|
||||
jQuery(this).find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
}
|
||||
});
|
||||
jQuery('.submenu-content').hide();
|
||||
|
||||
jQuery('.menu-title').append('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
jQuery('.menu-title').click(function () {
|
||||
jQuery('.menu-title').removeClass('active');
|
||||
jQuery('.menu-title').find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
jQuery('.menu-content').slideUp('normal');
|
||||
if (jQuery(this).next().is(':hidden') == true) {
|
||||
jQuery(this).addClass('active');
|
||||
jQuery(this).find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-down"></i></div>');
|
||||
jQuery(this).next().slideDown('normal');
|
||||
} else {
|
||||
jQuery(this).find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
}
|
||||
});
|
||||
jQuery('.menu-content').hide();
|
||||
} else if ($('#pageWrapper').hasClass('horizontal-wrapper')) {
|
||||
var contentwidth = jQuery(window).width();
|
||||
if ((contentwidth) < '992') {
|
||||
$('#pageWrapper').removeClass('horizontal-wrapper').addClass('compact-wrapper');
|
||||
$('.page-body-wrapper').removeClass('horizontal-menu').addClass('sidebar-icon');
|
||||
jQuery('.submenu-title').append('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
jQuery('.submenu-title').click(function () {
|
||||
jQuery('.submenu-title').removeClass('active');
|
||||
jQuery('.submenu-title').find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
jQuery('.submenu-content').slideUp('normal');
|
||||
if (jQuery(this).next().is(':hidden') == true) {
|
||||
jQuery(this).addClass('active');
|
||||
jQuery(this).find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-down"></i></div>');
|
||||
jQuery(this).next().slideDown('normal');
|
||||
} else {
|
||||
jQuery(this).find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
}
|
||||
});
|
||||
jQuery('.submenu-content').hide();
|
||||
|
||||
jQuery('.menu-title').append('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
jQuery('.menu-title').click(function () {
|
||||
jQuery('.menu-title').removeClass('active');
|
||||
jQuery('.menu-title').find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
jQuery('.menu-content').slideUp('normal');
|
||||
if (jQuery(this).next().is(':hidden') == true) {
|
||||
jQuery(this).addClass('active');
|
||||
jQuery(this).find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-down"></i></div>');
|
||||
jQuery(this).next().slideDown('normal');
|
||||
} else {
|
||||
jQuery(this).find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-right"></i></div>');
|
||||
}
|
||||
});
|
||||
jQuery('.menu-content').hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// toggle sidebar
|
||||
$nav = $('.main-nav');
|
||||
$header = $('.page-main-header');
|
||||
$toggle_nav_top = $('#sidebar-toggle');
|
||||
$toggle_nav_top.click(function() {
|
||||
$this = $(this);
|
||||
$nav = $('.main-nav');
|
||||
$nav.toggleClass('close_icon');
|
||||
$header.toggleClass('close_icon');
|
||||
});
|
||||
|
||||
$( window ).resize(function() {
|
||||
$nav = $('.main-nav');
|
||||
$header = $('.page-main-header');
|
||||
$toggle_nav_top = $('#sidebar-toggle');
|
||||
$toggle_nav_top.click(function() {
|
||||
$this = $(this);
|
||||
$nav = $('.main-nav');
|
||||
$nav.toggleClass('close_icon');
|
||||
$header.toggleClass('close_icon');
|
||||
});
|
||||
});
|
||||
|
||||
$body_part_side = $('.body-part');
|
||||
$body_part_side.click(function(){
|
||||
$toggle_nav_top.attr('checked', false);
|
||||
$nav.addClass('close_icon');
|
||||
$header.addClass('close_icon');
|
||||
});
|
||||
|
||||
// document sidebar
|
||||
$('.mobile-sidebar').click(function(){
|
||||
$('.document').toggleClass('close')
|
||||
});
|
||||
|
||||
// $(".mobile-sidebar").click(function(){
|
||||
// $("p").toggleClass("main");
|
||||
// });
|
||||
|
||||
// responsive sidebar
|
||||
var $window = $(window);
|
||||
var widthwindow = $window.width();
|
||||
(function($) {
|
||||
"use strict";
|
||||
if(widthwindow+17 <= 993) {
|
||||
$toggle_nav_top.attr('checked', false);
|
||||
$nav.addClass("close_icon");
|
||||
$header.addClass("close_icon");
|
||||
}
|
||||
})(jQuery);
|
||||
$( window ).resize(function() {
|
||||
var widthwindaw = $window.width();
|
||||
if(widthwindaw+17 <= 991){
|
||||
$toggle_nav_top.attr('checked', false);
|
||||
$nav.addClass("close_icon");
|
||||
$header.addClass("close_icon");
|
||||
}else{
|
||||
$toggle_nav_top.attr('checked', true);
|
||||
$nav.removeClass("close_icon");
|
||||
$header.removeClass("close_icon");
|
||||
}
|
||||
});
|
||||
|
||||
// horizontal arrowss
|
||||
var view = $("#mainnav");
|
||||
var move = "500px";
|
||||
var leftsideLimit = -500
|
||||
|
||||
// var Windowwidth = jQuery(window).width();
|
||||
// get wrapper width
|
||||
var getMenuWrapperSize = function () {
|
||||
return $('.sidebar-wrapper').innerWidth();
|
||||
}
|
||||
var menuWrapperSize = getMenuWrapperSize();
|
||||
|
||||
if ((menuWrapperSize) >= '1660') {
|
||||
var sliderLimit = -3000
|
||||
|
||||
} else if ((menuWrapperSize) >= '1440') {
|
||||
var sliderLimit = -3600
|
||||
} else {
|
||||
var sliderLimit = -4200
|
||||
}
|
||||
|
||||
$("#left-arrow").addClass("disabled");
|
||||
$("#right-arrow").click(function () {
|
||||
var currentPosition = parseInt(view.css("marginLeft"));
|
||||
if (currentPosition >= sliderLimit) {
|
||||
$("#left-arrow").removeClass("disabled");
|
||||
view.stop(false, true).animate({
|
||||
marginLeft: "-=" + move
|
||||
}, {
|
||||
duration: 400
|
||||
})
|
||||
if (currentPosition == sliderLimit) {
|
||||
$(this).addClass("disabled");
|
||||
console.log("sliderLimit", sliderLimit);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#left-arrow").click(function () {
|
||||
var currentPosition = parseInt(view.css("marginLeft"));
|
||||
if (currentPosition < 0) {
|
||||
view.stop(false, true).animate({
|
||||
marginLeft: "+=" + move
|
||||
}, {
|
||||
duration: 400
|
||||
})
|
||||
$("#right-arrow").removeClass("disabled");
|
||||
$("#left-arrow").removeClass("disabled");
|
||||
if (currentPosition >= leftsideLimit) {
|
||||
$(this).addClass("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// page active
|
||||
$( ".main-navbar" ).find( "a" ).removeClass("active");
|
||||
$( ".main-navbar" ).find( "li" ).removeClass("active");
|
||||
|
||||
var current = window.location.pathname
|
||||
$(".main-navbar ul>li a").filter(function() {
|
||||
|
||||
var link = $(this).attr("href");
|
||||
if(link){
|
||||
if (current.indexOf(link) != -1) {
|
||||
$(this).parents().children('a').addClass('active');
|
||||
$(this).parents().parents().children('ul').css('display', 'block');
|
||||
$(this).addClass('active');
|
||||
$(this).parent().parent().parent().children('a').find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-down"></i></div>');
|
||||
$(this).parent().parent().parent().parent().parent().children('a').find('div').replaceWith('<div class="according-menu"><i class="fa fa-angle-down"></i></div>');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.custom-scrollbar').animate({
|
||||
scrollTop: $('a.nav-link.menu-title.active').offset().top - 500
|
||||
}, 1000);
|
||||
163
public/assets/js/bookmark/custom.js
Normal file
163
public/assets/js/bookmark/custom.js
Normal file
@@ -0,0 +1,163 @@
|
||||
|
||||
function submitBookMark() {
|
||||
if ($(".form-bookmark").valid()) {
|
||||
var index_var = $('#index_var').val();
|
||||
var weburl = $('#bm-weburl').val();
|
||||
var title = $('#bm-title').val();
|
||||
var desc = $('#bm-desc').val();
|
||||
var group = $('#bm-group').val();
|
||||
var collection = $('#bm-collection').val();
|
||||
$('#index_var').val(parseInt(index_var)+6);
|
||||
|
||||
var bmColData = '<div class="col-xl-3 col-md-4 xl-50">\
|
||||
<div class="card card-with-border bookmark-card o-hidden"><div class="details-website"><img class="img-fluid" src="../assets/images/lightgallry/07.jpg" alt="" data-original-title="" title="">\
|
||||
<div class="favourite-icon favourite_'+index_var+'"><a href="javascript:void(0)" onclick="setFavourite('+index_var+')" data-original-title="" title=""><i class="fa fa-star"></i></a></div>\
|
||||
<div class="desciption-data">\
|
||||
<div class="title-bookmark">\
|
||||
<h6 class="title_'+index_var+'">'+title+'</h6>\
|
||||
<p class="weburl_'+index_var+'">'+weburl+'</p>\
|
||||
<div class="hover-block">\
|
||||
<ul>\
|
||||
<li><a href="" data-bs-toggle="modal" data-bs-target="#edit-bookmark">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><polygon points="16 3 21 8 8 21 3 21 3 16 16 3"></polygon></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
<li><a href="javascript:void(0)">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
<li>\
|
||||
<a href="javascript:void(0)">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-share-2"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
<li>\
|
||||
<a href="javascript:void(0)">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
<li class="pull-right text-end">\
|
||||
<a href="javascript:void(0)">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
</ul>\
|
||||
</div>\
|
||||
<div class="content-general">\
|
||||
<p class="desc_'+index_var+'">'+desc+'</p>\
|
||||
<span class="collection_'+index_var+'">'+collection+'</span>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
$('#bookmarkData').append(bmColData);
|
||||
$('#bookmarkData1').append(bmColData);
|
||||
$('#exampleModal').modal('toggle');
|
||||
$('#bookmark-form').find('input[type="text"],textarea').val('');
|
||||
}
|
||||
}
|
||||
|
||||
// edit contact
|
||||
|
||||
function editBookmark(index_var){
|
||||
|
||||
var title = $(".title_"+index_var).html();
|
||||
var weburl = $(".weburl_"+index_var).html();
|
||||
var desc = $(".desc_"+index_var).html();
|
||||
$("#edittitle").val(title);
|
||||
$("#editurl").val(weburl);
|
||||
$("#editdesc").val(desc);
|
||||
}
|
||||
|
||||
|
||||
// favourites bookmark
|
||||
|
||||
var fav_arr = [];
|
||||
function setFavourite(index_var){
|
||||
$(".favourite_"+index_var).toggleClass("favourite");
|
||||
var title = $(".title_"+index_var).html();
|
||||
var weburl=$(".weburl_"+index_var).html();
|
||||
var desc = $(".desc_"+index_var).html();
|
||||
var collection = $(".collection_"+index_var).html();
|
||||
var n = fav_arr.includes(index_var);
|
||||
|
||||
console.log(fav_arr);
|
||||
console.log(n);
|
||||
if(n){
|
||||
for( var i = 0; i < fav_arr.length; i++){
|
||||
if ( fav_arr[i] === index_var) {
|
||||
fav_arr.splice(i, 1);
|
||||
}
|
||||
}
|
||||
$(".favourite_card_"+index_var).hide();
|
||||
}
|
||||
else {
|
||||
fav_arr.push(index_var);
|
||||
|
||||
var bmColData = '<div class="col-xl-3 col-md-4 xl-50 favourite_card_'+index_var+'">\
|
||||
<div class="card card-with-border bookmark-card o-hidden"><div class="details-website"><img class="img-fluid" src="../assets/images/lightgallry/07.jpg" alt="" data-original-title="" title="">\
|
||||
<div class="favourite-icon favourite" ><a href="javascript:void(0)" class="favourite_'+index_var+'" onclick="setFavourite('+index_var+')" data-original-title="" title=""><i class="fa fa-star"></i></a></div>\
|
||||
<div class="desciption-data">\
|
||||
<div class="title-bookmark">\
|
||||
<h6 class="title_'+index_var+'">'+title+'</h6>\
|
||||
<p class="weburl_'+index_var+'">'+weburl+'</p>\
|
||||
<div class="hover-block">\
|
||||
<ul>\
|
||||
<li><a href="" data-bs-toggle="modal" data-bs-target="#edit-bookmark">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><polygon points="16 3 21 8 8 21 3 21 3 16 16 3"></polygon></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
<li><a href="javascript:void(0)">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
<li>\
|
||||
<a href="javascript:void(0)">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-share-2"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
<li>\
|
||||
<a href="javascript:void(0)">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
<li class="pull-right text-end">\
|
||||
<a href="javascript:void(0)">\
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7" y2="7"></line></svg>\
|
||||
</a>\
|
||||
</li>\
|
||||
</ul>\
|
||||
</div>\
|
||||
<div class="content-general">\
|
||||
<p class="desc_'+index_var+'">'+desc+'</p>\
|
||||
<span class="collection_'+index_var+'">'+collection+'</span>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>';
|
||||
$('#favouriteData').append(bmColData);
|
||||
}
|
||||
if (fav_arr.length == 0) {
|
||||
$(".no-favourite").show();
|
||||
} else {
|
||||
$(".no-favourite").hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// list-view
|
||||
$('.grid-bookmark-view').on('click', function(e) {
|
||||
$('.details-bookmark').removeClass("list-bookmark");
|
||||
|
||||
});
|
||||
$('.list-layout-view').on('click', function(e) {
|
||||
$(".details-bookmark").css("opacity","0.2");
|
||||
$('.details-bookmark').addClass("list-bookmark");
|
||||
setTimeout(function(){
|
||||
$(".details-bookmark").css("opacity","1");
|
||||
}, 500);
|
||||
});
|
||||
|
||||
4
public/assets/js/bookmark/jquery.validate.min.js
vendored
Normal file
4
public/assets/js/bookmark/jquery.validate.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
public/assets/js/bootstrap/bootstrap.min.js
vendored
Normal file
7
public/assets/js/bootstrap/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
public/assets/js/bootstrap/popper.min.js
vendored
Normal file
6
public/assets/js/bootstrap/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
public/assets/js/bootstrap_bundle.js
vendored
Normal file
7
public/assets/js/bootstrap_bundle.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/assets/js/button-builder/clipboard.min.js
vendored
Normal file
1
public/assets/js/button-builder/clipboard.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
480
public/assets/js/button-builder/colorpicker.js
Normal file
480
public/assets/js/button-builder/colorpicker.js
Normal file
@@ -0,0 +1,480 @@
|
||||
|
||||
(function ($) {
|
||||
"use strict";
|
||||
var ColorPicker = function () {
|
||||
var
|
||||
ids = {},
|
||||
inAction,
|
||||
charMin = 65,
|
||||
visible,
|
||||
tpl = '<div class="colorpicker"><div class="colorpicker-color"><div><div></div></div></div><div class="colorpicker-hue"><div></div></div><div class="colorpicker-new-color" id="color_preview_box"></div><div class="colorpicker-current-color"></div><div class="colorpicker-hex"><input type="text" id="hex_code" maxlength="6" size="6" /></div><div class="colorpicker-rgb-r colorpicker-field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker-rgb-g colorpicker-field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker-rgb-b colorpicker-field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker-field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker-field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker-hsb-b colorpicker-field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker-submit"></div></div>',
|
||||
defaults = {
|
||||
eventName: 'click',
|
||||
onShow: function () {},
|
||||
onBeforeShow: function(){},
|
||||
onHide: function () {},
|
||||
onChange: function () {},
|
||||
onSubmit: function () {},
|
||||
color: 'ff0000',
|
||||
livePreview: true,
|
||||
flat: false
|
||||
},
|
||||
fillRGBFields = function (hsb, cal) {
|
||||
var rgb = HSBToRGB(hsb);
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(1).val(rgb.r).end()
|
||||
.eq(2).val(rgb.g).end()
|
||||
.eq(3).val(rgb.b).end();
|
||||
},
|
||||
fillHSBFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(4).val(hsb.h).end()
|
||||
.eq(5).val(hsb.s).end()
|
||||
.eq(6).val(hsb.b).end();
|
||||
},
|
||||
fillHexFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(0).val(HSBToHex(hsb)).end();
|
||||
},
|
||||
setSelector = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
|
||||
$(cal).data('colorpicker').selectorIndic.css({
|
||||
left: parseInt(150 * hsb.s/100, 10),
|
||||
top: parseInt(150 * (100-hsb.b)/100, 10)
|
||||
});
|
||||
},
|
||||
setHue = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
|
||||
},
|
||||
setCurrentColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
setNewColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
keyDown = function (ev) {
|
||||
var pressedKey = ev.charCode || ev.keyCode || -1;
|
||||
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
|
||||
return false;
|
||||
}
|
||||
var cal = $(this).parent().parent();
|
||||
if (cal.data('colorpicker').livePreview === true) {
|
||||
change.apply(this);
|
||||
}
|
||||
},
|
||||
change = function (ev) {
|
||||
var cal = $(this).parent().parent(), col;
|
||||
if (this.parentNode.className.indexOf('_hex') > 0) {
|
||||
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
|
||||
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
||||
cal.data('colorpicker').color = col = fixHSB({
|
||||
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
|
||||
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
|
||||
});
|
||||
} else {
|
||||
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
|
||||
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
|
||||
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
|
||||
}));
|
||||
}
|
||||
if (ev) {
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
}
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
||||
},
|
||||
blur = function (ev) {
|
||||
var cal = $(this).parent().parent();
|
||||
cal.data('colorpicker').fields.parent().removeClass('colorpicker-focus');
|
||||
},
|
||||
focus = function () {
|
||||
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
|
||||
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker-focus');
|
||||
$(this).parent().addClass('colorpicker-focus');
|
||||
},
|
||||
downIncrement = function (ev) {
|
||||
var field = $(this).parent().find('input').focus();
|
||||
var current = {
|
||||
el: $(this).parent().addClass('colorpicker-slider'),
|
||||
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
||||
y: ev.pageY,
|
||||
field: field,
|
||||
val: parseInt(field.val(), 10),
|
||||
preview: $(this).parent().parent().data('colorpicker').livePreview
|
||||
};
|
||||
$(document).bind('mouseup', current, upIncrement);
|
||||
$(document).bind('mousemove', current, moveIncrement);
|
||||
},
|
||||
moveIncrement = function (ev) {
|
||||
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
|
||||
if (ev.data.preview) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
upIncrement = function (ev) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
ev.data.el.removeClass('colorpicker-slider').find('input').focus();
|
||||
$(document).unbind('mouseup', upIncrement);
|
||||
$(document).unbind('mousemove', moveIncrement);
|
||||
return false;
|
||||
},
|
||||
downHue = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
y: $(this).offset().top
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upHue);
|
||||
$(document).bind('mousemove', current, moveHue);
|
||||
},
|
||||
moveHue = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(4)
|
||||
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upHue = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upHue);
|
||||
$(document).unbind('mousemove', moveHue);
|
||||
moveHue(ev);
|
||||
return false;
|
||||
},
|
||||
downSelector = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
pos: $(this).offset()
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upSelector);
|
||||
$(document).bind('mousemove', current, moveSelector);
|
||||
},
|
||||
moveSelector = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(6)
|
||||
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
|
||||
.end()
|
||||
.eq(5)
|
||||
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upSelector = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upSelector);
|
||||
$(document).unbind('mousemove', moveSelector);
|
||||
moveSelector(ev);
|
||||
return false;
|
||||
},
|
||||
enterSubmit = function (ev) {
|
||||
$(this).addClass('colorpicker-focus');
|
||||
},
|
||||
leaveSubmit = function (ev) {
|
||||
$(this).removeClass('colorpicker-focus');
|
||||
},
|
||||
clickSubmit = function (ev) {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').color;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
setCurrentColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
|
||||
},
|
||||
show = function (ev) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
|
||||
var pos = $(this).offset();
|
||||
var viewPort = getViewport();
|
||||
var top = pos.top + this.offsetHeight;
|
||||
var left = pos.left;
|
||||
if (top + 176 > viewPort.t + viewPort.h) {
|
||||
top -= this.offsetHeight + 176;
|
||||
}
|
||||
if (left + 356 > viewPort.l + viewPort.w) {
|
||||
left -= 356;
|
||||
}
|
||||
cal.css({left: left + 'px', top: top + 'px'});
|
||||
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
|
||||
cal.show();
|
||||
}
|
||||
$(document).bind('mousedown', {cal: cal}, hide);
|
||||
return false;
|
||||
},
|
||||
hide = function (ev) {
|
||||
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
|
||||
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
||||
ev.data.cal.hide();
|
||||
}
|
||||
$(document).unbind('mousedown', hide);
|
||||
}
|
||||
},
|
||||
isChildOf = function(parentEl, el, container) {
|
||||
if (parentEl == el) {
|
||||
return true;
|
||||
}
|
||||
if (parentEl.contains) {
|
||||
return parentEl.contains(el);
|
||||
}
|
||||
if ( parentEl.compareDocumentPosition ) {
|
||||
return !!(parentEl.compareDocumentPosition(el) & 16);
|
||||
}
|
||||
var prEl = el.parentNode;
|
||||
while(prEl && prEl != container) {
|
||||
if (prEl == parentEl)
|
||||
return true;
|
||||
prEl = prEl.parentNode;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getViewport = function () {
|
||||
var m = document.compatMode == 'CSS1Compat';
|
||||
return {
|
||||
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
||||
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
|
||||
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
|
||||
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
|
||||
};
|
||||
},
|
||||
fixHSB = function (hsb) {
|
||||
return {
|
||||
h: Math.min(360, Math.max(0, hsb.h)),
|
||||
s: Math.min(100, Math.max(0, hsb.s)),
|
||||
b: Math.min(100, Math.max(0, hsb.b))
|
||||
};
|
||||
},
|
||||
fixRGB = function (rgb) {
|
||||
return {
|
||||
r: Math.min(255, Math.max(0, rgb.r)),
|
||||
g: Math.min(255, Math.max(0, rgb.g)),
|
||||
b: Math.min(255, Math.max(0, rgb.b))
|
||||
};
|
||||
},
|
||||
fixHex = function (hex) {
|
||||
var len = 6 - hex.length;
|
||||
if (len > 0) {
|
||||
var o = [];
|
||||
for (var i=0; i<len; i++) {
|
||||
o.push('0');
|
||||
}
|
||||
o.push(hex);
|
||||
hex = o.join('');
|
||||
}
|
||||
return hex;
|
||||
},
|
||||
HexToRGB = function (hex) {
|
||||
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
||||
},
|
||||
HexToHSB = function (hex) {
|
||||
return RGBToHSB(HexToRGB(hex));
|
||||
},
|
||||
RGBToHSB = function (rgb) {
|
||||
var hsb = {
|
||||
h: 0,
|
||||
s: 0,
|
||||
b: 0
|
||||
};
|
||||
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
||||
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
||||
var delta = max - min;
|
||||
hsb.b = max;
|
||||
if (max != 0) {
|
||||
|
||||
}
|
||||
hsb.s = max != 0 ? 255 * delta / max : 0;
|
||||
if (hsb.s != 0) {
|
||||
if (rgb.r == max) {
|
||||
hsb.h = (rgb.g - rgb.b) / delta;
|
||||
} else if (rgb.g == max) {
|
||||
hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
||||
} else {
|
||||
hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
||||
}
|
||||
} else {
|
||||
hsb.h = -1;
|
||||
}
|
||||
hsb.h *= 60;
|
||||
if (hsb.h < 0) {
|
||||
hsb.h += 360;
|
||||
}
|
||||
hsb.s *= 100/255;
|
||||
hsb.b *= 100/255;
|
||||
return hsb;
|
||||
},
|
||||
HSBToRGB = function (hsb) {
|
||||
var rgb = {};
|
||||
var h = Math.round(hsb.h);
|
||||
var s = Math.round(hsb.s*255/100);
|
||||
var v = Math.round(hsb.b*255/100);
|
||||
if(s == 0) {
|
||||
rgb.r = rgb.g = rgb.b = v;
|
||||
} else {
|
||||
var t1 = v;
|
||||
var t2 = (255-s)*v/255;
|
||||
var t3 = (t1-t2)*(h%60)/60;
|
||||
if(h==360) h = 0;
|
||||
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
||||
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
||||
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
||||
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
||||
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
||||
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
||||
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
||||
}
|
||||
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
||||
},
|
||||
RGBToHex = function (rgb) {
|
||||
var hex = [
|
||||
rgb.r.toString(16),
|
||||
rgb.g.toString(16),
|
||||
rgb.b.toString(16)
|
||||
];
|
||||
$.each(hex, function (nr, val) {
|
||||
if (val.length == 1) {
|
||||
hex[nr] = '0' + val;
|
||||
}
|
||||
});
|
||||
return hex.join('');
|
||||
},
|
||||
HSBToHex = function (hsb) {
|
||||
return RGBToHex(HSBToRGB(hsb));
|
||||
},
|
||||
restoreOriginal = function () {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').origColor;
|
||||
cal.data('colorpicker').color = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
};
|
||||
return {
|
||||
init: function (opt) {
|
||||
opt = $.extend({}, defaults, opt||{});
|
||||
if (typeof opt.color == 'string') {
|
||||
opt.color = HexToHSB(opt.color);
|
||||
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
|
||||
opt.color = RGBToHSB(opt.color);
|
||||
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
|
||||
opt.color = fixHSB(opt.color);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function () {
|
||||
if (!$(this).data('colorpickerId')) {
|
||||
var options = $.extend({}, opt);
|
||||
options.origColor = opt.color;
|
||||
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
||||
$(this).data('colorpickerId', id);
|
||||
var cal = $(tpl).attr('id', id);
|
||||
if (options.flat) {
|
||||
cal.appendTo(this).show();
|
||||
} else {
|
||||
cal.appendTo(document.body);
|
||||
}
|
||||
options.fields = cal
|
||||
.find('input')
|
||||
.bind('keyup', keyDown)
|
||||
.bind('change', change)
|
||||
.bind('blur', blur)
|
||||
.bind('focus', focus);
|
||||
cal
|
||||
.find('span').bind('mousedown', downIncrement).end()
|
||||
.find('>div.colorpicker-current-color').bind('click', restoreOriginal);
|
||||
options.selector = cal.find('div.colorpicker-color').bind('mousedown', downSelector);
|
||||
options.selectorIndic = options.selector.find('div div');
|
||||
options.el = this;
|
||||
options.hue = cal.find('div.colorpicker-hue div');
|
||||
cal.find('div.colorpicker-hue').bind('mousedown', downHue);
|
||||
options.newColor = cal.find('div.colorpicker-new-color');
|
||||
options.currentColor = cal.find('div.colorpicker-current-color');
|
||||
cal.data('colorpicker', options);
|
||||
cal.find('div.colorpicker-submit')
|
||||
.bind('mouseenter', enterSubmit)
|
||||
.bind('mouseleave', leaveSubmit)
|
||||
.bind('click', clickSubmit);
|
||||
fillRGBFields(options.color, cal.get(0));
|
||||
fillHSBFields(options.color, cal.get(0));
|
||||
fillHexFields(options.color, cal.get(0));
|
||||
setHue(options.color, cal.get(0));
|
||||
setSelector(options.color, cal.get(0));
|
||||
setCurrentColor(options.color, cal.get(0));
|
||||
setNewColor(options.color, cal.get(0));
|
||||
if (options.flat) {
|
||||
cal.css({
|
||||
position: 'relative',
|
||||
display: 'block'
|
||||
});
|
||||
} else {
|
||||
$(this).bind(options.eventName, show);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
showPicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
show.apply(this);
|
||||
}
|
||||
});
|
||||
},
|
||||
hidePicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
$('#' + $(this).data('colorpickerId')).hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
setColor: function(col) {
|
||||
if (typeof col == 'string') {
|
||||
col = HexToHSB(col);
|
||||
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
||||
col = RGBToHSB(col);
|
||||
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
||||
col = fixHSB(col);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function(){
|
||||
if ($(this).data('colorpickerId')) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').color = col;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setCurrentColor(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}();
|
||||
$.fn.extend({
|
||||
ColorPicker: ColorPicker.init,
|
||||
ColorPickerHide: ColorPicker.hidePicker,
|
||||
ColorPickerShow: ColorPicker.showPicker,
|
||||
ColorPickerSetColor: ColorPicker.setColor
|
||||
});
|
||||
})(jQuery);
|
||||
475
public/assets/js/button-builder/extend-1.0.js
Normal file
475
public/assets/js/button-builder/extend-1.0.js
Normal file
@@ -0,0 +1,475 @@
|
||||
"use strict";
|
||||
function customRadio(radioName){
|
||||
var radioButton = $('input[name="'+ radioName +'"]');
|
||||
$(radioButton).each(function(){
|
||||
$(this).wrap( "<span class='custom-radio'></span>" );
|
||||
if($(this).is(':checked')){
|
||||
$(this).parent().addClass("selected");
|
||||
}
|
||||
});
|
||||
$(radioButton).click(function(){
|
||||
if($(this).is(':checked')){
|
||||
$(this).parent().addClass("selected");
|
||||
}
|
||||
$(radioButton).not(this).each(function(){
|
||||
$(this).parent().removeClass("selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
function customCheckbox(checkboxName){
|
||||
var checkBox = $('input[name="'+ checkboxName +'"]');
|
||||
$(checkBox).each(function(){
|
||||
$(this).wrap( "<span class='custom-checkbox'></span>" );
|
||||
if($(this).is(':checked')){
|
||||
$(this).parent().addClass("selected");
|
||||
}
|
||||
});
|
||||
$(checkBox).click(function(){
|
||||
$(this).parent().toggleClass("selected");
|
||||
});
|
||||
}
|
||||
function setColor(){
|
||||
// Getting current color values
|
||||
var btnSelector = "";
|
||||
var resultButton = $("#result").children("a, input, button");
|
||||
var btnClass = resultButton.attr("class");
|
||||
var btnClass = btnClass.replace(" "," ");
|
||||
var strTrim = $.trim(btnClass);
|
||||
var btnSelector = "." + strTrim.split(" ").join('.');
|
||||
|
||||
//alert(btnClass);
|
||||
if(resultButton.hasClass("btn-xs")){
|
||||
var classStr = btnClass.replace(" btn-xs","");
|
||||
var strTrim = $.trim(classStr);
|
||||
var btnSelector = "." + strTrim.split(" ").join('.');
|
||||
}
|
||||
if(resultButton.hasClass("btn-sm")){
|
||||
var classStr = btnClass.replace(" btn-sm","");
|
||||
var strTrim = $.trim(classStr);
|
||||
var btnSelector = "." + strTrim.split(" ").join('.');
|
||||
}
|
||||
if(resultButton.hasClass("btn-lg")){
|
||||
var classStr = btnClass.replace(" btn-lg","");
|
||||
var strTrim = $.trim(classStr);
|
||||
var btnSelector = "." + strTrim.split(" ").join('.');
|
||||
}
|
||||
if(resultButton.hasClass("btn-block")){
|
||||
var btnSelector = btnSelector.replace(".btn-block","");
|
||||
}
|
||||
|
||||
//alert(btnSelector);
|
||||
|
||||
// Default button style
|
||||
if(btnSelector == ".btn.btn-default" || btnSelector == ".btn.btn-default.disabled"){
|
||||
$("#textColor").val("333333");
|
||||
$("#bgColor").val("FFFFFF");
|
||||
$("#topColor").val("FFFFFF");
|
||||
$("#bottomColor").val("E0E0E0");
|
||||
$("#borderTopColor").val("CCCCCC");
|
||||
$("#borderHrColor").val("CCCCCC");
|
||||
$("#borderBottomColor").val("CCCCCC");
|
||||
}
|
||||
if(btnSelector == ".btn.btn-default.active"){
|
||||
$("#textColor").val("333333");
|
||||
$("#bgColor").val("E0E0E0");
|
||||
$("#topColor").val("E0E0E0");
|
||||
$("#bottomColor").val("E0E0E0");
|
||||
$("#borderTopColor").val("DBDBDB");
|
||||
$("#borderHrColor").val("DBDBDB");
|
||||
$("#borderBottomColor").val("DBDBDB");
|
||||
}
|
||||
|
||||
// Primary button style
|
||||
if(btnSelector == ".btn.btn-primary" || btnSelector == ".btn.btn-primary.disabled"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("428BCA");
|
||||
$("#topColor").val("428BCA");
|
||||
$("#bottomColor").val("2D6CA2");
|
||||
$("#borderTopColor").val("2B669A");
|
||||
$("#borderHrColor").val("2B669A");
|
||||
$("#borderBottomColor").val("2B669A");
|
||||
}
|
||||
if(btnSelector == ".btn.btn-primary.active"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("2D6CA2");
|
||||
$("#topColor").val("2D6CA2");
|
||||
$("#bottomColor").val("2D6CA2");
|
||||
$("#borderTopColor").val("2B669A");
|
||||
$("#borderHrColor").val("2B669A");
|
||||
$("#borderBottomColor").val("2B669A");
|
||||
}
|
||||
|
||||
// Info button style
|
||||
if(btnSelector == ".btn.btn-info" || btnSelector == ".btn.btn-info.disabled"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("5BC0DE");
|
||||
$("#topColor").val("5BC0DE");
|
||||
$("#bottomColor").val("2AABD2");
|
||||
$("#borderTopColor").val("28A4C9");
|
||||
$("#borderHrColor").val("28A4C9");
|
||||
$("#borderBottomColor").val("28A4C9");
|
||||
}
|
||||
if(btnSelector == ".btn.btn-info.active"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("2AABD2");
|
||||
$("#topColor").val("2AABD2");
|
||||
$("#bottomColor").val("2AABD2");
|
||||
$("#borderTopColor").val("28A4C9");
|
||||
$("#borderHrColor").val("28A4C9");
|
||||
$("#borderBottomColor").val("28A4C9");
|
||||
}
|
||||
|
||||
// Success button style
|
||||
if(btnSelector == ".btn.btn-success" || btnSelector == ".btn.btn-success.disabled"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("00c292");
|
||||
$("#topColor").val("00c292");
|
||||
$("#bottomColor").val("00ebb1");
|
||||
$("#borderTopColor").val("00c292");
|
||||
$("#borderHrColor").val("00c292");
|
||||
$("#borderBottomColor").val("00c292");
|
||||
}
|
||||
if(btnSelector == ".btn.btn-success.active"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("00ebb1");
|
||||
$("#topColor").val("00ebb1");
|
||||
$("#bottomColor").val("00ebb1");
|
||||
$("#borderTopColor").val("00c292");
|
||||
$("#borderHrColor").val("00c292");
|
||||
$("#borderBottomColor").val("00c292");
|
||||
}
|
||||
|
||||
// Warning button style
|
||||
if(btnSelector == ".btn.btn-warning" || btnSelector == ".btn.btn-warning.disabled"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("F0AD4E");
|
||||
$("#topColor").val("F0AD4E");
|
||||
$("#bottomColor").val("EB9316");
|
||||
$("#borderTopColor").val("E38D13");
|
||||
$("#borderHrColor").val("E38D13");
|
||||
$("#borderBottomColor").val("E38D13");
|
||||
}
|
||||
if(btnSelector == ".btn.btn-warning.active"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("EB9316");
|
||||
$("#topColor").val("EB9316");
|
||||
$("#bottomColor").val("EB9316");
|
||||
$("#borderTopColor").val("E38D13");
|
||||
$("#borderHrColor").val("E38D13");
|
||||
$("#borderBottomColor").val("E38D13");
|
||||
}
|
||||
|
||||
// Danger button style
|
||||
if(btnSelector == ".btn.btn-danger" || btnSelector == ".btn.btn-danger.disabled"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("D9534F");
|
||||
$("#topColor").val("D9534F");
|
||||
$("#bottomColor").val("C12E2A");
|
||||
$("#borderTopColor").val("B92C28");
|
||||
$("#borderHrColor").val("B92C28");
|
||||
$("#borderBottomColor").val("B92C28");
|
||||
}
|
||||
if(btnSelector == ".btn.btn-danger.active"){
|
||||
$("#textColor").val("ffffff");
|
||||
$("#bgColor").val("C12E2A");
|
||||
$("#topColor").val("C12E2A");
|
||||
$("#bottomColor").val("C12E2A");
|
||||
$("#borderTopColor").val("B92C28");
|
||||
$("#borderHrColor").val("B92C28");
|
||||
$("#borderBottomColor").val("B92C28");
|
||||
}
|
||||
|
||||
// Setting background of color selector
|
||||
$(".custom-button-color input").each(function(){
|
||||
var colorValue = $(this).val();
|
||||
//alert(colorValue);
|
||||
$(this).next(".color-slelector").css("background", "#"+colorValue);
|
||||
});
|
||||
|
||||
var txtColor = $("#textColor").val();
|
||||
var bgColor = $("#bgColor").val();
|
||||
var topColor = $("#topColor").val();
|
||||
var bottomColor = $("#bottomColor").val();
|
||||
var borderTopColor = $("#borderTopColor").val();
|
||||
var borderHrColor = $("#borderHrColor").val();
|
||||
var borderBottomColor = $("#borderBottomColor").val();
|
||||
|
||||
var btnBg = "background-color: " + "#" + bgColor + ";";
|
||||
var btnGradient = "background-image: linear-gradient(to bottom, " + "#" + topColor + "," + " " + "#" + bottomColor + ");";
|
||||
var btnBgPosition = "background-position: 0 0;";
|
||||
var btnText = "color: " + "#" + txtColor + ";";
|
||||
var btnBorder = "border-color: " + "#" + borderTopColor + " " + "#" + borderHrColor + " " + "#" + borderBottomColor +";";
|
||||
|
||||
var btnBgHover = "background-color: " + "#" + bottomColor + ";";
|
||||
var btnGradientHover = "background-image: linear-gradient(to bottom, " + "#" + bottomColor + "," + " " + "#" + bottomColor + ");";
|
||||
|
||||
// Setting CSS
|
||||
var resultButton = $("#result").find("a, input, button");
|
||||
|
||||
if(resultButton.hasClass("active") || resultButton.hasClass("disabled")){
|
||||
//alert(btnSelector);
|
||||
var btnStyle = "<style type='text/css'>" + "#result" + " " + btnSelector + "," + " " + "#result" + " " + btnSelector + ":hover {" + btnText + " " + btnBg + " " + btnGradient + " " + btnBgPosition + " " + btnBorder + "}</style>";
|
||||
|
||||
var btnCSS = btnSelector + "," + " " + "\n" + btnSelector + ":hover {\n" + " "+ btnText + "\n" + " "+ btnBg + "\n" + " "+ btnGradient + "\n" + " "+btnBgPosition + "\n" + " "+ btnBorder + "\n}";
|
||||
|
||||
$("style").remove();
|
||||
$(btnStyle).appendTo("head");
|
||||
$(".button-css").empty();
|
||||
$(".button-css").html(btnCSS);
|
||||
}
|
||||
else{
|
||||
//alert(btnSelector);
|
||||
var btnStyle = "<style type='text/css'>" + "#result" + " " + btnSelector + " {" + btnText + " " + btnBg + " " + btnGradient + " " + btnBorder + "}" + "#result" + " " + btnSelector + ":hover {" + btnText + " " + btnBgHover + " " + btnGradientHover + " " + btnBorder + "}" + "</style>";
|
||||
|
||||
var btnCSS = btnSelector + " {\n" + " "+ btnText + "\n" + " "+ btnBg + "\n" + " "+ btnGradient + "\n" + " "+ btnBorder + "\n}\n" + btnSelector + ":hover {\n" + " "+ btnText + "\n" + " "+ btnBgHover + "\n" + " "+ btnGradientHover + "\n" + " "+ btnBorder + "\n}";
|
||||
|
||||
$("style").remove();
|
||||
$(btnStyle).appendTo("head");
|
||||
$(".button-css").empty();
|
||||
$(".button-css").html(btnCSS);
|
||||
}
|
||||
}
|
||||
(function($) {
|
||||
"use strict";
|
||||
customRadio("color-option");
|
||||
customCheckbox("border-all");
|
||||
setColor();
|
||||
|
||||
// Show hide border options
|
||||
$('.border-all input[type="checkbox"]').each(function(){
|
||||
if($(this).prop('checked') == true){
|
||||
var borderTopColor = $("#borderTopColor").val();
|
||||
$("#borderHrColor").val(borderTopColor);
|
||||
$("#borderBottomColor").val(borderTopColor);
|
||||
$("#borderHrColor, #borderBottomColor").next(".color-slelector").css("background", "#"+borderTopColor);
|
||||
$(".border-color-separate").hide();
|
||||
$(this).parents(".controls").prev().text("Border Color");
|
||||
}
|
||||
if($(this).prop('checked') == false){
|
||||
$(".border-color-separate").show();
|
||||
$(this).parents(".controls").prev().text("Border Top Color");
|
||||
}
|
||||
});
|
||||
$('.border-all, .border-all input[type="checkbox"]').click(function(){
|
||||
if($(this).prop('checked') == true){
|
||||
var borderTopColor = $("#borderTopColor").val();
|
||||
$("#borderHrColor").val(borderTopColor);
|
||||
$("#borderBottomColor").val(borderTopColor);
|
||||
$("#borderHrColor, #borderBottomColor").next(".color-slelector").css("background", "#"+borderTopColor);
|
||||
$(".border-color-separate").hide();
|
||||
$(this).parents(".controls").prev().text("Border Color");
|
||||
}
|
||||
if($(this).prop('checked') == false){
|
||||
$(".border-color-separate").show();
|
||||
$(this).parents(".controls").prev().text("Border Top Color");
|
||||
}
|
||||
});
|
||||
|
||||
// HTML copy to clipboard
|
||||
var copyHTML = new Clipboard("#copyHTML");
|
||||
|
||||
copyHTML.on("success", function(e) {
|
||||
$("#htmlAlert").fadeIn("fast").delay(500).queue(function() {
|
||||
$(this).fadeOut("fast");
|
||||
$(this).dequeue();
|
||||
});
|
||||
});
|
||||
|
||||
// HTML copy to clipboard
|
||||
var copyCSS = new Clipboard("#copyCSS");
|
||||
|
||||
copyCSS.on("success", function(e) {
|
||||
$("#cssAlert").fadeIn("fast").delay(500).queue(function() {
|
||||
$(this).fadeOut("fast");
|
||||
$(this).dequeue();
|
||||
});
|
||||
});
|
||||
|
||||
// Show hide icon option
|
||||
$('.element-type button[value="a"]').click(function(){
|
||||
$("#iconOption").show();
|
||||
$(".include-icon button").each(function(){
|
||||
if($('button[value="1"]').hasClass("active")){
|
||||
$(".toggle").show();
|
||||
}
|
||||
if($('button[value="0"]').hasClass("active")){
|
||||
$(".toggle").hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.element-type button[value="button"]').click(function(){
|
||||
$("#iconOption").show();
|
||||
$(".include-icon button").each(function(){
|
||||
if($('button[value="1"]').hasClass("active")){
|
||||
$(".toggle").show();
|
||||
}
|
||||
if($('button[value="0"]').hasClass("active")){
|
||||
$(".toggle").hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.element-type button[value="input"]').click(function(){
|
||||
$("#iconOption, .toggle").hide();
|
||||
});
|
||||
|
||||
// Show hide color option
|
||||
$('.button-color-option input[type="radio"]').each(function(){
|
||||
if($(this).is(':checked')){
|
||||
if($(this).attr("value")=="bootstrap"){
|
||||
$(".custom-button-color").hide();
|
||||
$(".bootstrap-inbuilt-style").show();
|
||||
$(".wrapper").removeClass("adjust");
|
||||
$("#cssBox").hide();
|
||||
$("style").remove();
|
||||
}
|
||||
if($(this).attr("value")=="custom"){
|
||||
$(".bootstrap-inbuilt-style").hide();
|
||||
$(".custom-button-color").show();
|
||||
$(".wrapper").addClass("adjust");
|
||||
$("#cssBox").show();
|
||||
setColor();
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.button-color-option input[type="radio"]').click(function(){
|
||||
if($(this).attr("value")=="bootstrap"){
|
||||
$(".custom-button-color").hide();
|
||||
$(".bootstrap-inbuilt-style").show();
|
||||
$(".wrapper").removeClass("adjust");
|
||||
$("#cssBox").hide();
|
||||
$("style").remove();
|
||||
}
|
||||
if($(this).attr("value")=="custom"){
|
||||
$(".bootstrap-inbuilt-style").hide();
|
||||
$(".custom-button-color").show();
|
||||
$(".wrapper").addClass("adjust");
|
||||
$("#cssBox").show();
|
||||
setColor();
|
||||
}
|
||||
});
|
||||
|
||||
var colorInput = $('#textColor, #topColor, #bottomColor, #bgColor, #borderTopColor, #borderHrColor, #borderBottomColor');
|
||||
$(colorInput).each(function(){
|
||||
var defautColor = $(this).val();
|
||||
//alert(defautColor);
|
||||
$(this).ColorPicker({
|
||||
color: defautColor,
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
$(el).val(hex);
|
||||
$(el).ColorPickerHide();
|
||||
}
|
||||
})
|
||||
.bind('keyup', function(){
|
||||
$(this).ColorPickerSetColor(this.value);
|
||||
});
|
||||
});
|
||||
|
||||
$(".colorpicker-submit").click(function(){
|
||||
$(".custom-button-color input").each(function(){
|
||||
var colorValue = $(this).val();
|
||||
//alert(colorValue);
|
||||
$(this).next(".color-slelector").css("background", "#"+colorValue);
|
||||
$(this).attr("value", colorValue);
|
||||
});
|
||||
});
|
||||
var colorSelector = $('#colorSelector1, #colorSelector2, #colorSelector3, #colorSelector4, #colorSelector5, #colorSelector6, #colorSelector7');
|
||||
$(colorSelector).each(function(){
|
||||
var selectorColor = $(this).prev().val();
|
||||
$(this).ColorPicker({
|
||||
color: selectorColor,
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
$(el).val(hex);
|
||||
$(el).ColorPickerHide();
|
||||
$(el).css("background", "#"+hex);
|
||||
$(el).prev().val(hex);
|
||||
}
|
||||
}).bind('click', function(){
|
||||
var selectorColor = $(this).prev().val();
|
||||
$(this).ColorPickerSetColor(selectorColor);
|
||||
});
|
||||
});
|
||||
|
||||
// Inserting CSS
|
||||
$('.colorpicker-submit, .button-state button, .border-all input[type="checkbox"]').click(function(){
|
||||
if($('.button-color-option input[value="custom"]').is(':checked')){
|
||||
|
||||
// Getting current color values
|
||||
var btnSelector = "";
|
||||
var resultButton = $("#result").children("a, input, button");
|
||||
var btnClass = resultButton.attr("class");
|
||||
var strTrim = $.trim(btnClass);
|
||||
var btnSelector = "." + strTrim.split(" ").join('.');
|
||||
|
||||
//alert(btnClass);
|
||||
if(resultButton.hasClass("btn-xs")){
|
||||
var classStr = btnClass.replace(" btn-xs","");
|
||||
var strTrim = $.trim(classStr);
|
||||
var btnSelector = "." + strTrim.split(" ").join('.');
|
||||
}
|
||||
if(resultButton.hasClass("btn-sm")){
|
||||
var classStr = btnClass.replace(" btn-sm","");
|
||||
var strTrim = $.trim(classStr);
|
||||
var btnSelector = "." + strTrim.split(" ").join('.');
|
||||
}
|
||||
if(resultButton.hasClass("btn-lg")){
|
||||
var classStr = btnClass.replace(" btn-lg","");
|
||||
var strTrim = $.trim(classStr);
|
||||
var btnSelector = "." + strTrim.split(" ").join('.');
|
||||
}
|
||||
|
||||
//alert(btnSelector);
|
||||
|
||||
$('.border-all input[type="checkbox"]').each(function(){
|
||||
if($(this).is(':checked')){
|
||||
var borderTopColor = $("#borderTopColor").val();
|
||||
$("#borderHrColor").val(borderTopColor);
|
||||
$("#borderBottomColor").val(borderTopColor);
|
||||
$("#borderHrColor, #borderBottomColor").next(".color-slelector").css("background", "#"+borderTopColor);
|
||||
}
|
||||
});
|
||||
|
||||
var txtColor = $("#textColor").val();
|
||||
var bgColor = $("#bgColor").val();
|
||||
var topColor = $("#topColor").val();
|
||||
var bottomColor = $("#bottomColor").val();
|
||||
var borderTopColor = $("#borderTopColor").val();
|
||||
var borderHrColor = $("#borderHrColor").val();
|
||||
var borderBottomColor = $("#borderBottomColor").val();
|
||||
|
||||
var btnBg = "background-color: " + "#" + bgColor + ";";
|
||||
var btnGradient = "background-image: linear-gradient(to bottom, " + "#" + topColor + "," + " " + "#" + bottomColor + ");";
|
||||
var btnBgPosition = "background-position: 0 0;";
|
||||
var btnText = "color: " + "#" + txtColor + ";";
|
||||
var btnBorder = "border-color: " + "#" + borderTopColor + " " + "#" + borderHrColor + " " + "#" + borderBottomColor +";";
|
||||
|
||||
var btnBgHover = "background-color: " + "#" + bottomColor + ";";
|
||||
var btnGradientHover = "background-image: linear-gradient(to bottom, " + "#" + bottomColor + "," + " " + "#" + bottomColor + ");";
|
||||
|
||||
// Setting CSS
|
||||
var resultButton = $("#result").find("a, input, button");
|
||||
|
||||
if(resultButton.hasClass("active") || resultButton.hasClass("disabled")){
|
||||
//alert(btnSelector);
|
||||
var btnStyle = "<style type='text/css'>" + "#result" + " " + btnSelector + "," + " " + "#result" + " " + btnSelector + ":hover {" + btnText + " " + btnBg + " " + btnGradient + " " + btnBgPosition + " " + btnBorder + "}</style>";
|
||||
|
||||
var btnCSS = btnSelector + "," + " " + "\n" + btnSelector + ":hover {\n" + " "+ btnText + "\n" + " "+ btnBg + "\n" + " "+ btnGradient + "\n" + " "+btnBgPosition + "\n" + " "+ btnBorder + "\n}";
|
||||
|
||||
$("style").remove();
|
||||
$(btnStyle).appendTo("head");
|
||||
$(".button-css").empty();
|
||||
$(".button-css").html(btnCSS);
|
||||
}
|
||||
else{
|
||||
//alert(btnSelector);
|
||||
var btnStyle = "<style type='text/css'>" + "#result" + " " + btnSelector + " {" + btnText + " " + btnBg + " " + btnGradient + " " + btnBorder + "}" + "#result" + " " + btnSelector + ":hover {" + btnText + " " + btnBgHover + " " + btnGradientHover + " " + btnBorder + "}" + "</style>";
|
||||
|
||||
var btnCSS = btnSelector + " {\n" + " "+ btnText + "\n" + " "+ btnBg + "\n" + " "+ btnGradient + "\n" + " "+ btnBorder + "\n}\n" + btnSelector + ":hover {\n" + " "+ btnText + "\n" + " "+ btnBgHover + "\n" + " "+ btnGradientHover + "\n" + " "+ btnBorder + "\n}";
|
||||
|
||||
$("style").remove();
|
||||
$(btnStyle).appendTo("head");
|
||||
$(".button-css").empty();
|
||||
$(".button-css").html(btnCSS);
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
368
public/assets/js/button-builder/generator.js
Normal file
368
public/assets/js/button-builder/generator.js
Normal file
@@ -0,0 +1,368 @@
|
||||
function filterHTML(strInput){
|
||||
strInput = strInput.replace(new RegExp(['<'],"g"), "<");
|
||||
strInput = strInput.replace(new RegExp(['>'],"g"), ">");
|
||||
return strInput;
|
||||
}
|
||||
$(function(){
|
||||
$(".button-text").keyup(function(){
|
||||
var btnText = $(this).val();
|
||||
if($("#result a.btn, #result button.btn").length){
|
||||
if($("#result a.btn span, #result button.btn span").length){
|
||||
var iconCode = $("#result a.btn span, #result button.btn span").clone();
|
||||
innerCode = btnText;
|
||||
$("#result .btn").html(filterHTML(btnText));
|
||||
$("#result .btn").prepend(" ");
|
||||
$("#result .btn").prepend(iconCode);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
else{
|
||||
$("#result .btn").html(filterHTML(btnText));
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
else if($("#result input.btn").length){
|
||||
$("#result .btn").attr("value", filterHTML(btnText));
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
});
|
||||
$(".button-color label").click(function(){
|
||||
var btnColor = $(this).children("input").attr("value");
|
||||
var btnSize = $(".button-size label.active").children("input").attr("value");
|
||||
var btnState = $(".button-state label.active").children("input").attr("value");
|
||||
var btnWidth = $(".button-width label.active").children("input").attr("value");
|
||||
if(btnState == "active" || btnState == "disabled"){
|
||||
var className = btnColor + " " + btnSize + " " + btnState;
|
||||
if(btnWidth.length){
|
||||
var className = btnColor + " " + btnSize + " " + btnState + " " + btnWidth;
|
||||
}
|
||||
$("#result .btn").attr("class", className);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
if(btnState == "normal"){
|
||||
var className = btnColor + " " + btnSize;
|
||||
if(btnWidth.length){
|
||||
var className = btnColor + " " + btnSize + " " + btnWidth;
|
||||
}
|
||||
$("#result .btn").attr("class", className);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
});
|
||||
$(".button-size label").click(function(){
|
||||
var btnSize = $(this).children("input").attr("value");
|
||||
var btnColor = $(".button-color label.active").children("input").attr("value");
|
||||
var btnState = $(".button-state label.active").children("input").attr("value");
|
||||
var btnWidth = $(".button-width label.active").children("input").attr("value");
|
||||
if(btnSize.length){
|
||||
if(btnState == "active" || btnState == "disabled"){
|
||||
var className = btnColor + " " + btnSize + " " + btnState;
|
||||
if(btnWidth.length){
|
||||
var className = btnColor + " " + btnSize + " " + btnState + " " + btnWidth;
|
||||
}
|
||||
$("#result .btn").attr("class", className);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
if(btnState == "normal"){
|
||||
var className = btnColor + " " + btnSize;
|
||||
if(btnWidth.length){
|
||||
var className = btnColor + " " + btnSize + " " + btnWidth;
|
||||
}
|
||||
$("#result .btn").attr("class", className);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(btnState == "active" || btnState == "disabled"){
|
||||
var className = btnColor + " " + btnState;
|
||||
if(btnWidth.length){
|
||||
var className = btnColor + " " + btnState + " " + btnWidth;
|
||||
}
|
||||
$("#result .btn").attr("class", className);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
if(btnState == "normal"){
|
||||
var className = btnColor;
|
||||
if(btnWidth.length){
|
||||
var className = btnColor + " " + btnWidth;
|
||||
}
|
||||
$("#result .btn").attr("class", className);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
$("#result .btn").attr("class", className);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
});
|
||||
$(".element-type label").click(function(){
|
||||
var iconCode = "";
|
||||
var currentClass = $("#result .btn").attr("class");
|
||||
if($("#result a.btn span").length){
|
||||
var iconCode = $("#result a.btn span, #result button.btn span").clone();
|
||||
}
|
||||
if($("#result a.btn span").length === 0 && $('.include-icon label.active input').val() == 1){
|
||||
var iconName = $(".the-icons li.active span").attr("class");
|
||||
iconCode = '<span class="'+iconName+ '"></span>';
|
||||
}
|
||||
if($("#result a.btn, #result button.btn").length){
|
||||
var btnStr = $("#result .btn").text();
|
||||
var btnText = $.trim(btnStr);
|
||||
}
|
||||
else if($("#result input.btn").length){
|
||||
var btnStr = $("#result .btn").attr("value");
|
||||
var btnText = $.trim(btnStr);
|
||||
}
|
||||
if($(this).children("input").attr("value")=="a"){
|
||||
$("#result").empty();
|
||||
var btnCode = '<a href="javascript:void(0)"' + " " + 'class="' + currentClass + '">' + btnText + '</a>';
|
||||
$("#result a").remove();
|
||||
$("#result").append(btnCode);
|
||||
if(iconCode.length){
|
||||
if($('.fa-position label.active input').val() == "left"){
|
||||
$("#result .btn").prepend(" ");
|
||||
$("#result .btn").prepend(iconCode);
|
||||
}
|
||||
if($('.fa-position label.active input').val() == "right"){
|
||||
$("#result .btn").append(" ");
|
||||
$("#result .btn").append(iconCode);
|
||||
}
|
||||
}
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
if($(".include-icon label.active").children("input").attr("value")=="1"){
|
||||
$(".toggle").add("#iconOption").show();
|
||||
}
|
||||
if($(".include-icon label.active").children("input").attr("value")=="0"){
|
||||
$("#iconOption").show();
|
||||
}
|
||||
}
|
||||
else if($(this).children("input").attr("value")=="button"){
|
||||
$("#result").empty();
|
||||
var btnCode = '<button type="button"' + " " + 'class="' + currentClass + '">' + btnText + '</button>';
|
||||
$("#result button").remove();
|
||||
$("#result").append(btnCode);
|
||||
if(iconCode.length){
|
||||
if($('.fa-position label.active input').val() == "left"){
|
||||
$("#result .btn").prepend(" ");
|
||||
$("#result .btn").prepend(iconCode);
|
||||
}
|
||||
if($('.fa-position label.active input').val() == "right"){
|
||||
$("#result .btn").append(" ");
|
||||
$("#result .btn").append(iconCode);
|
||||
}
|
||||
}
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
if($(".include-icon label.active").children("input").attr("value")=="1"){
|
||||
$(".toggle").add("#iconOption").show();
|
||||
}
|
||||
if($(".include-icon label.active").children("input").attr("value")=="0"){
|
||||
$("#iconOption").show();
|
||||
}
|
||||
}
|
||||
else if($(this).children("input").attr("value")=="input"){
|
||||
$("#result").empty();
|
||||
var btnCode = '<input type="button"' + " " + 'class="' + currentClass + '" value="' + btnText + '">';
|
||||
$("#result button").remove();
|
||||
$("#result").append(btnCode);
|
||||
// Only applicable for input case
|
||||
$(".button-html").html(filterHTML(btnCode));
|
||||
$(".toggle").add("#iconOption").hide();
|
||||
}
|
||||
else if($(this).children("input").attr("value")=="submit"){
|
||||
$("#result").empty();
|
||||
var btnCode = '<input type="submit"' + " " + 'class="' + currentClass + '" value="' + btnText + '">';
|
||||
$("#result button").remove();
|
||||
$("#result").append(btnCode);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
});
|
||||
$(".button-state label").click(function(){
|
||||
if($(this).children("input").attr("value")=="active"){
|
||||
if($("#result a.btn").length){
|
||||
if($("#result a.disabled").length){
|
||||
$("#result a.btn").removeClass("disabled");
|
||||
$("#result a.btn").addClass("active");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
else{
|
||||
$("#result a.btn").addClass("active");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
if($("#result button.btn, #result input.btn").length){
|
||||
if($("#result button.disabled, #result input.disabled").length){
|
||||
$("#result button.btn, #result input.btn").removeClass("disabled");
|
||||
//$("#result button.btn, #result input.btn").removeAttr("disabled");
|
||||
$("#result button.btn, #result input.btn").addClass("active");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
else{
|
||||
$("#result button.btn, #result input.btn").addClass("active");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
}
|
||||
if($(this).children("input").attr("value")=="disabled"){
|
||||
if($("#result a.btn").length){
|
||||
if($("#result a.active").length){
|
||||
$("#result a.btn").removeClass("active");
|
||||
$("#result a.btn").addClass("disabled");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
else{
|
||||
$("#result a.btn").addClass("disabled");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
if($("#result button.btn, #result input.btn")){
|
||||
if($("#result button.active, #result input.active").length){
|
||||
$("#result button.btn, #result input.btn").removeClass("active");
|
||||
$("#result button.btn, #result input.btn").addClass("disabled");
|
||||
//$("#result button.btn, #result input.btn").attr("disabled","disabled");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
else{
|
||||
$("#result button.btn, #result input.btn").addClass("disabled");
|
||||
//$("#result button.btn, #result input.btn").attr("disabled","disabled");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
}
|
||||
if($(this).children("input").attr("value")=="normal"){
|
||||
if($("#result .btn.active").length){
|
||||
$("#result .btn").removeClass("active");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
if($("#result .btn.disabled").length){
|
||||
$("#result .btn").removeClass("disabled");
|
||||
//$("#result .btn").removeAttr("disabled");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
});
|
||||
$(".button-width label").click(function(){
|
||||
if($(this).children("input").attr("value")==""){
|
||||
if($("#result .btn").hasClass("btn-block")){
|
||||
$("#result .btn").removeClass("btn-block");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
if($(this).children("input").attr("value")=="btn-block"){
|
||||
if(!$("#result .btn").hasClass("btn-block")){
|
||||
$("#result .btn").addClass("btn-block");
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
});
|
||||
$(".the-icons li").click(function(){
|
||||
$(".the-icons li").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
if($('.include-icon label.active input').val() == 1){
|
||||
if($("#result .btn span").length){
|
||||
var iconClass = $(this).children("span").attr("class");
|
||||
iconCode = ' <span class="'+iconClass+'"></span> ';
|
||||
//alert(iconCode);
|
||||
$("#result .btn span").remove();
|
||||
if($('.fa-position label.active input').val() == "left"){
|
||||
$("#result .btn").prepend(iconCode);
|
||||
}
|
||||
if($('.fa-position label.active input').val() == "right"){
|
||||
$("#result .btn").append(iconCode);
|
||||
}
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.include-icon label').click(function(){
|
||||
if($(this).children("input").attr("value") == 0){
|
||||
if($("#result .btn span").length){
|
||||
var btnStr = $("#result .btn").text();
|
||||
var btnText = $.trim(btnStr);
|
||||
$("#result .btn").html(btnText);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
$(".toggle").hide();
|
||||
}
|
||||
if($(this).children("input").attr("value") == 1){
|
||||
$(".toggle").show();
|
||||
var iconName = $(".the-icons li.active span").attr("class");
|
||||
iconCode = '<span class="'+iconName+ '"></span>';
|
||||
if(iconCode.length){
|
||||
if($('.fa-position label.active input').val() == "left"){
|
||||
$("#result .btn").prepend(" ");
|
||||
$("#result .btn").prepend(iconCode);
|
||||
}
|
||||
if($('.fa-position label.active input').val() == "right"){
|
||||
$("#result .btn").append(" ");
|
||||
$("#result .btn").append(iconCode);
|
||||
}
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$(".fa-position label").click(function(){
|
||||
if($(this).children("input").attr("value") == "left"){
|
||||
if($("#result .btn span").length){
|
||||
var iconCode = $("#result .btn span").clone();
|
||||
var btnStr = $("#result .btn").text();
|
||||
var btnText = $.trim(btnStr);
|
||||
$("#result .btn").html(iconCode);
|
||||
$("#result .btn").append(" ");
|
||||
$("#result .btn").append(btnText);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
|
||||
}
|
||||
if($(this).children("input").attr("value") == "right"){
|
||||
if($("#result .btn span").length){
|
||||
var iconCode = $("#result .btn span").clone();
|
||||
var btnStr = $("#result .btn").text();
|
||||
var btnText = $.trim(btnStr);
|
||||
$("#result .btn").html(iconCode);
|
||||
$("#result .btn").prepend(" ");
|
||||
$("#result .btn").prepend(btnText);
|
||||
var btnHTML = $("#result").html();
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$(".the-icons li").each(function(){
|
||||
var iconName = $(this).text().trim();
|
||||
$(this).attr("title",iconName);
|
||||
});
|
||||
$(".the-icons li").tooltip();
|
||||
|
||||
//Print Button HTML
|
||||
$(".print-html").click(function(){
|
||||
var btnHTML = $("#result").html();
|
||||
alert(filterHTML(btnHTML));
|
||||
$(".button-html").html(filterHTML(btnHTML));
|
||||
});
|
||||
});
|
||||
16
public/assets/js/button-tooltip-custom.js
Normal file
16
public/assets/js/button-tooltip-custom.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// "use strict";
|
||||
// var button_tooltip_custom = {
|
||||
// init: function() {
|
||||
// $("button").hover(function() {
|
||||
// var buttontooltiptext = $(this).attr("class");
|
||||
// $("button").attr("data-original-title", buttontooltiptext);
|
||||
// });
|
||||
// // $("button").tooltip();
|
||||
// $("a").tooltip();
|
||||
// $("input").tooltip();
|
||||
// }
|
||||
// };
|
||||
// (function($) {
|
||||
// "use strict";
|
||||
// button_tooltip_custom.init()
|
||||
// })(jQuery);
|
||||
447
public/assets/js/calendar/app.js
Normal file
447
public/assets/js/calendar/app.js
Normal file
@@ -0,0 +1,447 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable */
|
||||
/* eslint-env jquery */
|
||||
/* global moment, tui, chance */
|
||||
/* global findCalendar, CalendarList, ScheduleList, generateSchedule */
|
||||
|
||||
(function(window, Calendar) {
|
||||
var cal, resizeThrottled;
|
||||
var useCreationPopup = true;
|
||||
var useDetailPopup = true;
|
||||
var datePicker, selectedCalendar;
|
||||
|
||||
cal = new Calendar('#calendar', {
|
||||
defaultView: 'month',
|
||||
useCreationPopup: useCreationPopup,
|
||||
useDetailPopup: useDetailPopup,
|
||||
calendars: CalendarList,
|
||||
template: {
|
||||
milestone: function(model) {
|
||||
return '<span class="calendar-font-icon ic-milestone-b"></span> <span style="background-color: ' + model.bgColor + '">' + model.title + '</span>';
|
||||
},
|
||||
allday: function(schedule) {
|
||||
return getTimeTemplate(schedule, true);
|
||||
},
|
||||
time: function(schedule) {
|
||||
return getTimeTemplate(schedule, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// event handlers
|
||||
cal.on({
|
||||
'clickMore': function(e) {
|
||||
console.log('clickMore', e);
|
||||
},
|
||||
'clickSchedule': function(e) {
|
||||
console.log('clickSchedule', e);
|
||||
},
|
||||
'clickDayname': function(date) {
|
||||
console.log('clickDayname', date);
|
||||
},
|
||||
'beforeCreateSchedule': function(e) {
|
||||
console.log('beforeCreateSchedule', e);
|
||||
saveNewSchedule(e);
|
||||
},
|
||||
'beforeUpdateSchedule': function(e) {
|
||||
var schedule = e.schedule;
|
||||
var changes = e.changes;
|
||||
|
||||
console.log('beforeUpdateSchedule', e);
|
||||
|
||||
if (changes && !changes.isAllDay && schedule.category === 'allday') {
|
||||
changes.category = 'time';
|
||||
}
|
||||
|
||||
cal.updateSchedule(schedule.id, schedule.calendarId, changes);
|
||||
refreshScheduleVisibility();
|
||||
},
|
||||
'beforeDeleteSchedule': function(e) {
|
||||
console.log('beforeDeleteSchedule', e);
|
||||
cal.deleteSchedule(e.schedule.id, e.schedule.calendarId);
|
||||
},
|
||||
'afterRenderSchedule': function(e) {
|
||||
var schedule = e.schedule;
|
||||
// var element = cal.getElement(schedule.id, schedule.calendarId);
|
||||
// console.log('afterRenderSchedule', element);
|
||||
},
|
||||
'clickTimezonesCollapseBtn': function(timezonesCollapsed) {
|
||||
console.log('timezonesCollapsed', timezonesCollapsed);
|
||||
|
||||
if (timezonesCollapsed) {
|
||||
cal.setTheme({
|
||||
'week.daygridLeft.width': '77px',
|
||||
'week.timegridLeft.width': '77px'
|
||||
});
|
||||
} else {
|
||||
cal.setTheme({
|
||||
'week.daygridLeft.width': '60px',
|
||||
'week.timegridLeft.width': '60px'
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Get time template for time and all-day
|
||||
* @param {Schedule} schedule - schedule
|
||||
* @param {boolean} isAllDay - isAllDay or hasMultiDates
|
||||
* @returns {string}
|
||||
*/
|
||||
function getTimeTemplate(schedule, isAllDay) {
|
||||
var html = [];
|
||||
var start = moment(schedule.start.toUTCString());
|
||||
if (!isAllDay) {
|
||||
html.push('<strong>' + start.format('HH:mm') + '</strong> ');
|
||||
}
|
||||
if (schedule.isPrivate) {
|
||||
html.push('<span class="calendar-font-icon ic-lock-b"></span>');
|
||||
html.push(' Private');
|
||||
} else {
|
||||
if (schedule.isReadOnly) {
|
||||
html.push('<span class="calendar-font-icon ic-readonly-b"></span>');
|
||||
} else if (schedule.recurrenceRule) {
|
||||
html.push('<span class="calendar-font-icon ic-repeat-b"></span>');
|
||||
} else if (schedule.attendees.length) {
|
||||
html.push('<span class="calendar-font-icon ic-user-b"></span>');
|
||||
} else if (schedule.location) {
|
||||
html.push('<span class="calendar-font-icon ic-location-b"></span>');
|
||||
}
|
||||
html.push(' ' + schedule.title);
|
||||
}
|
||||
|
||||
return html.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* A listener for click the menu
|
||||
* @param {Event} e - click event
|
||||
*/
|
||||
function onClickMenu(e) {
|
||||
var target = $(e.target).closest('a[role="menuitem"]')[0];
|
||||
var action = getDataAction(target);
|
||||
var options = cal.getOptions();
|
||||
var viewName = '';
|
||||
|
||||
console.log(target);
|
||||
console.log(action);
|
||||
switch (action) {
|
||||
case 'toggle-daily':
|
||||
viewName = 'day';
|
||||
break;
|
||||
case 'toggle-weekly':
|
||||
viewName = 'week';
|
||||
break;
|
||||
case 'toggle-monthly':
|
||||
options.month.visibleWeeksCount = 0;
|
||||
viewName = 'month';
|
||||
break;
|
||||
case 'toggle-weeks2':
|
||||
options.month.visibleWeeksCount = 2;
|
||||
viewName = 'month';
|
||||
break;
|
||||
case 'toggle-weeks3':
|
||||
options.month.visibleWeeksCount = 3;
|
||||
viewName = 'month';
|
||||
break;
|
||||
case 'toggle-narrow-weekend':
|
||||
options.month.narrowWeekend = !options.month.narrowWeekend;
|
||||
options.week.narrowWeekend = !options.week.narrowWeekend;
|
||||
viewName = cal.getViewName();
|
||||
|
||||
target.querySelector('input').checked = options.month.narrowWeekend;
|
||||
break;
|
||||
case 'toggle-start-day-1':
|
||||
options.month.startDayOfWeek = options.month.startDayOfWeek ? 0 : 1;
|
||||
options.week.startDayOfWeek = options.week.startDayOfWeek ? 0 : 1;
|
||||
viewName = cal.getViewName();
|
||||
|
||||
target.querySelector('input').checked = options.month.startDayOfWeek;
|
||||
break;
|
||||
case 'toggle-workweek':
|
||||
options.month.workweek = !options.month.workweek;
|
||||
options.week.workweek = !options.week.workweek;
|
||||
viewName = cal.getViewName();
|
||||
|
||||
target.querySelector('input').checked = !options.month.workweek;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
cal.setOptions(options, true);
|
||||
cal.changeView(viewName, true);
|
||||
|
||||
setDropdownCalendarType();
|
||||
setRenderRangeText();
|
||||
setSchedules();
|
||||
}
|
||||
|
||||
function onClickNavi(e) {
|
||||
var action = getDataAction(e.target);
|
||||
|
||||
switch (action) {
|
||||
case 'move-prev':
|
||||
cal.prev();
|
||||
break;
|
||||
case 'move-next':
|
||||
cal.next();
|
||||
break;
|
||||
case 'move-today':
|
||||
cal.today();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
setRenderRangeText();
|
||||
setSchedules();
|
||||
}
|
||||
|
||||
function onNewSchedule() {
|
||||
var title = $('#new-schedule-title').val();
|
||||
var location = $('#new-schedule-location').val();
|
||||
var isAllDay = document.getElementById('new-schedule-allday').checked;
|
||||
var start = datePicker.getStartDate();
|
||||
var end = datePicker.getEndDate();
|
||||
var calendar = selectedCalendar ? selectedCalendar : CalendarList[0];
|
||||
|
||||
if (!title) {
|
||||
return;
|
||||
}
|
||||
|
||||
cal.createSchedules([{
|
||||
id: String(chance.guid()),
|
||||
calendarId: calendar.id,
|
||||
title: title,
|
||||
isAllDay: isAllDay,
|
||||
start: start,
|
||||
end: end,
|
||||
category: isAllDay ? 'allday' : 'time',
|
||||
dueDateClass: '',
|
||||
color: calendar.color,
|
||||
bgColor: calendar.bgColor,
|
||||
dragBgColor: calendar.bgColor,
|
||||
borderColor: calendar.borderColor,
|
||||
raw: {
|
||||
location: location
|
||||
},
|
||||
state: 'Busy'
|
||||
}]);
|
||||
|
||||
$('#modal-new-schedule').modal('hide');
|
||||
}
|
||||
|
||||
function onChangeNewScheduleCalendar(e) {
|
||||
var target = $(e.target).closest('a[role="menuitem"]')[0];
|
||||
var calendarId = getDataAction(target);
|
||||
changeNewScheduleCalendar(calendarId);
|
||||
}
|
||||
|
||||
function changeNewScheduleCalendar(calendarId) {
|
||||
var calendarNameElement = document.getElementById('calendarName');
|
||||
var calendar = findCalendar(calendarId);
|
||||
var html = [];
|
||||
|
||||
html.push('<span class="calendar-bar" style="background-color: ' + calendar.bgColor + '; border-color:' + calendar.borderColor + ';"></span>');
|
||||
html.push('<span class="calendar-name">' + calendar.name + '</span>');
|
||||
|
||||
calendarNameElement.innerHTML = html.join('');
|
||||
|
||||
selectedCalendar = calendar;
|
||||
}
|
||||
|
||||
function createNewSchedule(event) {
|
||||
var start = event.start ? new Date(event.start.getTime()) : new Date();
|
||||
var end = event.end ? new Date(event.end.getTime()) : moment().add(1, 'hours').toDate();
|
||||
|
||||
if (useCreationPopup) {
|
||||
cal.openCreationPopup({
|
||||
start: start,
|
||||
end: end
|
||||
});
|
||||
}
|
||||
}
|
||||
function saveNewSchedule(scheduleData) {
|
||||
var calendar = scheduleData.calendar || findCalendar(scheduleData.calendarId);
|
||||
var schedule = {
|
||||
id: String(chance.guid()),
|
||||
title: scheduleData.title,
|
||||
isAllDay: scheduleData.isAllDay,
|
||||
start: scheduleData.start,
|
||||
end: scheduleData.end,
|
||||
category: scheduleData.isAllDay ? 'allday' : 'time',
|
||||
dueDateClass: '',
|
||||
color: calendar.color,
|
||||
bgColor: calendar.bgColor,
|
||||
dragBgColor: calendar.bgColor,
|
||||
borderColor: calendar.borderColor,
|
||||
location: scheduleData.location,
|
||||
raw: {
|
||||
class: scheduleData.raw['class']
|
||||
},
|
||||
state: scheduleData.state
|
||||
};
|
||||
if (calendar) {
|
||||
schedule.calendarId = calendar.id;
|
||||
schedule.color = calendar.color;
|
||||
schedule.bgColor = calendar.bgColor;
|
||||
schedule.borderColor = calendar.borderColor;
|
||||
}
|
||||
|
||||
cal.createSchedules([schedule]);
|
||||
|
||||
refreshScheduleVisibility();
|
||||
}
|
||||
|
||||
function onChangeCalendars(e) {
|
||||
var calendarId = e.target.value;
|
||||
var checked = e.target.checked;
|
||||
var viewAll = document.querySelector('.lnb-calendars-item input');
|
||||
var calendarElements = Array.prototype.slice.call(document.querySelectorAll('#calendarList input'));
|
||||
var allCheckedCalendars = true;
|
||||
|
||||
if (calendarId === 'all') {
|
||||
allCheckedCalendars = checked;
|
||||
|
||||
calendarElements.forEach(function(input) {
|
||||
var span = input.parentNode;
|
||||
input.checked = checked;
|
||||
span.style.backgroundColor = checked ? span.style.borderColor : 'transparent';
|
||||
});
|
||||
|
||||
CalendarList.forEach(function(calendar) {
|
||||
calendar.checked = checked;
|
||||
});
|
||||
} else {
|
||||
findCalendar(calendarId).checked = checked;
|
||||
|
||||
allCheckedCalendars = calendarElements.every(function(input) {
|
||||
return input.checked;
|
||||
});
|
||||
|
||||
if (allCheckedCalendars) {
|
||||
viewAll.checked = true;
|
||||
} else {
|
||||
viewAll.checked = false;
|
||||
}
|
||||
}
|
||||
refreshScheduleVisibility();
|
||||
}
|
||||
function refreshScheduleVisibility() {
|
||||
var calendarElements = Array.prototype.slice.call(document.querySelectorAll('#calendarList input'));
|
||||
CalendarList.forEach(function(calendar) {
|
||||
cal.toggleSchedules(calendar.id, !calendar.checked, false);
|
||||
});
|
||||
cal.render(true);
|
||||
calendarElements.forEach(function(input) {
|
||||
var span = input.nextElementSibling;
|
||||
span.style.backgroundColor = input.checked ? span.style.borderColor : 'transparent';
|
||||
});
|
||||
}
|
||||
function setDropdownCalendarType() {
|
||||
var calendarTypeName = document.getElementById('calendarTypeName');
|
||||
var calendarTypeIcon = document.getElementById('calendarTypeIcon');
|
||||
var options = cal.getOptions();
|
||||
var type = cal.getViewName();
|
||||
var iconClassName;
|
||||
if (type === 'month') {
|
||||
type = 'Monthly';
|
||||
iconClassName = 'calendar-icon fa fa-th';
|
||||
} else if (type === 'week') {
|
||||
type = 'Weekly';
|
||||
iconClassName = 'calendar-icon fa fa-th-large';
|
||||
} else if (options.month.visibleWeeksCount === 2) {
|
||||
type = '2 weeks';
|
||||
iconClassName = 'calendar-icon fa fa-th-large';
|
||||
} else if (options.month.visibleWeeksCount === 3) {
|
||||
type = '3 weeks';
|
||||
iconClassName = 'calendar-icon fa fa-th-large';
|
||||
} else{
|
||||
type = 'Daily';
|
||||
iconClassName = 'calendar-icon fa fa-bars';
|
||||
}
|
||||
|
||||
calendarTypeName.innerHTML = type;
|
||||
calendarTypeIcon.className = iconClassName;
|
||||
}
|
||||
|
||||
function currentCalendarDate(format) {
|
||||
var currentDate = moment([cal.getDate().getFullYear(), cal.getDate().getMonth(), cal.getDate().getDate()]);
|
||||
|
||||
return currentDate.format(format);
|
||||
}
|
||||
|
||||
function setRenderRangeText() {
|
||||
var renderRange = document.getElementById('renderRange');
|
||||
var options = cal.getOptions();
|
||||
var viewName = cal.getViewName();
|
||||
|
||||
var html = [];
|
||||
if (viewName === 'day') {
|
||||
html.push(currentCalendarDate('YYYY.MM.DD'));
|
||||
} else if (viewName === 'month' &&
|
||||
(!options.month.visibleWeeksCount || options.month.visibleWeeksCount > 4)) {
|
||||
html.push(currentCalendarDate('YYYY.MM'));
|
||||
} else {
|
||||
html.push(moment(cal.getDateRangeStart().getTime()).format('YYYY.MM.DD'));
|
||||
html.push(' ~ ');
|
||||
html.push(moment(cal.getDateRangeEnd().getTime()).format(' MM.DD'));
|
||||
}
|
||||
renderRange.innerHTML = html.join('');
|
||||
}
|
||||
|
||||
function setSchedules() {
|
||||
cal.clear();
|
||||
generateSchedule(cal.getViewName(), cal.getDateRangeStart(), cal.getDateRangeEnd());
|
||||
cal.createSchedules(ScheduleList);
|
||||
|
||||
refreshScheduleVisibility();
|
||||
}
|
||||
|
||||
function setEventListener() {
|
||||
$('#menu-navi').on('click', onClickNavi);
|
||||
$('.dropdown-menu a[role="menuitem"]').on('click', onClickMenu);
|
||||
$('#lnb-calendars').on('change', onChangeCalendars);
|
||||
|
||||
$('#btn-save-schedule').on('click', onNewSchedule);
|
||||
$('#btn-new-schedule').on('click', createNewSchedule);
|
||||
|
||||
$('#dropdownMenu-calendars-list').on('click', onChangeNewScheduleCalendar);
|
||||
|
||||
window.addEventListener('resize', resizeThrottled);
|
||||
}
|
||||
|
||||
function getDataAction(target) {
|
||||
return target.dataset ? target.dataset.action : target.getAttribute('data-action');
|
||||
}
|
||||
|
||||
resizeThrottled = tui.util.throttle(function() {
|
||||
cal.render();
|
||||
}, 50);
|
||||
|
||||
window.cal = cal;
|
||||
|
||||
setDropdownCalendarType();
|
||||
setRenderRangeText();
|
||||
setSchedules();
|
||||
setEventListener();
|
||||
})(window, tui.Calendar);
|
||||
|
||||
// set calendars
|
||||
(function() {
|
||||
var calendarList = document.getElementById('calendarList');
|
||||
var html = [];
|
||||
CalendarList.forEach(function(calendar) {
|
||||
html.push('<div class="lnb-calendars-item"><label>' +
|
||||
'<input type="checkbox" class="tui-full-calendar-checkbox-round" value="' + calendar.id + '" checked>' +
|
||||
'<span style="border-color: ' + calendar.borderColor + '; background-color: ' + calendar.borderColor + ';"></span>' +
|
||||
'<span>' + calendar.name + '</span>' +
|
||||
'</label></div>'
|
||||
);
|
||||
});
|
||||
calendarList.innerHTML = html.join('\n');
|
||||
})();
|
||||
127
public/assets/js/calendar/calendars.js
Normal file
127
public/assets/js/calendar/calendars.js
Normal file
@@ -0,0 +1,127 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint-disable require-jsdoc, no-unused-vars */
|
||||
|
||||
var CalendarList = [];
|
||||
|
||||
function CalendarInfo() {
|
||||
this.id = null;
|
||||
this.name = null;
|
||||
this.checked = true;
|
||||
this.color = null;
|
||||
this.bgColor = null;
|
||||
this.borderColor = null;
|
||||
this.dragBgColor = null;
|
||||
}
|
||||
|
||||
function addCalendar(calendar) {
|
||||
CalendarList.push(calendar);
|
||||
}
|
||||
|
||||
function findCalendar(id) {
|
||||
var found;
|
||||
|
||||
CalendarList.forEach(function(calendar) {
|
||||
if (calendar.id === id) {
|
||||
found = calendar;
|
||||
}
|
||||
});
|
||||
|
||||
return found || CalendarList[0];
|
||||
}
|
||||
|
||||
function hexToRGBA(hex) {
|
||||
var radix = 16;
|
||||
var r = parseInt(hex.slice(1, 3), radix),
|
||||
g = parseInt(hex.slice(3, 5), radix),
|
||||
b = parseInt(hex.slice(5, 7), radix),
|
||||
a = parseInt(hex.slice(7, 9), radix) / 255 || 1;
|
||||
var rgba = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + a + ')';
|
||||
|
||||
return rgba;
|
||||
}
|
||||
|
||||
(function() {
|
||||
var calendar;
|
||||
var id = 0;
|
||||
|
||||
calendar = new CalendarInfo();
|
||||
id += 1;
|
||||
calendar.id = String(id);
|
||||
calendar.name = 'My Calendar';
|
||||
calendar.color = '#ffffff';
|
||||
calendar.bgColor = '#24695c';
|
||||
calendar.dragBgColor = '#24695c';
|
||||
calendar.borderColor = '#24695c';
|
||||
addCalendar(calendar);
|
||||
|
||||
calendar = new CalendarInfo();
|
||||
id += 1;
|
||||
calendar.id = String(id);
|
||||
calendar.name = 'Company';
|
||||
calendar.color = '#ffffff';
|
||||
calendar.bgColor = '#ba895d';
|
||||
calendar.dragBgColor = '#ba895d';
|
||||
calendar.borderColor = '#ba895d';
|
||||
addCalendar(calendar);
|
||||
|
||||
calendar = new CalendarInfo();
|
||||
id += 1;
|
||||
calendar.id = String(id);
|
||||
calendar.name = 'Family';
|
||||
calendar.color = '#ffffff';
|
||||
calendar.bgColor = '#ff5583';
|
||||
calendar.dragBgColor = '#ff5583';
|
||||
calendar.borderColor = '#ff5583';
|
||||
addCalendar(calendar);
|
||||
|
||||
calendar = new CalendarInfo();
|
||||
id += 1;
|
||||
calendar.id = String(id);
|
||||
calendar.name = 'Friend';
|
||||
calendar.color = '#ffffff';
|
||||
calendar.bgColor = '#03bd9e';
|
||||
calendar.dragBgColor = '#03bd9e';
|
||||
calendar.borderColor = '#03bd9e';
|
||||
addCalendar(calendar);
|
||||
|
||||
calendar = new CalendarInfo();
|
||||
id += 1;
|
||||
calendar.id = String(id);
|
||||
calendar.name = 'Travel';
|
||||
calendar.color = '#ffffff';
|
||||
calendar.bgColor = '#1b4c43';
|
||||
calendar.dragBgColor = '#1b4c43';
|
||||
calendar.borderColor = '#1b4c43';
|
||||
addCalendar(calendar);
|
||||
|
||||
calendar = new CalendarInfo();
|
||||
id += 1;
|
||||
calendar.id = String(id);
|
||||
calendar.name = 'etc';
|
||||
calendar.color = '#ffffff';
|
||||
calendar.bgColor = '#9d9d9d';
|
||||
calendar.dragBgColor = '#9d9d9d';
|
||||
calendar.borderColor = '#9d9d9d';
|
||||
addCalendar(calendar);
|
||||
|
||||
calendar = new CalendarInfo();
|
||||
id += 1;
|
||||
calendar.id = String(id);
|
||||
calendar.name = 'Birthdays';
|
||||
calendar.color = '#ffffff';
|
||||
calendar.bgColor = '#e2c636';
|
||||
calendar.dragBgColor = '#e2c636';
|
||||
calendar.borderColor = '#e2c636';
|
||||
addCalendar(calendar);
|
||||
|
||||
calendar = new CalendarInfo();
|
||||
id += 1;
|
||||
calendar.id = String(id);
|
||||
calendar.name = 'National Holidays';
|
||||
calendar.color = '#ffffff';
|
||||
calendar.bgColor = '#d22d3d';
|
||||
calendar.dragBgColor = '#d22d3d';
|
||||
calendar.borderColor = '#d22d3d';
|
||||
addCalendar(calendar);
|
||||
})();
|
||||
2
public/assets/js/calendar/chance.min.js
vendored
Normal file
2
public/assets/js/calendar/chance.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
644
public/assets/js/calendar/fullcalendar-custom.js
Normal file
644
public/assets/js/calendar/fullcalendar-custom.js
Normal file
@@ -0,0 +1,644 @@
|
||||
"use strict";
|
||||
var basic_calendar = {
|
||||
init: function() {
|
||||
$('#cal-basic').fullCalendar({
|
||||
defaultDate: '2016-06-12',
|
||||
editable: true,
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
droppable: true,
|
||||
eventLimit: true,
|
||||
select: function(start, end, allDay) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
$('#cal-basic').fullCalendar('renderEvent',
|
||||
{
|
||||
title: title,
|
||||
start: start._d,
|
||||
end: end._d,
|
||||
allDay: allDay
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
$('#cal-basic').fullCalendar('unselect');
|
||||
},
|
||||
events: [
|
||||
{
|
||||
title: 'All Day Event',
|
||||
start: '2016-06-01'
|
||||
},
|
||||
{
|
||||
title: 'Long Event',
|
||||
start: '2016-06-07',
|
||||
end: '2016-06-10'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2016-06-09T16:00:00'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2016-06-16T16:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Conference',
|
||||
start: '2016-06-11',
|
||||
end: '2016-06-13'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2016-06-12T10:30:00',
|
||||
end: '2016-06-12T12:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Lunch',
|
||||
start: '2016-06-12T12:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2016-06-12T14:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Happy Hour',
|
||||
start: '2016-06-12T17:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Dinner',
|
||||
start: '2016-06-12T20:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Birthday Party',
|
||||
start: '2016-06-13T07:00:00'
|
||||
}
|
||||
]
|
||||
}), $('#cal-basic-view').fullCalendar({
|
||||
header: {
|
||||
right: 'prev,next today',
|
||||
center: 'title',
|
||||
left: 'month,basicWeek,basicDay'
|
||||
},
|
||||
defaultDate: '2016-06-12',
|
||||
editable: true,
|
||||
droppable: true,
|
||||
eventLimit: true,
|
||||
select: function(start, end, allDay) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
$('#cal-basic-view').fullCalendar('renderEvent',
|
||||
{
|
||||
title: title,
|
||||
start: start._d,
|
||||
end: end._d,
|
||||
allDay: allDay
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
$('#cal-basic-view').fullCalendar('unselect');
|
||||
},
|
||||
events: [
|
||||
{
|
||||
title: 'All Day Event',
|
||||
start: '2016-06-01'
|
||||
},
|
||||
{
|
||||
title: 'Long Event',
|
||||
start: '2016-06-07',
|
||||
end: '2016-06-10'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2016-06-09T16:00:00'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2016-06-16T16:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Conference',
|
||||
start: '2016-06-11',
|
||||
end: '2016-06-13'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2016-06-12T10:30:00',
|
||||
end: '2016-06-12T12:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Lunch',
|
||||
start: '2016-06-12T12:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2016-06-12T14:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Happy Hour',
|
||||
start: '2016-06-12T17:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Dinner',
|
||||
start: '2016-06-12T20:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Birthday Party',
|
||||
start: '2016-06-13T07:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Click for Google',
|
||||
url: 'http://google.com/',
|
||||
start: '2016-06-28'
|
||||
}
|
||||
]
|
||||
}), $('#cal-agenda-view').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
defaultDate: '2016-06-12',
|
||||
defaultView: 'agendaWeek',
|
||||
editable: true,
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
droppable: true,
|
||||
eventLimit: true,
|
||||
select: function(start, end, allDay) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
$('#cal-agenda-view').fullCalendar('renderEvent',
|
||||
{
|
||||
title: title,
|
||||
start: start._d,
|
||||
end: end._d,
|
||||
allDay: allDay
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
$('#cal-agenda-view').fullCalendar('unselect');
|
||||
},
|
||||
events: [
|
||||
{
|
||||
title: 'All Day Event',
|
||||
start: '2016-06-01'
|
||||
},
|
||||
{
|
||||
title: 'Long Event',
|
||||
start: '2016-06-07',
|
||||
end: '2016-06-10'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2016-06-09T16:00:00'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2016-06-16T16:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Conference',
|
||||
start: '2016-06-11',
|
||||
end: '2016-06-13'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2016-06-12T10:30:00',
|
||||
end: '2016-06-12T12:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Lunch',
|
||||
start: '2016-06-12T12:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2016-06-12T14:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Happy Hour',
|
||||
start: '2016-06-12T17:30:00'
|
||||
},
|
||||
{
|
||||
title: 'Dinner',
|
||||
start: '2016-06-12T20:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Birthday Party',
|
||||
start: '2016-06-13T07:00:00'
|
||||
},
|
||||
{
|
||||
title: 'Click for Google',
|
||||
url: 'http://google.com/',
|
||||
start: '2016-06-28'
|
||||
}
|
||||
]
|
||||
}), $('#cal-bg-events').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
defaultDate: '2018-02-03',
|
||||
businessHours: true,
|
||||
editable: true,
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
droppable: true,
|
||||
eventLimit: true,
|
||||
select: function(start, end, allDay) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
$('#cal-bg-events').fullCalendar('renderEvent',
|
||||
{
|
||||
title: title,
|
||||
start: start._d,
|
||||
end: end._d,
|
||||
allDay: allDay
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
$('#cal-bg-events').fullCalendar('unselect');
|
||||
},
|
||||
events: [
|
||||
{
|
||||
title: 'Business Lunch',
|
||||
start: '2018-02-03T16:00:00',
|
||||
constraint: 'businessHours'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2018-02-13T11:00:00',
|
||||
constraint: 'availableForMeeting',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
title: 'Conference',
|
||||
start: '2018-02-18',
|
||||
end: '2016-06-20'
|
||||
},
|
||||
{
|
||||
title: 'Party',
|
||||
start: '2018-02-28T20:00:00'
|
||||
},
|
||||
{
|
||||
id: 'availableForMeeting',
|
||||
start: '2018-02-11T10:00:00',
|
||||
end: '2016-02-11T16:00:00',
|
||||
rendering: 'background'
|
||||
},
|
||||
{
|
||||
id: 'availableForMeeting',
|
||||
start: '2018-02-13T10:00:00',
|
||||
end: '2018-02-13T16:00:00',
|
||||
rendering: 'background'
|
||||
},
|
||||
{
|
||||
start: '2018-02-24',
|
||||
end: '2018-02-28',
|
||||
overlap: false,
|
||||
rendering: 'background',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
start: '2018-02-06',
|
||||
end: '2018-02-08',
|
||||
overlap: false,
|
||||
rendering: 'background',
|
||||
color: '#ba895d'
|
||||
}
|
||||
]
|
||||
}), $('#cal-event-colors').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
defaultDate: '2016-06-12',
|
||||
businessHours: true,
|
||||
editable: true,
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
droppable: true,
|
||||
eventLimit: true,
|
||||
select: function(start, end, allDay) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
$('#cal-event-colors').fullCalendar('renderEvent',
|
||||
{
|
||||
title: title,
|
||||
start: start._d,
|
||||
end: end._d,
|
||||
allDay: allDay
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
$('#cal-event-colors').fullCalendar('unselect');
|
||||
},
|
||||
events: [
|
||||
{
|
||||
title: 'All Day Event',
|
||||
start: '2016-06-01',
|
||||
color: '#24695c'
|
||||
},
|
||||
{
|
||||
title: 'Long Event',
|
||||
start: '2016-06-07',
|
||||
end: '2016-06-10',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2016-06-09T16:00:00',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2016-06-16T16:00:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Conference',
|
||||
start: '2016-06-11',
|
||||
end: '2016-06-13',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2016-06-12T10:30:00',
|
||||
end: '2016-06-12T12:30:00',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
title: 'Lunch',
|
||||
start: '2016-06-12T12:00:00',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2016-06-12T14:30:00',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
title: 'Happy Hour',
|
||||
start: '2016-06-12T17:30:00',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
title: 'Dinner',
|
||||
start: '2016-06-12T20:00:00',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
title: 'Birthday Party',
|
||||
start: '2016-06-13T07:00:00',
|
||||
color: '#ba895d'
|
||||
},
|
||||
{
|
||||
title: 'Click for Google',
|
||||
url: 'http://google.com/',
|
||||
start: '2016-06-28',
|
||||
color: '#22af47'
|
||||
}
|
||||
]
|
||||
}), $('#external-events .fc-event').each(function() {
|
||||
$(this).css({'backgroundColor': $(this).data('color'), 'borderColor': $(this).data('color')});
|
||||
$(this).data('event', {
|
||||
title: $.trim($(this).text()),
|
||||
color: $(this).data('color'),
|
||||
stick: true
|
||||
});
|
||||
$(this).draggable({
|
||||
zIndex: 999,
|
||||
revert: true,
|
||||
revertDuration: 0
|
||||
});
|
||||
}), $('#fc-external-drag').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
editable: true,
|
||||
defaultDate: '2018-06-12',
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
droppable: true,
|
||||
eventLimit: true,
|
||||
select: function(start, end, allDay) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
$('#fc-external-drag').fullCalendar('renderEvent',
|
||||
{
|
||||
title: title,
|
||||
start: start._d,
|
||||
end: end._d,
|
||||
allDay: allDay
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
$('#fc-external-drag').fullCalendar('unselect');
|
||||
},
|
||||
events: [
|
||||
{
|
||||
title: 'All Day Event',
|
||||
start: '2018-06-01',
|
||||
color: '#24695c'
|
||||
},
|
||||
{
|
||||
title: 'Long Event',
|
||||
start: '2018-06-07',
|
||||
end: '2018-06-10',
|
||||
color: '#22af47'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2018-06-09T16:00:00',
|
||||
color: '#22af47'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2018-06-16T16:00:00',
|
||||
color: '#ff9f40'
|
||||
},
|
||||
{
|
||||
title: 'Conference',
|
||||
start: '2018-06-11',
|
||||
end: '2018-06-13',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2018-06-12T10:30:00',
|
||||
end: '2018-06-12T12:30:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Lunch',
|
||||
start: '2018-06-12T12:00:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2018-06-12T14:30:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Happy Hour',
|
||||
start: '2018-06-12T17:30:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Dinner',
|
||||
start: '2018-06-12T20:00:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Birthday Party',
|
||||
start: '2018-06-13T07:00:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Click for Google',
|
||||
url: 'http://google.com/',
|
||||
start: '2018-06-28',
|
||||
color: '#ba895d'
|
||||
}
|
||||
],
|
||||
drop: function() {
|
||||
if ($('#drop-remove').is(':checked')) {
|
||||
$(this).remove();
|
||||
}
|
||||
}
|
||||
}), $('#external-events .fc-event').each(function() {
|
||||
$(this).css({'backgroundColor': $(this).data('color'), 'borderColor': $(this).data('color')});
|
||||
$(this).data('event', {
|
||||
title: $.trim($(this).text()),
|
||||
color: $(this).data('color'),
|
||||
stick: true
|
||||
});
|
||||
$(this).draggable({
|
||||
zIndex: 999,
|
||||
revert: true,
|
||||
revertDuration: 0
|
||||
});
|
||||
}), $('#fc-external-drag').fullCalendar({
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'month,agendaWeek,agendaDay'
|
||||
},
|
||||
editable: true,
|
||||
defaultDate: '2018-06-12',
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
droppable: true,
|
||||
eventLimit: true,
|
||||
select: function(start, end, allDay) {
|
||||
var title = prompt('Event Title:');
|
||||
if (title) {
|
||||
$('#fc-external-drag').fullCalendar('renderEvent',
|
||||
{
|
||||
title: title,
|
||||
start: start._d,
|
||||
end: end._d,
|
||||
allDay: allDay
|
||||
},
|
||||
true
|
||||
);
|
||||
}
|
||||
$('#fc-external-drag').fullCalendar('unselect');
|
||||
},
|
||||
events: [
|
||||
{
|
||||
title: 'All Day Event',
|
||||
start: '2018-06-01',
|
||||
color: '#24695c'
|
||||
},
|
||||
{
|
||||
title: 'Long Event',
|
||||
start: '2018-06-07',
|
||||
end: '2018-06-10',
|
||||
color: '#22af47'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2018-06-09T16:00:00',
|
||||
color: '#22af47'
|
||||
},
|
||||
{
|
||||
id: 999,
|
||||
title: 'Repeating Event',
|
||||
start: '2018-06-16T16:00:00',
|
||||
color: '#ff9f40'
|
||||
},
|
||||
{
|
||||
title: 'Conference',
|
||||
start: '2018-06-11',
|
||||
end: '2018-06-13',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2018-06-12T10:30:00',
|
||||
end: '2018-06-12T12:30:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Lunch',
|
||||
start: '2018-06-12T12:00:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Meeting',
|
||||
start: '2018-06-12T14:30:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Happy Hour',
|
||||
start: '2018-06-12T17:30:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Dinner',
|
||||
start: '2018-06-12T20:00:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Birthday Party',
|
||||
start: '2018-06-13T07:00:00',
|
||||
color: '#FF5370'
|
||||
},
|
||||
{
|
||||
title: 'Click for Google',
|
||||
url: 'http://google.com/',
|
||||
start: '2018-06-28',
|
||||
color: '#ba895d'
|
||||
}
|
||||
],
|
||||
drop: function() {
|
||||
if ($('#drop-remove').is(':checked')) {
|
||||
$(this).remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
(function($) {
|
||||
"use strict";
|
||||
basic_calendar.init()
|
||||
})(jQuery);
|
||||
8
public/assets/js/calendar/fullcalendar.min.js
vendored
Normal file
8
public/assets/js/calendar/fullcalendar.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
14
public/assets/js/calendar/inital.js
Normal file
14
public/assets/js/calendar/inital.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// (function($) {
|
||||
// "use strict";
|
||||
// var cal = new tui.Calendar('#calendar-monthly', {
|
||||
// defaultView: 'month' // monthly view option
|
||||
// });
|
||||
|
||||
|
||||
// var cal = new tui.Calendar('#calendar', {
|
||||
// defaultView: 'week' // weekly view option
|
||||
// });
|
||||
|
||||
|
||||
// })(jQuery);
|
||||
|
||||
1
public/assets/js/calendar/moment.min.js
vendored
Normal file
1
public/assets/js/calendar/moment.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
165
public/assets/js/calendar/schedules.js
Normal file
165
public/assets/js/calendar/schedules.js
Normal file
@@ -0,0 +1,165 @@
|
||||
'use strict';
|
||||
|
||||
/*eslint-disable*/
|
||||
|
||||
var ScheduleList = [];
|
||||
|
||||
var SCHEDULE_CATEGORY = [
|
||||
'milestone',
|
||||
'task'
|
||||
];
|
||||
|
||||
function ScheduleInfo() {
|
||||
this.id = null;
|
||||
this.calendarId = null;
|
||||
|
||||
this.title = null;
|
||||
this.body = null;
|
||||
this.isAllday = false;
|
||||
this.start = null;
|
||||
this.end = null;
|
||||
this.category = '';
|
||||
this.dueDateClass = '';
|
||||
|
||||
this.color = null;
|
||||
this.bgColor = null;
|
||||
this.dragBgColor = null;
|
||||
this.borderColor = null;
|
||||
this.customStyle = '';
|
||||
|
||||
this.isFocused = false;
|
||||
this.isPending = false;
|
||||
this.isVisible = true;
|
||||
this.isReadOnly = false;
|
||||
this.goingDuration = 0;
|
||||
this.comingDuration = 0;
|
||||
this.recurrenceRule = '';
|
||||
this.state = '';
|
||||
|
||||
this.raw = {
|
||||
memo: '',
|
||||
hasToOrCc: false,
|
||||
hasRecurrenceRule: false,
|
||||
location: null,
|
||||
class: 'public', // or 'private'
|
||||
creator: {
|
||||
name: '',
|
||||
avatar: '',
|
||||
company: '',
|
||||
email: '',
|
||||
phone: ''
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function generateTime(schedule, renderStart, renderEnd) {
|
||||
var startDate = moment(renderStart.getTime())
|
||||
var endDate = moment(renderEnd.getTime());
|
||||
var diffDate = endDate.diff(startDate, 'days');
|
||||
|
||||
schedule.isAllday = chance.bool({likelihood: 30});
|
||||
if (schedule.isAllday) {
|
||||
schedule.category = 'allday';
|
||||
} else if (chance.bool({likelihood: 30})) {
|
||||
schedule.category = SCHEDULE_CATEGORY[chance.integer({min: 0, max: 1})];
|
||||
if (schedule.category === SCHEDULE_CATEGORY[1]) {
|
||||
schedule.dueDateClass = 'morning';
|
||||
}
|
||||
} else {
|
||||
schedule.category = 'time';
|
||||
}
|
||||
|
||||
startDate.add(chance.integer({min: 0, max: diffDate}), 'days');
|
||||
startDate.hours(chance.integer({min: 0, max: 23}))
|
||||
startDate.minutes(chance.bool() ? 0 : 30);
|
||||
schedule.start = startDate.toDate();
|
||||
|
||||
endDate = moment(startDate);
|
||||
if (schedule.isAllday) {
|
||||
endDate.add(chance.integer({min: 0, max: 3}), 'days');
|
||||
}
|
||||
|
||||
schedule.end = endDate
|
||||
.add(chance.integer({min: 1, max: 4}), 'hour')
|
||||
.toDate();
|
||||
|
||||
if (!schedule.isAllday && chance.bool({likelihood: 20})) {
|
||||
schedule.goingDuration = chance.integer({min: 30, max: 120});
|
||||
schedule.comingDuration = chance.integer({min: 30, max: 120});;
|
||||
|
||||
if (chance.bool({likelihood: 50})) {
|
||||
schedule.end = schedule.start;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function generateNames() {
|
||||
var names = [];
|
||||
var i = 0;
|
||||
var length = chance.integer({min: 1, max: 10});
|
||||
|
||||
for (; i < length; i += 1) {
|
||||
names.push(chance.name());
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
function generateRandomSchedule(calendar, renderStart, renderEnd) {
|
||||
var schedule = new ScheduleInfo();
|
||||
|
||||
schedule.id = chance.guid();
|
||||
schedule.calendarId = calendar.id;
|
||||
|
||||
schedule.title = chance.sentence({words: 3});
|
||||
schedule.body = chance.bool({likelihood: 20}) ? chance.sentence({words: 10}) : '';
|
||||
schedule.isReadOnly = chance.bool({likelihood: 20});
|
||||
generateTime(schedule, renderStart, renderEnd);
|
||||
|
||||
schedule.isPrivate = chance.bool({likelihood: 10});
|
||||
schedule.location = chance.address();
|
||||
schedule.attendees = chance.bool({likelihood: 70}) ? generateNames() : [];
|
||||
schedule.recurrenceRule = chance.bool({likelihood: 20}) ? 'repeated events' : '';
|
||||
schedule.state = chance.bool({likelihood: 20}) ? 'Free' : 'Busy';
|
||||
schedule.color = calendar.color;
|
||||
schedule.bgColor = calendar.bgColor;
|
||||
schedule.dragBgColor = calendar.dragBgColor;
|
||||
schedule.borderColor = calendar.borderColor;
|
||||
|
||||
if (schedule.category === 'milestone') {
|
||||
schedule.color = schedule.bgColor;
|
||||
schedule.bgColor = 'transparent';
|
||||
schedule.dragBgColor = 'transparent';
|
||||
schedule.borderColor = 'transparent';
|
||||
}
|
||||
|
||||
schedule.raw.memo = chance.sentence();
|
||||
schedule.raw.creator.name = chance.name();
|
||||
schedule.raw.creator.avatar = chance.avatar();
|
||||
schedule.raw.creator.company = chance.company();
|
||||
schedule.raw.creator.email = chance.email();
|
||||
schedule.raw.creator.phone = chance.phone();
|
||||
|
||||
if (chance.bool({ likelihood: 20 })) {
|
||||
var travelTime = chance.minute();
|
||||
schedule.goingDuration = travelTime;
|
||||
schedule.comingDuration = travelTime;
|
||||
}
|
||||
|
||||
ScheduleList.push(schedule);
|
||||
}
|
||||
|
||||
function generateSchedule(viewName, renderStart, renderEnd) {
|
||||
ScheduleList = [];
|
||||
CalendarList.forEach(function(calendar) {
|
||||
var i = 0, length = 10;
|
||||
if (viewName === 'month') {
|
||||
length = 3;
|
||||
} else if (viewName === 'day') {
|
||||
length = 4;
|
||||
}
|
||||
for (; i < length; i += 1) {
|
||||
generateRandomSchedule(calendar, renderStart, renderEnd);
|
||||
}
|
||||
});
|
||||
}
|
||||
27039
public/assets/js/calendar/tui-calendar.js
Normal file
27039
public/assets/js/calendar/tui-calendar.js
Normal file
File diff suppressed because one or more lines are too long
7
public/assets/js/calendar/tui-code-snippet.min.js
vendored
Normal file
7
public/assets/js/calendar/tui-code-snippet.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
public/assets/js/calendar/tui-date-picker.min.js
vendored
Normal file
7
public/assets/js/calendar/tui-date-picker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
public/assets/js/calendar/tui-time-picker.min.js
vendored
Normal file
7
public/assets/js/calendar/tui-time-picker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
777
public/assets/js/chart-widget.js
Normal file
777
public/assets/js/chart-widget.js
Normal file
@@ -0,0 +1,777 @@
|
||||
/*Line chart*/
|
||||
var optionslinechart = {
|
||||
chart: {
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
height: 170,
|
||||
type: 'area'
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
xaxis: {
|
||||
show: false,
|
||||
type: 'datetime',
|
||||
categories: ["2018-09-19T00:00:00", "2018-09-19T01:30:00", "2018-09-19T02:30:00", "2018-09-19T03:30:00", "2018-09-19T04:30:00", "2018-09-19T05:30:00", "2018-09-19T06:30:00"],
|
||||
labels: {
|
||||
show: false,
|
||||
},
|
||||
axisBorder: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
padding: {
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: -40
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'light',
|
||||
type: 'vertical',
|
||||
shadeIntensity: 0.4,
|
||||
inverseColors: false,
|
||||
opacityFrom: 0.8,
|
||||
opacityTo: 0.2,
|
||||
stops: [0, 100]
|
||||
},
|
||||
},
|
||||
colors: [vihoAdminConfig.primary],
|
||||
series: [{
|
||||
data: [1.2, 2.3, 1.7, 3.2, 1.8, 3.2, 1]
|
||||
}],
|
||||
tooltip: {
|
||||
x: {
|
||||
format: 'dd/MM/yy HH:mm'
|
||||
}
|
||||
}
|
||||
};
|
||||
var chartlinechart = new ApexCharts(document.querySelector("#chart-widget1"), optionslinechart);
|
||||
chartlinechart.render();
|
||||
|
||||
/*Line chart2*/
|
||||
var optionslinechart2 = {
|
||||
chart: {
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
height: 170,
|
||||
type: 'area'
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
xaxis: {
|
||||
show: false,
|
||||
type: 'datetime',
|
||||
categories: ["2018-09-19T00:00:00", "2018-09-19T01:30:00", "2018-09-19T02:30:00", "2018-09-19T03:30:00", "2018-09-19T04:30:00", "2018-09-19T05:30:00", "2018-09-19T06:30:00"],
|
||||
labels: {
|
||||
show: false,
|
||||
},
|
||||
axisBorder: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
padding: {
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: -40
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'light',
|
||||
type: 'vertical',
|
||||
shadeIntensity: 0.4,
|
||||
inverseColors: false,
|
||||
opacityFrom: 0.8,
|
||||
opacityTo: 0.2,
|
||||
stops: [0, 100]
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.secondary],
|
||||
series: [{
|
||||
name: 'series1',
|
||||
data: [12, 5, 10, 5, 16, 11, 20]
|
||||
}],
|
||||
tooltip: {
|
||||
x: {
|
||||
format: 'dd/MM/yy HH:mm'
|
||||
}
|
||||
}
|
||||
};
|
||||
var chartlinechart2 = new ApexCharts(document.querySelector("#chart-widget2"), optionslinechart2);
|
||||
chartlinechart2.render();
|
||||
|
||||
/*Line chart3*/
|
||||
var optionslinechart3 = {
|
||||
chart: {
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
height: 170,
|
||||
type: 'area'
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
xaxis: {
|
||||
show: false,
|
||||
type: 'datetime',
|
||||
categories: ["2018-09-19T00:00:00", "2018-09-19T01:30:00", "2018-09-19T02:30:00", "2018-09-19T03:30:00", "2018-09-19T04:30:00", "2018-09-19T05:30:00", "2018-09-19T06:30:00"],
|
||||
labels: {
|
||||
show: false,
|
||||
},
|
||||
axisBorder: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
padding: {
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: -40
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
colors: [vihoAdminConfig.primary],
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'light',
|
||||
type: 'vertical',
|
||||
shadeIntensity: 0.4,
|
||||
inverseColors: false,
|
||||
opacityFrom: 0.8,
|
||||
opacityTo: 0.2,
|
||||
stops: [0, 100]
|
||||
},
|
||||
},
|
||||
colors: [vihoAdminConfig.primary],
|
||||
series: [{
|
||||
data: [24, 55, 21, 67, 22, 43, 21]
|
||||
}],
|
||||
tooltip: {
|
||||
x: {
|
||||
format: 'dd/MM/yy HH:mm'
|
||||
}
|
||||
}
|
||||
};
|
||||
var chartlinechart3 = new ApexCharts(document.querySelector("#chart-widget3"), optionslinechart3);
|
||||
chartlinechart3.render();
|
||||
|
||||
// column chart
|
||||
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'Net Profit',
|
||||
data: [44, 55, 57, 56, 61, 58, 63, 60, 66]
|
||||
}, {
|
||||
name: 'Revenue',
|
||||
data: [76, 85, 101, 98, 87, 105, 91, 114, 94]
|
||||
} ],
|
||||
chart: {
|
||||
type: 'bar',
|
||||
height: 360
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: false,
|
||||
columnWidth: '55%',
|
||||
endingShape: 'rounded'
|
||||
},
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
show: true,
|
||||
width: 2,
|
||||
colors: ['transparent']
|
||||
},
|
||||
xaxis: {
|
||||
categories: ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'],
|
||||
},
|
||||
yaxis: {
|
||||
title: {
|
||||
text: '$ (thousands)'
|
||||
}
|
||||
},
|
||||
|
||||
fill: {
|
||||
opacity: 1,
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'light',
|
||||
type: 'vertical',
|
||||
shadeIntensity: 0.4,
|
||||
inverseColors: false,
|
||||
opacityFrom: 0.9,
|
||||
opacityTo: 0.8,
|
||||
stops: [0, 100]
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
tooltip: {
|
||||
y: {
|
||||
formatter: function (val) {
|
||||
return "$ " + val + " thousands"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var chartlinechart4 = new ApexCharts(document.querySelector("#chart-widget4"), options);
|
||||
chartlinechart4.render();
|
||||
|
||||
// earning chart
|
||||
var optionsearningchart = {
|
||||
chart: {
|
||||
height: 360,
|
||||
type: 'radialBar',
|
||||
},
|
||||
plotOptions: {
|
||||
radialBar: {
|
||||
startAngle: -135,
|
||||
endAngle: 135,
|
||||
dataLabels: {
|
||||
name: {
|
||||
fontSize: '16px',
|
||||
color: '#000000',
|
||||
offsetY: 120
|
||||
},
|
||||
value: {
|
||||
offsetY: 76,
|
||||
fontSize: '22px',
|
||||
color: '#000000',
|
||||
formatter: function(val) {
|
||||
return val + "%";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
opacity: 1
|
||||
},
|
||||
colors: [vihoAdminConfig.primary],
|
||||
stroke: {
|
||||
dashArray: 4
|
||||
},
|
||||
series: [70],
|
||||
labels: ['Median Ratio'],
|
||||
}
|
||||
var options = {
|
||||
series: [70],
|
||||
chart: {
|
||||
height: 350,
|
||||
type: 'radialBar',
|
||||
},
|
||||
plotOptions: {
|
||||
radialBar: {
|
||||
hollow: {
|
||||
margin: 15,
|
||||
size: '70%',
|
||||
image: '../assets/images/email-template/success.png',
|
||||
imageWidth: 64,
|
||||
imageHeight: 64,
|
||||
imageClipped: false
|
||||
},
|
||||
dataLabels: {
|
||||
name: {
|
||||
show: false,
|
||||
color: '#fff'
|
||||
},
|
||||
value: {
|
||||
show: true,
|
||||
color: '#333',
|
||||
offsetY: 70,
|
||||
fontSize: '22px'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
type: 'image',
|
||||
image: {
|
||||
src: ['../assets/images/user-card/5.jpg'],
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
lineCap: 'round'
|
||||
},
|
||||
labels: ['Volatility'],
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart-widget5"), options);
|
||||
chart.render();
|
||||
|
||||
// product chart
|
||||
var optionsproductchart = {
|
||||
chart: {
|
||||
height: 320,
|
||||
type: 'line'
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
series: [{
|
||||
name: 'TEAM A',
|
||||
type: 'area',
|
||||
data: [44, 55, 31, 47, 31, 43, 26, 41, 31, 47, 33]
|
||||
}, {
|
||||
name: 'TEAM B',
|
||||
type: 'line',
|
||||
data: [55, 69, 45, 61, 43, 54, 37, 52, 44, 61, 43]
|
||||
}],
|
||||
fill: {
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'light',
|
||||
type: 'vertical',
|
||||
shadeIntensity: 0.4,
|
||||
inverseColors: false,
|
||||
opacityFrom: 0.9,
|
||||
opacityTo: 0.8,
|
||||
stops: [0, 100]
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
labels: ['01', '02', '03', '04', '05', '06', '07', '08', '09 ', '10', '11', '12'],
|
||||
markers: {
|
||||
size: 0
|
||||
},
|
||||
yaxis: [{
|
||||
title: {
|
||||
text: 'Series A'
|
||||
}
|
||||
}, {
|
||||
opposite: true,
|
||||
title: {
|
||||
text: 'Series B'
|
||||
}
|
||||
}],
|
||||
tooltip: {
|
||||
shared: true,
|
||||
intersect: false,
|
||||
y: {
|
||||
formatter: function(y) {
|
||||
if (typeof y !== "undefined") {
|
||||
return y.toFixed(0) + " points";
|
||||
}
|
||||
return y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var chartproductchart = new ApexCharts(document.querySelector("#chart-widget6"), optionsproductchart);
|
||||
chartproductchart.render();
|
||||
|
||||
// Turnover chart
|
||||
var optionsturnoverchart = {
|
||||
chart: {
|
||||
height: 320,
|
||||
type: 'area',
|
||||
zoom: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
curve: 'straight'
|
||||
},
|
||||
fill: {
|
||||
colors: [vihoAdminConfig.primary],
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'light',
|
||||
type: 'vertical',
|
||||
shadeIntensity: 0.4,
|
||||
inverseColors: false,
|
||||
opacityFrom: 0.9,
|
||||
opacityTo: 0.8,
|
||||
stops: [0, 100]
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: "STOCK ABC",
|
||||
data: series.monthDataSeries1.prices
|
||||
}],
|
||||
colors: [vihoAdminConfig.primary],
|
||||
labels: series.monthDataSeries1.dates,
|
||||
xaxis: {
|
||||
type: 'datetime'
|
||||
},
|
||||
yaxis: {
|
||||
opposite: false
|
||||
},
|
||||
legend: {
|
||||
horizontalAlign: 'left'
|
||||
}
|
||||
}
|
||||
var chartturnoverchart = new ApexCharts(document.querySelector("#chart-widget7"), optionsturnoverchart);
|
||||
chartturnoverchart.render();
|
||||
|
||||
// sales chart
|
||||
var optionssaleschart = {
|
||||
fill: {
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'dark',
|
||||
type: 'Reflected',
|
||||
shadeIntensity: 0.1,
|
||||
inverseColors: false,
|
||||
opacityFrom: 1,
|
||||
opacityTo: 0.8,
|
||||
stops: [0, 100]
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary, '#e2c636'],
|
||||
chart: {
|
||||
height: 320,
|
||||
type: 'radar',
|
||||
dropShadow: {
|
||||
enabled: true,
|
||||
blur: 1,
|
||||
left: 1,
|
||||
top: 1
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: 'Series 1',
|
||||
data: [80, 50, 30, 40, 100, 20],
|
||||
}, {
|
||||
name: 'Series 2',
|
||||
data: [20, 30, 40, 80, 20, 80],
|
||||
}, {
|
||||
name: 'Series 3',
|
||||
data: [44, 76, 78, 13, 43, 10],
|
||||
}],
|
||||
|
||||
stroke: {
|
||||
width: 0
|
||||
},
|
||||
markers: {
|
||||
size: 0
|
||||
},
|
||||
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
|
||||
}
|
||||
var chartsaleschart = new ApexCharts(document.querySelector("#chart-widget8"), optionssaleschart);
|
||||
chartsaleschart.render();
|
||||
|
||||
// user chart
|
||||
function generateData(baseval, count, yrange) {
|
||||
var i = 0;
|
||||
var series = [];
|
||||
while (i < count) {
|
||||
var x = Math.floor(Math.random() * (750 - 1 + 1)) + 1;;
|
||||
var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;
|
||||
var z = Math.floor(Math.random() * (75 - 15 + 1)) + 15;
|
||||
series.push([x, y, z]);
|
||||
baseval += 86400000;
|
||||
i++;
|
||||
}
|
||||
return series;
|
||||
}
|
||||
var optionsuserchart = {
|
||||
chart: {
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
height: 320,
|
||||
type: 'bubble',
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
series: [{
|
||||
name: 'Bubble1',
|
||||
data: generateData(new Date('11 Feb 2017 GMT').getTime(), 20, {
|
||||
min: 10,
|
||||
max: 60
|
||||
})
|
||||
}, {
|
||||
name: 'Bubble2',
|
||||
data: generateData(new Date('11 Feb 2017 GMT').getTime(), 20, {
|
||||
min: 10,
|
||||
max: 60
|
||||
})
|
||||
}, {
|
||||
name: 'Bubble3',
|
||||
data: generateData(new Date('11 Feb 2017 GMT').getTime(), 20, {
|
||||
min: 10,
|
||||
max: 60
|
||||
})
|
||||
}, {
|
||||
name: 'Bubble4',
|
||||
data: generateData(new Date('11 Feb 2017 GMT').getTime(), 20, {
|
||||
min: 10,
|
||||
max: 60
|
||||
})
|
||||
}],
|
||||
fill: {
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shade: 'dark',
|
||||
type: 'horizontal',
|
||||
shadeIntensity: 0.4,
|
||||
inverseColors: false,
|
||||
opacityFrom: 1,
|
||||
opacityTo: 0.7,
|
||||
stops: [0, 100]
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary, '#222222', '#e2c636'],
|
||||
xaxis: {
|
||||
tickAmount: 12,
|
||||
type: 'category',
|
||||
},
|
||||
yaxis: {
|
||||
max: 70
|
||||
}
|
||||
}
|
||||
var chartuserchart = new ApexCharts(document.querySelector("#chart-widget9"), optionsuserchart);
|
||||
chartuserchart.render();
|
||||
|
||||
// browser-candlestick chart
|
||||
var optionscandlestickchart = {
|
||||
chart: {
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
height: 500,
|
||||
type: 'candlestick',
|
||||
},
|
||||
plotOptions: {
|
||||
candlestick: {
|
||||
colors: {
|
||||
upward: vihoAdminConfig.primary,
|
||||
downward: vihoAdminConfig.secondary
|
||||
}
|
||||
}
|
||||
},
|
||||
fill: {
|
||||
opacity: 0.9,
|
||||
colors: ['#fb2e63'],
|
||||
},
|
||||
series: [{
|
||||
data: [{
|
||||
x: new Date(1538778600000),
|
||||
y: [6629.81, 6650.5, 6623.04, 6633.33]
|
||||
}, {
|
||||
x: new Date(1538780400000),
|
||||
y: [6632.01, 6643.59, 6620, 6630.11]
|
||||
}, {
|
||||
x: new Date(1538782200000),
|
||||
y: [6630.71, 6648.95, 6623.34, 6635.65]
|
||||
}, {
|
||||
x: new Date(1538784000000),
|
||||
y: [6635.65, 6651, 6629.67, 6638.24]
|
||||
}, {
|
||||
x: new Date(1538785800000),
|
||||
y: [6638.24, 6640, 6620, 6624.47]
|
||||
}, {
|
||||
x: new Date(1538787600000),
|
||||
y: [6624.53, 6636.03, 6621.68, 6624.31]
|
||||
}, {
|
||||
x: new Date(1538789400000),
|
||||
y: [6624.61, 6632.2, 6617, 6626.02]
|
||||
}, {
|
||||
x: new Date(1538791200000),
|
||||
y: [6627, 6627.62, 6584.22, 6603.02]
|
||||
}, {
|
||||
x: new Date(1538793000000),
|
||||
y: [6605, 6608.03, 6598.95, 6604.01]
|
||||
}, {
|
||||
x: new Date(1538794800000),
|
||||
y: [6604.5, 6614.4, 6602.26, 6608.02]
|
||||
}, {
|
||||
x: new Date(1538796600000),
|
||||
y: [6608.02, 6610.68, 6601.99, 6608.91]
|
||||
}, {
|
||||
x: new Date(1538798400000),
|
||||
y: [6608.91, 6618.99, 6608.01, 6612]
|
||||
}, {
|
||||
x: new Date(1538800200000),
|
||||
y: [6612, 6615.13, 6605.09, 6612]
|
||||
}, {
|
||||
x: new Date(1538802000000),
|
||||
y: [6612, 6624.12, 6608.43, 6622.95]
|
||||
}, {
|
||||
x: new Date(1538803800000),
|
||||
y: [6623.91, 6623.91, 6615, 6615.67]
|
||||
}, {
|
||||
x: new Date(1538805600000),
|
||||
y: [6618.69, 6618.74, 6610, 6610.4]
|
||||
}, {
|
||||
x: new Date(1538807400000),
|
||||
y: [6611, 6622.78, 6610.4, 6614.9]
|
||||
}, {
|
||||
x: new Date(1538809200000),
|
||||
y: [6614.9, 6626.2, 6613.33, 6623.45]
|
||||
}, {
|
||||
x: new Date(1538811000000),
|
||||
y: [6623.48, 6627, 6618.38, 6620.35]
|
||||
}, {
|
||||
x: new Date(1538812800000),
|
||||
y: [6619.43, 6620.35, 6610.05, 6615.53]
|
||||
}, {
|
||||
x: new Date(1538814600000),
|
||||
y: [6615.53, 6617.93, 6610, 6615.19]
|
||||
}, {
|
||||
x: new Date(1538816400000),
|
||||
y: [6615.19, 6621.6, 6608.2, 6620]
|
||||
}, {
|
||||
x: new Date(1538818200000),
|
||||
y: [6619.54, 6625.17, 6614.15, 6620]
|
||||
}, {
|
||||
x: new Date(1538820000000),
|
||||
y: [6620.33, 6634.15, 6617.24, 6624.61]
|
||||
}, {
|
||||
x: new Date(1538821800000),
|
||||
y: [6625.95, 6626, 6611.66, 6617.58]
|
||||
}, {
|
||||
x: new Date(1538823600000),
|
||||
y: [6619, 6625.97, 6595.27, 6598.86]
|
||||
}, {
|
||||
x: new Date(1538825400000),
|
||||
y: [6598.86, 6598.88, 6570, 6587.16]
|
||||
}, {
|
||||
x: new Date(1538827200000),
|
||||
y: [6588.86, 6600, 6580, 6593.4]
|
||||
}, {
|
||||
x: new Date(1538829000000),
|
||||
y: [6593.99, 6598.89, 6585, 6587.81]
|
||||
}, {
|
||||
x: new Date(1538830800000),
|
||||
y: [6587.81, 6592.73, 6567.14, 6578]
|
||||
}, {
|
||||
x: new Date(1538832600000),
|
||||
y: [6578.35, 6581.72, 6567.39, 6579]
|
||||
}, {
|
||||
x: new Date(1538834400000),
|
||||
y: [6579.38, 6580.92, 6566.77, 6575.96]
|
||||
}, {
|
||||
x: new Date(1538836200000),
|
||||
y: [6575.96, 6589, 6571.77, 6588.92]
|
||||
}, {
|
||||
x: new Date(1538838000000),
|
||||
y: [6588.92, 6594, 6577.55, 6589.22]
|
||||
}, {
|
||||
x: new Date(1538839800000),
|
||||
y: [6589.3, 6598.89, 6589.1, 6596.08]
|
||||
}, {
|
||||
x: new Date(1538841600000),
|
||||
y: [6597.5, 6600, 6588.39, 6596.25]
|
||||
}, {
|
||||
x: new Date(1538843400000),
|
||||
y: [6598.03, 6600, 6588.73, 6595.97]
|
||||
}, {
|
||||
x: new Date(1538845200000),
|
||||
y: [6595.97, 6602.01, 6588.17, 6602]
|
||||
}, {
|
||||
x: new Date(1538847000000),
|
||||
y: [6602, 6607, 6596.51, 6599.95]
|
||||
}, {
|
||||
x: new Date(1538848800000),
|
||||
y: [6600.63, 6601.21, 6590.39, 6591.02]
|
||||
}, {
|
||||
x: new Date(1538850600000),
|
||||
y: [6591.02, 6603.08, 6591, 6591]
|
||||
}, {
|
||||
x: new Date(1538852400000),
|
||||
y: [6591, 6601.32, 6585, 6592]
|
||||
}, {
|
||||
x: new Date(1538854200000),
|
||||
y: [6593.13, 6596.01, 6590, 6593.34]
|
||||
}, {
|
||||
x: new Date(1538856000000),
|
||||
y: [6593.34, 6604.76, 6582.63, 6593.86]
|
||||
}, {
|
||||
x: new Date(1538857800000),
|
||||
y: [6593.86, 6604.28, 6586.57, 6600.01]
|
||||
}, {
|
||||
x: new Date(1538859600000),
|
||||
y: [6601.81, 6603.21, 6592.78, 6596.25]
|
||||
}, {
|
||||
x: new Date(1538861400000),
|
||||
y: [6596.25, 6604.2, 6590, 6602.99]
|
||||
}, {
|
||||
x: new Date(1538863200000),
|
||||
y: [6602.99, 6606, 6584.99, 6587.81]
|
||||
}, {
|
||||
x: new Date(1538865000000),
|
||||
y: [6587.81, 6595, 6583.27, 6591.96]
|
||||
}, {
|
||||
x: new Date(1538866800000),
|
||||
y: [6591.97, 6596.07, 6585, 6588.39]
|
||||
}, {
|
||||
x: new Date(1538868600000),
|
||||
y: [6587.6, 6598.21, 6587.6, 6594.27]
|
||||
}, {
|
||||
x: new Date(1538870400000),
|
||||
y: [6596.44, 6601, 6590, 6596.55]
|
||||
}, {
|
||||
x: new Date(1538872200000),
|
||||
y: [6598.91, 6605, 6596.61, 6600.02]
|
||||
}, {
|
||||
x: new Date(1538874000000),
|
||||
y: [6600.55, 6605, 6589.14, 6593.01]
|
||||
}, {
|
||||
x: new Date(1538875800000),
|
||||
y: [6593.15, 6605, 6592, 6603.06]
|
||||
}, {
|
||||
x: new Date(1538877600000),
|
||||
y: [6603.07, 6604.5, 6599.09, 6603.89]
|
||||
}, {
|
||||
x: new Date(1538879400000),
|
||||
y: [6604.44, 6604.44, 6600, 6603.5]
|
||||
}, {
|
||||
x: new Date(1538881200000),
|
||||
y: [6603.5, 6603.99, 6597.5, 6603.86]
|
||||
}, {
|
||||
x: new Date(1538883000000),
|
||||
y: [6603.85, 6605, 6600, 6604.07]
|
||||
}, {
|
||||
x: new Date(1538884800000),
|
||||
y: [6604.98, 6606, 6604.07, 6606]
|
||||
}, ]
|
||||
}],
|
||||
title: {
|
||||
text: 'CandleStick Chart',
|
||||
align: 'left'
|
||||
},
|
||||
xaxis: {
|
||||
type: 'datetime'
|
||||
},
|
||||
yaxis: {
|
||||
tooltip: {
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
var chartcandlestickchart = new ApexCharts(document.querySelector("#chart-widget13"), optionscandlestickchart);
|
||||
chartcandlestickchart.render();
|
||||
|
||||
|
||||
|
||||
124
public/assets/js/chart/Chart.js
vendored
Normal file
124
public/assets/js/chart/Chart.js
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
Chart.elements.Rectangle.prototype.draw = function() {
|
||||
|
||||
var ctx = this._chart.ctx;
|
||||
var vm = this._view;
|
||||
var left, right, top, bottom, signX, signY, borderSkipped, radius;
|
||||
var borderWidth = vm.borderWidth;
|
||||
// Set Radius Here
|
||||
// If radius is large enough to cause drawing errors a max radius is imposed
|
||||
var cornerRadius = 20;
|
||||
|
||||
if (!vm.horizontal) {
|
||||
// bar
|
||||
left = vm.x - vm.width / 2;
|
||||
right = vm.x + vm.width / 2;
|
||||
top = vm.y;
|
||||
bottom = vm.base;
|
||||
signX = 1;
|
||||
signY = bottom > top? 1: -1;
|
||||
borderSkipped = vm.borderSkipped || 'bottom';
|
||||
} else {
|
||||
// horizontal bar
|
||||
left = vm.base;
|
||||
right = vm.x;
|
||||
top = vm.y - vm.height / 2;
|
||||
bottom = vm.y + vm.height / 2;
|
||||
signX = right > left? 1: -1;
|
||||
signY = 1;
|
||||
borderSkipped = vm.borderSkipped || 'left';
|
||||
}
|
||||
|
||||
// Canvas doesn't allow us to stroke inside the width so we can
|
||||
// adjust the sizes to fit if we're setting a stroke on the line
|
||||
if (borderWidth) {
|
||||
// borderWidth shold be less than bar width and bar height.
|
||||
var barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom));
|
||||
borderWidth = borderWidth > barSize? barSize: borderWidth;
|
||||
var halfStroke = borderWidth / 2;
|
||||
// Adjust borderWidth when bar top position is near vm.base(zero).
|
||||
var borderLeft = left + (borderSkipped !== 'left'? halfStroke * signX: 0);
|
||||
var borderRight = right + (borderSkipped !== 'right'? -halfStroke * signX: 0);
|
||||
var borderTop = top + (borderSkipped !== 'top'? halfStroke * signY: 0);
|
||||
var borderBottom = bottom + (borderSkipped !== 'bottom'? -halfStroke * signY: 0);
|
||||
// not become a vertical line?
|
||||
if (borderLeft !== borderRight) {
|
||||
top = borderTop;
|
||||
bottom = borderBottom;
|
||||
}
|
||||
// not become a horizontal line?
|
||||
if (borderTop !== borderBottom) {
|
||||
left = borderLeft;
|
||||
right = borderRight;
|
||||
}
|
||||
}
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = vm.backgroundColor;
|
||||
ctx.strokeStyle = vm.borderColor;
|
||||
ctx.lineWidth = borderWidth;
|
||||
|
||||
// Corner points, from bottom-left to bottom-right clockwise
|
||||
// | 1 2 |
|
||||
// | 0 3 |
|
||||
var corners = [
|
||||
[left, bottom],
|
||||
[left, top],
|
||||
[right, top],
|
||||
[right, bottom]
|
||||
];
|
||||
|
||||
// Find first (starting) corner with fallback to 'bottom'
|
||||
var borders = ['bottom', 'left', 'top', 'right'];
|
||||
var startCorner = borders.indexOf(borderSkipped, 0);
|
||||
if (startCorner === -1) {
|
||||
startCorner = 0;
|
||||
}
|
||||
|
||||
function cornerAt(index) {
|
||||
return corners[(startCorner + index) % 4];
|
||||
}
|
||||
|
||||
// Draw rectangle from 'startCorner'
|
||||
var corner = cornerAt(0);
|
||||
ctx.moveTo(corner[0], corner[1]);
|
||||
|
||||
for (var i = 1; i < 4; i++) {
|
||||
corner = cornerAt(i);
|
||||
nextCornerId = i+1;
|
||||
if(nextCornerId == 4){
|
||||
nextCornerId = 0
|
||||
}
|
||||
|
||||
nextCorner = cornerAt(nextCornerId);
|
||||
|
||||
width = corners[2][0] - corners[1][0];
|
||||
height = corners[0][1] - corners[1][1];
|
||||
x = corners[1][0];
|
||||
y = corners[1][1];
|
||||
|
||||
var radius = cornerRadius;
|
||||
|
||||
// Fix radius being too large
|
||||
if(radius > height/2){
|
||||
radius = height/2;
|
||||
}if(radius > width/2){
|
||||
radius = width/2;
|
||||
}
|
||||
|
||||
ctx.moveTo(x + radius, y);
|
||||
ctx.lineTo(x + width - radius, y);
|
||||
ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
|
||||
ctx.lineTo(x + width, y + height - radius);
|
||||
ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
|
||||
ctx.lineTo(x + radius, y + height);
|
||||
ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
|
||||
ctx.lineTo(x, y + radius);
|
||||
ctx.quadraticCurveTo(x, y, x + radius, y);
|
||||
|
||||
}
|
||||
|
||||
ctx.fill();
|
||||
if (borderWidth) {
|
||||
ctx.stroke();
|
||||
}
|
||||
};
|
||||
6
public/assets/js/chart/apex-chart/apex-chart.js
Normal file
6
public/assets/js/chart/apex-chart/apex-chart.js
Normal file
File diff suppressed because one or more lines are too long
2413
public/assets/js/chart/apex-chart/chart-custom.js
Normal file
2413
public/assets/js/chart/apex-chart/chart-custom.js
Normal file
File diff suppressed because it is too large
Load Diff
1
public/assets/js/chart/apex-chart/moment.min.js
vendored
Normal file
1
public/assets/js/chart/apex-chart/moment.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
347
public/assets/js/chart/apex-chart/stock-prices.js
Normal file
347
public/assets/js/chart/apex-chart/stock-prices.js
Normal file
@@ -0,0 +1,347 @@
|
||||
var series =
|
||||
{
|
||||
"monthDataSeries1": {
|
||||
"prices": [
|
||||
8107.85,
|
||||
8128.0,
|
||||
8122.9,
|
||||
8165.5,
|
||||
8340.7,
|
||||
8423.7,
|
||||
8423.5,
|
||||
8514.3,
|
||||
8481.85,
|
||||
8487.7,
|
||||
8506.9,
|
||||
8626.2,
|
||||
8668.95,
|
||||
8602.3,
|
||||
8607.55,
|
||||
8512.9,
|
||||
8496.25,
|
||||
8600.65,
|
||||
8881.1,
|
||||
9340.85
|
||||
],
|
||||
"dates": [
|
||||
"13 Nov 2017",
|
||||
"14 Nov 2017",
|
||||
"15 Nov 2017",
|
||||
"16 Nov 2017",
|
||||
"17 Nov 2017",
|
||||
"20 Nov 2017",
|
||||
"21 Nov 2017",
|
||||
"22 Nov 2017",
|
||||
"23 Nov 2017",
|
||||
"24 Nov 2017",
|
||||
"27 Nov 2017",
|
||||
"28 Nov 2017",
|
||||
"29 Nov 2017",
|
||||
"30 Nov 2017",
|
||||
"01 Dec 2017",
|
||||
"04 Dec 2017",
|
||||
"05 Dec 2017",
|
||||
"06 Dec 2017",
|
||||
"07 Dec 2017",
|
||||
"08 Dec 2017"
|
||||
]
|
||||
},
|
||||
"monthDataSeries2": {
|
||||
"prices": [
|
||||
8423.7,
|
||||
8423.5,
|
||||
8514.3,
|
||||
8481.85,
|
||||
8487.7,
|
||||
8506.9,
|
||||
8626.2,
|
||||
8668.95,
|
||||
8602.3,
|
||||
8607.55,
|
||||
8512.9,
|
||||
8496.25,
|
||||
8600.65,
|
||||
8881.1,
|
||||
9040.85,
|
||||
8340.7,
|
||||
8165.5,
|
||||
8122.9,
|
||||
8107.85,
|
||||
8128.0
|
||||
],
|
||||
"dates": [
|
||||
"13 Nov 2017",
|
||||
"14 Nov 2017",
|
||||
"15 Nov 2017",
|
||||
"16 Nov 2017",
|
||||
"17 Nov 2017",
|
||||
"20 Nov 2017",
|
||||
"21 Nov 2017",
|
||||
"22 Nov 2017",
|
||||
"23 Nov 2017",
|
||||
"24 Nov 2017",
|
||||
"27 Nov 2017",
|
||||
"28 Nov 2017",
|
||||
"29 Nov 2017",
|
||||
"30 Nov 2017",
|
||||
"01 Dec 2017",
|
||||
"04 Dec 2017",
|
||||
"05 Dec 2017",
|
||||
"06 Dec 2017",
|
||||
"07 Dec 2017",
|
||||
"08 Dec 2017"
|
||||
]
|
||||
},
|
||||
"monthDataSeries3": {
|
||||
"prices": [
|
||||
7114.25,
|
||||
7126.6,
|
||||
7116.95,
|
||||
7203.7,
|
||||
7233.75,
|
||||
7451.0,
|
||||
7381.15,
|
||||
7348.95,
|
||||
7347.75,
|
||||
7311.25,
|
||||
7266.4,
|
||||
7253.25,
|
||||
7215.45,
|
||||
7266.35,
|
||||
7315.25,
|
||||
7237.2,
|
||||
7191.4,
|
||||
7238.95,
|
||||
7222.6,
|
||||
7217.9,
|
||||
7359.3,
|
||||
7371.55,
|
||||
7371.15,
|
||||
7469.2,
|
||||
7429.25,
|
||||
7434.65,
|
||||
7451.1,
|
||||
7475.25,
|
||||
7566.25,
|
||||
7556.8,
|
||||
7525.55,
|
||||
7555.45,
|
||||
7560.9,
|
||||
7490.7,
|
||||
7527.6,
|
||||
7551.9,
|
||||
7514.85,
|
||||
7577.95,
|
||||
7592.3,
|
||||
7621.95,
|
||||
7707.95,
|
||||
7859.1,
|
||||
7815.7,
|
||||
7739.0,
|
||||
7778.7,
|
||||
7839.45,
|
||||
7756.45,
|
||||
7669.2,
|
||||
7580.45,
|
||||
7452.85,
|
||||
7617.25,
|
||||
7701.6,
|
||||
7606.8,
|
||||
7620.05,
|
||||
7513.85,
|
||||
7498.45,
|
||||
7575.45,
|
||||
7601.95,
|
||||
7589.1,
|
||||
7525.85,
|
||||
7569.5,
|
||||
7702.5,
|
||||
7812.7,
|
||||
7803.75,
|
||||
7816.3,
|
||||
7851.15,
|
||||
7912.2,
|
||||
7972.8,
|
||||
8145.0,
|
||||
8161.1,
|
||||
8121.05,
|
||||
8071.25,
|
||||
8088.2,
|
||||
8154.45,
|
||||
8148.3,
|
||||
8122.05,
|
||||
8132.65,
|
||||
8074.55,
|
||||
7952.8,
|
||||
7885.55,
|
||||
7733.9,
|
||||
7897.15,
|
||||
7973.15,
|
||||
7888.5,
|
||||
7842.8,
|
||||
7838.4,
|
||||
7909.85,
|
||||
7892.75,
|
||||
7897.75,
|
||||
7820.05,
|
||||
7904.4,
|
||||
7872.2,
|
||||
7847.5,
|
||||
7849.55,
|
||||
7789.6,
|
||||
7736.35,
|
||||
7819.4,
|
||||
7875.35,
|
||||
7871.8,
|
||||
8076.5,
|
||||
8114.8,
|
||||
8193.55,
|
||||
8217.1,
|
||||
8235.05,
|
||||
8215.3,
|
||||
8216.4,
|
||||
8301.55,
|
||||
8235.25,
|
||||
8229.75,
|
||||
8201.95,
|
||||
8164.95,
|
||||
8107.85,
|
||||
8128.0,
|
||||
8122.9,
|
||||
8165.5,
|
||||
8340.7,
|
||||
8423.7,
|
||||
8423.5,
|
||||
8514.3,
|
||||
8481.85,
|
||||
8487.7,
|
||||
8506.9,
|
||||
8626.2
|
||||
],
|
||||
"dates": [
|
||||
"02 Jun 2017",
|
||||
"05 Jun 2017",
|
||||
"06 Jun 2017",
|
||||
"07 Jun 2017",
|
||||
"08 Jun 2017",
|
||||
"09 Jun 2017",
|
||||
"12 Jun 2017",
|
||||
"13 Jun 2017",
|
||||
"14 Jun 2017",
|
||||
"15 Jun 2017",
|
||||
"16 Jun 2017",
|
||||
"19 Jun 2017",
|
||||
"20 Jun 2017",
|
||||
"21 Jun 2017",
|
||||
"22 Jun 2017",
|
||||
"23 Jun 2017",
|
||||
"27 Jun 2017",
|
||||
"28 Jun 2017",
|
||||
"29 Jun 2017",
|
||||
"30 Jun 2017",
|
||||
"03 Jul 2017",
|
||||
"04 Jul 2017",
|
||||
"05 Jul 2017",
|
||||
"06 Jul 2017",
|
||||
"07 Jul 2017",
|
||||
"10 Jul 2017",
|
||||
"11 Jul 2017",
|
||||
"12 Jul 2017",
|
||||
"13 Jul 2017",
|
||||
"14 Jul 2017",
|
||||
"17 Jul 2017",
|
||||
"18 Jul 2017",
|
||||
"19 Jul 2017",
|
||||
"20 Jul 2017",
|
||||
"21 Jul 2017",
|
||||
"24 Jul 2017",
|
||||
"25 Jul 2017",
|
||||
"26 Jul 2017",
|
||||
"27 Jul 2017",
|
||||
"28 Jul 2017",
|
||||
"31 Jul 2017",
|
||||
"01 Aug 2017",
|
||||
"02 Aug 2017",
|
||||
"03 Aug 2017",
|
||||
"04 Aug 2017",
|
||||
"07 Aug 2017",
|
||||
"08 Aug 2017",
|
||||
"09 Aug 2017",
|
||||
"10 Aug 2017",
|
||||
"11 Aug 2017",
|
||||
"14 Aug 2017",
|
||||
"16 Aug 2017",
|
||||
"17 Aug 2017",
|
||||
"18 Aug 2017",
|
||||
"21 Aug 2017",
|
||||
"22 Aug 2017",
|
||||
"23 Aug 2017",
|
||||
"24 Aug 2017",
|
||||
"28 Aug 2017",
|
||||
"29 Aug 2017",
|
||||
"30 Aug 2017",
|
||||
"31 Aug 2017",
|
||||
"01 Sep 2017",
|
||||
"04 Sep 2017",
|
||||
"05 Sep 2017",
|
||||
"06 Sep 2017",
|
||||
"07 Sep 2017",
|
||||
"08 Sep 2017",
|
||||
"11 Sep 2017",
|
||||
"12 Sep 2017",
|
||||
"13 Sep 2017",
|
||||
"14 Sep 2017",
|
||||
"15 Sep 2017",
|
||||
"18 Sep 2017",
|
||||
"19 Sep 2017",
|
||||
"20 Sep 2017",
|
||||
"21 Sep 2017",
|
||||
"22 Sep 2017",
|
||||
"25 Sep 2017",
|
||||
"26 Sep 2017",
|
||||
"27 Sep 2017",
|
||||
"28 Sep 2017",
|
||||
"29 Sep 2017",
|
||||
"03 Oct 2017",
|
||||
"04 Oct 2017",
|
||||
"05 Oct 2017",
|
||||
"06 Oct 2017",
|
||||
"09 Oct 2017",
|
||||
"10 Oct 2017",
|
||||
"11 Oct 2017",
|
||||
"12 Oct 2017",
|
||||
"13 Oct 2017",
|
||||
"16 Oct 2017",
|
||||
"17 Oct 2017",
|
||||
"18 Oct 2017",
|
||||
"19 Oct 2017",
|
||||
"23 Oct 2017",
|
||||
"24 Oct 2017",
|
||||
"25 Oct 2017",
|
||||
"26 Oct 2017",
|
||||
"27 Oct 2017",
|
||||
"30 Oct 2017",
|
||||
"31 Oct 2017",
|
||||
"01 Nov 2017",
|
||||
"02 Nov 2017",
|
||||
"03 Nov 2017",
|
||||
"06 Nov 2017",
|
||||
"07 Nov 2017",
|
||||
"08 Nov 2017",
|
||||
"09 Nov 2017",
|
||||
"10 Nov 2017",
|
||||
"13 Nov 2017",
|
||||
"14 Nov 2017",
|
||||
"15 Nov 2017",
|
||||
"16 Nov 2017",
|
||||
"17 Nov 2017",
|
||||
"20 Nov 2017",
|
||||
"21 Nov 2017",
|
||||
"22 Nov 2017",
|
||||
"23 Nov 2017",
|
||||
"24 Nov 2017",
|
||||
"27 Nov 2017",
|
||||
"28 Nov 2017"
|
||||
]
|
||||
}
|
||||
}
|
||||
347
public/assets/js/chart/chartist/chartist-custom.js
Normal file
347
public/assets/js/chart/chartist/chartist-custom.js
Normal file
@@ -0,0 +1,347 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
new Chartist.Line('.ct-1', {
|
||||
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
|
||||
series: [
|
||||
[12, 9, 7, 8, 5],
|
||||
[2, 1, 3.5, 7, 3],
|
||||
[1, 3, 4, 5, 6]
|
||||
]
|
||||
}, {
|
||||
fullWidth: true,
|
||||
chartPadding: {
|
||||
right: 40
|
||||
}
|
||||
});
|
||||
var chart = new Chartist.Line('.ct-2', {
|
||||
labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
||||
series: [
|
||||
[5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9],
|
||||
[10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null],
|
||||
[null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null],
|
||||
[{x:3, y: 3},{x: 4, y: 3}, {x: 5, y: undefined}, {x: 6, y: 4}, {x: 7, y: null}, {x: 8, y: 4}, {x: 9, y: 4}]
|
||||
]
|
||||
}, {
|
||||
fullWidth: true,
|
||||
chartPadding: {
|
||||
right: 10
|
||||
},
|
||||
low: 0
|
||||
});
|
||||
var chart = new Chartist.Line('.ct-3', {
|
||||
labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
||||
series: [
|
||||
[5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9],
|
||||
[10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null],
|
||||
[null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null],
|
||||
[{x:3, y: 3},{x: 4, y: 3}, {x: 5, y: undefined}, {x: 6, y: 4}, {x: 7, y: null}, {x: 8, y: 4}, {x: 9, y: 4}]
|
||||
]
|
||||
}, {
|
||||
fullWidth: true,
|
||||
chartPadding: {
|
||||
right: 10
|
||||
},
|
||||
lineSmooth: Chartist.Interpolation.cardinal({
|
||||
fillHoles: true,
|
||||
}),
|
||||
low: 0
|
||||
});
|
||||
new Chartist.Line('.ct-4', {
|
||||
labels: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
series: [
|
||||
[5, 9, 7, 8, 5, 3, 5, 4]
|
||||
]
|
||||
}, {
|
||||
low: 0,
|
||||
showArea: true
|
||||
});
|
||||
new Chartist.Line('.ct-5', {
|
||||
labels: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
series: [
|
||||
[1, 2, 3, 1, -2, 0, 1, 0],
|
||||
[-2, -1, -2, -1, -2.5, -1, -2, -1],
|
||||
[0, 0, 0, 1, 2, 2.5, 2, 1],
|
||||
[2.5, 2, 1, 0.5, 1, 0.5, -1, -2.5]
|
||||
]
|
||||
}, {
|
||||
high: 3,
|
||||
low: -3,
|
||||
showArea: true,
|
||||
showLine: false,
|
||||
showPoint: false,
|
||||
fullWidth: true,
|
||||
axisX: {
|
||||
showLabel: false,
|
||||
showGrid: false
|
||||
}
|
||||
});
|
||||
var chart = new Chartist.Line('.ct-6', {
|
||||
labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
|
||||
series: [
|
||||
[12, 9, 7, 8, 5, 4, 6, 2, 3, 3, 4, 6],
|
||||
[4, 5, 3, 7, 3, 5, 5, 3, 4, 4, 5, 5],
|
||||
[5, 3, 4, 5, 6, 3, 3, 4, 5, 6, 3, 4],
|
||||
[3, 4, 5, 6, 7, 6, 4, 5, 6, 7, 6, 3]
|
||||
]
|
||||
}, {
|
||||
low: 0
|
||||
});
|
||||
var seq = 0,
|
||||
delays = 80,
|
||||
durations = 500;
|
||||
chart.on('created', function() {
|
||||
seq = 0;
|
||||
});
|
||||
chart.on('draw', function(data) {
|
||||
seq++;
|
||||
if(data.type === 'line') {
|
||||
data.element.animate({
|
||||
opacity: {
|
||||
begin: seq * delays + 1000,
|
||||
dur: durations,
|
||||
from: 0,
|
||||
to: 1
|
||||
}
|
||||
});
|
||||
} else if(data.type === 'label' && data.axis === 'x') {
|
||||
data.element.animate({
|
||||
y: {
|
||||
begin: seq * delays,
|
||||
dur: durations,
|
||||
from: data.y + 100,
|
||||
to: data.y,
|
||||
easing: 'easeOutQuart'
|
||||
}
|
||||
});
|
||||
} else if(data.type === 'label' && data.axis === 'y') {
|
||||
data.element.animate({
|
||||
x: {
|
||||
begin: seq * delays,
|
||||
dur: durations,
|
||||
from: data.x - 100,
|
||||
to: data.x,
|
||||
easing: 'easeOutQuart'
|
||||
}
|
||||
});
|
||||
} else if(data.type === 'point') {
|
||||
data.element.animate({
|
||||
x1: {
|
||||
begin: seq * delays,
|
||||
dur: durations,
|
||||
from: data.x - 10,
|
||||
to: data.x,
|
||||
easing: 'easeOutQuart'
|
||||
},
|
||||
x2: {
|
||||
begin: seq * delays,
|
||||
dur: durations,
|
||||
from: data.x - 10,
|
||||
to: data.x,
|
||||
easing: 'easeOutQuart'
|
||||
},
|
||||
opacity: {
|
||||
begin: seq * delays,
|
||||
dur: durations,
|
||||
from: 0,
|
||||
to: 1,
|
||||
easing: 'easeOutQuart'
|
||||
}
|
||||
});
|
||||
} else if(data.type === 'grid') {
|
||||
var pos1Animation = {
|
||||
begin: seq * delays,
|
||||
dur: durations,
|
||||
from: data[data.axis.units.pos + '1'] - 30,
|
||||
to: data[data.axis.units.pos + '1'],
|
||||
easing: 'easeOutQuart'
|
||||
};
|
||||
var pos2Animation = {
|
||||
begin: seq * delays,
|
||||
dur: durations,
|
||||
from: data[data.axis.units.pos + '2'] - 100,
|
||||
to: data[data.axis.units.pos + '2'],
|
||||
easing: 'easeOutQuart'
|
||||
};
|
||||
var animations = {};
|
||||
animations[data.axis.units.pos + '1'] = pos1Animation;
|
||||
animations[data.axis.units.pos + '2'] = pos2Animation;
|
||||
animations['opacity'] = {
|
||||
begin: seq * delays,
|
||||
dur: durations,
|
||||
from: 0,
|
||||
to: 1,
|
||||
easing: 'easeOutQuart'
|
||||
};
|
||||
data.element.animate(animations);
|
||||
}
|
||||
});
|
||||
chart.on('created', function() {
|
||||
if(window.__exampleAnimateTimeout) {
|
||||
clearTimeout(window.__exampleAnimateTimeout);
|
||||
window.__exampleAnimateTimeout = null;
|
||||
}
|
||||
window.__exampleAnimateTimeout = setTimeout(chart.update.bind(chart), 12000);
|
||||
});
|
||||
var chart = new Chartist.Line('.ct-7', {
|
||||
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
||||
series: [
|
||||
[1, 5, 2, 5, 4, 3],
|
||||
[2, 3, 4, 8, 1, 2],
|
||||
[5, 4, 3, 2, 1, 0.5]
|
||||
]
|
||||
}, {
|
||||
low: 0,
|
||||
showArea: true,
|
||||
showPoint: false,
|
||||
fullWidth: true
|
||||
});
|
||||
chart.on('draw', function(data) {
|
||||
if(data.type === 'line' || data.type === 'area') {
|
||||
data.element.animate({
|
||||
d: {
|
||||
begin: 2000 * data.index,
|
||||
dur: 2000,
|
||||
from: data.path.clone().scale(1, 0).translate(0, data.chartRect.height()).stringify(),
|
||||
to: data.path.clone().stringify(),
|
||||
easing: Chartist.Svg.Easing.easeOutQuint
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
var chart = new Chartist.Pie('.ct-8', {
|
||||
series: [10, 20, 50, 20, 5, 50, 15],
|
||||
labels: [1, 2, 3, 4, 5, 6, 7]
|
||||
}, {
|
||||
donut: true,
|
||||
showLabel: false
|
||||
});
|
||||
chart.on('draw', function(data) {
|
||||
if(data.type === 'slice') {
|
||||
var pathLength = data.element._node.getTotalLength();
|
||||
data.element.attr({
|
||||
'stroke-dasharray': pathLength + 'px ' + pathLength + 'px'
|
||||
});
|
||||
var animationDefinition = {
|
||||
'stroke-dashoffset': {
|
||||
id: 'anim' + data.index,
|
||||
dur: 1000,
|
||||
from: -pathLength + 'px',
|
||||
to: '0px',
|
||||
easing: Chartist.Svg.Easing.easeOutQuint,
|
||||
fill: 'freeze'
|
||||
}
|
||||
};
|
||||
if(data.index !== 0) {
|
||||
animationDefinition['stroke-dashoffset'].begin = 'anim' + (data.index - 1) + '.end';
|
||||
}
|
||||
data.element.attr({
|
||||
'stroke-dashoffset': -pathLength + 'px'
|
||||
});
|
||||
data.element.animate(animationDefinition, false);
|
||||
}
|
||||
});
|
||||
chart.on('created', function() {
|
||||
if(window.__anim21278907124) {
|
||||
clearTimeout(window.__anim21278907124);
|
||||
window.__anim21278907124 = null;
|
||||
}
|
||||
window.__anim21278907124 = setTimeout(chart.update.bind(chart), 10000);
|
||||
});
|
||||
var data = {
|
||||
labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'],
|
||||
series: [
|
||||
[1, 2, 4, 8, 6, -2, -1, -4, -6, -2]
|
||||
]
|
||||
};
|
||||
var options = {
|
||||
high: 10,
|
||||
low: -10,
|
||||
axisX: {
|
||||
labelInterpolationFnc: function(value, index) {
|
||||
return index % 2 === 0 ? value : null;
|
||||
}
|
||||
}
|
||||
};
|
||||
new Chartist.Bar('.ct-9', data, options);
|
||||
new Chartist.Bar('.ct-10', {
|
||||
labels: ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', 'Q7', 'Q8', 'Q9', 'Q10', 'Q11', 'Q13', 'Q14'],
|
||||
series: [
|
||||
[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300],
|
||||
[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300],
|
||||
[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300]
|
||||
]
|
||||
}, {
|
||||
stackBars: true,
|
||||
axisY: {
|
||||
labelInterpolationFnc: function(value) {
|
||||
return (value / 1000) + 'k';
|
||||
}
|
||||
}
|
||||
}).on('draw', function(data) {
|
||||
if(data.type === 'bar') {
|
||||
data.element.attr({
|
||||
style: 'stroke-width: 14px'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
new Chartist.Bar('.ct-11', {
|
||||
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
|
||||
series: [
|
||||
[5, 4, 3, 7, 5, 10, 3],
|
||||
[3, 2, 9, 5, 4, 6, 4]
|
||||
]
|
||||
}, {
|
||||
seriesBarDistance: 10,
|
||||
reverseData: true,
|
||||
horizontalBars: true,
|
||||
axisY: {
|
||||
offset: 70
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
new Chartist.Bar('.ct-12', {
|
||||
labels: ['2010-11', '2011-12', '2012-13', '2013-13', '2014-15', '2015-16', '2016-17', '2017-18'],
|
||||
series: [
|
||||
[0.9, 0.4, 1.5, 4.9, 3, 3.8, 3.8, 1.9],
|
||||
[6.4, 5.7, 7, 4.95, 3, 3.8, 3.8, 1.9],
|
||||
[4.3, 2.3, 3.6, 4.5, 5, 2.8, 3.3, 4.3],
|
||||
[3.8, 4.1, 2.8, 1.8, 2.2, 1.9, 6.7, 2.9]
|
||||
]
|
||||
},
|
||||
{
|
||||
stackBars: true,
|
||||
axisX: {
|
||||
labelInterpolationFnc: function(value) {
|
||||
return value.split(/\s+/).map(function(word) {
|
||||
return word[0];
|
||||
}).join('');
|
||||
}
|
||||
},
|
||||
axisY: {
|
||||
offset: 20
|
||||
}
|
||||
}, [
|
||||
['screen and (min-width: 400px)', {
|
||||
reverseData: true,
|
||||
horizontalBars: true,
|
||||
axisX: {
|
||||
labelInterpolationFnc: Chartist.noop
|
||||
},
|
||||
axisY: {
|
||||
offset: 60
|
||||
}
|
||||
}],
|
||||
['screen and (min-width: 800px)', {
|
||||
stackBars: false,
|
||||
seriesBarDistance: 10
|
||||
}],
|
||||
['screen and (min-width: 1000px)', {
|
||||
reverseData: false,
|
||||
horizontalBars: false,
|
||||
seriesBarDistance: 15
|
||||
}]
|
||||
]);
|
||||
})(jQuery);
|
||||
182
public/assets/js/chart/chartist/chartist-plugin-tooltip.js
Normal file
182
public/assets/js/chart/chartist/chartist-plugin-tooltip.js
Normal file
@@ -0,0 +1,182 @@
|
||||
/**
|
||||
* Chartist.js plugin to display a data label on top of the points in a line chart.
|
||||
*
|
||||
*/
|
||||
/* global Chartist */
|
||||
(function (window, document, Chartist) {
|
||||
'use strict';
|
||||
|
||||
var defaultOptions = {
|
||||
currency: undefined,
|
||||
currencyFormatCallback: undefined,
|
||||
tooltipOffset: {
|
||||
x: 0,
|
||||
y: -20
|
||||
},
|
||||
anchorToPoint: false,
|
||||
appendToBody: false,
|
||||
class: undefined,
|
||||
pointClass: 'ct-point'
|
||||
};
|
||||
|
||||
Chartist.plugins = Chartist.plugins || {};
|
||||
Chartist.plugins.tooltip = function (options) {
|
||||
options = Chartist.extend({}, defaultOptions, options);
|
||||
|
||||
return function tooltip(chart) {
|
||||
var tooltipSelector = options.pointClass;
|
||||
if (chart.constructor.name == Chartist.Bar.prototype.constructor.name) {
|
||||
tooltipSelector = 'ct-bar';
|
||||
} else if (chart.constructor.name == Chartist.Pie.prototype.constructor.name) {
|
||||
// Added support for donut graph
|
||||
if (chart.options.donut) {
|
||||
tooltipSelector = 'ct-slice-donut';
|
||||
} else {
|
||||
tooltipSelector = 'ct-slice-pie';
|
||||
}
|
||||
}
|
||||
|
||||
var $chart = chart.container;
|
||||
var $toolTip = $chart.querySelector('.chartist-tooltip');
|
||||
if (!$toolTip) {
|
||||
$toolTip = document.createElement('div');
|
||||
$toolTip.className = (!options.class) ? 'chartist-tooltip' : 'chartist-tooltip ' + options.class;
|
||||
if (!options.appendToBody) {
|
||||
$chart.appendChild($toolTip);
|
||||
} else {
|
||||
document.body.appendChild($toolTip);
|
||||
}
|
||||
}
|
||||
var height = $toolTip.offsetHeight;
|
||||
var width = $toolTip.offsetWidth;
|
||||
|
||||
hide($toolTip);
|
||||
|
||||
function on(event, selector, callback) {
|
||||
$chart.addEventListener(event, function (e) {
|
||||
if (!selector || hasClass(e.target, selector))
|
||||
callback(e);
|
||||
});
|
||||
}
|
||||
|
||||
on('mouseover', null, function () {
|
||||
var $point = event.target;
|
||||
var tooltipText = '';
|
||||
|
||||
var isPieChart = (chart instanceof Chartist.Pie) ? $point : $point.parentNode;
|
||||
var seriesName = (isPieChart) ? $point.parentNode.getAttribute('ct:meta') || $point.parentNode.getAttribute('ct:series-name') : '';
|
||||
var meta = $point.getAttribute('ct:meta') || seriesName || '';
|
||||
var hasMeta = !!meta;
|
||||
var value = $point.getAttribute('ct:value');
|
||||
|
||||
if (options.transformTooltipTextFnc && typeof options.transformTooltipTextFnc === 'function') {
|
||||
value = options.transformTooltipTextFnc(value);
|
||||
}
|
||||
|
||||
if (options.tooltipFnc && typeof options.tooltipFnc === 'function') {
|
||||
tooltipText = options.tooltipFnc(meta, value);
|
||||
} else {
|
||||
if (options.metaIsHTML) {
|
||||
var txt = document.createElement('textarea');
|
||||
txt.innerHTML = meta;
|
||||
meta = txt.value;
|
||||
}
|
||||
|
||||
meta = '<span class="chartist-tooltip-meta">' + meta + '</span>';
|
||||
|
||||
if (hasMeta) {
|
||||
tooltipText += meta + '<br>';
|
||||
} else {
|
||||
// For Pie Charts also take the labels into account
|
||||
// Could add support for more charts here as well!
|
||||
if (chart instanceof Chartist.Pie) {
|
||||
var label = next($point, 'ct-label');
|
||||
if (label.length > 0) {
|
||||
tooltipText += text(label) + '<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (value) {
|
||||
if (options.currency) {
|
||||
if (options.currencyFormatCallback != undefined) {
|
||||
value = options.currencyFormatCallback(value, options);
|
||||
} else {
|
||||
value = options.currency + value.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, '$1,');
|
||||
}
|
||||
}
|
||||
value = '<span class="chartist-tooltip-value">' + value + '</span>';
|
||||
tooltipText += value;
|
||||
}
|
||||
}
|
||||
|
||||
if(tooltipText) {
|
||||
$toolTip.innerHTML = tooltipText;
|
||||
setPosition(event);
|
||||
show($toolTip);
|
||||
|
||||
// Remember height and width to avoid wrong position in IE
|
||||
height = $toolTip.offsetHeight;
|
||||
width = $toolTip.offsetWidth;
|
||||
}
|
||||
});
|
||||
|
||||
on('mouseout', null, function () {
|
||||
hide($toolTip);
|
||||
});
|
||||
|
||||
function setPosition(event) {
|
||||
height = height || $toolTip.offsetHeight;
|
||||
width = width || $toolTip.offsetWidth;
|
||||
var offsetX = - width / 2 + options.tooltipOffset.x
|
||||
var offsetY = - height + options.tooltipOffset.y;
|
||||
var anchorX, anchorY;
|
||||
|
||||
if (!options.appendToBody) {
|
||||
var box = $chart.getBoundingClientRect();
|
||||
var left = event.pageX - box.left - window.pageXOffset ;
|
||||
var top = event.pageY - box.top - window.pageYOffset ;
|
||||
|
||||
if (true === options.anchorToPoint && event.target.x2 && event.target.y2) {
|
||||
anchorX = parseInt(event.target.x2.baseVal.value);
|
||||
anchorY = parseInt(event.target.y2.baseVal.value);
|
||||
}
|
||||
|
||||
$toolTip.style.top = (anchorY || top) + offsetY + 'px';
|
||||
$toolTip.style.left = (anchorX || left) + offsetX + 'px';
|
||||
} else {
|
||||
$toolTip.style.top = event.pageY + offsetY + 'px';
|
||||
$toolTip.style.left = event.pageX + offsetX + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function show(element) {
|
||||
if(!hasClass(element, 'tooltip-show')) {
|
||||
element.className = element.className + ' tooltip-show';
|
||||
}
|
||||
}
|
||||
|
||||
function hide(element) {
|
||||
// var regex = new RegExp('tooltip-show' + '\\s*', 'gi');
|
||||
// element.className = element.className.replace(regex, '').trim();
|
||||
element.classList.remove('tooltip-show');
|
||||
}
|
||||
|
||||
function hasClass(element, className) {
|
||||
return (' ' + element.getAttribute('class') + ' ').indexOf(' ' + className + ' ') > -1;
|
||||
}
|
||||
|
||||
function next(element, className) {
|
||||
do {
|
||||
element = element.nextSibling;
|
||||
} while (element && !hasClass(element, className));
|
||||
return element;
|
||||
}
|
||||
|
||||
function text(element) {
|
||||
return element.innerText || element.textContent;
|
||||
}
|
||||
|
||||
} (window, document, Chartist));
|
||||
4488
public/assets/js/chart/chartist/chartist.js
Normal file
4488
public/assets/js/chart/chartist/chartist.js
Normal file
File diff suppressed because it is too large
Load Diff
285
public/assets/js/chart/chartjs/chart.custom.js
Normal file
285
public/assets/js/chart/chartjs/chart.custom.js
Normal file
@@ -0,0 +1,285 @@
|
||||
Chart.defaults.global = {
|
||||
animation: true,
|
||||
animationSteps: 60,
|
||||
animationEasing: "easeOutIn",
|
||||
showScale: true,
|
||||
scaleOverride: false,
|
||||
scaleSteps: null,
|
||||
scaleStepWidth: null,
|
||||
scaleStartValue: null,
|
||||
scaleLineColor: "#eeeeee",
|
||||
scaleLineWidth: 1,
|
||||
scaleShowLabels: true,
|
||||
scaleLabel: "<%=value%>",
|
||||
scaleIntegersOnly: true,
|
||||
scaleBeginAtZero: false,
|
||||
scaleFontSize: 12,
|
||||
scaleFontStyle: "normal",
|
||||
scaleFontColor: "#717171",
|
||||
responsive: true,
|
||||
maintainAspectRatio: true,
|
||||
showTooltips: true,
|
||||
multiTooltipTemplate: "<%= value %>",
|
||||
tooltipFillColor: "#333333",
|
||||
tooltipEvents: ["mousemove", "touchstart", "touchmove"],
|
||||
tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",
|
||||
tooltipFontSize: 14,
|
||||
tooltipFontStyle: "normal",
|
||||
tooltipFontColor: "#fff",
|
||||
tooltipTitleFontSize: 16,
|
||||
TitleFontStyle : "Raleway",
|
||||
tooltipTitleFontStyle: "bold",
|
||||
tooltipTitleFontColor: "#ffffff",
|
||||
tooltipYPadding: 10,
|
||||
tooltipXPadding: 10,
|
||||
tooltipCaretSize: 8,
|
||||
tooltipCornerRadius: 6,
|
||||
tooltipXOffset: 5,
|
||||
onAnimationProgress: function() {},
|
||||
onAnimationComplete: function() {}
|
||||
};
|
||||
var barData = {
|
||||
labels: ["January", "February", "March", "April", "May", "June", "July"],
|
||||
datasets: [{
|
||||
label: "My First dataset",
|
||||
fillColor: "rgba(36, 105, 92, 0.4)",
|
||||
strokeColor: vihoAdminConfig.primary,
|
||||
highlightFill: "rgba(36, 105, 92, 0.6)",
|
||||
highlightStroke: vihoAdminConfig.primary,
|
||||
data: [35, 59, 80, 81, 56, 55, 40]
|
||||
}, {
|
||||
label: "My Second dataset",
|
||||
fillColor: "rgba(186, 137, 93, 0.4)",
|
||||
strokeColor: vihoAdminConfig.secondary,
|
||||
highlightFill: "rgba(186, 137, 93, 0.6)",
|
||||
highlightStroke: vihoAdminConfig.secondary,
|
||||
data: [28, 48, 40, 19, 86, 27, 90]
|
||||
}]
|
||||
};
|
||||
var barOptions = {
|
||||
scaleBeginAtZero: true,
|
||||
scaleShowGridLines: true,
|
||||
scaleGridLineColor: "rgba(0,0,0,0.1)",
|
||||
scaleGridLineWidth: 1,
|
||||
scaleShowHorizontalLines: true,
|
||||
scaleShowVerticalLines: true,
|
||||
barShowStroke: true,
|
||||
barStrokeWidth: 2,
|
||||
barValueSpacing: 5,
|
||||
barDatasetSpacing: 1,
|
||||
};
|
||||
var barCtx = document.getElementById("myBarGraph").getContext("2d");
|
||||
var myBarChart = new Chart(barCtx).Bar(barData, barOptions);
|
||||
var polarData = [
|
||||
{
|
||||
value: 300,
|
||||
color: vihoAdminConfig.primary,
|
||||
highlight: "rgba(36, 105, 92, 1)",
|
||||
label: "Yellow"
|
||||
}, {
|
||||
value: 50,
|
||||
color: vihoAdminConfig.secondary,
|
||||
highlight: "rgba(186, 137, 93, 1)",
|
||||
label: "Sky"
|
||||
}, {
|
||||
value: 100,
|
||||
color: "#222222",
|
||||
highlight: "rgba(34,34,34,1)",
|
||||
label: "Black"
|
||||
}, {
|
||||
value: 40,
|
||||
color: "#717171",
|
||||
highlight: "rgba(113, 113, 113, 1)",
|
||||
label: "Grey"
|
||||
}, {
|
||||
value: 120,
|
||||
color: "#e2c636",
|
||||
highlight: "#616774",
|
||||
label: "Dark Grey"
|
||||
}
|
||||
];
|
||||
var polarOptions = {
|
||||
scaleShowLabelBackdrop: true,
|
||||
scaleBackdropColor: "rgba(255,255,255,0.75)",
|
||||
scaleBeginAtZero: true,
|
||||
scaleBackdropPaddingY: 2,
|
||||
scaleBackdropPaddingX: 2,
|
||||
scaleShowLine: true,
|
||||
segmentShowStroke: true,
|
||||
segmentStrokeColor: "#fff",
|
||||
segmentStrokeWidth: 2,
|
||||
animationSteps: 100,
|
||||
animationEasing: "easeOutBounce",
|
||||
animateRotate: true,
|
||||
animateScale: false,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
|
||||
};
|
||||
var polarCtx = document.getElementById("myPolarGraph").getContext("2d");
|
||||
var myPolarChart = new Chart(polarCtx).PolarArea(polarData, polarOptions);
|
||||
var lineGraphData = {
|
||||
labels: ["January", "February", "March", "April", "May", "June", "July"],
|
||||
datasets: [{
|
||||
label: "My First dataset",
|
||||
fillColor: "rgba(36, 105, 92, 0.5)",
|
||||
strokeColor: vihoAdminConfig.primary,
|
||||
pointColor: vihoAdminConfig.primary,
|
||||
pointStrokeColor: "#fff",
|
||||
pointHighlightFill: "#fff",
|
||||
pointHighlightStroke: "#000",
|
||||
data: [10, 59, 80, 81, 56, 55, 40]
|
||||
}, {
|
||||
label: "My Second dataset",
|
||||
fillColor: "rgba(186, 137, 93, 0.3)",
|
||||
strokeColor: vihoAdminConfig.secondary,
|
||||
pointColor: vihoAdminConfig.secondary,
|
||||
pointStrokeColor: "#fff",
|
||||
pointHighlightFill: "#000",
|
||||
pointHighlightStroke: "rgba(30, 166, 236, 1)",
|
||||
data: [28, 48, 40, 19, 86, 27, 90]
|
||||
}]
|
||||
};
|
||||
var lineGraphOptions = {
|
||||
scaleShowGridLines: true,
|
||||
scaleGridLineColor: "rgba(0,0,0,.05)",
|
||||
scaleGridLineWidth: 1,
|
||||
scaleShowHorizontalLines: true,
|
||||
scaleShowVerticalLines: true,
|
||||
bezierCurve: true,
|
||||
bezierCurveTension: 0.4,
|
||||
pointDot: true,
|
||||
pointDotRadius: 4,
|
||||
pointDotStrokeWidth: 1,
|
||||
pointHitDetectionRadius: 20,
|
||||
datasetStroke: true,
|
||||
datasetStrokeWidth: 2,
|
||||
datasetFill: true,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
|
||||
};
|
||||
var lineCtx = document.getElementById("myGraph").getContext("2d");
|
||||
var myLineCharts = new Chart(lineCtx).Line(lineGraphData, lineGraphOptions);
|
||||
var radarData = {
|
||||
labels: ["Ford", "Chevy", "Toyota", "Honda", "Mazda"],
|
||||
datasets: [{
|
||||
label: "My First dataset",
|
||||
fillColor: "rgba(36, 105, 92, 0.4)",
|
||||
strokeColor: vihoAdminConfig.primary,
|
||||
pointColor: vihoAdminConfig.primary,
|
||||
pointStrokeColor: vihoAdminConfig.primary,
|
||||
pointHighlightFill: vihoAdminConfig.primary,
|
||||
pointHighlightStroke: "rgba(68, 102, 242, 0.4)",
|
||||
data: [12, 3, 5, 18, 7]
|
||||
}]
|
||||
};
|
||||
var radarOptions = {
|
||||
scaleShowGridLines: true,
|
||||
scaleGridLineColor: "rgba(0,0,0,.2)",
|
||||
scaleGridLineWidth: 1,
|
||||
scaleShowHorizontalLines: true,
|
||||
scaleShowVerticalLines: true,
|
||||
bezierCurve: true,
|
||||
bezierCurveTension: 0.4,
|
||||
pointDot: true,
|
||||
pointDotRadius: 3,
|
||||
pointDotStrokeWidth: 1,
|
||||
pointHitDetectionRadius: 20,
|
||||
datasetStroke: true,
|
||||
datasetStrokeWidth: 2,
|
||||
datasetFill: true,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
|
||||
};
|
||||
var radarCtx = document.getElementById("myRadarGraph").getContext("2d");
|
||||
var myRadarChart = new Chart(radarCtx).Radar(radarData, radarOptions);
|
||||
var pieData = [
|
||||
{
|
||||
value: 300,
|
||||
color: vihoAdminConfig.primary,
|
||||
highlight: vihoAdminConfig.primary,
|
||||
label: "Primary"
|
||||
},
|
||||
{
|
||||
value: 50,
|
||||
color: vihoAdminConfig.secondary,
|
||||
highlight: vihoAdminConfig.secondary,
|
||||
label: "Secondary"
|
||||
},
|
||||
{
|
||||
value: 100,
|
||||
color: "#d22d3d",
|
||||
highlight: "#d22d3d",
|
||||
label: "Danger"
|
||||
}
|
||||
];
|
||||
var pieOptions = {
|
||||
segmentShowStroke: true,
|
||||
segmentStrokeColor: "#fff",
|
||||
segmentStrokeWidth: 2,
|
||||
percentageInnerCutout: 0,
|
||||
animationSteps: 100,
|
||||
animationEasing: "easeOutBounce",
|
||||
animateRotate: true,
|
||||
animateScale: false,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
|
||||
};
|
||||
|
||||
|
||||
var doughnutData = [
|
||||
{
|
||||
value: 300,
|
||||
color: vihoAdminConfig.primary,
|
||||
highlight: vihoAdminConfig.primary,
|
||||
label: "Primary"
|
||||
},
|
||||
{
|
||||
value: 50,
|
||||
color: vihoAdminConfig.secondary,
|
||||
highlight: vihoAdminConfig.secondary,
|
||||
label: "Secondary"
|
||||
},
|
||||
{
|
||||
value: 100,
|
||||
color: "#222222",
|
||||
highlight: "#222222",
|
||||
label: "Success"
|
||||
}
|
||||
];
|
||||
var doughnutOptions = {
|
||||
segmentShowStroke: true,
|
||||
segmentStrokeColor: "#fff",
|
||||
segmentStrokeWidth: 2,
|
||||
percentageInnerCutout: 50,
|
||||
animationSteps: 100,
|
||||
animationEasing: "easeOutBounce",
|
||||
animateRotate: true,
|
||||
animateScale: false,
|
||||
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
|
||||
};
|
||||
var doughnutCtx = document.getElementById("myDoughnutGraph").getContext("2d");
|
||||
var myDoughnutChart = new Chart(doughnutCtx).Doughnut(doughnutData, doughnutOptions);
|
||||
var myLineChart = {
|
||||
labels: ["","10", "20", "30", "40", "50", "60", "70", "80"],
|
||||
datasets: [{
|
||||
fillColor: "rgba(113, 113, 113, 0.2)",
|
||||
strokeColor: "#717171",
|
||||
pointColor: "#717171",
|
||||
data: [10, 20, 40, 30, 0, 20, 10, 30, 10]
|
||||
},{
|
||||
fillColor: "rgba(186, 137, 93, 0.2)",
|
||||
strokeColor: vihoAdminConfig.secondary,
|
||||
pointColor: vihoAdminConfig.secondary,
|
||||
data: [20, 40, 10, 20, 40, 30, 40, 10, 20]
|
||||
}, {
|
||||
fillColor: "rgb(36, 105, 92, 0.2)",
|
||||
strokeColor: vihoAdminConfig.primary,
|
||||
pointColor: vihoAdminConfig.primary,
|
||||
data: [60, 10, 40, 30, 80, 30, 20, 90, 0]
|
||||
}]
|
||||
}
|
||||
var ctx = document.getElementById("myLineCharts").getContext("2d");
|
||||
var LineChartDemo = new Chart(ctx).Line(myLineChart, {
|
||||
pointDotRadius: 2,
|
||||
pointDotStrokeWidth: 5,
|
||||
pointDotStrokeColor: "#ffffff",
|
||||
bezierCurve: false,
|
||||
scaleShowVerticalLines: false,
|
||||
scaleGridLineColor: "#eeeeee"
|
||||
});
|
||||
11
public/assets/js/chart/chartjs/chart.min.js
vendored
Normal file
11
public/assets/js/chart/chartjs/chart.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1428
public/assets/js/chart/flot-chart/excanvas.js
Normal file
1428
public/assets/js/chart/flot-chart/excanvas.js
Normal file
File diff suppressed because it is too large
Load Diff
1
public/assets/js/chart/flot-chart/excanvas.min.js
vendored
Normal file
1
public/assets/js/chart/flot-chart/excanvas.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
617
public/assets/js/chart/flot-chart/flot-script.js
Normal file
617
public/assets/js/chart/flot-chart/flot-script.js
Normal file
@@ -0,0 +1,617 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
var data = [],
|
||||
totalPoints = 300;
|
||||
function getRandomData() {
|
||||
if (data.length > 0)
|
||||
data = data.slice(1);
|
||||
while (data.length < totalPoints) {
|
||||
var prev = data.length > 0 ? data[data.length - 1] : 50,
|
||||
y = prev + Math.random() * 10 - 5;
|
||||
if (y < 0) {
|
||||
y = 0;
|
||||
} else if (y > 100) {
|
||||
y = 100;
|
||||
}
|
||||
data.push(y);
|
||||
}
|
||||
var res = [];
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
res.push([i, data[i]])
|
||||
}
|
||||
return res;
|
||||
}
|
||||
var updateInterval = 30;
|
||||
$("#updateInterval").val(updateInterval).change(function () {
|
||||
var v = $(this).val();
|
||||
if (v && !isNaN(+v)) {
|
||||
updateInterval = +v;
|
||||
if (updateInterval < 1) {
|
||||
updateInterval = 1;
|
||||
} else if (updateInterval > 2000) {
|
||||
updateInterval = 2000;
|
||||
}
|
||||
$(this).val("" + updateInterval);
|
||||
}
|
||||
});
|
||||
var plot = $.plot("#real-time-update", [ getRandomData() ], {
|
||||
series: {
|
||||
shadowSize: 0
|
||||
},
|
||||
yaxis: {
|
||||
min: 0,
|
||||
max: 100
|
||||
},
|
||||
xaxis: {
|
||||
show: !1
|
||||
},
|
||||
background:{
|
||||
color:'#469dff'
|
||||
},
|
||||
grid: {
|
||||
borderWidth: 0
|
||||
},
|
||||
colors: [vihoAdminConfig.primary]
|
||||
});
|
||||
function update() {
|
||||
plot.setData([getRandomData()]);
|
||||
plot.draw();
|
||||
setTimeout(update, updateInterval);
|
||||
}
|
||||
update();
|
||||
})(jQuery);
|
||||
if ($("#flot-categories").length > 0) {
|
||||
var a = {
|
||||
color: vihoAdminConfig.primary,
|
||||
data: [
|
||||
["Jan", 25],
|
||||
["Feb", 8],
|
||||
["Mar", 4],
|
||||
["Apr", 13],
|
||||
["May", 17],
|
||||
["Jun", 9],
|
||||
["Jul", 5],
|
||||
["Aug", 11],
|
||||
["Sep", 17],
|
||||
["Oct", 8],
|
||||
["Nov", 26],
|
||||
]
|
||||
};
|
||||
$.plot("#flot-categories", [a], {
|
||||
series: {
|
||||
bars: {
|
||||
show: !0,
|
||||
barWidth: .8,
|
||||
align: "center",
|
||||
fillColor: {
|
||||
colors: [{
|
||||
opacity: 1
|
||||
}, {
|
||||
opacity: 1
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
tickLength: 0
|
||||
},
|
||||
grid: {
|
||||
borderWidth: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if ($("#annotations-chart").length > 0) {
|
||||
for (var a = [], b = 0; b < 20; ++b) a.push([b, Math.sin(b)]);
|
||||
var c = [{
|
||||
data: a,
|
||||
label: "Pressure",
|
||||
color: vihoAdminConfig.primary
|
||||
}],
|
||||
d = [{
|
||||
color: "#ffffff",
|
||||
yaxis: {
|
||||
from: 1
|
||||
}
|
||||
}, {
|
||||
color: "#ffffff",
|
||||
yaxis: {
|
||||
to: -1
|
||||
}
|
||||
}, {
|
||||
color: "#ffffff",
|
||||
lineWidth: 1,
|
||||
xaxis: {
|
||||
from: 1,
|
||||
to: 1
|
||||
}
|
||||
}, {
|
||||
color: "#ffffff",
|
||||
lineWidth: 1,
|
||||
xaxis: {
|
||||
from: 9,
|
||||
to: 9
|
||||
}
|
||||
}],
|
||||
e = $("#annotations-chart"),
|
||||
f = $.plot(e, c, {
|
||||
bars: {
|
||||
show: !0,
|
||||
barWidth: .7,
|
||||
fill: 1
|
||||
},
|
||||
xaxis: {
|
||||
ticks: [],
|
||||
autoscaleMargin: .02
|
||||
},
|
||||
yaxis: {
|
||||
min: -2,
|
||||
max: 2
|
||||
},
|
||||
grid: {
|
||||
markings: d,
|
||||
borderWidth: 0
|
||||
}
|
||||
}),
|
||||
g = f.pointOffset({
|
||||
x: 2,
|
||||
y: -1.2
|
||||
});
|
||||
e.append("<div style='position:absolute;left:" + (g.left + 4) + "px;top:" + g.top + "px;color:#666;font-size:smaller'>Warming up</div>"), g = f.pointOffset({
|
||||
x: 8,
|
||||
y: -1.2
|
||||
}), e.append("<div style='position:absolute;left:" + (g.left + 4) + "px;top:" + g.top + "px;color:#666;font-size:smaller'>Actual measurements</div>");
|
||||
var h = f.getCanvas().getContext("2d");
|
||||
h.beginPath(), g.left += 4, h.moveTo(g.left, g.top), h.lineTo(g.left, g.top - 10), h.lineTo(g.left + 10, g.top - 5), h.lineTo(g.left, g.top), h.fillStyle = "#5e6db3", h.fill()
|
||||
}
|
||||
|
||||
if ($("#flot-basic-chart").length > 0) {
|
||||
for (var a = [], b = 0; b < 14; b += .5) a.push([b, Math.sin(b)]);
|
||||
var c = {
|
||||
color: "#e2c636",
|
||||
data: [
|
||||
[0, 3],
|
||||
[4, 8],
|
||||
[8, 5],
|
||||
[9, 13]
|
||||
]
|
||||
},
|
||||
d = {
|
||||
color: vihoAdminConfig.primary,
|
||||
data: [
|
||||
[0, 12],
|
||||
[7, 0],
|
||||
null,
|
||||
[0, 2.5],
|
||||
[12, 10.5]
|
||||
]
|
||||
};
|
||||
$.plot("#flot-basic-chart", [a, c, d], {
|
||||
grid: {
|
||||
borderWidth: 0
|
||||
},
|
||||
bars: {
|
||||
show: !0,
|
||||
lineWidth: 0,
|
||||
fill: !0,
|
||||
fillColor: {
|
||||
colors: [{
|
||||
opacity: 1
|
||||
}, {
|
||||
opacity: 1
|
||||
}]
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.secondary, vihoAdminConfig.secondary ,vihoAdminConfig.secondary ,vihoAdminConfig.secondary]
|
||||
})
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var datasets = {
|
||||
"usa": {
|
||||
label: "USA",
|
||||
data: [[1988, 483994], [1989, 479060], [1990, 457648], [1991, 401949], [1992, 424705], [1993, 402375], [1994, 377867], [1995, 357382], [1996, 337946], [1997, 336185], [1998, 328611], [1999, 329421], [2000, 342172], [2001, 344932], [2002, 387303], [2003, 440813], [2004, 480451], [2005, 504638], [2006, 528692]]
|
||||
},
|
||||
"russia": {
|
||||
label: "Russia",
|
||||
data: [[1988, 218000], [1989, 203000], [1990, 171000], [1992, 42500], [1993, 37600], [1994, 36600], [1995, 21700], [1996, 19200], [1997, 21300], [1998, 13600], [1999, 14000], [2000, 19100], [2001, 21300], [2002, 23600], [2003, 25100], [2004, 26100], [2005, 31100], [2006, 34700]]
|
||||
},
|
||||
"uk": {
|
||||
label: "UK",
|
||||
data: [[1988, 62982], [1989, 62027], [1990, 60696], [1991, 62348], [1992, 58560], [1993, 56393], [1994, 54579], [1995, 50818], [1996, 50554], [1997, 48276], [1998, 47691], [1999, 47529], [2000, 47778], [2001, 48760], [2002, 50949], [2003, 57452], [2004, 60234], [2005, 60076], [2006, 59213]]
|
||||
},
|
||||
"germany": {
|
||||
label: "Germany",
|
||||
data: [[1988, 55627], [1989, 55475], [1990, 58464], [1991, 55134], [1992, 52436], [1993, 47139], [1994, 43962], [1995, 43238], [1996, 42395], [1997, 40854], [1998, 40993], [1999, 41822], [2000, 41147], [2001, 40474], [2002, 40604], [2003, 40044], [2004, 38816], [2005, 38060], [2006, 36984]]
|
||||
},
|
||||
"denmark": {
|
||||
label: "Denmark",
|
||||
data: [[1988, 3813], [1989, 3719], [1990, 3722], [1991, 3789], [1992, 3720], [1993, 3730], [1994, 3636], [1995, 3598], [1996, 3610], [1997, 3655], [1998, 3695], [1999, 3673], [2000, 3553], [2001, 3774], [2002, 3728], [2003, 3618], [2004, 3638], [2005, 3467], [2006, 3770]]
|
||||
},
|
||||
"sweden": {
|
||||
label: "Sweden",
|
||||
data: [[1988, 6402], [1989, 6474], [1990, 6605], [1991, 6209], [1992, 6035], [1993, 6020], [1994, 6000], [1995, 6018], [1996, 3958], [1997, 5780], [1998, 5954], [1999, 6178], [2000, 6411], [2001, 5993], [2002, 5833], [2003, 5791], [2004, 5450], [2005, 5521], [2006, 5271]]
|
||||
},
|
||||
"norway": {
|
||||
label: "Norway",
|
||||
data: [[1988, 4382], [1989, 4498], [1990, 4535], [1991, 4398], [1992, 4766], [1993, 4441], [1994, 4670], [1995, 4217], [1996, 4275], [1997, 4203], [1998, 4482], [1999, 4506], [2000, 4358], [2001, 4385], [2002, 5269], [2003, 5066], [2004, 5194], [2005, 4887], [2006, 4891]]
|
||||
}
|
||||
};
|
||||
var i = 0;
|
||||
$.each(datasets, function(key, val) {
|
||||
val.color = i;
|
||||
++i;
|
||||
});
|
||||
var choiceContainer = $("#choices");
|
||||
$.each(datasets, function(key, val) {
|
||||
choiceContainer.append("<div class='checkbox checkbox-primary m-squar'><input type='checkbox' name='" + key +
|
||||
"' checked='checked' id='id" + key + "'></input>" +
|
||||
"<label for='id" + key + "'>"
|
||||
+ val.label + "</label></div>");
|
||||
});
|
||||
choiceContainer.find("input").click(plotAccordingToChoices);
|
||||
function plotAccordingToChoices() {
|
||||
var data = [];
|
||||
choiceContainer.find("input:checked").each(function () {
|
||||
var key = $(this).attr("name");
|
||||
if (key && datasets[key]) {
|
||||
data.push(datasets[key]);
|
||||
}
|
||||
});
|
||||
if (data.length > 0) {
|
||||
$.plot("#toggling-series-flot", data, {
|
||||
yaxis: {
|
||||
min: 0
|
||||
},
|
||||
xaxis: {
|
||||
tickDecimals: 0
|
||||
},
|
||||
grid: {
|
||||
|
||||
borderWidth: 0
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#e6edef"]
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
plotAccordingToChoices();
|
||||
});
|
||||
|
||||
$(function() {
|
||||
function a() {
|
||||
$("#stacking-flot-chart").length > 0 && $.plot("#stacking-flot-chart", j, {
|
||||
series: {
|
||||
stack: f,
|
||||
lines: {
|
||||
show: h,
|
||||
fill: !0,
|
||||
steps: i
|
||||
},
|
||||
bars: {
|
||||
show: g,
|
||||
barWidth: .6
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
borderWidth: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
for (var b = [], c = 0; c <= 10; c += 1) b.push([c, parseInt(30 * Math.random(), 30)]);
|
||||
for (var d = [], c = 0; c <= 10; c += 1) d.push([c, parseInt(30 * Math.random(), 30)]);
|
||||
for (var e = [], c = 0; c <= 10; c += 1) e.push([c, parseInt(30 * Math.random(), 30)]);
|
||||
var f = 0,
|
||||
g = !0,
|
||||
h = !1,
|
||||
i = !1,
|
||||
j = [{
|
||||
color: vihoAdminConfig.secondary,
|
||||
data: b
|
||||
}, {
|
||||
color: vihoAdminConfig.primary,
|
||||
data: d
|
||||
}, {
|
||||
color: "#222222",
|
||||
data: e
|
||||
}];
|
||||
a(), $(".stackControls button").click( function(b) {
|
||||
b.preventDefault(), f = "With stacking" == $(this).text() || null, a()
|
||||
}), $(".graphControls button").on("click", function(b) {
|
||||
b.preventDefault(), g = $(this).text().indexOf("Bars") != -1, h = $(this).text().indexOf("Lines") != -1, i = $(this).text().indexOf("steps") != -1, a()
|
||||
})
|
||||
});
|
||||
|
||||
$(function() {
|
||||
function drawArrow(ctx, x, y, radius){
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x + radius, y + radius);
|
||||
ctx.lineTo(x, y);
|
||||
ctx.lineTo(x - radius, y + radius);
|
||||
ctx.stroke();
|
||||
}
|
||||
function drawSemiCircle(ctx, x, y, radius){
|
||||
ctx.beginPath();
|
||||
ctx.arc(x, y, radius, 0, Math.PI, false);
|
||||
ctx.moveTo(x - radius, y);
|
||||
ctx.lineTo(x + radius, y);
|
||||
ctx.stroke();
|
||||
}
|
||||
var data1 = [
|
||||
[1,1,.5,.1,.3],
|
||||
[2,2,.3,.5,.2],
|
||||
[3,3,.9,.5,.2],
|
||||
[1.5,-.05,.5,.1,.3],
|
||||
[3.15,1.,.5,.1,.3],
|
||||
[2.5,-1.,.5,.1,.3]
|
||||
];
|
||||
|
||||
var data1_points = {
|
||||
show: true,
|
||||
radius: 5,
|
||||
fillColor: "#007bff",
|
||||
errorbars: "xy",
|
||||
xerr: {show: true, asymmetric: true, upperCap: "-", lowerCap: "-"},
|
||||
yerr: {show: true, color: "red", upperCap: "-"}
|
||||
};
|
||||
|
||||
var data2 = [
|
||||
[.7,3,.2,.4],
|
||||
[1.5,2.2,.3,.4],
|
||||
[2.3,1,.5,.2]
|
||||
];
|
||||
|
||||
var data2_points = {
|
||||
show: true,
|
||||
radius: 5,
|
||||
errorbars: "y",
|
||||
yerr: {show:true, asymmetric:true, upperCap: drawArrow, lowerCap: drawSemiCircle}
|
||||
};
|
||||
|
||||
var data3 = [
|
||||
[1,2,.4],
|
||||
[2,0.5,.3],
|
||||
[2.7,2,.5]
|
||||
];
|
||||
|
||||
var data3_points = {
|
||||
radius: 0,
|
||||
errorbars: "y",
|
||||
yerr: {show:true, upperCap: "-", lowerCap: "-", radius: 5}
|
||||
};
|
||||
|
||||
var data4 = [
|
||||
[1.3, 1],
|
||||
[1.75, 2.5],
|
||||
[2.5, 0.5]
|
||||
];
|
||||
|
||||
var data4_errors = [0.1, 0.4, 0.2];
|
||||
for (var i = 0; i < data4.length; i++) {
|
||||
data4_errors[i] = data4[i].concat(data4_errors[i])
|
||||
}
|
||||
|
||||
var data = [
|
||||
{color: "#717171", points: data1_points, data: data1, label: "data1"},
|
||||
{color: "#222222", points: data2_points, data: data2, label: "data2"},
|
||||
{color: vihoAdminConfig.secondary, lines: {show: true}, points: data3_points, data: data3, label: "data3"},
|
||||
{color: vihoAdminConfig.primary, bars: {show: true, align: "center", barWidth: 0.25}, data: data4, label: "data4"},
|
||||
{color: "#e2c636", points: data3_points, data: data4_errors}
|
||||
];
|
||||
|
||||
$.plot($("#error-flot-chart"), data , {
|
||||
legend: {
|
||||
position: "sw",
|
||||
show: true
|
||||
},
|
||||
series: {
|
||||
lines: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
min: 0.6,
|
||||
max: 3.1
|
||||
},
|
||||
yaxis: {
|
||||
min: 0,
|
||||
max: 3.5
|
||||
},
|
||||
zoom: {
|
||||
interactive: true
|
||||
},
|
||||
pan: {
|
||||
interactive: true
|
||||
},
|
||||
grid: {
|
||||
borderWidth: 0
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
var data = [],
|
||||
series = Math.floor(Math.random() * 6) + 3;
|
||||
for (var i = 0; i < series; i++) {
|
||||
data[i] = {
|
||||
label: "Series" + (i + 1),
|
||||
data: Math.floor(Math.random() * 100) + 1
|
||||
}
|
||||
}
|
||||
$.plot('#default-pie-flot-chart', data, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#efefef"]
|
||||
});
|
||||
$.plot('#default-pie-legend-flot-chart', data, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#efefef"]
|
||||
});
|
||||
$.plot('#hidden-label-radius-flot-chart', data, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
label: {
|
||||
show: true,
|
||||
radius: 2/3,
|
||||
threshold: 0.1
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#efefef"]
|
||||
});
|
||||
$.plot('#default-pie-flot-chart-hover', data, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
hoverable: true,
|
||||
clickable: true
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#efefef"]
|
||||
});
|
||||
$.plot('#custom-label1pie', data, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
label: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
background: {
|
||||
opacity: 0.8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#efefef"]
|
||||
});
|
||||
$.plot('#label-radius-flot-chart', data, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
label: {
|
||||
show: true,
|
||||
radius: 3/4,
|
||||
background: {
|
||||
opacity: 0.8
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#efefef"]
|
||||
});
|
||||
$.plot('#title-pie-flot-chart', data, {
|
||||
series: {
|
||||
pie: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
tilt: 0.5,
|
||||
label: {
|
||||
show: true,
|
||||
radius: 1,
|
||||
background: {
|
||||
opacity: 0.8
|
||||
}
|
||||
},
|
||||
combine: {
|
||||
color: '#ddd',
|
||||
threshold: 0.1
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#efefef"]
|
||||
});
|
||||
$.plot('#dount-hole-flot-chart', data, {
|
||||
series: {
|
||||
pie: {
|
||||
innerRadius: 0.5,
|
||||
show: true
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, "#ba895" ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#efefef"]
|
||||
});
|
||||
});
|
||||
|
||||
if ($("#multiple-real-timeupdate ").length > 0) {
|
||||
var a = [],
|
||||
b = 300,
|
||||
c = function() {
|
||||
for (a.length > 0 && (a = a.slice(1)); a.length < b;) {
|
||||
var c = a.length > 0 ? a[a.length - 1] : 50,
|
||||
d = c + 10 * Math.random() - 5;
|
||||
d < 0 ? d = 0 : d > 100 && (d = 100), a.push(d)
|
||||
}
|
||||
for (var e = [], f = 0; f < a.length; ++f) e.push([f, a[f]]);
|
||||
return e
|
||||
},
|
||||
d = [],
|
||||
b = 300,
|
||||
e = function() {
|
||||
for (d.length > 0 && (d = d.slice(1)); d.length < b;) {
|
||||
var a = d.length > 0 ? d[d.length - 1] : 50,
|
||||
c = a + 10 * Math.random() - 5;
|
||||
c < 0 ? c = 0 : c > 100 && (c = 100), d.push(c)
|
||||
}
|
||||
for (var e = [], f = 0; f < d.length; ++f) e.push([f, d[f]]);
|
||||
return e
|
||||
},
|
||||
f = 30,
|
||||
g = 30;
|
||||
g && !isNaN(+g) && (f = +g, f < 1 ? f = 1 : f > 2e3 && (f = 2e3), $(this).val("" + f));
|
||||
var h = {
|
||||
color: "#544fff",
|
||||
data: c()
|
||||
},
|
||||
i = {
|
||||
color: "#000000",
|
||||
data: e()
|
||||
},
|
||||
j = $.plot("#multiple-real-timeupdate", [h, i], {
|
||||
series: {
|
||||
shadowSize: 0
|
||||
},
|
||||
yaxis: {
|
||||
min: 0,
|
||||
max: 100
|
||||
},
|
||||
xaxis: {
|
||||
show: !1
|
||||
},
|
||||
grid: {
|
||||
borderWidth: 0
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary]
|
||||
}),
|
||||
k = function() {
|
||||
j.setData([c(), e()]), j.draw(), setTimeout(k, f)
|
||||
};
|
||||
k()
|
||||
}
|
||||
345
public/assets/js/chart/flot-chart/jquery.flot.canvas.js
Normal file
345
public/assets/js/chart/flot-chart/jquery.flot.canvas.js
Normal file
@@ -0,0 +1,345 @@
|
||||
/* Flot plugin for drawing all elements of a plot on the canvas.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Flot normally produces certain elements, like axis labels and the legend, using
|
||||
HTML elements. This permits greater interactivity and customization, and often
|
||||
looks better, due to cross-browser canvas text inconsistencies and limitations.
|
||||
|
||||
It can also be desirable to render the plot entirely in canvas, particularly
|
||||
if the goal is to save it as an image, or if Flot is being used in a context
|
||||
where the HTML DOM does not exist, as is the case within Node.js. This plugin
|
||||
switches out Flot's standard drawing operations for canvas-only replacements.
|
||||
|
||||
Currently the plugin supports only axis labels, but it will eventually allow
|
||||
every element of the plot to be rendered directly to canvas.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
{
|
||||
canvas: boolean
|
||||
}
|
||||
|
||||
The "canvas" option controls whether full canvas drawing is enabled, making it
|
||||
possible to toggle on and off. This is useful when a plot uses HTML text in the
|
||||
browser, but needs to redraw with canvas text when exporting as an image.
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var options = {
|
||||
canvas: true
|
||||
};
|
||||
|
||||
var render, getTextInfo, addText;
|
||||
|
||||
// Cache the prototype hasOwnProperty for faster access
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
function init(plot, classes) {
|
||||
|
||||
var Canvas = classes.Canvas;
|
||||
|
||||
// We only want to replace the functions once; the second time around
|
||||
// we would just get our new function back. This whole replacing of
|
||||
// prototype functions is a disaster, and needs to be changed ASAP.
|
||||
|
||||
if (render == null) {
|
||||
getTextInfo = Canvas.prototype.getTextInfo,
|
||||
addText = Canvas.prototype.addText,
|
||||
render = Canvas.prototype.render;
|
||||
}
|
||||
|
||||
// Finishes rendering the canvas, including overlaid text
|
||||
|
||||
Canvas.prototype.render = function() {
|
||||
|
||||
if (!plot.getOptions().canvas) {
|
||||
return render.call(this);
|
||||
}
|
||||
|
||||
var context = this.context,
|
||||
cache = this._textCache;
|
||||
|
||||
// For each text layer, render elements marked as active
|
||||
|
||||
context.save();
|
||||
context.textBaseline = "middle";
|
||||
|
||||
for (var layerKey in cache) {
|
||||
if (hasOwnProperty.call(cache, layerKey)) {
|
||||
var layerCache = cache[layerKey];
|
||||
for (var styleKey in layerCache) {
|
||||
if (hasOwnProperty.call(layerCache, styleKey)) {
|
||||
var styleCache = layerCache[styleKey],
|
||||
updateStyles = true;
|
||||
for (var key in styleCache) {
|
||||
if (hasOwnProperty.call(styleCache, key)) {
|
||||
|
||||
var info = styleCache[key],
|
||||
positions = info.positions,
|
||||
lines = info.lines;
|
||||
|
||||
// Since every element at this level of the cache have the
|
||||
// same font and fill styles, we can just change them once
|
||||
// using the values from the first element.
|
||||
|
||||
if (updateStyles) {
|
||||
context.fillStyle = info.font.color;
|
||||
context.font = info.font.definition;
|
||||
updateStyles = false;
|
||||
}
|
||||
|
||||
for (var i = 0, position; position = positions[i]; i++) {
|
||||
if (position.active) {
|
||||
for (var j = 0, line; line = position.lines[j]; j++) {
|
||||
context.fillText(lines[j].text, line[0], line[1]);
|
||||
}
|
||||
} else {
|
||||
positions.splice(i--, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (positions.length == 0) {
|
||||
delete styleCache[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context.restore();
|
||||
};
|
||||
|
||||
// Creates (if necessary) and returns a text info object.
|
||||
//
|
||||
// When the canvas option is set, the object looks like this:
|
||||
//
|
||||
// {
|
||||
// width: Width of the text's bounding box.
|
||||
// height: Height of the text's bounding box.
|
||||
// positions: Array of positions at which this text is drawn.
|
||||
// lines: [{
|
||||
// height: Height of this line.
|
||||
// widths: Width of this line.
|
||||
// text: Text on this line.
|
||||
// }],
|
||||
// font: {
|
||||
// definition: Canvas font property string.
|
||||
// color: Color of the text.
|
||||
// },
|
||||
// }
|
||||
//
|
||||
// The positions array contains objects that look like this:
|
||||
//
|
||||
// {
|
||||
// active: Flag indicating whether the text should be visible.
|
||||
// lines: Array of [x, y] coordinates at which to draw the line.
|
||||
// x: X coordinate at which to draw the text.
|
||||
// y: Y coordinate at which to draw the text.
|
||||
// }
|
||||
|
||||
Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) {
|
||||
|
||||
if (!plot.getOptions().canvas) {
|
||||
return getTextInfo.call(this, layer, text, font, angle, width);
|
||||
}
|
||||
|
||||
var textStyle, layerCache, styleCache, info;
|
||||
|
||||
// Cast the value to a string, in case we were given a number
|
||||
|
||||
text = "" + text;
|
||||
|
||||
// If the font is a font-spec object, generate a CSS definition
|
||||
|
||||
if (typeof font === "object") {
|
||||
textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px " + font.family;
|
||||
} else {
|
||||
textStyle = font;
|
||||
}
|
||||
|
||||
// Retrieve (or create) the cache for the text's layer and styles
|
||||
|
||||
layerCache = this._textCache[layer];
|
||||
|
||||
if (layerCache == null) {
|
||||
layerCache = this._textCache[layer] = {};
|
||||
}
|
||||
|
||||
styleCache = layerCache[textStyle];
|
||||
|
||||
if (styleCache == null) {
|
||||
styleCache = layerCache[textStyle] = {};
|
||||
}
|
||||
|
||||
info = styleCache[text];
|
||||
|
||||
if (info == null) {
|
||||
|
||||
var context = this.context;
|
||||
|
||||
// If the font was provided as CSS, create a div with those
|
||||
// classes and examine it to generate a canvas font spec.
|
||||
|
||||
if (typeof font !== "object") {
|
||||
|
||||
var element = $("<div> </div>")
|
||||
.css("position", "absolute")
|
||||
.addClass(typeof font === "string" ? font : null)
|
||||
.appendTo(this.getTextLayer(layer));
|
||||
|
||||
font = {
|
||||
lineHeight: element.height(),
|
||||
style: element.css("font-style"),
|
||||
variant: element.css("font-variant"),
|
||||
weight: element.css("font-weight"),
|
||||
family: element.css("font-family"),
|
||||
color: element.css("color")
|
||||
};
|
||||
|
||||
// Setting line-height to 1, without units, sets it equal
|
||||
// to the font-size, even if the font-size is abstract,
|
||||
// like 'smaller'. This enables us to read the real size
|
||||
// via the element's height, working around browsers that
|
||||
// return the literal 'smaller' value.
|
||||
|
||||
font.size = element.css("line-height", 1).height();
|
||||
|
||||
element.remove();
|
||||
}
|
||||
|
||||
textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px " + font.family;
|
||||
|
||||
// Create a new info object, initializing the dimensions to
|
||||
// zero so we can count them up line-by-line.
|
||||
|
||||
info = styleCache[text] = {
|
||||
width: 0,
|
||||
height: 0,
|
||||
positions: [],
|
||||
lines: [],
|
||||
font: {
|
||||
definition: textStyle,
|
||||
color: font.color
|
||||
}
|
||||
};
|
||||
|
||||
context.save();
|
||||
context.font = textStyle;
|
||||
|
||||
// Canvas can't handle multi-line strings; break on various
|
||||
// newlines, including HTML brs, to build a list of lines.
|
||||
// Note that we could split directly on regexps, but IE < 9 is
|
||||
// broken; revisit when we drop IE 7/8 support.
|
||||
|
||||
var lines = (text + "").replace(/<br ?\/?>|\r\n|\r/g, "\n").split("\n");
|
||||
|
||||
for (var i = 0; i < lines.length; ++i) {
|
||||
|
||||
var lineText = lines[i],
|
||||
measured = context.measureText(lineText);
|
||||
|
||||
info.width = Math.max(measured.width, info.width);
|
||||
info.height += font.lineHeight;
|
||||
|
||||
info.lines.push({
|
||||
text: lineText,
|
||||
width: measured.width,
|
||||
height: font.lineHeight
|
||||
});
|
||||
}
|
||||
|
||||
context.restore();
|
||||
}
|
||||
|
||||
return info;
|
||||
};
|
||||
|
||||
// Adds a text string to the canvas text overlay.
|
||||
|
||||
Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) {
|
||||
|
||||
if (!plot.getOptions().canvas) {
|
||||
return addText.call(this, layer, x, y, text, font, angle, width, halign, valign);
|
||||
}
|
||||
|
||||
var info = this.getTextInfo(layer, text, font, angle, width),
|
||||
positions = info.positions,
|
||||
lines = info.lines;
|
||||
|
||||
// Text is drawn with baseline 'middle', which we need to account
|
||||
// for by adding half a line's height to the y position.
|
||||
|
||||
y += info.height / lines.length / 2;
|
||||
|
||||
// Tweak the initial y-position to match vertical alignment
|
||||
|
||||
if (valign == "middle") {
|
||||
y = Math.round(y - info.height / 2);
|
||||
} else if (valign == "bottom") {
|
||||
y = Math.round(y - info.height);
|
||||
} else {
|
||||
y = Math.round(y);
|
||||
}
|
||||
|
||||
// FIXME: LEGACY BROWSER FIX
|
||||
// AFFECTS: Opera < 12.00
|
||||
|
||||
// Offset the y coordinate, since Opera is off pretty
|
||||
// consistently compared to the other browsers.
|
||||
|
||||
if (!!(window.opera && window.opera.version().split(".")[0] < 12)) {
|
||||
y -= 2;
|
||||
}
|
||||
|
||||
// Determine whether this text already exists at this position.
|
||||
// If so, mark it for inclusion in the next render pass.
|
||||
|
||||
for (var i = 0, position; position = positions[i]; i++) {
|
||||
if (position.x == x && position.y == y) {
|
||||
position.active = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If the text doesn't exist at this position, create a new entry
|
||||
|
||||
position = {
|
||||
active: true,
|
||||
lines: [],
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
|
||||
positions.push(position);
|
||||
|
||||
// Fill in the x & y positions of each line, adjusting them
|
||||
// individually for horizontal alignment.
|
||||
|
||||
for (var i = 0, line; line = lines[i]; i++) {
|
||||
if (halign == "center") {
|
||||
position.lines.push([Math.round(x - line.width / 2), y]);
|
||||
} else if (halign == "right") {
|
||||
position.lines.push([Math.round(x - line.width), y]);
|
||||
} else {
|
||||
position.lines.push([Math.round(x), y]);
|
||||
}
|
||||
y += line.height;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "canvas",
|
||||
version: "1.0"
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
190
public/assets/js/chart/flot-chart/jquery.flot.categories.js
Normal file
190
public/assets/js/chart/flot-chart/jquery.flot.categories.js
Normal file
@@ -0,0 +1,190 @@
|
||||
/* Flot plugin for plotting textual data or categories.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
|
||||
allows you to plot such a dataset directly.
|
||||
|
||||
To enable it, you must specify mode: "categories" on the axis with the textual
|
||||
labels, e.g.
|
||||
|
||||
$.plot("#placeholder", data, { xaxis: { mode: "categories" } });
|
||||
|
||||
By default, the labels are ordered as they are met in the data series. If you
|
||||
need a different ordering, you can specify "categories" on the axis options
|
||||
and list the categories there:
|
||||
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
categories: ["February", "March", "April"]
|
||||
}
|
||||
|
||||
If you need to customize the distances between the categories, you can specify
|
||||
"categories" as an object mapping labels to values
|
||||
|
||||
xaxis: {
|
||||
mode: "categories",
|
||||
categories: { "February": 1, "March": 3, "April": 4 }
|
||||
}
|
||||
|
||||
If you don't specify all categories, the remaining categories will be numbered
|
||||
from the max value plus 1 (with a spacing of 1 between each).
|
||||
|
||||
Internally, the plugin works by transforming the input data through an auto-
|
||||
generated mapping where the first category becomes 0, the second 1, etc.
|
||||
Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
|
||||
is visible in hover and click events that return numbers rather than the
|
||||
category labels). The plugin also overrides the tick generator to spit out the
|
||||
categories as ticks instead of the values.
|
||||
|
||||
If you need to map a value back to its label, the mapping is always accessible
|
||||
as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
xaxis: {
|
||||
categories: null
|
||||
},
|
||||
yaxis: {
|
||||
categories: null
|
||||
}
|
||||
};
|
||||
|
||||
function processRawData(plot, series, data, datapoints) {
|
||||
// if categories are enabled, we need to disable
|
||||
// auto-transformation to numbers so the strings are intact
|
||||
// for later processing
|
||||
|
||||
var xCategories = series.xaxis.options.mode == "categories",
|
||||
yCategories = series.yaxis.options.mode == "categories";
|
||||
|
||||
if (!(xCategories || yCategories))
|
||||
return;
|
||||
|
||||
var format = datapoints.format;
|
||||
|
||||
if (!format) {
|
||||
// FIXME: auto-detection should really not be defined here
|
||||
var s = series;
|
||||
format = [];
|
||||
format.push({ x: true, number: true, required: true });
|
||||
format.push({ y: true, number: true, required: true });
|
||||
|
||||
if (s.bars.show || (s.lines.show && s.lines.fill)) {
|
||||
var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
|
||||
format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });
|
||||
if (s.bars.horizontal) {
|
||||
delete format[format.length - 1].y;
|
||||
format[format.length - 1].x = true;
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.format = format;
|
||||
}
|
||||
|
||||
for (var m = 0; m < format.length; ++m) {
|
||||
if (format[m].x && xCategories)
|
||||
format[m].number = false;
|
||||
|
||||
if (format[m].y && yCategories)
|
||||
format[m].number = false;
|
||||
}
|
||||
}
|
||||
|
||||
function getNextIndex(categories) {
|
||||
var index = -1;
|
||||
|
||||
for (var v in categories)
|
||||
if (categories[v] > index)
|
||||
index = categories[v];
|
||||
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
function categoriesTickGenerator(axis) {
|
||||
var res = [];
|
||||
for (var label in axis.categories) {
|
||||
var v = axis.categories[label];
|
||||
if (v >= axis.min && v <= axis.max)
|
||||
res.push([v, label]);
|
||||
}
|
||||
|
||||
res.sort(function (a, b) { return a[0] - b[0]; });
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
function setupCategoriesForAxis(series, axis, datapoints) {
|
||||
if (series[axis].options.mode != "categories")
|
||||
return;
|
||||
|
||||
if (!series[axis].categories) {
|
||||
// parse options
|
||||
var c = {}, o = series[axis].options.categories || {};
|
||||
if ($.isArray(o)) {
|
||||
for (var i = 0; i < o.length; ++i)
|
||||
c[o[i]] = i;
|
||||
}
|
||||
else {
|
||||
for (var v in o)
|
||||
c[v] = o[v];
|
||||
}
|
||||
|
||||
series[axis].categories = c;
|
||||
}
|
||||
|
||||
// fix ticks
|
||||
if (!series[axis].options.ticks)
|
||||
series[axis].options.ticks = categoriesTickGenerator;
|
||||
|
||||
transformPointsOnAxis(datapoints, axis, series[axis].categories);
|
||||
}
|
||||
|
||||
function transformPointsOnAxis(datapoints, axis, categories) {
|
||||
// go through the points, transforming them
|
||||
var points = datapoints.points,
|
||||
ps = datapoints.pointsize,
|
||||
format = datapoints.format,
|
||||
formatColumn = axis.charAt(0),
|
||||
index = getNextIndex(categories);
|
||||
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
if (points[i] == null)
|
||||
continue;
|
||||
|
||||
for (var m = 0; m < ps; ++m) {
|
||||
var val = points[i + m];
|
||||
|
||||
if (val == null || !format[m][formatColumn])
|
||||
continue;
|
||||
|
||||
if (!(val in categories)) {
|
||||
categories[val] = index;
|
||||
++index;
|
||||
}
|
||||
|
||||
points[i + m] = categories[val];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function processDatapoints(plot, series, datapoints) {
|
||||
setupCategoriesForAxis(series, "xaxis", datapoints);
|
||||
setupCategoriesForAxis(series, "yaxis", datapoints);
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processRawData.push(processRawData);
|
||||
plot.hooks.processDatapoints.push(processDatapoints);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'categories',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
176
public/assets/js/chart/flot-chart/jquery.flot.crosshair.js
Normal file
176
public/assets/js/chart/flot-chart/jquery.flot.crosshair.js
Normal file
@@ -0,0 +1,176 @@
|
||||
/* Flot plugin for showing crosshairs when the mouse hovers over the plot.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
crosshair: {
|
||||
mode: null or "x" or "y" or "xy"
|
||||
color: color
|
||||
lineWidth: number
|
||||
}
|
||||
|
||||
Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical
|
||||
crosshair that lets you trace the values on the x axis, "y" enables a
|
||||
horizontal crosshair and "xy" enables them both. "color" is the color of the
|
||||
crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
|
||||
the drawn lines (default is 1).
|
||||
|
||||
The plugin also adds four public methods:
|
||||
|
||||
- setCrosshair( pos )
|
||||
|
||||
Set the position of the crosshair. Note that this is cleared if the user
|
||||
moves the mouse. "pos" is in coordinates of the plot and should be on the
|
||||
form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
|
||||
axes), which is coincidentally the same format as what you get from a
|
||||
"plothover" event. If "pos" is null, the crosshair is cleared.
|
||||
|
||||
- clearCrosshair()
|
||||
|
||||
Clear the crosshair.
|
||||
|
||||
- lockCrosshair(pos)
|
||||
|
||||
Cause the crosshair to lock to the current location, no longer updating if
|
||||
the user moves the mouse. Optionally supply a position (passed on to
|
||||
setCrosshair()) to move it to.
|
||||
|
||||
Example usage:
|
||||
|
||||
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
|
||||
$("#graph").bind( "plothover", function ( evt, position, item ) {
|
||||
if ( item ) {
|
||||
// Lock the crosshair to the data point being hovered
|
||||
myFlot.lockCrosshair({
|
||||
x: item.datapoint[ 0 ],
|
||||
y: item.datapoint[ 1 ]
|
||||
});
|
||||
} else {
|
||||
// Return normal crosshair operation
|
||||
myFlot.unlockCrosshair();
|
||||
}
|
||||
});
|
||||
|
||||
- unlockCrosshair()
|
||||
|
||||
Free the crosshair to move again after locking it.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
crosshair: {
|
||||
mode: null, // one of null, "x", "y" or "xy",
|
||||
color: "rgba(170, 0, 0, 0.80)",
|
||||
lineWidth: 1
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
// position of crosshair in pixels
|
||||
var crosshair = { x: -1, y: -1, locked: false };
|
||||
|
||||
plot.setCrosshair = function setCrosshair(pos) {
|
||||
if (!pos)
|
||||
crosshair.x = -1;
|
||||
else {
|
||||
var o = plot.p2c(pos);
|
||||
crosshair.x = Math.max(0, Math.min(o.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(o.top, plot.height()));
|
||||
}
|
||||
|
||||
plot.triggerRedrawOverlay();
|
||||
};
|
||||
|
||||
plot.clearCrosshair = plot.setCrosshair; // passes null for pos
|
||||
|
||||
plot.lockCrosshair = function lockCrosshair(pos) {
|
||||
if (pos)
|
||||
plot.setCrosshair(pos);
|
||||
crosshair.locked = true;
|
||||
};
|
||||
|
||||
plot.unlockCrosshair = function unlockCrosshair() {
|
||||
crosshair.locked = false;
|
||||
};
|
||||
|
||||
function onMouseOut(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
if (crosshair.x != -1) {
|
||||
crosshair.x = -1;
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseMove(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
if (plot.getSelection && plot.getSelection()) {
|
||||
crosshair.x = -1; // hide the crosshair while selecting
|
||||
return;
|
||||
}
|
||||
|
||||
var offset = plot.offset();
|
||||
crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(function (plot, eventHolder) {
|
||||
if (!plot.getOptions().crosshair.mode)
|
||||
return;
|
||||
|
||||
eventHolder.mouseout(onMouseOut);
|
||||
eventHolder.mousemove(onMouseMove);
|
||||
});
|
||||
|
||||
plot.hooks.drawOverlay.push(function (plot, ctx) {
|
||||
var c = plot.getOptions().crosshair;
|
||||
if (!c.mode)
|
||||
return;
|
||||
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
|
||||
if (crosshair.x != -1) {
|
||||
var adj = plot.getOptions().crosshair.lineWidth % 2 ? 0.5 : 0;
|
||||
|
||||
ctx.strokeStyle = c.color;
|
||||
ctx.lineWidth = c.lineWidth;
|
||||
ctx.lineJoin = "round";
|
||||
|
||||
ctx.beginPath();
|
||||
if (c.mode.indexOf("x") != -1) {
|
||||
var drawX = Math.floor(crosshair.x) + adj;
|
||||
ctx.moveTo(drawX, 0);
|
||||
ctx.lineTo(drawX, plot.height());
|
||||
}
|
||||
if (c.mode.indexOf("y") != -1) {
|
||||
var drawY = Math.floor(crosshair.y) + adj;
|
||||
ctx.moveTo(0, drawY);
|
||||
ctx.lineTo(plot.width(), drawY);
|
||||
}
|
||||
ctx.stroke();
|
||||
}
|
||||
ctx.restore();
|
||||
});
|
||||
|
||||
plot.hooks.shutdown.push(function (plot, eventHolder) {
|
||||
eventHolder.unbind("mouseout", onMouseOut);
|
||||
eventHolder.unbind("mousemove", onMouseMove);
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'crosshair',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
353
public/assets/js/chart/flot-chart/jquery.flot.errorbars.js
Normal file
353
public/assets/js/chart/flot-chart/jquery.flot.errorbars.js
Normal file
@@ -0,0 +1,353 @@
|
||||
/* Flot plugin for plotting error bars.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Error bars are used to show standard deviation and other statistical
|
||||
properties in a plot.
|
||||
|
||||
* Created by Rui Pereira - rui (dot) pereira (at) gmail (dot) com
|
||||
|
||||
This plugin allows you to plot error-bars over points. Set "errorbars" inside
|
||||
the points series to the axis name over which there will be error values in
|
||||
your data array (*even* if you do not intend to plot them later, by setting
|
||||
"show: null" on xerr/yerr).
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
points: {
|
||||
errorbars: "x" or "y" or "xy",
|
||||
xerr: {
|
||||
show: null/false or true,
|
||||
asymmetric: null/false or true,
|
||||
upperCap: null or "-" or function,
|
||||
lowerCap: null or "-" or function,
|
||||
color: null or color,
|
||||
radius: null or number
|
||||
},
|
||||
yerr: { same options as xerr }
|
||||
}
|
||||
}
|
||||
|
||||
Each data point array is expected to be of the type:
|
||||
|
||||
"x" [ x, y, xerr ]
|
||||
"y" [ x, y, yerr ]
|
||||
"xy" [ x, y, xerr, yerr ]
|
||||
|
||||
Where xerr becomes xerr_lower,xerr_upper for the asymmetric error case, and
|
||||
equivalently for yerr. Eg., a datapoint for the "xy" case with symmetric
|
||||
error-bars on X and asymmetric on Y would be:
|
||||
|
||||
[ x, y, xerr, yerr_lower, yerr_upper ]
|
||||
|
||||
By default no end caps are drawn. Setting upperCap and/or lowerCap to "-" will
|
||||
draw a small cap perpendicular to the error bar. They can also be set to a
|
||||
user-defined drawing function, with (ctx, x, y, radius) as parameters, as eg.
|
||||
|
||||
function drawSemiCircle( ctx, x, y, radius ) {
|
||||
ctx.beginPath();
|
||||
ctx.arc( x, y, radius, 0, Math.PI, false );
|
||||
ctx.moveTo( x - radius, y );
|
||||
ctx.lineTo( x + radius, y );
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
Color and radius both default to the same ones of the points series if not
|
||||
set. The independent radius parameter on xerr/yerr is useful for the case when
|
||||
we may want to add error-bars to a line, without showing the interconnecting
|
||||
points (with radius: 0), and still showing end caps on the error-bars.
|
||||
shadowSize and lineWidth are derived as well from the points series.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: {
|
||||
points: {
|
||||
errorbars: null, //should be 'x', 'y' or 'xy'
|
||||
xerr: { err: 'x', show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null},
|
||||
yerr: { err: 'y', show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function processRawData(plot, series, data, datapoints){
|
||||
if (!series.points.errorbars)
|
||||
return;
|
||||
|
||||
// x,y values
|
||||
var format = [
|
||||
{ x: true, number: true, required: true },
|
||||
{ y: true, number: true, required: true }
|
||||
];
|
||||
|
||||
var errors = series.points.errorbars;
|
||||
// error bars - first X then Y
|
||||
if (errors == 'x' || errors == 'xy') {
|
||||
// lower / upper error
|
||||
if (series.points.xerr.asymmetric) {
|
||||
format.push({ x: true, number: true, required: true });
|
||||
format.push({ x: true, number: true, required: true });
|
||||
} else
|
||||
format.push({ x: true, number: true, required: true });
|
||||
}
|
||||
if (errors == 'y' || errors == 'xy') {
|
||||
// lower / upper error
|
||||
if (series.points.yerr.asymmetric) {
|
||||
format.push({ y: true, number: true, required: true });
|
||||
format.push({ y: true, number: true, required: true });
|
||||
} else
|
||||
format.push({ y: true, number: true, required: true });
|
||||
}
|
||||
datapoints.format = format;
|
||||
}
|
||||
|
||||
function parseErrors(series, i){
|
||||
|
||||
var points = series.datapoints.points;
|
||||
|
||||
// read errors from points array
|
||||
var exl = null,
|
||||
exu = null,
|
||||
eyl = null,
|
||||
eyu = null;
|
||||
var xerr = series.points.xerr,
|
||||
yerr = series.points.yerr;
|
||||
|
||||
var eb = series.points.errorbars;
|
||||
// error bars - first X
|
||||
if (eb == 'x' || eb == 'xy') {
|
||||
if (xerr.asymmetric) {
|
||||
exl = points[i + 2];
|
||||
exu = points[i + 3];
|
||||
if (eb == 'xy')
|
||||
if (yerr.asymmetric){
|
||||
eyl = points[i + 4];
|
||||
eyu = points[i + 5];
|
||||
} else eyl = points[i + 4];
|
||||
} else {
|
||||
exl = points[i + 2];
|
||||
if (eb == 'xy')
|
||||
if (yerr.asymmetric) {
|
||||
eyl = points[i + 3];
|
||||
eyu = points[i + 4];
|
||||
} else eyl = points[i + 3];
|
||||
}
|
||||
// only Y
|
||||
} else if (eb == 'y')
|
||||
if (yerr.asymmetric) {
|
||||
eyl = points[i + 2];
|
||||
eyu = points[i + 3];
|
||||
} else eyl = points[i + 2];
|
||||
|
||||
// symmetric errors?
|
||||
if (exu == null) exu = exl;
|
||||
if (eyu == null) eyu = eyl;
|
||||
|
||||
var errRanges = [exl, exu, eyl, eyu];
|
||||
// nullify if not showing
|
||||
if (!xerr.show){
|
||||
errRanges[0] = null;
|
||||
errRanges[1] = null;
|
||||
}
|
||||
if (!yerr.show){
|
||||
errRanges[2] = null;
|
||||
errRanges[3] = null;
|
||||
}
|
||||
return errRanges;
|
||||
}
|
||||
|
||||
function drawSeriesErrors(plot, ctx, s){
|
||||
|
||||
var points = s.datapoints.points,
|
||||
ps = s.datapoints.pointsize,
|
||||
ax = [s.xaxis, s.yaxis],
|
||||
radius = s.points.radius,
|
||||
err = [s.points.xerr, s.points.yerr];
|
||||
|
||||
//sanity check, in case some inverted axis hack is applied to flot
|
||||
var invertX = false;
|
||||
if (ax[0].p2c(ax[0].max) < ax[0].p2c(ax[0].min)) {
|
||||
invertX = true;
|
||||
var tmp = err[0].lowerCap;
|
||||
err[0].lowerCap = err[0].upperCap;
|
||||
err[0].upperCap = tmp;
|
||||
}
|
||||
|
||||
var invertY = false;
|
||||
if (ax[1].p2c(ax[1].min) < ax[1].p2c(ax[1].max)) {
|
||||
invertY = true;
|
||||
var tmp = err[1].lowerCap;
|
||||
err[1].lowerCap = err[1].upperCap;
|
||||
err[1].upperCap = tmp;
|
||||
}
|
||||
|
||||
for (var i = 0; i < s.datapoints.points.length; i += ps) {
|
||||
|
||||
//parse
|
||||
var errRanges = parseErrors(s, i);
|
||||
|
||||
//cycle xerr & yerr
|
||||
for (var e = 0; e < err.length; e++){
|
||||
|
||||
var minmax = [ax[e].min, ax[e].max];
|
||||
|
||||
//draw this error?
|
||||
if (errRanges[e * err.length]){
|
||||
|
||||
//data coordinates
|
||||
var x = points[i],
|
||||
y = points[i + 1];
|
||||
|
||||
//errorbar ranges
|
||||
var upper = [x, y][e] + errRanges[e * err.length + 1],
|
||||
lower = [x, y][e] - errRanges[e * err.length];
|
||||
|
||||
//points outside of the canvas
|
||||
if (err[e].err == 'x')
|
||||
if (y > ax[1].max || y < ax[1].min || upper < ax[0].min || lower > ax[0].max)
|
||||
continue;
|
||||
if (err[e].err == 'y')
|
||||
if (x > ax[0].max || x < ax[0].min || upper < ax[1].min || lower > ax[1].max)
|
||||
continue;
|
||||
|
||||
// prevent errorbars getting out of the canvas
|
||||
var drawUpper = true,
|
||||
drawLower = true;
|
||||
|
||||
if (upper > minmax[1]) {
|
||||
drawUpper = false;
|
||||
upper = minmax[1];
|
||||
}
|
||||
if (lower < minmax[0]) {
|
||||
drawLower = false;
|
||||
lower = minmax[0];
|
||||
}
|
||||
|
||||
//sanity check, in case some inverted axis hack is applied to flot
|
||||
if ((err[e].err == 'x' && invertX) || (err[e].err == 'y' && invertY)) {
|
||||
//swap coordinates
|
||||
var tmp = lower;
|
||||
lower = upper;
|
||||
upper = tmp;
|
||||
tmp = drawLower;
|
||||
drawLower = drawUpper;
|
||||
drawUpper = tmp;
|
||||
tmp = minmax[0];
|
||||
minmax[0] = minmax[1];
|
||||
minmax[1] = tmp;
|
||||
}
|
||||
|
||||
// convert to pixels
|
||||
x = ax[0].p2c(x),
|
||||
y = ax[1].p2c(y),
|
||||
upper = ax[e].p2c(upper);
|
||||
lower = ax[e].p2c(lower);
|
||||
minmax[0] = ax[e].p2c(minmax[0]);
|
||||
minmax[1] = ax[e].p2c(minmax[1]);
|
||||
|
||||
//same style as points by default
|
||||
var lw = err[e].lineWidth ? err[e].lineWidth : s.points.lineWidth,
|
||||
sw = s.points.shadowSize != null ? s.points.shadowSize : s.shadowSize;
|
||||
|
||||
//shadow as for points
|
||||
if (lw > 0 && sw > 0) {
|
||||
var w = sw / 2;
|
||||
ctx.lineWidth = w;
|
||||
ctx.strokeStyle = "rgba(0,0,0,0.1)";
|
||||
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w + w/2, minmax);
|
||||
|
||||
ctx.strokeStyle = "rgba(0,0,0,0.2)";
|
||||
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w/2, minmax);
|
||||
}
|
||||
|
||||
ctx.strokeStyle = err[e].color? err[e].color: s.color;
|
||||
ctx.lineWidth = lw;
|
||||
//draw it
|
||||
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, 0, minmax);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function drawError(ctx,err,x,y,upper,lower,drawUpper,drawLower,radius,offset,minmax){
|
||||
|
||||
//shadow offset
|
||||
y += offset;
|
||||
upper += offset;
|
||||
lower += offset;
|
||||
|
||||
// error bar - avoid plotting over circles
|
||||
if (err.err == 'x'){
|
||||
if (upper > x + radius) drawPath(ctx, [[upper,y],[Math.max(x + radius,minmax[0]),y]]);
|
||||
else drawUpper = false;
|
||||
if (lower < x - radius) drawPath(ctx, [[Math.min(x - radius,minmax[1]),y],[lower,y]] );
|
||||
else drawLower = false;
|
||||
}
|
||||
else {
|
||||
if (upper < y - radius) drawPath(ctx, [[x,upper],[x,Math.min(y - radius,minmax[0])]] );
|
||||
else drawUpper = false;
|
||||
if (lower > y + radius) drawPath(ctx, [[x,Math.max(y + radius,minmax[1])],[x,lower]] );
|
||||
else drawLower = false;
|
||||
}
|
||||
|
||||
//internal radius value in errorbar, allows to plot radius 0 points and still keep proper sized caps
|
||||
//this is a way to get errorbars on lines without visible connecting dots
|
||||
radius = err.radius != null? err.radius: radius;
|
||||
|
||||
// upper cap
|
||||
if (drawUpper) {
|
||||
if (err.upperCap == '-'){
|
||||
if (err.err=='x') drawPath(ctx, [[upper,y - radius],[upper,y + radius]] );
|
||||
else drawPath(ctx, [[x - radius,upper],[x + radius,upper]] );
|
||||
} else if ($.isFunction(err.upperCap)){
|
||||
if (err.err=='x') err.upperCap(ctx, upper, y, radius);
|
||||
else err.upperCap(ctx, x, upper, radius);
|
||||
}
|
||||
}
|
||||
// lower cap
|
||||
if (drawLower) {
|
||||
if (err.lowerCap == '-'){
|
||||
if (err.err=='x') drawPath(ctx, [[lower,y - radius],[lower,y + radius]] );
|
||||
else drawPath(ctx, [[x - radius,lower],[x + radius,lower]] );
|
||||
} else if ($.isFunction(err.lowerCap)){
|
||||
if (err.err=='x') err.lowerCap(ctx, lower, y, radius);
|
||||
else err.lowerCap(ctx, x, lower, radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function drawPath(ctx, pts){
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(pts[0][0], pts[0][1]);
|
||||
for (var p=1; p < pts.length; p++)
|
||||
ctx.lineTo(pts[p][0], pts[p][1]);
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
function draw(plot, ctx){
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
$.each(plot.getData(), function (i, s) {
|
||||
if (s.points.errorbars && (s.points.xerr.show || s.points.yerr.show))
|
||||
drawSeriesErrors(plot, ctx, s);
|
||||
});
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processRawData.push(processRawData);
|
||||
plot.hooks.draw.push(draw);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'errorbars',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
226
public/assets/js/chart/flot-chart/jquery.flot.fillbetween.js
Normal file
226
public/assets/js/chart/flot-chart/jquery.flot.fillbetween.js
Normal file
@@ -0,0 +1,226 @@
|
||||
/* Flot plugin for computing bottoms for filled line and bar charts.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The case: you've got two series that you want to fill the area between. In Flot
|
||||
terms, you need to use one as the fill bottom of the other. You can specify the
|
||||
bottom of each data point as the third coordinate manually, or you can use this
|
||||
plugin to compute it for you.
|
||||
|
||||
In order to name the other series, you need to give it an id, like this:
|
||||
|
||||
var dataset = [
|
||||
{ data: [ ... ], id: "foo" } , // use default bottom
|
||||
{ data: [ ... ], fillBetween: "foo" }, // use first dataset as bottom
|
||||
];
|
||||
|
||||
$.plot($("#placeholder"), dataset, { lines: { show: true, fill: true }});
|
||||
|
||||
As a convenience, if the id given is a number that doesn't appear as an id in
|
||||
the series, it is interpreted as the index in the array instead (so fillBetween:
|
||||
0 can also mean the first series).
|
||||
|
||||
Internally, the plugin modifies the datapoints in each series. For line series,
|
||||
extra data points might be inserted through interpolation. Note that at points
|
||||
where the bottom line is not defined (due to a null point or start/end of line),
|
||||
the current line will show a gap too. The algorithm comes from the
|
||||
jquery.flot.stack.js plugin, possibly some code could be shared.
|
||||
|
||||
*/
|
||||
|
||||
(function ( $ ) {
|
||||
|
||||
var options = {
|
||||
series: {
|
||||
fillBetween: null // or number
|
||||
}
|
||||
};
|
||||
|
||||
function init( plot ) {
|
||||
|
||||
function findBottomSeries( s, allseries ) {
|
||||
|
||||
var i;
|
||||
|
||||
for ( i = 0; i < allseries.length; ++i ) {
|
||||
if ( allseries[ i ].id === s.fillBetween ) {
|
||||
return allseries[ i ];
|
||||
}
|
||||
}
|
||||
|
||||
if ( typeof s.fillBetween === "number" ) {
|
||||
if ( s.fillBetween < 0 || s.fillBetween >= allseries.length ) {
|
||||
return null;
|
||||
}
|
||||
return allseries[ s.fillBetween ];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function computeFillBottoms( plot, s, datapoints ) {
|
||||
|
||||
if ( s.fillBetween == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var other = findBottomSeries( s, plot.getData() );
|
||||
|
||||
if ( !other ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var ps = datapoints.pointsize,
|
||||
points = datapoints.points,
|
||||
otherps = other.datapoints.pointsize,
|
||||
otherpoints = other.datapoints.points,
|
||||
newpoints = [],
|
||||
px, py, intery, qx, qy, bottom,
|
||||
withlines = s.lines.show,
|
||||
withbottom = ps > 2 && datapoints.format[2].y,
|
||||
withsteps = withlines && s.lines.steps,
|
||||
fromgap = true,
|
||||
i = 0,
|
||||
j = 0,
|
||||
l, m;
|
||||
|
||||
while ( true ) {
|
||||
|
||||
if ( i >= points.length ) {
|
||||
break;
|
||||
}
|
||||
|
||||
l = newpoints.length;
|
||||
|
||||
if ( points[ i ] == null ) {
|
||||
|
||||
// copy gaps
|
||||
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
|
||||
i += ps;
|
||||
|
||||
} else if ( j >= otherpoints.length ) {
|
||||
|
||||
// for lines, we can't use the rest of the points
|
||||
|
||||
if ( !withlines ) {
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
}
|
||||
|
||||
i += ps;
|
||||
|
||||
} else if ( otherpoints[ j ] == null ) {
|
||||
|
||||
// oops, got a gap
|
||||
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( null );
|
||||
}
|
||||
|
||||
fromgap = true;
|
||||
j += otherps;
|
||||
|
||||
} else {
|
||||
|
||||
// cases where we actually got two points
|
||||
|
||||
px = points[ i ];
|
||||
py = points[ i + 1 ];
|
||||
qx = otherpoints[ j ];
|
||||
qy = otherpoints[ j + 1 ];
|
||||
bottom = 0;
|
||||
|
||||
if ( px === qx ) {
|
||||
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
|
||||
//newpoints[ l + 1 ] += qy;
|
||||
bottom = qy;
|
||||
|
||||
i += ps;
|
||||
j += otherps;
|
||||
|
||||
} else if ( px > qx ) {
|
||||
|
||||
// we got past point below, might need to
|
||||
// insert interpolated extra point
|
||||
|
||||
if ( withlines && i > 0 && points[ i - ps ] != null ) {
|
||||
intery = py + ( points[ i - ps + 1 ] - py ) * ( qx - px ) / ( points[ i - ps ] - px );
|
||||
newpoints.push( qx );
|
||||
newpoints.push( intery );
|
||||
for ( m = 2; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
bottom = qy;
|
||||
}
|
||||
|
||||
j += otherps;
|
||||
|
||||
} else { // px < qx
|
||||
|
||||
// if we come from a gap, we just skip this point
|
||||
|
||||
if ( fromgap && withlines ) {
|
||||
i += ps;
|
||||
continue;
|
||||
}
|
||||
|
||||
for ( m = 0; m < ps; ++m ) {
|
||||
newpoints.push( points[ i + m ] );
|
||||
}
|
||||
|
||||
// we might be able to interpolate a point below,
|
||||
// this can give us a better y
|
||||
|
||||
if ( withlines && j > 0 && otherpoints[ j - otherps ] != null ) {
|
||||
bottom = qy + ( otherpoints[ j - otherps + 1 ] - qy ) * ( px - qx ) / ( otherpoints[ j - otherps ] - qx );
|
||||
}
|
||||
|
||||
//newpoints[l + 1] += bottom;
|
||||
|
||||
i += ps;
|
||||
}
|
||||
|
||||
fromgap = false;
|
||||
|
||||
if ( l !== newpoints.length && withbottom ) {
|
||||
newpoints[ l + 2 ] = bottom;
|
||||
}
|
||||
}
|
||||
|
||||
// maintain the line steps invariant
|
||||
|
||||
if ( withsteps && l !== newpoints.length && l > 0 &&
|
||||
newpoints[ l ] !== null &&
|
||||
newpoints[ l ] !== newpoints[ l - ps ] &&
|
||||
newpoints[ l + 1 ] !== newpoints[ l - ps + 1 ] ) {
|
||||
for (m = 0; m < ps; ++m) {
|
||||
newpoints[ l + ps + m ] = newpoints[ l + m ];
|
||||
}
|
||||
newpoints[ l + 1 ] = newpoints[ l - ps + 1 ];
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push( computeFillBottoms );
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "fillbetween",
|
||||
version: "1.0"
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
241
public/assets/js/chart/flot-chart/jquery.flot.image.js
Normal file
241
public/assets/js/chart/flot-chart/jquery.flot.image.js
Normal file
@@ -0,0 +1,241 @@
|
||||
/* Flot plugin for plotting images.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and
|
||||
(x2, y2) are where you intend the two opposite corners of the image to end up
|
||||
in the plot. Image must be a fully loaded Javascript image (you can make one
|
||||
with new Image()). If the image is not complete, it's skipped when plotting.
|
||||
|
||||
There are two helpers included for retrieving images. The easiest work the way
|
||||
that you put in URLs instead of images in the data, like this:
|
||||
|
||||
[ "myimage.png", 0, 0, 10, 10 ]
|
||||
|
||||
Then call $.plot.image.loadData( data, options, callback ) where data and
|
||||
options are the same as you pass in to $.plot. This loads the images, replaces
|
||||
the URLs in the data with the corresponding images and calls "callback" when
|
||||
all images are loaded (or failed loading). In the callback, you can then call
|
||||
$.plot with the data set. See the included example.
|
||||
|
||||
A more low-level helper, $.plot.image.load(urls, callback) is also included.
|
||||
Given a list of URLs, it calls callback with an object mapping from URL to
|
||||
Image object when all images are loaded or have failed loading.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
images: {
|
||||
show: boolean
|
||||
anchor: "corner" or "center"
|
||||
alpha: [ 0, 1 ]
|
||||
}
|
||||
}
|
||||
|
||||
They can be specified for a specific series:
|
||||
|
||||
$.plot( $("#placeholder"), [{
|
||||
data: [ ... ],
|
||||
images: { ... }
|
||||
])
|
||||
|
||||
Note that because the data format is different from usual data points, you
|
||||
can't use images with anything else in a specific data series.
|
||||
|
||||
Setting "anchor" to "center" causes the pixels in the image to be anchored at
|
||||
the corner pixel centers inside of at the pixel corners, effectively letting
|
||||
half a pixel stick out to each side in the plot.
|
||||
|
||||
A possible future direction could be support for tiling for large images (like
|
||||
Google Maps).
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: {
|
||||
images: {
|
||||
show: false,
|
||||
alpha: 1,
|
||||
anchor: "corner" // or "center"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.plot.image = {};
|
||||
|
||||
$.plot.image.loadDataImages = function (series, options, callback) {
|
||||
var urls = [], points = [];
|
||||
|
||||
var defaultShow = options.series.images.show;
|
||||
|
||||
$.each(series, function (i, s) {
|
||||
if (!(defaultShow || s.images.show))
|
||||
return;
|
||||
|
||||
if (s.data)
|
||||
s = s.data;
|
||||
|
||||
$.each(s, function (i, p) {
|
||||
if (typeof p[0] == "string") {
|
||||
urls.push(p[0]);
|
||||
points.push(p);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.plot.image.load(urls, function (loadedImages) {
|
||||
$.each(points, function (i, p) {
|
||||
var url = p[0];
|
||||
if (loadedImages[url])
|
||||
p[0] = loadedImages[url];
|
||||
});
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.image.load = function (urls, callback) {
|
||||
var missing = urls.length, loaded = {};
|
||||
if (missing == 0)
|
||||
callback({});
|
||||
|
||||
$.each(urls, function (i, url) {
|
||||
var handler = function () {
|
||||
--missing;
|
||||
|
||||
loaded[url] = this;
|
||||
|
||||
if (missing == 0)
|
||||
callback(loaded);
|
||||
};
|
||||
|
||||
$('<img />').load(handler).error(handler).attr('src', url);
|
||||
});
|
||||
};
|
||||
|
||||
function drawSeries(plot, ctx, series) {
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
if (!series.images || !series.images.show)
|
||||
return;
|
||||
|
||||
var points = series.datapoints.points,
|
||||
ps = series.datapoints.pointsize;
|
||||
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
var img = points[i],
|
||||
x1 = points[i + 1], y1 = points[i + 2],
|
||||
x2 = points[i + 3], y2 = points[i + 4],
|
||||
xaxis = series.xaxis, yaxis = series.yaxis,
|
||||
tmp;
|
||||
|
||||
// actually we should check img.complete, but it
|
||||
// appears to be a somewhat unreliable indicator in
|
||||
// IE6 (false even after load event)
|
||||
if (!img || img.width <= 0 || img.height <= 0)
|
||||
continue;
|
||||
|
||||
if (x1 > x2) {
|
||||
tmp = x2;
|
||||
x2 = x1;
|
||||
x1 = tmp;
|
||||
}
|
||||
if (y1 > y2) {
|
||||
tmp = y2;
|
||||
y2 = y1;
|
||||
y1 = tmp;
|
||||
}
|
||||
|
||||
// if the anchor is at the center of the pixel, expand the
|
||||
// image by 1/2 pixel in each direction
|
||||
if (series.images.anchor == "center") {
|
||||
tmp = 0.5 * (x2-x1) / (img.width - 1);
|
||||
x1 -= tmp;
|
||||
x2 += tmp;
|
||||
tmp = 0.5 * (y2-y1) / (img.height - 1);
|
||||
y1 -= tmp;
|
||||
y2 += tmp;
|
||||
}
|
||||
|
||||
// clip
|
||||
if (x1 == x2 || y1 == y2 ||
|
||||
x1 >= xaxis.max || x2 <= xaxis.min ||
|
||||
y1 >= yaxis.max || y2 <= yaxis.min)
|
||||
continue;
|
||||
|
||||
var sx1 = 0, sy1 = 0, sx2 = img.width, sy2 = img.height;
|
||||
if (x1 < xaxis.min) {
|
||||
sx1 += (sx2 - sx1) * (xaxis.min - x1) / (x2 - x1);
|
||||
x1 = xaxis.min;
|
||||
}
|
||||
|
||||
if (x2 > xaxis.max) {
|
||||
sx2 += (sx2 - sx1) * (xaxis.max - x2) / (x2 - x1);
|
||||
x2 = xaxis.max;
|
||||
}
|
||||
|
||||
if (y1 < yaxis.min) {
|
||||
sy2 += (sy1 - sy2) * (yaxis.min - y1) / (y2 - y1);
|
||||
y1 = yaxis.min;
|
||||
}
|
||||
|
||||
if (y2 > yaxis.max) {
|
||||
sy1 += (sy1 - sy2) * (yaxis.max - y2) / (y2 - y1);
|
||||
y2 = yaxis.max;
|
||||
}
|
||||
|
||||
x1 = xaxis.p2c(x1);
|
||||
x2 = xaxis.p2c(x2);
|
||||
y1 = yaxis.p2c(y1);
|
||||
y2 = yaxis.p2c(y2);
|
||||
|
||||
// the transformation may have swapped us
|
||||
if (x1 > x2) {
|
||||
tmp = x2;
|
||||
x2 = x1;
|
||||
x1 = tmp;
|
||||
}
|
||||
if (y1 > y2) {
|
||||
tmp = y2;
|
||||
y2 = y1;
|
||||
y1 = tmp;
|
||||
}
|
||||
|
||||
tmp = ctx.globalAlpha;
|
||||
ctx.globalAlpha *= series.images.alpha;
|
||||
ctx.drawImage(img,
|
||||
sx1, sy1, sx2 - sx1, sy2 - sy1,
|
||||
x1 + plotOffset.left, y1 + plotOffset.top,
|
||||
x2 - x1, y2 - y1);
|
||||
ctx.globalAlpha = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
function processRawData(plot, series, data, datapoints) {
|
||||
if (!series.images.show)
|
||||
return;
|
||||
|
||||
// format is Image, x1, y1, x2, y2 (opposite corners)
|
||||
datapoints.format = [
|
||||
{ required: true },
|
||||
{ x: true, number: true, required: true },
|
||||
{ y: true, number: true, required: true },
|
||||
{ x: true, number: true, required: true },
|
||||
{ y: true, number: true, required: true }
|
||||
];
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processRawData.push(processRawData);
|
||||
plot.hooks.drawSeries.push(drawSeries);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'image',
|
||||
version: '1.1'
|
||||
});
|
||||
})(jQuery);
|
||||
3168
public/assets/js/chart/flot-chart/jquery.flot.js
Normal file
3168
public/assets/js/chart/flot-chart/jquery.flot.js
Normal file
File diff suppressed because it is too large
Load Diff
346
public/assets/js/chart/flot-chart/jquery.flot.navigate.js
Normal file
346
public/assets/js/chart/flot-chart/jquery.flot.navigate.js
Normal file
@@ -0,0 +1,346 @@
|
||||
/* Flot plugin for adding the ability to pan and zoom the plot.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The default behaviour is double click and scrollwheel up/down to zoom in, drag
|
||||
to pan. The plugin defines plot.zoom({ center }), plot.zoomOut() and
|
||||
plot.pan( offset ) so you easily can add custom controls. It also fires
|
||||
"plotpan" and "plotzoom" events, useful for synchronizing plots.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
zoom: {
|
||||
interactive: false
|
||||
trigger: "dblclick" // or "click" for single click
|
||||
amount: 1.5 // 2 = 200% (zoom in), 0.5 = 50% (zoom out)
|
||||
}
|
||||
|
||||
pan: {
|
||||
interactive: false
|
||||
cursor: "move" // CSS mouse cursor value used when dragging, e.g. "pointer"
|
||||
frameRate: 20
|
||||
}
|
||||
|
||||
xaxis, yaxis, x2axis, y2axis: {
|
||||
zoomRange: null // or [ number, number ] (min range, max range) or false
|
||||
panRange: null // or [ number, number ] (min, max) or false
|
||||
}
|
||||
|
||||
"interactive" enables the built-in drag/click behaviour. If you enable
|
||||
interactive for pan, then you'll have a basic plot that supports moving
|
||||
around; the same for zoom.
|
||||
|
||||
"amount" specifies the default amount to zoom in (so 1.5 = 150%) relative to
|
||||
the current viewport.
|
||||
|
||||
"cursor" is a standard CSS mouse cursor string used for visual feedback to the
|
||||
user when dragging.
|
||||
|
||||
"frameRate" specifies the maximum number of times per second the plot will
|
||||
update itself while the user is panning around on it (set to null to disable
|
||||
intermediate pans, the plot will then not update until the mouse button is
|
||||
released).
|
||||
|
||||
"zoomRange" is the interval in which zooming can happen, e.g. with zoomRange:
|
||||
[1, 100] the zoom will never scale the axis so that the difference between min
|
||||
and max is smaller than 1 or larger than 100. You can set either end to null
|
||||
to ignore, e.g. [1, null]. If you set zoomRange to false, zooming on that axis
|
||||
will be disabled.
|
||||
|
||||
"panRange" confines the panning to stay within a range, e.g. with panRange:
|
||||
[-10, 20] panning stops at -10 in one end and at 20 in the other. Either can
|
||||
be null, e.g. [-10, null]. If you set panRange to false, panning on that axis
|
||||
will be disabled.
|
||||
|
||||
Example API usage:
|
||||
|
||||
plot = $.plot(...);
|
||||
|
||||
// zoom default amount in on the pixel ( 10, 20 )
|
||||
plot.zoom({ center: { left: 10, top: 20 } });
|
||||
|
||||
// zoom out again
|
||||
plot.zoomOut({ center: { left: 10, top: 20 } });
|
||||
|
||||
// zoom 200% in on the pixel (10, 20)
|
||||
plot.zoom({ amount: 2, center: { left: 10, top: 20 } });
|
||||
|
||||
// pan 100 pixels to the left and 20 down
|
||||
plot.pan({ left: -100, top: 20 })
|
||||
|
||||
Here, "center" specifies where the center of the zooming should happen. Note
|
||||
that this is defined in pixel space, not the space of the data points (you can
|
||||
use the p2c helpers on the axes in Flot to help you convert between these).
|
||||
|
||||
"amount" is the amount to zoom the viewport relative to the current range, so
|
||||
1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is 70% (zoom out). You
|
||||
can set the default in the options.
|
||||
|
||||
*/
|
||||
|
||||
// First two dependencies, jquery.event.drag.js and
|
||||
// jquery.mousewheel.js, we put them inline here to save people the
|
||||
// effort of downloading them.
|
||||
|
||||
/*
|
||||
jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
|
||||
Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt
|
||||
*/
|
||||
(function(a){function e(h){var k,j=this,l=h.data||{};if(l.elem)j=h.dragTarget=l.elem,h.dragProxy=d.proxy||j,h.cursorOffsetX=l.pageX-l.left,h.cursorOffsetY=l.pageY-l.top,h.offsetX=h.pageX-h.cursorOffsetX,h.offsetY=h.pageY-h.cursorOffsetY;else if(d.dragging||l.which>0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY)<l.distance)break;h.target=l.target,k=f(h,"dragstart",j),k!==!1&&(d.dragging=j,d.proxy=h.dragProxy=a(k||j)[0]);case"mousemove":if(d.dragging){if(k=f(h,"drag",j),c.drop&&(c.drop.allowed=k!==!1,c.drop.handler(h)),k!==!1)break;h.type="mouseup"}case"mouseup":b.remove(document,"mousemove mouseup",e),d.dragging&&(c.drop&&c.drop.handler(h),f(h,"dragend",j)),i(j,!0),d.dragging=d.proxy=l.elem=!1}return!0}function f(b,c,d){b.type=c;var e=a.event.dispatch.call(d,b);return e===!1?!1:e||b.result}function g(a){return Math.pow(a,2)}function h(){return d.dragging===!1}function i(a,b){a&&(a.unselectable=b?"off":"on",a.onselectstart=function(){return b},a.style&&(a.style.MozUserSelect=b?"":"none"))}a.fn.drag=function(a,b,c){return b&&this.bind("dragstart",a),c&&this.bind("dragend",c),a?this.bind("drag",b?b:a):this.trigger("drag")};var b=a.event,c=b.special,d=c.drag={not:":input",distance:0,which:1,dragging:!1,setup:function(c){c=a.extend({distance:d.distance,which:d.which,not:d.not},c||{}),c.distance=g(c.distance),b.add(this,"mousedown",e,c),this.attachEvent&&this.attachEvent("ondragstart",h)},teardown:function(){b.remove(this,"mousedown",e),this===d.dragging&&(d.dragging=d.proxy=!1),i(this,!0),this.detachEvent&&this.detachEvent("ondragstart",h)}};c.dragstart=c.dragend={setup:function(){},teardown:function(){}}})(jQuery);
|
||||
|
||||
/* jquery.mousewheel.min.js
|
||||
* Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.6
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;void 0!==b.axis&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);void 0!==b.wheelDeltaY&&(g=b.wheelDeltaY/120);void 0!==b.wheelDeltaX&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
||||
|
||||
|
||||
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
xaxis: {
|
||||
zoomRange: null, // or [number, number] (min range, max range)
|
||||
panRange: null // or [number, number] (min, max)
|
||||
},
|
||||
zoom: {
|
||||
interactive: false,
|
||||
trigger: "dblclick", // or "click" for single click
|
||||
amount: 1.5 // how much to zoom relative to current position, 2 = 200% (zoom in), 0.5 = 50% (zoom out)
|
||||
},
|
||||
pan: {
|
||||
interactive: false,
|
||||
cursor: "move",
|
||||
frameRate: 20
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function onZoomClick(e, zoomOut) {
|
||||
var c = plot.offset();
|
||||
c.left = e.pageX - c.left;
|
||||
c.top = e.pageY - c.top;
|
||||
if (zoomOut)
|
||||
plot.zoomOut({ center: c });
|
||||
else
|
||||
plot.zoom({ center: c });
|
||||
}
|
||||
|
||||
function onMouseWheel(e, delta) {
|
||||
e.preventDefault();
|
||||
onZoomClick(e, delta < 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
var prevCursor = 'default', prevPageX = 0, prevPageY = 0,
|
||||
panTimeout = null;
|
||||
|
||||
function onDragStart(e) {
|
||||
if (e.which != 1) // only accept left-click
|
||||
return false;
|
||||
var c = plot.getPlaceholder().css('cursor');
|
||||
if (c)
|
||||
prevCursor = c;
|
||||
plot.getPlaceholder().css('cursor', plot.getOptions().pan.cursor);
|
||||
prevPageX = e.pageX;
|
||||
prevPageY = e.pageY;
|
||||
}
|
||||
|
||||
function onDrag(e) {
|
||||
var frameRate = plot.getOptions().pan.frameRate;
|
||||
if (panTimeout || !frameRate)
|
||||
return;
|
||||
|
||||
panTimeout = setTimeout(function () {
|
||||
plot.pan({ left: prevPageX - e.pageX,
|
||||
top: prevPageY - e.pageY });
|
||||
prevPageX = e.pageX;
|
||||
prevPageY = e.pageY;
|
||||
|
||||
panTimeout = null;
|
||||
}, 1 / frameRate * 1000);
|
||||
}
|
||||
|
||||
function onDragEnd(e) {
|
||||
if (panTimeout) {
|
||||
clearTimeout(panTimeout);
|
||||
panTimeout = null;
|
||||
}
|
||||
|
||||
plot.getPlaceholder().css('cursor', prevCursor);
|
||||
plot.pan({ left: prevPageX - e.pageX,
|
||||
top: prevPageY - e.pageY });
|
||||
}
|
||||
|
||||
function bindEvents(plot, eventHolder) {
|
||||
var o = plot.getOptions();
|
||||
if (o.zoom.interactive) {
|
||||
eventHolder[o.zoom.trigger](onZoomClick);
|
||||
eventHolder.mousewheel(onMouseWheel);
|
||||
}
|
||||
|
||||
if (o.pan.interactive) {
|
||||
eventHolder.bind("dragstart", { distance: 10 }, onDragStart);
|
||||
eventHolder.bind("drag", onDrag);
|
||||
eventHolder.bind("dragend", onDragEnd);
|
||||
}
|
||||
}
|
||||
|
||||
plot.zoomOut = function (args) {
|
||||
if (!args)
|
||||
args = {};
|
||||
|
||||
if (!args.amount)
|
||||
args.amount = plot.getOptions().zoom.amount;
|
||||
|
||||
args.amount = 1 / args.amount;
|
||||
plot.zoom(args);
|
||||
};
|
||||
|
||||
plot.zoom = function (args) {
|
||||
if (!args)
|
||||
args = {};
|
||||
|
||||
var c = args.center,
|
||||
amount = args.amount || plot.getOptions().zoom.amount,
|
||||
w = plot.width(), h = plot.height();
|
||||
|
||||
if (!c)
|
||||
c = { left: w / 2, top: h / 2 };
|
||||
|
||||
var xf = c.left / w,
|
||||
yf = c.top / h,
|
||||
minmax = {
|
||||
x: {
|
||||
min: c.left - xf * w / amount,
|
||||
max: c.left + (1 - xf) * w / amount
|
||||
},
|
||||
y: {
|
||||
min: c.top - yf * h / amount,
|
||||
max: c.top + (1 - yf) * h / amount
|
||||
}
|
||||
};
|
||||
|
||||
$.each(plot.getAxes(), function(_, axis) {
|
||||
var opts = axis.options,
|
||||
min = minmax[axis.direction].min,
|
||||
max = minmax[axis.direction].max,
|
||||
zr = opts.zoomRange,
|
||||
pr = opts.panRange;
|
||||
|
||||
if (zr === false) // no zooming on this axis
|
||||
return;
|
||||
|
||||
min = axis.c2p(min);
|
||||
max = axis.c2p(max);
|
||||
if (min > max) {
|
||||
// make sure min < max
|
||||
var tmp = min;
|
||||
min = max;
|
||||
max = tmp;
|
||||
}
|
||||
|
||||
//Check that we are in panRange
|
||||
if (pr) {
|
||||
if (pr[0] != null && min < pr[0]) {
|
||||
min = pr[0];
|
||||
}
|
||||
if (pr[1] != null && max > pr[1]) {
|
||||
max = pr[1];
|
||||
}
|
||||
}
|
||||
|
||||
var range = max - min;
|
||||
if (zr &&
|
||||
((zr[0] != null && range < zr[0] && amount >1) ||
|
||||
(zr[1] != null && range > zr[1] && amount <1)))
|
||||
return;
|
||||
|
||||
opts.min = min;
|
||||
opts.max = max;
|
||||
});
|
||||
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
|
||||
if (!args.preventEvent)
|
||||
plot.getPlaceholder().trigger("plotzoom", [ plot, args ]);
|
||||
};
|
||||
|
||||
plot.pan = function (args) {
|
||||
var delta = {
|
||||
x: +args.left,
|
||||
y: +args.top
|
||||
};
|
||||
|
||||
if (isNaN(delta.x))
|
||||
delta.x = 0;
|
||||
if (isNaN(delta.y))
|
||||
delta.y = 0;
|
||||
|
||||
$.each(plot.getAxes(), function (_, axis) {
|
||||
var opts = axis.options,
|
||||
min, max, d = delta[axis.direction];
|
||||
|
||||
min = axis.c2p(axis.p2c(axis.min) + d),
|
||||
max = axis.c2p(axis.p2c(axis.max) + d);
|
||||
|
||||
var pr = opts.panRange;
|
||||
if (pr === false) // no panning on this axis
|
||||
return;
|
||||
|
||||
if (pr) {
|
||||
// check whether we hit the wall
|
||||
if (pr[0] != null && pr[0] > min) {
|
||||
d = pr[0] - min;
|
||||
min += d;
|
||||
max += d;
|
||||
}
|
||||
|
||||
if (pr[1] != null && pr[1] < max) {
|
||||
d = pr[1] - max;
|
||||
min += d;
|
||||
max += d;
|
||||
}
|
||||
}
|
||||
|
||||
opts.min = min;
|
||||
opts.max = max;
|
||||
});
|
||||
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
|
||||
if (!args.preventEvent)
|
||||
plot.getPlaceholder().trigger("plotpan", [ plot, args ]);
|
||||
};
|
||||
|
||||
function shutdown(plot, eventHolder) {
|
||||
eventHolder.unbind(plot.getOptions().zoom.trigger, onZoomClick);
|
||||
eventHolder.unbind("mousewheel", onMouseWheel);
|
||||
eventHolder.unbind("dragstart", onDragStart);
|
||||
eventHolder.unbind("drag", onDrag);
|
||||
eventHolder.unbind("dragend", onDragEnd);
|
||||
if (panTimeout)
|
||||
clearTimeout(panTimeout);
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(bindEvents);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'navigate',
|
||||
version: '1.3'
|
||||
});
|
||||
})(jQuery);
|
||||
820
public/assets/js/chart/flot-chart/jquery.flot.pie.js
Normal file
820
public/assets/js/chart/flot-chart/jquery.flot.pie.js
Normal file
@@ -0,0 +1,820 @@
|
||||
/* Flot plugin for rendering pie charts.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin assumes that each series has a single data value, and that each
|
||||
value is a positive integer or zero. Negative numbers don't make sense for a
|
||||
pie chart, and have unpredictable results. The values do NOT need to be
|
||||
passed in as percentages; the plugin will calculate the total and per-slice
|
||||
percentages internally.
|
||||
|
||||
* Created by Brian Medendorp
|
||||
|
||||
* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
pie: {
|
||||
show: true/false
|
||||
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
|
||||
innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
|
||||
startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
|
||||
tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
|
||||
offset: {
|
||||
top: integer value to move the pie up or down
|
||||
left: integer value to move the pie left or right, or 'auto'
|
||||
},
|
||||
stroke: {
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
|
||||
width: integer pixel width of the stroke
|
||||
},
|
||||
label: {
|
||||
show: true/false, or 'auto'
|
||||
formatter: a user-defined function that modifies the text/style of the label text
|
||||
radius: 0-1 for percentage of fullsize, or a specified pixel length
|
||||
background: {
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
|
||||
opacity: 0-1
|
||||
},
|
||||
threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
|
||||
},
|
||||
combine: {
|
||||
threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
|
||||
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined
|
||||
label: any text value of what the combined slice should be labeled
|
||||
}
|
||||
highlight: {
|
||||
opacity: 0-1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
More detail and specific examples can be found in the included HTML file.
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
// Maximum redraw attempts when fitting labels within the plot
|
||||
|
||||
var REDRAW_ATTEMPTS = 10;
|
||||
|
||||
// Factor by which to shrink the pie when fitting labels within the plot
|
||||
|
||||
var REDRAW_SHRINK = 0.95;
|
||||
|
||||
function init(plot) {
|
||||
|
||||
var canvas = null,
|
||||
target = null,
|
||||
options = null,
|
||||
maxRadius = null,
|
||||
centerLeft = null,
|
||||
centerTop = null,
|
||||
processed = false,
|
||||
ctx = null;
|
||||
|
||||
// interactive variables
|
||||
|
||||
var highlights = [];
|
||||
|
||||
// add hook to determine if pie plugin in enabled, and then perform necessary operations
|
||||
|
||||
plot.hooks.processOptions.push(function(plot, options) {
|
||||
if (options.series.pie.show) {
|
||||
|
||||
options.grid.show = false;
|
||||
|
||||
// set labels.show
|
||||
|
||||
if (options.series.pie.label.show == "auto") {
|
||||
if (options.legend.show) {
|
||||
options.series.pie.label.show = false;
|
||||
} else {
|
||||
options.series.pie.label.show = true;
|
||||
}
|
||||
}
|
||||
|
||||
// set radius
|
||||
|
||||
if (options.series.pie.radius == "auto") {
|
||||
if (options.series.pie.label.show) {
|
||||
options.series.pie.radius = 3/4;
|
||||
} else {
|
||||
options.series.pie.radius = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// ensure sane tilt
|
||||
|
||||
if (options.series.pie.tilt > 1) {
|
||||
options.series.pie.tilt = 1;
|
||||
} else if (options.series.pie.tilt < 0) {
|
||||
options.series.pie.tilt = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.bindEvents.push(function(plot, eventHolder) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
if (options.grid.hoverable) {
|
||||
eventHolder.unbind("mousemove").mousemove(onMouseMove);
|
||||
}
|
||||
if (options.grid.clickable) {
|
||||
eventHolder.unbind("click").click(onClick);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
processDatapoints(plot, series, data, datapoints);
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.drawOverlay.push(function(plot, octx) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
drawOverlay(plot, octx);
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.draw.push(function(plot, newCtx) {
|
||||
var options = plot.getOptions();
|
||||
if (options.series.pie.show) {
|
||||
draw(plot, newCtx);
|
||||
}
|
||||
});
|
||||
|
||||
function processDatapoints(plot, series, datapoints) {
|
||||
if (!processed) {
|
||||
processed = true;
|
||||
canvas = plot.getCanvas();
|
||||
target = $(canvas).parent();
|
||||
options = plot.getOptions();
|
||||
plot.setData(combine(plot.getData()));
|
||||
}
|
||||
}
|
||||
|
||||
function combine(data) {
|
||||
|
||||
var total = 0,
|
||||
combined = 0,
|
||||
numCombined = 0,
|
||||
color = options.series.pie.combine.color,
|
||||
newdata = [];
|
||||
|
||||
// Fix up the raw data from Flot, ensuring the data is numeric
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
|
||||
var value = data[i].data;
|
||||
|
||||
// If the data is an array, we'll assume that it's a standard
|
||||
// Flot x-y pair, and are concerned only with the second value.
|
||||
|
||||
// Note how we use the original array, rather than creating a
|
||||
// new one; this is more efficient and preserves any extra data
|
||||
// that the user may have stored in higher indexes.
|
||||
|
||||
if ($.isArray(value) && value.length == 1) {
|
||||
value = value[0];
|
||||
}
|
||||
|
||||
if ($.isArray(value)) {
|
||||
// Equivalent to $.isNumeric() but compatible with jQuery < 1.7
|
||||
if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {
|
||||
value[1] = +value[1];
|
||||
} else {
|
||||
value[1] = 0;
|
||||
}
|
||||
} else if (!isNaN(parseFloat(value)) && isFinite(value)) {
|
||||
value = [1, +value];
|
||||
} else {
|
||||
value = [1, 0];
|
||||
}
|
||||
|
||||
data[i].data = [value];
|
||||
}
|
||||
|
||||
// Sum up all the slices, so we can calculate percentages for each
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
total += data[i].data[0][1];
|
||||
}
|
||||
|
||||
// Count the number of slices with percentages below the combine
|
||||
// threshold; if it turns out to be just one, we won't combine.
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
var value = data[i].data[0][1];
|
||||
if (value / total <= options.series.pie.combine.threshold) {
|
||||
combined += value;
|
||||
numCombined++;
|
||||
if (!color) {
|
||||
color = data[i].color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
var value = data[i].data[0][1];
|
||||
if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
|
||||
newdata.push(
|
||||
$.extend(data[i], { /* extend to allow keeping all other original data values
|
||||
and using them e.g. in labelFormatter. */
|
||||
data: [[1, value]],
|
||||
color: data[i].color,
|
||||
label: data[i].label,
|
||||
angle: value * Math.PI * 2 / total,
|
||||
percent: value / (total / 100)
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (numCombined > 1) {
|
||||
newdata.push({
|
||||
data: [[1, combined]],
|
||||
color: color,
|
||||
label: options.series.pie.combine.label,
|
||||
angle: combined * Math.PI * 2 / total,
|
||||
percent: combined / (total / 100)
|
||||
});
|
||||
}
|
||||
|
||||
return newdata;
|
||||
}
|
||||
|
||||
function draw(plot, newCtx) {
|
||||
|
||||
if (!target) {
|
||||
return; // if no series were passed
|
||||
}
|
||||
|
||||
var canvasWidth = plot.getPlaceholder().width(),
|
||||
canvasHeight = plot.getPlaceholder().height(),
|
||||
legendWidth = target.children().filter(".legend").children().width() || 0;
|
||||
|
||||
ctx = newCtx;
|
||||
|
||||
// WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!
|
||||
|
||||
// When combining smaller slices into an 'other' slice, we need to
|
||||
// add a new series. Since Flot gives plugins no way to modify the
|
||||
// list of series, the pie plugin uses a hack where the first call
|
||||
// to processDatapoints results in a call to setData with the new
|
||||
// list of series, then subsequent processDatapoints do nothing.
|
||||
|
||||
// The plugin-global 'processed' flag is used to control this hack;
|
||||
// it starts out false, and is set to true after the first call to
|
||||
// processDatapoints.
|
||||
|
||||
// Unfortunately this turns future setData calls into no-ops; they
|
||||
// call processDatapoints, the flag is true, and nothing happens.
|
||||
|
||||
// To fix this we'll set the flag back to false here in draw, when
|
||||
// all series have been processed, so the next sequence of calls to
|
||||
// processDatapoints once again starts out with a slice-combine.
|
||||
// This is really a hack; in 0.9 we need to give plugins a proper
|
||||
// way to modify series before any processing begins.
|
||||
|
||||
processed = false;
|
||||
|
||||
// calculate maximum radius and center point
|
||||
|
||||
maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;
|
||||
centerTop = canvasHeight / 2 + options.series.pie.offset.top;
|
||||
centerLeft = canvasWidth / 2;
|
||||
|
||||
if (options.series.pie.offset.left == "auto") {
|
||||
if (options.legend.position.match("w")) {
|
||||
centerLeft += legendWidth / 2;
|
||||
} else {
|
||||
centerLeft -= legendWidth / 2;
|
||||
}
|
||||
if (centerLeft < maxRadius) {
|
||||
centerLeft = maxRadius;
|
||||
} else if (centerLeft > canvasWidth - maxRadius) {
|
||||
centerLeft = canvasWidth - maxRadius;
|
||||
}
|
||||
} else {
|
||||
centerLeft += options.series.pie.offset.left;
|
||||
}
|
||||
|
||||
var slices = plot.getData(),
|
||||
attempts = 0;
|
||||
|
||||
// Keep shrinking the pie's radius until drawPie returns true,
|
||||
// indicating that all the labels fit, or we try too many times.
|
||||
|
||||
do {
|
||||
if (attempts > 0) {
|
||||
maxRadius *= REDRAW_SHRINK;
|
||||
}
|
||||
attempts += 1;
|
||||
clear();
|
||||
if (options.series.pie.tilt <= 0.8) {
|
||||
drawShadow();
|
||||
}
|
||||
} while (!drawPie() && attempts < REDRAW_ATTEMPTS)
|
||||
|
||||
if (attempts >= REDRAW_ATTEMPTS) {
|
||||
clear();
|
||||
target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>");
|
||||
}
|
||||
|
||||
if (plot.setSeries && plot.insertLegend) {
|
||||
plot.setSeries(slices);
|
||||
plot.insertLegend();
|
||||
}
|
||||
|
||||
// we're actually done at this point, just defining internal functions at this point
|
||||
|
||||
function clear() {
|
||||
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
|
||||
target.children().filter(".pieLabel, .pieLabelBackground").remove();
|
||||
}
|
||||
|
||||
function drawShadow() {
|
||||
|
||||
var shadowLeft = options.series.pie.shadow.left;
|
||||
var shadowTop = options.series.pie.shadow.top;
|
||||
var edge = 10;
|
||||
var alpha = options.series.pie.shadow.alpha;
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {
|
||||
return; // shadow would be outside canvas, so don't draw it
|
||||
}
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(shadowLeft,shadowTop);
|
||||
ctx.globalAlpha = alpha;
|
||||
ctx.fillStyle = "#000";
|
||||
|
||||
// center and rotate to starting position
|
||||
|
||||
ctx.translate(centerLeft,centerTop);
|
||||
ctx.scale(1, options.series.pie.tilt);
|
||||
|
||||
//radius -= edge;
|
||||
|
||||
for (var i = 1; i <= edge; i++) {
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, radius, 0, Math.PI * 2, false);
|
||||
ctx.fill();
|
||||
radius -= i;
|
||||
}
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function drawPie() {
|
||||
|
||||
var startAngle = Math.PI * options.series.pie.startAngle;
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
// center and rotate to starting position
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(centerLeft,centerTop);
|
||||
ctx.scale(1, options.series.pie.tilt);
|
||||
//ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
|
||||
|
||||
// draw slices
|
||||
|
||||
ctx.save();
|
||||
var currentAngle = startAngle;
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
slices[i].startAngle = currentAngle;
|
||||
drawSlice(slices[i].angle, slices[i].color, true);
|
||||
}
|
||||
ctx.restore();
|
||||
|
||||
// draw slice outlines
|
||||
|
||||
if (options.series.pie.stroke.width > 0) {
|
||||
ctx.save();
|
||||
ctx.lineWidth = options.series.pie.stroke.width;
|
||||
currentAngle = startAngle;
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
// draw donut hole
|
||||
|
||||
drawDonutHole(ctx);
|
||||
|
||||
ctx.restore();
|
||||
|
||||
// Draw the labels, returning true if they fit within the plot
|
||||
|
||||
if (options.series.pie.label.show) {
|
||||
return drawLabels();
|
||||
} else return true;
|
||||
|
||||
function drawSlice(angle, color, fill) {
|
||||
|
||||
if (angle <= 0 || isNaN(angle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fill) {
|
||||
ctx.fillStyle = color;
|
||||
} else {
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineJoin = "round";
|
||||
}
|
||||
|
||||
ctx.beginPath();
|
||||
if (Math.abs(angle - Math.PI * 2) > 0.000000001) {
|
||||
ctx.moveTo(0, 0); // Center of the pie
|
||||
}
|
||||
|
||||
//ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera
|
||||
ctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false);
|
||||
ctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false);
|
||||
ctx.closePath();
|
||||
//ctx.rotate(angle); // This doesn't work properly in Opera
|
||||
currentAngle += angle;
|
||||
|
||||
if (fill) {
|
||||
ctx.fill();
|
||||
} else {
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
function drawLabels() {
|
||||
|
||||
var currentAngle = startAngle;
|
||||
var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
|
||||
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
if (slices[i].percent >= options.series.pie.label.threshold * 100) {
|
||||
if (!drawLabel(slices[i], currentAngle, i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
currentAngle += slices[i].angle;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
function drawLabel(slice, startAngle, index) {
|
||||
|
||||
if (slice.data[0][1] == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// format label text
|
||||
|
||||
var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
|
||||
|
||||
if (lf) {
|
||||
text = lf(slice.label, slice);
|
||||
} else {
|
||||
text = slice.label;
|
||||
}
|
||||
|
||||
if (plf) {
|
||||
text = plf(text, slice);
|
||||
}
|
||||
|
||||
var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;
|
||||
var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
|
||||
var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
|
||||
|
||||
var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
|
||||
target.append(html);
|
||||
|
||||
var label = target.children("#pieLabel" + index);
|
||||
var labelTop = (y - label.height() / 2);
|
||||
var labelLeft = (x - label.width() / 2);
|
||||
|
||||
label.css("top", labelTop);
|
||||
label.css("left", labelLeft);
|
||||
|
||||
// check to make sure that the label is not outside the canvas
|
||||
|
||||
if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (options.series.pie.label.background.opacity != 0) {
|
||||
|
||||
// put in the transparent background separately to avoid blended labels and label boxes
|
||||
|
||||
var c = options.series.pie.label.background.color;
|
||||
|
||||
if (c == null) {
|
||||
c = slice.color;
|
||||
}
|
||||
|
||||
var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;";
|
||||
$("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>")
|
||||
.css("opacity", options.series.pie.label.background.opacity)
|
||||
.insertBefore(label);
|
||||
}
|
||||
|
||||
return true;
|
||||
} // end individual label function
|
||||
} // end drawLabels function
|
||||
} // end drawPie function
|
||||
} // end draw function
|
||||
|
||||
// Placed here because it needs to be accessed from multiple locations
|
||||
|
||||
function drawDonutHole(layer) {
|
||||
if (options.series.pie.innerRadius > 0) {
|
||||
|
||||
// subtract the center
|
||||
|
||||
layer.save();
|
||||
var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
|
||||
layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color
|
||||
layer.beginPath();
|
||||
layer.fillStyle = options.series.pie.stroke.color;
|
||||
layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
|
||||
layer.fill();
|
||||
layer.closePath();
|
||||
layer.restore();
|
||||
|
||||
// add inner stroke
|
||||
|
||||
layer.save();
|
||||
layer.beginPath();
|
||||
layer.strokeStyle = options.series.pie.stroke.color;
|
||||
layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
|
||||
layer.stroke();
|
||||
layer.closePath();
|
||||
layer.restore();
|
||||
|
||||
// TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
|
||||
}
|
||||
}
|
||||
|
||||
//-- Additional Interactive related functions --
|
||||
|
||||
function isPointInPoly(poly, pt) {
|
||||
for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
|
||||
((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))
|
||||
&& (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
|
||||
&& (c = !c);
|
||||
return c;
|
||||
}
|
||||
|
||||
function findNearbySlice(mouseX, mouseY) {
|
||||
|
||||
var slices = plot.getData(),
|
||||
options = plot.getOptions(),
|
||||
radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
|
||||
x, y;
|
||||
|
||||
for (var i = 0; i < slices.length; ++i) {
|
||||
|
||||
var s = slices[i];
|
||||
|
||||
if (s.pie.show) {
|
||||
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 0); // Center of the pie
|
||||
//ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
|
||||
ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);
|
||||
ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);
|
||||
ctx.closePath();
|
||||
x = mouseX - centerLeft;
|
||||
y = mouseY - centerTop;
|
||||
|
||||
if (ctx.isPointInPath) {
|
||||
if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {
|
||||
ctx.restore();
|
||||
return {
|
||||
datapoint: [s.percent, s.data],
|
||||
dataIndex: 0,
|
||||
series: s,
|
||||
seriesIndex: i
|
||||
};
|
||||
}
|
||||
} else {
|
||||
|
||||
// excanvas for IE doesn;t support isPointInPath, this is a workaround.
|
||||
|
||||
var p1X = radius * Math.cos(s.startAngle),
|
||||
p1Y = radius * Math.sin(s.startAngle),
|
||||
p2X = radius * Math.cos(s.startAngle + s.angle / 4),
|
||||
p2Y = radius * Math.sin(s.startAngle + s.angle / 4),
|
||||
p3X = radius * Math.cos(s.startAngle + s.angle / 2),
|
||||
p3Y = radius * Math.sin(s.startAngle + s.angle / 2),
|
||||
p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),
|
||||
p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),
|
||||
p5X = radius * Math.cos(s.startAngle + s.angle),
|
||||
p5Y = radius * Math.sin(s.startAngle + s.angle),
|
||||
arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],
|
||||
arrPoint = [x, y];
|
||||
|
||||
// TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
|
||||
|
||||
if (isPointInPoly(arrPoly, arrPoint)) {
|
||||
ctx.restore();
|
||||
return {
|
||||
datapoint: [s.percent, s.data],
|
||||
dataIndex: 0,
|
||||
series: s,
|
||||
seriesIndex: i
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function onMouseMove(e) {
|
||||
triggerClickHoverEvent("plothover", e);
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
triggerClickHoverEvent("plotclick", e);
|
||||
}
|
||||
|
||||
// trigger click or hover event (they send the same parameters so we share their code)
|
||||
|
||||
function triggerClickHoverEvent(eventname, e) {
|
||||
|
||||
var offset = plot.offset();
|
||||
var canvasX = parseInt(e.pageX - offset.left);
|
||||
var canvasY = parseInt(e.pageY - offset.top);
|
||||
var item = findNearbySlice(canvasX, canvasY);
|
||||
|
||||
if (options.grid.autoHighlight) {
|
||||
|
||||
// clear auto-highlights
|
||||
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
var h = highlights[i];
|
||||
if (h.auto == eventname && !(item && h.series == item.series)) {
|
||||
unhighlight(h.series);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// highlight the slice
|
||||
|
||||
if (item) {
|
||||
highlight(item.series, eventname);
|
||||
}
|
||||
|
||||
// trigger any hover bind events
|
||||
|
||||
var pos = { pageX: e.pageX, pageY: e.pageY };
|
||||
target.trigger(eventname, [pos, item]);
|
||||
}
|
||||
|
||||
function highlight(s, auto) {
|
||||
//if (typeof s == "number") {
|
||||
// s = series[s];
|
||||
//}
|
||||
|
||||
var i = indexOfHighlight(s);
|
||||
|
||||
if (i == -1) {
|
||||
highlights.push({ series: s, auto: auto });
|
||||
plot.triggerRedrawOverlay();
|
||||
} else if (!auto) {
|
||||
highlights[i].auto = false;
|
||||
}
|
||||
}
|
||||
|
||||
function unhighlight(s) {
|
||||
if (s == null) {
|
||||
highlights = [];
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
//if (typeof s == "number") {
|
||||
// s = series[s];
|
||||
//}
|
||||
|
||||
var i = indexOfHighlight(s);
|
||||
|
||||
if (i != -1) {
|
||||
highlights.splice(i, 1);
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
function indexOfHighlight(s) {
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
var h = highlights[i];
|
||||
if (h.series == s)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function drawOverlay(plot, octx) {
|
||||
|
||||
var options = plot.getOptions();
|
||||
|
||||
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
|
||||
|
||||
octx.save();
|
||||
octx.translate(centerLeft, centerTop);
|
||||
octx.scale(1, options.series.pie.tilt);
|
||||
|
||||
for (var i = 0; i < highlights.length; ++i) {
|
||||
drawHighlight(highlights[i].series);
|
||||
}
|
||||
|
||||
drawDonutHole(octx);
|
||||
|
||||
octx.restore();
|
||||
|
||||
function drawHighlight(series) {
|
||||
|
||||
if (series.angle <= 0 || isNaN(series.angle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
|
||||
octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor
|
||||
octx.beginPath();
|
||||
if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {
|
||||
octx.moveTo(0, 0); // Center of the pie
|
||||
}
|
||||
octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);
|
||||
octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);
|
||||
octx.closePath();
|
||||
octx.fill();
|
||||
}
|
||||
}
|
||||
} // end init (plugin body)
|
||||
|
||||
// define pie specific options and their default values
|
||||
|
||||
var options = {
|
||||
series: {
|
||||
pie: {
|
||||
show: false,
|
||||
radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
|
||||
innerRadius: 0, /* for donut */
|
||||
startAngle: 3/2,
|
||||
tilt: 1,
|
||||
shadow: {
|
||||
left: 5, // shadow left offset
|
||||
top: 15, // shadow top offset
|
||||
alpha: 0.02 // shadow alpha
|
||||
},
|
||||
offset: {
|
||||
top: 0,
|
||||
left: "auto"
|
||||
},
|
||||
stroke: {
|
||||
color: "#fff",
|
||||
width: 1
|
||||
},
|
||||
label: {
|
||||
show: "auto",
|
||||
formatter: function(label, slice) {
|
||||
return "<div style='font-size:x-small;text-align:center;padding:2px;color:" + slice.color + ";'>" + label + "<br/>" + Math.round(slice.percent) + "%</div>";
|
||||
}, // formatter function
|
||||
radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
|
||||
background: {
|
||||
color: null,
|
||||
opacity: 0
|
||||
},
|
||||
threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
|
||||
},
|
||||
combine: {
|
||||
threshold: -1, // percentage at which to combine little slices into one larger slice
|
||||
color: null, // color to give the new slice (auto-generated if null)
|
||||
label: "Other" // label to give the new slice
|
||||
},
|
||||
highlight: {
|
||||
//color: "#fff", // will add this functionality once parseColor is available
|
||||
opacity: 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "pie",
|
||||
version: "1.1"
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
59
public/assets/js/chart/flot-chart/jquery.flot.resize.js
Normal file
59
public/assets/js/chart/flot-chart/jquery.flot.resize.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/* Flot plugin for automatically redrawing plots as the placeholder resizes.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
It works by listening for changes on the placeholder div (through the jQuery
|
||||
resize event plugin) - if the size changes, it will redraw the plot.
|
||||
|
||||
There are no options. If you need to disable the plugin for some plots, you
|
||||
can just fix the size of their placeholders.
|
||||
|
||||
*/
|
||||
|
||||
/* Inline dependency:
|
||||
* jQuery resize event - v1.1 - 3/14/2010
|
||||
* http://benalman.com/projects/jquery-resize-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function($,e,t){"$:nomunge";var i=[],n=$.resize=$.extend($.resize,{}),a,r=false,s="setTimeout",u="resize",m=u+"-special-event",o="pendingDelay",l="activeDelay",f="throttleWindow";n[o]=200;n[l]=20;n[f]=true;$.event.special[u]={setup:function(){if(!n[f]&&this[s]){return false}var e=$(this);i.push(this);e.data(m,{w:e.width(),h:e.height()});if(i.length===1){a=t;h()}},teardown:function(){if(!n[f]&&this[s]){return false}var e=$(this);for(var t=i.length-1;t>=0;t--){if(i[t]==this){i.splice(t,1);break}}e.removeData(m);if(!i.length){if(r){cancelAnimationFrame(a)}else{clearTimeout(a)}a=null}},add:function(e){if(!n[f]&&this[s]){return false}var i;function a(e,n,a){var r=$(this),s=r.data(m)||{};s.w=n!==t?n:r.width();s.h=a!==t?a:r.height();i.apply(this,arguments)}if($.isFunction(e)){i=e;return a}else{i=e.handler;e.handler=a}}};function h(t){if(r===true){r=t||1}for(var s=i.length-1;s>=0;s--){var l=$(i[s]);if(l[0]==e||l.is(":visible")){var f=l.width(),c=l.height(),d=l.data(m);if(d&&(f!==d.w||c!==d.h)){l.trigger(u,[d.w=f,d.h=c]);r=t||true}}else{d=l.data(m);d.w=0;d.h=0}}if(a!==null){if(r&&(t==null||t-r<1e3)){a=e.requestAnimationFrame(h)}else{a=setTimeout(h,n[o]);r=false}}}if(!e.requestAnimationFrame){e.requestAnimationFrame=function(){return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t,i){return e.setTimeout(function(){t((new Date).getTime())},n[l])}}()}if(!e.cancelAnimationFrame){e.cancelAnimationFrame=function(){return e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout}()}})(jQuery,this);
|
||||
|
||||
(function ($) {
|
||||
var options = { }; // no options
|
||||
|
||||
function init(plot) {
|
||||
function onResize() {
|
||||
var placeholder = plot.getPlaceholder();
|
||||
|
||||
// somebody might have hidden us and we can't plot
|
||||
// when we don't have the dimensions
|
||||
if (placeholder.width() == 0 || placeholder.height() == 0)
|
||||
return;
|
||||
|
||||
plot.resize();
|
||||
plot.setupGrid();
|
||||
plot.draw();
|
||||
}
|
||||
|
||||
function bindEvents(plot, eventHolder) {
|
||||
plot.getPlaceholder().resize(onResize);
|
||||
}
|
||||
|
||||
function shutdown(plot, eventHolder) {
|
||||
plot.getPlaceholder().unbind("resize", onResize);
|
||||
}
|
||||
|
||||
plot.hooks.bindEvents.push(bindEvents);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'resize',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
360
public/assets/js/chart/flot-chart/jquery.flot.selection.js
Normal file
360
public/assets/js/chart/flot-chart/jquery.flot.selection.js
Normal file
@@ -0,0 +1,360 @@
|
||||
/* Flot plugin for selecting regions of a plot.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
selection: {
|
||||
mode: null or "x" or "y" or "xy",
|
||||
color: color,
|
||||
shape: "round" or "miter" or "bevel",
|
||||
minSize: number of pixels
|
||||
}
|
||||
|
||||
Selection support is enabled by setting the mode to one of "x", "y" or "xy".
|
||||
In "x" mode, the user will only be able to specify the x range, similarly for
|
||||
"y" mode. For "xy", the selection becomes a rectangle where both ranges can be
|
||||
specified. "color" is color of the selection (if you need to change the color
|
||||
later on, you can get to it with plot.getOptions().selection.color). "shape"
|
||||
is the shape of the corners of the selection.
|
||||
|
||||
"minSize" is the minimum size a selection can be in pixels. This value can
|
||||
be customized to determine the smallest size a selection can be and still
|
||||
have the selection rectangle be displayed. When customizing this value, the
|
||||
fact that it refers to pixels, not axis units must be taken into account.
|
||||
Thus, for example, if there is a bar graph in time mode with BarWidth set to 1
|
||||
minute, setting "minSize" to 1 will not make the minimum selection size 1
|
||||
minute, but rather 1 pixel. Note also that setting "minSize" to 0 will prevent
|
||||
"plotunselected" events from being fired when the user clicks the mouse without
|
||||
dragging.
|
||||
|
||||
When selection support is enabled, a "plotselected" event will be emitted on
|
||||
the DOM element you passed into the plot function. The event handler gets a
|
||||
parameter with the ranges selected on the axes, like this:
|
||||
|
||||
placeholder.bind( "plotselected", function( event, ranges ) {
|
||||
alert("You selected " + ranges.xaxis.from + " to " + ranges.xaxis.to)
|
||||
// similar for yaxis - with multiple axes, the extra ones are in
|
||||
// x2axis, x3axis, ...
|
||||
});
|
||||
|
||||
The "plotselected" event is only fired when the user has finished making the
|
||||
selection. A "plotselecting" event is fired during the process with the same
|
||||
parameters as the "plotselected" event, in case you want to know what's
|
||||
happening while it's happening,
|
||||
|
||||
A "plotunselected" event with no arguments is emitted when the user clicks the
|
||||
mouse to remove the selection. As stated above, setting "minSize" to 0 will
|
||||
destroy this behavior.
|
||||
|
||||
The plugin allso adds the following methods to the plot object:
|
||||
|
||||
- setSelection( ranges, preventEvent )
|
||||
|
||||
Set the selection rectangle. The passed in ranges is on the same form as
|
||||
returned in the "plotselected" event. If the selection mode is "x", you
|
||||
should put in either an xaxis range, if the mode is "y" you need to put in
|
||||
an yaxis range and both xaxis and yaxis if the selection mode is "xy", like
|
||||
this:
|
||||
|
||||
setSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } });
|
||||
|
||||
setSelection will trigger the "plotselected" event when called. If you don't
|
||||
want that to happen, e.g. if you're inside a "plotselected" handler, pass
|
||||
true as the second parameter. If you are using multiple axes, you can
|
||||
specify the ranges on any of those, e.g. as x2axis/x3axis/... instead of
|
||||
xaxis, the plugin picks the first one it sees.
|
||||
|
||||
- clearSelection( preventEvent )
|
||||
|
||||
Clear the selection rectangle. Pass in true to avoid getting a
|
||||
"plotunselected" event.
|
||||
|
||||
- getSelection()
|
||||
|
||||
Returns the current selection in the same format as the "plotselected"
|
||||
event. If there's currently no selection, the function returns null.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
function init(plot) {
|
||||
var selection = {
|
||||
first: { x: -1, y: -1}, second: { x: -1, y: -1},
|
||||
show: false,
|
||||
active: false
|
||||
};
|
||||
|
||||
// FIXME: The drag handling implemented here should be
|
||||
// abstracted out, there's some similar code from a library in
|
||||
// the navigation plugin, this should be massaged a bit to fit
|
||||
// the Flot cases here better and reused. Doing this would
|
||||
// make this plugin much slimmer.
|
||||
var savedhandlers = {};
|
||||
|
||||
var mouseUpHandler = null;
|
||||
|
||||
function onMouseMove(e) {
|
||||
if (selection.active) {
|
||||
updateSelection(e);
|
||||
|
||||
plot.getPlaceholder().trigger("plotselecting", [ getSelection() ]);
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseDown(e) {
|
||||
if (e.which != 1) // only accept left-click
|
||||
return;
|
||||
|
||||
// cancel out any text selections
|
||||
document.body.focus();
|
||||
|
||||
// prevent text selection and drag in old-school browsers
|
||||
if (document.onselectstart !== undefined && savedhandlers.onselectstart == null) {
|
||||
savedhandlers.onselectstart = document.onselectstart;
|
||||
document.onselectstart = function () { return false; };
|
||||
}
|
||||
if (document.ondrag !== undefined && savedhandlers.ondrag == null) {
|
||||
savedhandlers.ondrag = document.ondrag;
|
||||
document.ondrag = function () { return false; };
|
||||
}
|
||||
|
||||
setSelectionPos(selection.first, e);
|
||||
|
||||
selection.active = true;
|
||||
|
||||
// this is a bit silly, but we have to use a closure to be
|
||||
// able to whack the same handler again
|
||||
mouseUpHandler = function (e) { onMouseUp(e); };
|
||||
|
||||
$(document).one("mouseup", mouseUpHandler);
|
||||
}
|
||||
|
||||
function onMouseUp(e) {
|
||||
mouseUpHandler = null;
|
||||
|
||||
// revert drag stuff for old-school browsers
|
||||
if (document.onselectstart !== undefined)
|
||||
document.onselectstart = savedhandlers.onselectstart;
|
||||
if (document.ondrag !== undefined)
|
||||
document.ondrag = savedhandlers.ondrag;
|
||||
|
||||
// no more dragging
|
||||
selection.active = false;
|
||||
updateSelection(e);
|
||||
|
||||
if (selectionIsSane())
|
||||
triggerSelectedEvent();
|
||||
else {
|
||||
// this counts as a clear
|
||||
plot.getPlaceholder().trigger("plotunselected", [ ]);
|
||||
plot.getPlaceholder().trigger("plotselecting", [ null ]);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getSelection() {
|
||||
if (!selectionIsSane())
|
||||
return null;
|
||||
|
||||
if (!selection.show) return null;
|
||||
|
||||
var r = {}, c1 = selection.first, c2 = selection.second;
|
||||
$.each(plot.getAxes(), function (name, axis) {
|
||||
if (axis.used) {
|
||||
var p1 = axis.c2p(c1[axis.direction]), p2 = axis.c2p(c2[axis.direction]);
|
||||
r[name] = { from: Math.min(p1, p2), to: Math.max(p1, p2) };
|
||||
}
|
||||
});
|
||||
return r;
|
||||
}
|
||||
|
||||
function triggerSelectedEvent() {
|
||||
var r = getSelection();
|
||||
|
||||
plot.getPlaceholder().trigger("plotselected", [ r ]);
|
||||
|
||||
// backwards-compat stuff, to be removed in future
|
||||
if (r.xaxis && r.yaxis)
|
||||
plot.getPlaceholder().trigger("selected", [ { x1: r.xaxis.from, y1: r.yaxis.from, x2: r.xaxis.to, y2: r.yaxis.to } ]);
|
||||
}
|
||||
|
||||
function clamp(min, value, max) {
|
||||
return value < min ? min: (value > max ? max: value);
|
||||
}
|
||||
|
||||
function setSelectionPos(pos, e) {
|
||||
var o = plot.getOptions();
|
||||
var offset = plot.getPlaceholder().offset();
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
pos.x = clamp(0, e.pageX - offset.left - plotOffset.left, plot.width());
|
||||
pos.y = clamp(0, e.pageY - offset.top - plotOffset.top, plot.height());
|
||||
|
||||
if (o.selection.mode == "y")
|
||||
pos.x = pos == selection.first ? 0 : plot.width();
|
||||
|
||||
if (o.selection.mode == "x")
|
||||
pos.y = pos == selection.first ? 0 : plot.height();
|
||||
}
|
||||
|
||||
function updateSelection(pos) {
|
||||
if (pos.pageX == null)
|
||||
return;
|
||||
|
||||
setSelectionPos(selection.second, pos);
|
||||
if (selectionIsSane()) {
|
||||
selection.show = true;
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
else
|
||||
clearSelection(true);
|
||||
}
|
||||
|
||||
function clearSelection(preventEvent) {
|
||||
if (selection.show) {
|
||||
selection.show = false;
|
||||
plot.triggerRedrawOverlay();
|
||||
if (!preventEvent)
|
||||
plot.getPlaceholder().trigger("plotunselected", [ ]);
|
||||
}
|
||||
}
|
||||
|
||||
// function taken from markings support in Flot
|
||||
function extractRange(ranges, coord) {
|
||||
var axis, from, to, key, axes = plot.getAxes();
|
||||
|
||||
for (var k in axes) {
|
||||
axis = axes[k];
|
||||
if (axis.direction == coord) {
|
||||
key = coord + axis.n + "axis";
|
||||
if (!ranges[key] && axis.n == 1)
|
||||
key = coord + "axis"; // support x1axis as xaxis
|
||||
if (ranges[key]) {
|
||||
from = ranges[key].from;
|
||||
to = ranges[key].to;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// backwards-compat stuff - to be removed in future
|
||||
if (!ranges[key]) {
|
||||
axis = coord == "x" ? plot.getXAxes()[0] : plot.getYAxes()[0];
|
||||
from = ranges[coord + "1"];
|
||||
to = ranges[coord + "2"];
|
||||
}
|
||||
|
||||
// auto-reverse as an added bonus
|
||||
if (from != null && to != null && from > to) {
|
||||
var tmp = from;
|
||||
from = to;
|
||||
to = tmp;
|
||||
}
|
||||
|
||||
return { from: from, to: to, axis: axis };
|
||||
}
|
||||
|
||||
function setSelection(ranges, preventEvent) {
|
||||
var axis, range, o = plot.getOptions();
|
||||
|
||||
if (o.selection.mode == "y") {
|
||||
selection.first.x = 0;
|
||||
selection.second.x = plot.width();
|
||||
}
|
||||
else {
|
||||
range = extractRange(ranges, "x");
|
||||
|
||||
selection.first.x = range.axis.p2c(range.from);
|
||||
selection.second.x = range.axis.p2c(range.to);
|
||||
}
|
||||
|
||||
if (o.selection.mode == "x") {
|
||||
selection.first.y = 0;
|
||||
selection.second.y = plot.height();
|
||||
}
|
||||
else {
|
||||
range = extractRange(ranges, "y");
|
||||
|
||||
selection.first.y = range.axis.p2c(range.from);
|
||||
selection.second.y = range.axis.p2c(range.to);
|
||||
}
|
||||
|
||||
selection.show = true;
|
||||
plot.triggerRedrawOverlay();
|
||||
if (!preventEvent && selectionIsSane())
|
||||
triggerSelectedEvent();
|
||||
}
|
||||
|
||||
function selectionIsSane() {
|
||||
var minSize = plot.getOptions().selection.minSize;
|
||||
return Math.abs(selection.second.x - selection.first.x) >= minSize &&
|
||||
Math.abs(selection.second.y - selection.first.y) >= minSize;
|
||||
}
|
||||
|
||||
plot.clearSelection = clearSelection;
|
||||
plot.setSelection = setSelection;
|
||||
plot.getSelection = getSelection;
|
||||
|
||||
plot.hooks.bindEvents.push(function(plot, eventHolder) {
|
||||
var o = plot.getOptions();
|
||||
if (o.selection.mode != null) {
|
||||
eventHolder.mousemove(onMouseMove);
|
||||
eventHolder.mousedown(onMouseDown);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
plot.hooks.drawOverlay.push(function (plot, ctx) {
|
||||
// draw selection
|
||||
if (selection.show && selectionIsSane()) {
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
var o = plot.getOptions();
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
|
||||
var c = $.color.parse(o.selection.color);
|
||||
|
||||
ctx.strokeStyle = c.scale('a', 0.8).toString();
|
||||
ctx.lineWidth = 1;
|
||||
ctx.lineJoin = o.selection.shape;
|
||||
ctx.fillStyle = c.scale('a', 0.4).toString();
|
||||
|
||||
var x = Math.min(selection.first.x, selection.second.x) + 0.5,
|
||||
y = Math.min(selection.first.y, selection.second.y) + 0.5,
|
||||
w = Math.abs(selection.second.x - selection.first.x) - 1,
|
||||
h = Math.abs(selection.second.y - selection.first.y) - 1;
|
||||
|
||||
ctx.fillRect(x, y, w, h);
|
||||
ctx.strokeRect(x, y, w, h);
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
});
|
||||
|
||||
plot.hooks.shutdown.push(function (plot, eventHolder) {
|
||||
eventHolder.unbind("mousemove", onMouseMove);
|
||||
eventHolder.unbind("mousedown", onMouseDown);
|
||||
|
||||
if (mouseUpHandler)
|
||||
$(document).unbind("mouseup", mouseUpHandler);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: {
|
||||
selection: {
|
||||
mode: null, // one of null, "x", "y" or "xy"
|
||||
color: "#e8cfac",
|
||||
shape: "round", // one of "round", "miter", or "bevel"
|
||||
minSize: 5 // minimum number of pixels
|
||||
}
|
||||
},
|
||||
name: 'selection',
|
||||
version: '1.1'
|
||||
});
|
||||
})(jQuery);
|
||||
188
public/assets/js/chart/flot-chart/jquery.flot.stack.js
Normal file
188
public/assets/js/chart/flot-chart/jquery.flot.stack.js
Normal file
@@ -0,0 +1,188 @@
|
||||
/* Flot plugin for stacking data sets rather than overlyaing them.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin assumes the data is sorted on x (or y if stacking horizontally).
|
||||
For line charts, it is assumed that if a line has an undefined gap (from a
|
||||
null point), then the line above it should have the same gap - insert zeros
|
||||
instead of "null" if you want another behaviour. This also holds for the start
|
||||
and end of the chart. Note that stacking a mix of positive and negative values
|
||||
in most instances doesn't make sense (so it looks weird).
|
||||
|
||||
Two or more series are stacked when their "stack" attribute is set to the same
|
||||
key (which can be any number or string or just "true"). To specify the default
|
||||
stack, you can set the stack option like this:
|
||||
|
||||
series: {
|
||||
stack: null/false, true, or a key (number/string)
|
||||
}
|
||||
|
||||
You can also specify it for a single series, like this:
|
||||
|
||||
$.plot( $("#placeholder"), [{
|
||||
data: [ ... ],
|
||||
stack: true
|
||||
}])
|
||||
|
||||
The stacking order is determined by the order of the data series in the array
|
||||
(later series end up on top of the previous).
|
||||
|
||||
Internally, the plugin modifies the datapoints in each series, adding an
|
||||
offset to the y value. For line series, extra data points are inserted through
|
||||
interpolation. If there's a second y value, it's also adjusted (e.g for bar
|
||||
charts or filled areas).
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: { stack: null } // or number/string
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function findMatchingSeries(s, allseries) {
|
||||
var res = null;
|
||||
for (var i = 0; i < allseries.length; ++i) {
|
||||
if (s == allseries[i])
|
||||
break;
|
||||
|
||||
if (allseries[i].stack == s.stack)
|
||||
res = allseries[i];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
function stackData(plot, s, datapoints) {
|
||||
if (s.stack == null || s.stack === false)
|
||||
return;
|
||||
|
||||
var other = findMatchingSeries(s, plot.getData());
|
||||
if (!other)
|
||||
return;
|
||||
|
||||
var ps = datapoints.pointsize,
|
||||
points = datapoints.points,
|
||||
otherps = other.datapoints.pointsize,
|
||||
otherpoints = other.datapoints.points,
|
||||
newpoints = [],
|
||||
px, py, intery, qx, qy, bottom,
|
||||
withlines = s.lines.show,
|
||||
horizontal = s.bars.horizontal,
|
||||
withbottom = ps > 2 && (horizontal ? datapoints.format[2].x : datapoints.format[2].y),
|
||||
withsteps = withlines && s.lines.steps,
|
||||
fromgap = true,
|
||||
keyOffset = horizontal ? 1 : 0,
|
||||
accumulateOffset = horizontal ? 0 : 1,
|
||||
i = 0, j = 0, l, m;
|
||||
|
||||
while (true) {
|
||||
if (i >= points.length)
|
||||
break;
|
||||
|
||||
l = newpoints.length;
|
||||
|
||||
if (points[i] == null) {
|
||||
// copy gaps
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
i += ps;
|
||||
}
|
||||
else if (j >= otherpoints.length) {
|
||||
// for lines, we can't use the rest of the points
|
||||
if (!withlines) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
}
|
||||
i += ps;
|
||||
}
|
||||
else if (otherpoints[j] == null) {
|
||||
// oops, got a gap
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(null);
|
||||
fromgap = true;
|
||||
j += otherps;
|
||||
}
|
||||
else {
|
||||
// cases where we actually got two points
|
||||
px = points[i + keyOffset];
|
||||
py = points[i + accumulateOffset];
|
||||
qx = otherpoints[j + keyOffset];
|
||||
qy = otherpoints[j + accumulateOffset];
|
||||
bottom = 0;
|
||||
|
||||
if (px == qx) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
|
||||
newpoints[l + accumulateOffset] += qy;
|
||||
bottom = qy;
|
||||
|
||||
i += ps;
|
||||
j += otherps;
|
||||
}
|
||||
else if (px > qx) {
|
||||
// we got past point below, might need to
|
||||
// insert interpolated extra point
|
||||
if (withlines && i > 0 && points[i - ps] != null) {
|
||||
intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px);
|
||||
newpoints.push(qx);
|
||||
newpoints.push(intery + qy);
|
||||
for (m = 2; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
bottom = qy;
|
||||
}
|
||||
|
||||
j += otherps;
|
||||
}
|
||||
else { // px < qx
|
||||
if (fromgap && withlines) {
|
||||
// if we come from a gap, we just skip this point
|
||||
i += ps;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints.push(points[i + m]);
|
||||
|
||||
// we might be able to interpolate a point below,
|
||||
// this can give us a better y
|
||||
if (withlines && j > 0 && otherpoints[j - otherps] != null)
|
||||
bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx);
|
||||
|
||||
newpoints[l + accumulateOffset] += bottom;
|
||||
|
||||
i += ps;
|
||||
}
|
||||
|
||||
fromgap = false;
|
||||
|
||||
if (l != newpoints.length && withbottom)
|
||||
newpoints[l + 2] += bottom;
|
||||
}
|
||||
|
||||
// maintain the line steps invariant
|
||||
if (withsteps && l != newpoints.length && l > 0
|
||||
&& newpoints[l] != null
|
||||
&& newpoints[l] != newpoints[l - ps]
|
||||
&& newpoints[l + 1] != newpoints[l - ps + 1]) {
|
||||
for (m = 0; m < ps; ++m)
|
||||
newpoints[l + ps + m] = newpoints[l + m];
|
||||
newpoints[l + 1] = newpoints[l - ps + 1];
|
||||
}
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push(stackData);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'stack',
|
||||
version: '1.2'
|
||||
});
|
||||
})(jQuery);
|
||||
71
public/assets/js/chart/flot-chart/jquery.flot.symbol.js
Normal file
71
public/assets/js/chart/flot-chart/jquery.flot.symbol.js
Normal file
@@ -0,0 +1,71 @@
|
||||
/* Flot plugin that adds some extra symbols for plotting points.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The symbols are accessed as strings through the standard symbol options:
|
||||
|
||||
series: {
|
||||
points: {
|
||||
symbol: "square" // or "diamond", "triangle", "cross"
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
function processRawData(plot, series, datapoints) {
|
||||
// we normalize the area of each symbol so it is approximately the
|
||||
// same as a circle of the given radius
|
||||
|
||||
var handlers = {
|
||||
square: function (ctx, x, y, radius, shadow) {
|
||||
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
|
||||
var size = radius * Math.sqrt(Math.PI) / 2;
|
||||
ctx.rect(x - size, y - size, size + size, size + size);
|
||||
},
|
||||
diamond: function (ctx, x, y, radius, shadow) {
|
||||
// pi * r^2 = 2s^2 => s = r * sqrt(pi/2)
|
||||
var size = radius * Math.sqrt(Math.PI / 2);
|
||||
ctx.moveTo(x - size, y);
|
||||
ctx.lineTo(x, y - size);
|
||||
ctx.lineTo(x + size, y);
|
||||
ctx.lineTo(x, y + size);
|
||||
ctx.lineTo(x - size, y);
|
||||
},
|
||||
triangle: function (ctx, x, y, radius, shadow) {
|
||||
// pi * r^2 = 1/2 * s^2 * sin (pi / 3) => s = r * sqrt(2 * pi / sin(pi / 3))
|
||||
var size = radius * Math.sqrt(2 * Math.PI / Math.sin(Math.PI / 3));
|
||||
var height = size * Math.sin(Math.PI / 3);
|
||||
ctx.moveTo(x - size/2, y + height/2);
|
||||
ctx.lineTo(x + size/2, y + height/2);
|
||||
if (!shadow) {
|
||||
ctx.lineTo(x, y - height/2);
|
||||
ctx.lineTo(x - size/2, y + height/2);
|
||||
}
|
||||
},
|
||||
cross: function (ctx, x, y, radius, shadow) {
|
||||
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
|
||||
var size = radius * Math.sqrt(Math.PI) / 2;
|
||||
ctx.moveTo(x - size, y - size);
|
||||
ctx.lineTo(x + size, y + size);
|
||||
ctx.moveTo(x - size, y + size);
|
||||
ctx.lineTo(x + size, y - size);
|
||||
}
|
||||
};
|
||||
|
||||
var s = series.points.symbol;
|
||||
if (handlers[s])
|
||||
series.points.symbol = handlers[s];
|
||||
}
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processDatapoints.push(processRawData);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
name: 'symbols',
|
||||
version: '1.0'
|
||||
});
|
||||
})(jQuery);
|
||||
142
public/assets/js/chart/flot-chart/jquery.flot.threshold.js
Normal file
142
public/assets/js/chart/flot-chart/jquery.flot.threshold.js
Normal file
@@ -0,0 +1,142 @@
|
||||
/* Flot plugin for thresholding data.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
The plugin supports these options:
|
||||
|
||||
series: {
|
||||
threshold: {
|
||||
below: number
|
||||
color: colorspec
|
||||
}
|
||||
}
|
||||
|
||||
It can also be applied to a single series, like this:
|
||||
|
||||
$.plot( $("#placeholder"), [{
|
||||
data: [ ... ],
|
||||
threshold: { ... }
|
||||
}])
|
||||
|
||||
An array can be passed for multiple thresholding, like this:
|
||||
|
||||
threshold: [{
|
||||
below: number1
|
||||
color: color1
|
||||
},{
|
||||
below: number2
|
||||
color: color2
|
||||
}]
|
||||
|
||||
These multiple threshold objects can be passed in any order since they are
|
||||
sorted by the processing function.
|
||||
|
||||
The data points below "below" are drawn with the specified color. This makes
|
||||
it easy to mark points below 0, e.g. for budget data.
|
||||
|
||||
Internally, the plugin works by splitting the data into two series, above and
|
||||
below the threshold. The extra series below the threshold will have its label
|
||||
cleared and the special "originSeries" attribute set to the original series.
|
||||
You may need to check for this in hover events.
|
||||
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var options = {
|
||||
series: { threshold: null } // or { below: number, color: color spec}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
function thresholdData(plot, s, datapoints, below, color) {
|
||||
var ps = datapoints.pointsize, i, x, y, p, prevp,
|
||||
thresholded = $.extend({}, s); // note: shallow copy
|
||||
|
||||
thresholded.datapoints = { points: [], pointsize: ps, format: datapoints.format };
|
||||
thresholded.label = null;
|
||||
thresholded.color = color;
|
||||
thresholded.threshold = null;
|
||||
thresholded.originSeries = s;
|
||||
thresholded.data = [];
|
||||
|
||||
var origpoints = datapoints.points,
|
||||
addCrossingPoints = s.lines.show;
|
||||
|
||||
var threspoints = [];
|
||||
var newpoints = [];
|
||||
var m;
|
||||
|
||||
for (i = 0; i < origpoints.length; i += ps) {
|
||||
x = origpoints[i];
|
||||
y = origpoints[i + 1];
|
||||
|
||||
prevp = p;
|
||||
if (y < below)
|
||||
p = threspoints;
|
||||
else
|
||||
p = newpoints;
|
||||
|
||||
if (addCrossingPoints && prevp != p && x != null
|
||||
&& i > 0 && origpoints[i - ps] != null) {
|
||||
var interx = x + (below - y) * (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]);
|
||||
prevp.push(interx);
|
||||
prevp.push(below);
|
||||
for (m = 2; m < ps; ++m)
|
||||
prevp.push(origpoints[i + m]);
|
||||
|
||||
p.push(null); // start new segment
|
||||
p.push(null);
|
||||
for (m = 2; m < ps; ++m)
|
||||
p.push(origpoints[i + m]);
|
||||
p.push(interx);
|
||||
p.push(below);
|
||||
for (m = 2; m < ps; ++m)
|
||||
p.push(origpoints[i + m]);
|
||||
}
|
||||
|
||||
p.push(x);
|
||||
p.push(y);
|
||||
for (m = 2; m < ps; ++m)
|
||||
p.push(origpoints[i + m]);
|
||||
}
|
||||
|
||||
datapoints.points = newpoints;
|
||||
thresholded.datapoints.points = threspoints;
|
||||
|
||||
if (thresholded.datapoints.points.length > 0) {
|
||||
var origIndex = $.inArray(s, plot.getData());
|
||||
// Insert newly-generated series right after original one (to prevent it from becoming top-most)
|
||||
plot.getData().splice(origIndex + 1, 0, thresholded);
|
||||
}
|
||||
|
||||
// FIXME: there are probably some edge cases left in bars
|
||||
}
|
||||
|
||||
function processThresholds(plot, s, datapoints) {
|
||||
if (!s.threshold)
|
||||
return;
|
||||
|
||||
if (s.threshold instanceof Array) {
|
||||
s.threshold.sort(function(a, b) {
|
||||
return a.below - b.below;
|
||||
});
|
||||
|
||||
$(s.threshold).each(function(i, th) {
|
||||
thresholdData(plot, s, datapoints, th.below, th.color);
|
||||
});
|
||||
}
|
||||
else {
|
||||
thresholdData(plot, s, datapoints, s.threshold.below, s.threshold.color);
|
||||
}
|
||||
}
|
||||
|
||||
plot.hooks.processDatapoints.push(processThresholds);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'threshold',
|
||||
version: '1.2'
|
||||
});
|
||||
})(jQuery);
|
||||
432
public/assets/js/chart/flot-chart/jquery.flot.time.js
Normal file
432
public/assets/js/chart/flot-chart/jquery.flot.time.js
Normal file
@@ -0,0 +1,432 @@
|
||||
/* Pretty handling of time axes.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Set axis.mode to "time" to enable. See the section "Time series data" in
|
||||
API.txt for details.
|
||||
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var options = {
|
||||
xaxis: {
|
||||
timezone: null, // "browser" for local to the client or timezone for timezone-js
|
||||
timeformat: null, // format string to use
|
||||
twelveHourClock: false, // 12 or 24 time in time mode
|
||||
monthNames: null // list of names of months
|
||||
}
|
||||
};
|
||||
|
||||
// round to nearby lower multiple of base
|
||||
|
||||
function floorInBase(n, base) {
|
||||
return base * Math.floor(n / base);
|
||||
}
|
||||
|
||||
// Returns a string with the date d formatted according to fmt.
|
||||
// A subset of the Open Group's strftime format is supported.
|
||||
|
||||
function formatDate(d, fmt, monthNames, dayNames) {
|
||||
|
||||
if (typeof d.strftime == "function") {
|
||||
return d.strftime(fmt);
|
||||
}
|
||||
|
||||
var leftPad = function(n, pad) {
|
||||
n = "" + n;
|
||||
pad = "" + (pad == null ? "0" : pad);
|
||||
return n.length == 1 ? pad + n : n;
|
||||
};
|
||||
|
||||
var r = [];
|
||||
var escape = false;
|
||||
var hours = d.getHours();
|
||||
var isAM = hours < 12;
|
||||
|
||||
if (monthNames == null) {
|
||||
monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
}
|
||||
|
||||
if (dayNames == null) {
|
||||
dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
||||
}
|
||||
|
||||
var hours12;
|
||||
|
||||
if (hours > 12) {
|
||||
hours12 = hours - 12;
|
||||
} else if (hours == 0) {
|
||||
hours12 = 12;
|
||||
} else {
|
||||
hours12 = hours;
|
||||
}
|
||||
|
||||
for (var i = 0; i < fmt.length; ++i) {
|
||||
|
||||
var c = fmt.charAt(i);
|
||||
|
||||
if (escape) {
|
||||
switch (c) {
|
||||
case 'a': c = "" + dayNames[d.getDay()]; break;
|
||||
case 'b': c = "" + monthNames[d.getMonth()]; break;
|
||||
case 'd': c = leftPad(d.getDate()); break;
|
||||
case 'e': c = leftPad(d.getDate(), " "); break;
|
||||
case 'h': // For back-compat with 0.7; remove in 1.0
|
||||
case 'H': c = leftPad(hours); break;
|
||||
case 'I': c = leftPad(hours12); break;
|
||||
case 'l': c = leftPad(hours12, " "); break;
|
||||
case 'm': c = leftPad(d.getMonth() + 1); break;
|
||||
case 'M': c = leftPad(d.getMinutes()); break;
|
||||
// quarters not in Open Group's strftime specification
|
||||
case 'q':
|
||||
c = "" + (Math.floor(d.getMonth() / 3) + 1); break;
|
||||
case 'S': c = leftPad(d.getSeconds()); break;
|
||||
case 'y': c = leftPad(d.getFullYear() % 100); break;
|
||||
case 'Y': c = "" + d.getFullYear(); break;
|
||||
case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
|
||||
case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
|
||||
case 'w': c = "" + d.getDay(); break;
|
||||
}
|
||||
r.push(c);
|
||||
escape = false;
|
||||
} else {
|
||||
if (c == "%") {
|
||||
escape = true;
|
||||
} else {
|
||||
r.push(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return r.join("");
|
||||
}
|
||||
|
||||
// To have a consistent view of time-based data independent of which time
|
||||
// zone the client happens to be in we need a date-like object independent
|
||||
// of time zones. This is done through a wrapper that only calls the UTC
|
||||
// versions of the accessor methods.
|
||||
|
||||
function makeUtcWrapper(d) {
|
||||
|
||||
function addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {
|
||||
sourceObj[sourceMethod] = function() {
|
||||
return targetObj[targetMethod].apply(targetObj, arguments);
|
||||
};
|
||||
};
|
||||
|
||||
var utc = {
|
||||
date: d
|
||||
};
|
||||
|
||||
// support strftime, if found
|
||||
|
||||
if (d.strftime != undefined) {
|
||||
addProxyMethod(utc, "strftime", d, "strftime");
|
||||
}
|
||||
|
||||
addProxyMethod(utc, "getTime", d, "getTime");
|
||||
addProxyMethod(utc, "setTime", d, "setTime");
|
||||
|
||||
var props = ["Date", "Day", "FullYear", "Hours", "Milliseconds", "Minutes", "Month", "Seconds"];
|
||||
|
||||
for (var p = 0; p < props.length; p++) {
|
||||
addProxyMethod(utc, "get" + props[p], d, "getUTC" + props[p]);
|
||||
addProxyMethod(utc, "set" + props[p], d, "setUTC" + props[p]);
|
||||
}
|
||||
|
||||
return utc;
|
||||
};
|
||||
|
||||
// select time zone strategy. This returns a date-like object tied to the
|
||||
// desired timezone
|
||||
|
||||
function dateGenerator(ts, opts) {
|
||||
if (opts.timezone == "browser") {
|
||||
return new Date(ts);
|
||||
} else if (!opts.timezone || opts.timezone == "utc") {
|
||||
return makeUtcWrapper(new Date(ts));
|
||||
} else if (typeof timezoneJS != "undefined" && typeof timezoneJS.Date != "undefined") {
|
||||
var d = new timezoneJS.Date();
|
||||
// timezone-js is fickle, so be sure to set the time zone before
|
||||
// setting the time.
|
||||
d.setTimezone(opts.timezone);
|
||||
d.setTime(ts);
|
||||
return d;
|
||||
} else {
|
||||
return makeUtcWrapper(new Date(ts));
|
||||
}
|
||||
}
|
||||
|
||||
// map of app. size of time units in milliseconds
|
||||
|
||||
var timeUnitSize = {
|
||||
"second": 1000,
|
||||
"minute": 60 * 1000,
|
||||
"hour": 60 * 60 * 1000,
|
||||
"day": 24 * 60 * 60 * 1000,
|
||||
"month": 30 * 24 * 60 * 60 * 1000,
|
||||
"quarter": 3 * 30 * 24 * 60 * 60 * 1000,
|
||||
"year": 365.2425 * 24 * 60 * 60 * 1000
|
||||
};
|
||||
|
||||
// the allowed tick sizes, after 1 year we use
|
||||
// an integer algorithm
|
||||
|
||||
var baseSpec = [
|
||||
[1, "second"], [2, "second"], [5, "second"], [10, "second"],
|
||||
[30, "second"],
|
||||
[1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
|
||||
[30, "minute"],
|
||||
[1, "hour"], [2, "hour"], [4, "hour"],
|
||||
[8, "hour"], [12, "hour"],
|
||||
[1, "day"], [2, "day"], [3, "day"],
|
||||
[0.25, "month"], [0.5, "month"], [1, "month"],
|
||||
[2, "month"]
|
||||
];
|
||||
|
||||
// we don't know which variant(s) we'll need yet, but generating both is
|
||||
// cheap
|
||||
|
||||
var specMonths = baseSpec.concat([[3, "month"], [6, "month"],
|
||||
[1, "year"]]);
|
||||
var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"],
|
||||
[1, "year"]]);
|
||||
|
||||
function init(plot) {
|
||||
plot.hooks.processOptions.push(function (plot, options) {
|
||||
$.each(plot.getAxes(), function(axisName, axis) {
|
||||
|
||||
var opts = axis.options;
|
||||
|
||||
if (opts.mode == "time") {
|
||||
axis.tickGenerator = function(axis) {
|
||||
|
||||
var ticks = [];
|
||||
var d = dateGenerator(axis.min, opts);
|
||||
var minSize = 0;
|
||||
|
||||
// make quarter use a possibility if quarters are
|
||||
// mentioned in either of these options
|
||||
|
||||
var spec = (opts.tickSize && opts.tickSize[1] ===
|
||||
"quarter") ||
|
||||
(opts.minTickSize && opts.minTickSize[1] ===
|
||||
"quarter") ? specQuarters : specMonths;
|
||||
|
||||
if (opts.minTickSize != null) {
|
||||
if (typeof opts.tickSize == "number") {
|
||||
minSize = opts.tickSize;
|
||||
} else {
|
||||
minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < spec.length - 1; ++i) {
|
||||
if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]]
|
||||
+ spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2
|
||||
&& spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var size = spec[i][0];
|
||||
var unit = spec[i][1];
|
||||
|
||||
// special-case the possibility of several years
|
||||
|
||||
if (unit == "year") {
|
||||
|
||||
// if given a minTickSize in years, just use it,
|
||||
// ensuring that it's an integer
|
||||
|
||||
if (opts.minTickSize != null && opts.minTickSize[1] == "year") {
|
||||
size = Math.floor(opts.minTickSize[0]);
|
||||
} else {
|
||||
|
||||
var magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10));
|
||||
var norm = (axis.delta / timeUnitSize.year) / magn;
|
||||
|
||||
if (norm < 1.5) {
|
||||
size = 1;
|
||||
} else if (norm < 3) {
|
||||
size = 2;
|
||||
} else if (norm < 7.5) {
|
||||
size = 5;
|
||||
} else {
|
||||
size = 10;
|
||||
}
|
||||
|
||||
size *= magn;
|
||||
}
|
||||
|
||||
// minimum size for years is 1
|
||||
|
||||
if (size < 1) {
|
||||
size = 1;
|
||||
}
|
||||
}
|
||||
|
||||
axis.tickSize = opts.tickSize || [size, unit];
|
||||
var tickSize = axis.tickSize[0];
|
||||
unit = axis.tickSize[1];
|
||||
|
||||
var step = tickSize * timeUnitSize[unit];
|
||||
|
||||
if (unit == "second") {
|
||||
d.setSeconds(floorInBase(d.getSeconds(), tickSize));
|
||||
} else if (unit == "minute") {
|
||||
d.setMinutes(floorInBase(d.getMinutes(), tickSize));
|
||||
} else if (unit == "hour") {
|
||||
d.setHours(floorInBase(d.getHours(), tickSize));
|
||||
} else if (unit == "month") {
|
||||
d.setMonth(floorInBase(d.getMonth(), tickSize));
|
||||
} else if (unit == "quarter") {
|
||||
d.setMonth(3 * floorInBase(d.getMonth() / 3,
|
||||
tickSize));
|
||||
} else if (unit == "year") {
|
||||
d.setFullYear(floorInBase(d.getFullYear(), tickSize));
|
||||
}
|
||||
|
||||
// reset smaller components
|
||||
|
||||
d.setMilliseconds(0);
|
||||
|
||||
if (step >= timeUnitSize.minute) {
|
||||
d.setSeconds(0);
|
||||
}
|
||||
if (step >= timeUnitSize.hour) {
|
||||
d.setMinutes(0);
|
||||
}
|
||||
if (step >= timeUnitSize.day) {
|
||||
d.setHours(0);
|
||||
}
|
||||
if (step >= timeUnitSize.day * 4) {
|
||||
d.setDate(1);
|
||||
}
|
||||
if (step >= timeUnitSize.month * 2) {
|
||||
d.setMonth(floorInBase(d.getMonth(), 3));
|
||||
}
|
||||
if (step >= timeUnitSize.quarter * 2) {
|
||||
d.setMonth(floorInBase(d.getMonth(), 6));
|
||||
}
|
||||
if (step >= timeUnitSize.year) {
|
||||
d.setMonth(0);
|
||||
}
|
||||
|
||||
var carry = 0;
|
||||
var v = Number.NaN;
|
||||
var prev;
|
||||
|
||||
do {
|
||||
|
||||
prev = v;
|
||||
v = d.getTime();
|
||||
ticks.push(v);
|
||||
|
||||
if (unit == "month" || unit == "quarter") {
|
||||
if (tickSize < 1) {
|
||||
|
||||
// a bit complicated - we'll divide the
|
||||
// month/quarter up but we need to take
|
||||
// care of fractions so we don't end up in
|
||||
// the middle of a day
|
||||
|
||||
d.setDate(1);
|
||||
var start = d.getTime();
|
||||
d.setMonth(d.getMonth() +
|
||||
(unit == "quarter" ? 3 : 1));
|
||||
var end = d.getTime();
|
||||
d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);
|
||||
carry = d.getHours();
|
||||
d.setHours(0);
|
||||
} else {
|
||||
d.setMonth(d.getMonth() +
|
||||
tickSize * (unit == "quarter" ? 3 : 1));
|
||||
}
|
||||
} else if (unit == "year") {
|
||||
d.setFullYear(d.getFullYear() + tickSize);
|
||||
} else {
|
||||
d.setTime(v + step);
|
||||
}
|
||||
} while (v < axis.max && v != prev);
|
||||
|
||||
return ticks;
|
||||
};
|
||||
|
||||
axis.tickFormatter = function (v, axis) {
|
||||
|
||||
var d = dateGenerator(v, axis.options);
|
||||
|
||||
// first check global format
|
||||
|
||||
if (opts.timeformat != null) {
|
||||
return formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames);
|
||||
}
|
||||
|
||||
// possibly use quarters if quarters are mentioned in
|
||||
// any of these places
|
||||
|
||||
var useQuarters = (axis.options.tickSize &&
|
||||
axis.options.tickSize[1] == "quarter") ||
|
||||
(axis.options.minTickSize &&
|
||||
axis.options.minTickSize[1] == "quarter");
|
||||
|
||||
var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
|
||||
var span = axis.max - axis.min;
|
||||
var suffix = (opts.twelveHourClock) ? " %p" : "";
|
||||
var hourCode = (opts.twelveHourClock) ? "%I" : "%H";
|
||||
var fmt;
|
||||
|
||||
if (t < timeUnitSize.minute) {
|
||||
fmt = hourCode + ":%M:%S" + suffix;
|
||||
} else if (t < timeUnitSize.day) {
|
||||
if (span < 2 * timeUnitSize.day) {
|
||||
fmt = hourCode + ":%M" + suffix;
|
||||
} else {
|
||||
fmt = "%b %d " + hourCode + ":%M" + suffix;
|
||||
}
|
||||
} else if (t < timeUnitSize.month) {
|
||||
fmt = "%b %d";
|
||||
} else if ((useQuarters && t < timeUnitSize.quarter) ||
|
||||
(!useQuarters && t < timeUnitSize.year)) {
|
||||
if (span < timeUnitSize.year) {
|
||||
fmt = "%b";
|
||||
} else {
|
||||
fmt = "%b %Y";
|
||||
}
|
||||
} else if (useQuarters && t < timeUnitSize.year) {
|
||||
if (span < timeUnitSize.year) {
|
||||
fmt = "Q%q";
|
||||
} else {
|
||||
fmt = "Q%q %Y";
|
||||
}
|
||||
} else {
|
||||
fmt = "%Y";
|
||||
}
|
||||
|
||||
var rt = formatDate(d, fmt, opts.monthNames, opts.dayNames);
|
||||
|
||||
return rt;
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'time',
|
||||
version: '1.0'
|
||||
});
|
||||
|
||||
// Time-axis support used to be in Flot core, which exposed the
|
||||
// formatDate function on the plot object. Various plugins depend
|
||||
// on the function, so we need to re-expose it here.
|
||||
|
||||
$.plot.formatDate = formatDate;
|
||||
$.plot.dateGenerator = dateGenerator;
|
||||
|
||||
})(jQuery);
|
||||
9472
public/assets/js/chart/flot-chart/jquery.js
vendored
Normal file
9472
public/assets/js/chart/flot-chart/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
226
public/assets/js/chart/google/google-chart-loader.js
Normal file
226
public/assets/js/chart/google/google-chart-loader.js
Normal file
@@ -0,0 +1,226 @@
|
||||
(function(){var a="\n//# sourceURL=",k="' of type ",n='<script type="text/javascript" src="',p="SCRIPT",r="array",t="complete",u="function",v="google.charts.load",w="hasOwnProperty",x="number",y="object",z="pre-45",A="propertyIsEnumerable",B="string",C="text/javascript",D="toLocaleString";function E(){return function(b){return b}}function F(){return function(){}}function G(b){return function(){return this[b]}}var I,J=J||{};J.scope={};
|
||||
J.Up=function(b,c,d){if(null==b)throw new TypeError("The 'this' value for String.prototype."+d+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+d+" must not be a regular expression");return b+""};J.Gh=!1;J.fm=!1;J.gm=!1;J.defineProperty=J.Gh||typeof Object.defineProperties==u?Object.defineProperty:function(b,c,d){b!=Array.prototype&&b!=Object.prototype&&(b[c]=d.value)};
|
||||
J.Ij=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global&&null!=global?global:b};J.global=J.Ij(this);J.Sk=function(b){if(b){for(var c=J.global,d=["Promise"],e=0;e<d.length-1;e++){var f=d[e];f in c||(c[f]={});c=c[f]}d=d[d.length-1];e=c[d];b=b(e);b!=e&&null!=b&&J.defineProperty(c,d,{configurable:!0,writable:!0,value:b})}};
|
||||
J.Fq=function(b,c,d){b instanceof String&&(b=String(b));for(var e=b.length,f=0;f<e;f++){var g=b[f];if(c.call(d,g,f,b))return{Zj:f,Ll:g}}return{Zj:-1,Ll:void 0}};J.yi="jscomp_symbol_";J.rg=function(){J.rg=F();J.global.Symbol||(J.global.Symbol=J.Symbol)};J.Symbol=function(){var b=0;return function(c){return J.yi+(c||"")+b++}}();
|
||||
J.Fd=function(){J.rg();var b=J.global.Symbol.iterator;b||(b=J.global.Symbol.iterator=J.global.Symbol("iterator"));typeof Array.prototype[b]!=u&&J.defineProperty(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return J.df(this)}});J.Fd=F()};J.df=function(b){var c=0;return J.uk(function(){return c<b.length?{done:!1,value:b[c++]}:{done:!0}})};J.uk=function(b){J.Fd();b={next:b};b[J.global.Symbol.iterator]=function(){return this};return b};
|
||||
J.Qg=function(b){J.Fd();var c=b[Symbol.iterator];return c?c.call(b):J.df(b)};J.Yh=!1;
|
||||
J.Sk(function(b){function c(b){this.$=g.wa;this.ia=void 0;this.Ub=[];var c=this.gd();try{b(c.resolve,c.reject)}catch(q){c.reject(q)}}function d(){this.Ma=null}function e(b){return b instanceof c?b:new c(function(c){c(b)})}if(b&&!J.Yh)return b;d.prototype.ef=function(b){null==this.Ma&&(this.Ma=[],this.Ni());this.Ma.push(b)};d.prototype.Ni=function(){var b=this;this.ff(function(){b.uj()})};var f=J.global.setTimeout;d.prototype.ff=function(b){f(b,0)};d.prototype.uj=function(){for(;this.Ma&&this.Ma.length;){var b=
|
||||
this.Ma;this.Ma=[];for(var c=0;c<b.length;++c){var d=b[c];delete b[c];try{d()}catch(H){this.Oi(H)}}}this.Ma=null};d.prototype.Oi=function(b){this.ff(function(){throw b;})};var g={wa:0,Ja:1,ka:2};c.prototype.gd=function(){function b(b){return function(e){d||(d=!0,b.call(c,e))}}var c=this,d=!1;return{resolve:b(this.Xk),reject:b(this.Yd)}};c.prototype.Xk=function(b){if(b===this)this.Yd(new TypeError("A Promise cannot resolve to itself"));else if(b instanceof c)this.pl(b);else{a:switch(typeof b){case y:var d=
|
||||
null!=b;break a;case u:d=!0;break a;default:d=!1}d?this.Wk(b):this.If(b)}};c.prototype.Wk=function(b){var c=void 0;try{c=b.then}catch(q){this.Yd(q);return}typeof c==u?this.ql(c,b):this.If(b)};c.prototype.Yd=function(b){this.mh(g.ka,b)};c.prototype.If=function(b){this.mh(g.Ja,b)};c.prototype.mh=function(b,c){if(this.$!=g.wa)throw Error("Cannot settle("+b+", "+c|"): Promise already settled in state"+this.$);this.$=b;this.ia=c;this.wj()};c.prototype.wj=function(){if(null!=this.Ub){for(var b=this.Ub,
|
||||
c=0;c<b.length;++c)b[c].call(),b[c]=null;this.Ub=null}};var h=new d;c.prototype.pl=function(b){var c=this.gd();b.fc(c.resolve,c.reject)};c.prototype.ql=function(b,c){var d=this.gd();try{b.call(c,d.resolve,d.reject)}catch(H){d.reject(H)}};c.prototype.then=function(b,d){function e(b,c){return typeof b==u?function(c){try{f(b(c))}catch(ca){g(ca)}}:c}var f,g,h=new c(function(b,c){f=b;g=c});this.fc(e(b,f),e(d,g));return h};c.prototype["catch"]=function(b){return this.then(void 0,b)};c.prototype.fc=function(b,
|
||||
c){function d(){switch(e.$){case g.Ja:b(e.ia);break;case g.ka:c(e.ia);break;default:throw Error("Unexpected state: "+e.$);}}var e=this;null==this.Ub?h.ef(d):this.Ub.push(function(){h.ef(d)})};c.resolve=e;c.reject=function(b){return new c(function(c,d){d(b)})};c.race=function(b){return new c(function(c,d){for(var f=J.Qg(b),g=f.next();!g.done;g=f.next())e(g.value).fc(c,d)})};c.all=function(b){var d=J.Qg(b),f=d.next();return f.done?e([]):new c(function(b,c){function g(c){return function(d){h[c]=d;l--;
|
||||
0==l&&b(h)}}var h=[],l=0;do h.push(void 0),l++,e(f.value).fc(g(h.length-1),c),f=d.next();while(!f.done)})};return c});var K=K||{};K.global=this;K.R=function(b){return void 0!==b};K.L=function(b){return typeof b==B};K.ck=function(b){return"boolean"==typeof b};K.Rb=function(b){return typeof b==x};
|
||||
K.md=function(b,c,d){b=b.split(".");d=d||K.global;b[0]in d||!d.execScript||d.execScript("var "+b[0]);for(var e;b.length&&(e=b.shift());)!b.length&&K.R(c)?d[e]=c:d=d[e]&&d[e]!==Object.prototype[e]?d[e]:d[e]={}};K.define=function(b,c){K.md(b,c)};K.ea=!0;K.ba="en";K.$c=!0;K.wi=!1;K.Uh=!K.ea;K.De=!1;K.Es=function(b){if(K.Kd())throw Error("goog.provide can not be used within a goog.module.");K.qf(b)};K.qf=function(b,c){K.md(b,c)};K.Di=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/;
|
||||
K.Td=function(b){if(!K.L(b)||!b||-1==b.search(K.Di))throw Error("Invalid module identifier");if(!K.Kd())throw Error("Module "+b+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");
|
||||
if(K.na.Ud)throw Error("goog.module may only be called once per module.");K.na.Ud=b};K.Td.get=function(){return null};K.Td.$q=function(){return null};K.na=null;K.Kd=function(){return null!=K.na};K.Td.jd=function(){K.na.jd=!0};K.rt=function(b){if(K.Uh)throw b=b||"",Error("Importing test-only code into non-debug environment"+(b?": "+b:"."));};K.Lq=F();K.rb=function(b){b=b.split(".");for(var c=K.global,d=0;d<b.length;d++)if(c=c[b[d]],!K.cb(c))return null;return c};
|
||||
K.kr=function(b,c){c=c||K.global;for(var d in b)c[d]=b[d]};K.hp=function(b,c,d,e){if(K.Ae){var f;b=b.replace(/\\/g,"/");var g=K.la;e&&"boolean"!==typeof e||(e=e?{module:"goog"}:{});for(var h=0;f=c[h];h++)g.Sb[f]=b,g.Od[b]=e;for(e=0;c=d[e];e++)b in g.gb||(g.gb[b]={}),g.gb[b][c]=!0}};K.Ut=!1;K.Xm=!0;K.Ek=function(b){K.global.console&&K.global.console.error(b)};K.Qs=F();K.La="";K.eb=F();K.gp=function(){throw Error("unimplemented abstract method");};
|
||||
K.ip=function(b){b.Gd=void 0;b.Zq=function(){if(b.Gd)return b.Gd;K.ea&&(K.wg[K.wg.length]=b);return b.Gd=new b}};K.wg=[];K.fi=!0;K.ti=K.ea;K.Ck={};K.Ae=!1;K.Ve="detect";K.zi="transpile.js";
|
||||
K.Ae&&(K.la={Od:{},Sb:{},gb:{},zh:{},je:{},pb:{}},K.qg=function(){var b=K.global.document;return null!=b&&"write"in b},K.xj=function(){if(K.R(K.global.ye)&&K.L(K.global.ye))K.La=K.global.ye;else if(K.qg()){var b=K.global.document,c=b.currentScript;b=c?[c]:b.getElementsByTagName(p);for(c=b.length-1;0<=c;--c){var d=b[c].src,e=d.lastIndexOf("?");e=-1==e?d.length:e;if("base.js"==d.substr(e-7,7)){K.La=d.substr(0,e-7);break}}}},K.Ed=function(b,c){(K.global.zm||K.Tl)(b,c)&&(K.la.je[b]=!0)},K.di=!(K.global.atob||
|
||||
!K.global.document||!K.global.document.all),K.$g=!1,K.ak=function(b,c,d){K.Ed("",'goog.retrieveAndExec_("'+b+'", '+c+", "+d+");")},K.Wd=[],K.Yt=function(b,c){return K.fi&&K.R(K.global.JSON)?"goog.loadModule("+K.global.JSON.stringify(c+a+b+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+c+"\n;return exports});\n//# sourceURL="+b+"\n"},K.Ak=function(){var b=K.Wd.length;if(0<b){var c=K.Wd;K.Wd=[];for(var d=0;d<b;d++)K.Tg(c[d])}K.$g=!1},K.ks=function(b){K.Bg(b)&&K.Ji(b)&&K.Tg(K.La+K.zd(b))},
|
||||
K.Bg=function(b){var c=(b=K.zd(b))&&K.la.Od[b]||{},d=c.lang||"es3";return b&&("goog"==c.module||K.Xg(d))?K.La+b in K.la.pb:!1},K.Ji=function(b){if((b=K.zd(b))&&b in K.la.gb)for(var c in K.la.gb[b])if(!K.mk(c)&&!K.Bg(c))return!1;return!0},K.Tg=function(b){if(b in K.la.pb){var c=K.la.pb[b];delete K.la.pb[b];K.Tj(c)}},K.es=F(),K.Sl=function(b){K.global.document.write(n+b+'">\x3c/script>')},K.Ki=function(b){var c=K.global.document,d=c.createElement("script");d.type=C;d.src=b;d.defer=!1;d.async=!1;c.head.appendChild(d)},
|
||||
K.Tl=function(b,c){if(K.qg()){var d=K.global.document;if(!K.De&&d.readyState==t){if(/\bdeps.js$/.test(b))return!1;throw Error('Cannot write "'+b+'" after document load');}void 0===c?K.di?(K.$g=!0,c=" onreadystatechange='goog.onScriptLoad_(this, "+ ++K.Pg+")' ",d.write(n+b+'"'+c+">\x3c/script>")):K.De?K.Ki(b):K.Sl(b):d.write('<script type="text/javascript">'+K.Tk(c)+"\x3c/script>");return!0}return!1},K.Tk=function(b){return b.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},K.Xg=function(b){if("always"==K.Ve)return!0;
|
||||
if("never"==K.Ve)return!1;K.Dc||(K.Dc=K.ej());if(b in K.Dc)return K.Dc[b];throw Error("Unknown language mode: "+b);},K.Dc=null,K.Pg=0,K.ys=function(b,c){b.readyState==t&&K.Pg==c&&K.Ak();return!0},K.Zt=function(b){function c(b){if(!(b in f.je||b in f.zh)){f.zh[b]=!0;if(b in f.gb)for(var g in f.gb[b])if(!K.mk(g))if(g in f.Sb)c(f.Sb[g]);else throw Error("Undefined nameToPath for "+g);b in e||(e[b]=!0,d.push(b))}}var d=[],e={},f=K.la;c(b);for(b=0;b<d.length;b++){var g=d[b];K.la.je[g]=!0}var h=K.na;K.na=
|
||||
null;for(b=0;b<d.length;b++)if(g=d[b]){var l=f.Od[g]||{},m=K.Xg(l.lang||"es3");"goog"==l.module||m?K.ak(K.La+g,"goog"==l.module,m):K.Ed(K.La+g)}else throw K.na=h,Error("Undefined script input");K.na=h},K.zd=function(b){return b in K.la.Sb?K.la.Sb[b]:null},K.xj(),K.global.Am||K.Ed(K.La+"deps.js"));K.Cd=null;K.Jl=function(){if(null==K.Cd){try{var b=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(c){b=!1}K.Cd=b}return K.Cd};
|
||||
K.Ql=function(b){return"(function(){"+b+"\n;})();\n"};K.ds=function(b){var c=K.na;try{K.na={Ud:void 0,jd:!1};if(K.ya(b))var d=b.call(void 0,{});else if(K.L(b))K.Jl()&&(b=K.Ql(b)),d=K.zk.call(void 0,b);else throw Error("Invalid module definition");var e=K.na.Ud;if(!K.L(e)||!e)throw Error('Invalid module name "'+e+'"');K.na.jd?K.qf(e,d):K.ti&&Object.seal&&typeof d==y&&null!=d&&Object.seal(d);K.Ck[e]=d}finally{K.na=c}};K.zk=function(b){eval(b);return{}};
|
||||
K.rs=function(b){b=b.split("/");for(var c=0;c<b.length;)"."==b[c]?b.splice(c,1):c&&".."==b[c]&&b[c-1]&&".."!=b[c-1]?b.splice(--c,2):c++;return b.join("/")};K.xk=function(b){if(K.global.Ph)return K.global.Ph(b);try{var c=new K.global.XMLHttpRequest;c.open("get",b,!1);c.send();return 0==c.status||200==c.status?c.responseText:null}catch(d){return null}};K.Ss=F();
|
||||
K.Lt=function(b,c){var d=K.global.$jscomp;d||(K.global.$jscomp=d={});var e=d.he;if(!e){var f=K.La+K.zi,g=K.xk(f);if(g){eval(g+a+f);if(K.global.$gwtExport&&K.global.$gwtExport.$jscomp&&!K.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(K.global.$gwtExport));K.global.$jscomp.he=K.global.$gwtExport.$jscomp.transpile;d=K.global.$jscomp;e=d.he}}if(!e){var h=" requires transpilation but no transpiler was found.";
|
||||
h+=' Please add "//javascript/closure:transpiler" as a data dependency to ensure it is included.';e=d.he=function(b,c){K.Ek(c+h);return b}}return e(b,c)};
|
||||
K.aa=function(b){var c=typeof b;if(c==y)if(b){if(b instanceof Array)return r;if(b instanceof Object)return c;var d=Object.prototype.toString.call(b);if("[object Window]"==d)return y;if("[object Array]"==d||typeof b.length==x&&"undefined"!=typeof b.splice&&"undefined"!=typeof b.propertyIsEnumerable&&!b.propertyIsEnumerable("splice"))return r;if("[object Function]"==d||"undefined"!=typeof b.call&&"undefined"!=typeof b.propertyIsEnumerable&&!b.propertyIsEnumerable("call"))return u}else return"null";
|
||||
else if(c==u&&"undefined"==typeof b.call)return y;return c};K.Pr=function(b){return null===b};K.cb=function(b){return null!=b};K.isArray=function(b){return K.aa(b)==r};K.Nb=function(b){var c=K.aa(b);return c==r||c==y&&typeof b.length==x};K.Br=function(b){return K.ha(b)&&typeof b.getFullYear==u};K.ya=function(b){return K.aa(b)==u};K.ha=function(b){var c=typeof b;return c==y&&null!=b||c==u};K.kg=function(b){return b[K.Va]||(b[K.Va]=++K.Cl)};K.nr=function(b){return!!b[K.Va]};
|
||||
K.Uk=function(b){null!==b&&"removeAttribute"in b&&b.removeAttribute(K.Va);try{delete b[K.Va]}catch(c){}};K.Va="closure_uid_"+(1E9*Math.random()>>>0);K.Cl=0;K.Yq=K.kg;K.Ms=K.Uk;K.aj=function(b){var c=K.aa(b);if(c==y||c==r){if(b.clone)return b.clone();c=c==r?[]:{};for(var d in b)c[d]=K.aj(b[d]);return c}return b};K.Si=function(b,c,d){return b.call.apply(b.bind,arguments)};
|
||||
K.Ri=function(b,c,d){if(!b)throw Error();if(2<arguments.length){var e=Array.prototype.slice.call(arguments,2);return function(){var d=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(d,e);return b.apply(c,d)}}return function(){return b.apply(c,arguments)}};K.bind=function(b,c,d){K.bind=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?K.Si:K.Ri;return K.bind.apply(null,arguments)};
|
||||
K.fb=function(b,c){var d=Array.prototype.slice.call(arguments,1);return function(){var c=d.slice();c.push.apply(c,arguments);return b.apply(this,c)}};K.ms=function(b,c){for(var d in c)b[d]=c[d]};K.now=K.$c&&Date.now||function(){return+new Date};
|
||||
K.Tj=function(b){if(K.global.execScript)K.global.execScript(b,"JavaScript");else if(K.global.eval){if(null==K.lc)if(K.global.eval("var _evalTest_ = 1;"),"undefined"!=typeof K.global._evalTest_){try{delete K.global._evalTest_}catch(e){}K.lc=!0}else K.lc=!1;if(K.lc)K.global.eval(b);else{var c=K.global.document,d=c.createElement(p);d.type=C;d.defer=!1;d.appendChild(c.createTextNode(b));c.body.appendChild(d);c.body.removeChild(d)}}else throw Error("goog.globalEval not available");};K.lc=null;
|
||||
K.Wq=function(b,c){function d(b){b=b.split("-");for(var c=[],d=0;d<b.length;d++)c.push(e(b[d]));return c.join("-")}function e(b){return K.uf[b]||b}if("."==String(b).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+b);var f=K.uf?"BY_WHOLE"==K.kj?e:d:E();b=c?b+"-"+f(c):f(b);return K.global.Oh?K.global.Oh(b):b};K.bt=function(b,c){K.uf=b;K.kj=c};K.ar=function(b,c){c&&(b=b.replace(/\{\$([^}]+)}/g,function(b,e){return null!=c&&e in c?c[e]:b}));return b};
|
||||
K.cr=E();K.zf=function(b,c){K.md(b,c,void 0)};K.Eq=function(b,c,d){b[c]=d};K.ab=function(b,c){function d(){}d.prototype=c.prototype;b.Lc=c.prototype;b.prototype=new d;b.prototype.constructor=b;b.Qi=function(b,d,g){for(var e=Array(arguments.length-2),f=2;f<arguments.length;f++)e[f-2]=arguments[f];return c.prototype[d].apply(b,e)}};
|
||||
K.Qi=function(b,c,d){var e=arguments.callee.caller;if(K.wi||K.ea&&!e)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(e.Lc){for(var f=Array(arguments.length-1),g=1;g<arguments.length;g++)f[g-1]=arguments[g];return e.Lc.constructor.apply(b,f)}f=Array(arguments.length-2);for(g=2;g<arguments.length;g++)f[g-2]=arguments[g];g=!1;for(var h=b.constructor;h;h=h.Lc&&h.Lc.constructor)if(h.prototype[c]===
|
||||
e)g=!0;else if(g)return h.prototype[c].apply(b,f);if(b[c]===e)return b.constructor.prototype[c].apply(b,f);throw Error("goog.base called from a method of one name to a method of a different name");};K.scope=function(b){if(K.Kd())throw Error("goog.scope is not supported within a goog.module.");b.call(K.global)};
|
||||
K.oa=function(b,c){var d=c.constructor,e=c.ul;d&&d!=Object.prototype.constructor||(d=function(){throw Error("cannot instantiate an interface (no constructor defined).");});d=K.oa.fj(d,b);b&&K.ab(d,b);delete c.constructor;delete c.ul;K.oa.cf(d.prototype,c);null!=e&&(e instanceof Function?e(d):K.oa.cf(d,e));return d};K.oa.si=K.ea;
|
||||
K.oa.fj=function(b,c){function d(){var c=b.apply(this,arguments)||this;c[K.Va]=c[K.Va];this.constructor===d&&e&&Object.seal instanceof Function&&Object.seal(c);return c}if(!K.oa.si)return b;var e=!K.oa.qk(c);return d};K.oa.qk=function(b){return b&&b.prototype&&b.prototype[K.Bi]};K.oa.Me=["constructor",w,"isPrototypeOf",A,D,"toString","valueOf"];
|
||||
K.oa.cf=function(b,c){for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(b[d]=c[d]);for(var e=0;e<K.oa.Me.length;e++)d=K.oa.Me[e],Object.prototype.hasOwnProperty.call(c,d)&&(b[d]=c[d])};K.Et=F();K.Bi="goog_defineClass_legacy_unsealable";
|
||||
K.ej=function(){function b(b,c){e?d[b]=!0:c()?d[b]=!1:e=d[b]=!0}function c(b){try{return!!eval(b)}catch(h){return!1}}var d={es3:!1},e=!1,f=K.global.navigator&&K.global.navigator.userAgent?K.global.navigator.userAgent:"";b("es5",function(){return c("[1,].length==1")});b("es6",function(){var b=f.match(/Edge\/(\d+)(\.\d)*/i);return b&&15>Number(b[1])?!1:c('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')});
|
||||
b("es6-impl",function(){return!0});b("es7",function(){return c("2 ** 2 == 4")});b("es8",function(){return c("async () => 1, true")});return d};K.debug={};K.debug.Error=function(b){if(Error.captureStackTrace)Error.captureStackTrace(this,K.debug.Error);else{var c=Error().stack;c&&(this.stack=c)}b&&(this.message=String(b))};K.ab(K.debug.Error,Error);K.debug.Error.prototype.name="CustomError";K.a={};K.a.fa={Ia:1,hm:2,cc:3,wm:4,Zm:5,Ym:6,oo:7,Fm:8,Xc:9,Rm:10,Vh:11,bo:12};K.f={};K.f.Wc=!1;K.f.Xh=!1;K.f.Ye={Ke:"\u00a0"};K.f.startsWith=function(b,c){return 0==b.lastIndexOf(c,0)};K.f.endsWith=function(b,c){var d=b.length-c.length;return 0<=d&&b.indexOf(c,d)==d};K.f.Zi=function(b){return 0==K.f.jf("tel:",b.substr(0,4))};K.f.Sp=function(b,c){return 0==K.f.jf(c,b.substr(b.length-c.length,c.length))};K.f.Tp=function(b,c){return b.toLowerCase()==c.toLowerCase()};
|
||||
K.f.wl=function(b,c){for(var d=b.split("%s"),e="",f=Array.prototype.slice.call(arguments,1);f.length&&1<d.length;)e+=d.shift()+f.shift();return e+d.join("%s")};K.f.Zp=function(b){return b.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};K.f.Id=function(b){return/^[\s\xa0]*$/.test(b)};K.f.Er=function(b){return 0==b.length};K.f.Qb=K.f.Id;K.f.ek=function(b){return K.f.Id(K.f.Jk(b))};K.f.Dr=K.f.ek;K.f.zr=function(b){return!/[^\t\n\r ]/.test(b)};K.f.wr=function(b){return!/[^a-zA-Z]/.test(b)};
|
||||
K.f.Qr=function(b){return!/[^0-9]/.test(b)};K.f.xr=function(b){return!/[^a-zA-Z0-9]/.test(b)};K.f.Wr=function(b){return" "==b};K.f.Xr=function(b){return 1==b.length&&" "<=b&&"~">=b||"\u0080"<=b&&"\ufffd">=b};K.f.Ct=function(b){return b.replace(/(\r\n|\r|\n)+/g," ")};K.f.Yi=function(b){return b.replace(/(\r\n|\r|\n)/g,"\n")};K.f.ts=function(b){return b.replace(/\xa0|\s/g," ")};K.f.ss=function(b){return b.replace(/\xa0|[ \t]+/g," ")};
|
||||
K.f.Yp=function(b){return b.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};K.f.trim=K.$c&&String.prototype.trim?function(b){return b.trim()}:function(b){return b.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};K.f.trimLeft=function(b){return b.replace(/^[\s\xa0]+/,"")};K.f.trimRight=function(b){return b.replace(/[\s\xa0]+$/,"")};K.f.jf=function(b,c){b=String(b).toLowerCase();c=String(c).toLowerCase();return b<c?-1:b==c?0:1};
|
||||
K.f.Zg=function(b,c,d){if(b==c)return 0;if(!b)return-1;if(!c)return 1;for(var e=b.toLowerCase().match(d),f=c.toLowerCase().match(d),g=Math.min(e.length,f.length),h=0;h<g;h++){d=e[h];var l=f[h];if(d!=l)return b=parseInt(d,10),!isNaN(b)&&(c=parseInt(l,10),!isNaN(c)&&b-c)?b-c:d<l?-1:1}return e.length!=f.length?e.length-f.length:b<c?-1:1};K.f.ur=function(b,c){return K.f.Zg(b,c,/\d+|\D+/g)};K.f.Aj=function(b,c){return K.f.Zg(b,c,/\d+|\.\d+|\D+/g)};K.f.ws=K.f.Aj;K.f.Tt=function(b){return encodeURIComponent(String(b))};
|
||||
K.f.St=function(b){return decodeURIComponent(b.replace(/\+/g," "))};K.f.Yg=function(b,c){return b.replace(/(\r\n|\r|\n)/g,c?"<br />":"<br>")};
|
||||
K.f.ta=function(b,c){if(c)b=b.replace(K.f.ke,"&").replace(K.f.Je,"<").replace(K.f.Ge,">").replace(K.f.Qe,""").replace(K.f.Te,"'").replace(K.f.Le,"�"),K.f.Wc&&(b=b.replace(K.f.Ee,"e"));else{if(!K.f.Eh.test(b))return b;-1!=b.indexOf("&")&&(b=b.replace(K.f.ke,"&"));-1!=b.indexOf("<")&&(b=b.replace(K.f.Je,"<"));-1!=b.indexOf(">")&&(b=b.replace(K.f.Ge,">"));-1!=b.indexOf('"')&&(b=b.replace(K.f.Qe,"""));-1!=b.indexOf("'")&&(b=b.replace(K.f.Te,"'"));-1!=b.indexOf("\x00")&&
|
||||
(b=b.replace(K.f.Le,"�"));K.f.Wc&&-1!=b.indexOf("e")&&(b=b.replace(K.f.Ee,"e"))}return b};K.f.ke=/&/g;K.f.Je=/</g;K.f.Ge=/>/g;K.f.Qe=/"/g;K.f.Te=/'/g;K.f.Le=/\x00/g;K.f.Ee=/e/g;K.f.Eh=K.f.Wc?/[\x00&<>"'e]/:/[\x00&<>"']/;K.f.vh=function(b){return K.f.contains(b,"&")?!K.f.Xh&&"document"in K.global?K.f.wh(b):K.f.Fl(b):b};K.f.Pt=function(b,c){return K.f.contains(b,"&")?K.f.wh(b,c):b};
|
||||
K.f.wh=function(b,c){var d={"&":"&","<":"<",">":">",""":'"'};var e=c?c.createElement("div"):K.global.document.createElement("div");return b.replace(K.f.bi,function(b,c){var f=d[b];if(f)return f;"#"==c.charAt(0)&&(c=Number("0"+c.substr(1)),isNaN(c)||(f=String.fromCharCode(c)));f||(e.innerHTML=b+" ",f=e.firstChild.nodeValue.slice(0,-1));return d[b]=f})};
|
||||
K.f.Fl=function(b){return b.replace(/&([^;]+);/g,function(b,d){switch(d){case "amp":return"&";case "lt":return"<";case "gt":return">";case "quot":return'"';default:return"#"!=d.charAt(0)||(d=Number("0"+d.substr(1)),isNaN(d))?b:String.fromCharCode(d)}})};K.f.bi=/&([^;\s<&]+);?/g;K.f.Ol=function(b){return K.f.Yg(b.replace(/ /g,"  "),void 0)};K.f.Ds=function(b){return b.replace(/(^|[\n ]) /g,"$1"+K.f.Ye.Ke)};
|
||||
K.f.Dt=function(b,c){for(var d=c.length,e=0;e<d;e++){var f=1==d?c:c.charAt(e);if(b.charAt(0)==f&&b.charAt(b.length-1)==f)return b.substring(1,b.length-1)}return b};K.f.truncate=function(b,c,d){d&&(b=K.f.vh(b));b.length>c&&(b=b.substring(0,c-3)+"...");d&&(b=K.f.ta(b));return b};K.f.Nt=function(b,c,d,e){d&&(b=K.f.vh(b));e&&b.length>c?(e>c&&(e=c),b=b.substring(0,c-e)+"..."+b.substring(b.length-e)):b.length>c&&(e=Math.floor(c/2),b=b.substring(0,e+c%2)+"..."+b.substring(b.length-e));d&&(b=K.f.ta(b));return b};
|
||||
K.f.de={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"<"};K.f.vc={"'":"\\'"};K.f.quote=function(b){b=String(b);for(var c=['"'],d=0;d<b.length;d++){var e=b.charAt(d),f=e.charCodeAt(0);c[d+1]=K.f.de[e]||(31<f&&127>f?e:K.f.xf(e))}c.push('"');return c.join("")};K.f.Dq=function(b){for(var c=[],d=0;d<b.length;d++)c[d]=K.f.xf(b.charAt(d));return c.join("")};
|
||||
K.f.xf=function(b){if(b in K.f.vc)return K.f.vc[b];if(b in K.f.de)return K.f.vc[b]=K.f.de[b];var c=b.charCodeAt(0);if(31<c&&127>c)var d=b;else{if(256>c){if(d="\\x",16>c||256<c)d+="0"}else d="\\u",4096>c&&(d+="0");d+=c.toString(16).toUpperCase()}return K.f.vc[b]=d};K.f.contains=function(b,c){return-1!=b.indexOf(c)};K.f.kf=function(b,c){return K.f.contains(b.toLowerCase(),c.toLowerCase())};K.f.gq=function(b,c){return b&&c?b.split(c).length-1:0};
|
||||
K.f.yb=function(b,c,d){var e=b;0<=c&&c<b.length&&0<d&&(e=b.substr(0,c)+b.substr(c+d,b.length-c-d));return e};K.f.remove=function(b,c){return b.replace(c,"")};K.f.Js=function(b,c){c=new RegExp(K.f.Xd(c),"g");return b.replace(c,"")};K.f.Ps=function(b,c,d){c=new RegExp(K.f.Xd(c),"g");return b.replace(c,d.replace(/\$/g,"$$$$"))};K.f.Xd=function(b){return String(b).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};
|
||||
K.f.repeat=String.prototype.repeat?function(b,c){return b.repeat(c)}:function(b,c){return Array(c+1).join(b)};K.f.Bs=function(b,c,d){b=K.R(d)?b.toFixed(d):String(b);d=b.indexOf(".");-1==d&&(d=b.length);return K.f.repeat("0",Math.max(0,c-d))+b};K.f.Jk=function(b){return null==b?"":String(b)};K.f.Np=function(b){return Array.prototype.join.call(arguments,"")};K.f.fr=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^K.now()).toString(36)};
|
||||
K.f.Eb=function(b,c){var d=0;b=K.f.trim(String(b)).split(".");c=K.f.trim(String(c)).split(".");for(var e=Math.max(b.length,c.length),f=0;0==d&&f<e;f++){var g=b[f]||"",h=c[f]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==g[0].length&&0==h[0].length)break;d=K.f.dd(0==g[1].length?0:parseInt(g[1],10),0==h[1].length?0:parseInt(h[1],10))||K.f.dd(0==g[2].length,0==h[2].length)||K.f.dd(g[2],h[2]);g=g[3];h=h[3]}while(0==d)}return d};
|
||||
K.f.dd=function(b,c){return b<c?-1:b>c?1:0};K.f.or=function(b){for(var c=0,d=0;d<b.length;++d)c=31*c+b.charCodeAt(d)>>>0;return c};K.f.Gl=2147483648*Math.random()|0;K.f.pq=function(){return"goog_"+K.f.Gl++};K.f.Ht=function(b){var c=Number(b);return 0==c&&K.f.Id(b)?NaN:c};K.f.Jr=function(b){return/^[a-z]+([A-Z][a-z]*)*$/.test(b)};K.f.Yr=function(b){return/^([A-Z][a-z]*)+$/.test(b)};K.f.Gt=function(b){return String(b).replace(/\-([a-z])/g,function(b,d){return d.toUpperCase()})};
|
||||
K.f.Jt=function(b){return String(b).replace(/([A-Z])/g,"-$1").toLowerCase()};K.f.Kt=function(b,c){c=K.L(c)?K.f.Xd(c):"\\s";return b.replace(new RegExp("(^"+(c?"|["+c+"]+":"")+")([a-z])","g"),function(b,c,f){return c+f.toUpperCase()})};K.f.Rp=function(b){return String(b.charAt(0)).toUpperCase()+String(b.substr(1)).toLowerCase()};K.f.parseInt=function(b){isFinite(b)&&(b=String(b));return K.L(b)?/^\s*-?0x/i.test(b)?parseInt(b,16):parseInt(b,10):NaN};
|
||||
K.f.xt=function(b,c,d){b=b.split(c);for(var e=[];0<d&&b.length;)e.push(b.shift()),d--;b.length&&e.push(b.join(c));return e};K.f.as=function(b,c){if(c)typeof c==B&&(c=[c]);else return b;for(var d=-1,e=0;e<c.length;e++)if(""!=c[e]){var f=b.lastIndexOf(c[e]);f>d&&(d=f)}return-1==d?b:b.slice(d+1)};
|
||||
K.f.xq=function(b,c){var d=[],e=[];if(b==c)return 0;if(!b.length||!c.length)return Math.max(b.length,c.length);for(var f=0;f<c.length+1;f++)d[f]=f;for(f=0;f<b.length;f++){e[0]=f+1;for(var g=0;g<c.length;g++)e[g+1]=Math.min(e[g]+1,d[g+1]+1,d[g]+Number(b[f]!=c[g]));for(g=0;g<d.length;g++)d[g]=e[g]}return e[c.length]};K.m={};K.m.ja=K.ea;K.m.Xb=function(b,c){c.unshift(b);K.debug.Error.call(this,K.f.wl.apply(null,c));c.shift()};K.ab(K.m.Xb,K.debug.Error);K.m.Xb.prototype.name="AssertionError";K.m.Sh=function(b){throw b;};K.m.kd=K.m.Sh;K.m.xa=function(b,c,d,e){var f="Assertion failed";if(d){f+=": "+d;var g=e}else b&&(f+=": "+b,g=c);b=new K.m.Xb(""+f,g||[]);K.m.kd(b)};K.m.ft=function(b){K.m.ja&&(K.m.kd=b)};K.m.assert=function(b,c,d){K.m.ja&&!b&&K.m.xa("",null,c,Array.prototype.slice.call(arguments,2));return b};
|
||||
K.m.ma=function(b,c){K.m.ja&&K.m.kd(new K.m.Xb("Failure"+(b?": "+b:""),Array.prototype.slice.call(arguments,1)))};K.m.Ep=function(b,c,d){K.m.ja&&!K.Rb(b)&&K.m.xa("Expected number but got %s: %s.",[K.aa(b),b],c,Array.prototype.slice.call(arguments,2));return b};K.m.Hp=function(b,c,d){K.m.ja&&!K.L(b)&&K.m.xa("Expected string but got %s: %s.",[K.aa(b),b],c,Array.prototype.slice.call(arguments,2));return b};
|
||||
K.m.sp=function(b,c,d){K.m.ja&&!K.ya(b)&&K.m.xa("Expected function but got %s: %s.",[K.aa(b),b],c,Array.prototype.slice.call(arguments,2));return b};K.m.Fp=function(b,c,d){K.m.ja&&!K.ha(b)&&K.m.xa("Expected object but got %s: %s.",[K.aa(b),b],c,Array.prototype.slice.call(arguments,2));return b};K.m.op=function(b,c,d){K.m.ja&&!K.isArray(b)&&K.m.xa("Expected array but got %s: %s.",[K.aa(b),b],c,Array.prototype.slice.call(arguments,2));return b};
|
||||
K.m.pp=function(b,c,d){K.m.ja&&!K.ck(b)&&K.m.xa("Expected boolean but got %s: %s.",[K.aa(b),b],c,Array.prototype.slice.call(arguments,2));return b};K.m.qp=function(b,c,d){!K.m.ja||K.ha(b)&&b.nodeType==K.a.fa.Ia||K.m.xa("Expected Element but got %s: %s.",[K.aa(b),b],c,Array.prototype.slice.call(arguments,2));return b};K.m.tp=function(b,c,d,e){!K.m.ja||b instanceof c||K.m.xa("Expected instanceof %s but got %s.",[K.m.jg(c),K.m.jg(b)],d,Array.prototype.slice.call(arguments,3));return b};
|
||||
K.m.rp=function(b,c,d){!K.m.ja||typeof b==x&&isFinite(b)||K.m.xa("Expected %s to be a finite number but it is not.",[b],c,Array.prototype.slice.call(arguments,2));return b};K.m.Gp=function(){for(var b in Object.prototype)K.m.ma(b+" should not be enumerable in Object.prototype.")};K.m.jg=function(b){return b instanceof Function?b.displayName||b.name||"unknown type name":b instanceof Object?b.constructor.displayName||b.constructor.name||Object.prototype.toString.call(b):null===b?"null":typeof b};K.f.Yo=F();K.f.I=function(){this.Kc="";this.xi=K.f.I.We};K.f.I.prototype.ua=!0;K.f.I.prototype.ga=G("Kc");K.f.I.prototype.toString=function(){return"Const{"+this.Kc+"}"};K.f.I.u=function(b){if(b instanceof K.f.I&&b.constructor===K.f.I&&b.xi===K.f.I.We)return b.Kc;K.m.ma("expected object of type Const, got '"+b+"'");return"type_error:Const"};K.f.I.from=function(b){return K.f.I.jj(b)};K.f.I.We={};K.f.I.jj=function(b){var c=new K.f.I;c.Kc=b;return c};K.f.I.EMPTY=K.f.I.from("");K.j={};K.Ca=K.$c;K.j.za=!1;K.j.Rk=function(b){return b[b.length-1]};K.j.$r=K.j.Rk;K.j.indexOf=K.Ca&&(K.j.za||Array.prototype.indexOf)?function(b,c,d){return Array.prototype.indexOf.call(b,c,d)}:function(b,c,d){d=null==d?0:0>d?Math.max(0,b.length+d):d;if(K.L(b))return K.L(c)&&1==c.length?b.indexOf(c,d):-1;for(;d<b.length;d++)if(d in b&&b[d]===c)return d;return-1};
|
||||
K.j.lastIndexOf=K.Ca&&(K.j.za||Array.prototype.lastIndexOf)?function(b,c,d){return Array.prototype.lastIndexOf.call(b,c,null==d?b.length-1:d)}:function(b,c,d){d=null==d?b.length-1:d;0>d&&(d=Math.max(0,b.length+d));if(K.L(b))return K.L(c)&&1==c.length?b.lastIndexOf(c,d):-1;for(;0<=d;d--)if(d in b&&b[d]===c)return d;return-1};
|
||||
K.j.forEach=K.Ca&&(K.j.za||Array.prototype.forEach)?function(b,c,d){Array.prototype.forEach.call(b,c,d)}:function(b,c,d){for(var e=b.length,f=K.L(b)?b.split(""):b,g=0;g<e;g++)g in f&&c.call(d,f[g],g,b)};K.j.Gf=function(b,c){for(var d=K.L(b)?b.split(""):b,e=b.length-1;0<=e;--e)e in d&&c.call(void 0,d[e],e,b)};
|
||||
K.j.filter=K.Ca&&(K.j.za||Array.prototype.filter)?function(b,c,d){return Array.prototype.filter.call(b,c,d)}:function(b,c,d){for(var e=b.length,f=[],g=0,h=K.L(b)?b.split(""):b,l=0;l<e;l++)if(l in h){var m=h[l];c.call(d,m,l,b)&&(f[g++]=m)}return f};K.j.map=K.Ca&&(K.j.za||Array.prototype.map)?function(b,c,d){return Array.prototype.map.call(b,c,d)}:function(b,c,d){for(var e=b.length,f=Array(e),g=K.L(b)?b.split(""):b,h=0;h<e;h++)h in g&&(f[h]=c.call(d,g[h],h,b));return f};
|
||||
K.j.reduce=K.Ca&&(K.j.za||Array.prototype.reduce)?function(b,c,d,e){e&&(c=K.bind(c,e));return Array.prototype.reduce.call(b,c,d)}:function(b,c,d,e){var f=d;K.j.forEach(b,function(d,h){f=c.call(e,f,d,h,b)});return f};K.j.reduceRight=K.Ca&&(K.j.za||Array.prototype.reduceRight)?function(b,c,d,e){e&&(c=K.bind(c,e));return Array.prototype.reduceRight.call(b,c,d)}:function(b,c,d,e){var f=d;K.j.Gf(b,function(d,h){f=c.call(e,f,d,h,b)});return f};
|
||||
K.j.some=K.Ca&&(K.j.za||Array.prototype.some)?function(b,c,d){return Array.prototype.some.call(b,c,d)}:function(b,c,d){for(var e=b.length,f=K.L(b)?b.split(""):b,g=0;g<e;g++)if(g in f&&c.call(d,f[g],g,b))return!0;return!1};K.j.every=K.Ca&&(K.j.za||Array.prototype.every)?function(b,c,d){return Array.prototype.every.call(b,c,d)}:function(b,c,d){for(var e=b.length,f=K.L(b)?b.split(""):b,g=0;g<e;g++)if(g in f&&!c.call(d,f[g],g,b))return!1;return!0};
|
||||
K.j.count=function(b,c,d){var e=0;K.j.forEach(b,function(b,g,h){c.call(d,b,g,h)&&++e},d);return e};K.j.find=function(b,c,d){c=K.j.findIndex(b,c,d);return 0>c?null:K.L(b)?b.charAt(c):b[c]};K.j.findIndex=function(b,c,d){for(var e=b.length,f=K.L(b)?b.split(""):b,g=0;g<e;g++)if(g in f&&c.call(d,f[g],g,b))return g;return-1};K.j.Gq=function(b,c,d){c=K.j.yj(b,c,d);return 0>c?null:K.L(b)?b.charAt(c):b[c]};
|
||||
K.j.yj=function(b,c,d){for(var e=K.L(b)?b.split(""):b,f=b.length-1;0<=f;f--)if(f in e&&c.call(d,e[f],f,b))return f;return-1};K.j.contains=function(b,c){return 0<=K.j.indexOf(b,c)};K.j.Qb=function(b){return 0==b.length};K.j.clear=function(b){if(!K.isArray(b))for(var c=b.length-1;0<=c;c--)delete b[c];b.length=0};K.j.rr=function(b,c){K.j.contains(b,c)||b.push(c)};K.j.sg=function(b,c,d){K.j.splice(b,d,0,c)};K.j.tr=function(b,c,d){K.fb(K.j.splice,b,d,0).apply(null,c)};
|
||||
K.j.insertBefore=function(b,c,d){var e;2==arguments.length||0>(e=K.j.indexOf(b,d))?b.push(c):K.j.sg(b,c,e)};K.j.remove=function(b,c){c=K.j.indexOf(b,c);var d;(d=0<=c)&&K.j.yb(b,c);return d};K.j.Os=function(b,c){c=K.j.lastIndexOf(b,c);return 0<=c?(K.j.yb(b,c),!0):!1};K.j.yb=function(b,c){return 1==Array.prototype.splice.call(b,c,1).length};K.j.Ns=function(b,c,d){c=K.j.findIndex(b,c,d);return 0<=c?(K.j.yb(b,c),!0):!1};
|
||||
K.j.Ks=function(b,c,d){var e=0;K.j.Gf(b,function(f,g){c.call(d,f,g,b)&&K.j.yb(b,g)&&e++});return e};K.j.concat=function(b){return Array.prototype.concat.apply([],arguments)};K.j.join=function(b){return Array.prototype.concat.apply([],arguments)};K.j.th=function(b){var c=b.length;if(0<c){for(var d=Array(c),e=0;e<c;e++)d[e]=b[e];return d}return[]};K.j.clone=K.j.th;
|
||||
K.j.extend=function(b,c){for(var d=1;d<arguments.length;d++){var e=arguments[d];if(K.Nb(e)){var f=b.length||0,g=e.length||0;b.length=f+g;for(var h=0;h<g;h++)b[f+h]=e[h]}else b.push(e)}};K.j.splice=function(b,c,d,e){return Array.prototype.splice.apply(b,K.j.slice(arguments,1))};K.j.slice=function(b,c,d){return 2>=arguments.length?Array.prototype.slice.call(b,c):Array.prototype.slice.call(b,c,d)};
|
||||
K.j.Ls=function(b,c,d){function e(b){return K.ha(b)?"o"+K.kg(b):(typeof b).charAt(0)+b}c=c||b;d=d||e;for(var f={},g=0,h=0;h<b.length;){var l=b[h++],m=d(l);Object.prototype.hasOwnProperty.call(f,m)||(f[m]=!0,c[g++]=l)}c.length=g};K.j.gf=function(b,c,d){return K.j.hf(b,d||K.j.Pa,!1,c)};K.j.Kp=function(b,c,d){return K.j.hf(b,c,!0,void 0,d)};K.j.hf=function(b,c,d,e,f){for(var g=0,h=b.length,l;g<h;){var m=g+h>>1;var q=d?c.call(f,b[m],m,b):c(e,b[m]);0<q?g=m+1:(h=m,l=!q)}return l?g:~g};
|
||||
K.j.sort=function(b,c){b.sort(c||K.j.Pa)};K.j.zt=function(b,c){for(var d=Array(b.length),e=0;e<b.length;e++)d[e]={index:e,value:b[e]};var f=c||K.j.Pa;K.j.sort(d,function(b,c){return f(b.value,c.value)||b.index-c.index});for(e=0;e<b.length;e++)b[e]=d[e].value};K.j.sl=function(b,c,d){var e=d||K.j.Pa;K.j.sort(b,function(b,d){return e(c(b),c(d))})};K.j.wt=function(b,c,d){K.j.sl(b,function(b){return b[c]},d)};
|
||||
K.j.Vr=function(b,c,d){c=c||K.j.Pa;for(var e=1;e<b.length;e++){var f=c(b[e-1],b[e]);if(0<f||0==f&&d)return!1}return!0};K.j.Ib=function(b,c,d){if(!K.Nb(b)||!K.Nb(c)||b.length!=c.length)return!1;var e=b.length;d=d||K.j.lj;for(var f=0;f<e;f++)if(!d(b[f],c[f]))return!1;return!0};K.j.$p=function(b,c,d){d=d||K.j.Pa;for(var e=Math.min(b.length,c.length),f=0;f<e;f++){var g=d(b[f],c[f]);if(0!=g)return g}return K.j.Pa(b.length,c.length)};K.j.Pa=function(b,c){return b>c?1:b<c?-1:0};
|
||||
K.j.vr=function(b,c){return-K.j.Pa(b,c)};K.j.lj=function(b,c){return b===c};K.j.Ip=function(b,c,d){d=K.j.gf(b,c,d);return 0>d?(K.j.sg(b,c,-(d+1)),!0):!1};K.j.Jp=function(b,c,d){c=K.j.gf(b,c,d);return 0<=c?K.j.yb(b,c):!1};K.j.Mp=function(b,c,d){for(var e={},f=0;f<b.length;f++){var g=b[f],h=c.call(d,g,f,b);K.R(h)&&(e[h]||(e[h]=[])).push(g)}return e};K.j.It=function(b,c,d){var e={};K.j.forEach(b,function(f,g){e[c.call(d,f,g,b)]=f});return e};
|
||||
K.j.Gs=function(b,c,d){var e=[],f=0,g=b;d=d||1;void 0!==c&&(f=b,g=c);if(0>d*(g-f))return[];if(0<d)for(b=f;b<g;b+=d)e.push(b);else for(b=f;b>g;b+=d)e.push(b);return e};K.j.repeat=function(b,c){for(var d=[],e=0;e<c;e++)d[e]=b;return d};K.j.flatten=function(b){for(var c=[],d=0;d<arguments.length;d++){var e=arguments[d];if(K.isArray(e))for(var f=0;f<e.length;f+=8192)for(var g=K.j.flatten.apply(null,K.j.slice(e,f,f+8192)),h=0;h<g.length;h++)c.push(g[h]);else c.push(e)}return c};
|
||||
K.j.rotate=function(b,c){b.length&&(c%=b.length,0<c?Array.prototype.unshift.apply(b,b.splice(-c,c)):0>c&&Array.prototype.push.apply(b,b.splice(0,-c)));return b};K.j.os=function(b,c,d){c=Array.prototype.splice.call(b,c,1);Array.prototype.splice.call(b,d,0,c[0])};
|
||||
K.j.$t=function(b){if(!arguments.length)return[];for(var c=[],d=arguments[0].length,e=1;e<arguments.length;e++)arguments[e].length<d&&(d=arguments[e].length);for(e=0;e<d;e++){for(var f=[],g=0;g<arguments.length;g++)f.push(arguments[g][e]);c.push(f)}return c};K.j.vt=function(b,c){c=c||Math.random;for(var d=b.length-1;0<d;d--){var e=Math.floor(c()*(d+1)),f=b[d];b[d]=b[e];b[e]=f}};K.j.fq=function(b,c){var d=[];K.j.forEach(c,function(c){d.push(b[c])});return d};
|
||||
K.j.bq=function(b,c,d){return K.j.concat.apply([],K.j.map(b,c,d))};K.h={};K.h.i={};K.h.i.Zh=!1;
|
||||
K.h.i.Ie=K.h.i.Zh||("ar"==K.ba.substring(0,2).toLowerCase()||"fa"==K.ba.substring(0,2).toLowerCase()||"he"==K.ba.substring(0,2).toLowerCase()||"iw"==K.ba.substring(0,2).toLowerCase()||"ps"==K.ba.substring(0,2).toLowerCase()||"sd"==K.ba.substring(0,2).toLowerCase()||"ug"==K.ba.substring(0,2).toLowerCase()||"ur"==K.ba.substring(0,2).toLowerCase()||"yi"==K.ba.substring(0,2).toLowerCase())&&(2==K.ba.length||"-"==K.ba.substring(2,3)||"_"==K.ba.substring(2,3))||3<=K.ba.length&&"ckb"==K.ba.substring(0,3).toLowerCase()&&
|
||||
(3==K.ba.length||"-"==K.ba.substring(3,4)||"_"==K.ba.substring(3,4));K.h.i.mb={gi:"\u202a",ji:"\u202b",Oe:"\u202c",hi:"\u200e",ki:"\u200f"};K.h.i.O={Ta:1,Ua:-1,qa:0};K.h.i.bc="right";K.h.i.$b="left";K.h.i.yn=K.h.i.Ie?K.h.i.$b:K.h.i.bc;K.h.i.xn=K.h.i.Ie?K.h.i.bc:K.h.i.$b;K.h.i.Al=function(b){return typeof b==x?0<b?K.h.i.O.Ta:0>b?K.h.i.O.Ua:K.h.i.O.qa:null==b?null:b?K.h.i.O.Ua:K.h.i.O.Ta};K.h.i.vb="A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff";
|
||||
K.h.i.zb="\u0591-\u06ef\u06fa-\u07ff\u200f\ufb1d-\ufdff\ufe70-\ufefc";K.h.i.Yj=/<[^>]*>|&[^;]+;/g;K.h.i.Sa=function(b,c){return c?b.replace(K.h.i.Yj,""):b};K.h.i.$k=new RegExp("["+K.h.i.zb+"]");K.h.i.Fk=new RegExp("["+K.h.i.vb+"]");K.h.i.Bd=function(b,c){return K.h.i.$k.test(K.h.i.Sa(b,c))};K.h.i.mr=K.h.i.Bd;K.h.i.og=function(b){return K.h.i.Fk.test(K.h.i.Sa(b,void 0))};K.h.i.Ik=new RegExp("^["+K.h.i.vb+"]");K.h.i.el=new RegExp("^["+K.h.i.zb+"]");K.h.i.nk=function(b){return K.h.i.el.test(b)};
|
||||
K.h.i.jk=function(b){return K.h.i.Ik.test(b)};K.h.i.Nr=function(b){return!K.h.i.jk(b)&&!K.h.i.nk(b)};K.h.i.Gk=new RegExp("^[^"+K.h.i.zb+"]*["+K.h.i.vb+"]");K.h.i.bl=new RegExp("^[^"+K.h.i.vb+"]*["+K.h.i.zb+"]");K.h.i.nh=function(b,c){return K.h.i.bl.test(K.h.i.Sa(b,c))};K.h.i.Tr=K.h.i.nh;K.h.i.tl=function(b,c){return K.h.i.Gk.test(K.h.i.Sa(b,c))};K.h.i.Lr=K.h.i.tl;K.h.i.Jg=/^http:\/\/.*/;K.h.i.Or=function(b,c){b=K.h.i.Sa(b,c);return K.h.i.Jg.test(b)||!K.h.i.og(b)&&!K.h.i.Bd(b)};
|
||||
K.h.i.Hk=new RegExp("["+K.h.i.vb+"][^"+K.h.i.zb+"]*$");K.h.i.cl=new RegExp("["+K.h.i.zb+"][^"+K.h.i.vb+"]*$");K.h.i.rj=function(b,c){return K.h.i.Hk.test(K.h.i.Sa(b,c))};K.h.i.Kr=K.h.i.rj;K.h.i.sj=function(b,c){return K.h.i.cl.test(K.h.i.Sa(b,c))};K.h.i.Rr=K.h.i.sj;K.h.i.dl=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;K.h.i.Sr=function(b){return K.h.i.dl.test(b)};K.h.i.Ui=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g;
|
||||
K.h.i.lr=function(b,c){c=(void 0===c?K.h.i.Bd(b):c)?K.h.i.mb.ki:K.h.i.mb.hi;return b.replace(K.h.i.Ui,c+"$&"+c)};K.h.i.Aq=function(b){return"<"==b.charAt(0)?b.replace(/<\w+/,"$& dir=rtl"):"\n<span dir=rtl>"+b+"</span>"};K.h.i.Bq=function(b){return K.h.i.mb.ji+b+K.h.i.mb.Oe};K.h.i.yq=function(b){return"<"==b.charAt(0)?b.replace(/<\w+/,"$& dir=ltr"):"\n<span dir=ltr>"+b+"</span>"};K.h.i.zq=function(b){return K.h.i.mb.gi+b+K.h.i.mb.Oe};K.h.i.pj=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g;
|
||||
K.h.i.vk=/left/gi;K.h.i.Zk=/right/gi;K.h.i.yl=/%%%%/g;K.h.i.ls=function(b){return b.replace(K.h.i.pj,":$1 $4 $3 $2").replace(K.h.i.vk,"%%%%").replace(K.h.i.Zk,K.h.i.$b).replace(K.h.i.yl,K.h.i.bc)};K.h.i.qj=/([\u0591-\u05f2])"/g;K.h.i.rl=/([\u0591-\u05f2])'/g;K.h.i.qs=function(b){return b.replace(K.h.i.qj,"$1\u05f4").replace(K.h.i.rl,"$1\u05f3")};K.h.i.Pl=/\s+/;K.h.i.Xj=/[\d\u06f0-\u06f9]/;K.h.i.al=.4;
|
||||
K.h.i.yf=function(b,c){var d=0,e=0,f=!1;b=K.h.i.Sa(b,c).split(K.h.i.Pl);for(c=0;c<b.length;c++){var g=b[c];K.h.i.nh(g)?(d++,e++):K.h.i.Jg.test(g)?f=!0:K.h.i.og(g)?e++:K.h.i.Xj.test(g)&&(f=!0)}return 0==e?f?K.h.i.O.Ta:K.h.i.O.qa:d/e>K.h.i.al?K.h.i.O.Ua:K.h.i.O.Ta};K.h.i.tq=function(b,c){return K.h.i.yf(b,c)==K.h.i.O.Ua};K.h.i.ct=function(b,c){b&&(c=K.h.i.Al(c))&&(b.style.textAlign=c==K.h.i.O.Ua?K.h.i.bc:K.h.i.$b,b.dir=c==K.h.i.O.Ua?"rtl":"ltr")};
|
||||
K.h.i.dt=function(b,c){switch(K.h.i.yf(c)){case K.h.i.O.Ta:b.dir="ltr";break;case K.h.i.O.Ua:b.dir="rtl";break;default:b.removeAttribute("dir")}};K.h.i.Tm=F();K.b={};K.b.C=function(){this.Bc="";this.Ai=K.b.C.ca};K.b.C.prototype.ua=!0;K.b.C.prototype.ga=G("Bc");K.b.C.prototype.Dd=!0;K.b.C.prototype.$a=function(){return K.h.i.O.Ta};K.ea&&(K.b.C.prototype.toString=function(){return"TrustedResourceUrl{"+this.Bc+"}"});K.b.C.u=function(b){if(b instanceof K.b.C&&b.constructor===K.b.C&&b.Ai===K.b.C.ca)return b.Bc;K.m.ma("expected object of type TrustedResourceUrl, got '"+b+k+K.aa(b));return"type_error:TrustedResourceUrl"};
|
||||
K.b.C.format=function(b,c){b=K.b.C.Hf(b,c);return K.b.C.Hb(b)};K.b.C.Hf=function(b,c){var d=K.f.I.u(b);if(!K.b.C.Ih.test(d))throw Error("Invalid TrustedResourceUrl format: "+d);return d.replace(K.b.C.$h,function(b,f){if(!Object.prototype.hasOwnProperty.call(c,f))throw Error('Found marker, "'+f+'", in format string, "'+d+'", but no valid label mapping found in args: '+JSON.stringify(c));b=c[f];return b instanceof K.f.I?K.f.I.u(b):encodeURIComponent(String(b))})};K.b.C.$h=/%{(\w+)}/g;K.b.C.Ih=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank(#|$)/i;
|
||||
K.b.C.Kq=function(b,c,d){b=K.b.C.Hf(b,c);c=/\?/.test(b)?"&":"?";for(var e in d)for(var f=K.isArray(d[e])?d[e]:[d[e]],g=0;g<f.length;g++)null!=f[g]&&(b+=c+encodeURIComponent(e)+"="+encodeURIComponent(String(f[g])),c="&");return K.b.C.Hb(b)};K.b.C.mc=function(b){return K.b.C.Hb(K.f.I.u(b))};K.b.C.Nq=function(b){for(var c="",d=0;d<b.length;d++)c+=K.f.I.u(b[d]);return K.b.C.Hb(c)};K.b.C.ca={};K.b.C.Hb=function(b){var c=new K.b.C;c.Bc=b;return c};K.async={};K.async.Zb=function(b,c,d){this.wk=d;this.ij=b;this.Vk=c;this.xc=0;this.tc=null};K.async.Zb.prototype.get=function(){if(0<this.xc){this.xc--;var b=this.tc;this.tc=b.next;b.next=null}else b=this.ij();return b};K.async.Zb.prototype.put=function(b){this.Vk(b);this.xc<this.wk&&(this.xc++,b.next=this.tc,this.tc=b)};K.debug.Z={};K.debug.$m=F();K.debug.Z.xb=[];K.debug.Z.Vd=[];K.debug.Z.Wg=!1;K.debug.Z.register=function(b){K.debug.Z.xb[K.debug.Z.xb.length]=b;if(K.debug.Z.Wg)for(var c=K.debug.Z.Vd,d=0;d<c.length;d++)b(K.bind(c[d].Rl,c[d]))};K.debug.Z.ns=function(b){K.debug.Z.Wg=!0;for(var c=K.bind(b.Rl,b),d=0;d<K.debug.Z.xb.length;d++)K.debug.Z.xb[d](c);K.debug.Z.Vd.push(b)};K.debug.Z.Rt=function(b){var c=K.debug.Z.Vd;b=K.bind(b.u,b);for(var d=0;d<K.debug.Z.xb.length;d++)K.debug.Z.xb[d](b);c.length--};K.a.vn=F();K.a.c=function(b){this.xl=b};K.a.c.prototype.toString=G("xl");K.a.c.Ul=new K.a.c("A");K.a.c.Vl=new K.a.c("ABBR");K.a.c.Xl=new K.a.c("ACRONYM");K.a.c.Yl=new K.a.c("ADDRESS");K.a.c.bm=new K.a.c("APPLET");K.a.c.cm=new K.a.c("AREA");K.a.c.dm=new K.a.c("ARTICLE");K.a.c.em=new K.a.c("ASIDE");K.a.c.im=new K.a.c("AUDIO");K.a.c.jm=new K.a.c("B");K.a.c.km=new K.a.c("BASE");K.a.c.lm=new K.a.c("BASEFONT");K.a.c.mm=new K.a.c("BDI");K.a.c.nm=new K.a.c("BDO");K.a.c.qm=new K.a.c("BIG");K.a.c.rm=new K.a.c("BLOCKQUOTE");
|
||||
K.a.c.sm=new K.a.c("BODY");K.a.c.we=new K.a.c("BR");K.a.c.tm=new K.a.c("BUTTON");K.a.c.um=new K.a.c("CANVAS");K.a.c.vm=new K.a.c("CAPTION");K.a.c.xm=new K.a.c("CENTER");K.a.c.ym=new K.a.c("CITE");K.a.c.Bm=new K.a.c("CODE");K.a.c.Cm=new K.a.c("COL");K.a.c.Dm=new K.a.c("COLGROUP");K.a.c.Em=new K.a.c("COMMAND");K.a.c.Gm=new K.a.c("DATA");K.a.c.Hm=new K.a.c("DATALIST");K.a.c.Im=new K.a.c("DD");K.a.c.Jm=new K.a.c("DEL");K.a.c.Km=new K.a.c("DETAILS");K.a.c.Lm=new K.a.c("DFN");K.a.c.Mm=new K.a.c("DIALOG");
|
||||
K.a.c.Nm=new K.a.c("DIR");K.a.c.Om=new K.a.c("DIV");K.a.c.Pm=new K.a.c("DL");K.a.c.Sm=new K.a.c("DT");K.a.c.Vm=new K.a.c("EM");K.a.c.Wm=new K.a.c("EMBED");K.a.c.bn=new K.a.c("FIELDSET");K.a.c.cn=new K.a.c("FIGCAPTION");K.a.c.dn=new K.a.c("FIGURE");K.a.c.en=new K.a.c("FONT");K.a.c.fn=new K.a.c("FOOTER");K.a.c.gn=new K.a.c("FORM");K.a.c.hn=new K.a.c("FRAME");K.a.c.jn=new K.a.c("FRAMESET");K.a.c.kn=new K.a.c("H1");K.a.c.ln=new K.a.c("H2");K.a.c.mn=new K.a.c("H3");K.a.c.nn=new K.a.c("H4");K.a.c.on=new K.a.c("H5");
|
||||
K.a.c.pn=new K.a.c("H6");K.a.c.qn=new K.a.c("HEAD");K.a.c.rn=new K.a.c("HEADER");K.a.c.sn=new K.a.c("HGROUP");K.a.c.tn=new K.a.c("HR");K.a.c.un=new K.a.c("HTML");K.a.c.wn=new K.a.c("I");K.a.c.zn=new K.a.c("IFRAME");K.a.c.An=new K.a.c("IMG");K.a.c.Bn=new K.a.c("INPUT");K.a.c.Cn=new K.a.c("INS");K.a.c.Hn=new K.a.c("ISINDEX");K.a.c.Jn=new K.a.c("KBD");K.a.c.Kn=new K.a.c("KEYGEN");K.a.c.Ln=new K.a.c("LABEL");K.a.c.Nn=new K.a.c("LEGEND");K.a.c.On=new K.a.c("LI");K.a.c.Pn=new K.a.c("LINK");K.a.c.Sn=new K.a.c("MAP");
|
||||
K.a.c.Tn=new K.a.c("MARK");K.a.c.Un=new K.a.c("MATH");K.a.c.Vn=new K.a.c("MENU");K.a.c.Wn=new K.a.c("META");K.a.c.Xn=new K.a.c("METER");K.a.c.Zn=new K.a.c("NAV");K.a.c.$n=new K.a.c("NOFRAMES");K.a.c.ao=new K.a.c("NOSCRIPT");K.a.c.eo=new K.a.c("OBJECT");K.a.c.fo=new K.a.c("OL");K.a.c.ho=new K.a.c("OPTGROUP");K.a.c.io=new K.a.c("OPTION");K.a.c.jo=new K.a.c("OUTPUT");K.a.c.ko=new K.a.c("P");K.a.c.lo=new K.a.c("PARAM");K.a.c.no=new K.a.c("PRE");K.a.c.po=new K.a.c("PROGRESS");K.a.c.Q=new K.a.c("Q");
|
||||
K.a.c.qo=new K.a.c("RP");K.a.c.ro=new K.a.c("RT");K.a.c.so=new K.a.c("RUBY");K.a.c.uo=new K.a.c("S");K.a.c.wo=new K.a.c("SAMP");K.a.c.xo=new K.a.c(p);K.a.c.yo=new K.a.c("SECTION");K.a.c.zo=new K.a.c("SELECT");K.a.c.Ao=new K.a.c("SMALL");K.a.c.Bo=new K.a.c("SOURCE");K.a.c.Co=new K.a.c("SPAN");K.a.c.Do=new K.a.c("STRIKE");K.a.c.Eo=new K.a.c("STRONG");K.a.c.Fo=new K.a.c("STYLE");K.a.c.Go=new K.a.c("SUB");K.a.c.Ho=new K.a.c("SUMMARY");K.a.c.Io=new K.a.c("SUP");K.a.c.Jo=new K.a.c("SVG");K.a.c.Ko=new K.a.c("TABLE");
|
||||
K.a.c.Lo=new K.a.c("TBODY");K.a.c.Mo=new K.a.c("TD");K.a.c.No=new K.a.c("TEMPLATE");K.a.c.Oo=new K.a.c("TEXTAREA");K.a.c.Po=new K.a.c("TFOOT");K.a.c.Qo=new K.a.c("TH");K.a.c.Ro=new K.a.c("THEAD");K.a.c.So=new K.a.c("TIME");K.a.c.To=new K.a.c("TITLE");K.a.c.Uo=new K.a.c("TR");K.a.c.Vo=new K.a.c("TRACK");K.a.c.Xo=new K.a.c("TT");K.a.c.Zo=new K.a.c("U");K.a.c.$o=new K.a.c("UL");K.a.c.ap=new K.a.c("VAR");K.a.c.bp=new K.a.c("VIDEO");K.a.c.cp=new K.a.c("WBR");K.J={};K.J.ic=function(b){return function(){return b}};K.J.an=K.J.ic(!1);K.J.Wo=K.J.ic(!0);K.J.co=K.J.ic(null);K.J.$j=E();K.J.error=function(b){return function(){throw Error(b);}};K.J.ma=function(b){return function(){throw b;}};K.J.lock=function(b,c){c=c||0;return function(){return b.apply(this,Array.prototype.slice.call(arguments,0,c))}};K.J.vs=function(b){return function(){return arguments[b]}};
|
||||
K.J.Cs=function(b,c){var d=Array.prototype.slice.call(arguments,1);return function(){var c=Array.prototype.slice.call(arguments);c.push.apply(c,d);return b.apply(this,c)}};K.J.Xt=function(b,c){return K.J.ll(b,K.J.ic(c))};K.J.Cq=function(b,c){return function(d){return c?b==d:b===d}};K.J.aq=function(b,c){var d=arguments,e=d.length;return function(){var b;e&&(b=d[e-1].apply(this,arguments));for(var c=e-2;0<=c;c--)b=d[c].call(this,b);return b}};
|
||||
K.J.ll=function(b){var c=arguments,d=c.length;return function(){for(var b,f=0;f<d;f++)b=c[f].apply(this,arguments);return b}};K.J.kp=function(b){var c=arguments,d=c.length;return function(){for(var b=0;b<d;b++)if(!c[b].apply(this,arguments))return!1;return!0}};K.J.As=function(b){var c=arguments,d=c.length;return function(){for(var b=0;b<d;b++)if(c[b].apply(this,arguments))return!0;return!1}};K.J.us=function(b){return function(){return!b.apply(this,arguments)}};
|
||||
K.J.create=function(b,c){function d(){}d.prototype=b.prototype;var e=new d;b.apply(e,Array.prototype.slice.call(arguments,1));return e};K.J.Kh=!0;K.J.Op=function(b){var c=!1,d;return function(){if(!K.J.Kh)return b();c||(d=b(),c=!0);return d}};K.J.once=function(b){var c=b;return function(){if(c){var b=c;c=null;b()}}};K.J.rq=function(b,c,d){var e=0;return function(f){K.global.clearTimeout(e);var g=arguments;e=K.global.setTimeout(function(){b.apply(d,g)},c)}};
|
||||
K.J.Ft=function(b,c,d){function e(){g=K.global.setTimeout(f,c);b.apply(d,l)}function f(){g=0;h&&(h=!1,e())}var g=0,h=!1,l=[];return function(b){l=arguments;g?h=!0:e()}};K.J.Hs=function(b,c,d){function e(){f=0}var f=0;return function(g){f||(f=K.global.setTimeout(e,c),b.apply(d,arguments))}};K.g={};K.g.userAgent={};K.g.userAgent.A={};K.g.userAgent.A.Xf=function(){var b=K.g.userAgent.A.Kj();return b&&(b=b.userAgent)?b:""};K.g.userAgent.A.Kj=function(){return K.global.navigator};K.g.userAgent.A.xh=K.g.userAgent.A.Xf();K.g.userAgent.A.tt=function(b){K.g.userAgent.A.xh=b||K.g.userAgent.A.Xf()};K.g.userAgent.A.sb=function(){return K.g.userAgent.A.xh};K.g.userAgent.A.K=function(b){return K.f.contains(K.g.userAgent.A.sb(),b)};
|
||||
K.g.userAgent.A.Pk=function(){return K.f.kf(K.g.userAgent.A.sb(),"WebKit")};K.g.userAgent.A.Af=function(b){for(var c=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,d=[],e;e=c.exec(b);)d.push([e[1],e[2],e[3]||void 0]);return d};K.object={};K.object.is=function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c};K.object.forEach=function(b,c,d){for(var e in b)c.call(d,b[e],e,b)};K.object.filter=function(b,c,d){var e={},f;for(f in b)c.call(d,b[f],f,b)&&(e[f]=b[f]);return e};K.object.map=function(b,c,d){var e={},f;for(f in b)e[f]=c.call(d,b[f],f,b);return e};K.object.some=function(b,c,d){for(var e in b)if(c.call(d,b[e],e,b))return!0;return!1};K.object.every=function(b,c,d){for(var e in b)if(!c.call(d,b[e],e,b))return!1;return!0};
|
||||
K.object.Vq=function(b){var c=0,d;for(d in b)c++;return c};K.object.Tq=function(b){for(var c in b)return c};K.object.Uq=function(b){for(var c in b)return b[c]};K.object.contains=function(b,c){return K.object.cj(b,c)};K.object.jr=function(b){var c=[],d=0,e;for(e in b)c[d++]=b[e];return c};K.object.Vf=function(b){var c=[],d=0,e;for(e in b)c[d++]=e;return c};K.object.ir=function(b,c){var d=K.Nb(c),e=d?c:arguments;for(d=d?0:1;d<e.length;d++){if(null==b)return;b=b[e[d]]}return b};
|
||||
K.object.bj=function(b,c){return null!==b&&c in b};K.object.cj=function(b,c){for(var d in b)if(b[d]==c)return!0;return!1};K.object.zj=function(b,c,d){for(var e in b)if(c.call(d,b[e],e,b))return e};K.object.Hq=function(b,c,d){return(c=K.object.zj(b,c,d))&&b[c]};K.object.Qb=function(b){for(var c in b)return!1;return!0};K.object.clear=function(b){for(var c in b)delete b[c]};K.object.remove=function(b,c){var d;(d=c in b)&&delete b[c];return d};
|
||||
K.object.add=function(b,c,d){if(null!==b&&c in b)throw Error('The object already contains the key "'+c+'"');K.object.set(b,c,d)};K.object.get=function(b,c,d){return null!==b&&c in b?b[c]:d};K.object.set=function(b,c,d){b[c]=d};K.object.ht=function(b,c,d){return c in b?b[c]:b[c]=d};K.object.ut=function(b,c,d){if(c in b)return b[c];d=d();return b[c]=d};K.object.Ib=function(b,c){for(var d in b)if(!(d in c)||b[d]!==c[d])return!1;for(d in c)if(!(d in b))return!1;return!0};
|
||||
K.object.clone=function(b){var c={},d;for(d in b)c[d]=b[d];return c};K.object.Hl=function(b){var c=K.aa(b);if(c==y||c==r){if(K.ya(b.clone))return b.clone();c=c==r?[]:{};for(var d in b)c[d]=K.object.Hl(b[d]);return c}return b};K.object.Mt=function(b){var c={},d;for(d in b)c[b[d]]=d;return c};K.object.Pe=["constructor",w,"isPrototypeOf",A,D,"toString","valueOf"];
|
||||
K.object.extend=function(b,c){for(var d,e,f=1;f<arguments.length;f++){e=arguments[f];for(d in e)b[d]=e[d];for(var g=0;g<K.object.Pe.length;g++)d=K.object.Pe[g],Object.prototype.hasOwnProperty.call(e,d)&&(b[d]=e[d])}};K.object.create=function(b){var c=arguments.length;if(1==c&&K.isArray(arguments[0]))return K.object.create.apply(null,arguments[0]);if(c%2)throw Error("Uneven number of arguments");for(var d={},e=0;e<c;e+=2)d[arguments[e]]=arguments[e+1];return d};
|
||||
K.object.gj=function(b){var c=arguments.length;if(1==c&&K.isArray(arguments[0]))return K.object.gj.apply(null,arguments[0]);for(var d={},e=0;e<c;e++)d[arguments[e]]=!0;return d};K.object.iq=function(b){var c=b;Object.isFrozen&&!Object.isFrozen(b)&&(c=Object.create(b),Object.freeze(c));return c};K.object.Gr=function(b){return!!Object.isFrozen&&Object.isFrozen(b)};
|
||||
K.object.Sq=function(b,c,d){if(!b)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return K.object.Vf(b);for(var e={};b&&(b!==Object.prototype||c)&&(b!==Function.prototype||d);){for(var f=Object.getOwnPropertyNames(b),g=0;g<f.length;g++)e[f[g]]=!0;b=Object.getPrototypeOf(b)}return K.object.Vf(e)};K.g.userAgent.v={};K.g.userAgent.v.Rg=function(){return K.g.userAgent.A.K("Opera")};K.g.userAgent.v.Nk=function(){return K.g.userAgent.A.K("Trident")||K.g.userAgent.A.K("MSIE")};K.g.userAgent.v.Sd=function(){return K.g.userAgent.A.K("Edge")};K.g.userAgent.v.Mk=function(){return K.g.userAgent.A.K("Firefox")};K.g.userAgent.v.Sg=function(){return K.g.userAgent.A.K("Safari")&&!(K.g.userAgent.v.Qd()||K.g.userAgent.v.Rd()||K.g.userAgent.v.Rg()||K.g.userAgent.v.Sd()||K.g.userAgent.v.Kg()||K.g.userAgent.A.K("Android"))};
|
||||
K.g.userAgent.v.Rd=function(){return K.g.userAgent.A.K("Coast")};K.g.userAgent.v.Ok=function(){return(K.g.userAgent.A.K("iPad")||K.g.userAgent.A.K("iPhone"))&&!K.g.userAgent.v.Sg()&&!K.g.userAgent.v.Qd()&&!K.g.userAgent.v.Rd()&&K.g.userAgent.A.K("AppleWebKit")};K.g.userAgent.v.Qd=function(){return(K.g.userAgent.A.K("Chrome")||K.g.userAgent.A.K("CriOS"))&&!K.g.userAgent.v.Sd()};
|
||||
K.g.userAgent.v.Lk=function(){return K.g.userAgent.A.K("Android")&&!(K.g.userAgent.v.zg()||K.g.userAgent.v.fk()||K.g.userAgent.v.Nd()||K.g.userAgent.v.Kg())};K.g.userAgent.v.Nd=K.g.userAgent.v.Rg;K.g.userAgent.v.uc=K.g.userAgent.v.Nk;K.g.userAgent.v.Ra=K.g.userAgent.v.Sd;K.g.userAgent.v.fk=K.g.userAgent.v.Mk;K.g.userAgent.v.Ur=K.g.userAgent.v.Sg;K.g.userAgent.v.Ar=K.g.userAgent.v.Rd;K.g.userAgent.v.Ir=K.g.userAgent.v.Ok;K.g.userAgent.v.zg=K.g.userAgent.v.Qd;K.g.userAgent.v.yr=K.g.userAgent.v.Lk;
|
||||
K.g.userAgent.v.Kg=function(){return K.g.userAgent.A.K("Silk")};K.g.userAgent.v.Lb=function(){function b(b){b=K.j.find(b,e);return d[b]||""}var c=K.g.userAgent.A.sb();if(K.g.userAgent.v.uc())return K.g.userAgent.v.Jj(c);c=K.g.userAgent.A.Af(c);var d={};K.j.forEach(c,function(b){d[b[0]]=b[1]});var e=K.fb(K.object.bj,d);return K.g.userAgent.v.Nd()?b(["Version","Opera"]):K.g.userAgent.v.Ra()?b(["Edge"]):K.g.userAgent.v.zg()?b(["Chrome","CriOS"]):(c=c[2])&&c[1]||""};
|
||||
K.g.userAgent.v.va=function(b){return 0<=K.f.Eb(K.g.userAgent.v.Lb(),b)};K.g.userAgent.v.Jj=function(b){var c=/rv: *([\d\.]*)/.exec(b);if(c&&c[1])return c[1];c="";var d=/MSIE +([\d\.]+)/.exec(b);if(d&&d[1])if(b=/Trident\/(\d.\d)/.exec(b),"7.0"==d[1])if(b&&b[1])switch(b[1]){case "4.0":c="8.0";break;case "5.0":c="9.0";break;case "6.0":c="10.0";break;case "7.0":c="11.0"}else c="7.0";else c=d[1];return c};K.g.userAgent.U={};K.g.userAgent.U.lk=function(){return K.g.userAgent.A.K("Presto")};K.g.userAgent.U.pk=function(){return K.g.userAgent.A.K("Trident")||K.g.userAgent.A.K("MSIE")};K.g.userAgent.U.Ra=function(){return K.g.userAgent.A.K("Edge")};K.g.userAgent.U.Mg=function(){return K.g.userAgent.A.Pk()&&!K.g.userAgent.U.Ra()};K.g.userAgent.U.gk=function(){return K.g.userAgent.A.K("Gecko")&&!K.g.userAgent.U.Mg()&&!K.g.userAgent.U.pk()&&!K.g.userAgent.U.Ra()};
|
||||
K.g.userAgent.U.Lb=function(){var b=K.g.userAgent.A.sb();if(b){b=K.g.userAgent.A.Af(b);var c=K.g.userAgent.U.Hj(b);if(c)return"Gecko"==c[0]?K.g.userAgent.U.Rj(b):c[1];b=b[0];var d;if(b&&(d=b[2])&&(d=/Trident\/([^\s;]+)/.exec(d)))return d[1]}return""};K.g.userAgent.U.Hj=function(b){if(!K.g.userAgent.U.Ra())return b[1];for(var c=0;c<b.length;c++){var d=b[c];if("Edge"==d[0])return d}};K.g.userAgent.U.va=function(b){return 0<=K.f.Eb(K.g.userAgent.U.Lb(),b)};
|
||||
K.g.userAgent.U.Rj=function(b){return(b=K.j.find(b,function(b){return"Firefox"==b[0]}))&&b[1]||""};K.async.qh=function(b){K.global.setTimeout(function(){throw b;},0)};K.async.pa=function(b,c,d){var e=b;c&&(e=K.bind(b,c));e=K.async.pa.Ah(e);K.ya(K.global.setImmediate)&&(d||K.async.pa.Kl())?K.global.setImmediate(e):(K.async.pa.kh||(K.async.pa.kh=K.async.pa.Nj()),K.async.pa.kh(e))};K.async.pa.Kl=function(){return K.global.Window&&K.global.Window.prototype&&!K.g.userAgent.v.Ra()&&K.global.Window.prototype.setImmediate==K.global.setImmediate?!1:!0};
|
||||
K.async.pa.Nj=function(){var b=K.global.MessageChannel;"undefined"===typeof b&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!K.g.userAgent.U.lk()&&(b=function(){var b=document.createElement("IFRAME");b.style.display="none";b.src="";document.documentElement.appendChild(b);var c=b.contentWindow;b=c.document;b.open();b.write("");b.close();var d="callImmediate"+Math.random(),e="file:"==c.location.protocol?"*":c.location.protocol+"//"+c.location.host;b=K.bind(function(b){if(("*"==
|
||||
e||b.origin==e)&&b.data==d)this.port1.onmessage()},this);c.addEventListener("message",b,!1);this.port1={};this.port2={postMessage:function(){c.postMessage(d,e)}}});if("undefined"!==typeof b&&!K.g.userAgent.v.uc()){var c=new b,d={},e=d;c.port1.onmessage=function(){if(K.R(d.next)){d=d.next;var b=d.lf;d.lf=null;b()}};return function(b){e.next={lf:b};e=e.next;c.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement(p)?function(b){var c=document.createElement(p);
|
||||
c.onreadystatechange=function(){c.onreadystatechange=null;c.parentNode.removeChild(c);c=null;b();b=null};document.documentElement.appendChild(c)}:function(b){K.global.setTimeout(b,0)}};K.async.pa.Ah=K.J.$j;K.debug.Z.register(function(b){K.async.pa.Ah=b});K.async.Ea=function(){this.Qc=this.Ab=null};K.async.Ea.Vc=100;K.async.Ea.Kb=new K.async.Zb(function(){return new K.async.ad},function(b){b.reset()},K.async.Ea.Vc);K.async.Ea.prototype.add=function(b,c){var d=K.async.Ea.Kb.get();d.set(b,c);this.Qc?this.Qc.next=d:this.Ab=d;this.Qc=d};K.async.Ea.prototype.remove=function(){var b=null;this.Ab&&(b=this.Ab,this.Ab=this.Ab.next,this.Ab||(this.Qc=null),b.next=null);return b};K.async.ad=function(){this.next=this.scope=this.od=null};
|
||||
K.async.ad.prototype.set=function(b,c){this.od=b;this.scope=c;this.next=null};K.async.ad.prototype.reset=function(){this.next=this.scope=this.od=null};K.async.M=function(b,c){K.async.M.Hc||K.async.M.bk();K.async.M.Pc||(K.async.M.Hc(),K.async.M.Pc=!0);K.async.M.ie.add(b,c)};K.async.M.bk=function(){if(-1!=String(K.global.Promise).indexOf("[native code]")){var b=K.global.Promise.resolve(void 0);K.async.M.Hc=function(){b.then(K.async.M.Cc)}}else K.async.M.Hc=function(){K.async.pa(K.async.M.Cc)}};K.async.M.Jq=function(b){K.async.M.Hc=function(){K.async.pa(K.async.M.Cc);b&&b(K.async.M.Cc)}};K.async.M.Pc=!1;K.async.M.ie=new K.async.Ea;
|
||||
K.ea&&(K.async.M.Rs=function(){K.async.M.Pc=!1;K.async.M.ie=new K.async.Ea});K.async.M.Cc=function(){for(var b;b=K.async.M.ie.remove();){try{b.od.call(b.scope)}catch(c){K.async.qh(c)}K.async.Ea.Kb.put(b)}K.async.M.Pc=!1};K.a.m={};K.a.m.Cp=F();K.a.m.up=F();K.a.m.zp=F();K.a.m.yp=F();K.a.m.vp=F();K.a.m.wp=F();K.a.m.xp=F();K.a.m.Ap=F();K.a.m.Bp=F();K.a.m.sq=function(b){return K.ha(b)?b.constructor.displayName||b.constructor.name||Object.prototype.toString.call(b):void 0===b?"undefined":null===b?"null":typeof b};K.a.m.qc=function(b){return(b=b&&b.ownerDocument)&&(b.defaultView||b.parentWindow)||K.global};K.g.userAgent.platform={};K.g.userAgent.platform.yg=function(){return K.g.userAgent.A.K("Android")};K.g.userAgent.platform.Hg=function(){return K.g.userAgent.A.K("iPod")};K.g.userAgent.platform.Gg=function(){return K.g.userAgent.A.K("iPhone")&&!K.g.userAgent.A.K("iPod")&&!K.g.userAgent.A.K("iPad")};K.g.userAgent.platform.Fg=function(){return K.g.userAgent.A.K("iPad")};K.g.userAgent.platform.Eg=function(){return K.g.userAgent.platform.Gg()||K.g.userAgent.platform.Fg()||K.g.userAgent.platform.Hg()};
|
||||
K.g.userAgent.platform.Ig=function(){return K.g.userAgent.A.K("Macintosh")};K.g.userAgent.platform.ik=function(){return K.g.userAgent.A.K("Linux")};K.g.userAgent.platform.Og=function(){return K.g.userAgent.A.K("Windows")};K.g.userAgent.platform.Ag=function(){return K.g.userAgent.A.K("CrOS")};
|
||||
K.g.userAgent.platform.Lb=function(){var b=K.g.userAgent.A.sb(),c="";K.g.userAgent.platform.Og()?(c=/Windows (?:NT|Phone) ([0-9.]+)/,c=(b=c.exec(b))?b[1]:"0.0"):K.g.userAgent.platform.Eg()?(c=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/,c=(b=c.exec(b))&&b[1].replace(/_/g,".")):K.g.userAgent.platform.Ig()?(c=/Mac OS X ([0-9_.]+)/,c=(b=c.exec(b))?b[1].replace(/_/g,"."):"10"):K.g.userAgent.platform.yg()?(c=/Android\s+([^\);]+)(\)|;)/,c=(b=c.exec(b))&&b[1]):K.g.userAgent.platform.Ag()&&(c=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/,
|
||||
c=(b=c.exec(b))&&b[1]);return c||""};K.g.userAgent.platform.va=function(b){return 0<=K.f.Eb(K.g.userAgent.platform.Lb(),b)};K.Ha={};K.Ha.object=function(b,c){return c};K.Ha.ce=function(b){K.Ha.ce[" "](b);return b};K.Ha.ce[" "]=K.eb;K.Ha.Pp=function(b,c){try{return K.Ha.ce(b[c]),!0}catch(d){}return!1};K.Ha.cache=function(b,c,d,e){e=e?e(c):c;return Object.prototype.hasOwnProperty.call(b,e)?b[e]:b[e]=d(c)};K.userAgent={};K.userAgent.oe=!1;K.userAgent.me=!1;K.userAgent.ne=!1;K.userAgent.te=!1;K.userAgent.Uc=!1;K.userAgent.re=!1;K.userAgent.Fh=!1;K.userAgent.Bb=K.userAgent.oe||K.userAgent.me||K.userAgent.ne||K.userAgent.Uc||K.userAgent.te||K.userAgent.re;K.userAgent.Qj=function(){return K.g.userAgent.A.sb()};K.userAgent.Yf=function(){return K.global.navigator||null};K.userAgent.Ne=K.userAgent.Bb?K.userAgent.re:K.g.userAgent.v.Nd();K.userAgent.Y=K.userAgent.Bb?K.userAgent.oe:K.g.userAgent.v.uc();
|
||||
K.userAgent.Ce=K.userAgent.Bb?K.userAgent.me:K.g.userAgent.U.Ra();K.userAgent.Um=K.userAgent.Ce||K.userAgent.Y;K.userAgent.Yc=K.userAgent.Bb?K.userAgent.ne:K.g.userAgent.U.gk();K.userAgent.Cb=K.userAgent.Bb?K.userAgent.te||K.userAgent.Uc:K.g.userAgent.U.Mg();K.userAgent.kk=function(){return K.userAgent.Cb&&K.g.userAgent.A.K("Mobile")};K.userAgent.Yn=K.userAgent.Uc||K.userAgent.kk();K.userAgent.vo=K.userAgent.Cb;K.userAgent.nj=function(){var b=K.userAgent.Yf();return b&&b.platform||""};
|
||||
K.userAgent.mo=K.userAgent.nj();K.userAgent.qe=!1;K.userAgent.ue=!1;K.userAgent.pe=!1;K.userAgent.ve=!1;K.userAgent.le=!1;K.userAgent.Sc=!1;K.userAgent.Rc=!1;K.userAgent.Tc=!1;K.userAgent.Da=K.userAgent.qe||K.userAgent.ue||K.userAgent.pe||K.userAgent.ve||K.userAgent.le||K.userAgent.Sc||K.userAgent.Rc||K.userAgent.Tc;K.userAgent.Rn=K.userAgent.Da?K.userAgent.qe:K.g.userAgent.platform.Ig();K.userAgent.ep=K.userAgent.Da?K.userAgent.ue:K.g.userAgent.platform.Og();
|
||||
K.userAgent.hk=function(){return K.g.userAgent.platform.ik()||K.g.userAgent.platform.Ag()};K.userAgent.Qn=K.userAgent.Da?K.userAgent.pe:K.userAgent.hk();K.userAgent.tk=function(){var b=K.userAgent.Yf();return!!b&&K.f.contains(b.appVersion||"","X11")};K.userAgent.fp=K.userAgent.Da?K.userAgent.ve:K.userAgent.tk();K.userAgent.am=K.userAgent.Da?K.userAgent.le:K.g.userAgent.platform.yg();K.userAgent.Fn=K.userAgent.Da?K.userAgent.Sc:K.g.userAgent.platform.Gg();
|
||||
K.userAgent.En=K.userAgent.Da?K.userAgent.Rc:K.g.userAgent.platform.Fg();K.userAgent.Gn=K.userAgent.Da?K.userAgent.Tc:K.g.userAgent.platform.Hg();K.userAgent.Dn=K.userAgent.Da?K.userAgent.Sc||K.userAgent.Rc||K.userAgent.Tc:K.g.userAgent.platform.Eg();K.userAgent.oj=function(){var b="",c=K.userAgent.Sj();c&&(b=c?c[1]:"");return K.userAgent.Y&&(c=K.userAgent.Of(),null!=c&&c>parseFloat(b))?String(c):b};
|
||||
K.userAgent.Sj=function(){var b=K.userAgent.Qj();if(K.userAgent.Yc)return/rv\:([^\);]+)(\)|;)/.exec(b);if(K.userAgent.Ce)return/Edge\/([\d\.]+)/.exec(b);if(K.userAgent.Y)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(b);if(K.userAgent.Cb)return/WebKit\/(\S+)/.exec(b);if(K.userAgent.Ne)return/(?:Version)[ \/]?(\S+)/.exec(b)};K.userAgent.Of=function(){var b=K.global.document;return b?b.documentMode:void 0};K.userAgent.VERSION=K.userAgent.oj();K.userAgent.compare=function(b,c){return K.f.Eb(b,c)};
|
||||
K.userAgent.rk={};K.userAgent.va=function(b){return K.userAgent.Fh||K.Ha.cache(K.userAgent.rk,b,function(){return 0<=K.f.Eb(K.userAgent.VERSION,b)})};K.userAgent.Zr=K.userAgent.va;K.userAgent.Pb=function(b){return Number(K.userAgent.Wh)>=b};K.userAgent.Cr=K.userAgent.Pb;var L;var M=K.global.document,aa=K.userAgent.Of();L=M&&K.userAgent.Y?aa||("CSS1Compat"==M.compatMode?parseInt(K.userAgent.VERSION,10):5):void 0;K.userAgent.Wh=L;K.a.ib={Lh:!K.userAgent.Y||K.userAgent.Pb(9),Mh:!K.userAgent.Yc&&!K.userAgent.Y||K.userAgent.Y&&K.userAgent.Pb(9)||K.userAgent.Yc&&K.userAgent.va("1.9.1"),xe:K.userAgent.Y&&!K.userAgent.va("9"),Nh:K.userAgent.Y||K.userAgent.Ne||K.userAgent.Cb,ci:K.userAgent.Y,Mn:K.userAgent.Y&&!K.userAgent.Pb(9)};K.a.Mc={};K.a.Mc.Hi={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};K.a.Mc.sk=function(b){return!0===K.a.Mc.Hi[b]};K.b.V=function(){this.yc="";this.ni=K.b.V.ca};K.b.V.prototype.ua=!0;K.b.V.ca={};K.b.V.mc=function(b){b=K.f.I.u(b);return 0===b.length?K.b.V.EMPTY:K.b.V.hd(b)};K.b.V.prototype.ga=G("yc");K.ea&&(K.b.V.prototype.toString=function(){return"SafeScript{"+this.yc+"}"});K.b.V.u=function(b){if(b instanceof K.b.V&&b.constructor===K.b.V&&b.ni===K.b.V.ca)return b.yc;K.m.ma("expected object of type SafeScript, got '"+b+k+K.aa(b));return"type_error:SafeScript"};K.b.V.hd=function(b){return(new K.b.V).bb(b)};
|
||||
K.b.V.prototype.bb=function(b){this.yc=b;return this};K.b.V.EMPTY=K.b.V.hd("");K.sa={};K.sa.url={};K.sa.url.dj=function(b){return K.sa.url.lg().createObjectURL(b)};K.sa.url.Ts=function(b){K.sa.url.lg().revokeObjectURL(b)};K.sa.url.lg=function(){var b=K.sa.url.Ef();if(null!=b)return b;throw Error("This browser doesn't seem to support blob URLs");};K.sa.url.Ef=function(){return K.R(K.global.URL)&&K.R(K.global.URL.createObjectURL)?K.global.URL:K.R(K.global.webkitURL)&&K.R(K.global.webkitURL.createObjectURL)?K.global.webkitURL:K.R(K.global.createObjectURL)?K.global:null};
|
||||
K.sa.url.Lp=function(){return null!=K.sa.url.Ef()};K.b.o=function(){this.Ga="";this.ri=K.b.o.ca};K.b.o.Ka="about:invalid#zClosurez";K.b.o.prototype.ua=!0;K.b.o.prototype.ga=G("Ga");K.b.o.prototype.Dd=!0;K.b.o.prototype.$a=function(){return K.h.i.O.Ta};K.ea&&(K.b.o.prototype.toString=function(){return"SafeUrl{"+this.Ga+"}"});K.b.o.u=function(b){if(b instanceof K.b.o&&b.constructor===K.b.o&&b.ri===K.b.o.ca)return b.Ga;K.m.ma("expected object of type SafeUrl, got '"+b+k+K.aa(b));return"type_error:SafeUrl"};K.b.o.mc=function(b){return K.b.o.Fa(K.f.I.u(b))};
|
||||
K.b.Re=/^(?:audio\/(?:3gpp|3gpp2|aac|midi|mp4|mpeg|ogg|x-m4a|x-wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|text\/csv|video\/(?:mpeg|mp4|ogg|webm))$/i;K.b.o.Mq=function(b){b=K.b.Re.test(b.type)?K.sa.url.dj(b):K.b.o.Ka;return K.b.o.Fa(b)};K.b.Rh=/^data:([^;,]*);base64,[a-z0-9+\/]+=*$/i;K.b.o.Oq=function(b){var c=b.match(K.b.Rh);c=c&&K.b.Re.test(c[1]);return K.b.o.Fa(c?b:K.b.o.Ka)};K.b.o.Qq=function(b){K.f.Zi(b)||(b=K.b.o.Ka);return K.b.o.Fa(b)};K.b.o.Rq=function(b){return K.b.o.Fa(K.b.C.u(b))};
|
||||
K.b.Se=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;K.b.o.Gc=function(b){if(b instanceof K.b.o)return b;b=b.ua?b.ga():String(b);K.b.Se.test(b)||(b=K.b.o.Ka);return K.b.o.Fa(b)};K.b.o.Vb=function(b){if(b instanceof K.b.o)return b;b=b.ua?b.ga():String(b);K.b.Se.test(b)||(b=K.b.o.Ka);return K.b.o.Fa(b)};K.b.o.ca={};K.b.o.Fa=function(b){var c=new K.b.o;c.Ga=b;return c};K.b.o.Wl=K.b.o.Fa("about:blank");K.b.B=function(){this.Ac="";this.pi=K.b.B.ca};K.b.B.prototype.ua=!0;K.b.B.ca={};K.b.B.mc=function(b){b=K.f.I.u(b);return 0===b.length?K.b.B.EMPTY:K.b.B.Fb(b)};K.b.B.Vp=F();K.b.B.prototype.ga=G("Ac");K.ea&&(K.b.B.prototype.toString=function(){return"SafeStyle{"+this.Ac+"}"});K.b.B.u=function(b){if(b instanceof K.b.B&&b.constructor===K.b.B&&b.pi===K.b.B.ca)return b.Ac;K.m.ma("expected object of type SafeStyle, got '"+b+k+K.aa(b));return"type_error:SafeStyle"};K.b.B.Fb=function(b){return(new K.b.B).bb(b)};
|
||||
K.b.B.prototype.bb=function(b){this.Ac=b;return this};K.b.B.EMPTY=K.b.B.Fb("");K.b.B.Ka="zClosurez";K.b.B.create=function(b){var c="",d;for(d in b){if(!/^[-_a-zA-Z0-9]+$/.test(d))throw Error("Name allows only [-_a-zA-Z0-9], got: "+d);var e=b[d];null!=e&&(e=K.isArray(e)?K.j.map(e,K.b.B.gh).join(" "):K.b.B.gh(e),c+=d+":"+e+";")}return c?K.b.B.Fb(c):K.b.B.EMPTY};
|
||||
K.b.B.gh=function(b){return b instanceof K.b.o?'url("'+K.b.o.u(b).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")':b instanceof K.f.I?K.f.I.u(b):K.b.B.il(String(b))};K.b.B.il=function(b){var c=b.replace(K.b.o.ai,"$1").replace(K.b.o.Xe,"url");return K.b.B.Ei.test(c)?K.b.B.Vj(b)?K.b.B.jl(b):(K.m.ma("String value requires balanced quotes, got: "+b),K.b.B.Ka):(K.m.ma("String value allows only "+K.b.B.$e+" and simple functions, got: "+b),K.b.B.Ka)};
|
||||
K.b.B.Vj=function(b){for(var c=!0,d=!0,e=0;e<b.length;e++){var f=b.charAt(e);"'"==f&&d?c=!c:'"'==f&&c&&(d=!d)}return c&&d};K.b.B.$e="[-,.\"'%_!# a-zA-Z0-9]";K.b.B.Ei=new RegExp("^"+K.b.B.$e+"+$");K.b.o.Xe=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g;K.b.o.ai=/\b(hsl|hsla|rgb|rgba|(rotate|scale|translate)(X|Y|Z|3d)?)\([-0-9a-z.%, ]+\)/g;
|
||||
K.b.B.jl=function(b){return b.replace(K.b.o.Xe,function(b,d,e,f){var c="";e=e.replace(/^(['"])(.*)\1$/,function(b,d,e){c=d;return e});b=K.b.o.Gc(e).ga();return d+c+b+c+f})};K.b.B.concat=function(b){function c(b){K.isArray(b)?K.j.forEach(b,c):d+=K.b.B.u(b)}var d="";K.j.forEach(arguments,c);return d?K.b.B.Fb(d):K.b.B.EMPTY};K.b.N=function(){this.zc="";this.oi=K.b.N.ca};K.b.N.prototype.ua=!0;K.b.N.ca={};
|
||||
K.b.N.kq=function(b,c){if(K.f.contains(b,"<"))throw Error("Selector does not allow '<', got: "+b);var d=b.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(d))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+b);if(!K.b.N.Uj(d))throw Error("() and [] in selector must be balanced, got: "+b);c instanceof K.b.B||(c=K.b.B.create(c));b=b+"{"+K.b.B.u(c)+"}";return K.b.N.Gb(b)};
|
||||
K.b.N.Uj=function(b){for(var c={"(":")","[":"]"},d=[],e=0;e<b.length;e++){var f=b[e];if(c[f])d.push(c[f]);else if(K.object.contains(c,f)&&d.pop()!=f)return!1}return 0==d.length};K.b.N.concat=function(b){function c(b){K.isArray(b)?K.j.forEach(b,c):d+=K.b.N.u(b)}var d="";K.j.forEach(arguments,c);return K.b.N.Gb(d)};K.b.N.mc=function(b){b=K.f.I.u(b);return 0===b.length?K.b.N.EMPTY:K.b.N.Gb(b)};K.b.N.prototype.ga=G("zc");K.ea&&(K.b.N.prototype.toString=function(){return"SafeStyleSheet{"+this.zc+"}"});
|
||||
K.b.N.u=function(b){if(b instanceof K.b.N&&b.constructor===K.b.N&&b.oi===K.b.N.ca)return b.zc;K.m.ma("expected object of type SafeStyleSheet, got '"+b+k+K.aa(b));return"type_error:SafeStyleSheet"};K.b.N.Gb=function(b){return(new K.b.N).bb(b)};K.b.N.prototype.bb=function(b){this.zc=b;return this};K.b.N.EMPTY=K.b.N.Gb("");K.b.l=function(){this.Ga="";this.mi=K.b.l.ca;this.kc=null};K.b.l.prototype.Dd=!0;K.b.l.prototype.$a=G("kc");K.b.l.prototype.ua=!0;K.b.l.prototype.ga=G("Ga");K.ea&&(K.b.l.prototype.toString=function(){return"SafeHtml{"+this.Ga+"}"});K.b.l.u=function(b){if(b instanceof K.b.l&&b.constructor===K.b.l&&b.mi===K.b.l.ca)return b.Ga;K.m.ma("expected object of type SafeHtml, got '"+b+k+K.aa(b));return"type_error:SafeHtml"};
|
||||
K.b.l.ta=function(b){if(b instanceof K.b.l)return b;var c=null;b.Dd&&(c=b.$a());return K.b.l.ra(K.f.ta(b.ua?b.ga():String(b)),c)};K.b.l.pr=function(b){if(b instanceof K.b.l)return b;b=K.b.l.ta(b);return K.b.l.ra(K.f.Yg(K.b.l.u(b)),b.$a())};K.b.l.qr=function(b){if(b instanceof K.b.l)return b;b=K.b.l.ta(b);return K.b.l.ra(K.f.Ol(K.b.l.u(b)),b.$a())};K.b.l.from=K.b.l.ta;K.b.l.Ze=/^[a-zA-Z0-9-]+$/;K.b.l.Ci={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0};
|
||||
K.b.l.ii={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0};K.b.l.create=function(b,c,d){K.b.l.Ml(String(b));return K.b.l.Ya(String(b),c,d)};K.b.l.Ml=function(b){if(!K.b.l.Ze.test(b))throw Error("Invalid tag name <"+b+">.");if(b.toUpperCase()in K.b.l.ii)throw Error("Tag name <"+b+"> is not allowed for SafeHtml.");};
|
||||
K.b.l.hq=function(b,c,d,e){b&&K.b.C.u(b);var f={};f.src=b||null;f.srcdoc=c&&K.b.l.u(c);b=K.b.l.hc(f,{sandbox:""},d);return K.b.l.Ya("iframe",b,e)};K.b.l.lq=function(b,c,d,e){if(!K.b.l.Wi())throw Error("The browser does not support sandboxed iframes.");var f={};f.src=b?K.b.o.u(K.b.o.Gc(b)):null;f.srcdoc=c||null;f.sandbox="";b=K.b.l.hc(f,{},d);return K.b.l.Ya("iframe",b,e)};K.b.l.Wi=function(){return K.global.HTMLIFrameElement&&"sandbox"in K.global.HTMLIFrameElement.prototype};
|
||||
K.b.l.nq=function(b,c){K.b.C.u(b);b=K.b.l.hc({src:b},{},c);return K.b.l.Ya("script",b)};K.b.l.mq=function(b,c){for(var d in c){var e=d.toLowerCase();if("language"==e||"src"==e||"text"==e||"type"==e)throw Error('Cannot set "'+e+'" attribute');}d="";b=K.j.concat(b);for(e=0;e<b.length;e++)d+=K.b.V.u(b[e]);b=K.b.l.ra(d,K.h.i.O.qa);return K.b.l.Ya("script",c,b)};
|
||||
K.b.l.oq=function(b,c){c=K.b.l.hc({type:"text/css"},{},c);var d="";b=K.j.concat(b);for(var e=0;e<b.length;e++)d+=K.b.N.u(b[e]);b=K.b.l.ra(d,K.h.i.O.qa);return K.b.l.Ya("style",c,b)};K.b.l.jq=function(b,c){b=K.b.o.u(K.b.o.Gc(b));(K.g.userAgent.v.uc()||K.g.userAgent.v.Ra())&&K.f.contains(b,";")&&(b="'"+b.replace(/'/g,"%27")+"'");return K.b.l.Ya("meta",{"http-equiv":"refresh",content:(c||0)+"; url="+b})};
|
||||
K.b.l.Cj=function(b,c,d){if(d instanceof K.f.I)d=K.f.I.u(d);else if("style"==c.toLowerCase())d=K.b.l.Oj(d);else{if(/^on/i.test(c))throw Error('Attribute "'+c+'" requires goog.string.Const value, "'+d+'" given.');if(c.toLowerCase()in K.b.l.Ci)if(d instanceof K.b.C)d=K.b.C.u(d);else if(d instanceof K.b.o)d=K.b.o.u(d);else if(K.L(d))d=K.b.o.Gc(d).ga();else throw Error('Attribute "'+c+'" on tag "'+b+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+d+'" given.');}d.ua&&(d=d.ga());
|
||||
return c+'="'+K.f.ta(String(d))+'"'};K.b.l.Oj=function(b){if(!K.ha(b))throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof b+" given: "+b);b instanceof K.b.B||(b=K.b.B.create(b));return K.b.B.u(b)};K.b.l.qq=function(b,c,d,e){c=K.b.l.create(c,d,e);c.kc=b;return c};
|
||||
K.b.l.concat=function(b){function c(b){K.isArray(b)?K.j.forEach(b,c):(b=K.b.l.ta(b),e+=K.b.l.u(b),b=b.$a(),d==K.h.i.O.qa?d=b:b!=K.h.i.O.qa&&d!=b&&(d=null))}var d=K.h.i.O.qa,e="";K.j.forEach(arguments,c);return K.b.l.ra(e,d)};K.b.l.cq=function(b,c){var d=K.b.l.concat(K.j.slice(arguments,1));d.kc=b;return d};K.b.l.ca={};K.b.l.ra=function(b,c){return(new K.b.l).bb(b,c)};K.b.l.prototype.bb=function(b,c){this.Ga=b;this.kc=c;return this};
|
||||
K.b.l.Ya=function(b,c,d){var e=null;var f="<"+b+K.b.l.vl(b,c);K.cb(d)?K.isArray(d)||(d=[d]):d=[];K.a.Mc.sk(b.toLowerCase())?f+=">":(e=K.b.l.concat(d),f+=">"+K.b.l.u(e)+"</"+b+">",e=e.$a());(b=c&&c.dir)&&(e=/^(ltr|rtl|auto)$/i.test(b)?K.h.i.O.qa:null);return K.b.l.ra(f,e)};K.b.l.vl=function(b,c){var d="";if(c)for(var e in c){if(!K.b.l.Ze.test(e))throw Error('Invalid attribute name "'+e+'".');var f=c[e];K.cb(f)&&(d+=" "+K.b.l.Cj(b,e,f))}return d};
|
||||
K.b.l.hc=function(b,c,d){var e={},f;for(f in b)e[f]=b[f];for(f in c)e[f]=c[f];for(f in d){var g=f.toLowerCase();if(g in b)throw Error('Cannot override "'+g+'" attribute, got "'+f+'" with value "'+d[f]+'"');g in c&&delete e[g];e[f]=d[f]}return e};K.b.l.Qm=K.b.l.ra("<!DOCTYPE html>",K.h.i.O.qa);K.b.l.EMPTY=K.b.l.ra("",K.h.i.O.qa);K.b.l.we=K.b.l.ra("<br>",K.h.i.O.qa);K.a.S={};K.a.S.In={Zl:"afterbegin",$l:"afterend",om:"beforebegin",pm:"beforeend"};K.a.S.sr=function(b,c,d){b.insertAdjacentHTML(c,K.b.l.u(d))};K.a.S.ui={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0};K.a.S.lh=function(b,c){if(K.m.ja&&K.a.S.ui[b.tagName.toUpperCase()])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+b.tagName+".");b.innerHTML=K.b.l.u(c)};K.a.S.ot=function(b,c){b.outerHTML=K.b.l.u(c)};K.a.S.qt=function(b,c){b.style.cssText=K.b.B.u(c)};K.a.S.wq=function(b,c){b.write(K.b.l.u(c))};
|
||||
K.a.S.at=function(b,c){c=c instanceof K.b.o?c:K.b.o.Vb(c);b.href=K.b.o.u(c)};K.a.S.kt=function(b,c){c=c instanceof K.b.o?c:K.b.o.Vb(c);b.src=K.b.o.u(c)};K.a.S.et=function(b,c){b.src=K.b.C.u(c)};K.a.S.gt=function(b,c){b.src=K.b.C.u(c)};K.a.S.it=function(b,c){b.src=K.b.C.u(c)};K.a.S.jt=function(b,c){b.srcdoc=K.b.l.u(c)};K.a.S.lt=function(b,c,d){b.rel=d;K.f.kf(d,"stylesheet")?b.href=K.b.C.u(c):b.href=c instanceof K.b.C?K.b.C.u(c):c instanceof K.b.o?K.b.o.u(c):K.b.o.Vb(c).ga()};
|
||||
K.a.S.nt=function(b,c){b.data=K.b.C.u(c)};K.a.S.ol=function(b,c){b.src=K.b.C.u(c)};K.a.S.pt=function(b,c){b.text=K.b.V.u(c)};K.a.S.mt=function(b,c){c=c instanceof K.b.o?c:K.b.o.Vb(c);b.href=K.b.o.u(c)};K.a.S.zs=function(b,c,d,e,f){b=b instanceof K.b.o?b:K.b.o.Vb(b);return(c||window).open(K.b.o.u(b),d?K.f.I.u(d):"",e,f)};K.b.hb={};K.b.hb.fl=function(b,c){return K.b.l.ra(c,null)};K.b.hb.Xs=function(b,c){return K.b.V.hd(c)};K.b.hb.Ys=function(b,c){return K.b.B.Fb(c)};K.b.hb.Zs=function(b,c){return K.b.N.Gb(c)};K.b.hb.$s=function(b,c){return K.b.o.Fa(c)};K.b.hb.Ot=function(b,c){return K.b.C.Hb(c)};K.s={};K.s.Fs=function(b){return Math.floor(Math.random()*b)};K.s.Qt=function(b,c){return b+Math.random()*(c-b)};K.s.Wp=function(b,c,d){return Math.min(Math.max(b,c),d)};K.s.Vg=function(b,c){b%=c;return 0>b*c?b+c:b};K.s.bs=function(b,c,d){return b+d*(c-b)};K.s.ps=function(b,c,d){return Math.abs(b-c)<=(d||1E-6)};K.s.fe=function(b){return K.s.Vg(b,360)};K.s.At=function(b){return K.s.Vg(b,2*Math.PI)};K.s.uh=function(b){return b*Math.PI/180};K.s.zl=function(b){return 180*b/Math.PI};
|
||||
K.s.mp=function(b,c){return c*Math.cos(K.s.uh(b))};K.s.np=function(b,c){return c*Math.sin(K.s.uh(b))};K.s.angle=function(b,c,d,e){return K.s.fe(K.s.zl(Math.atan2(e-c,d-b)))};K.s.lp=function(b,c){b=K.s.fe(c)-K.s.fe(b);180<b?b-=360:-180>=b&&(b=360+b);return b};K.s.sign=function(b){return 0<b?1:0>b?-1:b};
|
||||
K.s.gs=function(b,c,d,e){d=d||function(b,c){return b==c};e=e||function(c){return b[c]};for(var f=b.length,g=c.length,h=[],l=0;l<f+1;l++)h[l]=[],h[l][0]=0;for(var m=0;m<g+1;m++)h[0][m]=0;for(l=1;l<=f;l++)for(m=1;m<=g;m++)d(b[l-1],c[m-1])?h[l][m]=h[l-1][m-1]+1:h[l][m]=Math.max(h[l-1][m],h[l][m-1]);var q=[];l=f;for(m=g;0<l&&0<m;)d(b[l-1],c[m-1])?(q.unshift(e(l-1,m-1)),l--,m--):h[l-1][m]>h[l][m-1]?l--:m--;return q};K.s.ge=function(b){return K.j.reduce(arguments,function(b,d){return b+d},0)};
|
||||
K.s.Pi=function(b){return K.s.ge.apply(null,arguments)/arguments.length};K.s.hl=function(b){var c=arguments.length;if(2>c)return 0;var d=K.s.Pi.apply(null,arguments);return K.s.ge.apply(null,K.j.map(arguments,function(b){return Math.pow(b-d,2)}))/(c-1)};K.s.Bt=function(b){return Math.sqrt(K.s.hl.apply(null,arguments))};K.s.Hr=function(b){return isFinite(b)&&0==b%1};K.s.Fr=function(b){return isFinite(b)};K.s.Mr=function(b){return 0==b&&0>1/b};
|
||||
K.s.fs=function(b){if(0<b){var c=Math.round(Math.log(b)*Math.LOG10E);return c-(parseFloat("1e"+c)>b?1:0)}return 0==b?-Infinity:NaN};K.s.Vs=function(b,c){return Math.floor(b+(c||2E-15))};K.s.Us=function(b,c){return Math.ceil(b-(c||2E-15))};K.s.W=function(b,c){this.x=K.R(b)?b:0;this.y=K.R(c)?c:0};K.s.W.prototype.clone=function(){return new K.s.W(this.x,this.y)};K.ea&&(K.s.W.prototype.toString=function(){return"("+this.x+", "+this.y+")"});K.s.W.prototype.Ib=function(b){return b instanceof K.s.W&&K.s.W.Ib(this,b)};K.s.W.Ib=function(b,c){return b==c?!0:b&&c?b.x==c.x&&b.y==c.y:!1};K.s.W.vq=function(b,c){var d=b.x-c.x;b=b.y-c.y;return Math.sqrt(d*d+b*b)};K.s.W.hs=function(b){return Math.sqrt(b.x*b.x+b.y*b.y)};
|
||||
K.s.W.azimuth=function(b){return K.s.angle(0,0,b.x,b.y)};K.s.W.yt=function(b,c){var d=b.x-c.x;b=b.y-c.y;return d*d+b*b};K.s.W.uq=function(b,c){return new K.s.W(b.x-c.x,b.y-c.y)};K.s.W.ge=function(b,c){return new K.s.W(b.x+c.x,b.y+c.y)};I=K.s.W.prototype;I.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};I.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};I.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};
|
||||
I.translate=function(b,c){b instanceof K.s.W?(this.x+=b.x,this.y+=b.y):(this.x+=Number(b),K.Rb(c)&&(this.y+=c));return this};I.scale=function(b,c){c=K.Rb(c)?c:b;this.x*=b;this.y*=c;return this};K.s.nb=function(b,c){this.width=b;this.height=c};K.s.nb.Ib=function(b,c){return b==c?!0:b&&c?b.width==c.width&&b.height==c.height:!1};K.s.nb.prototype.clone=function(){return new K.s.nb(this.width,this.height)};K.ea&&(K.s.nb.prototype.toString=function(){return"("+this.width+" x "+this.height+")"});I=K.s.nb.prototype;I.Li=function(){return this.width*this.height};I.aspectRatio=function(){return this.width/this.height};I.Qb=function(){return!this.Li()};
|
||||
I.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};I.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};I.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};I.scale=function(b,c){c=K.Rb(c)?c:b;this.width*=b;this.height*=c;return this};K.a.Hh=!1;K.a.se=!1;K.a.Qh=K.a.Hh||K.a.se;K.a.td=function(b){return b?new K.a.lb(K.a.Qa(b)):K.a.mj||(K.a.mj=new K.a.lb)};K.a.Dj=function(){return document};K.a.ud=function(b){return K.a.xd(document,b)};K.a.xd=function(b,c){return K.L(c)?b.getElementById(c):c};K.a.Lj=function(b){return K.a.ig(document,b)};K.a.ig=function(b,c){return K.a.xd(b,c)};K.a.Bh=K.a.ud;K.a.getElementsByTagName=function(b,c){return(c||document).getElementsByTagName(String(b))};
|
||||
K.a.yd=function(b,c,d){return K.a.nc(document,b,c,d)};K.a.Gj=function(b,c,d){return K.a.wd(document,b,c,d)};K.a.Rf=function(b,c){var d=c||document;return K.a.cd(d)?d.querySelectorAll("."+b):K.a.nc(document,"*",b,c)};K.a.vd=function(b,c){var d=c||document;return(d.getElementsByClassName?d.getElementsByClassName(b)[0]:K.a.wd(document,"*",b,c))||null};K.a.hg=function(b,c){return K.a.vd(b,c)};K.a.cd=function(b){return!(!b.querySelectorAll||!b.querySelector)};
|
||||
K.a.nc=function(b,c,d,e){b=e||b;c=c&&"*"!=c?String(c).toUpperCase():"";if(K.a.cd(b)&&(c||d))return b.querySelectorAll(c+(d?"."+d:""));if(d&&b.getElementsByClassName){b=b.getElementsByClassName(d);if(c){e={};for(var f=0,g=0,h;h=b[g];g++)c==h.nodeName&&(e[f++]=h);e.length=f;return e}return b}b=b.getElementsByTagName(c||"*");if(d){e={};for(g=f=0;h=b[g];g++)c=h.className,typeof c.split==u&&K.j.contains(c.split(/\s+/),d)&&(e[f++]=h);e.length=f;return e}return b};
|
||||
K.a.wd=function(b,c,d,e){var f=e||b,g=c&&"*"!=c?String(c).toUpperCase():"";return K.a.cd(f)&&(g||d)?f.querySelector(g+(d?"."+d:"")):K.a.nc(b,c,d,e)[0]||null};K.a.Ch=K.a.yd;K.a.Jc=function(b,c){K.object.forEach(c,function(c,e){c&&c.ua&&(c=c.ga());"style"==e?b.style.cssText=c:"class"==e?b.className=c:"for"==e?b.htmlFor=c:K.a.Be.hasOwnProperty(e)?b.setAttribute(K.a.Be[e],c):K.f.startsWith(e,"aria-")||K.f.startsWith(e,"data-")?b.setAttribute(e,c):b[e]=c})};
|
||||
K.a.Be={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};K.a.mg=function(b){return K.a.ng(b||window)};K.a.ng=function(b){b=b.document;b=K.a.Ob(b)?b.documentElement:b.body;return new K.s.nb(b.clientWidth,b.clientHeight)};K.a.Ej=function(){return K.a.rd(window)};K.a.Xq=function(b){return K.a.rd(b)};
|
||||
K.a.rd=function(b){var c=b.document,d=0;if(c){d=c.body;var e=c.documentElement;if(!e||!d)return 0;b=K.a.ng(b).height;if(K.a.Ob(c)&&e.scrollHeight)d=e.scrollHeight!=b?e.scrollHeight:e.offsetHeight;else{c=e.scrollHeight;var f=e.offsetHeight;e.clientHeight!=f&&(c=d.scrollHeight,f=d.offsetHeight);d=c>b?c>f?c:f:c<f?c:f}}return d};K.a.dr=function(b){return K.a.td((b||K.global||window).document).Pf()};K.a.Pf=function(){return K.a.Qf(document)};
|
||||
K.a.Qf=function(b){var c=K.a.sd(b);b=K.a.qc(b);return K.userAgent.Y&&K.userAgent.va("10")&&b.pageYOffset!=c.scrollTop?new K.s.W(c.scrollLeft,c.scrollTop):new K.s.W(b.pageXOffset||c.scrollLeft,b.pageYOffset||c.scrollTop)};K.a.Fj=function(){return K.a.sd(document)};K.a.sd=function(b){return b.scrollingElement?b.scrollingElement:!K.userAgent.Cb&&K.a.Ob(b)?b.documentElement:b.body||b.documentElement};K.a.tb=function(b){return b?K.a.qc(b):window};K.a.qc=function(b){return b.parentWindow||b.defaultView};
|
||||
K.a.fd=function(b,c,d){return K.a.sf(document,arguments)};K.a.sf=function(b,c){var d=String(c[0]),e=c[1];if(!K.a.ib.Lh&&e&&(e.name||e.type)){d=["<",d];e.name&&d.push(' name="',K.f.ta(e.name),'"');if(e.type){d.push(' type="',K.f.ta(e.type),'"');var f={};K.object.extend(f,e);delete f.type;e=f}d.push(">");d=d.join("")}d=b.createElement(d);e&&(K.L(e)?d.className=e:K.isArray(e)?d.className=e.join(" "):K.a.Jc(d,e));2<c.length&&K.a.bf(b,d,c,2);return d};
|
||||
K.a.bf=function(b,c,d,e){function f(d){d&&c.appendChild(K.L(d)?b.createTextNode(d):d)}for(;e<d.length;e++){var g=d[e];K.Nb(g)&&!K.a.Ld(g)?K.j.forEach(K.a.Md(g)?K.j.th(g):g,f):f(g)}};K.a.Dh=K.a.fd;K.a.createElement=function(b){return K.a.Oa(document,b)};K.a.Oa=function(b,c){return b.createElement(String(c))};K.a.createTextNode=function(b){return document.createTextNode(String(b))};K.a.hj=function(b,c,d){return K.a.tf(document,b,c,!!d)};
|
||||
K.a.tf=function(b,c,d,e){for(var f=K.a.Oa(b,"TABLE"),g=f.appendChild(K.a.Oa(b,"TBODY")),h=0;h<c;h++){for(var l=K.a.Oa(b,"TR"),m=0;m<d;m++){var q=K.a.Oa(b,"TD");e&&K.a.ae(q,K.f.Ye.Ke);l.appendChild(q)}g.appendChild(l)}return f};K.a.eq=function(b){var c=K.j.map(arguments,K.f.I.u);c=K.b.hb.fl(K.f.I.from("Constant HTML string, that gets turned into a Node later, so it will be automatically balanced."),c.join(""));return K.a.eh(c)};K.a.eh=function(b){return K.a.fh(document,b)};
|
||||
K.a.fh=function(b,c){var d=K.a.Oa(b,"DIV");K.a.ib.ci?(K.a.S.lh(d,K.b.l.concat(K.b.l.we,c)),d.removeChild(d.firstChild)):K.a.S.lh(d,c);return K.a.$i(b,d)};K.a.$i=function(b,c){if(1==c.childNodes.length)return c.removeChild(c.firstChild);for(b=b.createDocumentFragment();c.firstChild;)b.appendChild(c.firstChild);return b};K.a.dk=function(){return K.a.Ob(document)};K.a.Ob=function(b){return K.a.Qh?K.a.se:"CSS1Compat"==b.compatMode};K.a.canHaveChildren=function(b){if(b.nodeType!=K.a.fa.Ia)return!1;switch(b.tagName){case "APPLET":case "AREA":case "BASE":case "BR":case "COL":case "COMMAND":case "EMBED":case "FRAME":case "HR":case "IMG":case "INPUT":case "IFRAME":case "ISINDEX":case "KEYGEN":case "LINK":case "NOFRAMES":case "NOSCRIPT":case "META":case "OBJECT":case "PARAM":case p:case "SOURCE":case "STYLE":case "TRACK":case "WBR":return!1}return!0};
|
||||
K.a.appendChild=function(b,c){b.appendChild(c)};K.a.append=function(b,c){K.a.bf(K.a.Qa(b),b,arguments,1)};K.a.Zd=function(b){for(var c;c=b.firstChild;)b.removeChild(c)};K.a.vg=function(b,c){c.parentNode&&c.parentNode.insertBefore(b,c)};K.a.ug=function(b,c){c.parentNode&&c.parentNode.insertBefore(b,c.nextSibling)};K.a.tg=function(b,c,d){b.insertBefore(c,b.childNodes[d]||null)};K.a.removeNode=function(b){return b&&b.parentNode?b.parentNode.removeChild(b):null};
|
||||
K.a.dh=function(b,c){var d=c.parentNode;d&&d.replaceChild(b,c)};K.a.Ff=function(b){var c,d=b.parentNode;if(d&&d.nodeType!=K.a.fa.Vh){if(b.removeNode)return b.removeNode(!1);for(;c=b.firstChild;)d.insertBefore(c,b);return K.a.removeNode(b)}};K.a.Nf=function(b){return K.a.ib.Mh&&void 0!=b.children?b.children:K.j.filter(b.childNodes,function(b){return b.nodeType==K.a.fa.Ia})};K.a.Sf=function(b){return K.R(b.firstElementChild)?b.firstElementChild:K.a.oc(b.firstChild,!0)};
|
||||
K.a.Wf=function(b){return K.R(b.lastElementChild)?b.lastElementChild:K.a.oc(b.lastChild,!1)};K.a.Zf=function(b){return K.R(b.nextElementSibling)?b.nextElementSibling:K.a.oc(b.nextSibling,!0)};K.a.fg=function(b){return K.R(b.previousElementSibling)?b.previousElementSibling:K.a.oc(b.previousSibling,!1)};K.a.oc=function(b,c){for(;b&&b.nodeType!=K.a.fa.Ia;)b=c?b.nextSibling:b.previousSibling;return b};
|
||||
K.a.$f=function(b){if(!b)return null;if(b.firstChild)return b.firstChild;for(;b&&!b.nextSibling;)b=b.parentNode;return b?b.nextSibling:null};K.a.gg=function(b){if(!b)return null;if(!b.previousSibling)return b.parentNode;for(b=b.previousSibling;b&&b.lastChild;)b=b.lastChild;return b};K.a.Ld=function(b){return K.ha(b)&&0<b.nodeType};K.a.Hd=function(b){return K.ha(b)&&b.nodeType==K.a.fa.Ia};K.a.Ng=function(b){return K.ha(b)&&b.window==b};
|
||||
K.a.eg=function(b){var c;if(K.a.ib.Nh&&!(K.userAgent.Y&&K.userAgent.va("9")&&!K.userAgent.va("10")&&K.global.SVGElement&&b instanceof K.global.SVGElement)&&(c=b.parentElement))return c;c=b.parentNode;return K.a.Hd(c)?c:null};K.a.contains=function(b,c){if(!b||!c)return!1;if(b.contains&&c.nodeType==K.a.fa.Ia)return b==c||b.contains(c);if("undefined"!=typeof b.compareDocumentPosition)return b==c||!!(b.compareDocumentPosition(c)&16);for(;c&&b!=c;)c=c.parentNode;return c==b};
|
||||
K.a.mf=function(b,c){if(b==c)return 0;if(b.compareDocumentPosition)return b.compareDocumentPosition(c)&2?1:-1;if(K.userAgent.Y&&!K.userAgent.Pb(9)){if(b.nodeType==K.a.fa.Xc)return-1;if(c.nodeType==K.a.fa.Xc)return 1}if("sourceIndex"in b||b.parentNode&&"sourceIndex"in b.parentNode){var d=b.nodeType==K.a.fa.Ia,e=c.nodeType==K.a.fa.Ia;if(d&&e)return b.sourceIndex-c.sourceIndex;var f=b.parentNode,g=c.parentNode;return f==g?K.a.pf(b,c):!d&&K.a.contains(f,c)?-1*K.a.nf(b,c):!e&&K.a.contains(g,b)?K.a.nf(c,
|
||||
b):(d?b.sourceIndex:f.sourceIndex)-(e?c.sourceIndex:g.sourceIndex)}e=K.a.Qa(b);d=e.createRange();d.selectNode(b);d.collapse(!0);b=e.createRange();b.selectNode(c);b.collapse(!0);return d.compareBoundaryPoints(K.global.Range.START_TO_END,b)};K.a.nf=function(b,c){var d=b.parentNode;if(d==c)return-1;for(;c.parentNode!=d;)c=c.parentNode;return K.a.pf(c,b)};K.a.pf=function(b,c){for(;c=c.previousSibling;)if(c==b)return-1;return 1};
|
||||
K.a.Bf=function(b){var c,d=arguments.length;if(!d)return null;if(1==d)return arguments[0];var e=[],f=Infinity;for(c=0;c<d;c++){for(var g=[],h=arguments[c];h;)g.unshift(h),h=h.parentNode;e.push(g);f=Math.min(f,g.length)}g=null;for(c=0;c<f;c++){h=e[0][c];for(var l=1;l<d;l++)if(h!=e[l][c])return g;g=h}return g};K.a.Qa=function(b){return b.nodeType==K.a.fa.Xc?b:b.ownerDocument||b.document};K.a.Tf=function(b){return b.contentDocument||b.contentWindow.document};
|
||||
K.a.Uf=function(b){try{return b.contentWindow||(b.contentDocument?K.a.tb(b.contentDocument):null)}catch(c){}return null};K.a.ae=function(b,c){if("textContent"in b)b.textContent=c;else if(b.nodeType==K.a.fa.cc)b.data=String(c);else if(b.firstChild&&b.firstChild.nodeType==K.a.fa.cc){for(;b.lastChild!=b.firstChild;)b.removeChild(b.lastChild);b.firstChild.data=String(c)}else{K.a.Zd(b);var d=K.a.Qa(b);b.appendChild(d.createTextNode(String(c)))}};
|
||||
K.a.dg=function(b){if("outerHTML"in b)return b.outerHTML;var c=K.a.Qa(b);c=K.a.Oa(c,"DIV");c.appendChild(b.cloneNode(!0));return c.innerHTML};K.a.Cf=function(b,c){var d=[];return K.a.nd(b,c,d,!0)?d[0]:void 0};K.a.Df=function(b,c){var d=[];K.a.nd(b,c,d,!1);return d};K.a.nd=function(b,c,d,e){if(null!=b)for(b=b.firstChild;b;){if(c(b)&&(d.push(b),e)||K.a.nd(b,c,d,e))return!0;b=b.nextSibling}return!1};K.a.Ue={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1};K.a.ac={IMG:" ",BR:"\n"};
|
||||
K.a.Jd=function(b){return K.a.pg(b)&&K.a.Lg(b)};K.a.jh=function(b,c){c?b.tabIndex=0:(b.tabIndex=-1,b.removeAttribute("tabIndex"))};K.a.Cg=function(b){var c;return(c=K.a.Qk(b)?!b.disabled&&(!K.a.pg(b)||K.a.Lg(b)):K.a.Jd(b))&&K.userAgent.Y?K.a.Wj(b):c};K.a.pg=function(b){return K.userAgent.Y&&!K.userAgent.va("9")?(b=b.getAttributeNode("tabindex"),K.cb(b)&&b.specified):b.hasAttribute("tabindex")};K.a.Lg=function(b){b=b.tabIndex;return K.Rb(b)&&0<=b&&32768>b};
|
||||
K.a.Qk=function(b){return"A"==b.tagName||"INPUT"==b.tagName||"TEXTAREA"==b.tagName||"SELECT"==b.tagName||"BUTTON"==b.tagName};K.a.Wj=function(b){b=!K.ya(b.getBoundingClientRect)||K.userAgent.Y&&null==b.parentElement?{height:b.offsetHeight,width:b.offsetWidth}:b.getBoundingClientRect();return K.cb(b)&&0<b.height&&0<b.width};
|
||||
K.a.pc=function(b){if(K.a.ib.xe&&null!==b&&"innerText"in b)b=K.f.Yi(b.innerText);else{var c=[];K.a.Ad(b,c,!0);b=c.join("")}b=b.replace(/ \xAD /g," ").replace(/\xAD/g,"");b=b.replace(/\u200B/g,"");K.a.ib.xe||(b=b.replace(/ +/g," "));" "!=b&&(b=b.replace(/^\s*/,""));return b};K.a.gr=function(b){var c=[];K.a.Ad(b,c,!1);return c.join("")};
|
||||
K.a.Ad=function(b,c,d){if(!(b.nodeName in K.a.Ue))if(b.nodeType==K.a.fa.cc)d?c.push(String(b.nodeValue).replace(/(\r\n|\r|\n)/g,"")):c.push(b.nodeValue);else if(b.nodeName in K.a.ac)c.push(K.a.ac[b.nodeName]);else for(b=b.firstChild;b;)K.a.Ad(b,c,d),b=b.nextSibling};K.a.bg=function(b){return K.a.pc(b).length};K.a.cg=function(b,c){c=c||K.a.Qa(b).body;for(var d=[];b&&b!=c;){for(var e=b;e=e.previousSibling;)d.unshift(K.a.pc(e));b=b.parentNode}return K.f.trimLeft(d.join("")).replace(/ +/g," ").length};
|
||||
K.a.ag=function(b,c,d){b=[b];for(var e=0,f=null;0<b.length&&e<c;)if(f=b.pop(),!(f.nodeName in K.a.Ue))if(f.nodeType==K.a.fa.cc){var g=f.nodeValue.replace(/(\r\n|\r|\n)/g,"").replace(/ +/g," ");e+=g.length}else if(f.nodeName in K.a.ac)e+=K.a.ac[f.nodeName].length;else for(g=f.childNodes.length-1;0<=g;g--)b.push(f.childNodes[g]);K.ha(d)&&(d.Is=f?f.nodeValue.length+c-e-1:0,d.node=f);return f};
|
||||
K.a.Md=function(b){if(b&&typeof b.length==x){if(K.ha(b))return typeof b.item==u||typeof b.item==B;if(K.ya(b))return typeof b.item==u}return!1};K.a.qd=function(b,c,d,e){if(!c&&!d)return null;var f=c?String(c).toUpperCase():null;return K.a.pd(b,function(b){return(!f||b.nodeName==f)&&(!d||K.L(b.className)&&K.j.contains(b.className.split(/\s+/),d))},!0,e)};K.a.Kf=function(b,c,d){return K.a.qd(b,null,c,d)};
|
||||
K.a.pd=function(b,c,d,e){b&&!d&&(b=b.parentNode);for(d=0;b&&(null==e||d<=e);){if(c(b))return b;b=b.parentNode;d++}return null};K.a.Jf=function(b){try{return b&&b.activeElement}catch(c){}return null};K.a.er=function(){var b=K.a.tb();return K.R(b.devicePixelRatio)?b.devicePixelRatio:b.matchMedia?K.a.wc(3)||K.a.wc(2)||K.a.wc(1.5)||K.a.wc(1)||.75:1};
|
||||
K.a.wc=function(b){return K.a.tb().matchMedia("(min-resolution: "+b+"dppx),(min--moz-device-pixel-ratio: "+b+"),(min-resolution: "+96*b+"dpi)").matches?b:0};K.a.Mf=function(b){return b.getContext("2d")};K.a.lb=function(b){this.X=b||K.global.document||document};I=K.a.lb.prototype;I.td=K.a.td;I.Dj=G("X");I.ud=function(b){return K.a.xd(this.X,b)};I.Lj=function(b){return K.a.ig(this.X,b)};I.Bh=K.a.lb.prototype.ud;I.getElementsByTagName=function(b,c){return(c||this.X).getElementsByTagName(String(b))};
|
||||
I.yd=function(b,c,d){return K.a.nc(this.X,b,c,d)};I.Gj=function(b,c,d){return K.a.wd(this.X,b,c,d)};I.Rf=function(b,c){return K.a.Rf(b,c||this.X)};I.vd=function(b,c){return K.a.vd(b,c||this.X)};I.hg=function(b,c){return K.a.hg(b,c||this.X)};I.Ch=K.a.lb.prototype.yd;I.Jc=K.a.Jc;I.mg=function(b){return K.a.mg(b||this.tb())};I.Ej=function(){return K.a.rd(this.tb())};I.fd=function(b,c,d){return K.a.sf(this.X,arguments)};I.Dh=K.a.lb.prototype.fd;I.createElement=function(b){return K.a.Oa(this.X,b)};
|
||||
I.createTextNode=function(b){return this.X.createTextNode(String(b))};I.hj=function(b,c,d){return K.a.tf(this.X,b,c,!!d)};I.eh=function(b){return K.a.fh(this.X,b)};I.dk=function(){return K.a.Ob(this.X)};I.tb=function(){return K.a.qc(this.X)};I.Fj=function(){return K.a.sd(this.X)};I.Pf=function(){return K.a.Qf(this.X)};I.Jf=function(b){return K.a.Jf(b||this.X)};I.appendChild=K.a.appendChild;I.append=K.a.append;I.canHaveChildren=K.a.canHaveChildren;I.Zd=K.a.Zd;I.vg=K.a.vg;I.ug=K.a.ug;I.tg=K.a.tg;
|
||||
I.removeNode=K.a.removeNode;I.dh=K.a.dh;I.Ff=K.a.Ff;I.Nf=K.a.Nf;I.Sf=K.a.Sf;I.Wf=K.a.Wf;I.Zf=K.a.Zf;I.fg=K.a.fg;I.$f=K.a.$f;I.gg=K.a.gg;I.Ld=K.a.Ld;I.Hd=K.a.Hd;I.Ng=K.a.Ng;I.eg=K.a.eg;I.contains=K.a.contains;I.mf=K.a.mf;I.Bf=K.a.Bf;I.Qa=K.a.Qa;I.Tf=K.a.Tf;I.Uf=K.a.Uf;I.ae=K.a.ae;I.dg=K.a.dg;I.Cf=K.a.Cf;I.Df=K.a.Df;I.Jd=K.a.Jd;I.jh=K.a.jh;I.Cg=K.a.Cg;I.pc=K.a.pc;I.bg=K.a.bg;I.cg=K.a.cg;I.ag=K.a.ag;I.Md=K.a.Md;I.qd=K.a.qd;I.Kf=K.a.Kf;I.pd=K.a.pd;I.Mf=K.a.Mf;K.bh={};K.bh.to=F();K.Thenable=F();K.Thenable.prototype.then=F();K.Thenable.He="$goog_Thenable";K.Thenable.af=function(b){b.prototype.then=b.prototype.then;b.prototype[K.Thenable.He]=!0};K.Thenable.Dg=function(b){if(!b)return!1;try{return!!b[K.Thenable.He]}catch(c){return!1}};K.Promise=function(b,c){this.$=K.Promise.P.wa;this.ia=void 0;this.ob=this.Na=this.da=null;this.ld=!1;0<K.Promise.Wa?this.Oc=0:0==K.Promise.Wa&&(this.rc=!1);K.Promise.Aa&&(this.ee=[],N(this,Error("created")),this.vf=0);if(b!=K.eb)try{var d=this;b.call(c,function(b){O(d,K.Promise.P.Ja,b)},function(b){if(K.ea&&!(b instanceof K.Promise.kb))try{if(b instanceof Error)throw b;throw Error("Promise rejected.");}catch(f){}O(d,K.Promise.P.ka,b)})}catch(e){O(this,K.Promise.P.ka,e)}};K.Promise.Aa=!1;
|
||||
K.Promise.Wa=0;K.Promise.P={wa:0,Jh:1,Ja:2,ka:3};K.Promise.ze=function(){this.next=this.context=this.wb=this.Tb=this.Xa=null;this.dc=!1};K.Promise.ze.prototype.reset=function(){this.context=this.wb=this.Tb=this.Xa=null;this.dc=!1};K.Promise.Vc=100;K.Promise.Kb=new K.async.Zb(function(){return new K.Promise.ze},function(b){b.reset()},K.Promise.Vc);K.Promise.Lf=function(b,c,d){var e=K.Promise.Kb.get();e.Tb=b;e.wb=c;e.context=d;return e};K.Promise.Yk=function(b){K.Promise.Kb.put(b)};
|
||||
K.Promise.resolve=function(b){if(b instanceof K.Promise)return b;var c=new K.Promise(K.eb);O(c,K.Promise.P.Ja,b);return c};K.Promise.reject=function(b){return new K.Promise(function(c,d){d(b)})};K.Promise.Ec=function(b,c,d){K.Promise.Ug(b,c,d,null)||K.async.M(K.fb(c,b))};K.Promise.race=function(b){return new K.Promise(function(c,d){b.length||c(void 0);for(var e=0,f;e<b.length;e++)f=b[e],K.Promise.Ec(f,c,d)})};
|
||||
K.Promise.all=function(b){return new K.Promise(function(c,d){var e=b.length,f=[];if(e)for(var g=function(b,d){e--;f[b]=d;0==e&&c(f)},h=function(b){d(b)},l=0,m;l<b.length;l++)m=b[l],K.Promise.Ec(m,K.fb(g,l),h);else c(f)})};K.Promise.jp=function(b){return new K.Promise(function(c){var d=b.length,e=[];if(d)for(var f=function(b,f,g){d--;e[b]=f?{Bj:!0,value:g}:{Bj:!1,reason:g};0==d&&c(e)},g=0,h;g<b.length;g++)h=b[g],K.Promise.Ec(h,K.fb(f,g,!0),K.fb(f,g,!1));else c(e)})};
|
||||
K.Promise.Iq=function(b){return new K.Promise(function(c,d){var e=b.length,f=[];if(e)for(var g=function(b){c(b)},h=function(b,c){e--;f[b]=c;0==e&&d(f)},l=0,m;l<b.length;l++)m=b[l],K.Promise.Ec(m,g,K.fb(h,l));else c(void 0)})};K.Promise.Wt=function(){var b,c,d=new K.Promise(function(d,f){b=d;c=f});return new K.Promise.li(d,b,c)};K.Promise.prototype.then=function(b,c,d){K.Promise.Aa&&N(this,Error("then"));return ba(this,K.ya(b)?b:null,K.ya(c)?c:null,d)};K.Thenable.af(K.Promise);
|
||||
K.Promise.prototype.cancel=function(b){this.$==K.Promise.P.wa&&K.async.M(function(){var c=new K.Promise.kb(b);P(this,c)},this)};function P(b,c){if(b.$==K.Promise.P.wa)if(b.da){var d=b.da;if(d.Na){for(var e=0,f=null,g=null,h=d.Na;h&&(h.dc||(e++,h.Xa==b&&(f=h),!(f&&1<e)));h=h.next)f||(g=h);f&&(d.$==K.Promise.P.wa&&1==e?P(d,c):(g?(e=g,e.next==d.ob&&(d.ob=e),e.next=e.next.next):Q(d),R(d,f,K.Promise.P.ka,c)))}b.da=null}else O(b,K.Promise.P.ka,c)}
|
||||
function S(b,c){b.Na||b.$!=K.Promise.P.Ja&&b.$!=K.Promise.P.ka||T(b);b.ob?b.ob.next=c:b.Na=c;b.ob=c}function ba(b,c,d,e){var f=K.Promise.Lf(null,null,null);f.Xa=new K.Promise(function(b,h){f.Tb=c?function(d){try{var f=c.call(e,d);b(f)}catch(q){h(q)}}:b;f.wb=d?function(c){try{var f=d.call(e,c);!K.R(f)&&c instanceof K.Promise.kb?h(c):b(f)}catch(q){h(q)}}:h});f.Xa.da=b;S(b,f);return f.Xa}K.Promise.prototype.Dl=function(b){this.$=K.Promise.P.wa;O(this,K.Promise.P.Ja,b)};
|
||||
K.Promise.prototype.El=function(b){this.$=K.Promise.P.wa;O(this,K.Promise.P.ka,b)};function O(b,c,d){b.$==K.Promise.P.wa&&(b===d&&(c=K.Promise.P.ka,d=new TypeError("Promise cannot resolve to itself")),b.$=K.Promise.P.Jh,K.Promise.Ug(d,b.Dl,b.El,b)||(b.ia=d,b.$=c,b.da=null,T(b),c!=K.Promise.P.ka||d instanceof K.Promise.kb||K.Promise.Ii(b,d)))}
|
||||
K.Promise.Ug=function(b,c,d,e){if(b instanceof K.Promise)return K.Promise.Aa&&N(b,Error("then")),S(b,K.Promise.Lf(c||K.eb,d||null,e)),!0;if(K.Thenable.Dg(b))return b.then(c,d,e),!0;if(K.ha(b))try{var f=b.then;if(K.ya(f))return K.Promise.Bl(b,f,c,d,e),!0}catch(g){return d.call(e,g),!0}return!1};K.Promise.Bl=function(b,c,d,e,f){function g(b){l||(l=!0,e.call(f,b))}function h(b){l||(l=!0,d.call(f,b))}var l=!1;try{c.call(b,h,g)}catch(m){g(m)}};function T(b){b.ld||(b.ld=!0,K.async.M(b.vj,b))}
|
||||
function Q(b){var c=null;b.Na&&(c=b.Na,b.Na=c.next,c.next=null);b.Na||(b.ob=null);return c}K.Promise.prototype.vj=function(){for(var b;b=Q(this);)K.Promise.Aa&&this.vf++,R(this,b,this.$,this.ia);this.ld=!1};
|
||||
function R(b,c,d,e){if(d==K.Promise.P.ka&&c.wb&&!c.dc)if(0<K.Promise.Wa)for(;b&&b.Oc;b=b.da)K.global.clearTimeout(b.Oc),b.Oc=0;else if(0==K.Promise.Wa)for(;b&&b.rc;b=b.da)b.rc=!1;if(c.Xa)c.Xa.da=null,K.Promise.xg(c,d,e);else try{c.dc?c.Tb.call(c.context):K.Promise.xg(c,d,e)}catch(f){K.Promise.sc.call(null,f)}K.Promise.Yk(c)}K.Promise.xg=function(b,c,d){c==K.Promise.P.Ja?b.Tb.call(b.context,d):b.wb&&b.wb.call(b.context,d)};
|
||||
function N(b,c){if(K.Promise.Aa&&K.L(c.stack)){var d=c.stack.split("\n",4)[3];c=c.message;c+=Array(11-c.length).join(" ");b.ee.push(c+d)}}function U(b,c){if(K.Promise.Aa&&c&&K.L(c.stack)&&b.ee.length){for(var d=["Promise trace:"],e=b;e;e=e.da){for(var f=b.vf;0<=f;f--)d.push(e.ee[f]);d.push("Value: ["+(e.$==K.Promise.P.ka?"REJECTED":"FULFILLED")+"] <"+String(e.ia)+">")}c.stack+="\n\n"+d.join("\n")}}
|
||||
K.Promise.Ii=function(b,c){0<K.Promise.Wa?b.Oc=K.global.setTimeout(function(){U(b,c);K.Promise.sc.call(null,c)},K.Promise.Wa):0==K.Promise.Wa&&(b.rc=!0,K.async.M(function(){b.rc&&(U(b,c),K.Promise.sc.call(null,c))}))};K.Promise.sc=K.async.qh;K.Promise.st=function(b){K.Promise.sc=b};K.Promise.kb=function(b){K.debug.Error.call(this,b)};K.ab(K.Promise.kb,K.debug.Error);K.Promise.kb.prototype.name="cancel";K.Promise.li=function(b,c,d){this.bh=b;this.resolve=c;this.reject=d};/*
|
||||
Portions of this code are from MochiKit, received by
|
||||
The Closure Authors under the MIT license. All other code is Copyright
|
||||
2005-2009 The Closure Authors. All Rights Reserved.
|
||||
*/
|
||||
K.async.w=function(b,c){this.Ic=[];this.ah=b;this.wf=c||null;this.ub=this.qb=!1;this.ia=void 0;this.be=this.Ti=this.bd=!1;this.Nc=0;this.da=null;this.ec=0;K.async.w.Aa&&(this.ed=null,Error.captureStackTrace&&(b={stack:""},Error.captureStackTrace(b,K.async.w),typeof b.stack==B&&(this.ed=b.stack.replace(/^[^\n]*\n/,""))))};K.async.w.vi=!1;K.async.w.Aa=!1;I=K.async.w.prototype;
|
||||
I.cancel=function(b){if(this.qb)this.ia instanceof K.async.w&&this.ia.cancel();else{if(this.da){var c=this.da;delete this.da;b?c.cancel(b):(c.ec--,0>=c.ec&&c.cancel())}this.ah?this.ah.call(this.wf,this):this.be=!0;this.qb||this.Za(new K.async.w.jb(this))}};I.rf=function(b,c){this.bd=!1;V(this,b,c)};function V(b,c,d){b.qb=!0;b.ia=d;b.ub=!c;W(b)}function X(b){if(b.qb){if(!b.be)throw new K.async.w.Wb(b);b.be=!1}}I.Db=function(b){X(this);V(this,!0,b)};I.Za=function(b){X(this);da(this,b);V(this,!1,b)};
|
||||
function da(b,c){K.async.w.Aa&&b.ed&&K.ha(c)&&c.stack&&/^[^\n]+(\n [^\n]+)+/.test(c.stack)&&(c.stack=c.stack+"\nDEFERRED OPERATION:\n"+b.ed)}function Y(b,c,d){return Z(b,c,null,d)}function ea(b,c){Z(b,null,c,void 0)}function Z(b,c,d,e){b.Ic.push([c,d,e]);b.qb&&W(b);return b}I.then=function(b,c,d){var e,f,g=new K.Promise(function(b,c){e=b;f=c});Z(this,e,function(b){b instanceof K.async.w.jb?g.cancel():f(b)});return g.then(b,c,d)};K.Thenable.af(K.async.w);
|
||||
K.async.w.prototype.Vi=function(){var b=new K.async.w;Z(this,b.Db,b.Za,b);b.da=this;this.ec++;return b};function fa(b){return K.j.some(b.Ic,function(b){return K.ya(b[1])})}
|
||||
function W(b){b.Nc&&b.qb&&fa(b)&&(K.async.w.Il(b.Nc),b.Nc=0);b.da&&(b.da.ec--,delete b.da);for(var c=b.ia,d=!1,e=!1;b.Ic.length&&!b.bd;){var f=b.Ic.shift(),g=f[0],h=f[1];f=f[2];if(g=b.ub?h:g)try{var l=g.call(f||b.wf,c);K.R(l)&&(b.ub=b.ub&&(l==c||l instanceof Error),b.ia=c=l);if(K.Thenable.Dg(c)||typeof K.global.Promise===u&&c instanceof K.global.Promise)e=!0,b.bd=!0}catch(m){c=m,b.ub=!0,da(b,c),fa(b)||(d=!0)}}b.ia=c;e?(e=K.bind(b.rf,b,!0),l=K.bind(b.rf,b,!1),c instanceof K.async.w?(Z(c,e,l),c.Ti=
|
||||
!0):c.then(e,l)):K.async.w.vi&&c instanceof Error&&!(c instanceof K.async.w.jb)&&(d=b.ub=!0);d&&(b.Nc=K.async.w.kl(c))}K.async.w.oh=function(b){var c=new K.async.w;c.Db(b);return c};K.async.w.Pq=function(b){var c=new K.async.w;c.Db();Y(c,function(){return b});return c};K.async.w.ma=function(b){var c=new K.async.w;c.Za(b);return c};K.async.w.Qp=function(){var b=new K.async.w;b.cancel();return b};K.async.w.Vt=function(b,c,d){return b instanceof K.async.w?Y(b.Vi(),c,d):Y(K.async.w.oh(b),c,d)};
|
||||
K.async.w.Wb=function(b){K.debug.Error.call(this);this.pb=b};K.ab(K.async.w.Wb,K.debug.Error);K.async.w.Wb.prototype.message="Deferred has already fired";K.async.w.Wb.prototype.name="AlreadyCalledError";K.async.w.jb=function(b){K.debug.Error.call(this);this.pb=b};K.ab(K.async.w.jb,K.debug.Error);K.async.w.jb.prototype.message="Deferred was canceled";K.async.w.jb.prototype.name="CanceledError";K.async.w.Fe=function(b){this.Mb=K.global.setTimeout(K.bind(this.ph,this),0);this.tj=b};
|
||||
K.async.w.Fe.prototype.ph=function(){delete K.async.w.Jb[this.Mb];throw this.tj;};K.async.w.Jb={};K.async.w.kl=function(b){b=new K.async.w.Fe(b);K.async.w.Jb[b.Mb]=b;return b.Mb};K.async.w.Il=function(b){var c=K.async.w.Jb[b];c&&(K.global.clearTimeout(c.Mb),delete K.async.w.Jb[b])};K.async.w.Dp=function(){var b=K.async.w.Jb,c;for(c in b){var d=b[c];K.global.clearTimeout(d.Mb);d.ph()}};K.D={};K.D.F={};K.D.F.Zc="closure_verification";K.D.F.Th=5E3;K.D.F.$d=[];K.D.F.gl=function(b,c){function d(){var e=b.shift();e=K.D.F.Fc(e,c);b.length&&Z(e,d,d,void 0);return e}if(!b.length)return K.async.w.oh(null);var e=K.D.F.$d.length;K.j.extend(K.D.F.$d,b);if(e)return K.D.F.hh;b=K.D.F.$d;K.D.F.hh=d();return K.D.F.hh};
|
||||
K.D.F.Fc=function(b,c){var d=c||{};c=d.document||document;var e=K.b.C.u(b),f=K.a.createElement(p),g={ih:f,sh:void 0},h=new K.async.w(K.D.F.Xi,g),l=null,m=K.cb(d.timeout)?d.timeout:K.D.F.Th;0<m&&(l=window.setTimeout(function(){K.D.F.gc(f,!0);h.Za(new K.D.F.Error(K.D.F.Yb.TIMEOUT,"Timeout reached for loading script "+e))},m),g.sh=l);f.onload=f.onreadystatechange=function(){f.readyState&&"loaded"!=f.readyState&&f.readyState!=t||(K.D.F.gc(f,d.Xp||!1,l),h.Db(null))};f.onerror=function(){K.D.F.gc(f,!0,
|
||||
l);h.Za(new K.D.F.Error(K.D.F.Yb.ei,"Error while loading script "+e))};g=d.attributes||{};K.object.extend(g,{type:C,charset:"UTF-8"});K.a.Jc(f,g);K.a.S.ol(f,b);K.D.F.Mj(c).appendChild(f);return h};
|
||||
K.D.F.Ws=function(b,c,d){K.global[K.D.F.Zc]||(K.global[K.D.F.Zc]={});var e=K.global[K.D.F.Zc],f=K.b.C.u(b);if(K.R(e[c]))return K.async.w.ma(new K.D.F.Error(K.D.F.Yb.Gi,"Verification object "+c+" already defined."));b=K.D.F.Fc(b,d);var g=new K.async.w(K.bind(b.cancel,b));Y(b,function(){var b=e[c];K.R(b)?(g.Db(b),delete e[c]):g.Za(new K.D.F.Error(K.D.F.Yb.Fi,"Script "+f+" loaded, but verification object "+c+" was not defined."))});ea(b,function(b){K.R(e[c])&&delete e[c];g.Za(b)});return g};
|
||||
K.D.F.Mj=function(b){var c=K.a.getElementsByTagName("HEAD",b);return!c||K.j.Qb(c)?b.documentElement:c[0]};K.D.F.Xi=function(){if(this&&this.ih){var b=this.ih;b&&b.tagName==p&&K.D.F.gc(b,!0,this.sh)}};K.D.F.gc=function(b,c,d){K.cb(d)&&K.global.clearTimeout(d);b.onload=K.eb;b.onerror=K.eb;b.onreadystatechange=K.eb;c&&window.setTimeout(function(){K.a.removeNode(b)},0)};K.D.F.Yb={ei:0,TIMEOUT:1,Fi:2,Gi:3};
|
||||
K.D.F.Error=function(b,c){var d="Jsloader error (code #"+b+")";c&&(d+=": "+c);K.debug.Error.call(this,d);this.code=b};K.ab(K.D.F.Error,K.debug.Error);var google={G:{}};google.G.H={};google.G.H.Ba={};google.G.H.Ba.rh=3E4;google.G.H.Ba.js=function(b,c){return{format:b,Mi:c}};google.G.H.Ba.Pj=function(b){return K.b.C.format(b.format,b.Mi)};google.G.H.Ba.load=function(b,c){b=K.b.C.format(b,c);var d=K.D.F.Fc(b,{timeout:google.G.H.Ba.rh,attributes:{async:!1,defer:!1}});return new Promise(function(b){Y(d,b)})};
|
||||
google.G.H.Ba.cs=function(b){b=K.j.map(b,google.G.H.Ba.Pj);if(K.j.Qb(b))return Promise.resolve();var c={timeout:google.G.H.Ba.rh,attributes:{async:!1,defer:!1}},d=[];!K.userAgent.Y||K.userAgent.va(11)?K.j.forEach(b,function(b){d.push(K.D.F.Fc(b,c))}):d.push(K.D.F.gl(b,c));return Promise.all(K.j.map(d,function(b){return new Promise(function(c){return Y(b,c)})}))};google.G.H.T={};if(K.rb(v))throw Error("Google Chart loader.js can only be loaded once.");google.G.H.T.Nl={41:z,42:z,43:z,44:z,1:"1.0","1.0":"current","1.1":"upcoming",current:"45.2",upcoming:"46"};google.G.H.T.Kk=function(b){var c=b,d=b.match(/^testing-/);d&&(c=c.replace(/^testing-/,""));b=c;do{var e=google.G.H.T.Nl[c];e&&(c=e)}while(e);d=(d?"testing-":"")+c;return{version:c==z?b:d,Dk:d}};google.G.H.T.yh=null;
|
||||
google.G.H.T.Bk=function(b){var c=google.G.H.T.Kk(b),d=K.f.I.from("https://www.gstatic.com/charts/%{version}/loader.js");return google.G.H.Ba.load(d,{version:c.Dk}).then(function(){var d=K.rb("google.charts.loader.VersionSpecific.load")||K.rb("google.charts.loader.publicLoad")||K.rb("google.charts.versionSpecific.load");if(!d)throw Error("Bad version: "+b);google.G.H.T.yh=function(b){b=d(c.version,b);if(null==b||null==b.then){var e=K.rb("google.charts.loader.publicSetOnLoadCallback")||K.rb("google.charts.versionSpecific.setOnLoadCallback");
|
||||
b=new Promise(function(b){e(b)});b.then=e}return b}})};google.G.H.T.Pd=null;google.G.H.T.jc=null;google.G.H.T.yk=function(b,c){google.G.H.T.Pd||(google.G.H.T.Pd=google.G.H.T.Bk(b));return google.G.H.T.jc=google.G.H.T.Pd.then(function(){return google.G.H.T.yh(c)})};google.G.H.T.nl=function(b){if(!google.G.H.T.jc)throw Error("Must call google.charts.load before google.charts.setOnLoadCallback");return b?google.G.H.T.jc.then(b):google.G.H.T.jc};
|
||||
google.G.load=function(b){for(var c=[],d=0;d<arguments.length;++d)c[d-0]=arguments[d];d=0;"visualization"===c[d]&&d++;var e="current";K.L(c[d])&&(e=c[d],d++);var f={};K.ha(c[d])&&(f=c[d]);return google.G.H.T.yk(e,f)};K.zf(v,google.G.load);google.G.ml=google.G.H.T.nl;K.zf("google.charts.setOnLoadCallback",google.G.ml);}).call(this);
|
||||
409
public/assets/js/chart/google/google-chart.js
Normal file
409
public/assets/js/chart/google/google-chart.js
Normal file
@@ -0,0 +1,409 @@
|
||||
google.charts.load('current', {packages: ['corechart', 'bar']});
|
||||
google.charts.load('current', {'packages':['line']});
|
||||
google.charts.load('current', {'packages':['corechart']});
|
||||
google.charts.setOnLoadCallback(drawBasic);
|
||||
function drawBasic() {
|
||||
if ($("#column-chart1").length > 0) {
|
||||
var a = google.visualization.arrayToDataTable([
|
||||
["Year", "Sales", "Expenses", "Profit"],
|
||||
["2014", 1e3, 400, 250],
|
||||
["2015", 1170, 460, 300],
|
||||
["2016", 660, 1120, 400],
|
||||
["2017", 1030, 540, 450]
|
||||
]),
|
||||
b = {
|
||||
chart: {
|
||||
title: "Company Performance",
|
||||
subtitle: "Sales, Expenses, and Profit: 2014-2017"
|
||||
},
|
||||
bars: "vertical",
|
||||
vAxis: {
|
||||
format: "decimal"
|
||||
},
|
||||
height: 400,
|
||||
width:'100%',
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.primary, "#e2c636"]
|
||||
|
||||
|
||||
},
|
||||
c = new google.charts.Bar(document.getElementById("column-chart1"));
|
||||
c.draw(a, google.charts.Bar.convertOptions(b))
|
||||
}
|
||||
if ($("#column-chart2").length > 0) {
|
||||
var a = google.visualization.arrayToDataTable([
|
||||
["Year", "Sales", "Expenses", "Profit"],
|
||||
["2014", 1e3, 400, 250],
|
||||
["2015", 1170, 460, 300],
|
||||
["2016", 660, 1120, 400],
|
||||
["2017", 1030, 540, 450]
|
||||
]),
|
||||
b = {
|
||||
chart: {
|
||||
title: "Company Performance",
|
||||
subtitle: "Sales, Expenses, and Profit: 2014-2017"
|
||||
},
|
||||
bars: "horizontal",
|
||||
vAxis: {
|
||||
format: "decimal"
|
||||
},
|
||||
height: 400,
|
||||
width:'100%',
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.primary, "#e2c636"]
|
||||
},
|
||||
c = new google.charts.Bar(document.getElementById("column-chart2"));
|
||||
c.draw(a, google.charts.Bar.convertOptions(b))
|
||||
}
|
||||
if ($("#pie-chart1").length > 0) {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 5],
|
||||
['Eat', 10],
|
||||
['Commute', 15],
|
||||
['Watch TV', 20],
|
||||
['Sleep', 25]
|
||||
]);
|
||||
var options = {
|
||||
title: 'My Daily Activities',
|
||||
width:'100%',
|
||||
height: 300,
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.primary, "#e2c636", "#222222", "#717171"]
|
||||
};
|
||||
var chart = new google.visualization.PieChart(document.getElementById('pie-chart1'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
if ($("#pie-chart2").length > 0) {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 5],
|
||||
['Eat', 10],
|
||||
['Commute', 15],
|
||||
['Watch TV', 20],
|
||||
['Sleep', 25]
|
||||
]);
|
||||
var options = {
|
||||
title: 'My Daily Activities',
|
||||
is3D: true,
|
||||
width:'100%',
|
||||
height: 300,
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary, "#e2c636", "#222222", "#717171"]
|
||||
};
|
||||
var chart = new google.visualization.PieChart(document.getElementById('pie-chart2'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
if ($("#pie-chart3").length > 0) {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 2],
|
||||
['Eat', 2],
|
||||
['Commute', 11],
|
||||
['Watch TV', 2],
|
||||
['Sleep', 7]
|
||||
]);
|
||||
var options = {
|
||||
title: 'My Daily Activities',
|
||||
pieHole: 0.4,
|
||||
width:'100%',
|
||||
height: 300,
|
||||
colors: [vihoAdminConfig.secondary, vihoAdminConfig.primary, "#222222", "#717171", "#e2c636"]
|
||||
};
|
||||
var chart = new google.visualization.PieChart(document.getElementById('pie-chart3'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
if ($("#pie-chart4").length > 0) {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Language', 'Speakers (in millions)'],
|
||||
['Assamese', 13],
|
||||
['Bengali', 83],
|
||||
['Bodo', 1.4],
|
||||
['Dogri', 2.3],
|
||||
['Gujarati', 46],
|
||||
['Hindi', 300],
|
||||
['Kannada', 38],
|
||||
['Kashmiri', 5.5],
|
||||
['Konkani', 5],
|
||||
['Maithili', 20],
|
||||
['Malayalam', 33],
|
||||
['Manipuri', 1.5],
|
||||
['Marathi', 72],
|
||||
['Nepali', 2.9],
|
||||
['Oriya', 33],
|
||||
['Punjabi', 29],
|
||||
['Sanskrit', 0.01],
|
||||
['Santhali', 6.5],
|
||||
['Sindhi', 2.5],
|
||||
['Tamil', 61],
|
||||
['Telugu', 74],
|
||||
['Urdu', 52]
|
||||
]);
|
||||
var options = {
|
||||
title: 'Indian Language Use',
|
||||
legend: 'none',
|
||||
width:'100%',
|
||||
height: 400,
|
||||
pieSliceText: 'label',
|
||||
slices: { 4: {offset: 0.2},
|
||||
12: {offset: 0.3},
|
||||
14: {offset: 0.4},
|
||||
15: {offset: 0.5},
|
||||
},
|
||||
// colors: ["#ab8ce4", "#26c6da"]
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary, "#222222", "#717171", "#e2c636", "#d22d3d","#e6edef", vihoAdminConfig.primary, vihoAdminConfig.secondary, "#222222", "#717171", "#e2c636","#d22d3d", vihoAdminConfig.primary, vihoAdminConfig.secondary, "#222222", "#717171", "#e2c636", "#d22d3d", vihoAdminConfig.primary,vihoAdminConfig.secondary, "#222222"]
|
||||
};
|
||||
var chart = new google.visualization.PieChart(document.getElementById('pie-chart4'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
if ($("#line-chart").length > 0) {
|
||||
var data = new google.visualization.DataTable();
|
||||
data.addColumn('number', 'month');
|
||||
data.addColumn('number', 'Guardians of the Galaxy');
|
||||
data.addColumn('number', 'The Avengers');
|
||||
data.addColumn('number', 'Transformers: Age of Extinction');
|
||||
data.addRows([
|
||||
[1, 37.8, 80.8, 41.8],
|
||||
[2, 30.9, 10.5, 32.4],
|
||||
[3, 40.4, 57, 25.7],
|
||||
[4, 11.7, 18.8, 10.5],
|
||||
[5, 20, 17.6, 10.4],
|
||||
[6, 8.8, 13.6, 7.7],
|
||||
[7, 7.6, 12.3, 9.6],
|
||||
[8, 12.3, 29.2, 10.6],
|
||||
[9, 16.9, 42.9, 14.8],
|
||||
[10, 12.8, 30.9, 11.6],
|
||||
[11, 5.3, 7.9, 4.7],
|
||||
[12, 6.6, 8.4, 5.2],
|
||||
]);
|
||||
var options = {
|
||||
chart: {
|
||||
title: 'Box Office Earnings in First Two Weeks of Opening',
|
||||
subtitle: 'in millions of dollars (USD)'
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary, "#222222"],
|
||||
height: 500,
|
||||
width:'100%',
|
||||
};
|
||||
var chart = new google.charts.Line(document.getElementById('line-chart'));
|
||||
chart.draw(data, google.charts.Line.convertOptions(options));
|
||||
}
|
||||
if ($("#combo-chart").length > 0) {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua', 'Rwanda', 'Average'],
|
||||
['2004/05', 165, 938, 522, 998, 450, 614.6],
|
||||
['2005/06', 135, 1120, 599, 1268, 288, 682],
|
||||
['2006/07', 157, 1167, 587, 807, 397, 623],
|
||||
['2007/08', 139, 1110, 615, 968, 215, 609.4],
|
||||
['2008/09', 136, 691, 629, 1026, 366, 569.6]
|
||||
]);
|
||||
var options = {
|
||||
title : 'Monthly Coffee Production by Country',
|
||||
vAxis: {title: 'Cups'},
|
||||
hAxis: {title: 'Month'},
|
||||
seriesType: 'bars',
|
||||
series: {5: {type: 'line'}},
|
||||
height: 500,
|
||||
width:'100%',
|
||||
colors: [vihoAdminConfig.secondary, vihoAdminConfig.primary, "#222222", "#717171", "#e2c636"]
|
||||
};
|
||||
var chart = new google.visualization.ComboChart(document.getElementById('combo-chart'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
if ($("#area-chart1").length > 0) {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Year', 'Sales', 'Expenses'],
|
||||
['2013', 1000, 400],
|
||||
['2014', 1170, 460],
|
||||
['2015', 660, 1120],
|
||||
['2016', 1030, 540]
|
||||
]);
|
||||
var options = {
|
||||
title: 'Company Performance',
|
||||
hAxis: {title: 'Year', titleTextStyle: {color: '#333'}},
|
||||
vAxis: {minValue: 0},
|
||||
width:'100%',
|
||||
height: 400,
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary]
|
||||
};
|
||||
var chart = new google.visualization.AreaChart(document.getElementById('area-chart1'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
if ($("#area-chart2").length > 0) {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Year', 'Cars', 'Trucks' , 'Drones' , 'Segways'],
|
||||
['2013', 100, 400, 2000, 400],
|
||||
['2014', 500, 700, 530, 800],
|
||||
['2015', 2000, 1000, 620, 120],
|
||||
['2016', 120, 201, 2501, 540]
|
||||
]);
|
||||
var options = {
|
||||
title: 'Company Performance',
|
||||
hAxis: {title: 'Year', titleTextStyle: {color: '#333'}},
|
||||
vAxis: {minValue: 0},
|
||||
width:'100%',
|
||||
height: 400,
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary, "#222222", "#717171"]
|
||||
};
|
||||
var chart = new google.visualization.AreaChart(document.getElementById('area-chart2'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
if ($("#area-chart-dashboard-default").length > 0) {
|
||||
var data = new google.visualization.DataTable();
|
||||
data.addColumn('number', 'Day');
|
||||
data.addColumn('number', 'Guardians of the Galaxy');
|
||||
data.addColumn('number', 'The Avengers');
|
||||
data.addColumn('number', 'Transformers: Extinction');
|
||||
data.addRows([
|
||||
[1, 37.8, 80.8, 41.8],
|
||||
[2, 30.9, 10.5, 32.4],
|
||||
[3, 40.4, 57, 25.7],
|
||||
[4, 11.7, 18.8, 10.5],
|
||||
[5, 20, 17.6, 10.4],
|
||||
[6, 8.8, 13.6, 7.7],
|
||||
[7, 7.6, 12.3, 9.6],
|
||||
[8, 12.3, 29.2, 10.6],
|
||||
[9, 16.9, 42.9, 14.8],
|
||||
[10, 12.8, 30.9, 11.6],
|
||||
[11, 5.3, 7.9, 4.7],
|
||||
[12, 6.6, 8.4, 5.2],
|
||||
[13, 4.8, 6.3, 3.6],
|
||||
[14, 4.2, 6.2, 3.4]
|
||||
]);
|
||||
var options = {
|
||||
chart: {
|
||||
title: 'Box Office Earnings in First Two Weeks of Opening',
|
||||
subtitle: 'in millions of dollars (USD)'
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary , "#222222"],
|
||||
width:'100%',
|
||||
legend: {position: 'top'},
|
||||
};
|
||||
var chart = new google.charts.Line(document.getElementById('area-chart-dashboard-default'));
|
||||
chart.draw(data, google.charts.Line.convertOptions(options));
|
||||
}
|
||||
if ($("#bar-chart2").length > 0) {
|
||||
var a = google.visualization.arrayToDataTable([
|
||||
["Element", "Density", {
|
||||
role: "style"
|
||||
}],
|
||||
["Copper", 10, vihoAdminConfig.primary],
|
||||
["Silver", 12, vihoAdminConfig.secondary],
|
||||
["Gold", 14, "#222222"],
|
||||
["Platinum", 16, "color: #717171"]
|
||||
]),
|
||||
d = new google.visualization.DataView(a);
|
||||
d.setColumns([0, 1, {
|
||||
calc: "stringify",
|
||||
sourceColumn: 1,
|
||||
type: "string",
|
||||
role: "annotation"
|
||||
}, 2]);
|
||||
var b = {
|
||||
title: "Density of Precious Metals, in g/cm^3",
|
||||
width:'100%',
|
||||
height: 400,
|
||||
bar: {
|
||||
groupWidth: "95%"
|
||||
},
|
||||
legend: {
|
||||
position: "none"
|
||||
}
|
||||
},
|
||||
c = new google.visualization.BarChart(document.getElementById("bar-chart2"));
|
||||
c.draw(d, b)
|
||||
}
|
||||
}
|
||||
// Gantt chart
|
||||
google.charts.load('current', {'packages':['gantt']});
|
||||
google.charts.setOnLoadCallback(drawChart);
|
||||
|
||||
function daysToMilliseconds(days) {
|
||||
return days * 24 * 60 * 60 * 1000;
|
||||
}
|
||||
|
||||
function drawChart() {
|
||||
|
||||
var data = new google.visualization.DataTable();
|
||||
data.addColumn('string', 'Task ID');
|
||||
data.addColumn('string', 'Task Name');
|
||||
data.addColumn('string', 'Resource');
|
||||
data.addColumn('date', 'Start Date');
|
||||
data.addColumn('date', 'End Date');
|
||||
data.addColumn('number', 'Duration');
|
||||
data.addColumn('number', 'Percent Complete');
|
||||
data.addColumn('string', 'Dependencies');
|
||||
|
||||
data.addRows([
|
||||
['Research', 'Find sources', null,
|
||||
new Date(2015, 0, 1), new Date(2015, 0, 5), null, 100, null],
|
||||
['Write', 'Write paper', 'write',
|
||||
null, new Date(2015, 0, 9), daysToMilliseconds(3), 25, 'Research,Outline'],
|
||||
['Cite', 'Create bibliography', 'write',
|
||||
null, new Date(2015, 0, 7), daysToMilliseconds(1), 20, 'Research'],
|
||||
['Complete', 'Hand in paper', 'complete',
|
||||
null, new Date(2015, 0, 10), daysToMilliseconds(1), 0, 'Cite,Write'],
|
||||
['Outline', 'Outline paper', 'write',
|
||||
null, new Date(2015, 0, 6), daysToMilliseconds(1), 100, 'Research']
|
||||
]);
|
||||
|
||||
var options = {
|
||||
height: 275,
|
||||
gantt: {
|
||||
criticalPathEnabled: false, // Critical path arrows will be the same as other arrows.
|
||||
arrow: {
|
||||
angle: 100,
|
||||
width: 5,
|
||||
color: vihoAdminConfig.secondary,
|
||||
radius: 0
|
||||
},
|
||||
|
||||
palette: [
|
||||
{
|
||||
"color": vihoAdminConfig.primary,
|
||||
"dark": vihoAdminConfig.primary,
|
||||
"light": "#222222"
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
};
|
||||
var chart = new google.visualization.Gantt(document.getElementById('gantt_chart'));
|
||||
|
||||
chart.draw(data, options);
|
||||
}
|
||||
// word tree
|
||||
google.charts.load('current1', {packages:['wordtree']});
|
||||
google.charts.setOnLoadCallback(drawChart1);
|
||||
|
||||
function drawChart1() {
|
||||
var data = google.visualization.arrayToDataTable(
|
||||
[ ['Phrases'],
|
||||
['cats are better than dogs'],
|
||||
['cats eat kibble'],
|
||||
['cats are better than hamsters'],
|
||||
['cats are awesome'],
|
||||
['cats are people too'],
|
||||
['cats eat mice'],
|
||||
['cats meowing'],
|
||||
['cats in the cradle'],
|
||||
['cats eat mice'],
|
||||
['cats in the cradle lyrics'],
|
||||
['cats eat kibble'],
|
||||
['cats for adoption'],
|
||||
['cats are family'],
|
||||
['cats eat mice'],
|
||||
['cats are better than kittens'],
|
||||
['cats are evil'],
|
||||
['cats are weird'],
|
||||
['cats eat mice']
|
||||
]
|
||||
);
|
||||
|
||||
var options = {
|
||||
wordtree: {
|
||||
format: 'implicit',
|
||||
word: 'cats'
|
||||
}
|
||||
|
||||
};
|
||||
var chart = new google.visualization.WordTree(document.getElementById('wordtree_basic'));
|
||||
chart.draw(data, options);
|
||||
}
|
||||
|
||||
98
public/assets/js/chart/knob/knob-chart.js
Normal file
98
public/assets/js/chart/knob/knob-chart.js
Normal file
@@ -0,0 +1,98 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
$(".knob").knob({
|
||||
change : function (value) {
|
||||
//console.log("change : " + value);
|
||||
},
|
||||
release : function (value) {
|
||||
//console.log(this.$.attr('value'));
|
||||
console.log("release : " + value);
|
||||
},
|
||||
cancel : function () {
|
||||
console.log("cancel : ", this);
|
||||
},
|
||||
/*format : function (value) {
|
||||
return value + '%';
|
||||
},*/
|
||||
draw : function () {
|
||||
|
||||
// "tron" case
|
||||
if(this.$.data('skin') == 'tron') {
|
||||
|
||||
this.cursorExt = 0.3;
|
||||
|
||||
var a = this.arc(this.cv) // Arc
|
||||
, pa // Previous arc
|
||||
, r = 1;
|
||||
|
||||
this.g.lineWidth = this.lineWidth;
|
||||
|
||||
if (this.o.displayPrevious) {
|
||||
pa = this.arc(this.v);
|
||||
this.g.beginPath();
|
||||
this.g.strokeStyle = this.pColor;
|
||||
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, pa.s, pa.e, pa.d);
|
||||
this.g.stroke();
|
||||
}
|
||||
|
||||
this.g.beginPath();
|
||||
this.g.strokeStyle = r ? this.o.fgColor : this.fgColor ;
|
||||
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, a.s, a.e, a.d);
|
||||
this.g.stroke();
|
||||
|
||||
this.g.lineWidth = 2;
|
||||
this.g.beginPath();
|
||||
this.g.strokeStyle = this.o.fgColor;
|
||||
this.g.arc( this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
|
||||
this.g.stroke();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
// Example of infinite knob, iPod click wheel
|
||||
var v, up=0,down=0,i=0
|
||||
,$idir = $("div.idir")
|
||||
,$ival = $("div.ival")
|
||||
,incr = function() { i++; $idir.show().html("+").fadeOut(); $ival.html(i); }
|
||||
,decr = function() { i--; $idir.show().html("-").fadeOut(); $ival.html(i); };
|
||||
$("input.infinite").knob(
|
||||
{
|
||||
min : 0
|
||||
, max : 20
|
||||
, stopper : false
|
||||
, change : function () {
|
||||
if(v > this.cv){
|
||||
if(up){
|
||||
decr();
|
||||
up=0;
|
||||
}else{up=1;down=0;}
|
||||
} else {
|
||||
if(v < this.cv){
|
||||
if(down){
|
||||
incr();
|
||||
down=0;
|
||||
}else{down=1;up=0;}
|
||||
}
|
||||
}
|
||||
v = this.cv;
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
|
||||
function clock() {
|
||||
var $s = $(".second"),
|
||||
$m = $(".minute"),
|
||||
$h = $(".hour");
|
||||
d = new Date(),
|
||||
s = d.getSeconds(),
|
||||
m = d.getMinutes(),
|
||||
h = d.getHours();
|
||||
$s.val(s).trigger("change");
|
||||
$m.val(m).trigger("change");
|
||||
$h.val(h).trigger("change");
|
||||
setTimeout("clock()", 1000);
|
||||
}
|
||||
clock();
|
||||
|
||||
1
public/assets/js/chart/knob/knob.min.js
vendored
Normal file
1
public/assets/js/chart/knob/knob.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
385
public/assets/js/chart/morris-chart/morris-script.js
Normal file
385
public/assets/js/chart/morris-chart/morris-script.js
Normal file
@@ -0,0 +1,385 @@
|
||||
"use strict";
|
||||
var morris_chart = {
|
||||
init: function() {
|
||||
Morris.Area({
|
||||
element: 'graph123',
|
||||
behaveLikeLine: true,
|
||||
data: [{
|
||||
x: '2011 Q1',
|
||||
y: 3,
|
||||
z: 3
|
||||
},
|
||||
{
|
||||
x: '2011 Q2',
|
||||
y: 2,
|
||||
z: 1
|
||||
},
|
||||
{
|
||||
x: '2011 Q3',
|
||||
y: 2,
|
||||
z: 4
|
||||
},
|
||||
{
|
||||
x: '2011 Q4',
|
||||
y: 3,
|
||||
z: 3
|
||||
}
|
||||
],
|
||||
xkey: 'x',
|
||||
ykeys: ['y', 'z'],
|
||||
labels: ['Y', 'Z'],
|
||||
lineColors: [vihoAdminConfig.secondary, vihoAdminConfig.primary],
|
||||
}), Morris.Line({
|
||||
element: "morris-line-chart",
|
||||
data: [{
|
||||
y: "2011",
|
||||
a: 100,
|
||||
b: 90
|
||||
},
|
||||
{
|
||||
y: "2012",
|
||||
a: 75,
|
||||
b: 65
|
||||
},
|
||||
{
|
||||
y: "2013",
|
||||
a: 50,
|
||||
b: 40
|
||||
},
|
||||
{
|
||||
y: "2014",
|
||||
a: 75,
|
||||
b: 65
|
||||
},
|
||||
{
|
||||
y: "2015",
|
||||
a: 50,
|
||||
b: 40
|
||||
},
|
||||
{
|
||||
y: "2016",
|
||||
a: 75,
|
||||
b: 65
|
||||
},
|
||||
{
|
||||
y: "2017",
|
||||
a: 100,
|
||||
b: 90
|
||||
}],
|
||||
xkey: "y",
|
||||
ykeys: ["a", "b"],
|
||||
lineColors: [vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
labels: ["Series A", "Series B"]
|
||||
}), Morris.Bar({
|
||||
element: "morris-simple-bar-chart",
|
||||
data: [{
|
||||
x: "2011 Q1",
|
||||
y: 3,
|
||||
z: 2,
|
||||
a: 3
|
||||
},
|
||||
{
|
||||
x: "2011 Q2",
|
||||
y: 2,
|
||||
z: 3,
|
||||
a: 1
|
||||
},
|
||||
{
|
||||
x: "2011 Q3",
|
||||
y: 5,
|
||||
z: 2,
|
||||
a: 4
|
||||
},
|
||||
{
|
||||
x: "2011 Q4",
|
||||
y: 2,
|
||||
z: 4,
|
||||
a: 3
|
||||
}],
|
||||
xkey: "x",
|
||||
ykeys: ["y", "z", "a"],
|
||||
barColors: [vihoAdminConfig.primary, vihoAdminConfig.secondary ,"#222222"],
|
||||
labels: ["Y", "Z", "A"]
|
||||
}), Morris.Bar({
|
||||
element: "bar-line-chart-morris",
|
||||
data: [{
|
||||
x: "2011 Q1",
|
||||
y: 0
|
||||
},
|
||||
{
|
||||
x: "2011 Q2",
|
||||
y: 1
|
||||
},
|
||||
{
|
||||
x: "2011 Q3",
|
||||
y: 2
|
||||
},
|
||||
{
|
||||
x: "2011 Q4",
|
||||
y: 3
|
||||
},
|
||||
{
|
||||
x: "2012 Q1",
|
||||
y: 4
|
||||
},
|
||||
{
|
||||
x: "2012 Q2",
|
||||
y: 5
|
||||
},
|
||||
{
|
||||
x: "2012 Q3",
|
||||
y: 6
|
||||
},
|
||||
{
|
||||
x: "2012 Q4",
|
||||
y: 7
|
||||
},
|
||||
{
|
||||
x: "2013 Q1",
|
||||
y: 8
|
||||
}],
|
||||
xkey: "x",
|
||||
ykeys: ["y"],
|
||||
labels: ["Y"],
|
||||
barColors: [vihoAdminConfig.primary]
|
||||
}), $(function() {
|
||||
var b = [{
|
||||
period: "2012-10-01",
|
||||
licensed: 5000,
|
||||
sorned: 4750
|
||||
},
|
||||
{
|
||||
period: "2012-09-30",
|
||||
licensed: 4500,
|
||||
sorned: 4250
|
||||
},
|
||||
{
|
||||
period: "2012-09-29",
|
||||
licensed: 4000,
|
||||
sorned: 3750
|
||||
},
|
||||
{
|
||||
period: "2012-09-20",
|
||||
licensed: 3500,
|
||||
sorned: 3250
|
||||
},
|
||||
{
|
||||
period: "2012-09-19",
|
||||
licensed: 3000,
|
||||
sorned: 2750
|
||||
},
|
||||
{
|
||||
period: "2012-09-18",
|
||||
licensed: 2500,
|
||||
sorned: 2250
|
||||
}
|
||||
];
|
||||
Morris.Bar({
|
||||
element: 'x-lable-morris-chart',
|
||||
data: b,
|
||||
barColors: [vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
xkey: "period",
|
||||
ykeys: ["licensed", "sorned"],
|
||||
labels: ["Licensed", "SORN"],
|
||||
xLabelAngle: 60
|
||||
})
|
||||
}), $(function() {
|
||||
for (var c = [], d = 0; d <= 360; d += 10) c.push({
|
||||
x: d,
|
||||
y: 1.5 + 1.5 * Math.sin(Math.PI * d / 180).toFixed(4)
|
||||
});
|
||||
window.m = Morris.Line({
|
||||
element: 'decimal-morris-chart',
|
||||
data: c,
|
||||
xkey: "x",
|
||||
ykeys: ["y"],
|
||||
labels: ["sin(x)"],
|
||||
parseTime: !1,
|
||||
lineColors: [vihoAdminConfig.primary],
|
||||
hoverCallback: function(a, b, c, d) {
|
||||
return c.replace("sin(x)", "1.5 + 1.5 sin(" + d.x + ")")
|
||||
},
|
||||
xLabelMargin: 10,
|
||||
integerYLabels: !0
|
||||
})
|
||||
}), $(function() {
|
||||
var b = [{
|
||||
period: "2012-10-30",
|
||||
licensed: 2000,
|
||||
sorned: 2000
|
||||
},
|
||||
{
|
||||
period: "2012-09-30",
|
||||
licensed: 3000,
|
||||
sorned: 1000
|
||||
},
|
||||
{
|
||||
period: "2012-09-29",
|
||||
licensed: 2000,
|
||||
sorned: 2000
|
||||
},
|
||||
{
|
||||
period: "2012-09-20",
|
||||
licensed: 4000,
|
||||
sorned: 0
|
||||
},
|
||||
{
|
||||
period: "2012-09-19",
|
||||
licensed: 3000,
|
||||
sorned: 1000
|
||||
},
|
||||
{
|
||||
period: "2012-09-18",
|
||||
licensed: 4000,
|
||||
sorned: 0
|
||||
},
|
||||
{
|
||||
period: "2012-09-17",
|
||||
licensed: 3171,
|
||||
sorned: 660
|
||||
},
|
||||
{
|
||||
period: "2012-09-16",
|
||||
licensed: 3171,
|
||||
sorned: 676
|
||||
},
|
||||
{
|
||||
period: "2012-09-15",
|
||||
licensed: 3201,
|
||||
sorned: 656
|
||||
},
|
||||
{
|
||||
period: "2012-09-10",
|
||||
licensed: 3215,
|
||||
sorned: 622
|
||||
}];
|
||||
Morris.Line({
|
||||
element: 'x-Labels-Diagonally-morris-chart',
|
||||
data: b,
|
||||
xkey: "period",
|
||||
lineColors: [vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
ykeys: ["licensed", "sorned"],
|
||||
labels: ["Licensed", "SORN"],
|
||||
xLabelAngle: 60
|
||||
})
|
||||
}), $(function() {
|
||||
Morris.Donut({
|
||||
element: 'donut-color-chart-morris',
|
||||
data: [{
|
||||
value: 70,
|
||||
label: "foo"
|
||||
},
|
||||
{
|
||||
value: 15,
|
||||
label: "bar"
|
||||
},
|
||||
{
|
||||
value: 10,
|
||||
label: "baz"
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: "A really really long label"
|
||||
}],
|
||||
backgroundColor: "rgba(36, 105, 92, 0.5)",
|
||||
labelColor: vihoAdminConfig.primary,
|
||||
colors: ["rgba(36, 105, 92, 1)", "rgba(186, 137, 93, 1)" ,"rgba(9,9, 9, 1)" ,"rgba(113, 113, 113, 1)" ,"rgba(230, 237, 239, 1)", "rgba(210, 45, 61, 1)" ,"rgba(36, 105, 92, 1)"],
|
||||
formatter: function(a) {
|
||||
return a + "%"
|
||||
}
|
||||
});
|
||||
}),
|
||||
$(function() {
|
||||
var e = 0,
|
||||
f = function(a) {
|
||||
for (var b = [], c = 0; c <= 360; c += 10) {
|
||||
var d = (a + c) % 360;
|
||||
b.push({
|
||||
x: c,
|
||||
y: Math.sin(Math.PI * d / 180).toFixed(4),
|
||||
z: Math.cos(Math.PI * d / 180).toFixed(4)
|
||||
})
|
||||
}
|
||||
return b
|
||||
},
|
||||
g = Morris.Line({
|
||||
element:'updating-data-morris-chart',
|
||||
data: f(0),
|
||||
xkey: "x",
|
||||
ykeys: ["y", "z"],
|
||||
labels: ["sin()", "cos()"],
|
||||
parseTime: !1,
|
||||
ymin: -1,
|
||||
ymax: 1,
|
||||
hideHover: !0,
|
||||
lineColors: [vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
}),
|
||||
h = function() {
|
||||
e++, g.setData(f(5 * e)), $(".reloadStatus").text(e + " reloads")
|
||||
};
|
||||
setInterval(h, 100)
|
||||
}), $(function() {
|
||||
Morris.Bar({
|
||||
element: 'stacked-bar-chart',
|
||||
data: [{
|
||||
x: "2011 Q1",
|
||||
a: 3,
|
||||
y: 3,
|
||||
z: 2
|
||||
},
|
||||
{
|
||||
x: "2011 Q2",
|
||||
a: 1,
|
||||
y: 2,
|
||||
z: null
|
||||
},
|
||||
{
|
||||
x: "2011 Q3",
|
||||
a: 4,
|
||||
y: 0,
|
||||
z: 2
|
||||
},
|
||||
{
|
||||
x: "2011 Q4",
|
||||
a: 1,
|
||||
y: 2,
|
||||
z: null
|
||||
},
|
||||
{
|
||||
x: "2011 Q5",
|
||||
a: 4,
|
||||
y: 0,
|
||||
z: 2
|
||||
},
|
||||
{
|
||||
x: "2011 Q6",
|
||||
a: 3,
|
||||
y: 3,
|
||||
z: 2
|
||||
|
||||
},
|
||||
{
|
||||
x: "2011 Q4",
|
||||
a: 4,
|
||||
y: 0,
|
||||
z: 2
|
||||
},
|
||||
{
|
||||
x: "2011 Q7",
|
||||
a: 3,
|
||||
y: 3,
|
||||
z: 2
|
||||
}],
|
||||
xkey: "x",
|
||||
ykeys: ["y", "z", "a"],
|
||||
labels: ["A", "Y", "Z"],
|
||||
barColors: [vihoAdminConfig.primary, vihoAdminConfig.secondary ,"#222222" ,"#717171" ,"#e2c636", "#d22d3d" ,"#e6edef"],
|
||||
stacked: !0
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
(function($) {
|
||||
"use strict";
|
||||
morris_chart.init()
|
||||
})(jQuery);
|
||||
2113
public/assets/js/chart/morris-chart/morris.js
Normal file
2113
public/assets/js/chart/morris-chart/morris.js
Normal file
File diff suppressed because it is too large
Load Diff
1
public/assets/js/chart/morris-chart/morris.min.js
vendored
Normal file
1
public/assets/js/chart/morris-chart/morris.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/assets/js/chart/morris-chart/prettify.min.js
vendored
Normal file
1
public/assets/js/chart/morris-chart/prettify.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8353
public/assets/js/chart/morris-chart/raphael.js
Normal file
8353
public/assets/js/chart/morris-chart/raphael.js
Normal file
File diff suppressed because it is too large
Load Diff
51
public/assets/js/chart/peity-chart/peity-custom.js
Normal file
51
public/assets/js/chart/peity-chart/peity-custom.js
Normal file
@@ -0,0 +1,51 @@
|
||||
var updatingChart = $(".updating-chart").peity("line")
|
||||
|
||||
setInterval(function() {
|
||||
var random = Math.round(Math.random() * 10)
|
||||
var values = updatingChart.text().split(",")
|
||||
values.shift()
|
||||
values.push(random)
|
||||
|
||||
updatingChart
|
||||
.text(values.join(","))
|
||||
.change()
|
||||
}, 1000)
|
||||
|
||||
$(".line").peity("line")
|
||||
|
||||
$(".bar").peity("bar")
|
||||
|
||||
$('.donut').peity('donut')
|
||||
|
||||
$(".data-attributes span").peity("donut")
|
||||
|
||||
$("span.pie").peity("pie")
|
||||
|
||||
$(".bar-colours-1").peity("bar", {
|
||||
fill: [vihoAdminConfig.primary, vihoAdminConfig.secondary, "#222222"],
|
||||
width: '100',
|
||||
height: '82'
|
||||
})
|
||||
|
||||
$(".bar-colours-2").peity("bar", {
|
||||
fill: function(value) {
|
||||
return value > 0 ? vihoAdminConfig.primary : vihoAdminConfig.secondary
|
||||
},
|
||||
width: '100',
|
||||
height: '82'
|
||||
})
|
||||
|
||||
$(".bar-colours-3").peity("bar", {
|
||||
fill: function(_, i, all) {
|
||||
var g = parseInt((i / all.length) * 36)
|
||||
return "rgb(36, " + g + ", 0)"
|
||||
},
|
||||
width: '100',
|
||||
height: '82'
|
||||
})
|
||||
|
||||
$(".pie-colours-1").peity("pie", {
|
||||
fill: [vihoAdminConfig.primary, vihoAdminConfig.secondary, "#222222", "#717171"],
|
||||
width: '100',
|
||||
height: '82'
|
||||
})
|
||||
383
public/assets/js/chart/peity-chart/peity.jquery.js
Normal file
383
public/assets/js/chart/peity-chart/peity.jquery.js
Normal file
@@ -0,0 +1,383 @@
|
||||
// Peity jQuery plugin version 3.2.1
|
||||
// (c) 2016 Ben Pickles
|
||||
//
|
||||
// http://benpickles.github.io/peity
|
||||
//
|
||||
// Released under MIT license.
|
||||
(function($, document, Math, undefined) {
|
||||
var peity = $.fn.peity = function(type, options) {
|
||||
if (svgSupported) {
|
||||
this.each(function() {
|
||||
var $this = $(this)
|
||||
var chart = $this.data('_peity')
|
||||
|
||||
if (chart) {
|
||||
if (type) chart.type = type
|
||||
$.extend(chart.opts, options)
|
||||
} else {
|
||||
chart = new Peity(
|
||||
$this,
|
||||
type,
|
||||
$.extend({},
|
||||
peity.defaults[type],
|
||||
$this.data('peity'),
|
||||
options)
|
||||
)
|
||||
|
||||
$this
|
||||
.change(function() { chart.draw() })
|
||||
.data('_peity', chart)
|
||||
}
|
||||
|
||||
chart.draw()
|
||||
});
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
var Peity = function($el, type, opts) {
|
||||
this.$el = $el
|
||||
this.type = type
|
||||
this.opts = opts
|
||||
}
|
||||
|
||||
var PeityPrototype = Peity.prototype
|
||||
|
||||
var svgElement = PeityPrototype.svgElement = function(tag, attrs) {
|
||||
return $(
|
||||
document.createElementNS('http://www.w3.org/2000/svg', tag)
|
||||
).attr(attrs)
|
||||
}
|
||||
|
||||
// https://gist.github.com/madrobby/3201472
|
||||
var svgSupported = 'createElementNS' in document && svgElement('svg', {})[0].createSVGRect
|
||||
|
||||
PeityPrototype.draw = function() {
|
||||
var opts = this.opts
|
||||
peity.graphers[this.type].call(this, opts)
|
||||
if (opts.after) opts.after.call(this, opts)
|
||||
}
|
||||
|
||||
PeityPrototype.fill = function() {
|
||||
var fill = this.opts.fill
|
||||
|
||||
return $.isFunction(fill)
|
||||
? fill
|
||||
: function(_, i) { return fill[i % fill.length] }
|
||||
}
|
||||
|
||||
PeityPrototype.prepare = function(width, height) {
|
||||
if (!this.$svg) {
|
||||
this.$el.hide().after(
|
||||
this.$svg = svgElement('svg', {
|
||||
"class": "peity"
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
return this.$svg
|
||||
.empty()
|
||||
.data('peity', this)
|
||||
.attr({
|
||||
height: height,
|
||||
width: width
|
||||
})
|
||||
}
|
||||
|
||||
PeityPrototype.values = function() {
|
||||
return $.map(this.$el.text().split(this.opts.delimiter), function(value) {
|
||||
return parseFloat(value)
|
||||
})
|
||||
}
|
||||
|
||||
peity.defaults = {}
|
||||
peity.graphers = {}
|
||||
|
||||
peity.register = function(type, defaults, grapher) {
|
||||
this.defaults[type] = defaults
|
||||
this.graphers[type] = grapher
|
||||
}
|
||||
|
||||
peity.register(
|
||||
'pie',
|
||||
{
|
||||
fill: ['#24695c', '#ba895d', '#222222'],
|
||||
radius: 8
|
||||
},
|
||||
function(opts) {
|
||||
if (!opts.delimiter) {
|
||||
var delimiter = this.$el.text().match(/[^0-9\.]/)
|
||||
opts.delimiter = delimiter ? delimiter[0] : ","
|
||||
}
|
||||
|
||||
var values = $.map(this.values(), function(n) {
|
||||
return n > 0 ? n : 0
|
||||
})
|
||||
|
||||
if (opts.delimiter == "/") {
|
||||
var v1 = values[0]
|
||||
var v2 = values[1]
|
||||
values = [v1, Math.max(0, v2 - v1)]
|
||||
}
|
||||
|
||||
var i = 0
|
||||
var length = values.length
|
||||
var sum = 0
|
||||
|
||||
for (; i < length; i++) {
|
||||
sum += values[i]
|
||||
}
|
||||
|
||||
if (!sum) {
|
||||
length = 2
|
||||
sum = 1
|
||||
values = [0, 1]
|
||||
}
|
||||
|
||||
var diameter = opts.radius * 2
|
||||
|
||||
var $svg = this.prepare(
|
||||
opts.width || diameter,
|
||||
opts.height || diameter
|
||||
)
|
||||
|
||||
var width = $svg.width()
|
||||
, height = $svg.height()
|
||||
, cx = width / 2
|
||||
, cy = height / 2
|
||||
|
||||
var radius = Math.min(cx, cy)
|
||||
, innerRadius = opts.innerRadius
|
||||
|
||||
if (this.type == 'donut' && !innerRadius) {
|
||||
innerRadius = radius * 0.5
|
||||
}
|
||||
|
||||
var pi = Math.PI
|
||||
var fill = this.fill()
|
||||
|
||||
var scale = this.scale = function(value, radius) {
|
||||
var radians = value / sum * pi * 2 - pi / 2
|
||||
|
||||
return [
|
||||
radius * Math.cos(radians) + cx,
|
||||
radius * Math.sin(radians) + cy
|
||||
]
|
||||
}
|
||||
|
||||
var cumulative = 0
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
var value = values[i]
|
||||
, portion = value / sum
|
||||
, $node
|
||||
|
||||
if (portion == 0) continue
|
||||
|
||||
if (portion == 1) {
|
||||
if (innerRadius) {
|
||||
var x2 = cx - 0.01
|
||||
, y1 = cy - radius
|
||||
, y2 = cy - innerRadius
|
||||
|
||||
$node = svgElement('path', {
|
||||
d: [
|
||||
'M', cx, y1,
|
||||
'A', radius, radius, 0, 1, 1, x2, y1,
|
||||
'L', x2, y2,
|
||||
'A', innerRadius, innerRadius, 0, 1, 0, cx, y2
|
||||
].join(' ')
|
||||
})
|
||||
} else {
|
||||
$node = svgElement('circle', {
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
r: radius
|
||||
})
|
||||
}
|
||||
} else {
|
||||
var cumulativePlusValue = cumulative + value
|
||||
|
||||
var d = ['M'].concat(
|
||||
scale(cumulative, radius),
|
||||
'A', radius, radius, 0, portion > 0.5 ? 1 : 0, 1,
|
||||
scale(cumulativePlusValue, radius),
|
||||
'L'
|
||||
)
|
||||
|
||||
if (innerRadius) {
|
||||
d = d.concat(
|
||||
scale(cumulativePlusValue, innerRadius),
|
||||
'A', innerRadius, innerRadius, 0, portion > 0.5 ? 1 : 0, 0,
|
||||
scale(cumulative, innerRadius)
|
||||
)
|
||||
} else {
|
||||
d.push(cx, cy)
|
||||
}
|
||||
|
||||
cumulative += value
|
||||
|
||||
$node = svgElement('path', {
|
||||
d: d.join(" ")
|
||||
})
|
||||
}
|
||||
|
||||
$node.attr('fill', fill.call(this, value, i, values))
|
||||
|
||||
$svg.append($node)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
peity.register(
|
||||
'donut',
|
||||
$.extend(true, {}, peity.defaults.pie),
|
||||
function(opts) {
|
||||
peity.graphers.pie.call(this, opts)
|
||||
}
|
||||
)
|
||||
|
||||
peity.register(
|
||||
"line",
|
||||
{
|
||||
delimiter: ",",
|
||||
fill: "#24695c",
|
||||
height: 16,
|
||||
min: 0,
|
||||
stroke: "#ba895d",
|
||||
strokeWidth: 1,
|
||||
width: 32
|
||||
},
|
||||
function(opts) {
|
||||
var values = this.values()
|
||||
if (values.length == 1) values.push(values[0])
|
||||
var max = Math.max.apply(Math, opts.max == undefined ? values : values.concat(opts.max))
|
||||
, min = Math.min.apply(Math, opts.min == undefined ? values : values.concat(opts.min))
|
||||
|
||||
var $svg = this.prepare(opts.width, opts.height)
|
||||
, strokeWidth = opts.strokeWidth
|
||||
, width = $svg.width()
|
||||
, height = $svg.height() - strokeWidth
|
||||
, diff = max - min
|
||||
|
||||
var xScale = this.x = function(input) {
|
||||
return input * (width / (values.length - 1))
|
||||
}
|
||||
|
||||
var yScale = this.y = function(input) {
|
||||
var y = height
|
||||
|
||||
if (diff) {
|
||||
y -= ((input - min) / diff) * height
|
||||
}
|
||||
|
||||
return y + strokeWidth / 2
|
||||
}
|
||||
|
||||
var zero = yScale(Math.max(min, 0))
|
||||
, coords = [0, zero]
|
||||
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
coords.push(
|
||||
xScale(i),
|
||||
yScale(values[i])
|
||||
)
|
||||
}
|
||||
|
||||
coords.push(width, zero)
|
||||
|
||||
if (opts.fill) {
|
||||
$svg.append(
|
||||
svgElement('polygon', {
|
||||
fill: opts.fill,
|
||||
points: coords.join(' ')
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (strokeWidth) {
|
||||
$svg.append(
|
||||
svgElement('polyline', {
|
||||
fill: 'none',
|
||||
points: coords.slice(2, coords.length - 2).join(' '),
|
||||
stroke: opts.stroke,
|
||||
'stroke-width': strokeWidth,
|
||||
'stroke-linecap': 'square'
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
peity.register(
|
||||
'bar',
|
||||
{
|
||||
delimiter: ",",
|
||||
fill: ["#4D89F9"],
|
||||
height: 16,
|
||||
min: 0,
|
||||
padding: 0.1,
|
||||
width: 32
|
||||
},
|
||||
function(opts) {
|
||||
var values = this.values()
|
||||
, max = Math.max.apply(Math, opts.max == undefined ? values : values.concat(opts.max))
|
||||
, min = Math.min.apply(Math, opts.min == undefined ? values : values.concat(opts.min))
|
||||
|
||||
var $svg = this.prepare(opts.width, opts.height)
|
||||
, width = $svg.width()
|
||||
, height = $svg.height()
|
||||
, diff = max - min
|
||||
, padding = opts.padding
|
||||
, fill = this.fill()
|
||||
|
||||
var xScale = this.x = function(input) {
|
||||
return input * width / values.length
|
||||
}
|
||||
|
||||
var yScale = this.y = function(input) {
|
||||
return height - (
|
||||
diff
|
||||
? ((input - min) / diff) * height
|
||||
: 1
|
||||
)
|
||||
}
|
||||
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
var x = xScale(i + padding)
|
||||
, w = xScale(i + 1 - padding) - x
|
||||
, value = values[i]
|
||||
, valueY = yScale(value)
|
||||
, y1 = valueY
|
||||
, y2 = valueY
|
||||
, h
|
||||
|
||||
if (!diff) {
|
||||
h = 1
|
||||
} else if (value < 0) {
|
||||
y1 = yScale(Math.min(max, 0))
|
||||
} else {
|
||||
y2 = yScale(Math.max(min, 0))
|
||||
}
|
||||
|
||||
h = y2 - y1
|
||||
|
||||
if (h == 0) {
|
||||
h = 1
|
||||
if (max > 0 && diff) y1--
|
||||
}
|
||||
|
||||
$svg.append(
|
||||
svgElement('rect', {
|
||||
fill: fill.call(this, value, i, values),
|
||||
x: x,
|
||||
y: y1,
|
||||
width: w,
|
||||
height: h
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
);
|
||||
})(jQuery, document, Math);
|
||||
145
public/assets/js/chart/sparkline/sparkline-script.js
Normal file
145
public/assets/js/chart/sparkline/sparkline-script.js
Normal file
@@ -0,0 +1,145 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
setTimeout(function(){
|
||||
$("#line-chart-sparkline").sparkline([5, 10, 20, 14, 17, 21, 20, 10, 4, 13,0, 10, 30, 40, 10, 15, 20], {
|
||||
type: 'line',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
tooltipClassname: 'chart-sparkline',
|
||||
lineColor: vihoAdminConfig.primary,
|
||||
fillColor: 'rgba(36, 105, 92, 0.40)',
|
||||
highlightLineColor: vihoAdminConfig.primary,
|
||||
highlightSpotColor: vihoAdminConfig.primary,
|
||||
targetColor: vihoAdminConfig.primary,
|
||||
performanceColor: vihoAdminConfig.primary,
|
||||
boxFillColor: vihoAdminConfig.primary,
|
||||
medianColor: vihoAdminConfig.primary,
|
||||
minSpotColor: vihoAdminConfig.primary
|
||||
});
|
||||
});
|
||||
var mrefreshinterval = 500;
|
||||
var lastmousex = -1;
|
||||
var lastmousey = -1;
|
||||
var lastmousetime;
|
||||
var mousetravel = 0;
|
||||
var mpoints = [];
|
||||
var mpoints_max = 30;
|
||||
$('body').mousemove(function(e) {
|
||||
var mousex = e.pageX;
|
||||
var mousey = e.pageY;
|
||||
if (lastmousex > -1)
|
||||
mousetravel += Math.max(Math.abs(mousex - lastmousex), Math.abs(mousey - lastmousey));
|
||||
lastmousex = mousex;
|
||||
lastmousey = mousey;
|
||||
});
|
||||
var mdraw = function() {
|
||||
var md = new Date();
|
||||
var timenow = md.getTime();
|
||||
if (lastmousetime && lastmousetime != timenow) {
|
||||
var pps = Math.round(mousetravel / (timenow - lastmousetime) * 1000);
|
||||
mpoints.push(pps);
|
||||
if (mpoints.length > mpoints_max)
|
||||
mpoints.splice(0, 1);
|
||||
mousetravel = 0;
|
||||
|
||||
var mouse_wid = $('#mouse-speed-chart-sparkline').parent('.card-block').parent().width();
|
||||
var a = mpoints - mouse_wid;
|
||||
$('#mouse-speed-chart-sparkline').sparkline(mpoints, {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
tooltipClassname: 'chart-sparkline',
|
||||
lineColor: vihoAdminConfig.primary,
|
||||
fillColor: 'rgba(36, 105, 92, 0.40)',
|
||||
highlightLineColor: vihoAdminConfig.primary,
|
||||
highlightSpotColor: vihoAdminConfig.primary,
|
||||
targetColor: vihoAdminConfig.primary,
|
||||
performanceColor: vihoAdminConfig.primary,
|
||||
boxFillColor: vihoAdminConfig.primary,
|
||||
medianColor: vihoAdminConfig.primary,
|
||||
minSpotColor: vihoAdminConfig.primary
|
||||
});
|
||||
}
|
||||
lastmousetime = timenow;
|
||||
mtimer = setTimeout(mdraw, mrefreshinterval);
|
||||
}
|
||||
var mtimer = setTimeout(mdraw, mrefreshinterval);
|
||||
$.sparkline_display_visible();
|
||||
$("#custom-line-chart").sparkline([5, 30, 27, 35, 30, 50, 70], {
|
||||
type: 'line',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
tooltipClassname: 'chart-sparkline',
|
||||
chartRangeMax: '50',
|
||||
lineColor: vihoAdminConfig.primary,
|
||||
fillColor: 'rgba(36, 105, 92, 0.40)',
|
||||
highlightLineColor: 'rgba(101, 90, 243, 0.40)',
|
||||
highlightSpotColor: 'rgba(101, 90, 243, 0.8)'
|
||||
});
|
||||
$("#custom-line-chart").sparkline([0, 5, 10, 7, 25, 20, 30], {
|
||||
type: 'line',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
composite: '!0',
|
||||
tooltipClassname: 'chart-sparkline',
|
||||
chartRangeMax: '40',
|
||||
lineColor: vihoAdminConfig.secondary,
|
||||
fillColor: 'rgba(186, 137, 93, 0.30)',
|
||||
highlightLineColor: 'rgba(186, 137, 93, 0.30)',
|
||||
highlightSpotColor: 'rgba(186, 137, 93, 0.8)'
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
var sparkline_chart = {
|
||||
init: function() {
|
||||
setTimeout(function(){
|
||||
$("#simple-line-chart-sparkline").sparkline([5, 10, 20, 14, 17, 21, 20, 10, 4, 13,0, 10, 30, 40, 10, 15, 20], {
|
||||
type: 'line',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
tooltipClassname: 'chart-sparkline',
|
||||
lineColor: vihoAdminConfig.primary,
|
||||
fillColor: 'transparent',
|
||||
highlightLineColor: vihoAdminConfig.primary,
|
||||
highlightSpotColor: vihoAdminConfig.primary,
|
||||
targetColor: vihoAdminConfig.primary,
|
||||
performanceColor: vihoAdminConfig.primary,
|
||||
boxFillColor: vihoAdminConfig.primary,
|
||||
medianColor: vihoAdminConfig.primary,
|
||||
minSpotColor: vihoAdminConfig.primary
|
||||
});
|
||||
}), $("#bar-chart-sparkline").sparkline([5, 2, 2, 4, 9, 5, 7, 5, 2, 2, 6], {
|
||||
type: 'bar',
|
||||
barWidth: '60',
|
||||
height: '100%',
|
||||
tooltipClassname: 'chart-sparkline',
|
||||
barColor: vihoAdminConfig.primary
|
||||
}), $("#pie-sparkline-chart").sparkline([1.5, 1, 1, 0.5], {
|
||||
type: 'pie',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
sliceColors: ['#717171','#222222',vihoAdminConfig.secondary, vihoAdminConfig.primary],
|
||||
tooltipClassname: 'chart-sparkline'
|
||||
}),$("#linechart-defaultdashboard").sparkline([5, 30, 27, 35, 30, 50, 70], {
|
||||
type: 'line',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
tooltipClassname: 'chart-sparkline',
|
||||
chartRangeMax: '50',
|
||||
lineColor: vihoAdminConfig.secondary,
|
||||
fillColor: 'rgba(186, 137, 93 ,0.50)'
|
||||
}), $("#linechart-defaultdashboard").sparkline([0, 5, 10, 7, 25, 20, 30], {
|
||||
type: 'line',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
composite: '!0',
|
||||
tooltipClassname: 'chart-sparkline',
|
||||
chartRangeMax: '40',
|
||||
lineColor: '#e2c636',
|
||||
fillColor: 'rgba(226, 198, 54, 0.50)'
|
||||
});
|
||||
}
|
||||
};
|
||||
(function($) {
|
||||
"use strict";
|
||||
sparkline_chart.init()
|
||||
})(jQuery);
|
||||
3054
public/assets/js/chart/sparkline/sparkline.js
Normal file
3054
public/assets/js/chart/sparkline/sparkline.js
Normal file
File diff suppressed because it is too large
Load Diff
20
public/assets/js/clipboard/clipboard-script.js
Normal file
20
public/assets/js/clipboard/clipboard-script.js
Normal file
@@ -0,0 +1,20 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
var clipboard = new ClipboardJS('.btn-clipboard');
|
||||
clipboard.on('success', function(e) {
|
||||
alert("copied");
|
||||
e.clearSelection();
|
||||
});
|
||||
clipboard.on('error', function(e) {
|
||||
|
||||
});
|
||||
|
||||
var clipboard = new ClipboardJS('.btn-clipboard-cut');
|
||||
clipboard.on('success', function(e) {
|
||||
alert("cut");
|
||||
e.clearSelection();
|
||||
});
|
||||
clipboard.on('error', function(e) {
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
7
public/assets/js/clipboard/clipboard.min.js
vendored
Normal file
7
public/assets/js/clipboard/clipboard.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9
public/assets/js/comapct-menu.js
Normal file
9
public/assets/js/comapct-menu.js
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
$(window).bind("resize", function () {
|
||||
console.log($(this).width())
|
||||
if ($(this).width() < 1024) {
|
||||
$('.page-body-wrapper').removeClass('sidebar-icon');
|
||||
} else {
|
||||
$('.page-body-wrapper').addClass('sidebar-icon')
|
||||
}
|
||||
}).trigger('resize');
|
||||
34
public/assets/js/config.js
Normal file
34
public/assets/js/config.js
Normal file
@@ -0,0 +1,34 @@
|
||||
var primary = localStorage.getItem("primary") || '#24695c';
|
||||
var secondary = localStorage.getItem("secondary") || '#ba895d';
|
||||
|
||||
window.vihoAdminConfig = {
|
||||
// Theme Primary Color
|
||||
primary: primary,
|
||||
// theme secondary color
|
||||
secondary: secondary,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// defalt layout
|
||||
$("#default-demo").click(function(){
|
||||
localStorage.setItem('page-wrapper', 'page-wrapper compact-wrapper');
|
||||
localStorage.setItem('page-body-wrapper', 'sidebar-icon');
|
||||
});
|
||||
|
||||
|
||||
// compact layout
|
||||
$("#compact-demo").click(function(){
|
||||
localStorage.setItem('page-wrapper', 'page-wrapper compact-wrapper compact-sidebar');
|
||||
localStorage.setItem('page-body-wrapper', 'sidebar-icon');
|
||||
});
|
||||
|
||||
|
||||
|
||||
// modern layout
|
||||
$("#modern-demo").click(function(){
|
||||
localStorage.setItem('page-wrapper', 'page-wrapper compact-wrapper modern-sidebar');
|
||||
localStorage.setItem('page-body-wrapper', 'sidebar-icon');
|
||||
});
|
||||
172
public/assets/js/contacts/custom.js
Normal file
172
public/assets/js/contacts/custom.js
Normal file
@@ -0,0 +1,172 @@
|
||||
function submitContact() {
|
||||
if ($("#bookmark-form").valid()) {
|
||||
var index_var = $('#index_var').val();
|
||||
var firstname = $('#con-name').val();
|
||||
var lastname = $('#con-last').val();
|
||||
var mail = $('#con-mail').val();
|
||||
$('#index_var').val(parseInt(index_var)+5);
|
||||
|
||||
var tablist = ' <a class="contact-tab-'+index_var+' nav-link active" id="v-pills-user-tab" data-bs-toggle="pill" onclick="activeDiv('+index_var+')" href="#v-pills-user" role="tab" aria-controls="v-pills-user" aria-selected="true" data-original-title="" title="">\
|
||||
<div class="media">\
|
||||
<img class="img-50 img-fluid m-r-20 rounded-circle update_img_0" src="../assets/images/user/user.png" alt="" data-original-title="" title="">\
|
||||
<div class="media-body">\
|
||||
<h6>\
|
||||
<span class="first_name_'+index_var+'">'+firstname+'</span>\
|
||||
<span class="last_name_'+index_var+'">'+lastname+'</span></h6>\
|
||||
<p class="email_add_'+index_var+'">'+mail+'</p>\
|
||||
</div>\
|
||||
</div>\
|
||||
</a>';
|
||||
var tabcontent = '<div class="tab-pane contact-tab-'+index_var+' tab-content-child fade show active" id="v-pills-user" role="tabpanel" aria-labelledby="v-pills-user-tab">\
|
||||
<div class="profile-mail">\
|
||||
<div class="media">\
|
||||
<img class="img-100 img-fluid m-r-20 rounded-circle update_img_0" src="../assets/images/user/user.png" alt="" data-original-title="" title="">\
|
||||
<input class="updateimg" type="file" name="img" onchange="readURL(this,0)" data-original-title="" title="">\
|
||||
<div class="media-body mt-0">\
|
||||
<h5>\
|
||||
<span class="first_name_'+index_var+'">'+firstname+'</span>\
|
||||
<span class="last_name_'+index_var+'">'+lastname+'</span></h5>\
|
||||
<p class="email_add_'+index_var+'">'+mail+'</p>\
|
||||
<ul>\
|
||||
<li><a href="javascript:void(0)" onclick="editContact('+index_var+')" data-original-title="" title="">Edit</a></li>\
|
||||
<li><a href="javascript:void(0)" onclick="deleteContact('+index_var+')" data-original-title="" title="">Delete</a></li>\
|
||||
<li><a href="javascript:void(0)" onclick="history('+index_var+')" data-original-title="" title="">History</a></li>\
|
||||
<li><a href="javascript:void(0)" onclick="printContact('+index_var+')" data-bs-toggle="modal" data-bs-target="#printModal" data-original-title="" title="">Print</a></li>\
|
||||
</ul>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="email-general">\
|
||||
<h6>General</h6>\
|
||||
<p>Email Address: <span class="font-primary email_add_'+index_var+'">'+mail+'</span></p>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
$('#v-pills-tab').append(tablist);
|
||||
$('#v-pills-tabContent').append(tabcontent);
|
||||
$('.contacts-tabs .nav-link ').removeClass('active show');
|
||||
$('.contacts-tabs .tab-content .tab-content-child ').removeClass('active show');
|
||||
$( '.contact-tab-'+index_var ).addClass('active show');
|
||||
$('#exampleModal').modal('toggle');
|
||||
$('#bookmark-form').find('input[type="text"]').val('');
|
||||
var notify = $.notify('Contact added successfully.', {
|
||||
type: 'contactadd',
|
||||
allow_dismiss: false,
|
||||
delay: 2000,
|
||||
placement: {
|
||||
from: 'top',
|
||||
align: 'center'
|
||||
},
|
||||
timer: 300
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
(function($) {
|
||||
$(".contact-editform").hide();
|
||||
$(".more-data").hide();
|
||||
})(jQuery);
|
||||
|
||||
// edit contact
|
||||
|
||||
function editContact(index){
|
||||
|
||||
$("#v-pills-tabContent").hide();
|
||||
$(".contact-editform").show();
|
||||
|
||||
var first_name = $(".first_name_"+index).html();
|
||||
var last_name = $(".last_name_"+index).html();
|
||||
var email_add = $(".email_add_"+index).html();
|
||||
$("#first_name").val(first_name);
|
||||
$("#last_name").val(last_name);
|
||||
$("#email_add").val(email_add);
|
||||
}
|
||||
|
||||
// print contact
|
||||
|
||||
function printContact(index){
|
||||
|
||||
var print_name = $(".first_name_"+index).html();
|
||||
var plast_name = $(".last_name_"+index).html();
|
||||
var pemail_add = $(".email_add_"+index).html();
|
||||
var update_img = $(".update_img_"+index).attr("src");
|
||||
$("#printname").html(print_name);
|
||||
$("#printlast").html(plast_name);
|
||||
$("#printmail").html(pemail_add);
|
||||
$("#mailadd").html(pemail_add);
|
||||
$("#updateimg").attr("src",update_img);
|
||||
}
|
||||
|
||||
// delete
|
||||
function deleteContact(index){
|
||||
swal({
|
||||
title: "Are you sure?",
|
||||
text: "This contact will be deleted from your Personal Contacts and from the chat list too.",
|
||||
icon: "warning",
|
||||
buttons: true,
|
||||
dangerMode: true,
|
||||
})
|
||||
.then((willDelete) => {
|
||||
if (willDelete) {
|
||||
$('.contact-tab-'+index).hide();
|
||||
$( '.contact-tab-'+index ).next().addClass('active show');
|
||||
} else {
|
||||
swal("Your contact is safe!");
|
||||
}
|
||||
})
|
||||
// var el = $('contact-tab-'+index);
|
||||
// el.addClass('delete-contact');
|
||||
|
||||
}
|
||||
function activeDiv(index){
|
||||
$('.contacts-tabs .nav-link ').removeClass('active show');
|
||||
$('.contacts-tabs .tab-content .tab-content-child ').removeClass('active show');
|
||||
$( '.contact-tab-'+index ).addClass('active show');
|
||||
}
|
||||
|
||||
// upload images
|
||||
|
||||
function readURL(input,index){
|
||||
// console.log(input.files[0]);
|
||||
var elems = document.getElementsByClassName('update_img_'+index);
|
||||
for(i=0;i<elems.length;i++) {
|
||||
elems[i].src = window.URL.createObjectURL(input.files[0]);
|
||||
}
|
||||
};
|
||||
|
||||
$('.update-contact').on('click', function(e) {
|
||||
$("#v-pills-tabContent").show();
|
||||
$(".contact-editform").hide();
|
||||
});
|
||||
|
||||
$('.edit-information').on('click', function(e) {
|
||||
$(".more-data").show();
|
||||
$(".edit-information").hide();
|
||||
});
|
||||
|
||||
// history
|
||||
|
||||
function history(index) {
|
||||
$("#right-history").toggleClass("show");
|
||||
};
|
||||
|
||||
$(".closehistory").click(function(){
|
||||
$("#right-history").removeClass("show");
|
||||
});
|
||||
|
||||
// print modal
|
||||
|
||||
function printDiv() {
|
||||
|
||||
var divToPrint=document.getElementById('DivIdToPrint');
|
||||
|
||||
var newWin=window.open('','Print-Window');
|
||||
|
||||
newWin.document.open();
|
||||
|
||||
newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
|
||||
|
||||
newWin.document.close();
|
||||
|
||||
setTimeout(function(){newWin.close();},10);
|
||||
|
||||
}
|
||||
17
public/assets/js/countdown.js
Normal file
17
public/assets/js/countdown.js
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
// Countdown js
|
||||
const second = 1000,
|
||||
minute = second * 60,
|
||||
hour = minute * 60,
|
||||
day = hour * 24;
|
||||
|
||||
var countDown = new Date('Dec 30, 2026 00:00:00').getTime(),
|
||||
x = setInterval(function() {
|
||||
|
||||
var now = new Date().getTime(),
|
||||
distance = countDown - now;
|
||||
document.getElementById('days').innerText = Math.floor(distance / (day)),
|
||||
document.getElementById('hours').innerText = Math.floor((distance % (day)) / (hour)),
|
||||
document.getElementById('minutes').innerText = Math.floor((distance % (hour)) / (minute)),
|
||||
document.getElementById('seconds').innerText = Math.floor((distance % (minute)) / second);
|
||||
}, second);
|
||||
7
public/assets/js/counter/counter-custom.js
Normal file
7
public/assets/js/counter/counter-custom.js
Normal file
@@ -0,0 +1,7 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
$('.counter').counterUp({
|
||||
delay: 10,
|
||||
time: 1000
|
||||
});
|
||||
})(jQuery);
|
||||
1
public/assets/js/counter/jquery.counterup.min.js
vendored
Normal file
1
public/assets/js/counter/jquery.counterup.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(t){"use strict";t.fn.counterUp=function(e){var n=t.extend({time:400,delay:10},e);return this.each(function(){var e=t(this),u=n;e.waypoint(function(){var t=[],n=u.time/u.delay,a=e.text(),r=/[0-9]+,[0-9]+/.test(a);a=a.replace(/,/g,"");/^[0-9]+$/.test(a);for(var o=/^[0-9]+\.[0-9]+$/.test(a),c=o?(a.split(".")[1]||[]).length:0,s=n;s>=1;s--){var i=parseInt(a/n*s);if(o&&(i=parseFloat(a/n*s).toFixed(c)),r)for(;/(\d+)(\d{3})/.test(i.toString());)i=i.toString().replace(/(\d+)(\d{3})/,"$1,$2");t.unshift(i)}e.data("counterup-nums",t),e.text("0");e.data("counterup-func",function(){e.data("counterup-nums")&&(e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?setTimeout(e.data("counterup-func"),u.delay):(e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null)))}),setTimeout(e.data("counterup-func"),u.delay)},{offset:"100%",triggerOnce:!0})})}}(jQuery);
|
||||
7
public/assets/js/counter/jquery.waypoints.min.js
vendored
Normal file
7
public/assets/js/counter/jquery.waypoints.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
100
public/assets/js/custom-card/custom-card.js
Normal file
100
public/assets/js/custom-card/custom-card.js
Normal file
@@ -0,0 +1,100 @@
|
||||
var customcard = {
|
||||
init: function() {
|
||||
$(".setting-list .close-card").on('click', function() {
|
||||
var $this = $(this);
|
||||
$this.parents('.card').animate({
|
||||
'opacity': '0',
|
||||
'-webkit-transform': 'scale3d(.3, .3, .3)',
|
||||
'transform': 'scale3d(.3, .3, .3)'
|
||||
});
|
||||
setTimeout(function() {
|
||||
$this.parents('.card').remove();
|
||||
}, 800);
|
||||
}), $(".setting-list .reload-card").on('click', function() {
|
||||
var $this = $(this);
|
||||
$this.parents('.card').addClass("card-load");
|
||||
$this.parents('.card').append('<div class="loader-box card-loader"><div class="loader card-load"><div class="whirly-loader"></div></div></div>');
|
||||
setTimeout(function() {
|
||||
$this.parents('.card').children(".card-loader").remove();
|
||||
$this.parents('.card').removeClass("card-load");
|
||||
}, 3000);
|
||||
}), $(".setting-list .setting-option .icon-settings").on('click', function() {
|
||||
var $this = $(this);
|
||||
if ($this.hasClass('icon-angle-double-right')) {
|
||||
|
||||
$this.parents('.setting-option').animate({
|
||||
'width': '35px',
|
||||
});
|
||||
} else {
|
||||
$this.parents('.setting-option').animate({
|
||||
'width': '230px',
|
||||
});
|
||||
}
|
||||
$(this).toggleClass("icon-angle-double-right").fadeIn('slow');
|
||||
}), $(".setting-list .minimize-card").on('click', function() {
|
||||
var $this = $(this);
|
||||
var port = $($this.parents('.card'));
|
||||
var card = $(port).children('.card-body').slideToggle();
|
||||
$(this).toggleClass("icofont-plus").fadeIn('slow');
|
||||
}), $(".setting-list .full-card").on('click', function() {
|
||||
var $this = $(this);
|
||||
var port = $($this.parents('.card'));
|
||||
port.toggleClass("full-card");
|
||||
$(this).toggleClass("icofont-resize");
|
||||
}), $(".view-html").on('click', function() {
|
||||
var html_source = $(this).parents(".card");
|
||||
var html_chield = html_source.find(".card-body");
|
||||
html_chield.toggleClass("show-source");
|
||||
$(this).toggleClass("fa-eye");
|
||||
}), $(document).ready(function(){
|
||||
var clipboard = new ClipboardJS('.btn-clipboard');
|
||||
clipboard.on('success', function(e) {
|
||||
e.querySelector();
|
||||
e.clearSelection();
|
||||
});
|
||||
clipboard.on('error', function(e) {
|
||||
});
|
||||
});
|
||||
$(".rtl .card-header-left .close-card").on('click', function() {
|
||||
var $this = $(this);
|
||||
$this.parents('.card').animate({
|
||||
'opacity': '0',
|
||||
'-webkit-transform': 'scale3d(.3, .3, .3)',
|
||||
'transform': 'scale3d(.3, .3, .3)'
|
||||
});
|
||||
setTimeout(function() {
|
||||
$this.parents('.card').remove();
|
||||
}, 800);
|
||||
}), $(".rtl .setting-list .setting-option .icon-angle-double-right").on('click', function() {
|
||||
var $this = $(this);
|
||||
if ($this.hasClass('icofont-simple-left')) {
|
||||
$this.parents('.setting-option').animate({
|
||||
'width': '35px',
|
||||
});
|
||||
} else {
|
||||
$this.parents('.setting-option').animate({
|
||||
'width': '230px',
|
||||
});
|
||||
}
|
||||
$(this).toggleClass("icofont-simple-left").fadeIn('slow');
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// $('.setting-list .setting-option .icon-settings').click(function(){
|
||||
// $(this).parents('.setting-option').toggleClass('open-setting')
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
customcard.init()
|
||||
})(jQuery);
|
||||
958
public/assets/js/dashboard/dashboard_2.js
Normal file
958
public/assets/js/dashboard/dashboard_2.js
Normal file
@@ -0,0 +1,958 @@
|
||||
|
||||
// dashbord-2 knob chart
|
||||
|
||||
// right-side-small-chart
|
||||
|
||||
(function($) {
|
||||
"use strict";
|
||||
$(".knob1").knob({
|
||||
|
||||
'width':65,
|
||||
'height':65,
|
||||
'max':100,
|
||||
|
||||
change : function (value) {
|
||||
//console.log("change : " + value);
|
||||
},
|
||||
release : function (value) {
|
||||
//console.log(this.$.attr('value'));
|
||||
console.log("release : " + value);
|
||||
},
|
||||
cancel : function () {
|
||||
console.log("cancel : ", this);
|
||||
},
|
||||
format : function (value) {
|
||||
return value + '%';
|
||||
},
|
||||
draw : function () {
|
||||
|
||||
// "tron" case
|
||||
if(this.$.data('skin') == 'tron') {
|
||||
|
||||
this.cursorExt = 1;
|
||||
|
||||
var a = this.arc(this.cv) // Arc
|
||||
, pa // Previous arc
|
||||
, r = 1;
|
||||
|
||||
this.g.lineWidth = this.lineWidth;
|
||||
|
||||
if (this.o.displayPrevious) {
|
||||
pa = this.arc(this.v);
|
||||
this.g.beginPath();
|
||||
this.g.strokeStyle = this.pColor;
|
||||
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, pa.s, pa.e, pa.d);
|
||||
this.g.stroke();
|
||||
}
|
||||
|
||||
this.g.beginPath();
|
||||
this.g.strokeStyle = r ? this.o.fgColor : this.fgColor ;
|
||||
this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, a.s, a.e, a.d);
|
||||
this.g.stroke();
|
||||
|
||||
this.g.lineWidth = 2;
|
||||
this.g.beginPath();
|
||||
this.g.strokeStyle = this.o.fgColor;
|
||||
this.g.arc( this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
|
||||
this.g.stroke();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
// Example of infinite knob, iPod click wheel
|
||||
var v, up=0,down=0,i=0
|
||||
,$idir = $("div.idir")
|
||||
,$ival = $("div.ival")
|
||||
,incr = function() { i++; $idir.show().html("+").fadeOut(); $ival.html(i); }
|
||||
,decr = function() { i--; $idir.show().html("-").fadeOut(); $ival.html(i); };
|
||||
$("input.infinite").knob(
|
||||
{
|
||||
min : 0
|
||||
, max : 20
|
||||
, stopper : false
|
||||
, change : function () {
|
||||
if(v > this.cv){
|
||||
if(up){
|
||||
decr();
|
||||
up=0;
|
||||
}else{up=1;down=0;}
|
||||
} else {
|
||||
if(v < this.cv){
|
||||
if(down){
|
||||
incr();
|
||||
down=0;
|
||||
}else{down=1;up=0;}
|
||||
}
|
||||
}
|
||||
v = this.cv;
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
|
||||
var options = {
|
||||
series: [{
|
||||
name: 'TEAM A',
|
||||
type: 'area',
|
||||
data: [44, 48, 38, 47]
|
||||
}, {
|
||||
name: 'TEAM B',
|
||||
type: 'line',
|
||||
data: [42, 38, 48, 30]
|
||||
}],
|
||||
chart: {
|
||||
height:470,
|
||||
type: 'line',
|
||||
toolbar: {
|
||||
show:false,
|
||||
},
|
||||
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth',
|
||||
width: [5, 2],
|
||||
dashArray: [0, 8]
|
||||
|
||||
},
|
||||
fill: {
|
||||
type:'solid',
|
||||
opacity: [0.35, 1],
|
||||
},
|
||||
labels: ['2010', '2011','2012','2013'],
|
||||
markers: {
|
||||
size: 5
|
||||
},
|
||||
responsive: [
|
||||
{
|
||||
breakpoint:991,
|
||||
options: {
|
||||
chart: {
|
||||
height:300
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint:1500,
|
||||
options: {
|
||||
chart: {
|
||||
height:325
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yaxis: [
|
||||
{
|
||||
labels: {
|
||||
formatter: function (value) {
|
||||
return value + "k";
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
tooltip: {
|
||||
shared: true,
|
||||
intersect: false,
|
||||
y: {
|
||||
formatter: function (y) {
|
||||
if(typeof y !== "undefined") {
|
||||
return y.toFixed(0) + " points";
|
||||
}
|
||||
return y;
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show:false,
|
||||
},
|
||||
colors:[vihoAdminConfig.primary , vihoAdminConfig.secondary]
|
||||
};
|
||||
var chart = new ApexCharts(document.querySelector("#chart-dash-2-line"), options);
|
||||
chart.render();
|
||||
|
||||
//overview section chart in dashboard-2
|
||||
var options25 = {
|
||||
chart:{
|
||||
type: "line",
|
||||
height: 450,
|
||||
foreColor: "#999",
|
||||
stacked: true,
|
||||
dropShadow: {
|
||||
enabled: true,
|
||||
enabledSeries: [0],
|
||||
top: -2,
|
||||
left: 2,
|
||||
blur: 5,
|
||||
opacity: 0.06
|
||||
},
|
||||
toolbar: {
|
||||
show:false,
|
||||
},
|
||||
},responsive: [
|
||||
{
|
||||
breakpoint:1470,
|
||||
options:{
|
||||
chart:{
|
||||
height:440
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint:1365,
|
||||
options:{
|
||||
chart:{
|
||||
height:300
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint:991,
|
||||
options:{
|
||||
chart:{
|
||||
height:250
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
colors:[vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
stroke:{
|
||||
width:3
|
||||
},
|
||||
dataLabels: {
|
||||
enabled:false
|
||||
},
|
||||
series: [{
|
||||
name: 'Total Views',
|
||||
data: generateDayWiseTimeSeries(0, 18)
|
||||
}, {
|
||||
name: 'Unique Views',
|
||||
data: generateDayWiseTimeSeries(1, 18)
|
||||
}],
|
||||
markers: {
|
||||
size: 5,
|
||||
strokeColor: "#e3e3e3",
|
||||
strokeWidth: 3,
|
||||
strokeOpacity: 1,
|
||||
fillOpacity: 1,
|
||||
hover: {
|
||||
size: 6
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
type: "datetime",
|
||||
axisBorder: {
|
||||
show: false
|
||||
},
|
||||
axisTicks: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
labels: {
|
||||
offsetX: 14,
|
||||
offsetY: -5
|
||||
},
|
||||
tooltip: {
|
||||
enabled: true
|
||||
},
|
||||
labels: {
|
||||
formatter: function (value) {
|
||||
return value + "k";
|
||||
},
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
padding: {
|
||||
left: -5,
|
||||
right: 5
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
x: {
|
||||
format: "dd MMM yyyy"
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
position: 'top',
|
||||
horizontalAlign: 'left',
|
||||
show:false
|
||||
},
|
||||
fill: {
|
||||
type: "solid",
|
||||
fillOpacity: 0.7
|
||||
},
|
||||
};
|
||||
var chart25 = new ApexCharts(document.querySelector("#timeline-chart"),
|
||||
options25
|
||||
);
|
||||
chart25.render();
|
||||
|
||||
function generateDayWiseTimeSeries(s, count) {
|
||||
var values = [[
|
||||
4,3,10,9,29,19,25,9,12,7,19,5,13,9,17,2,7,5
|
||||
], [
|
||||
2,3,8,7,22,16,23,7,11,5,12,5,10,4,15,2,6,2
|
||||
]];
|
||||
var i = 0;
|
||||
var series = [];
|
||||
var x = new Date("11 Nov 2012").getTime();
|
||||
while (i < count) {
|
||||
series.push([x, values[s][i]]);
|
||||
x += 86400000;
|
||||
i++;
|
||||
}
|
||||
return series;
|
||||
}
|
||||
|
||||
|
||||
//Dashboard-2 Third chart for Yearly Growth
|
||||
|
||||
|
||||
//new charts
|
||||
|
||||
|
||||
var options51 = {
|
||||
series: [
|
||||
{
|
||||
name: "Yearly Profit",
|
||||
data: [
|
||||
{
|
||||
x: "2001",
|
||||
y: 5500
|
||||
},
|
||||
{
|
||||
x: "2002",
|
||||
y: 3800
|
||||
},
|
||||
{
|
||||
x: "2003",
|
||||
y: 5500
|
||||
|
||||
},
|
||||
{
|
||||
x: "2004",
|
||||
y: 7700
|
||||
},
|
||||
{
|
||||
x: "2005",
|
||||
y: 1500
|
||||
|
||||
},
|
||||
{
|
||||
x: "2006",
|
||||
y: 1000,
|
||||
fillColor: vihoAdminConfig.primary,
|
||||
},
|
||||
{
|
||||
x: "2007",
|
||||
y: 5000,
|
||||
fillColor: vihoAdminConfig.primary,
|
||||
},
|
||||
{
|
||||
x: "2008",
|
||||
y: 6000,
|
||||
fillColor: vihoAdminConfig.primary,
|
||||
},
|
||||
{
|
||||
x: "2009",
|
||||
y: 7900,
|
||||
fillColor: vihoAdminConfig.primary,
|
||||
},
|
||||
{
|
||||
x: "2010",
|
||||
y: 4700,
|
||||
fillColor: vihoAdminConfig.primary,
|
||||
},
|
||||
{
|
||||
x: "2011",
|
||||
y: 4000,
|
||||
fillColor: vihoAdminConfig.primary,
|
||||
},
|
||||
{
|
||||
x: "2012",
|
||||
y: 5000,
|
||||
fillColor: vihoAdminConfig.primary,
|
||||
},
|
||||
{
|
||||
x: "2013",
|
||||
y: 7500
|
||||
},
|
||||
{
|
||||
x: "2014",
|
||||
y: 3500
|
||||
},
|
||||
{
|
||||
x: "2015",
|
||||
y: 4000
|
||||
},
|
||||
{
|
||||
x: "2016",
|
||||
y: 6500
|
||||
},
|
||||
{
|
||||
x: "2017",
|
||||
y: 4000
|
||||
},
|
||||
{
|
||||
x: "2018",
|
||||
y: 5853
|
||||
},
|
||||
{
|
||||
x: "2019",
|
||||
y: 6553
|
||||
},
|
||||
{
|
||||
x: "2020",
|
||||
y: 5200
|
||||
},
|
||||
{
|
||||
x: "2021",
|
||||
y: 6200
|
||||
},
|
||||
{
|
||||
x: "2022",
|
||||
y: 880,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2023",
|
||||
y: 1200,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2024",
|
||||
y: 8010,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2025",
|
||||
y: 6053,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2026",
|
||||
y: 4000,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2027",
|
||||
y: 1000,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2028",
|
||||
y: 6200
|
||||
},
|
||||
{
|
||||
x: "2029",
|
||||
y: 6200
|
||||
},
|
||||
{
|
||||
x: "2030",
|
||||
y: 7500
|
||||
},
|
||||
{
|
||||
x: "2031",
|
||||
y: 7000
|
||||
},
|
||||
{
|
||||
x: "2032",
|
||||
y: 5000
|
||||
},
|
||||
{
|
||||
x: "2033",
|
||||
y: 6000
|
||||
},
|
||||
{
|
||||
x: "2034",
|
||||
y: 8000
|
||||
},
|
||||
{
|
||||
x: "2035",
|
||||
y: 4000
|
||||
},
|
||||
{
|
||||
x: "2036",
|
||||
y: 4500
|
||||
},
|
||||
{
|
||||
x: "2037",
|
||||
y: 4800
|
||||
},
|
||||
{
|
||||
x: "2038",
|
||||
y: 3000,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2039",
|
||||
y: 4200,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2040",
|
||||
y: 7900,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2041",
|
||||
y: 4000,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2042",
|
||||
y: 5500,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
},
|
||||
{
|
||||
x: "2043",
|
||||
y: 1000
|
||||
},
|
||||
{
|
||||
x: "2044",
|
||||
y: 5500
|
||||
},
|
||||
{
|
||||
x: "2045",
|
||||
y: 7000
|
||||
},
|
||||
{
|
||||
x: "2046",
|
||||
y: 6500
|
||||
},
|
||||
{
|
||||
x: "2047",
|
||||
y: 4000
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
chart: {
|
||||
height: 350,
|
||||
type: "bar",
|
||||
toolbar:{
|
||||
show:false,
|
||||
},
|
||||
},
|
||||
plotOptions:{
|
||||
bar:{
|
||||
horizontal:false,
|
||||
columnWidth:"70%",
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
show: false,
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
fill: {
|
||||
opacity: 1
|
||||
},
|
||||
xaxis: {
|
||||
type: "datetime",
|
||||
axisBorder: {
|
||||
show: false
|
||||
},
|
||||
labels: {
|
||||
show: false,
|
||||
},
|
||||
axisTicks:{
|
||||
show:false,
|
||||
},
|
||||
},
|
||||
yaxis: {
|
||||
labels: {
|
||||
formatter: function (val) {
|
||||
return val / 100 + "K";
|
||||
},
|
||||
}
|
||||
},
|
||||
responsive: [
|
||||
{
|
||||
breakpoint:991,
|
||||
options: {
|
||||
chart: {
|
||||
height:250
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
colors:["#d8e3e5"]
|
||||
};
|
||||
|
||||
var chart51 = new ApexCharts(document.querySelector("#chart-yearly-growth-dash-2"),
|
||||
options51
|
||||
);
|
||||
chart51.render();
|
||||
// column charts in apex charts
|
||||
|
||||
// var options27 = {
|
||||
|
||||
// series: [
|
||||
// {
|
||||
// data: [400, 230, 448, 370, 540, 580, 690, 1100, 1200, 1380,1150,580,330,580,1355,1280,1485,875,356,587,954,325,469,1254,1587,543,370,987,675,345,895,1200,1265,987,1400,852,654,254,155,899,754,254,789,235,456,256,900]
|
||||
// }
|
||||
// ],
|
||||
// chart: {
|
||||
// type: "bar",
|
||||
// height: 350,
|
||||
// toolbar: {
|
||||
// show:false,
|
||||
// },
|
||||
// },
|
||||
// plotOptions: {
|
||||
// bar: {
|
||||
// horizontal: false,
|
||||
// distributed: true,
|
||||
// startingShape: "rounded",
|
||||
// endingShape: "rounded",
|
||||
// colors: {
|
||||
// backgroundBarColors: ["#eee"],
|
||||
// backgroundBarOpacity: 1,
|
||||
// backgroundBarRadius: 9
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// dataLabels: {
|
||||
// enabled: false
|
||||
// },
|
||||
// grid: {
|
||||
// yaxis: {
|
||||
// lines: {
|
||||
// show: false
|
||||
// },
|
||||
|
||||
// }
|
||||
// },
|
||||
// yaxis: {
|
||||
// labels: {
|
||||
// formatter: function (val) {
|
||||
// return val / 100 + "K";
|
||||
// },
|
||||
// }
|
||||
// },
|
||||
// xaxis: {
|
||||
// axisBorder: {
|
||||
// show: false
|
||||
// },
|
||||
// categories: [
|
||||
// "Spain",
|
||||
// "Canada",
|
||||
// "United Kingdom",
|
||||
// "Netherlands",
|
||||
// "Italy",
|
||||
// "France",
|
||||
// "Japan",
|
||||
// "United States",
|
||||
// "China",
|
||||
// "Germany"
|
||||
// ],
|
||||
// labels: {
|
||||
// show: false,
|
||||
// },
|
||||
// axisTicks:{
|
||||
// show:false,
|
||||
// },
|
||||
|
||||
// },
|
||||
// colors: [
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#24695c",
|
||||
// "#24695c",
|
||||
// "#24695c",
|
||||
// "#24695c",
|
||||
// "#24695c",
|
||||
// "#24695c",
|
||||
// "#24695c",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#d8e3e5",
|
||||
// "#ba895d",
|
||||
// "#ba895d",
|
||||
// "#ba895d",
|
||||
// "#ba895d",
|
||||
// "#ba895d",
|
||||
// "#ba895d"
|
||||
// ],
|
||||
|
||||
// legend: {
|
||||
// show: false
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
// var chart27 = new ApexCharts(document.querySelector("#chart-unique-2"),
|
||||
// options27
|
||||
// );
|
||||
// chart27.render();
|
||||
|
||||
//
|
||||
var barOptions = {
|
||||
curvature: 1,
|
||||
|
||||
animationSteps: 15,
|
||||
|
||||
responsive: true,
|
||||
|
||||
scaleShowVerticalLines: false,
|
||||
|
||||
scaleShowHorizontalLines: false,
|
||||
|
||||
scaleShowLabels: false,
|
||||
|
||||
// String - Template string for single tooltips
|
||||
tooltipTemplate: "<%if (label){%><%=label %>: <%}%><%= value + ' %' %>",
|
||||
// String - Template string for multiple tooltips
|
||||
multiTooltipTemplate: "<%= value + ' %' %>",
|
||||
|
||||
// Array - Array of string names to attach tooltip events
|
||||
tooltipEvents: ["mousemove", "touchstart", "touchmove"],
|
||||
|
||||
// String - Tooltip background colour
|
||||
tooltipFillColor: "rgba(0,0,0,0.8)",
|
||||
|
||||
// String - Tooltip label font declaration for the scale label
|
||||
tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
|
||||
|
||||
// Number - Tooltip label font size in pixels
|
||||
tooltipFontSize: 14,
|
||||
|
||||
// String - Tooltip font weight style
|
||||
tooltipFontStyle: "normal",
|
||||
|
||||
// String - Tooltip label font colour
|
||||
tooltipFontColor: "#fff",
|
||||
|
||||
// String - Tooltip title font declaration for the scale label
|
||||
tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
|
||||
|
||||
// Number - Tooltip title font size in pixels
|
||||
tooltipTitleFontSize: 14,
|
||||
|
||||
// String - Tooltip title font weight style
|
||||
tooltipTitleFontStyle: "bold",
|
||||
|
||||
// String - Tooltip title font colour
|
||||
tooltipTitleFontColor: "#fff",
|
||||
|
||||
// Number - pixel width of padding around tooltip text
|
||||
tooltipYPadding: 6,
|
||||
|
||||
// Number - pixel width of padding around tooltip text
|
||||
tooltipXPadding: 6,
|
||||
|
||||
// Number - Size of the caret on the tooltip
|
||||
tooltipCaretSize: 8,
|
||||
|
||||
// Number - Pixel radius of the tooltip border
|
||||
tooltipCornerRadius: 6,
|
||||
|
||||
// Number - Pixel offset from point x to tooltip edge
|
||||
tooltipXOffset: 10,
|
||||
|
||||
barShowLabels: false,
|
||||
|
||||
// Function - Will fire on animation progression.
|
||||
onAnimationProgress: function(){},
|
||||
|
||||
// Function - Will fire on animation completion.
|
||||
onAnimationComplete: function(){}
|
||||
};
|
||||
|
||||
Chart.types.Bar.extend({
|
||||
name: "BarAlt",
|
||||
initialize: function (data) {
|
||||
Chart.types.Bar.prototype.initialize.apply(this, arguments);
|
||||
|
||||
if (this.options.curvature !== undefined && this.options.curvature <= 1) {
|
||||
var rectangleDraw = this.datasets[0].bars[0].draw;
|
||||
var self = this;
|
||||
var radius = this.datasets[0].bars[0].width * this.options.curvature * 0.2;
|
||||
|
||||
// override the rectangle draw with ours
|
||||
this.datasets.forEach(function (dataset) {
|
||||
dataset.bars.forEach(function (bar) {
|
||||
bar.draw = function () {
|
||||
// draw the original bar a little down (so that our curve brings it to its original position)
|
||||
var y = bar.y;
|
||||
// the min is required so animation does not start from below the axes
|
||||
bar.y = Math.min(bar.y + radius, self.scale.endPoint - 1);
|
||||
// adjust the bar radius depending on how much of a curve we can draw
|
||||
var barRadius = (bar.y - y);
|
||||
rectangleDraw.apply(bar, arguments);
|
||||
|
||||
// draw a rounded rectangle on top
|
||||
Chart.helpers.drawRoundedRectangle(self.chart.ctx, bar.x - bar.width / 2, bar.y - barRadius + 1, bar.width, bar.height, barRadius);
|
||||
ctx.fill();
|
||||
|
||||
// restore the y value
|
||||
bar.y = y;
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var barData = {
|
||||
labels : ["3rd Mar","3rd Apr","3r May","3rd Jun","3rd Jul","3rd Aug","3rd Sep","3rd Nov","3rd dec", "3rd Mar","3rd Apr","3r May","3rd Jun","3rd Jul","3rd Aug","3rd Sep","3rd Nov","3rd dec", "3rd Mar","3rd Apr","3r May","3rd Jun","3rd Jul","3rd Aug","3rd Sep","3rd Nov","3rd dec", "3rd Mar","3rd Apr","3r May","3rd Jun","3rd Jul","3rd Aug","3rd Sep","3rd Nov","3rd dec", "3rd Mar","3rd Apr","3r May","3rd Jun","3rd Jul","3rd Aug","3rd Sep","3rd Nov","3rd dec"],
|
||||
datasets: [{
|
||||
label: "Third dataset",
|
||||
fillColor: "#1faf4b",
|
||||
strokeColor: "#1faf4b",
|
||||
data: [400, 230, 448, 370, 540, 580, 690, 1100, 1200, 1380,1150,580,330,580,1355,1280,1485,875,356,587,954,325,469,1254,1587,543,370,987,675,345,895,1200,1265,987,1400,852,654,254,155,899,754,254,789,235,456,256,900]
|
||||
}],
|
||||
};
|
||||
|
||||
// var ctx = document.getElementById("myChart").getContext("2d");
|
||||
// var myLine = new Chart(ctx).BarAlt(barData, barOptions);
|
||||
|
||||
// document.getElementById("addData").onclick = function addData() {
|
||||
// // Update one of the points in the second dataset
|
||||
// myLine.addData([Math.random() * 100]);
|
||||
|
||||
// Chart.types.Bar.extend({
|
||||
// name: "BarAlt",
|
||||
// initialize: function (data) {
|
||||
// Chart.types.Bar.prototype.initialize.apply(this, arguments);
|
||||
|
||||
|
||||
// var rectangleDraw = this.datasets[0].bars[0].draw;
|
||||
// var self = this;
|
||||
// var radius = this.datasets[0].bars[0].width * this.options.curvature * 0.2;
|
||||
|
||||
// // override the rectangle draw with ours
|
||||
// this.datasets.forEach(function (dataset) {
|
||||
// dataset.bars.forEach(function (bar) {
|
||||
// bar.draw = function () {
|
||||
// // draw the original bar a little down (so that our curve brings it to its original position)
|
||||
// var y = bar.y;
|
||||
// // the min is required so animation does not start from below the axes
|
||||
// bar.y = Math.min(bar.y + radius, self.scale.endPoint - 1);
|
||||
// // adjust the bar radius depending on how much of a curve we can draw
|
||||
// var barRadius = (bar.y - y);
|
||||
// rectangleDraw.apply(bar, arguments);
|
||||
|
||||
// // draw a rounded rectangle on top
|
||||
// Chart.helpers.drawRoundedRectangle(self.chart.ctx, bar.x - bar.width / 2, bar.y - barRadius + 1, bar.width, bar.height, barRadius);
|
||||
// ctx.fill();
|
||||
|
||||
// // restore the y value
|
||||
// bar.y = y;
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
// });
|
||||
|
||||
// // Remove the first point so we dont just add values forever
|
||||
// myLine.removeData();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
var options3 = {
|
||||
series: [{
|
||||
name: 'Inflation',
|
||||
data: [2.3, 5.1, 3.0, 9.1, 2.0, 4.6, 2.2, 9.3, 5.4, 4.8, 3.5, 5.2,2.3, 5.1, 3.0, 9.1, 2.0, 4.6, 2.2, 9.3, 5.4, 4.8, 3.5, 5.2]
|
||||
// data: [4.3, 5.1, 3.0, 8.1, 3.0, 5.6, 3.2]
|
||||
}],
|
||||
chart: {
|
||||
height:90,
|
||||
type: 'bar',
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
dataLabels: {
|
||||
position: 'top', // top, center, bottom
|
||||
},
|
||||
|
||||
columnWidth: '20%',
|
||||
startingShape: 'rounded',
|
||||
endingShape: 'rounded',
|
||||
colors: {
|
||||
backgroundBarColors: ["#d8e3e5"],
|
||||
backgroundBarOpacity: 1,
|
||||
backgroundBarRadius: 9
|
||||
},
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false,
|
||||
formatter: function (val) {
|
||||
return val + "%";
|
||||
},
|
||||
offsetY: -10,
|
||||
style: {
|
||||
fontSize: '12px',
|
||||
colors: ["#912efc"]
|
||||
}
|
||||
},
|
||||
|
||||
xaxis: {
|
||||
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
||||
position: 'bottom',
|
||||
|
||||
axisBorder: {
|
||||
show: false
|
||||
},
|
||||
axisTicks: {
|
||||
show: false
|
||||
},
|
||||
crosshairs: {
|
||||
fill: {
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
colorFrom: vihoAdminConfig.primary,
|
||||
colorTo: '#c481ec',
|
||||
stops: [0, 100],
|
||||
opacityFrom: 0.4,
|
||||
opacityTo: 0.5,
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
enabled: true,
|
||||
},
|
||||
labels:{
|
||||
show:false
|
||||
}
|
||||
|
||||
},
|
||||
yaxis: {
|
||||
axisBorder: {
|
||||
show: false
|
||||
},
|
||||
axisTicks: {
|
||||
show: false,
|
||||
},
|
||||
labels: {
|
||||
show: false,
|
||||
formatter: function (val) {
|
||||
return val + "%";
|
||||
}
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.secondary],
|
||||
|
||||
};
|
||||
var chart3 = new ApexCharts(document.querySelector("#column-chart"),
|
||||
options3
|
||||
);
|
||||
|
||||
chart3.render();
|
||||
384
public/assets/js/dashboard/dashboard_3.js
Normal file
384
public/assets/js/dashboard/dashboard_3.js
Normal file
@@ -0,0 +1,384 @@
|
||||
// history
|
||||
var lineArea1 = new Chartist.Line('.history', {
|
||||
labels: ['1', '2', '3', '4', '5'],
|
||||
series: [{
|
||||
name: 'highest',
|
||||
data: [3.8, 4, 2.8, 4, 3.2, 5]
|
||||
}, {
|
||||
name: 'lowest',
|
||||
data: [3.8, 4.5, 3.5, 5, 4.6, 7]
|
||||
}]
|
||||
}, {
|
||||
plugins: [
|
||||
Chartist.plugins.tooltip({
|
||||
appendToBody: false,
|
||||
className: "ct-tooltip"
|
||||
})
|
||||
],
|
||||
fullWidth: true,
|
||||
chartPadding: {
|
||||
right: 0,
|
||||
left: -17,
|
||||
bottom: 0
|
||||
},
|
||||
axisY: {
|
||||
low: 0,
|
||||
},
|
||||
axisX: {
|
||||
showLabel: false,
|
||||
offset: 0
|
||||
},
|
||||
series: {
|
||||
'highest': {
|
||||
lineSmooth: Chartist.Interpolation.simple({
|
||||
divisor: 2
|
||||
}),
|
||||
showPoint: false
|
||||
},
|
||||
'lowest': {
|
||||
lineSmooth: Chartist.Interpolation.cardinal({
|
||||
divisor: 2
|
||||
}),
|
||||
showArea: true
|
||||
},
|
||||
}
|
||||
}).on("draw", function(e) {
|
||||
if ("point" === e.type) {
|
||||
var t = new Chartist.Svg("circle", {
|
||||
cx: e.x,
|
||||
cy: e.y,
|
||||
"ct:value": e.y,
|
||||
r: 5,
|
||||
class: 5 === e.value.y ? "ct-point circle-point" : "ct-point circle-trans"
|
||||
});
|
||||
e.element.replace(t)
|
||||
}
|
||||
});
|
||||
|
||||
lineArea1.on('created', function (data) {
|
||||
var defs = data.svg.elem('defs');
|
||||
|
||||
defs.elem('linearGradient', {
|
||||
id: 'gradient',
|
||||
x1: 1,
|
||||
y1: 1,
|
||||
x2: 1,
|
||||
y2: 0
|
||||
}).elem('stop', {
|
||||
offset: 0,
|
||||
'stop-color': '#ffffff'
|
||||
}).parent().elem('stop', {
|
||||
offset: 1,
|
||||
'stop-color': '#f73164'
|
||||
});
|
||||
});
|
||||
|
||||
// project status
|
||||
var options = {
|
||||
chart: {
|
||||
height: 320,
|
||||
type: 'radialBar',
|
||||
},
|
||||
plotOptions: {
|
||||
radialBar: {
|
||||
dataLabels: {
|
||||
name: {
|
||||
fontSize: '20px',
|
||||
},
|
||||
value: {
|
||||
fontSize: '16px',
|
||||
},
|
||||
total: {
|
||||
show: true,
|
||||
label: 'Total',
|
||||
formatter: function (w) {
|
||||
return 249
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [45, 70, 60],
|
||||
labels: ['Running', 'Complete', 'Pending'],
|
||||
colors:['#f73164', '#51bb25', '#fdd92a']
|
||||
|
||||
|
||||
}
|
||||
|
||||
var chart = new ApexCharts(
|
||||
document.querySelector("#project-status"),
|
||||
options
|
||||
);
|
||||
|
||||
chart.render();
|
||||
|
||||
// website development
|
||||
var options1 = {
|
||||
chart: {
|
||||
height: 380,
|
||||
type: 'rangeBar',
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: true,
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: true
|
||||
},
|
||||
colors:['#fdd92a', '#f73164'],
|
||||
series: [{
|
||||
name: "John",
|
||||
data: [{
|
||||
x: 'Design',
|
||||
y: [10, 40]
|
||||
}, {
|
||||
x: 'Code',
|
||||
y: [30, 35]
|
||||
}, {
|
||||
x: 'Test',
|
||||
y: [20, 40]
|
||||
}, {
|
||||
x: 'Deployment',
|
||||
y: [20, 25]
|
||||
}]
|
||||
}, {
|
||||
name: "Alena",
|
||||
data: [{
|
||||
x: 'Design',
|
||||
y: [35, 45]
|
||||
}, {
|
||||
x: 'Code',
|
||||
y: [10, 25]
|
||||
}, {
|
||||
x: 'Test',
|
||||
y: [30, 50]
|
||||
}, {
|
||||
x: 'Deployment',
|
||||
y: [15, 25]
|
||||
}]
|
||||
}],
|
||||
|
||||
}
|
||||
|
||||
var chart1 = new ApexCharts(
|
||||
document.querySelector("#websites"),
|
||||
options1
|
||||
);
|
||||
|
||||
chart1.render();
|
||||
|
||||
// vector map
|
||||
! function(maps) {
|
||||
"use strict";
|
||||
var b = function() {};
|
||||
b.prototype.init = function() {
|
||||
maps("#asia").vectorMap({
|
||||
map: "asia_mill",
|
||||
backgroundColor: "transparent",
|
||||
regionStyle: {
|
||||
initial: {
|
||||
fill: "#f73164"
|
||||
}
|
||||
},
|
||||
markers: [
|
||||
{ latLng: [39.91, 116.36], name: 'china', style: {r: 8, fill:'white'}},
|
||||
{ latLng: [24.774, 46.73], name: 'saudi Arbia', style: {r: 8, fill:'white'}},
|
||||
{ latLng: [43.238949, 76.889709], name: 'Kyrgyzstan', style: {r: 8, fill:'white'}},
|
||||
{ latLng: [20.59, 78.96], name: 'India', style: {r: 8, fill:'white'}},
|
||||
{ latLng: [35.86, 104.19], name: 'Changzhou', style: {r: 8, fill:'white'}},
|
||||
{ latLng: [23.026, 113.13], name: 'Dongguan', style: {r: 8, fill:'white'}},
|
||||
{ latLng: [34.68, 112.45], name: 'Henan', style: {r: 8, fill:'white'}},
|
||||
{ latLng: [33.22, 43.67], name: 'Iraq', style: {r: 8, fill:'white'}}
|
||||
],
|
||||
series: {
|
||||
regions: [{
|
||||
scale: ['#fdd5df', '#fd0846'],
|
||||
normalizeFunction: 'polynomial',
|
||||
values: {
|
||||
"AF": 16.63,
|
||||
"AL": 11.58,
|
||||
"DZ": 158.97,
|
||||
"AO": 85.81,
|
||||
"AG": 1.1,
|
||||
"AR": 351.02,
|
||||
"AM": 8.83,
|
||||
"AU": 1219.72,
|
||||
"AT": 366.26,
|
||||
"AZ": 52.17,
|
||||
"BS": 7.54,
|
||||
"BH": 21.73,
|
||||
"BD": 105.4,
|
||||
"BB": 3.96,
|
||||
"BY": 52.89,
|
||||
"BE": 461.33,
|
||||
"BZ": 1.43,
|
||||
"BJ": 6.49,
|
||||
"BT": 1.4,
|
||||
"BO": 19.18,
|
||||
"BA": 16.2,
|
||||
"BW": 12.5,
|
||||
"BR": 2023.53,
|
||||
"BN": 11.96,
|
||||
"BG": 44.84,
|
||||
"BF": 8.67,
|
||||
"BI": 1.47,
|
||||
"KH": 11.36,
|
||||
"CM": 21.88,
|
||||
"CA": 1563.66,
|
||||
"CV": 1.57,
|
||||
"CF": 2.11,
|
||||
"TD": 7.59,
|
||||
"CL": 199.18,
|
||||
"CN": 5745.13,
|
||||
"CO": 283.11,
|
||||
"KM": 0.56,
|
||||
"CD": 12.6,
|
||||
"CG": 11.88,
|
||||
"CR": 35.02,
|
||||
"CI": 22.38,
|
||||
"HR": 59.92,
|
||||
"CY": 22.75,
|
||||
"CZ": 195.23,
|
||||
"DK": 304.56,
|
||||
"DJ": 1.14,
|
||||
"DM": 0.38,
|
||||
"DO": 50.87,
|
||||
"EC": 61.49,
|
||||
"EG": 216.83,
|
||||
"SV": 21.8,
|
||||
"GQ": 14.55,
|
||||
"ER": 2.25,
|
||||
"EE": 19.22,
|
||||
"ET": 30.94,
|
||||
"FJ": 3.15,
|
||||
"FI": 231.98,
|
||||
"FR": 2555.44,
|
||||
"GA": 12.56,
|
||||
"GM": 1.04,
|
||||
"GE": 11.23,
|
||||
"DE": 3305.9,
|
||||
"GH": 18.06,
|
||||
"GR": 305.01,
|
||||
"GD": 0.65,
|
||||
"GT": 40.77,
|
||||
"GN": 4.34,
|
||||
"GW": 0.83,
|
||||
"GY": 2.2,
|
||||
"HT": 6.5,
|
||||
"HN": 15.34,
|
||||
"HK": 226.49,
|
||||
"HU": 132.28,
|
||||
"IS": 12.77,
|
||||
"IN": 1430.02,
|
||||
"IR": 337.9,
|
||||
"IE": 204.14,
|
||||
"IL": 201.25,
|
||||
"IT": 2036.69,
|
||||
"JM": 13.74,
|
||||
"JP": 5390.9,
|
||||
"KZ": 129.76,
|
||||
"KE": 32.42,
|
||||
"KI": 0.15,
|
||||
"KR": 986.26,
|
||||
"KW": 117.32,
|
||||
"KG": 4.44,
|
||||
"LA": 6.34,
|
||||
"LV": 23.39,
|
||||
"LB": 39.15,
|
||||
"LS": 1.8,
|
||||
"LR": 0.98,
|
||||
"LY": 77.91,
|
||||
"LT": 35.73,
|
||||
"LU": 52.43,
|
||||
"MK": 9.58,
|
||||
"MG": 8.33,
|
||||
"MW": 5.04,
|
||||
"MY": 218.95,
|
||||
"MV": 1.43,
|
||||
"ML": 9.08,
|
||||
"MT": 7.8,
|
||||
"MR": 3.49,
|
||||
"MU": 9.43,
|
||||
"MX": 1004.04,
|
||||
"MD": 5.36,
|
||||
"MN": 5.81,
|
||||
"ME": 3.88,
|
||||
"MA": 91.7,
|
||||
"MZ": 10.21,
|
||||
"MM": 35.65,
|
||||
"NA": 11.45,
|
||||
"NP": 15.11,
|
||||
"NL": 770.31,
|
||||
"NZ": 138,
|
||||
"NI": 6.38,
|
||||
"NE": 5.6,
|
||||
"NG": 206.66,
|
||||
"NO": 413.51,
|
||||
"PK": 174.79,
|
||||
"PA": 27.2,
|
||||
"PG": 8.81,
|
||||
"PY": 17.17,
|
||||
"PE": 153.55,
|
||||
"PH": 189.06,
|
||||
"PL": 438.88,
|
||||
"PT": 223.7,
|
||||
"QA": 126.52,
|
||||
"RO": 158.39,
|
||||
"RU": 1476.91,
|
||||
"RW": 5.69,
|
||||
"WS": 0.55,
|
||||
"ST": 0.19,
|
||||
"SN": 12.66,
|
||||
"RS": 38.92,
|
||||
"SC": 0.92,
|
||||
"SL": 1.9,
|
||||
"SG": 217.38,
|
||||
"SK": 86.26,
|
||||
"SI": 46.44,
|
||||
"SB": 0.67,
|
||||
"ZA": 354.41,
|
||||
"ES": 1374.78,
|
||||
"LK": 48.24,
|
||||
"KN": 0.56,
|
||||
"LC": 1,
|
||||
"VC": 0.58,
|
||||
"SD": 65.93,
|
||||
"SR": 3.3,
|
||||
"SZ": 3.17,
|
||||
"SE": 444.59,
|
||||
"CH": 522.44,
|
||||
"TW": 426.98,
|
||||
"TJ": 5.58,
|
||||
"TZ": 22.43,
|
||||
"TH": 312.61,
|
||||
"TL": 0.62,
|
||||
"TG": 3.07,
|
||||
"TO": 0.3,
|
||||
"TT": 21.2,
|
||||
"TN": 43.86,
|
||||
"TM": 0,
|
||||
"UG": 17.12,
|
||||
"UA": 136.56,
|
||||
"GB": 2258.57,
|
||||
"US": 14624.18,
|
||||
"UY": 40.71,
|
||||
"UZ": 37.72,
|
||||
"VU": 0.72,
|
||||
"VE": 285.21,
|
||||
"VN": 101.99,
|
||||
"ZM": 15.69,
|
||||
"ZW": 5.57
|
||||
}
|
||||
}]
|
||||
}
|
||||
})
|
||||
}, maps.VectorMap = new b, maps.VectorMap.Constructor = b
|
||||
}(window.jQuery),
|
||||
function(maps) {
|
||||
"use strict";
|
||||
maps.VectorMap.init()
|
||||
}(window.jQuery);
|
||||
673
public/assets/js/dashboard/default.js
Normal file
673
public/assets/js/dashboard/default.js
Normal file
@@ -0,0 +1,673 @@
|
||||
//dashboard default page in chart-1
|
||||
var options = {
|
||||
series: [{
|
||||
data: [
|
||||
[1327359600000, 65.95],
|
||||
[1327446000000, 65.34],
|
||||
[1327532400000, 65.18],
|
||||
[1327618800000, 65.05],
|
||||
[1327878000000, 65.00],
|
||||
[1327964400000, 63.95],
|
||||
[1328050800000, 62.24],
|
||||
[1328137200000, 63.29],
|
||||
[1328223600000, 65.85],
|
||||
[1328482800000, 60.86],
|
||||
[1328569200000, 62.28],
|
||||
[1328655600000, 59.10],
|
||||
[1328742000000, 59.65],
|
||||
[1328828400000, 59.21],
|
||||
[1329087600000, 60.35],
|
||||
[1329174000000, 60.44],
|
||||
[1329260400000, 60.46],
|
||||
[1329346800000, 60.86],
|
||||
[1329433200000, 65.75],
|
||||
[1329778800000, 65.54],
|
||||
[1329865200000, 65.33],
|
||||
[1329951600000, 65.97],
|
||||
[1330038000000, 60.41],
|
||||
[1330297200000, 60.27],
|
||||
[1330383600000, 60.27],
|
||||
[1331161200000, 59.05],
|
||||
[1331247600000, 59.64],
|
||||
[1331506800000, 59.56],
|
||||
[1331593200000, 59.22],
|
||||
[1331679600000, 58.77],
|
||||
[1331766000000, 58.17],
|
||||
[1331852400000, 58.82],
|
||||
[1332111600000, 58.51],
|
||||
[1332198000000, 58.16],
|
||||
[1332284400000, 58.56],
|
||||
[1332370800000, 55.71],
|
||||
[1332457200000, 55.81],
|
||||
[1332712800000, 55.40],
|
||||
[1332799200000, 55.63],
|
||||
[1332885600000, 55.46],
|
||||
[1332972000000, 54.48],
|
||||
[1333058400000, 54.31],
|
||||
[1333317600000, 54.70],
|
||||
[1333404000000, 55.31],
|
||||
[1333490400000, 55.46],
|
||||
[1333576800000, 55.59],
|
||||
[1333922400000, 56.22],
|
||||
[1335477600000, 56.58],
|
||||
[1335736800000, 56.55],
|
||||
[1335823200000, 56.77],
|
||||
[1335909600000, 56.76],
|
||||
[1335996000000, 56.32],
|
||||
[1336082400000, 57.61],
|
||||
[1336341600000, 57.52],
|
||||
[1336428000000, 57.67],
|
||||
[1336514400000, 57.52],
|
||||
[1336600800000, 57.92],
|
||||
[1336687200000, 58.20],
|
||||
[1336946400000, 58.23],
|
||||
[1337032800000, 58.33],
|
||||
[1337119200000, 58.36],
|
||||
[1337205600000, 58.01],
|
||||
[1337292000000, 58.31],
|
||||
[1337551200000, 55.01],
|
||||
[1337637600000, 55.01],
|
||||
[1337724000000, 55.18],
|
||||
[1337810400000, 55.54],
|
||||
[1337896800000, 53.60],
|
||||
[1338242400000, 53.05],
|
||||
[1338328800000, 53.29],
|
||||
[1338415200000, 53.05],
|
||||
[1338501600000, 50.82],
|
||||
[1338760800000, 50.31],
|
||||
[1338847200000, 50.70],
|
||||
[1338933600000, 50.69],
|
||||
[1339020000000, 50.32],
|
||||
[1339106400000, 49.65],
|
||||
[1339365600000, 49.13],
|
||||
[1339452000000, 49.77],
|
||||
[1339538400000, 49.79],
|
||||
[1339624800000, 49.67],
|
||||
[1339711200000, 49.39],
|
||||
[1339970400000, 49.63],
|
||||
[1340056800000, 49.89],
|
||||
[1340143200000, 48.99],
|
||||
[1340229600000, 48.23],
|
||||
[1340316000000, 48.57],
|
||||
[1340575200000, 48.84],
|
||||
[1340661600000, 48.07],
|
||||
[1340748000000, 48.41],
|
||||
[1340834400000, 48.17],
|
||||
[1340920800000, 48.37],
|
||||
[1341180000000, 48.19],
|
||||
[1341266400000, 45.51],
|
||||
[1341439200000, 45.53],
|
||||
[1341525600000, 45.37],
|
||||
[1341784800000, 45.43],
|
||||
[1341871200000, 45.44],
|
||||
[1341957600000, 45.20],
|
||||
[1342044000000, 43.14],
|
||||
[1342130400000, 43.65],
|
||||
[1342389600000, 43.40],
|
||||
[1342476000000, 43.65],
|
||||
[1342562400000, 43.43],
|
||||
[1342648800000, 43.89],
|
||||
[1342735200000, 40.38],
|
||||
[1342994400000, 40.64],
|
||||
[1343080800000, 40.02],
|
||||
[1343167200000, 40.33],
|
||||
[1343253600000, 40.95],
|
||||
[1343340000000, 40.89],
|
||||
[1343599200000, 40.01],
|
||||
[1343685600000, 40.88],
|
||||
[1343772000000, 40.69],
|
||||
[1343858400000, 40.58],
|
||||
[1343944800000, 40.02],
|
||||
[1344204000000, 41.14],
|
||||
[1344290400000, 41.37],
|
||||
[1344376800000, 41.51],
|
||||
[1344463200000, 41.65],
|
||||
[1344549600000, 41.64],
|
||||
[1344808800000, 41.27],
|
||||
[1344895200000, 41.10],
|
||||
[1344981600000, 41.91],
|
||||
[1345068000000, 41.65],
|
||||
[1345154400000, 40.80],
|
||||
[1345413600000, 40.92],
|
||||
[1345500000000, 40.75],
|
||||
[1345586400000, 40.84],
|
||||
[1345672800000, 40.50],
|
||||
[1345759200000, 40.26],
|
||||
[1346018400000, 42.32],
|
||||
[1346104800000, 42.06],
|
||||
[1346191200000, 42.96],
|
||||
[1346277600000, 42.46],
|
||||
[1346364000000, 42.27],
|
||||
[1346709600000, 42.43],
|
||||
[1346796000000, 42.26],
|
||||
[1346882400000, 42.79],
|
||||
[1346968800000, 43.46],
|
||||
[1347228000000, 43.13],
|
||||
[1347314400000, 40.43],
|
||||
[1347400800000, 40.42],
|
||||
[1347487200000, 40.81],
|
||||
[1347573600000, 40.34],
|
||||
[1347832800000, 40.41],
|
||||
[1347919200000, 38.57],
|
||||
[1348005600000, 38.12],
|
||||
[1348092000000, 38.53],
|
||||
[1348178400000, 38.83],
|
||||
[1348437600000, 38.41],
|
||||
[1348524000000, 38.90],
|
||||
[1348610400000, 40.53],
|
||||
[1348696800000, 40.80],
|
||||
[1348783200000, 40.44],
|
||||
[1349042400000, 40.62],
|
||||
[1349128800000, 40.57],
|
||||
[1349215200000, 40.60],
|
||||
[1349301600000, 40.68],
|
||||
[1349388000000, 40.47],
|
||||
[1349647200000, 43.23],
|
||||
[1349733600000, 43.68],
|
||||
[1349820000000, 43.51],
|
||||
[1349906400000, 43.78],
|
||||
[1349992800000, 43.94],
|
||||
[1350252000000, 43.33],
|
||||
[1350338400000, 43.24],
|
||||
[1350424800000, 43.44],
|
||||
[1350511200000, 43.48],
|
||||
[1350597600000, 43.24],
|
||||
[1350856800000, 43.49],
|
||||
[1350943200000, 43.31],
|
||||
[1351029600000, 45.36],
|
||||
[1351116000000, 45.40],
|
||||
[1351202400000, 45.01],
|
||||
[1351638000000, 45.02],
|
||||
[1351724400000, 45.36],
|
||||
[1351810800000, 45.39],
|
||||
[1352070000000, 45.24],
|
||||
[1352156400000, 45.39],
|
||||
[1352242800000, 45.47],
|
||||
[1352329200000, 45.98],
|
||||
[1352415600000, 48.90],
|
||||
[1352674800000, 48.70],
|
||||
[1352761200000, 48.54],
|
||||
[1352847600000, 48.23],
|
||||
[1352934000000, 48.64],
|
||||
[1353020400000, 48.65],
|
||||
[1353279600000, 48.92],
|
||||
[1353366000000, 48.64],
|
||||
[1353452400000, 48.84],
|
||||
[1353625200000, 48.40],
|
||||
[1353884400000, 48.30],
|
||||
[1355353200000, 55.53],
|
||||
[1355439600000, 55.56],
|
||||
[1355698800000, 55.42],
|
||||
[1355785200000, 58.49],
|
||||
[1355871600000, 58.09],
|
||||
[1355958000000, 58.87],
|
||||
[1356044400000, 58.71],
|
||||
[1356303600000, 58.53],
|
||||
[1356476400000, 58.55],
|
||||
[1356562800000, 60.30],
|
||||
[1356649200000, 60.90],
|
||||
[1356908400000, 60.68],
|
||||
[1357081200000, 60.34],
|
||||
[1357167600000, 60.75],
|
||||
[1357254000000, 60.13],
|
||||
[1357513200000, 60.94],
|
||||
[1357599600000, 60.14],
|
||||
[1357686000000, 60.66],
|
||||
[1357772400000, 63.62],
|
||||
[1357858800000, 65.09],
|
||||
[1358118000000, 63.16],
|
||||
[1358204400000, 63.15],
|
||||
[1358290800000, 65.88],
|
||||
[1358377200000, 60.73],
|
||||
[1358463600000, 60.98],
|
||||
[1358809200000, 60.95],
|
||||
[1358895600000, 60.25],
|
||||
[1358982000000, 60.10],
|
||||
[1359068400000, 60.32],
|
||||
[1359327600000, 60.24],
|
||||
[1359414000000, 60.52],
|
||||
[1359500400000, 60.94],
|
||||
[1359586800000, 60.83],
|
||||
[1359673200000, 60.34],
|
||||
[1359932400000, 60.10],
|
||||
[1360018800000, 63.51],
|
||||
[1360105200000, 63.40],
|
||||
[1360191600000, 63.20],
|
||||
[1360278000000, 63.20],
|
||||
[1360537200000, 64.64],
|
||||
[1360623600000, 64.89],
|
||||
[1360710000000, 64.81],
|
||||
[1360796400000, 65.61],
|
||||
[1360882800000, 65.63],
|
||||
[1361228400000, 65.99],
|
||||
[1361314800000, 66.77],
|
||||
[1361401200000, 66.34],
|
||||
[1361487600000, 66.55],
|
||||
[1361746800000, 67.11],
|
||||
[1361833200000, 67.59],
|
||||
[1361919600000, 67.60]
|
||||
]
|
||||
}],
|
||||
chart: {
|
||||
id: 'area-datetime',
|
||||
type: 'area',
|
||||
height: 425,
|
||||
zoom: {
|
||||
autoScaleYaxis: true
|
||||
},
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
},
|
||||
annotations: {
|
||||
yaxis: [{
|
||||
y: 50,
|
||||
borderColor: vihoAdminConfig.primary,
|
||||
label: {
|
||||
show: true,
|
||||
text: 'Support',
|
||||
style: {
|
||||
color: "#fff",
|
||||
background: vihoAdminConfig.primary
|
||||
}
|
||||
}
|
||||
}],
|
||||
xaxis: [{
|
||||
x: new Date('15 Nov 2012').getTime(),
|
||||
borderColor: vihoAdminConfig.primary,
|
||||
yAxisIndex: 50,
|
||||
label: {
|
||||
show: false,
|
||||
text: '$859,432',
|
||||
style: {
|
||||
color: "#fff",
|
||||
background: vihoAdminConfig.primary
|
||||
}
|
||||
},
|
||||
}]
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
markers: {
|
||||
size: 0,
|
||||
style: 'hollow',
|
||||
},
|
||||
xaxis: {
|
||||
type: 'datetime',
|
||||
min: new Date('01 Apr 2012').getTime(),
|
||||
tickAmount: 6,
|
||||
axisTicks: {
|
||||
show: false,
|
||||
},
|
||||
axisBorder: {
|
||||
show: false
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
x: {
|
||||
format: 'dd MMM yyyy'
|
||||
},
|
||||
},
|
||||
fill: {
|
||||
type: 'gradient',
|
||||
gradient: {
|
||||
shadeIntensity: 1,
|
||||
opacityFrom: 0.7,
|
||||
opacityTo: 0.9,
|
||||
stops: [0, 100]
|
||||
}
|
||||
},
|
||||
responsive: [{
|
||||
breakpoint: 1366,
|
||||
options: {
|
||||
chart: {
|
||||
height: 350
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 1238,
|
||||
options: {
|
||||
chart: {
|
||||
height:300
|
||||
},
|
||||
grid: {
|
||||
padding: {
|
||||
bottom: 5,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 992,
|
||||
options: {
|
||||
chart: {
|
||||
height: 300
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 551,
|
||||
options: {
|
||||
grid: {
|
||||
padding: {
|
||||
bottom:10,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 535,
|
||||
options: {
|
||||
chart: {
|
||||
height: 250
|
||||
}
|
||||
|
||||
}
|
||||
}],
|
||||
|
||||
colors: [vihoAdminConfig.primary],
|
||||
};
|
||||
var charttimeline = new ApexCharts(document.querySelector("#chart-timeline-dashbord"), options);
|
||||
charttimeline.render();
|
||||
// second chart dashbord dafault
|
||||
var options17 = {
|
||||
series: [76, 67, 61, 90],
|
||||
chart: {
|
||||
height: 380,
|
||||
type: 'radialBar',
|
||||
},
|
||||
plotOptions: {
|
||||
radialBar: {
|
||||
offsetY: 0,
|
||||
startAngle: 0,
|
||||
endAngle: 270,
|
||||
hollow: {
|
||||
margin: 5,
|
||||
size: '30%',
|
||||
background: 'transparent',
|
||||
image: undefined,
|
||||
},
|
||||
dataLabels: {
|
||||
name: {
|
||||
show: false,
|
||||
},
|
||||
value: {
|
||||
show: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.primary, vihoAdminConfig.secondary, vihoAdminConfig.primary, vihoAdminConfig.secondary],
|
||||
labels: ['Total order', 'Total product', 'Quantity', 'Page views'],
|
||||
legend: {
|
||||
show: true,
|
||||
floating: true,
|
||||
fontSize: '14px',
|
||||
position: 'left',
|
||||
fontFamily: 'Roboto',
|
||||
fontweight: 400,
|
||||
// offsetX:30,
|
||||
offsetY: 20,
|
||||
labels: {
|
||||
useSeriesColors: true,
|
||||
},
|
||||
markers: {
|
||||
size: 0,
|
||||
show: false,
|
||||
},
|
||||
formatter: function(seriesName, opts) {
|
||||
return seriesName + ": " + opts.w.globals.series[opts.seriesIndex]
|
||||
},
|
||||
itemMargin: {
|
||||
vertical: 5,
|
||||
horizontal: 2
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
lineCap: 'round'
|
||||
},
|
||||
responsive: [{
|
||||
breakpoint: 480,
|
||||
options: {
|
||||
legend: {
|
||||
show: true,
|
||||
fontSize: '10px',
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
var chart17 = new ApexCharts(document.querySelector("#chart-dashbord"), options17);
|
||||
chart17.render();
|
||||
// chart-4 dashbord
|
||||
var options21 = {
|
||||
series: [{
|
||||
name: 'series1',
|
||||
data: [90, 78, 90, 84, 94, 60, 95, 88, 95]
|
||||
}],
|
||||
chart: {
|
||||
height: 405,
|
||||
type: 'area',
|
||||
toolbar: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
xaxis: {
|
||||
type: 'datetime',
|
||||
enabled: false,
|
||||
categories: ["2018-09-19T00:00:00.000Z", "2018-09-19T01:30:00.000Z", "2018-09-19T02:30:00.000Z", "2018-09-19T03:30:00.000Z", "2018-09-19T04:30:00.000Z", "2018-09-19T05:30:00.000Z", "2018-09-19T06:30:00.000Z"]
|
||||
},
|
||||
yaxis: {
|
||||
show: false,
|
||||
},
|
||||
xaxis: {
|
||||
show: false,
|
||||
labels: {
|
||||
show: false,
|
||||
},
|
||||
axisTicks: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
x: {
|
||||
format: 'dd/MM/yy HH:mm',
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
colors: [vihoAdminConfig.secondary],
|
||||
responsive: [
|
||||
{
|
||||
breakpoint:1365,
|
||||
options: {
|
||||
chart: {
|
||||
height: 220
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
breakpoint: 575,
|
||||
options: {
|
||||
chart: {
|
||||
height: 180
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
breakpoint: 992,
|
||||
options: {
|
||||
chart: {
|
||||
height: 250
|
||||
}
|
||||
},
|
||||
}],
|
||||
};
|
||||
var chart21 = new ApexCharts(document.querySelector("#chart-3dash"), options21);
|
||||
chart21.render();
|
||||
//column chart
|
||||
var options54 = {
|
||||
series: [{
|
||||
data: [400, 230, 448, 370, 540, 580, 690, 1100, 1200]
|
||||
}],
|
||||
chart: {
|
||||
type: "bar",
|
||||
height: 200,
|
||||
toolbar: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: false,
|
||||
distributed: true,
|
||||
columnWidth: '30%',
|
||||
startingShape: "rounded",
|
||||
endingShape: "rounded",
|
||||
colors: {
|
||||
backgroundBarColors: ["#e5edef"],
|
||||
backgroundBarOpacity: 1,
|
||||
backgroundBarRadius: 9
|
||||
}
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
grid: {
|
||||
yaxis: {
|
||||
lines: {
|
||||
show: false
|
||||
},
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
labels: {
|
||||
formatter: function(val) {
|
||||
return val / 100 + "K";
|
||||
},
|
||||
},
|
||||
labels: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
xaxis: {
|
||||
axisBorder: {
|
||||
show: false
|
||||
},
|
||||
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Sep", "Oct"],
|
||||
labels: {
|
||||
show: true,
|
||||
},
|
||||
axisTicks: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
colors: [
|
||||
vihoAdminConfig.primary,
|
||||
vihoAdminConfig.primary,
|
||||
vihoAdminConfig.primary,
|
||||
vihoAdminConfig.primary,
|
||||
vihoAdminConfig.primary,
|
||||
vihoAdminConfig.primary,
|
||||
vihoAdminConfig.primary,
|
||||
vihoAdminConfig.primary,
|
||||
vihoAdminConfig.primary
|
||||
],
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
};
|
||||
var chart54 = new ApexCharts(document.querySelector("#chart-unique-2"), options54);
|
||||
chart54.render();
|
||||
//new column charts
|
||||
var options55 = {
|
||||
series: [{
|
||||
name: "Yearly Profit",
|
||||
data: [{
|
||||
x: "Jan",
|
||||
y: 1500
|
||||
}, {
|
||||
x: "Feb",
|
||||
y: 3000
|
||||
}, {
|
||||
x: "Mar",
|
||||
y: 1800
|
||||
}, {
|
||||
x: "Apr",
|
||||
y: 3000,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
}, {
|
||||
x: "May",
|
||||
y: 1800
|
||||
}, {
|
||||
x: "Jun",
|
||||
y: 1500
|
||||
}, {
|
||||
x: "Jul",
|
||||
y: 2500
|
||||
}, {
|
||||
x: "Sep",
|
||||
y: 1500,
|
||||
fillColor: vihoAdminConfig.secondary,
|
||||
}, {
|
||||
x: "Oct",
|
||||
y: 2000
|
||||
}]
|
||||
}],
|
||||
chart: {
|
||||
height: 250,
|
||||
type: "bar",
|
||||
toolbar: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: false,
|
||||
columnWidth: "30%",
|
||||
startingShape: "rounded",
|
||||
endingShape: "rounded",
|
||||
colors: {
|
||||
backgroundBarColors: ["#e5edef"],
|
||||
backgroundBarOpacity: 1,
|
||||
backgroundBarRadius: 9
|
||||
}
|
||||
},
|
||||
},
|
||||
stroke: {
|
||||
show: false,
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
fill: {
|
||||
opacity: 1
|
||||
},
|
||||
xaxis: {
|
||||
// type: "datetime",
|
||||
axisBorder: {
|
||||
show: false
|
||||
},
|
||||
labels: {
|
||||
show: true,
|
||||
},
|
||||
axisTicks: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yaxis: {
|
||||
labels: {
|
||||
show: false,
|
||||
}
|
||||
},
|
||||
colors: [vihoAdminConfig.primary]
|
||||
};
|
||||
var chart55 = new ApexCharts(document.querySelector("#user-activation-dash-2"), options55);
|
||||
chart55.render();
|
||||
6
public/assets/js/datatable/datatable-extension/buttons.bootstrap4.min.js
vendored
Normal file
6
public/assets/js/datatable/datatable-extension/buttons.bootstrap4.min.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*!
|
||||
Bootstrap integration for DataTables' Buttons
|
||||
©2016 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-buttons"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-bs4")(a,b).$;b.fn.dataTable.Buttons||require("datatables.net-buttons")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable;c.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons btn-group"},
|
||||
button:{className:"btn btn-primary"},collection:{tag:"div",className:"dt-button-collection dropdown-menu",button:{tag:"a",className:"dt-button dropdown-item",active:"active",disabled:"disabled"}}}});a.ext.buttons.collection.className+=" dropdown-toggle";return a.Buttons});
|
||||
6
public/assets/js/datatable/datatable-extension/buttons.colVis.min.js
vendored
Normal file
6
public/assets/js/datatable/datatable-extension/buttons.colVis.min.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
(function(g){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(d){return g(d,window,document)}):"object"===typeof exports?module.exports=function(d,e){d||(d=window);if(!e||!e.fn.dataTable)e=require("datatables.net")(d,e).$;e.fn.dataTable.Buttons||require("datatables.net-buttons")(d,e);return g(e,d,d.document)}:g(jQuery,window,document)})(function(g,d,e,h){d=g.fn.dataTable;g.extend(d.ext.buttons,{colvis:function(b,a){return{extend:"collection",
|
||||
text:function(a){return a.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",buttons:[{extend:"columnsToggle",columns:a.columns,columnText:a.columnText}]}},columnsToggle:function(b,a){return b.columns(a.columns).indexes().map(function(b){return{extend:"columnToggle",columns:b,columnText:a.columnText}}).toArray()},columnToggle:function(b,a){return{extend:"columnVisibility",columns:a.columns,columnText:a.columnText}},columnsVisibility:function(b,a){return b.columns(a.columns).indexes().map(function(b){return{extend:"columnVisibility",
|
||||
columns:b,visibility:a.visibility,columnText:a.columnText}}).toArray()},columnVisibility:{columns:h,text:function(b,a,c){return c._columnText(b,c)},className:"buttons-columnVisibility",action:function(b,a,c,f){b=a.columns(f.columns);a=b.visible();b.visible(f.visibility!==h?f.visibility:!(a.length&&a[0]))},init:function(b,a,c){var f=this;b.on("column-visibility.dt"+c.namespace,function(a,d){!d.bDestroying&&d.nTable==b.settings()[0].nTable&&f.active(b.column(c.columns).visible())}).on("column-reorder.dt"+
|
||||
c.namespace,function(a,d,e){1===b.columns(c.columns).count()&&("number"===typeof c.columns&&(c.columns=e.mapping[c.columns]),a=b.column(c.columns),f.text(c._columnText(b,c)),f.active(a.visible()))});this.active(b.column(c.columns).visible())},destroy:function(b,a,c){b.off("column-visibility.dt"+c.namespace).off("column-reorder.dt"+c.namespace)},_columnText:function(b,a){var c=b.column(a.columns).index(),f=b.settings()[0].aoColumns[c].sTitle.replace(/\n/g," ").replace(/<br\s*\/?>/gi," ").replace(/<select(.*?)<\/select>/g,
|
||||
"").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,"");return a.columnText?a.columnText(b,c,f):f}},colvisRestore:{className:"buttons-colvisRestore",text:function(b){return b.i18n("buttons.colvisRestore","Restore visibility")},init:function(b,a,c){c._visOriginal=b.columns().indexes().map(function(a){return b.column(a).visible()}).toArray()},action:function(b,a,c,d){a.columns().every(function(b){b=a.colReorder&&a.colReorder.transpose?a.colReorder.transpose(b,"toOriginal"):b;this.visible(d._visOriginal[b])})}},
|
||||
colvisGroup:{className:"buttons-colvisGroup",action:function(b,a,c,d){a.columns(d.show).visible(!0,!1);a.columns(d.hide).visible(!1,!1);a.columns.adjust()},show:[],hide:[]}});return d.Buttons});
|
||||
28
public/assets/js/datatable/datatable-extension/buttons.html5.min.js
vendored
Normal file
28
public/assets/js/datatable/datatable-extension/buttons.html5.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
public/assets/js/datatable/datatable-extension/buttons.print.min.js
vendored
Normal file
4
public/assets/js/datatable/datatable-extension/buttons.print.min.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(e){return d(e,window,document)}):"object"===typeof exports?module.exports=function(e,c){e||(e=window);if(!c||!c.fn.dataTable)c=require("datatables.net")(e,c).$;c.fn.dataTable.Buttons||require("datatables.net-buttons")(e,c);return d(c,e,e.document)}:d(jQuery,window,document)})(function(d,e,c){var i=d.fn.dataTable,f=c.createElement("a"),l=function(a){f.href=a;a=f.host;-1===a.indexOf("/")&&
|
||||
0!==f.pathname.indexOf("/")&&(a+="/");return f.protocol+"//"+a+f.pathname+f.search};i.ext.buttons.print={className:"buttons-print",text:function(a){return a.i18n("buttons.print","Print")},action:function(a,b,c,h){var a=b.buttons.exportData(d.extend({decodeEntities:!1},h.exportOptions)),c=b.buttons.exportInfo(h),f=function(b,c){for(var a="<tr>",d=0,e=b.length;d<e;d++)a+="<"+c+">"+b[d]+"</"+c+">";return a+"</tr>"},b='<table class="'+b.table().node().className+'">';h.header&&(b+="<thead>"+f(a.header,
|
||||
"th")+"</thead>");for(var b=b+"<tbody>",k=0,i=a.body.length;k<i;k++)b+=f(a.body[k],"td");b+="</tbody>";h.footer&&a.footer&&(b+="<tfoot>"+f(a.footer,"th")+"</tfoot>");var b=b+"</table>",g=e.open("","");g.document.close();var j="<title>"+c.title+"</title>";d("style, link").each(function(){var b=j,a=d(this).clone()[0];"link"===a.nodeName.toLowerCase()&&(a.href=l(a.href));j=b+a.outerHTML});try{g.document.head.innerHTML=j}catch(m){d(g.document.head).html(j)}g.document.body.innerHTML="<h1>"+c.title+"</h1><div>"+
|
||||
(c.messageTop||"")+"</div>"+b+"<div>"+(c.messageBottom||"")+"</div>";d(g.document.body).addClass("dt-print-view");d("img",g.document.body).each(function(a,b){b.setAttribute("src",l(b.getAttribute("src")))});h.customize&&h.customize(g);setTimeout(function(){h.autoPrint&&(g.print(),g.close())},1E3)},title:"*",messageTop:"*",messageBottom:"*",exportOptions:{},header:!0,footer:!1,autoPrint:!0,customize:null};return i.Buttons});
|
||||
270
public/assets/js/datatable/datatable-extension/custom.js
Normal file
270
public/assets/js/datatable/datatable-extension/custom.js
Normal file
@@ -0,0 +1,270 @@
|
||||
"use strict";
|
||||
$(document).ready(function(){
|
||||
$('#auto-fill').DataTable( {
|
||||
autoFill: true
|
||||
} );
|
||||
$('#keytable').DataTable( {
|
||||
keys: true,
|
||||
autoFill: true
|
||||
} );
|
||||
$('#column-selector').DataTable( {
|
||||
columnDefs: [ {
|
||||
orderable: false,
|
||||
className: 'select-checkbox',
|
||||
targets: 0
|
||||
} ],
|
||||
select: {
|
||||
style: 'os',
|
||||
selector: 'td:first-child'
|
||||
},
|
||||
order: [[ 1, 'asc' ]],
|
||||
autoFill: {
|
||||
columns: ':not(:first-child)'
|
||||
}
|
||||
} );
|
||||
var table = $('#scrolling-datatable').dataTable( {
|
||||
scrollY: 400,
|
||||
scrollX: true,
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
autoFill: true
|
||||
} );
|
||||
var table = $('#basic-row-reorder').DataTable( {
|
||||
rowReorder: true
|
||||
} );
|
||||
//full row selection
|
||||
var table = $('#full-row').DataTable( {
|
||||
rowReorder: {
|
||||
selector: 'tr'
|
||||
},
|
||||
columnDefs: [
|
||||
{ targets: 0, visible: false }
|
||||
]
|
||||
} );
|
||||
// Restricted column ordering
|
||||
var table = $('#rest-column').DataTable( {
|
||||
rowReorder: true,
|
||||
columnDefs: [
|
||||
{ orderable: true, className: 'reorder', targets: 0 },
|
||||
{ orderable: false, targets: '_all' }
|
||||
]
|
||||
} );
|
||||
$('#export-button').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copyHtml5',
|
||||
'excelHtml5',
|
||||
'csvHtml5',
|
||||
'pdfHtml5'
|
||||
]
|
||||
} );
|
||||
$('#column-selector').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'copyHtml5',
|
||||
exportOptions: {
|
||||
columns: [ 0, ':visible' ]
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
exportOptions: {
|
||||
columns: ':visible'
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 5 ]
|
||||
}
|
||||
},
|
||||
'colvis'
|
||||
]
|
||||
} );
|
||||
$('#excel-cust-bolder').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
buttons: [ {
|
||||
extend: 'excelHtml5',
|
||||
customize: function ( xlsx ){
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
|
||||
// jQuery selector to add a border
|
||||
$('row c[r*="10"]', sheet).attr( 's', '25' );
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
$('#cust-json').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
text: 'JSON',
|
||||
action: function ( e, dt, button, config ) {
|
||||
var data = dt.buttons.exportData();
|
||||
|
||||
$.fn.dataTable.fileSave(
|
||||
new Blob( [ JSON.stringify( data ) ] ),
|
||||
'Export.json'
|
||||
);
|
||||
}
|
||||
}
|
||||
]
|
||||
} );
|
||||
$('#basic-key-table').DataTable( {
|
||||
keys: true
|
||||
} );
|
||||
var table = $('#scrolling').DataTable( {
|
||||
scrollY: 300,
|
||||
paging: false,
|
||||
keys: true
|
||||
} );
|
||||
$('#focus-cell').DataTable( {
|
||||
keys: true
|
||||
} );
|
||||
$('#basic-scroller').DataTable( {
|
||||
ajax: "../assets/json/datatable-extension/data.txt",
|
||||
deferRender: true,
|
||||
scrollY: 200,
|
||||
scrollCollapse: true,
|
||||
scroller: true
|
||||
} );
|
||||
$('#state-saving').DataTable( {
|
||||
ajax: "../assets/json/datatable-extension/data.txt",
|
||||
deferRender: true,
|
||||
scrollY: 200,
|
||||
scrollCollapse: true,
|
||||
scroller: true,
|
||||
stateSave: true
|
||||
} );
|
||||
$('#api').DataTable( {
|
||||
ajax: "../assets/json/datatable-extension/data.txt",
|
||||
deferRender: true,
|
||||
scrollY: 200,
|
||||
scrollCollapse: true,
|
||||
scroller: true,
|
||||
initComplete: function () {
|
||||
this.api().row( 1000 ).scrollTo();
|
||||
}
|
||||
} );
|
||||
$('#responsive').DataTable( {
|
||||
responsive: true
|
||||
} );
|
||||
var table = $('#new-cons').DataTable();
|
||||
// new $.fn.dataTable.Responsive( table );
|
||||
$('#show-hidden-row').DataTable( {
|
||||
responsive: {
|
||||
details: {
|
||||
display: $.fn.dataTable.Responsive.display.childRowImmediate,
|
||||
type: ''
|
||||
}
|
||||
}
|
||||
} );
|
||||
$('#basic-colreorder').DataTable( {
|
||||
colReorder: true
|
||||
} );
|
||||
$('#state-saving').dataTable( {
|
||||
colReorder: true,
|
||||
stateSave: true
|
||||
} );
|
||||
$('#real-time').dataTable( {
|
||||
colReorder: {
|
||||
realtime: false
|
||||
}
|
||||
} );
|
||||
$('#custom-button').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Add to cart',
|
||||
action: function ( e, dt, node, config ) {
|
||||
alert( 'Button activated' );
|
||||
}
|
||||
}
|
||||
]
|
||||
} );
|
||||
$('#class-button').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Secondary',
|
||||
className: 'btn-secondary'
|
||||
|
||||
},
|
||||
{
|
||||
text: 'Success',
|
||||
className: 'btn-success'
|
||||
},
|
||||
{
|
||||
text: 'Danger',
|
||||
className: 'btn-danger'
|
||||
}
|
||||
]
|
||||
} );
|
||||
$('#keyboard-btn').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Button <u>1</u>',
|
||||
key: '1',
|
||||
action: function ( e, dt, node, config ) {
|
||||
alert( 'Button 1 activated' );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Button <u><i>shift</i> 2</u>',
|
||||
key: {
|
||||
shiftKey: true,
|
||||
key: '2'
|
||||
},
|
||||
action: function ( e, dt, node, config ) {
|
||||
alert( 'Button 2 activated' );
|
||||
}
|
||||
}
|
||||
]
|
||||
} );
|
||||
$('#multilevel-btn').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'collection',
|
||||
text: 'Table control',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Toggle start date',
|
||||
action: function ( e, dt, node, config ) {
|
||||
dt.column( -2 ).visible( ! dt.column( -2 ).visible() );
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Toggle salary',
|
||||
action: function ( e, dt, node, config ) {
|
||||
dt.column( -1 ).visible( ! dt.column( -1 ).visible() );
|
||||
}
|
||||
},
|
||||
'colvis'
|
||||
]
|
||||
}
|
||||
]
|
||||
} );
|
||||
$('#pagelength-btn').DataTable( {
|
||||
dom: 'Bfrtip',
|
||||
lengthMenu: [
|
||||
[ 10, 25, 50, -1 ],
|
||||
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
|
||||
],
|
||||
buttons: [
|
||||
'pageLength'
|
||||
]
|
||||
} );
|
||||
$('#basic-fixed-header').DataTable( {
|
||||
fixedHeader: true
|
||||
} );
|
||||
var table = $('#fixed-header-footer').DataTable( {
|
||||
fixedHeader: {
|
||||
header: true,
|
||||
footer: true
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
|
||||
25
public/assets/js/datatable/datatable-extension/dataTables.autoFill.min.js
vendored
Normal file
25
public/assets/js/datatable/datatable-extension/dataTables.autoFill.min.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/*!
|
||||
AutoFill 2.2.2
|
||||
©2008-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(l){return e(l,window,document)}):"object"===typeof exports?module.exports=function(l,i){l||(l=window);if(!i||!i.fn.dataTable)i=require("datatables.net")(l,i).$;return e(i,l,l.document)}:e(jQuery,window,document)})(function(e,l,i,q){var k=e.fn.dataTable,p=0,j=function(c,b){if(!k.versionCheck||!k.versionCheck("1.10.8"))throw"Warning: AutoFill requires DataTables 1.10.8 or greater";this.c=e.extend(!0,{},k.defaults.autoFill,
|
||||
j.defaults,b);this.s={dt:new k.Api(c),namespace:".autoFill"+p++,scroll:{},scrollInterval:null,handle:{height:0,width:0},enabled:!1};this.dom={handle:e('<div class="dt-autofill-handle"/>'),select:{top:e('<div class="dt-autofill-select top"/>'),right:e('<div class="dt-autofill-select right"/>'),bottom:e('<div class="dt-autofill-select bottom"/>'),left:e('<div class="dt-autofill-select left"/>')},background:e('<div class="dt-autofill-background"/>'),list:e('<div class="dt-autofill-list">'+this.s.dt.i18n("autoFill.info",
|
||||
"")+"<ul/></div>"),dtScroll:null,offsetParent:null};this._constructor()};e.extend(j.prototype,{enabled:function(){return this.s.enabled},enable:function(c){var b=this;if(!1===c)return this.disable();this.s.enabled=!0;this._focusListener();this.dom.handle.on("mousedown",function(a){b._mousedown(a);return!1});return this},disable:function(){this.s.enabled=!1;this._focusListenerRemove();return this},_constructor:function(){var c=this,b=this.s.dt,a=e("div.dataTables_scrollBody",this.s.dt.table().container());
|
||||
b.settings()[0].autoFill=this;a.length&&(this.dom.dtScroll=a,"static"===a.css("position")&&a.css("position","relative"));!1!==this.c.enable&&this.enable();b.on("destroy.autoFill",function(){c._focusListenerRemove()})},_attach:function(c){var b=this.s.dt,a=b.cell(c).index(),d=this.dom.handle,f=this.s.handle;if(!a||-1===b.columns(this.c.columns).indexes().indexOf(a.column))this._detach();else{this.dom.offsetParent||(this.dom.offsetParent=e(b.table().node()).offsetParent());if(!f.height||!f.width)d.appendTo("body"),
|
||||
f.height=d.outerHeight(),f.width=d.outerWidth();b=this._getPosition(c,this.dom.offsetParent);this.dom.attachedTo=c;d.css({top:b.top+c.offsetHeight-f.height,left:b.left+c.offsetWidth-f.width}).appendTo(this.dom.offsetParent)}},_actionSelector:function(c){var b=this,a=this.s.dt,d=j.actions,f=[];e.each(d,function(b,d){d.available(a,c)&&f.push(b)});if(1===f.length&&!1===this.c.alwaysAsk){var h=d[f[0]].execute(a,c);this._update(h,c)}else{var g=this.dom.list.children("ul").empty();f.push("cancel");e.each(f,
|
||||
function(f,h){g.append(e("<li/>").append('<div class="dt-autofill-question">'+d[h].option(a,c)+"<div>").append(e('<div class="dt-autofill-button">').append(e('<button class="'+j.classes.btn+'">'+a.i18n("autoFill.button",">")+"</button>").on("click",function(){var f=d[h].execute(a,c,e(this).closest("li"));b._update(f,c);b.dom.background.remove();b.dom.list.remove()}))))});this.dom.background.appendTo("body");this.dom.list.appendTo("body");this.dom.list.css("margin-top",-1*(this.dom.list.outerHeight()/
|
||||
2))}},_detach:function(){this.dom.attachedTo=null;this.dom.handle.detach()},_drawSelection:function(c){var b=this.s.dt,a=this.s.start,d=e(this.dom.start),f=e(c),h={row:b.rows({page:"current"}).nodes().indexOf(f.parent()[0]),column:f.index()},c=b.column.index("toData",h.column);if(b.cell(f).any()&&-1!==b.columns(this.c.columns).indexes().indexOf(c)){this.s.end=h;var g,b=a.row<h.row?d:f;g=a.row<h.row?f:d;c=a.column<h.column?d:f;d=a.column<h.column?f:d;b=this._getPosition(b).top;c=this._getPosition(c).left;
|
||||
a=this._getPosition(g).top+g.outerHeight()-b;d=this._getPosition(d).left+d.outerWidth()-c;f=this.dom.select;f.top.css({top:b,left:c,width:d});f.left.css({top:b,left:c,height:a});f.bottom.css({top:b+a,left:c,width:d});f.right.css({top:b,left:c+d,height:a})}},_editor:function(c){var b=this.s.dt,a=this.c.editor;if(a){for(var d={},f=[],e=a.fields(),g=0,i=c.length;g<i;g++)for(var j=0,l=c[g].length;j<l;j++){var o=c[g][j],k=b.settings()[0].aoColumns[o.index.column],n=k.editField;if(n===q)for(var k=k.mData,
|
||||
m=0,p=e.length;m<p;m++){var r=a.field(e[m]);if(r.dataSrc()===k){n=r.name();break}}if(!n)throw"Could not automatically determine field data. Please see https://datatables.net/tn/11";d[n]||(d[n]={});k=b.row(o.index.row).id();d[n][k]=o.set;f.push(o.index)}a.bubble(f,!1).multiSet(d).submit()}},_emitEvent:function(c,b){this.s.dt.iterator("table",function(a){e(a.nTable).triggerHandler(c+".dt",b)})},_focusListener:function(){var c=this,b=this.s.dt,a=this.s.namespace,d=null!==this.c.focus?this.c.focus:b.init().keys||
|
||||
b.settings()[0].keytable?"focus":"hover";if("focus"===d)b.on("key-focus.autoFill",function(b,a,d){c._attach(d.node())}).on("key-blur.autoFill",function(){c._detach()});else if("click"===d)e(b.table().body()).on("click"+a,"td, th",function(){c._attach(this)}),e(i.body).on("click"+a,function(a){e(a.target).parents().filter(b.table().body()).length||c._detach()});else e(b.table().body()).on("mouseenter"+a,"td, th",function(){c._attach(this)}).on("mouseleave"+a,function(b){e(b.relatedTarget).hasClass("dt-autofill-handle")||
|
||||
c._detach()})},_focusListenerRemove:function(){var c=this.s.dt;c.off(".autoFill");e(c.table().body()).off(this.s.namespace);e(i.body).off(this.s.namespace)},_getPosition:function(c,b){var a=e(c),d,f,h=0,g=0;b||(b=e(this.s.dt.table().node()).offsetParent());do{f=a.position();d=a.offsetParent();h+=f.top+d.scrollTop();g+=f.left+d.scrollLeft();if("body"===a.get(0).nodeName.toLowerCase())break;a=d}while(d.get(0)!==b.get(0));return{top:h,left:g}},_mousedown:function(c){var b=this,a=this.s.dt;this.dom.start=
|
||||
this.dom.attachedTo;this.s.start={row:a.rows({page:"current"}).nodes().indexOf(e(this.dom.start).parent()[0]),column:e(this.dom.start).index()};e(i.body).on("mousemove.autoFill",function(a){b._mousemove(a)}).on("mouseup.autoFill",function(a){b._mouseup(a)});var d=this.dom.select,a=e(a.table().node()).offsetParent();d.top.appendTo(a);d.left.appendTo(a);d.right.appendTo(a);d.bottom.appendTo(a);this._drawSelection(this.dom.start,c);this.dom.handle.css("display","none");c=this.dom.dtScroll;this.s.scroll=
|
||||
{windowHeight:e(l).height(),windowWidth:e(l).width(),dtTop:c?c.offset().top:null,dtLeft:c?c.offset().left:null,dtHeight:c?c.outerHeight():null,dtWidth:c?c.outerWidth():null}},_mousemove:function(c){var b=c.target.nodeName.toLowerCase();"td"!==b&&"th"!==b||(this._drawSelection(c.target,c),this._shiftScroll(c))},_mouseup:function(){e(i.body).off(".autoFill");var c=this.s.dt,b=this.dom.select;b.top.remove();b.left.remove();b.right.remove();b.bottom.remove();this.dom.handle.css("display","block");var b=
|
||||
this.s.start,a=this.s.end;if(!(b.row===a.row&&b.column===a.column)){for(var d=this._range(b.row,a.row),b=this._range(b.column,a.column),a=[],f=c.settings()[0],h=f.aoColumns,g=0;g<d.length;g++)a.push(e.map(b,function(a){var a=c.cell(":eq("+d[g]+")",a+":visible",{page:"current"}),b=a.data(),e=a.index(),i=h[e.column].editField;i!==q&&(b=f.oApi._fnGetObjectDataFn(i)(c.row(e.row).data()));return{cell:a,data:b,label:a.data(),index:e}}));this._actionSelector(a);clearInterval(this.s.scrollInterval);this.s.scrollInterval=
|
||||
null}},_range:function(c,b){var a=[],d;if(c<=b)for(d=c;d<=b;d++)a.push(d);else for(d=c;d>=b;d--)a.push(d);return a},_shiftScroll:function(c){var b=this,a=this.s.scroll,d=!1,f=c.pageY-i.body.scrollTop,e=c.pageX-i.body.scrollLeft,g,j,k,l;65>f?g=-5:f>a.windowHeight-65&&(g=5);65>e?j=-5:e>a.windowWidth-65&&(j=5);null!==a.dtTop&&c.pageY<a.dtTop+65?k=-5:null!==a.dtTop&&c.pageY>a.dtTop+a.dtHeight-65&&(k=5);null!==a.dtLeft&&c.pageX<a.dtLeft+65?l=-5:null!==a.dtLeft&&c.pageX>a.dtLeft+a.dtWidth-65&&(l=5);g||
|
||||
j||k||l?(a.windowVert=g,a.windowHoriz=j,a.dtVert=k,a.dtHoriz=l,d=!0):this.s.scrollInterval&&(clearInterval(this.s.scrollInterval),this.s.scrollInterval=null);!this.s.scrollInterval&&d&&(this.s.scrollInterval=setInterval(function(){if(a.windowVert)i.body.scrollTop=i.body.scrollTop+a.windowVert;if(a.windowHoriz)i.body.scrollLeft=i.body.scrollLeft+a.windowHoriz;if(a.dtVert||a.dtHoriz){var c=b.dom.dtScroll[0];if(a.dtVert)c.scrollTop=c.scrollTop+a.dtVert;if(a.dtHoriz)c.scrollLeft=c.scrollLeft+a.dtHoriz}},
|
||||
20))},_update:function(c,b){if(!1!==c){var a=this.s.dt,d;this._emitEvent("preAutoFill",[a,b]);this._editor(b);if(null!==this.c.update?this.c.update:!this.c.editor){for(var f=0,e=b.length;f<e;f++)for(var g=0,i=b[f].length;g<i;g++)d=b[f][g],d.cell.data(d.set);a.draw(!1)}this._emitEvent("autoFill",[a,b])}}});j.actions={increment:{available:function(c,b){return e.isNumeric(b[0][0].label)},option:function(c){return c.i18n("autoFill.increment",'Increment / decrement each cell by: <input type="number" value="1">')},
|
||||
execute:function(c,b,a){for(var c=1*b[0][0].data,a=1*e("input",a).val(),d=0,f=b.length;d<f;d++)for(var h=0,g=b[d].length;h<g;h++)b[d][h].set=c,c+=a}},fill:{available:function(){return!0},option:function(c,b){return c.i18n("autoFill.fill","Fill all cells with <i>"+b[0][0].label+"</i>")},execute:function(c,b){for(var a=b[0][0].data,d=0,e=b.length;d<e;d++)for(var h=0,g=b[d].length;h<g;h++)b[d][h].set=a}},fillHorizontal:{available:function(c,b){return 1<b.length&&1<b[0].length},option:function(c){return c.i18n("autoFill.fillHorizontal",
|
||||
"Fill cells horizontally")},execute:function(c,b){for(var a=0,d=b.length;a<d;a++)for(var e=0,h=b[a].length;e<h;e++)b[a][e].set=b[a][0].data}},fillVertical:{available:function(c,b){return 1<b.length&&1<b[0].length},option:function(c){return c.i18n("autoFill.fillVertical","Fill cells vertically")},execute:function(c,b){for(var a=0,d=b.length;a<d;a++)for(var e=0,h=b[a].length;e<h;e++)b[a][e].set=b[0][e].data}},cancel:{available:function(){return!1},option:function(c){return c.i18n("autoFill.cancel",
|
||||
"Cancel")},execute:function(){return!1}}};j.version="2.2.2";j.defaults={alwaysAsk:!1,focus:null,columns:"",enable:!0,update:null,editor:null};j.classes={btn:"btn"};var m=e.fn.dataTable.Api;m.register("autoFill()",function(){return this});m.register("autoFill().enabled()",function(){var c=this.context[0];return c.autoFill?c.autoFill.enabled():!1});m.register("autoFill().enable()",function(c){return this.iterator("table",function(b){b.autoFill&&b.autoFill.enable(c)})});m.register("autoFill().disable()",
|
||||
function(){return this.iterator("table",function(c){c.autoFill&&c.autoFill.disable()})});e(i).on("preInit.dt.autofill",function(c,b){if("dt"===c.namespace){var a=b.oInit.autoFill,d=k.defaults.autoFill;if(a||d)d=e.extend({},a,d),!1!==a&&new j(b,d)}});k.AutoFill=j;return k.AutoFill=j});
|
||||
8
public/assets/js/datatable/datatable-extension/dataTables.bootstrap4.min.js
vendored
Normal file
8
public/assets/js/datatable/datatable-extension/dataTables.bootstrap4.min.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
DataTables Bootstrap 3 integration
|
||||
©2011-2015 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d,m){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
||||
renderer:"bootstrap"});b.extend(f.ext.classes,{sWrapper:"dataTables_wrapper container-fluid dt-bootstrap4",sFilterInput:"form-control form-control-sm",sLengthSelect:"form-control form-control-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,s,j,n){var o=new f.Api(a),t=a.oClasses,k=a.oLanguage.oPaginate,u=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&
|
||||
o.page()!=a.data.action&&o.page(a.data.action).draw("page")};l=0;for(h=f.length;l<h;l++)if(c=f[l],b.isArray(c))q(d,c);else{g=e="";switch(c){case "ellipsis":e="…";g="disabled";break;case "first":e=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":e=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":e=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":e=k.sLast;g=c+(j<n-1?"":" disabled");break;default:e=c+1,g=j===c?"active":""}e&&(i=b("<li>",{"class":t.sPageButton+" "+g,id:0===r&&
|
||||
"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#","aria-controls":a.sTableId,"aria-label":u[c],"data-dt-idx":p,tabindex:a.iTabIndex,"class":"page-link"}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(v){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),s);i!==m&&b(h).find("[data-dt-idx="+i+"]").focus()};return f});
|
||||
39
public/assets/js/datatable/datatable-extension/dataTables.buttons.min.js
vendored
Normal file
39
public/assets/js/datatable/datatable-extension/dataTables.buttons.min.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
/*!
|
||||
Buttons for DataTables 1.5.1
|
||||
©2016-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(o){return d(o,window,document)}):"object"===typeof exports?module.exports=function(o,n){o||(o=window);if(!n||!n.fn.dataTable)n=require("datatables.net")(o,n).$;return d(n,o,o.document)}:d(jQuery,window,document)})(function(d,o,n,l){var i=d.fn.dataTable,x=0,y=0,j=i.ext.buttons,m=function(a,b){"undefined"===typeof b&&(b={});!0===b&&(b={});d.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},m.defaults,b);
|
||||
b.buttons&&(this.c.buttons=b.buttons);this.s={dt:new i.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+x++};this.dom={container:d("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(m.prototype,{action:function(a,b){var c=this._nodeToButton(a);if(b===l)return c.conf.action;c.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.button.active,c=d(c.node);if(b===l)return c.hasClass(e);c.toggleClass(e,b===l?!0:
|
||||
b);return this},add:function(a,b){var c=this.s.buttons;if("string"===typeof b){for(var e=b.split("-"),c=this.s,d=0,g=e.length-1;d<g;d++)c=c.buttons[1*e[d]];c=c.buttons;b=1*e[e.length-1]}this._expandButton(c,a,!1,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);d(a.node).addClass(this.c.dom.button.disabled);return this},destroy:function(){d("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b,c;b=0;for(c=a.length;b<
|
||||
c;b++)this.remove(a[b].node);this.dom.container.remove();a=this.s.dt.settings()[0];b=0;for(c=a.length;b<c;b++)if(a.inst===this){a.splice(b,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);var c=this._nodeToButton(a);d(c.node).removeClass(this.c.dom.button.disabled);return this},name:function(){return this.c.name},node:function(a){a=this._nodeToButton(a);return d(a.node)},processing:function(a,b){var c=this._nodeToButton(a);if(b===l)return d(c.node).hasClass("processing");
|
||||
d(c.node).toggleClass("processing",b);return this},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),e=this.s.dt;if(b.buttons.length)for(var h=b.buttons.length-1;0<=h;h--)this.remove(b.buttons[h].node);b.conf.destroy&&b.conf.destroy.call(e.button(a),e,d(a),b.conf);this._removeKey(b.conf);d(b.node).remove();a=d.inArray(b,c);c.splice(a,1);return this},text:function(a,b){var c=this._nodeToButton(a),e=this.c.dom.collection.buttonLiner,e=c.inCollection&&e&&e.tag?e.tag:this.c.dom.buttonLiner.tag,
|
||||
h=this.s.dt,g=d(c.node),f=function(a){return"function"===typeof a?a(h,g,c.conf):a};if(b===l)return f(c.conf.text);c.conf.text=b;e?g.children(e).html(f(b)):g.html(f(b));return this},_constructor:function(){var a=this,b=this.s.dt,c=b.settings()[0],e=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var c=0,h=e.length;c<h;c++)this.add(e[c]);b.on("destroy",function(){a.destroy()});d("body").on("keyup."+this.s.namespace,function(b){if(!n.activeElement||n.activeElement===
|
||||
n.body){var c=String.fromCharCode(b.keyCode).toLowerCase();a.s.listenKeys.toLowerCase().indexOf(c)!==-1&&a._keypress(c,b)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=d.isPlainObject(a.key)?a.key.key:a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,e=b.length;c<e;c++)a.append(b[c].inserter),a.append(" "),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,e){for(var h=this.s.dt,g=0,
|
||||
b=!d.isArray(b)?[b]:b,f=0,q=b.length;f<q;f++){var k=this._resolveExtends(b[f]);if(k)if(d.isArray(k))this._expandButton(a,k,c,e);else{var p=this._buildButton(k,c);if(p){e!==l?(a.splice(e,0,p),e++):a.push(p);if(p.conf.buttons){var u=this.c.dom.collection;p.collection=d("<"+u.tag+"/>").addClass(u.className).attr("role","menu");p.conf._collection=p.collection;this._expandButton(p.buttons,p.conf.buttons,!0,e)}k.init&&k.init.call(h.button(p.node),h,d(p.node),k);g++}}}},_buildButton:function(a,b){var c=
|
||||
this.c.dom.button,e=this.c.dom.buttonLiner,h=this.c.dom.collection,g=this.s.dt,f=function(b){return"function"===typeof b?b(g,k,a):b};b&&h.button&&(c=h.button);b&&h.buttonLiner&&(e=h.buttonLiner);if(a.available&&!a.available(g,a))return!1;var q=function(a,b,c,e){e.action.call(b.button(c),a,b,c,e);d(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),b,c,e])},k=d("<"+c.tag+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",
|
||||
function(b){b.preventDefault();!k.hasClass(c.disabled)&&a.action&&q(b,g,k,a);k.blur()}).on("keyup.dtb",function(b){b.keyCode===13&&!k.hasClass(c.disabled)&&a.action&&q(b,g,k,a)});"a"===c.tag.toLowerCase()&&k.attr("href","#");e.tag?(h=d("<"+e.tag+"/>").html(f(a.text)).addClass(e.className),"a"===e.tag.toLowerCase()&&h.attr("href","#"),k.append(h)):k.html(f(a.text));!1===a.enabled&&k.addClass(c.disabled);a.className&&k.addClass(a.className);a.titleAttr&&k.attr("title",f(a.titleAttr));a.attr&&k.attr(a.attr);
|
||||
a.namespace||(a.namespace=".dt-button-"+y++);e=(e=this.c.dom.buttonContainer)&&e.tag?d("<"+e.tag+"/>").addClass(e.className).append(k):k;this._addKey(a);return{conf:a,node:k.get(0),inserter:e,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,b){b||(b=this.s.buttons);for(var c=0,e=b.length;c<e;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var d=this._nodeToButton(a,b[c].buttons);if(d)return d}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,e=b.length;c<
|
||||
e;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var d=this._nodeToHost(a,b[c].buttons);if(d)return d}}},_keypress:function(a,b){if(!b._buttonsHandled){var c=function(e){for(var h=0,g=e.length;h<g;h++){var f=e[h].conf,q=e[h].node;if(f.key)if(f.key===a)b._buttonsHandled=!0,d(q).click();else if(d.isPlainObject(f.key)&&f.key.key===a&&(!f.key.shiftKey||b.shiftKey))if(!f.key.altKey||b.altKey)if(!f.key.ctrlKey||b.ctrlKey)if(!f.key.metaKey||b.metaKey)b._buttonsHandled=!0,d(q).click();e[h].buttons.length&&
|
||||
c(e[h].buttons)}};c(this.s.buttons)}},_removeKey:function(a){if(a.key){var b=d.isPlainObject(a.key)?a.key.key:a.key,a=this.s.listenKeys.split(""),b=d.inArray(b,a);a.splice(b,1);this.s.listenKeys=a.join("")}},_resolveExtends:function(a){for(var b=this.s.dt,c,e,h=function(c){for(var e=0;!d.isPlainObject(c)&&!d.isArray(c);){if(c===l)return;if("function"===typeof c){if(c=c(b,a),!c)return!1}else if("string"===typeof c){if(!j[c])throw"Unknown button type: "+c;c=j[c]}e++;if(30<e)throw"Buttons: Too many iterations";
|
||||
}return d.isArray(c)?c:d.extend({},c)},a=h(a);a&&a.extend;){if(!j[a.extend])throw"Cannot extend unknown button type: "+a.extend;var g=h(j[a.extend]);if(d.isArray(g))return g;if(!g)return!1;c=g.className;a=d.extend({},g,a);c&&a.className!==c&&(a.className=c+" "+a.className);var f=a.postfixButtons;if(f){a.buttons||(a.buttons=[]);c=0;for(e=f.length;c<e;c++)a.buttons.push(f[c]);a.postfixButtons=null}if(f=a.prefixButtons){a.buttons||(a.buttons=[]);c=0;for(e=f.length;c<e;c++)a.buttons.splice(c,0,f[c]);
|
||||
a.prefixButtons=null}a.extend=g.extend}return a}});m.background=function(a,b,c){c===l&&(c=400);a?d("<div/>").addClass(b).css("display","none").appendTo("body").fadeIn(c):d("body > div."+b).fadeOut(c,function(){d(this).removeClass(b).remove()})};m.instanceSelector=function(a,b){if(!a)return d.map(b,function(a){return a.inst});var c=[],e=d.map(b,function(a){return a.name}),h=function(a){if(d.isArray(a))for(var f=0,q=a.length;f<q;f++)h(a[f]);else"string"===typeof a?-1!==a.indexOf(",")?h(a.split(",")):
|
||||
(a=d.inArray(d.trim(a),e),-1!==a&&c.push(b[a].inst)):"number"===typeof a&&c.push(b[a].inst)};h(a);return c};m.buttonSelector=function(a,b){for(var c=[],e=function(a,b,c){for(var d,f,h=0,g=b.length;h<g;h++)if(d=b[h])f=c!==l?c+h:h+"",a.push({node:d.node,name:d.conf.name,idx:f}),d.buttons&&e(a,d.buttons,f+"-")},h=function(a,b){var f,g,i=[];e(i,b.s.buttons);f=d.map(i,function(a){return a.node});if(d.isArray(a)||a instanceof d){f=0;for(g=a.length;f<g;f++)h(a[f],b)}else if(null===a||a===l||"*"===a){f=0;
|
||||
for(g=i.length;f<g;f++)c.push({inst:b,node:i[f].node})}else if("number"===typeof a)c.push({inst:b,node:b.s.buttons[a].node});else if("string"===typeof a)if(-1!==a.indexOf(",")){i=a.split(",");f=0;for(g=i.length;f<g;f++)h(d.trim(i[f]),b)}else if(a.match(/^\d+(\-\d+)*$/))f=d.map(i,function(a){return a.idx}),c.push({inst:b,node:i[d.inArray(a,f)].node});else if(-1!==a.indexOf(":name")){var j=a.replace(":name","");f=0;for(g=i.length;f<g;f++)i[f].name===j&&c.push({inst:b,node:i[f].node})}else d(f).filter(a).each(function(){c.push({inst:b,
|
||||
node:this})});else"object"===typeof a&&a.nodeName&&(i=d.inArray(a,f),-1!==i&&c.push({inst:b,node:f[i]}))},g=0,f=a.length;g<f;g++)h(b,a[g]);return c};m.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:"dt-button-collection"},button:{tag:"button",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};m.version="1.5.1";d.extend(j,{collection:{text:function(a){return a.i18n("buttons.collection",
|
||||
"Collection")},className:"buttons-collection",action:function(a,b,c,e){var h=d(c).parents("div.dt-button-collection"),a=c.position(),g=d(b.table().container()),f=!1,i=c;h.length&&(f=d(".dt-button-collection").position(),i=h,d("body").trigger("click.dtb-collection"));e._collection.addClass(e.collectionLayout).css("display","none").insertAfter(i).fadeIn(e.fade);h=e._collection.css("position");f&&"absolute"===h?e._collection.css({top:f.top,left:f.left}):"absolute"===h?(e._collection.css({top:a.top+c.outerHeight(),
|
||||
left:a.left}),f=g.offset().top+g.height(),c=a.top+c.outerHeight()+e._collection.outerHeight()-f,f=a.top-e._collection.outerHeight(),f=g.offset().top-f,c>f&&e._collection.css("top",a.top-e._collection.outerHeight()-5),c=a.left+e._collection.outerWidth(),g=g.offset().left+g.width(),c>g&&e._collection.css("left",a.left-(c-g))):(a=e._collection.height()/2,a>d(o).height()/2&&(a=d(o).height()/2),e._collection.css("marginTop",-1*a));e.background&&m.background(!0,e.backgroundClassName,e.fade);setTimeout(function(){d("div.dt-button-background").on("click.dtb-collection",
|
||||
function(){});d("body").on("click.dtb-collection",function(a){var c=d.fn.addBack?"addBack":"andSelf";if(!d(a.target).parents()[c]().filter(e._collection).length){e._collection.fadeOut(e.fade,function(){e._collection.detach()});d("div.dt-button-background").off("click.dtb-collection");m.background(false,e.backgroundClassName,e.fade);d("body").off("click.dtb-collection");b.off("buttons-action.b-internal")}})},10);if(e.autoClose)b.on("buttons-action.b-internal",function(){d("div.dt-button-background").click()})},
|
||||
background:!0,collectionLayout:"",backgroundClassName:"dt-button-background",autoClose:!1,fade:400,attr:{"aria-haspopup":!0}},copy:function(a,b){if(j.copyHtml5)return"copyHtml5";if(j.copyFlash&&j.copyFlash.available(a,b))return"copyFlash"},csv:function(a,b){if(j.csvHtml5&&j.csvHtml5.available(a,b))return"csvHtml5";if(j.csvFlash&&j.csvFlash.available(a,b))return"csvFlash"},excel:function(a,b){if(j.excelHtml5&&j.excelHtml5.available(a,b))return"excelHtml5";if(j.excelFlash&&j.excelFlash.available(a,
|
||||
b))return"excelFlash"},pdf:function(a,b){if(j.pdfHtml5&&j.pdfHtml5.available(a,b))return"pdfHtml5";if(j.pdfFlash&&j.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){var a=a.settings()[0].aLengthMenu,b=d.isArray(a[0])?a[0]:a,c=d.isArray(a[0])?a[1]:a,e=function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},a.page.len())};return{extend:"collection",text:e,className:"buttons-page-length",autoClose:!0,buttons:d.map(b,function(a,b){return{text:c[b],className:"button-page-length",
|
||||
action:function(b,c){c.page.len(a).draw()},init:function(b,c,d){var e=this,c=function(){e.active(b.page.len()===a)};b.on("length.dt"+d.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),init:function(a,b,c){var d=this;a.on("length.dt"+c.namespace,function(){d.text(e(a))})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});i.Api.register("buttons()",function(a,b){b===l&&(b=a,a=l);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(c){if(c._buttons)return m.buttonSelector(m.instanceSelector(a,
|
||||
c._buttons),b)},!0);c._groupSelector=a;return c});i.Api.register("button()",function(a,b){var c=this.buttons(a,b);1<c.length&&c.splice(1,c.length);return c});i.Api.registerPlural("buttons().active()","button().active()",function(a){return a===l?this.map(function(a){return a.inst.active(a.node)}):this.each(function(b){b.inst.active(b.node,a)})});i.Api.registerPlural("buttons().action()","button().action()",function(a){return a===l?this.map(function(a){return a.inst.action(a.node)}):this.each(function(b){b.inst.action(b.node,
|
||||
a)})});i.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});i.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});i.Api.registerPlural("buttons().nodes()","button().node()",function(){var a=d();d(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});i.Api.registerPlural("buttons().processing()","button().processing()",function(a){return a===
|
||||
l?this.map(function(a){return a.inst.processing(a.node)}):this.each(function(b){b.inst.processing(b.node,a)})});i.Api.registerPlural("buttons().text()","button().text()",function(a){return a===l?this.map(function(a){return a.inst.text(a.node)}):this.each(function(b){b.inst.text(b.node,a)})});i.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});i.Api.registerPlural("buttons().containers()","buttons().container()",
|
||||
function(){var a=d(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons)for(var c=m.instanceSelector(b,c._buttons),d=0,h=c.length;d<h;d++)a=a.add(c[d].container())});return a});i.Api.register("button().add()",function(a,b){var c=this.context;c.length&&(c=m.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b,a));return this.button(this._groupSelector,a)});i.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});
|
||||
return this});i.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var r;i.Api.register("buttons.info()",function(a,b,c){var e=this;if(!1===a)return d("#datatables_buttons_info").fadeOut(function(){d(this).remove()}),clearTimeout(r),r=null,this;r&&clearTimeout(r);d("#datatables_buttons_info").length&&d("#datatables_buttons_info").remove();d('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a?"<h2>"+a+
|
||||
"</h2>":"").append(d("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body").fadeIn();c!==l&&0!==c&&(r=setTimeout(function(){e.buttons.info(!1)},c));return this});i.Api.register("buttons.exportData()",function(a){if(this.context.length){var b=new i.Api(this.context[0]),c=d.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return e(a)},
|
||||
footer:function(a){return e(a)},body:function(a){return e(a)}}},a),e=function(a){if("string"!==typeof a)return a;a=a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&(a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(v.innerHTML=a,a=v.value);return a},a=b.columns(c.columns).indexes().map(function(a){var d=b.column(a).header();return c.format.header(d.innerHTML,a,d)}).toArray(),h=b.table().footer()?
|
||||
b.columns(c.columns).indexes().map(function(a){var d=b.column(a).footer();return c.format.footer(d?d.innerHTML:"",a,d)}).toArray():null,g=d.extend({},c.modifier);b.select&&"function"===typeof b.select.info&&g.selected===l&&b.rows(c.rows,d.extend({selected:!0},g)).any()&&d.extend(g,{selected:!0});for(var g=b.rows(c.rows,g).indexes().toArray(),f=b.cells(g,c.columns),g=f.render(c.orthogonal).toArray(),f=f.nodes().toArray(),j=a.length,k=0<j?g.length/j:0,m=[k],o=0,n=0;n<k;n++){for(var r=[j],s=0;s<j;s++)r[s]=
|
||||
c.format.body(g[o],n,s,f[o]),o++;m[n]=r}return{header:a,footer:h,body:m}}});i.Api.register("buttons.exportInfo()",function(a){a||(a={});var b;var c=a;b="*"===c.filename&&"*"!==c.title&&c.title!==l&&null!==c.title&&""!==c.title?c.title:c.filename;"function"===typeof b&&(b=b());b===l||null===b?b=null:(-1!==b.indexOf("*")&&(b=d.trim(b.replace("*",d("head > title").text()))),b=b.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(c=t(c.extension))||(c=""),b+=c);c=t(a.title);c=null===c?null:-1!==c.indexOf("*")?
|
||||
c.replace("*",d("head > title").text()||"Exported data"):c;return{filename:b,title:c,messageTop:w(this,a.message||a.messageTop,"top"),messageBottom:w(this,a.messageBottom,"bottom")}});var t=function(a){return null===a||a===l?null:"function"===typeof a?a():a},w=function(a,b,c){b=t(b);if(null===b)return null;a=d("caption",a.table().container()).eq(0);return"*"===b?a.css("caption-side")!==c?null:a.length?a.text():"":b},v=d("<textarea/>")[0];d.fn.dataTable.Buttons=m;d.fn.DataTable.Buttons=m;d(n).on("init.dt plugin-init.dt",
|
||||
function(a,b){if("dt"===a.namespace){var c=b.oInit.buttons||i.defaults.buttons;c&&!b._buttons&&(new m(b,c)).container()}});i.ext.feature.push({fnInit:function(a){var a=new i.Api(a),b=a.init().buttons||i.defaults.buttons;return(new m(a,b)).container()},cFeature:"B"});return m});
|
||||
27
public/assets/js/datatable/datatable-extension/dataTables.colReorder.min.js
vendored
Normal file
27
public/assets/js/datatable/datatable-extension/dataTables.colReorder.min.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/*!
|
||||
ColReorder 1.4.1
|
||||
©2010-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(o){return f(o,window,document)}):"object"===typeof exports?module.exports=function(o,l){o||(o=window);if(!l||!l.fn.dataTable)l=require("datatables.net")(o,l).$;return f(l,o,o.document)}:f(jQuery,window,document)})(function(f,o,l,r){function q(a){for(var b=[],c=0,e=a.length;c<e;c++)b[a[c]]=c;return b}function p(a,b,c){b=a.splice(b,1)[0];a.splice(c,0,b)}function s(a,b,c){for(var e=[],f=0,d=a.childNodes.length;f<
|
||||
d;f++)1==a.childNodes[f].nodeType&&e.push(a.childNodes[f]);b=e[b];null!==c?a.insertBefore(b,e[c]):a.appendChild(b)}var t=f.fn.dataTable;f.fn.dataTableExt.oApi.fnColReorder=function(a,b,c,e,g){var d,h,j,m,i,l=a.aoColumns.length,k;i=function(a,b,d){if(a[b]&&"function"!==typeof a[b]){var c=a[b].split("."),e=c.shift();isNaN(1*e)||(a[b]=d[1*e]+"."+c.join("."))}};if(b!=c)if(0>b||b>=l)this.oApi._fnLog(a,1,"ColReorder 'from' index is out of bounds: "+b);else if(0>c||c>=l)this.oApi._fnLog(a,1,"ColReorder 'to' index is out of bounds: "+
|
||||
c);else{j=[];d=0;for(h=l;d<h;d++)j[d]=d;p(j,b,c);var n=q(j);d=0;for(h=a.aaSorting.length;d<h;d++)a.aaSorting[d][0]=n[a.aaSorting[d][0]];if(null!==a.aaSortingFixed){d=0;for(h=a.aaSortingFixed.length;d<h;d++)a.aaSortingFixed[d][0]=n[a.aaSortingFixed[d][0]]}d=0;for(h=l;d<h;d++){k=a.aoColumns[d];j=0;for(m=k.aDataSort.length;j<m;j++)k.aDataSort[j]=n[k.aDataSort[j]];k.idx=n[k.idx]}f.each(a.aLastSort,function(b,c){a.aLastSort[b].src=n[c.src]});d=0;for(h=l;d<h;d++)k=a.aoColumns[d],"number"==typeof k.mData?
|
||||
k.mData=n[k.mData]:f.isPlainObject(k.mData)&&(i(k.mData,"_",n),i(k.mData,"filter",n),i(k.mData,"sort",n),i(k.mData,"type",n));if(a.aoColumns[b].bVisible){i=this.oApi._fnColumnIndexToVisible(a,b);m=null;for(d=c<b?c:c+1;null===m&&d<l;)m=this.oApi._fnColumnIndexToVisible(a,d),d++;j=a.nTHead.getElementsByTagName("tr");d=0;for(h=j.length;d<h;d++)s(j[d],i,m);if(null!==a.nTFoot){j=a.nTFoot.getElementsByTagName("tr");d=0;for(h=j.length;d<h;d++)s(j[d],i,m)}d=0;for(h=a.aoData.length;d<h;d++)null!==a.aoData[d].nTr&&
|
||||
s(a.aoData[d].nTr,i,m)}p(a.aoColumns,b,c);d=0;for(h=l;d<h;d++)a.oApi._fnColumnOptions(a,d,{});p(a.aoPreSearchCols,b,c);d=0;for(h=a.aoData.length;d<h;d++){m=a.aoData[d];if(k=m.anCells){p(k,b,c);j=0;for(i=k.length;j<i;j++)k[j]&&k[j]._DT_CellIndex&&(k[j]._DT_CellIndex.column=j)}"dom"!==m.src&&f.isArray(m._aData)&&p(m._aData,b,c)}d=0;for(h=a.aoHeader.length;d<h;d++)p(a.aoHeader[d],b,c);if(null!==a.aoFooter){d=0;for(h=a.aoFooter.length;d<h;d++)p(a.aoFooter[d],b,c)}(g||g===r)&&f.fn.dataTable.Api(a).rows().invalidate();
|
||||
d=0;for(h=l;d<h;d++)f(a.aoColumns[d].nTh).off("click.DT"),this.oApi._fnSortAttachListener(a,a.aoColumns[d].nTh,d);f(a.oInstance).trigger("column-reorder.dt",[a,{from:b,to:c,mapping:n,drop:e,iFrom:b,iTo:c,aiInvertMapping:n}])}};var i=function(a,b){var c=(new f.fn.dataTable.Api(a)).settings()[0];if(c._colReorder)return c._colReorder;!0===b&&(b={});var e=f.fn.dataTable.camelToHungarian;e&&(e(i.defaults,i.defaults,!0),e(i.defaults,b||{}));this.s={dt:null,init:f.extend(!0,{},i.defaults,b),fixed:0,fixedRight:0,
|
||||
reorderCallback:null,mouse:{startX:-1,startY:-1,offsetX:-1,offsetY:-1,target:-1,targetIndex:-1,fromIndex:-1},aoTargets:[]};this.dom={drag:null,pointer:null};this.s.dt=c;this.s.dt._colReorder=this;this._fnConstruct();return this};f.extend(i.prototype,{fnReset:function(){this._fnOrderColumns(this.fnOrder());return this},fnGetCurrentOrder:function(){return this.fnOrder()},fnOrder:function(a,b){var c=[],e,g,d=this.s.dt.aoColumns;if(a===r){e=0;for(g=d.length;e<g;e++)c.push(d[e]._ColReorder_iOrigCol);return c}if(b){d=
|
||||
this.fnOrder();e=0;for(g=a.length;e<g;e++)c.push(f.inArray(a[e],d));a=c}this._fnOrderColumns(q(a));return this},fnTranspose:function(a,b){b||(b="toCurrent");var c=this.fnOrder(),e=this.s.dt.aoColumns;return"toCurrent"===b?!f.isArray(a)?f.inArray(a,c):f.map(a,function(a){return f.inArray(a,c)}):!f.isArray(a)?e[a]._ColReorder_iOrigCol:f.map(a,function(a){return e[a]._ColReorder_iOrigCol})},_fnConstruct:function(){var a=this,b=this.s.dt.aoColumns.length,c=this.s.dt.nTable,e;this.s.init.iFixedColumns&&
|
||||
(this.s.fixed=this.s.init.iFixedColumns);this.s.init.iFixedColumnsLeft&&(this.s.fixed=this.s.init.iFixedColumnsLeft);this.s.fixedRight=this.s.init.iFixedColumnsRight?this.s.init.iFixedColumnsRight:0;this.s.init.fnReorderCallback&&(this.s.reorderCallback=this.s.init.fnReorderCallback);for(e=0;e<b;e++)e>this.s.fixed-1&&e<b-this.s.fixedRight&&this._fnMouseListener(e,this.s.dt.aoColumns[e].nTh),this.s.dt.aoColumns[e]._ColReorder_iOrigCol=e;this.s.dt.oApi._fnCallbackReg(this.s.dt,"aoStateSaveParams",function(b,
|
||||
c){a._fnStateSave.call(a,c)},"ColReorder_State");var g=null;this.s.init.aiOrder&&(g=this.s.init.aiOrder.slice());this.s.dt.oLoadedState&&("undefined"!=typeof this.s.dt.oLoadedState.ColReorder&&this.s.dt.oLoadedState.ColReorder.length==this.s.dt.aoColumns.length)&&(g=this.s.dt.oLoadedState.ColReorder);if(g)if(a.s.dt._bInitComplete)b=q(g),a._fnOrderColumns.call(a,b);else{var d=!1;f(c).on("draw.dt.colReorder",function(){if(!a.s.dt._bInitComplete&&!d){d=true;var b=q(g);a._fnOrderColumns.call(a,b)}})}else this._fnSetColumnIndexes();
|
||||
f(c).on("destroy.dt.colReorder",function(){f(c).off("destroy.dt.colReorder draw.dt.colReorder");f(a.s.dt.nTHead).find("*").off(".ColReorder");f.each(a.s.dt.aoColumns,function(a,b){f(b.nTh).removeAttr("data-column-index")});a.s.dt._colReorder=null;a.s=null})},_fnOrderColumns:function(a){var b=!1;if(a.length!=this.s.dt.aoColumns.length)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"ColReorder - array reorder does not match known number of columns. Skipping.");else{for(var c=0,e=a.length;c<e;c++){var g=
|
||||
f.inArray(c,a);c!=g&&(p(a,g,c),this.s.dt.oInstance.fnColReorder(g,c,!0,!1),b=!0)}f.fn.dataTable.Api(this.s.dt).rows().invalidate();this._fnSetColumnIndexes();b&&((""!==this.s.dt.oScroll.sX||""!==this.s.dt.oScroll.sY)&&this.s.dt.oInstance.fnAdjustColumnSizing(!1),this.s.dt.oInstance.oApi._fnSaveState(this.s.dt),null!==this.s.reorderCallback&&this.s.reorderCallback.call(this))}},_fnStateSave:function(a){var b,c,e,g=this.s.dt.aoColumns;a.ColReorder=[];if(a.aaSorting){for(b=0;b<a.aaSorting.length;b++)a.aaSorting[b][0]=
|
||||
g[a.aaSorting[b][0]]._ColReorder_iOrigCol;var d=f.extend(!0,[],a.aoSearchCols);b=0;for(c=g.length;b<c;b++)e=g[b]._ColReorder_iOrigCol,a.aoSearchCols[e]=d[b],a.abVisCols[e]=g[b].bVisible,a.ColReorder.push(e)}else if(a.order){for(b=0;b<a.order.length;b++)a.order[b][0]=g[a.order[b][0]]._ColReorder_iOrigCol;d=f.extend(!0,[],a.columns);b=0;for(c=g.length;b<c;b++)e=g[b]._ColReorder_iOrigCol,a.columns[e]=d[b],a.ColReorder.push(e)}},_fnMouseListener:function(a,b){var c=this;f(b).on("mousedown.ColReorder",
|
||||
function(a){c._fnMouseDown.call(c,a,b)}).on("touchstart.ColReorder",function(a){c._fnMouseDown.call(c,a,b)})},_fnMouseDown:function(a,b){var c=this,e=f(a.target).closest("th, td").offset(),g=parseInt(f(b).attr("data-column-index"),10);g!==r&&(this.s.mouse.startX=this._fnCursorPosition(a,"pageX"),this.s.mouse.startY=this._fnCursorPosition(a,"pageY"),this.s.mouse.offsetX=this._fnCursorPosition(a,"pageX")-e.left,this.s.mouse.offsetY=this._fnCursorPosition(a,"pageY")-e.top,this.s.mouse.target=this.s.dt.aoColumns[g].nTh,
|
||||
this.s.mouse.targetIndex=g,this.s.mouse.fromIndex=g,this._fnRegions(),f(l).on("mousemove.ColReorder touchmove.ColReorder",function(a){c._fnMouseMove.call(c,a)}).on("mouseup.ColReorder touchend.ColReorder",function(a){c._fnMouseUp.call(c,a)}))},_fnMouseMove:function(a){if(null===this.dom.drag){if(5>Math.pow(Math.pow(this._fnCursorPosition(a,"pageX")-this.s.mouse.startX,2)+Math.pow(this._fnCursorPosition(a,"pageY")-this.s.mouse.startY,2),0.5))return;this._fnCreateDragNode()}this.dom.drag.css({left:this._fnCursorPosition(a,
|
||||
"pageX")-this.s.mouse.offsetX,top:this._fnCursorPosition(a,"pageY")-this.s.mouse.offsetY});for(var b=!1,c=this.s.mouse.toIndex,e=1,f=this.s.aoTargets.length;e<f;e++)if(this._fnCursorPosition(a,"pageX")<this.s.aoTargets[e-1].x+(this.s.aoTargets[e].x-this.s.aoTargets[e-1].x)/2){this.dom.pointer.css("left",this.s.aoTargets[e-1].x);this.s.mouse.toIndex=this.s.aoTargets[e-1].to;b=!0;break}b||(this.dom.pointer.css("left",this.s.aoTargets[this.s.aoTargets.length-1].x),this.s.mouse.toIndex=this.s.aoTargets[this.s.aoTargets.length-
|
||||
1].to);this.s.init.bRealtime&&c!==this.s.mouse.toIndex&&(this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex,this.s.mouse.toIndex,!1),this.s.mouse.fromIndex=this.s.mouse.toIndex,this._fnRegions())},_fnMouseUp:function(){f(l).off(".ColReorder");null!==this.dom.drag&&(this.dom.drag.remove(),this.dom.pointer.remove(),this.dom.drag=null,this.dom.pointer=null,this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex,this.s.mouse.toIndex,!0),this._fnSetColumnIndexes(),(""!==this.s.dt.oScroll.sX||""!==
|
||||
this.s.dt.oScroll.sY)&&this.s.dt.oInstance.fnAdjustColumnSizing(!1),this.s.dt.oInstance.oApi._fnSaveState(this.s.dt),null!==this.s.reorderCallback&&this.s.reorderCallback.call(this))},_fnRegions:function(){var a=this.s.dt.aoColumns;this.s.aoTargets.splice(0,this.s.aoTargets.length);this.s.aoTargets.push({x:f(this.s.dt.nTable).offset().left,to:0});for(var b=0,c=this.s.aoTargets[0].x,e=0,g=a.length;e<g;e++)e!=this.s.mouse.fromIndex&&b++,a[e].bVisible&&"none"!==a[e].nTh.style.display&&(c+=f(a[e].nTh).outerWidth(),
|
||||
this.s.aoTargets.push({x:c,to:b}));0!==this.s.fixedRight&&this.s.aoTargets.splice(this.s.aoTargets.length-this.s.fixedRight);0!==this.s.fixed&&this.s.aoTargets.splice(0,this.s.fixed)},_fnCreateDragNode:function(){var a=""!==this.s.dt.oScroll.sX||""!==this.s.dt.oScroll.sY,b=this.s.dt.aoColumns[this.s.mouse.targetIndex].nTh,c=b.parentNode,e=c.parentNode,g=e.parentNode,d=f(b).clone();this.dom.drag=f(g.cloneNode(!1)).addClass("DTCR_clonedTable").append(f(e.cloneNode(!1)).append(f(c.cloneNode(!1)).append(d[0]))).css({position:"absolute",
|
||||
top:0,left:0,width:f(b).outerWidth(),height:f(b).outerHeight()}).appendTo("body");this.dom.pointer=f("<div></div>").addClass("DTCR_pointer").css({position:"absolute",top:a?f("div.dataTables_scroll",this.s.dt.nTableWrapper).offset().top:f(this.s.dt.nTable).offset().top,height:a?f("div.dataTables_scroll",this.s.dt.nTableWrapper).height():f(this.s.dt.nTable).height()}).appendTo("body")},_fnSetColumnIndexes:function(){f.each(this.s.dt.aoColumns,function(a,b){f(b.nTh).attr("data-column-index",a)})},_fnCursorPosition:function(a,
|
||||
b){return-1!==a.type.indexOf("touch")?a.originalEvent.touches[0][b]:a[b]}});i.defaults={aiOrder:null,bRealtime:!0,iFixedColumnsLeft:0,iFixedColumnsRight:0,fnReorderCallback:null};i.version="1.4.1";f.fn.dataTable.ColReorder=i;f.fn.DataTable.ColReorder=i;"function"==typeof f.fn.dataTable&&"function"==typeof f.fn.dataTableExt.fnVersionCheck&&f.fn.dataTableExt.fnVersionCheck("1.10.8")?f.fn.dataTableExt.aoFeatures.push({fnInit:function(a){var b=a.oInstance;a._colReorder?b.oApi._fnLog(a,1,"ColReorder attempted to initialise twice. Ignoring second"):
|
||||
(b=a.oInit,new i(a,b.colReorder||b.oColReorder||{}));return null},cFeature:"R",sFeature:"ColReorder"}):alert("Warning: ColReorder requires DataTables 1.10.8 or greater - www.datatables.net/download");f(l).on("preInit.dt.colReorder",function(a,b){if("dt"===a.namespace){var c=b.oInit.colReorder,e=t.defaults.colReorder;if(c||e)e=f.extend({},c,e),!1!==c&&new i(b,e)}});f.fn.dataTable.Api.register("colReorder.reset()",function(){return this.iterator("table",function(a){a._colReorder.fnReset()})});f.fn.dataTable.Api.register("colReorder.order()",
|
||||
function(a,b){return a?this.iterator("table",function(c){c._colReorder.fnOrder(a,b)}):this.context.length?this.context[0]._colReorder.fnOrder():null});f.fn.dataTable.Api.register("colReorder.transpose()",function(a,b){return this.context.length&&this.context[0]._colReorder?this.context[0]._colReorder.fnTranspose(a,b):a});f.fn.dataTable.Api.register("colReorder.move()",function(a,b,c,e){this.context.length&&this.context[0]._colReorder.s.dt.oInstance.fnColReorder(a,b,c,e);return this});return i});
|
||||
18
public/assets/js/datatable/datatable-extension/dataTables.fixedHeader.min.js
vendored
Normal file
18
public/assets/js/datatable/datatable-extension/dataTables.fixedHeader.min.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/*!
|
||||
FixedHeader 3.1.3
|
||||
©2009-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(g){return d(g,window,document)}):"object"===typeof exports?module.exports=function(g,h){g||(g=window);if(!h||!h.fn.dataTable)h=require("datatables.net")(g,h).$;return d(h,g,g.document)}:d(jQuery,window,document)})(function(d,g,h,k){var j=d.fn.dataTable,l=0,i=function(b,a){if(!(this instanceof i))throw"FixedHeader must be initialised with the 'new' keyword.";!0===a&&(a={});b=new j.Api(b);this.c=d.extend(!0,
|
||||
{},i.defaults,a);this.s={dt:b,position:{theadTop:0,tbodyTop:0,tfootTop:0,tfootBottom:0,width:0,left:0,tfootHeight:0,theadHeight:0,windowHeight:d(g).height(),visible:!0},headerMode:null,footerMode:null,autoWidth:b.settings()[0].oFeatures.bAutoWidth,namespace:".dtfc"+l++,scrollLeft:{header:-1,footer:-1},enable:!0};this.dom={floatingHeader:null,thead:d(b.table().header()),tbody:d(b.table().body()),tfoot:d(b.table().footer()),header:{host:null,floating:null,placeholder:null},footer:{host:null,floating:null,
|
||||
placeholder:null}};this.dom.header.host=this.dom.thead.parent();this.dom.footer.host=this.dom.tfoot.parent();var e=b.settings()[0];if(e._fixedHeader)throw"FixedHeader already initialised on table "+e.nTable.id;e._fixedHeader=this;this._constructor()};d.extend(i.prototype,{enable:function(b){this.s.enable=b;this.c.header&&this._modeChange("in-place","header",!0);this.c.footer&&this.dom.tfoot.length&&this._modeChange("in-place","footer",!0);this.update()},headerOffset:function(b){b!==k&&(this.c.headerOffset=
|
||||
b,this.update());return this.c.headerOffset},footerOffset:function(b){b!==k&&(this.c.footerOffset=b,this.update());return this.c.footerOffset},update:function(){this._positions();this._scroll(!0)},_constructor:function(){var b=this,a=this.s.dt;d(g).on("scroll"+this.s.namespace,function(){b._scroll()}).on("resize"+this.s.namespace,function(){b.s.position.windowHeight=d(g).height();b.update()});var e=d(".fh-fixedHeader");!this.c.headerOffset&&e.length&&(this.c.headerOffset=e.outerHeight());e=d(".fh-fixedFooter");
|
||||
!this.c.footerOffset&&e.length&&(this.c.footerOffset=e.outerHeight());a.on("column-reorder.dt.dtfc column-visibility.dt.dtfc draw.dt.dtfc column-sizing.dt.dtfc",function(){b.update()});a.on("destroy.dtfc",function(){a.off(".dtfc");d(g).off(b.s.namespace)});this._positions();this._scroll()},_clone:function(b,a){var e=this.s.dt,c=this.dom[b],f="header"===b?this.dom.thead:this.dom.tfoot;!a&&c.floating?c.floating.removeClass("fixedHeader-floating fixedHeader-locked"):(c.floating&&(c.placeholder.remove(),
|
||||
this._unsize(b),c.floating.children().detach(),c.floating.remove()),c.floating=d(e.table().node().cloneNode(!1)).css("table-layout","fixed").removeAttr("id").append(f).appendTo("body"),c.placeholder=f.clone(!1),c.placeholder.find("*[id]").removeAttr("id"),c.host.prepend(c.placeholder),this._matchWidths(c.placeholder,c.floating))},_matchWidths:function(b,a){var e=function(a){return d(a,b).map(function(){return d(this).width()}).toArray()},c=function(b,c){d(b,a).each(function(a){d(this).css({width:c[a],
|
||||
minWidth:c[a]})})},f=e("th"),e=e("td");c("th",f);c("td",e)},_unsize:function(b){var a=this.dom[b].floating;a&&("footer"===b||"header"===b&&!this.s.autoWidth)?d("th, td",a).css({width:"",minWidth:""}):a&&"header"===b&&d("th, td",a).css("min-width","")},_horizontal:function(b,a){var e=this.dom[b],c=this.s.position,d=this.s.scrollLeft;e.floating&&d[b]!==a&&(e.floating.css("left",c.left-a),d[b]=a)},_modeChange:function(b,a,e){var c=this.dom[a],f=this.s.position,g=d.contains(this.dom["footer"===a?"tfoot":
|
||||
"thead"][0],h.activeElement)?h.activeElement:null;if("in-place"===b){if(c.placeholder&&(c.placeholder.remove(),c.placeholder=null),this._unsize(a),"header"===a?c.host.prepend(this.dom.thead):c.host.append(this.dom.tfoot),c.floating)c.floating.remove(),c.floating=null}else"in"===b?(this._clone(a,e),c.floating.addClass("fixedHeader-floating").css("header"===a?"top":"bottom",this.c[a+"Offset"]).css("left",f.left+"px").css("width",f.width+"px"),"footer"===a&&c.floating.css("top","")):"below"===b?(this._clone(a,
|
||||
e),c.floating.addClass("fixedHeader-locked").css("top",f.tfootTop-f.theadHeight).css("left",f.left+"px").css("width",f.width+"px")):"above"===b&&(this._clone(a,e),c.floating.addClass("fixedHeader-locked").css("top",f.tbodyTop).css("left",f.left+"px").css("width",f.width+"px"));g&&g!==h.activeElement&&g.focus();this.s.scrollLeft.header=-1;this.s.scrollLeft.footer=-1;this.s[a+"Mode"]=b},_positions:function(){var b=this.s.dt.table(),a=this.s.position,e=this.dom,b=d(b.node()),c=b.children("thead"),f=
|
||||
b.children("tfoot"),e=e.tbody;a.visible=b.is(":visible");a.width=b.outerWidth();a.left=b.offset().left;a.theadTop=c.offset().top;a.tbodyTop=e.offset().top;a.theadHeight=a.tbodyTop-a.theadTop;f.length?(a.tfootTop=f.offset().top,a.tfootBottom=a.tfootTop+f.outerHeight(),a.tfootHeight=a.tfootBottom-a.tfootTop):(a.tfootTop=a.tbodyTop+e.outerHeight(),a.tfootBottom=a.tfootTop,a.tfootHeight=a.tfootTop)},_scroll:function(b){var a=d(h).scrollTop(),e=d(h).scrollLeft(),c=this.s.position,f;if(this.s.enable&&(this.c.header&&
|
||||
(f=!c.visible||a<=c.theadTop-this.c.headerOffset?"in-place":a<=c.tfootTop-c.theadHeight-this.c.headerOffset?"in":"below",(b||f!==this.s.headerMode)&&this._modeChange(f,"header",b),this._horizontal("header",e)),this.c.footer&&this.dom.tfoot.length))a=!c.visible||a+c.windowHeight>=c.tfootBottom+this.c.footerOffset?"in-place":c.windowHeight+a>c.tbodyTop+c.tfootHeight+this.c.footerOffset?"in":"above",(b||a!==this.s.footerMode)&&this._modeChange(a,"footer",b),this._horizontal("footer",e)}});i.version=
|
||||
"3.1.3";i.defaults={header:!0,footer:!1,headerOffset:0,footerOffset:0};d.fn.dataTable.FixedHeader=i;d.fn.DataTable.FixedHeader=i;d(h).on("init.dt.dtfh",function(b,a){if("dt"===b.namespace){var e=a.oInit.fixedHeader,c=j.defaults.fixedHeader;if((e||c)&&!a._fixedHeader)c=d.extend({},c,e),!1!==e&&new i(a,c)}});j.Api.register("fixedHeader()",function(){});j.Api.register("fixedHeader.adjust()",function(){return this.iterator("table",function(b){(b=b._fixedHeader)&&b.update()})});j.Api.register("fixedHeader.enable()",
|
||||
function(b){return this.iterator("table",function(a){a=a._fixedHeader;b=b!==k?b:!0;a&&b!==a.s.enable&&a.enable(b)})});j.Api.register("fixedHeader.disable()",function(){return this.iterator("table",function(b){(b=b._fixedHeader)&&b.s.enable&&b.enable(!1)})});d.each(["header","footer"],function(b,a){j.Api.register("fixedHeader."+a+"Offset()",function(b){var c=this.context;return b===k?c.length&&c[0]._fixedHeader?c[0]._fixedHeader[a+"Offset"]():k:this.iterator("table",function(c){if(c=c._fixedHeader)c[a+
|
||||
"Offset"](b)})})});return i});
|
||||
22
public/assets/js/datatable/datatable-extension/dataTables.keyTable.min.js
vendored
Normal file
22
public/assets/js/datatable/datatable-extension/dataTables.keyTable.min.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/*!
|
||||
KeyTable 2.3.2
|
||||
©2009-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(k){return f(k,window,document)}):"object"===typeof exports?module.exports=function(k,h){k||(k=window);if(!h||!h.fn.dataTable)h=require("datatables.net")(k,h).$;return f(h,k,k.document)}:f(jQuery,window,document)})(function(f,k,h,o){var l=f.fn.dataTable,n=function(a,b){if(!l.versionCheck||!l.versionCheck("1.10.8"))throw"KeyTable requires DataTables 1.10.8 or newer";this.c=f.extend(!0,{},l.defaults.keyTable,
|
||||
n.defaults,b);this.s={dt:new l.Api(a),enable:!0,focusDraw:!1,waitingForDraw:!1,lastFocus:null};this.dom={};var c=this.s.dt.settings()[0],d=c.keytable;if(d)return d;c.keytable=this;this._constructor()};f.extend(n.prototype,{blur:function(){this._blur()},enable:function(a){this.s.enable=a},focus:function(a,b){this._focus(this.s.dt.cell(a,b))},focused:function(a){if(!this.s.lastFocus)return!1;var b=this.s.lastFocus.cell.index();return a.row===b.row&&a.column===b.column},_constructor:function(){this._tabInput();
|
||||
var a=this,b=this.s.dt,c=f(b.table().node());"static"===c.css("position")&&c.css("position","relative");f(b.table().body()).on("click.keyTable","th, td",function(c){if(!1!==a.s.enable){var d=b.cell(this);d.any()&&a._focus(d,null,!1,c)}});f(h).on("keydown.keyTable",function(b){a._key(b)});if(this.c.blurable)f(h).on("mousedown.keyTable",function(c){f(c.target).parents(".dataTables_filter").length&&a._blur();f(c.target).parents().filter(b.table().container()).length||f(c.target).parents("div.DTE").length||
|
||||
f(c.target).parents("div.editor-datetime").length||f(c.target).parents().filter(".DTFC_Cloned").length||a._blur()});if(this.c.editor){var d=this.c.editor;d.on("open.keyTableMain",function(b,c){"inline"!==c&&a.s.enable&&(a.enable(!1),d.one("close.keyTable",function(){a.enable(!0)}))});if(this.c.editOnFocus)b.on("key-focus.keyTable key-refocus.keyTable",function(b,c,d,e){a._editor(null,e)});b.on("key.keyTable",function(b,c,d,e,f){a._editor(d,f)})}if(b.settings()[0].oFeatures.bStateSave)b.on("stateSaveParams.keyTable",
|
||||
function(b,c,d){d.keyTable=a.s.lastFocus?a.s.lastFocus.cell.index():null});b.on("draw.keyTable",function(c){if(!a.s.focusDraw){var d=a.s.lastFocus;if(d&&d.node&&f(d.node).closest("body")===h.body){var d=a.s.lastFocus.relative,e=b.page.info(),j=d.row+e.start;0!==e.recordsDisplay&&(j>=e.recordsDisplay&&(j=e.recordsDisplay-1),a._focus(j,d.column,!0,c))}}});b.on("destroy.keyTable",function(){b.off(".keyTable");f(b.table().body()).off("click.keyTable","th, td");f(h.body).off("keydown.keyTable").off("click.keyTable")});
|
||||
var e=b.state.loaded();if(e&&e.keyTable)b.one("init",function(){var a=b.cell(e.keyTable);a.any()&&a.focus()});else this.c.focus&&b.cell(this.c.focus).focus()},_blur:function(){if(this.s.enable&&this.s.lastFocus){var a=this.s.lastFocus.cell;f(a.node()).removeClass(this.c.className);this.s.lastFocus=null;this._updateFixedColumns(a.index().column);this._emitEvent("key-blur",[this.s.dt,a])}},_clipboardCopy:function(){var a=this.s.dt;if(this.s.lastFocus&&k.getSelection&&!k.getSelection().toString()){var b=
|
||||
this.s.lastFocus.cell.render("display"),c=f("<div/>").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0}),b=f("<textarea readonly/>").val(b).appendTo(c);try{c.appendTo(a.table().container()),b[0].focus(),b[0].select(),h.execCommand("copy")}catch(d){}c.remove()}},_columns:function(){var a=this.s.dt,b=a.columns(this.c.columns).indexes(),c=[];a.columns(":visible").every(function(a){-1!==b.indexOf(a)&&c.push(a)});return c},_editor:function(a,b){var c=this,d=this.s.dt,e=this.c.editor;
|
||||
!f("div.DTE",this.s.lastFocus.cell.node()).length&&16!==a&&(b.stopPropagation(),13===a&&b.preventDefault(),e.one("open.keyTable",function(){e.off("cancelOpen.keyTable");c.c.editAutoSelect&&f("div.DTE_Field_InputControl input, div.DTE_Field_InputControl textarea").select();d.keys.enable(c.c.editorKeys);d.one("key-blur.editor",function(){e.displayed()&&e.submit()});e.one("close",function(){d.keys.enable(!0);d.off("key-blur.editor")})}).one("cancelOpen.keyTable",function(){e.off("open.keyTable")}).inline(this.s.lastFocus.cell.index()))},
|
||||
_emitEvent:function(a,b){this.s.dt.iterator("table",function(c){f(c.nTable).triggerHandler(a,b)})},_focus:function(a,b,c,d){var e=this,m=this.s.dt,g=m.page.info(),i=this.s.lastFocus;d||(d=null);if(this.s.enable){if("number"!==typeof a){var j=a.index(),b=j.column,a=m.rows({filter:"applied",order:"applied"}).indexes().indexOf(j.row);g.serverSide&&(a+=g.start)}if(-1!==g.length&&(a<g.start||a>=g.start+g.length))this.s.focusDraw=!0,this.s.waitingForDraw=!0,m.one("draw",function(){e.s.focusDraw=!1;e.s.waitingForDraw=
|
||||
!1;e._focus(a,b,o,d)}).page(Math.floor(a/g.length)).draw(!1);else if(-1!==f.inArray(b,this._columns())){g.serverSide&&(a-=g.start);g=m.cells(null,b,{search:"applied",order:"applied"}).flatten();g=m.cell(g[a]);if(i){if(i.node===g.node()){this._emitEvent("key-refocus",[this.s.dt,g,d||null]);return}this._blur()}i=f(g.node());i.addClass(this.c.className);this._updateFixedColumns(b);if(c===o||!0===c)this._scroll(f(k),f(h.body),i,"offset"),c=m.table().body().parentNode,c!==m.table().header().parentNode&&
|
||||
(c=f(c.parentNode),this._scroll(c,c,i,"position"));this.s.lastFocus={cell:g,node:g.node(),relative:{row:m.rows({page:"current"}).indexes().indexOf(g.index().row),column:g.index().column}};this._emitEvent("key-focus",[this.s.dt,g,d||null]);m.state.save()}}},_key:function(a){if(this.s.waitingForDraw)a.preventDefault();else{var b=this.s.enable,c=!0===b||"navigation-only"===b;if(b)if(a.ctrlKey&&67===a.keyCode)this._clipboardCopy();else if(!(0===a.keyCode||a.ctrlKey||a.metaKey||a.altKey)&&this.s.lastFocus){var d=
|
||||
this.s.dt;if(!(this.c.keys&&-1===f.inArray(a.keyCode,this.c.keys)))switch(a.keyCode){case 9:this._shift(a,a.shiftKey?"left":"right",!0);break;case 27:this.s.blurable&&!0===b&&this._blur();break;case 33:case 34:c&&(a.preventDefault(),d.page(33===a.keyCode?"previous":"next").draw(!1));break;case 35:case 36:c&&(a.preventDefault(),b=d.cells({page:"current"}).indexes(),c=this._columns(),this._focus(d.cell(b[35===a.keyCode?b.length-1:c[0]]),null,!0,a));break;case 37:c&&this._shift(a,"left");break;case 38:c&&
|
||||
this._shift(a,"up");break;case 39:c&&this._shift(a,"right");break;case 40:c&&this._shift(a,"down");break;default:!0===b&&this._emitEvent("key",[d,a.keyCode,this.s.lastFocus.cell,a])}}}},_scroll:function(a,b,c,d){var e=c[d](),f=c.outerHeight(),g=c.outerWidth(),i=b.scrollTop(),j=b.scrollLeft(),h=a.height(),a=a.width();"position"===d&&(e.top+=parseInt(c.closest("table").css("top"),10));e.top<i&&b.scrollTop(e.top);e.left<j&&b.scrollLeft(e.left);e.top+f>i+h&&f<h&&b.scrollTop(e.top+f-h);e.left+g>j+a&&g<
|
||||
a&&b.scrollLeft(e.left+g-a)},_shift:function(a,b,c){var d=this.s.dt,e=d.page.info(),h=e.recordsDisplay,g=this.s.lastFocus.cell,i=this._columns();if(g){var j=d.rows({filter:"applied",order:"applied"}).indexes().indexOf(g.index().row);e.serverSide&&(j+=e.start);d=d.columns(i).indexes().indexOf(g.index().column);e=i[d];"right"===b?d>=i.length-1?(j++,e=i[0]):e=i[d+1]:"left"===b?0===d?(j--,e=i[i.length-1]):e=i[d-1]:"up"===b?j--:"down"===b&&j++;0<=j&&j<h&&-1!==f.inArray(e,i)?(a.preventDefault(),this._focus(j,
|
||||
e,!0,a)):!c||!this.c.blurable?a.preventDefault():this._blur()}},_tabInput:function(){var a=this,b=this.s.dt,c=null!==this.c.tabIndex?this.c.tabIndex:b.settings()[0].iTabIndex;if(-1!=c)f('<div><input type="text" tabindex="'+c+'"/></div>').css({position:"absolute",height:1,width:0,overflow:"hidden"}).insertBefore(b.table().node()).children().on("focus",function(c){b.cell(":eq(0)",{page:"current"}).any()&&a._focus(b.cell(":eq(0)","0:visible",{page:"current"}),null,!0,c)})},_updateFixedColumns:function(a){var b=
|
||||
this.s.dt,c=b.settings()[0];if(c._oFixedColumns){var d=c.aoColumns.length-c._oFixedColumns.s.iRightColumns;(a<c._oFixedColumns.s.iLeftColumns||a>=d)&&b.fixedColumns().update()}}});n.defaults={blurable:!0,className:"focus",columns:"",editor:null,editorKeys:"navigation-only",editAutoSelect:!0,editOnFocus:!1,focus:null,keys:null,tabIndex:null};n.version="2.3.2";f.fn.dataTable.KeyTable=n;f.fn.DataTable.KeyTable=n;l.Api.register("cell.blur()",function(){return this.iterator("table",function(a){a.keytable&&
|
||||
a.keytable.blur()})});l.Api.register("cell().focus()",function(){return this.iterator("cell",function(a,b,c){a.keytable&&a.keytable.focus(b,c)})});l.Api.register("keys.disable()",function(){return this.iterator("table",function(a){a.keytable&&a.keytable.enable(!1)})});l.Api.register("keys.enable()",function(a){return this.iterator("table",function(b){b.keytable&&b.keytable.enable(a===o?!0:a)})});l.ext.selector.cell.push(function(a,b,c){var b=b.focused,a=a.keytable,d=[];if(!a||b===o)return c;for(var e=
|
||||
0,f=c.length;e<f;e++)(!0===b&&a.focused(c[e])||!1===b&&!a.focused(c[e]))&&d.push(c[e]);return d});f(h).on("preInit.dt.dtk",function(a,b){if("dt"===a.namespace){var c=b.oInit.keys,d=l.defaults.keys;if(c||d)d=f.extend({},d,c),!1!==c&&new n(b,d)}});return n});
|
||||
29
public/assets/js/datatable/datatable-extension/dataTables.responsive.min.js
vendored
Normal file
29
public/assets/js/datatable/datatable-extension/dataTables.responsive.min.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/*!
|
||||
Responsive 2.2.1
|
||||
2014-2017 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(l){return c(l,window,document)}):"object"===typeof exports?module.exports=function(l,k){l||(l=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(l,k).$;return c(k,l,l.document)}:c(jQuery,window,document)})(function(c,l,k,q){function s(b,a,c){var e=a+"-"+c;if(m[e])return m[e];for(var f=[],b=b.cell(a,c).node().childNodes,a=0,c=b.length;a<c;a++)f.push(b[a]);return m[e]=f}function r(b,a,c){var e=a+
|
||||
"-"+c;if(m[e]){for(var b=b.cell(a,c).node(),c=m[e][0].parentNode.childNodes,a=[],f=0,g=c.length;f<g;f++)a.push(c[f]);c=0;for(f=a.length;c<f;c++)b.appendChild(a[c]);m[e]=q}}var o=c.fn.dataTable,j=function(b,a){if(!o.versionCheck||!o.versionCheck("1.10.10"))throw"DataTables Responsive requires DataTables 1.10.10 or newer";this.s={dt:new o.Api(b),columns:[],current:[]};this.s.dt.settings()[0].responsive||(a&&"string"===typeof a.details?a.details={type:a.details}:a&&!1===a.details?a.details={type:!1}:
|
||||
a&&!0===a.details&&(a.details={type:"inline"}),this.c=c.extend(!0,{},j.defaults,o.defaults.responsive,a),b.responsive=this,this._constructor())};c.extend(j.prototype,{_constructor:function(){var b=this,a=this.s.dt,d=a.settings()[0],e=c(l).width();a.settings()[0]._responsive=this;c(l).on("resize.dtr orientationchange.dtr",o.util.throttle(function(){var a=c(l).width();a!==e&&(b._resize(),e=a)}));d.oApi._fnCallbackReg(d,"aoRowCreatedCallback",function(e){-1!==c.inArray(!1,b.s.current)&&c(">td, >th",
|
||||
e).each(function(e){e=a.column.index("toData",e);!1===b.s.current[e]&&c(this).css("display","none")})});a.on("destroy.dtr",function(){a.off(".dtr");c(a.table().body()).off(".dtr");c(l).off("resize.dtr orientationchange.dtr");c.each(b.s.current,function(a,c){!1===c&&b._setColumnVis(a,!0)})});this.c.breakpoints.sort(function(a,b){return a.width<b.width?1:a.width>b.width?-1:0});this._classLogic();this._resizeAuto();d=this.c.details;!1!==d.type&&(b._detailsInit(),a.on("column-visibility.dtr",function(a,
|
||||
c,e,d,h){h&&(b._classLogic(),b._resizeAuto(),b._resize())}),a.on("draw.dtr",function(){b._redrawChildren()}),c(a.table().node()).addClass("dtr-"+d.type));a.on("column-reorder.dtr",function(){b._classLogic();b._resizeAuto();b._resize()});a.on("column-sizing.dtr",function(){b._resizeAuto();b._resize()});a.on("preXhr.dtr",function(){var c=[];a.rows().every(function(){this.child.isShown()&&c.push(this.id(true))});a.one("draw.dtr",function(){b._resizeAuto();b._resize();a.rows(c).every(function(){b._detailsDisplay(this,
|
||||
false)})})});a.on("init.dtr",function(){b._resizeAuto();b._resize();c.inArray(false,b.s.current)&&a.columns.adjust()});this._resize()},_columnsVisiblity:function(b){var a=this.s.dt,d=this.s.columns,e,f,g=d.map(function(a,b){return{columnIdx:b,priority:a.priority}}).sort(function(a,b){return a.priority!==b.priority?a.priority-b.priority:a.columnIdx-b.columnIdx}),i=c.map(d,function(a){return a.auto&&null===a.minWidth?!1:!0===a.auto?"-":-1!==c.inArray(b,a.includeIn)}),n=0;e=0;for(f=i.length;e<f;e++)!0===
|
||||
i[e]&&(n+=d[e].minWidth);e=a.settings()[0].oScroll;e=e.sY||e.sX?e.iBarWidth:0;a=a.table().container().offsetWidth-e-n;e=0;for(f=i.length;e<f;e++)d[e].control&&(a-=d[e].minWidth);n=!1;e=0;for(f=g.length;e<f;e++){var h=g[e].columnIdx;"-"===i[h]&&(!d[h].control&&d[h].minWidth)&&(n||0>a-d[h].minWidth?(n=!0,i[h]=!1):i[h]=!0,a-=d[h].minWidth)}g=!1;e=0;for(f=d.length;e<f;e++)if(!d[e].control&&!d[e].never&&!i[e]){g=!0;break}e=0;for(f=d.length;e<f;e++)d[e].control&&(i[e]=g);-1===c.inArray(!0,i)&&(i[0]=!0);
|
||||
return i},_classLogic:function(){var b=this,a=this.c.breakpoints,d=this.s.dt,e=d.columns().eq(0).map(function(a){var b=this.column(a),e=b.header().className,a=d.settings()[0].aoColumns[a].responsivePriority;a===q&&(b=c(b.header()).data("priority"),a=b!==q?1*b:1E4);return{className:e,includeIn:[],auto:!1,control:!1,never:e.match(/\bnever\b/)?!0:!1,priority:a}}),f=function(a,b){var d=e[a].includeIn;-1===c.inArray(b,d)&&d.push(b)},g=function(c,d,h,g){if(h)if("max-"===h){g=b._find(d).width;d=0;for(h=
|
||||
a.length;d<h;d++)a[d].width<=g&&f(c,a[d].name)}else if("min-"===h){g=b._find(d).width;d=0;for(h=a.length;d<h;d++)a[d].width>=g&&f(c,a[d].name)}else{if("not-"===h){d=0;for(h=a.length;d<h;d++)-1===a[d].name.indexOf(g)&&f(c,a[d].name)}}else e[c].includeIn.push(d)};e.each(function(b,e){for(var d=b.className.split(" "),f=!1,j=0,l=d.length;j<l;j++){var k=c.trim(d[j]);if("all"===k){f=!0;b.includeIn=c.map(a,function(a){return a.name});return}if("none"===k||b.never){f=!0;return}if("control"===k){f=!0;b.control=
|
||||
!0;return}c.each(a,function(a,b){var c=b.name.split("-"),d=k.match(RegExp("(min\\-|max\\-|not\\-)?("+c[0]+")(\\-[_a-zA-Z0-9])?"));d&&(f=!0,d[2]===c[0]&&d[3]==="-"+c[1]?g(e,b.name,d[1],d[2]+d[3]):d[2]===c[0]&&!d[3]&&g(e,b.name,d[1],d[2]))})}f||(b.auto=!0)});this.s.columns=e},_detailsDisplay:function(b,a){var d=this,e=this.s.dt,f=this.c.details;if(f&&!1!==f.type){var g=f.display(b,a,function(){return f.renderer(e,b[0],d._detailsObj(b[0]))});(!0===g||!1===g)&&c(e.table().node()).triggerHandler("responsive-display.dt",
|
||||
[e,b,g,a])}},_detailsInit:function(){var b=this,a=this.s.dt,d=this.c.details;"inline"===d.type&&(d.target="td:first-child, th:first-child");a.on("draw.dtr",function(){b._tabIndexes()});b._tabIndexes();c(a.table().body()).on("keyup.dtr","td, th",function(a){a.keyCode===13&&c(this).data("dtr-keyboard")&&c(this).click()});var e=d.target;c(a.table().body()).on("click.dtr mousedown.dtr mouseup.dtr","string"===typeof e?e:"td, th",function(d){if(c(a.table().node()).hasClass("collapsed")&&c.inArray(c(this).closest("tr").get(0),
|
||||
a.rows().nodes().toArray())!==-1){if(typeof e==="number"){var g=e<0?a.columns().eq(0).length+e:e;if(a.cell(this).index().column!==g)return}g=a.row(c(this).closest("tr"));d.type==="click"?b._detailsDisplay(g,false):d.type==="mousedown"?c(this).css("outline","none"):d.type==="mouseup"&&c(this).blur().css("outline","")}})},_detailsObj:function(b){var a=this,d=this.s.dt;return c.map(this.s.columns,function(c,f){if(!c.never&&!c.control)return{title:d.settings()[0].aoColumns[f].sTitle,data:d.cell(b,f).render(a.c.orthogonal),
|
||||
hidden:d.column(f).visible()&&!a.s.current[f],columnIndex:f,rowIndex:b}})},_find:function(b){for(var a=this.c.breakpoints,c=0,e=a.length;c<e;c++)if(a[c].name===b)return a[c]},_redrawChildren:function(){var b=this,a=this.s.dt;a.rows({page:"current"}).iterator("row",function(c,e){a.row(e);b._detailsDisplay(a.row(e),!0)})},_resize:function(){var b=this,a=this.s.dt,d=c(l).width(),e=this.c.breakpoints,f=e[0].name,g=this.s.columns,i,n=this.s.current.slice();for(i=e.length-1;0<=i;i--)if(d<=e[i].width){f=
|
||||
e[i].name;break}var h=this._columnsVisiblity(f);this.s.current=h;e=!1;i=0;for(d=g.length;i<d;i++)if(!1===h[i]&&!g[i].never&&!g[i].control){e=!0;break}c(a.table().node()).toggleClass("collapsed",e);var j=!1,k=0;a.columns().eq(0).each(function(a,c){!0===h[c]&&k++;h[c]!==n[c]&&(j=!0,b._setColumnVis(a,h[c]))});j&&(this._redrawChildren(),c(a.table().node()).trigger("responsive-resize.dt",[a,this.s.current]),0===a.page.info().recordsDisplay&&c("td",a.table().body()).eq(0).attr("colspan",k))},_resizeAuto:function(){var b=
|
||||
this.s.dt,a=this.s.columns;if(this.c.auto&&-1!==c.inArray(!0,c.map(a,function(a){return a.auto}))){c.isEmptyObject(m)||c.each(m,function(a){a=a.split("-");r(b,1*a[0],1*a[1])});b.table().node();var d=b.table().node().cloneNode(!1),e=c(b.table().header().cloneNode(!1)).appendTo(d),f=c(b.table().body()).clone(!1,!1).empty().appendTo(d),g=b.columns().header().filter(function(a){return b.column(a).visible()}).to$().clone(!1).css("display","table-cell").css("min-width",0);c(f).append(c(b.rows({page:"current"}).nodes()).clone(!1)).find("th, td").css("display",
|
||||
"");if(f=b.table().footer()){var f=c(f.cloneNode(!1)).appendTo(d),i=b.columns().footer().filter(function(a){return b.column(a).visible()}).to$().clone(!1).css("display","table-cell");c("<tr/>").append(i).appendTo(f)}c("<tr/>").append(g).appendTo(e);"inline"===this.c.details.type&&c(d).addClass("dtr-inline collapsed");c(d).find("[name]").removeAttr("name");d=c("<div/>").css({width:1,height:1,overflow:"hidden",clear:"both"}).append(d);d.insertBefore(b.table().node());g.each(function(c){c=b.column.index("fromVisible",
|
||||
c);a[c].minWidth=this.offsetWidth||0});d.remove()}},_setColumnVis:function(b,a){var d=this.s.dt,e=a?"":"none";c(d.column(b).header()).css("display",e);c(d.column(b).footer()).css("display",e);d.column(b).nodes().to$().css("display",e);c.isEmptyObject(m)||d.cells(null,b).indexes().each(function(a){r(d,a.row,a.column)})},_tabIndexes:function(){var b=this.s.dt,a=b.cells({page:"current"}).nodes().to$(),d=b.settings()[0],e=this.c.details.target;a.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]");
|
||||
a="number"===typeof e?":eq("+e+")":e;"td:first-child, th:first-child"===a&&(a=">td:first-child, >th:first-child");c(a,b.rows({page:"current"}).nodes()).attr("tabIndex",d.iTabIndex).data("dtr-keyboard",1)}});j.breakpoints=[{name:"desktop",width:Infinity},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}];j.display={childRow:function(b,a,d){if(a){if(c(b.node()).hasClass("parent"))return b.child(d(),"child").show(),!0}else{if(b.child.isShown())return b.child(!1),
|
||||
c(b.node()).removeClass("parent"),!1;b.child(d(),"child").show();c(b.node()).addClass("parent");return!0}},childRowImmediate:function(b,a,d){if(!a&&b.child.isShown()||!b.responsive.hasHidden())return b.child(!1),c(b.node()).removeClass("parent"),!1;b.child(d(),"child").show();c(b.node()).addClass("parent");return!0},modal:function(b){return function(a,d,e){if(d)c("div.dtr-modal-content").empty().append(e());else{var f=function(){g.remove();c(k).off("keypress.dtr")},g=c('<div class="dtr-modal"/>').append(c('<div class="dtr-modal-display"/>').append(c('<div class="dtr-modal-content"/>').append(e())).append(c('<div class="dtr-modal-close">×</div>').click(function(){f()}))).append(c('<div class="dtr-modal-background"/>').click(function(){f()})).appendTo("body");
|
||||
c(k).on("keyup.dtr",function(a){27===a.keyCode&&(a.stopPropagation(),f())})}b&&b.header&&c("div.dtr-modal-content").prepend("<h2>"+b.header(a)+"</h2>")}}};var m={};j.renderer={listHiddenNodes:function(){return function(b,a,d){var e=c('<ul data-dtr-index="'+a+'" class="dtr-details"/>'),f=!1;c.each(d,function(a,d){d.hidden&&(c('<li data-dtr-index="'+d.columnIndex+'" data-dt-row="'+d.rowIndex+'" data-dt-column="'+d.columnIndex+'"><span class="dtr-title">'+d.title+"</span> </li>").append(c('<span class="dtr-data"/>').append(s(b,
|
||||
d.rowIndex,d.columnIndex))).appendTo(e),f=!0)});return f?e:!1}},listHidden:function(){return function(b,a,d){return(b=c.map(d,function(a){return a.hidden?'<li data-dtr-index="'+a.columnIndex+'" data-dt-row="'+a.rowIndex+'" data-dt-column="'+a.columnIndex+'"><span class="dtr-title">'+a.title+'</span> <span class="dtr-data">'+a.data+"</span></li>":""}).join(""))?c('<ul data-dtr-index="'+a+'" class="dtr-details"/>').append(b):!1}},tableAll:function(b){b=c.extend({tableClass:""},b);return function(a,
|
||||
d,e){a=c.map(e,function(a){return'<tr data-dt-row="'+a.rowIndex+'" data-dt-column="'+a.columnIndex+'"><td>'+a.title+":</td> <td>"+a.data+"</td></tr>"}).join("");return c('<table class="'+b.tableClass+' dtr-details" width="100%"/>').append(a)}}};j.defaults={breakpoints:j.breakpoints,auto:!0,details:{display:j.display.childRow,renderer:j.renderer.listHidden(),target:0,type:"inline"},orthogonal:"display"};var p=c.fn.dataTable.Api;p.register("responsive()",function(){return this});p.register("responsive.index()",
|
||||
function(b){b=c(b);return{column:b.data("dtr-index"),row:b.parent().data("dtr-index")}});p.register("responsive.rebuild()",function(){return this.iterator("table",function(b){b._responsive&&b._responsive._classLogic()})});p.register("responsive.recalc()",function(){return this.iterator("table",function(b){b._responsive&&(b._responsive._resizeAuto(),b._responsive._resize())})});p.register("responsive.hasHidden()",function(){var b=this.context[0];return b._responsive?-1!==c.inArray(!1,b._responsive.s.current):
|
||||
!1});p.registerPlural("columns().responsiveHidden()","column().responsiveHidden()",function(){return this.iterator("column",function(b,a){return b._responsive?b._responsive.s.current[a]:!1},1)});j.version="2.2.1";c.fn.dataTable.Responsive=j;c.fn.DataTable.Responsive=j;c(k).on("preInit.dt.dtr",function(b,a){if("dt"===b.namespace&&(c(a.nTable).hasClass("responsive")||c(a.nTable).hasClass("dt-responsive")||a.oInit.responsive||o.defaults.responsive)){var d=a.oInit.responsive;!1!==d&&new j(a,c.isPlainObject(d)?
|
||||
d:{})}});return j});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user