/******************************************************************
INDEX
*******************************************************************
01. Avoid `console`
02. Mean menu
03. Parallax js
04. Images Loaded
05. tags
06. Circle Progress
07. Chartist js
08. Chartist Point Labels
******************************************************************
END INDEX
******************************************************************/
/*==================== 01. Avoid console ========================*/
//Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
while (length--) {
method = methods[length];
// Only stub undefined methods.
if (!console[method]) {
console[method] = noop;
}
}
}());
/*
jQuery Nice Select - v1.0
*/
!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("
").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html(''));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
/*-------------------------------------------------------------
05. tags
---------------------------------------------------------------*/
(function(){
var TagsInput = function(opts){
this.options = Object.assign(TagsInput.defaults , opts);
this.original_input = document.getElementById(opts.selector);
this.arr = [];
this.wrapper = document.createElement('div');
this.input = document.createElement('input');
buildUI(this);
addEvents(this);
}
TagsInput.prototype.addTag = function(string){
if(this.anyErrors(string))
return ;
this.arr.push(string);
var tagInput = this;
var tag = document.createElement('span');
tag.className = this.options.tagClass;
tag.innerText = string;
var closeIcon = document.createElement('a');
closeIcon.innerHTML = '×';
closeIcon.addEventListener('click' , function(e){
e.preventDefault();
var tag = this.parentNode;
for(var i =0 ;i < tagInput.wrapper.childNodes.length ; i++){
if(tagInput.wrapper.childNodes[i] == tag)
tagInput.deleteTag(tag , i);
}
})
tag.appendChild(closeIcon);
this.wrapper.insertBefore(tag , this.input);
this.original_input.value = this.arr.join(',');
return this;
}
TagsInput.prototype.deleteTag = function(tag , i){
tag.remove();
this.arr.splice( i , 1);
this.original_input.value = this.arr.join(',');
return this;
}
TagsInput.prototype.anyErrors = function(string){
if( this.options.max != null && this.arr.length >= this.options.max ){
console.log('max tags limit reached');
return true;
}
if(!this.options.duplicate && this.arr.indexOf(string) != -1 ){
console.log('duplicate found " '+string+' " ')
return true;
}
return false;
}
TagsInput.prototype.addData = function(array){
var plugin = this;
array.forEach(function(string){
plugin.addTag(string);
})
return this;
}
TagsInput.prototype.getInputString = function(){
return this.arr.join(',');
}
// Private function to initialize the UI Elements
function buildUI(tags){
tags.wrapper.append(tags.input);
tags.wrapper.classList.add(tags.options.wrapperClass);
tags.original_input.setAttribute('hidden' , 'true');
tags.original_input.parentNode.insertBefore(tags.wrapper , tags.original_input);
}
function addEvents(tags){
tags.wrapper.addEventListener('click' ,function(){
tags.input.focus();
});
tags.input.addEventListener('keydown' , function(e){
var str = tags.input.value.trim();
if( !!(~[9 , 13 , 188].indexOf( e.keyCode )) )
{
tags.input.value = "";
if(str != "")
tags.addTag(str);
}
});
}
TagsInput.defaults = {
selector : '',
wrapperClass : 'tags-input-wrapper',
tagClass : 'tag',
max : null,
duplicate: false
}
window.TagsInput = TagsInput;
})();
/*-------------------------------------------------------------
06. Circle Progress
---------------------------------------------------------------*/
/**
* jquery-circle-progress - jQuery Plugin to draw animated circular progress bars:
* {@link http://kottenator.github.io/jquery-circle-progress/}
*
* @author Rostyslav Bryzgunov
* @version 1.2.2
* @licence MIT
* @preserve
*/
!function(i){if("function"==typeof define&&define.amd)define(["jquery"],i);else if("object"==typeof module&&module.exports){var t=require("jquery");i(t),module.exports=t}else i(jQuery)}(function(i){function t(i){this.init(i)}t.prototype={value:0,size:100,startAngle:-Math.PI,thickness:"auto",fill:{gradient:["#3aeabb","#fdd250"]},emptyFill:"rgba(0, 0, 0, .1)",animation:{duration:1200,easing:"circleProgressEasing"},animationStartValue:0,reverse:!1,lineCap:"butt",insertMode:"prepend",constructor:t,el:null,canvas:null,ctx:null,radius:0,arcFill:null,lastFrameValue:0,init:function(t){i.extend(this,t),this.radius=this.size/2,this.initWidget(),this.initFill(),this.draw(),this.el.trigger("circle-inited")},initWidget:function(){this.canvas||(this.canvas=i("