From d04162d338e43bd94b2a58aa0cfcc1b3a69fc94e Mon Sep 17 00:00:00 2001 From: razvanaldea89 Date: Fri, 22 Feb 2019 13:28:26 +0200 Subject: [PATCH] fix for dynamic tables extra space --- build/js/custom.js | 366 ++++++++++++++++++++--------------------- build/js/custom.min.js | 2 +- src/js/custom.js | 331 ++++++++++++++++++++----------------- 3 files changed, 355 insertions(+), 344 deletions(-) diff --git a/build/js/custom.js b/build/js/custom.js index b1bc1de2..866a3182 100644 --- a/build/js/custom.js +++ b/build/js/custom.js @@ -1,38 +1,3 @@ -/** - * Resize function without multiple trigger - * - * Usage: - * $(window).smartresize(function(){ - * // code here - * }); - */ -(function($,sr){ - // debouncing function from John Hann - // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ - var debounce = function (func, threshold, execAsap) { - var timeout; - - return function debounced () { - var obj = this, args = arguments; - function delayed () { - if (!execAsap) - func.apply(obj, args); - timeout = null; - } - - if (timeout) - clearTimeout(timeout); - else if (execAsap) - func.apply(obj, args); - - timeout = setTimeout(delayed, threshold || 100); - }; - }; - - // smartresize - jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; - -})(jQuery,'smartresize'); /** * Resize function without multiple trigger * @@ -41,15 +6,16 @@ * // code here * }); */ -(function($,sr){ +(function ($, sr) { // debouncing function from John Hann // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ var debounce = function (func, threshold, execAsap) { var timeout; - return function debounced () { + return function debounced() { var obj = this, args = arguments; - function delayed () { + + function delayed() { if (!execAsap) func.apply(obj, args); timeout = null; @@ -65,9 +31,11 @@ }; // smartresize - jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; + jQuery.fn[sr] = function (fn) { + return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); + }; -})(jQuery,'smartresize'); +})(jQuery, 'smartresize'); /** * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates @@ -75,20 +43,23 @@ */ -var CURRENT_URL = window.location.href.split("#")[0].split("?")[0], - $BODY = $("body"), - $MENU_TOGGLE = $("#menu_toggle"), - $SIDEBAR_MENU = $("#sidebar-menu"), - $SIDEBAR_FOOTER = $(".sidebar-footer"), - $LEFT_COL = $(".left_col"), - $RIGHT_COL = $(".right_col"), - $NAV_MENU = $(".nav_menu"), - $FOOTER = $("footer"), - randNum = function() { - return Math.floor(21 * Math.random()) + 20 - }; +/* SIDEBAR */ +// fix for dynamic tables +function setContentHeight() { + var CURRENT_URL = window.location.href.split("#")[0].split("?")[0], + $BODY = $("body"), + $MENU_TOGGLE = $("#menu_toggle"), + $SIDEBAR_MENU = $("#sidebar-menu"), + $SIDEBAR_FOOTER = $(".sidebar-footer"), + $LEFT_COL = $(".left_col"), + $RIGHT_COL = $(".right_col"), + $NAV_MENU = $(".nav_menu"), + $FOOTER = $("footer"), + randNum = function () { + return Math.floor(21 * Math.random()) + 20 + }; -var setContentHeight = function () { + // reset height $RIGHT_COL.css('min-height', $(window).height()); var bodyHeight = $BODY.outerHeight(), @@ -101,34 +72,41 @@ var setContentHeight = function () { $RIGHT_COL.css('min-height', contentHeight); }; -/* SIDEBAR */ +$(document).ready(function () { + var CURRENT_URL = window.location.href.split("#")[0].split("?")[0], + $BODY = $("body"), + $MENU_TOGGLE = $("#menu_toggle"), + $SIDEBAR_MENU = $("#sidebar-menu"), + $SIDEBAR_FOOTER = $(".sidebar-footer"), + $LEFT_COL = $(".left_col"), + $RIGHT_COL = $(".right_col"), + $NAV_MENU = $(".nav_menu"), + $FOOTER = $("footer"), + randNum = function () { + return Math.floor(21 * Math.random()) + 20 + }; -$(document).ready(function() { - $SIDEBAR_MENU.find('a').on('click', function(ev) { + $SIDEBAR_MENU.find('a').on('click', function (ev) { var $li = $(this).parent(); var child_menu = $('ul:first', $li); var other_list_items = $li.parent().find('li').not($li); var other_level_menus = $li.parents('.child_menu').find('ul.child_menu').not(child_menu); if ($li.is('.active')) { $li.removeClass('active active-sm'); - $('ul:first', $li).slideUp(function() { + $('ul:first', $li).slideUp(function () { setContentHeight(); if ($('.left_col.menu_fixed > .mCustomScrollBox > .mCSB_container ').length) { $('.left_col.menu_fixed > .mCustomScrollBox > .mCSB_container ').css('min-height', '0'); } }); - } - else - { + } else { // prevent closing menu if we are on child menu if (!$li.parent().is('.child_menu')) { $SIDEBAR_MENU.find('li').removeClass('active active-sm'); $SIDEBAR_MENU.find('li ul').slideUp(); - }else - { - if ( $BODY.is( ".nav-sm" ) ) - { + } else { + if ($BODY.is(".nav-sm")) { if (!$li.parent().is('.child_menu')) { $SIDEBAR_MENU.find('li').removeClass('active active-sm'); $SIDEBAR_MENU.find('li ul').slideUp(); @@ -155,14 +133,14 @@ $(document).ready(function() { // toggle small or large menu - $MENU_TOGGLE.on('click', function() { + $MENU_TOGGLE.on('click', function () { if ($BODY.hasClass('nav-md')) { $SIDEBAR_MENU.find('li.active ul').hide(); $SIDEBAR_MENU.find('li.active').addClass('active-sm').removeClass('active'); $('.main_container > .row > .left_col').removeClass('col-md-2 col-lg-2').addClass('col-md-1 col-lg-1 col-2'); - if( $('.main_container > .row > .left_col.menu_fixed').length){ - if($(window).width() < 1024){ + if ($('.main_container > .row > .left_col.menu_fixed').length) { + if ($(window).width() < 1024) { $('.main_container > .row > .right_col_wrapper').addClass('offset-2'); } else { $('.main_container > .row > .right_col_wrapper').removeClass('offset-md-2').addClass('offset-md-1'); @@ -174,8 +152,8 @@ $(document).ready(function() { $SIDEBAR_MENU.find('li.active-sm ul').show(); $SIDEBAR_MENU.find('li.active-sm').addClass('active').removeClass('active-sm'); $('.main_container > .row > .left_col').removeClass('col-lg-1 col-2 col-md-1').addClass('col-lg-2 col-md-2'); - if( $('.main_container > .row > .left_col.menu_fixed').length){ - if($(window).width() < 1024){ + if ($('.main_container > .row > .left_col.menu_fixed').length) { + if ($(window).width() < 1024) { $('.main_container > .row > .right_col_wrapper').removeClass('offset-2'); } else { $('.main_container > .row > .right_col_wrapper').removeClass('offset-1').addClass('offset-md-2'); @@ -187,9 +165,11 @@ $(document).ready(function() { $BODY.toggleClass('nav-md nav-sm'); - setContentHeight(); + $('.dataTable').each(function () { + $(this).dataTable().fnDraw(); + }); - $('.dataTable').each ( function () { $(this).dataTable().fnDraw(); }); + setContentHeight(); }); // check active menu @@ -213,12 +193,12 @@ $(document).ready(function() { } // original code below, but executed for $cur_menu - $cur_menu.parent('li').addClass('current-page').parents('ul').slideDown(function() { + $cur_menu.parent('li').addClass('current-page').parents('ul').slideDown(function () { setContentHeight(); }).parent().addClass('active'); // recompute content when resizing - $(window).smartresize(function(){ + $(window).smartresize(function () { setContentHeight(); }); @@ -229,12 +209,11 @@ $(document).ready(function() { $('.menu_fixed').mCustomScrollbar({ autoHideScrollbar: true, theme: 'minimal', - mouseWheel:{ preventDefault: true } + mouseWheel: {preventDefault: true} }); } }); - /* SIDEBAR - end */ function countChecked() { @@ -363,7 +342,7 @@ function init_flot_chart() { margin: [0, -25], noColumns: 0, labelBoxBorderColor: null, - labelFormatter: function(a, b) { + labelFormatter: function (a, b) { return a + "  " }, width: 40, @@ -441,9 +420,9 @@ function init_flot_chart() { function init_starrr() { "undefined" != typeof starrr && (console.log("init_starrr"), $(".stars").starrr(), $(".stars-existing").starrr({ rating: 4 - }), $(".stars").on("starrr:change", function(a, b) { + }), $(".stars").on("starrr:change", function (a, b) { $(".stars-count").html(b) - }), $(".stars-existing").on("starrr:change", function(a, b) { + }), $(".stars-existing").on("starrr:change", function (a, b) { $(".stars-count-existing").html(b) })) } @@ -504,7 +483,7 @@ function init_chart_doughnut() { responsive: !1 } }; - $(".canvasDoughnut").each(function() { + $(".canvasDoughnut").each(function () { var b = $(this); new Chart(b, a) }) @@ -888,7 +867,7 @@ function init_autocomplete() { ZW: "Zimbabwe", ZZ: "Unknown or Invalid Region" }, - b = $.map(a, function(a, b) { + b = $.map(a, function (a, b) { return { value: a, data: b @@ -906,25 +885,26 @@ function init_autosize() { function init_parsley() { if ("undefined" != typeof parsley) { - console.log("init_parsley"), $("parsley:field:validate", function() { + console.log("init_parsley"), $("parsley:field:validate", function () { a() - }), $("#demo-form .btn").on("click", function() { + }), $("#demo-form .btn").on("click", function () { $("#demo-form").parsley().validate(), a() }); - var a = function() { + var a = function () { !0 === $("#demo-form").parsley().isValid() ? ($(".bs-callout-info").removeClass("hidden"), $(".bs-callout-warning").addClass("hidden")) : ($(".bs-callout-info").addClass("hidden"), $(".bs-callout-warning").removeClass("hidden")) }; - $("parsley:field:validate", function() { + $("parsley:field:validate", function () { a() - }), $("#demo-form2 .btn").on("click", function() { + }), $("#demo-form2 .btn").on("click", function () { $("#demo-form2").parsley().validate(), a() }); - var a = function() { + var a = function () { !0 === $("#demo-form2").parsley().isValid() ? ($(".bs-callout-info").removeClass("hidden"), $(".bs-callout-warning").addClass("hidden")) : ($(".bs-callout-info").addClass("hidden"), $(".bs-callout-warning").removeClass("hidden")) }; try { hljs.initHighlightingOnLoad() - } catch (a) {} + } catch (a) { + } } } @@ -962,7 +942,8 @@ function init_wysiwyg() { var c = ""; "unsupported-file-type" === a ? c = "Unsupported format " + b : console.log("error uploading file", a, b), $('
File upload error ' + c + "
").prependTo("#alerts") } - "undefined" != typeof $.fn.wysiwyg && (console.log("init_wysiwyg"), $(".editor-wrapper").each(function() { + + "undefined" != typeof $.fn.wysiwyg && (console.log("init_wysiwyg"), $(".editor-wrapper").each(function () { var a = $(this).attr("id"); $(this).wysiwyg({ toolbarSelector: '[data-target="#' + a + '"]', @@ -986,40 +967,40 @@ function init_cropper() { j = { aspectRatio: 16 / 9, preview: ".img-preview", - crop: function(a) { + crop: function (a) { c.val(Math.round(a.x)), d.val(Math.round(a.y)), e.val(Math.round(a.height)), f.val(Math.round(a.width)), g.val(a.rotate), h.val(a.scaleX), i.val(a.scaleY) } }; $('[data-toggle="tooltip"]').tooltip(), a.on({ - "build.cropper": function(a) { + "build.cropper": function (a) { console.log(a.type) }, - "built.cropper": function(a) { + "built.cropper": function (a) { console.log(a.type) }, - "cropstart.cropper": function(a) { + "cropstart.cropper": function (a) { console.log(a.type, a.action) }, - "cropmove.cropper": function(a) { + "cropmove.cropper": function (a) { console.log(a.type, a.action) }, - "cropend.cropper": function(a) { + "cropend.cropper": function (a) { console.log(a.type, a.action) }, - "crop.cropper": function(a) { + "crop.cropper": function (a) { console.log(a.type, a.x, a.y, a.width, a.height, a.rotate, a.scaleX, a.scaleY) }, - "zoom.cropper": function(a) { + "zoom.cropper": function (a) { console.log(a.type, a.ratio) } - }).cropper(j), $.isFunction(document.createElement("canvas").getContext) || $('button[data-method="getCroppedCanvas"]').prop("disabled", !0), "undefined" == typeof document.createElement("cropper").style.transition && ($('button[data-method="rotate"]').prop("disabled", !0), $('button[data-method="scale"]').prop("disabled", !0)), "undefined" == typeof b[0].download && b.addClass("disabled"), $(".docs-toggles").on("change", "input", function() { + }).cropper(j), $.isFunction(document.createElement("canvas").getContext) || $('button[data-method="getCroppedCanvas"]').prop("disabled", !0), "undefined" == typeof document.createElement("cropper").style.transition && ($('button[data-method="rotate"]').prop("disabled", !0), $('button[data-method="scale"]').prop("disabled", !0)), "undefined" == typeof b[0].download && b.addClass("disabled"), $(".docs-toggles").on("change", "input", function () { var e, f, b = $(this), c = b.attr("name"), d = b.prop("type"); - a.data("cropper") && ("checkbox" === d ? (j[c] = b.prop("checked"), e = a.cropper("getCropBoxData"), f = a.cropper("getCanvasData"), j.built = function() { + a.data("cropper") && ("checkbox" === d ? (j[c] = b.prop("checked"), e = a.cropper("getCropBoxData"), f = a.cropper("getCanvasData"), j.built = function () { a.cropper("setCropBoxData", e), a.cropper("setCanvasData", f) }) : "radio" === d && (j[c] = b.val()), a.cropper("destroy").cropper(j)) - }), $(".docs-buttons").on("click", "[data-method]", function() { + }), $(".docs-buttons").on("click", "[data-method]", function () { var e, f, c = $(this), d = c.data(); if (!c.prop("disabled") && !c.hasClass("disabled") && a.data("cropper") && d.method) { @@ -1042,7 +1023,7 @@ function init_cropper() { console.log(a.message) } } - }), $(document.body).on("keydown", function(b) { + }), $(document.body).on("keydown", function (b) { if (a.data("cropper") && !(this.scrollTop > 300)) switch (b.which) { case 37: b.preventDefault(), a.cropper("move", -1, 0); @@ -1059,9 +1040,9 @@ function init_cropper() { }); var m, k = $("#inputImage"), l = window.URL || window.webkitURL; - l ? k.change(function() { + l ? k.change(function () { var c, b = this.files; - a.data("cropper") && b && b.length && (c = b[0], /^image\/\w+$/.test(c.type) ? (m = l.createObjectURL(c), a.one("built.cropper", function() { + a.data("cropper") && b && b.length && (c = b[0], /^image\/\w+$/.test(c.type) ? (m = l.createObjectURL(c), a.one("built.cropper", function () { l.revokeObjectURL(m) }).cropper("reset").cropper("replace", m), k.val("")) : window.alert("Please choose an image file.")) }) : k.prop("disabled", !0).parent().addClass("disabled") @@ -1071,14 +1052,15 @@ function init_cropper() { function init_knob() { if ("undefined" != typeof $.fn.knob) { console.log("init_knob"), $(".knob").knob({ - change: function(a) {}, - release: function(a) { + change: function (a) { + }, + release: function (a) { console.log("release : " + a) }, - cancel: function() { + cancel: function () { console.log("cancel : ", this) }, - draw: function() { + draw: function () { if ("tron" == this.$.data("skin")) { this.cursorExt = .3; var b, a = this.arc(this.cv), @@ -1092,17 +1074,17 @@ function init_knob() { d = 0, e = $("div.idir"), f = $("div.ival"), - g = function() { + g = function () { d++, e.show().html("+").fadeOut(), f.html(d) }, - h = function() { + h = function () { d--, e.show().html("-").fadeOut(), f.html(d) }; $("input.infinite").knob({ min: 0, max: 20, stopper: !1, - change: function() { + change: function () { a > this.cv ? b ? (h(), b = 0) : (b = 1, c = 0) : a < this.cv && (c ? (g(), c = 0) : (c = 1, b = 0)), a = this.cv } }) @@ -1172,7 +1154,7 @@ function init_IonRangeSlider() { from: +moment().subtract(6, "hours").format("X"), grid: !0, force_edges: !0, - prettify: function(a) { + prettify: function (a) { var b = moment(a, "X"); return b.format("Do MMMM, HH:mm") } @@ -1182,7 +1164,7 @@ function init_IonRangeSlider() { function init_daterangepicker() { if ("undefined" != typeof $.fn.daterangepicker) { console.log("init_daterangepicker"); - var a = function(a, b, c) { + var a = function (a, b, c) { console.log(a.toISOString(), b.toISOString(), c), $("#reportrange span").html(a.format("MMMM D, YYYY") + " - " + b.format("MMMM D, YYYY")) }, b = { @@ -1223,19 +1205,19 @@ function init_daterangepicker() { firstDay: 1 } }; - $("#reportrange span").html(moment().subtract(29, "days").format("MMMM D, YYYY") + " - " + moment().format("MMMM D, YYYY")), $("#reportrange").daterangepicker(b, a), $("#reportrange").on("show.daterangepicker", function() { + $("#reportrange span").html(moment().subtract(29, "days").format("MMMM D, YYYY") + " - " + moment().format("MMMM D, YYYY")), $("#reportrange").daterangepicker(b, a), $("#reportrange").on("show.daterangepicker", function () { console.log("show event fired") - }), $("#reportrange").on("hide.daterangepicker", function() { + }), $("#reportrange").on("hide.daterangepicker", function () { console.log("hide event fired") - }), $("#reportrange").on("apply.daterangepicker", function(a, b) { + }), $("#reportrange").on("apply.daterangepicker", function (a, b) { console.log("apply event fired, start/end dates are " + b.startDate.format("MMMM D, YYYY") + " to " + b.endDate.format("MMMM D, YYYY")) - }), $("#reportrange").on("cancel.daterangepicker", function(a, b) { + }), $("#reportrange").on("cancel.daterangepicker", function (a, b) { console.log("cancel event fired") - }), $("#options1").click(function() { + }), $("#options1").click(function () { $("#reportrange").data("daterangepicker").setOptions(b, a) - }), $("#options2").click(function() { + }), $("#options2").click(function () { $("#reportrange").data("daterangepicker").setOptions(optionSet2, a) - }), $("#destroy").click(function() { + }), $("#destroy").click(function () { $("#reportrange").data("daterangepicker").remove() }) } @@ -1244,7 +1226,7 @@ function init_daterangepicker() { function init_daterangepicker_right() { if ("undefined" != typeof $.fn.daterangepicker) { console.log("init_daterangepicker_right"); - var a = function(a, b, c) { + var a = function (a, b, c) { console.log(a.toISOString(), b.toISOString(), c), $("#reportrange_right span").html(a.format("MMMM D, YYYY") + " - " + b.format("MMMM D, YYYY")) }, b = { @@ -1285,19 +1267,19 @@ function init_daterangepicker_right() { firstDay: 1 } }; - $("#reportrange_right span").html(moment().subtract(29, "days").format("MMMM D, YYYY") + " - " + moment().format("MMMM D, YYYY")), $("#reportrange_right").daterangepicker(b, a), $("#reportrange_right").on("show.daterangepicker", function() { + $("#reportrange_right span").html(moment().subtract(29, "days").format("MMMM D, YYYY") + " - " + moment().format("MMMM D, YYYY")), $("#reportrange_right").daterangepicker(b, a), $("#reportrange_right").on("show.daterangepicker", function () { console.log("show event fired") - }), $("#reportrange_right").on("hide.daterangepicker", function() { + }), $("#reportrange_right").on("hide.daterangepicker", function () { console.log("hide event fired") - }), $("#reportrange_right").on("apply.daterangepicker", function(a, b) { + }), $("#reportrange_right").on("apply.daterangepicker", function (a, b) { console.log("apply event fired, start/end dates are " + b.startDate.format("MMMM D, YYYY") + " to " + b.endDate.format("MMMM D, YYYY")) - }), $("#reportrange_right").on("cancel.daterangepicker", function(a, b) { + }), $("#reportrange_right").on("cancel.daterangepicker", function (a, b) { console.log("cancel event fired") - }), $("#options1").click(function() { + }), $("#options1").click(function () { $("#reportrange_right").data("daterangepicker").setOptions(b, a) - }), $("#options2").click(function() { + }), $("#options2").click(function () { $("#reportrange_right").data("daterangepicker").setOptions(optionSet2, a) - }), $("#destroy").click(function() { + }), $("#destroy").click(function () { $("#reportrange_right").data("daterangepicker").remove() }) } @@ -1307,28 +1289,28 @@ function init_daterangepicker_single_call() { "undefined" != typeof $.fn.daterangepicker && (console.log("init_daterangepicker_single_call"), $("#single_cal1").daterangepicker({ singleDatePicker: !0, singleClasses: "picker_1" - }, function(a, b, c) { + }, function (a, b, c) { console.log(a.toISOString(), b.toISOString(), c) }), $("#single_cal2").daterangepicker({ singleDatePicker: !0, singleClasses: "picker_2" - }, function(a, b, c) { + }, function (a, b, c) { console.log(a.toISOString(), b.toISOString(), c) }), $("#single_cal3").daterangepicker({ singleDatePicker: !0, singleClasses: "picker_3" - }, function(a, b, c) { + }, function (a, b, c) { console.log(a.toISOString(), b.toISOString(), c) }), $("#single_cal4").daterangepicker({ singleDatePicker: !0, singleClasses: "picker_4" - }, function(a, b, c) { + }, function (a, b, c) { console.log(a.toISOString(), b.toISOString(), c) })) } function init_daterangepicker_reservation() { - "undefined" != typeof $.fn.daterangepicker && (console.log("init_daterangepicker_reservation"), $("#reservation").daterangepicker(null, function(a, b, c) { + "undefined" != typeof $.fn.daterangepicker && (console.log("init_daterangepicker_reservation"), $("#reservation").daterangepicker(null, function (a, b, c) { console.log(a.toISOString(), b.toISOString(), c) }), $("#reservation-time").daterangepicker({ timePicker: !0, @@ -1346,9 +1328,9 @@ function init_SmartWizard() { } function init_validator() { - "undefined" != typeof validator && (console.log("init_validator"), validator.message.date = "not a real date", $("form").on("blur", "input[required], input.optional, select.required", validator.checkField).on("change", "select.required", validator.checkField).on("keypress", "input[required][pattern]", validator.keypress), $(".multi.required").on("keyup blur", "input", function() { + "undefined" != typeof validator && (console.log("init_validator"), validator.message.date = "not a real date", $("form").on("blur", "input[required], input.optional, select.required", validator.checkField).on("change", "select.required", validator.checkField).on("keypress", "input[required][pattern]", validator.keypress), $(".multi.required").on("keyup blur", "input", function () { validator.checkField.apply($(this).siblings().last()[0]) - }), $("form").submit(function(a) { + }), $("form").submit(function (a) { a.preventDefault(); var b = !0; return validator.checkAll($(this)) || (b = !1), b && this.submit(), !1 @@ -1366,7 +1348,7 @@ function init_PNotify() { addclass: "dark", styling: "bootstrap3", hide: !1, - before_close: function(a) { + before_close: function (a) { return a.update({ title: a.options.title + " - Enjoy your Stay", before_close: null @@ -1379,11 +1361,11 @@ function init_CustomNotification() { if (console.log("run_customtabs"), "undefined" != typeof CustomTabs) { console.log("init_CustomTabs"); var a = 10; - TabbedNotification = function(b) { + TabbedNotification = function (b) { var c = ""; document.getElementById("custom_notifications") ? ($("#custom_notifications ul.notifications").append("
  • "), $("#custom_notifications #notif-group").append(c), a++, CustomTabs(b)) : alert("doesnt exists") - }, CustomTabs = function(a) { - $(".tabbed_notifications > div").hide(), $(".tabbed_notifications > div:first-of-type").show(), $("#custom_notifications").removeClass("dsp_none"), $(".notifications a").click(function(a) { + }, CustomTabs = function (a) { + $(".tabbed_notifications > div").hide(), $(".tabbed_notifications > div:first-of-type").show(), $("#custom_notifications").removeClass("dsp_none"), $(".notifications a").click(function (a) { a.preventDefault(); var b = $(this), c = "#" + b.parents(".notifications").data("tabbed_notifications"), @@ -1393,7 +1375,7 @@ function init_CustomNotification() { }) }, CustomTabs(); var b = idname = ""; - $(document).on("click", ".notification_close", function(a) { + $(document).on("click", ".notification_close", function (a) { idname = $(this).parent().parent().attr("id"), b = idname.substr(-2), $("#ntf" + b).remove(), $("#ntlink" + b).parent().remove(), $(".notifications a").first().addClass("active"), $("#notif-group div").first().css("display", "block") }) } @@ -1410,19 +1392,20 @@ function init_EasyPieChart() { lineWidth: 20, trackWidth: 16, lineCap: "butt", - onStep: function(a, b, c) { + onStep: function (a, b, c) { $(this.el).find(".percent").text(Math.round(c)) } }); var a = window.chart = $(".chart").data("easyPieChart"); - $(".js_update").on("click", function() { + $(".js_update").on("click", function () { a.update(200 * Math.random() - 100) }); var b = $.fn.popover.Constructor.prototype.leave; - $.fn.popover.Constructor.prototype.leave = function(a) { - var d, e, c = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type); - b.call(this, a), a.currentTarget && (d = $(a.currentTarget).siblings(".popover"), e = c.timeout, d.one("mouseenter", function() { - clearTimeout(e), d.one("mouseleave", function() { + $.fn.popover.Constructor.prototype.leave = function (a) { + var d, e, + c = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type); + b.call(this, a), a.currentTarget && (d = $(a.currentTarget).siblings(".popover"), e = c.timeout, d.one("mouseenter", function () { + clearTimeout(e), d.one("mouseleave", function () { $.fn.popover.Constructor.prototype.leave.call(c, c) }) })) @@ -1732,7 +1715,7 @@ function init_charts() { } function init_compose() { - "undefined" != typeof $.fn.slideToggle && (console.log("init_compose"), $("#compose, .compose-close").click(function() { + "undefined" != typeof $.fn.slideToggle && (console.log("init_compose"), $("#compose, .compose-close").click(function () { $(".compose").slideToggle() })) } @@ -1752,8 +1735,8 @@ function init_calendar() { }, selectable: !0, selectHelper: !0, - select: function(a, b, c) { - $("#fc_create").click(), e = a, ended = b, $(".antosubmit").on("click", function() { + select: function (a, b, c) { + $("#fc_create").click(), e = a, ended = b, $(".antosubmit").on("click", function () { var a = $("#title").val(); return b && (ended = b), f = $("#event_type").val(), a && g.fullCalendar("renderEvent", { title: a, @@ -1763,8 +1746,8 @@ function init_calendar() { }, !0), $("#title").val(""), g.fullCalendar("unselect"), $(".antoclose").click(), !1 }) }, - eventClick: function(a, b, c) { - $("#fc_edit").click(), $("#title2").val(a.title), f = $("#event_type").val(), $(".antosubmit2").on("click", function() { + eventClick: function (a, b, c) { + $("#fc_edit").click(), $("#title2").val(a.title), f = $("#event_type").val(), $(".antosubmit2").on("click", function () { a.title = $("#title2").val(), g.fullCalendar("updateEvent", a), $(".antoclose2").click() }), g.fullCalendar("unselect") }, @@ -1803,7 +1786,7 @@ function init_calendar() { function init_DataTables() { if (console.log("run_datatables"), "undefined" != typeof $.fn.DataTable) { console.log("init_DataTables"); - var a = function() { + var a = function () { $("#datatable-buttons").length && $("#datatable-buttons").DataTable({ dom: "Bfrtip", buttons: [{ @@ -1825,10 +1808,10 @@ function init_DataTables() { responsive: !0 }) }; - TableManageButtons = function() { + TableManageButtons = function () { "use strict"; return { - init: function() { + init: function () { a() } } @@ -1852,12 +1835,14 @@ function init_DataTables() { orderable: !1, targets: [0] }] - }), b.on("draw.dt", function() { + }), b.on("draw.dt", function () { $("checkbox input").iCheck({ checkboxClass: "icheckbox_flat-green" }) }), TableManageButtons.init() } + //fix for dynamic tables + setContentHeight(); } function init_morris_charts() { @@ -1981,7 +1966,7 @@ function init_morris_charts() { hideHover: "auto", labels: ["Y", "Z", "A"], resize: !0 - }).on("click", function(a, b) { + }).on("click", function (a, b) { console.log(a, b) }), $("#graph_area").length && Morris.Area({ element: "graph_area", @@ -2059,7 +2044,7 @@ function init_morris_charts() { value: 10 }], colors: ["#26B99A", "#34495E", "#ACADAC", "#3498DB"], - formatter: function(a) { + formatter: function (a) { return a + "%" }, resize: !0 @@ -2087,7 +2072,7 @@ function init_morris_charts() { value: 20 }], resize: !0 - }), $MENU_TOGGLE.on("click", function() { + }), $MENU_TOGGLE.on("click", function () { $(window).resize() }))) } @@ -2543,7 +2528,7 @@ function init_echarts() { }, axisLabel: { show: !0, - formatter: function(a) { + formatter: function (a) { switch (a + "") { case "10": return "a"; @@ -2739,7 +2724,7 @@ function init_echarts() { type: "scatter", tooltip: { trigger: "item", - formatter: function(a) { + formatter: function (a) { return a.value.length > 1 ? a.seriesName + " :
    " + a.value[0] + "cm " + a.value[1] + "kg " : a.seriesName + " :
    " + a.name + " : " + a.value + "kg " } }, @@ -3025,7 +3010,7 @@ function init_echarts() { type: "scatter", tooltip: { trigger: "item", - formatter: function(a) { + formatter: function (a) { return a.value.length > 1 ? a.seriesName + " :
    " + a.value[0] + "cm " + a.value[1] + "kg " : a.seriesName + " :
    " + a.name + " : " + a.value + "kg " } }, @@ -3673,7 +3658,7 @@ function init_echarts() { }, tooltip: { trigger: "item", - formatter: function(a) { + formatter: function (a) { var b = (a.value + "").split("."); return b = b[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + "." + b[1], a.seriesName + "
    " + a.name + " : " + b } @@ -4262,83 +4247,87 @@ function init_echarts() { }) } } -}! function(a, b) { - var c = function(a, b, c) { +} + +!function (a, b) { + var c = function (a, b, c) { var d; - return function() { + return function () { function h() { c || a.apply(f, g), d = null } + var f = this, g = arguments; d ? clearTimeout(d) : c && a.apply(f, g), d = setTimeout(h, b || 100) } }; - jQuery.fn[b] = function(a) { + jQuery.fn[b] = function (a) { return a ? this.bind("resize", c(a)) : this.trigger(b) } }(jQuery, "smartresize"); -$(document).ready(function() { - $(".collapse-link").on("click", function() { +$(document).ready(function () { + $(".collapse-link").on("click", function () { var a = $(this).closest(".x_panel"), b = $(this).find("i"), c = a.find(".x_content"); - a.attr("style") ? c.slideToggle(200, function() { + a.attr("style") ? c.slideToggle(200, function () { a.removeAttr("style") }) : (c.slideToggle(200), a.css("height", "auto")), b.toggleClass("fa-chevron-up fa-chevron-down") - }), $(".close-link").click(function() { + }), $(".close-link").click(function () { var a = $(this).closest(".x_panel"); a.remove() }) -}), $(document).ready(function() { +}), $(document).ready(function () { $('[data-toggle="tooltip"]').tooltip({ container: "body" }) -}), $(".progress .progress-bar")[0] && $(".progress .progress-bar").progressbar(), $(document).ready(function() { +}), $(".progress .progress-bar")[0] && $(".progress .progress-bar").progressbar(), $(document).ready(function () { if ($(".js-switch")[0]) { var a = Array.prototype.slice.call(document.querySelectorAll(".js-switch")); - a.forEach(function(a) { + a.forEach(function (a) { new Switchery(a, { color: "#26B99A" }) }) } -}), $(document).ready(function() { - $("input.flat")[0] && $(document).ready(function() { +}), $(document).ready(function () { + $("input.flat")[0] && $(document).ready(function () { $("input.flat").iCheck({ checkboxClass: "icheckbox_flat-green", radioClass: "iradio_flat-green" }) }) -}), $("table input").on("ifChecked", function() { +}), $("table input").on("ifChecked", function () { checkState = "", $(this).parent().parent().parent().addClass("selected"), countChecked() -}), $("table input").on("ifUnchecked", function() { +}), $("table input").on("ifUnchecked", function () { checkState = "", $(this).parent().parent().parent().removeClass("selected"), countChecked() }); var checkState = ""; -$(".bulk_action input").on("ifChecked", function() { +$(".bulk_action input").on("ifChecked", function () { checkState = "", $(this).parent().parent().parent().addClass("selected"), countChecked() -}), $(".bulk_action input").on("ifUnchecked", function() { +}), $(".bulk_action input").on("ifUnchecked", function () { checkState = "", $(this).parent().parent().parent().removeClass("selected"), countChecked() -}), $(".bulk_action input#check-all").on("ifChecked", function() { +}), $(".bulk_action input#check-all").on("ifChecked", function () { checkState = "all", countChecked() -}), $(".bulk_action input#check-all").on("ifUnchecked", function() { +}), $(".bulk_action input#check-all").on("ifUnchecked", function () { checkState = "none", countChecked() -}), $(document).ready(function() { - $(".expand").on("click", function() { +}), $(document).ready(function () { + $(".expand").on("click", function () { $(this).next().slideToggle(200), $expand = $(this).find(">:first-child"), "+" == $expand.text() ? $expand.text("-") : $expand.text("+") }) -}), "undefined" != typeof NProgress && ($(document).ready(function() { +}), "undefined" != typeof NProgress && ($(document).ready(function () { NProgress.start() -}), $(window).on('load', function() { +}), $(window).on('load', function () { NProgress.done() })); var originalLeave = $.fn.popover.Constructor.prototype.leave; -$.fn.popover.Constructor.prototype.leave = function(a) { - var c, d, b = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type); - originalLeave.call(this, a), a.currentTarget && (c = $(a.currentTarget).siblings(".popover"), d = b.timeout, c.one("mouseenter", function() { - clearTimeout(d), c.one("mouseleave", function() { +$.fn.popover.Constructor.prototype.leave = function (a) { + var c, d, + b = a instanceof this.constructor ? a : $(a.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type); + originalLeave.call(this, a), a.currentTarget && (c = $(a.currentTarget).siblings(".popover"), d = b.timeout, c.one("mouseenter", function () { + clearTimeout(d), c.one("mouseleave", function () { $.fn.popover.Constructor.prototype.leave.call(b, b) }) })) @@ -4350,7 +4339,7 @@ $.fn.popover.Constructor.prototype.leave = function(a) { hide: 400 } -}), $(document).ready(function() { +}), $(document).ready(function () { init_sparklines(), init_flot_chart(), init_wysiwyg(), @@ -4384,4 +4373,3 @@ $.fn.popover.Constructor.prototype.leave = function(a) { init_autosize(), init_autocomplete() }); - \ No newline at end of file diff --git a/build/js/custom.min.js b/build/js/custom.min.js index 3e6c540a..46d70edb 100644 --- a/build/js/custom.min.js +++ b/build/js/custom.min.js @@ -1,3 +1,3 @@ function countChecked(){"all"===checkState&&$(".bulk_action input[name='table_records']").iCheck("check"),"none"===checkState&&$(".bulk_action input[name='table_records']").iCheck("uncheck");var e=$(".bulk_action input[name='table_records']:checked").length;e?($(".column-title").hide(),$(".bulk-actions").show(),$(".action-cnt").html(e+" Records Selected")):($(".column-title").show(),$(".bulk-actions").hide())}function gd(e,a,t){return new Date(e,a-1,t).getTime()}function init_flot_chart(){if("undefined"!=typeof $.plot){console.log("init_flot_chart");for(var e=[[gd(2012,1,1),17],[gd(2012,1,2),74],[gd(2012,1,3),6],[gd(2012,1,4),39],[gd(2012,1,5),20],[gd(2012,1,6),85],[gd(2012,1,7),7]],a=[[gd(2012,1,1),82],[gd(2012,1,2),23],[gd(2012,1,3),66],[gd(2012,1,4),9],[gd(2012,1,5),119],[gd(2012,1,6),6],[gd(2012,1,7),9]],t=[],n=[[0,1],[1,9],[2,6],[3,10],[4,5],[5,17],[6,6],[7,10],[8,7],[9,11],[10,35],[11,9],[12,12],[13,5],[14,3],[15,4],[16,9]],o=0;o<30;o++)t.push([new Date(Date.today().add(o).days()).getTime(),randNum()+o+o+10]);var i={series:{lines:{show:!1,fill:!0},splines:{show:!0,tension:.4,lineWidth:1,fill:.4},points:{radius:0,show:!0},shadowSize:2},grid:{verticalLines:!0,hoverable:!0,clickable:!0,tickColor:"#d5d5d5",borderWidth:1,color:"#fff"},colors:["rgba(38, 185, 154, 0.38)","rgba(3, 88, 106, 0.38)"],xaxis:{tickColor:"rgba(51, 51, 51, 0.06)",mode:"time",tickSize:[1,"day"],axisLabel:"Date",axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial",axisLabelPadding:10},yaxis:{ticks:8,tickColor:"rgba(51, 51, 51, 0.06)"},tooltip:!1},r={grid:{show:!0,aboveData:!0,color:"#3f3f3f",labelMargin:10,axisMargin:0,borderWidth:0,borderColor:null,minBorderMargin:5,clickable:!0,hoverable:!0,autoHighlight:!0,mouseActiveRadius:100},series:{lines:{show:!0,fill:!0,lineWidth:2,steps:!1},points:{show:!0,radius:4.5,symbol:"circle",lineWidth:3}},legend:{position:"ne",margin:[0,-25],noColumns:0,labelBoxBorderColor:null,labelFormatter:function(e,a){return e+"  "},width:40,height:1},colors:["#96CA59","#3F97EB","#72c380","#6f7a8a","#f7cb38","#5a8022","#2c7282"],shadowSize:0,tooltip:!0,tooltipOpts:{content:"%s: %y.0",xDateFormat:"%d/%m",shifts:{x:-30,y:-50},defaultTheme:!1},yaxis:{min:0},xaxis:{mode:"time",minTickSize:[1,"day"],timeformat:"%d/%m/%y",min:t[0][0],max:t[20][0]}},l={series:{curvedLines:{apply:!0,active:!0,monotonicFit:!0}},colors:["#26B99A"],grid:{borderWidth:{top:0,right:0,bottom:1,left:1},borderColor:{bottom:"#7F8790",left:"#7F8790"}}};$("#chart_plot_01").length&&(console.log("Plot1"),$.plot($("#chart_plot_01"),[e,a],i)),$("#chart_plot_02").length&&(console.log("Plot2"),$.plot($("#chart_plot_02"),[{label:"Email Sent",data:t,lines:{fillColor:"rgba(150, 202, 89, 0.12)"},points:{fillColor:"#fff"}}],r)),$("#chart_plot_03").length&&(console.log("Plot3"),$.plot($("#chart_plot_03"),[{label:"Registrations",data:n,lines:{fillColor:"rgba(150, 202, 89, 0.12)"},points:{fillColor:"#fff"}}],l))}}function init_starrr(){"undefined"!=typeof starrr&&(console.log("init_starrr"),$(".stars").starrr(),$(".stars-existing").starrr({rating:4}),$(".stars").on("starrr:change",function(e,a){$(".stars-count").html(a)}),$(".stars-existing").on("starrr:change",function(e,a){$(".stars-count-existing").html(a)}))}function init_JQVmap(){"undefined"!=typeof jQuery.fn.vectorMap&&(console.log("init_JQVmap"),$("#world-map-gdp").length&&$("#world-map-gdp").vectorMap({map:"world_en",backgroundColor:null,color:"#ffffff",hoverOpacity:.7,selectedColor:"#666666",enableZoom:!0,showTooltip:!0,values:sample_data,scaleColors:["#E6F2F0","#149B7E"],normalizeFunction:"polynomial"}),$("#usa_map").length&&$("#usa_map").vectorMap({map:"usa_en",backgroundColor:null,color:"#ffffff",hoverOpacity:.7,selectedColor:"#666666",enableZoom:!0,showTooltip:!0,values:sample_data,scaleColors:["#E6F2F0","#149B7E"],normalizeFunction:"polynomial"}))}function init_skycons(){if("undefined"!=typeof Skycons){console.log("init_skycons");var e,a=new Skycons({color:"#73879C"}),t=["clear-day","clear-night","partly-cloudy-day","partly-cloudy-night","cloudy","rain","sleet","snow","wind","fog"];for(e=t.length;e--;)a.set(t[e],t[e]);a.play()}}function init_chart_doughnut(){if("undefined"!=typeof Chart&&(console.log("init_chart_doughnut"),$(".canvasDoughnut").length)){var e={type:"doughnut",tooltipFillColor:"rgba(51, 51, 51, 0.55)",data:{labels:["Symbian","Blackberry","Other","Android","IOS"],datasets:[{data:[15,20,30,10,30],backgroundColor:["#BDC3C7","#9B59B6","#E74C3C","#26B99A","#3498DB"],hoverBackgroundColor:["#CFD4D8","#B370CF","#E95E4F","#36CAAB","#49A9EA"]}]},options:{legend:!1,responsive:!1}};$(".canvasDoughnut").each(function(){var a=$(this);new Chart(a,e)})}}function init_gauge(){if("undefined"!=typeof Gauge){console.log("init_gauge ["+$(".gauge-chart").length+"]"),console.log("init_gauge");var e={lines:12,angle:0,lineWidth:.4,pointer:{length:.75,strokeWidth:.042,color:"#1D212A"},limitMax:"false",colorStart:"#1ABC9C",colorStop:"#1ABC9C",strokeColor:"#F0F3F3",generateGradient:!0};if($("#chart_gauge_01").length)var a=document.getElementById("chart_gauge_01"),t=new Gauge(a).setOptions(e);if($("#gauge-text").length&&(t.maxValue=6e3,t.animationSpeed=32,t.set(3200),t.setTextField(document.getElementById("gauge-text"))),$("#chart_gauge_02").length)var n=document.getElementById("chart_gauge_02"),o=new Gauge(n).setOptions(e);$("#gauge-text2").length&&(o.maxValue=9e3,o.animationSpeed=32,o.set(2400),o.setTextField(document.getElementById("gauge-text2")))}}function init_sparklines(){"undefined"!=typeof jQuery.fn.sparkline&&(console.log("init_sparklines"),$(".sparkline_one").sparkline([2,4,3,4,5,4,5,4,3,4,5,6,4,5,6,3,5,4,5,4,5,4,3,4,5,6,7,5,4,3,5,6],{type:"bar",height:"125",barWidth:13,colorMap:{7:"#a1a1a1"},barSpacing:2,barColor:"#26B99A"}),$(".sparkline_two").sparkline([2,4,3,4,5,4,5,4,3,4,5,6,7,5,4,3,5,6],{type:"bar",height:"40",barWidth:9,colorMap:{7:"#a1a1a1"},barSpacing:2,barColor:"#26B99A"}),$(".sparkline_three").sparkline([2,4,3,4,5,4,5,4,3,4,5,6,7,5,4,3,5,6],{type:"line",width:"200",height:"40",lineColor:"#26B99A",fillColor:"rgba(223, 223, 223, 0.57)",lineWidth:2,spotColor:"#26B99A",minSpotColor:"#26B99A"}),$(".sparkline11").sparkline([2,4,3,4,5,4,5,4,3,4,6,2,4,3,4,5,4,5,4,3],{type:"bar",height:"40",barWidth:8,colorMap:{7:"#a1a1a1"},barSpacing:2,barColor:"#26B99A"}),$(".sparkline22").sparkline([2,4,3,4,7,5,4,3,5,6,2,4,3,4,5,4,5,4,3,4,6],{type:"line",height:"40",width:"200",lineColor:"#26B99A",fillColor:"#ffffff",lineWidth:3,spotColor:"#34495E",minSpotColor:"#34495E"}),$(".sparkline_bar").sparkline([2,4,3,4,5,4,5,4,3,4,5,6,4,5,6,3,5],{type:"bar",colorMap:{7:"#a1a1a1"},barColor:"#26B99A"}),$(".sparkline_area").sparkline([5,6,7,9,9,5,3,2,2,4,6,7],{type:"line",lineColor:"#26B99A",fillColor:"#26B99A",spotColor:"#4578a0",minSpotColor:"#728fb2",maxSpotColor:"#6d93c4",highlightSpotColor:"#ef5179",highlightLineColor:"#8ba8bf",spotRadius:2.5,width:85}),$(".sparkline_line").sparkline([2,4,3,4,5,4,5,4,3,4,5,6,4,5,6,3,5],{type:"line",lineColor:"#26B99A",fillColor:"#ffffff",width:85,spotColor:"#34495E",minSpotColor:"#34495E"}),$(".sparkline_pie").sparkline([1,1,2,1],{type:"pie",sliceColors:["#26B99A","#ccc","#75BCDD","#D66DE2"]}),$(".sparkline_discreet").sparkline([4,6,7,7,4,3,2,1,4,4,2,4,3,7,8,9,7,6,4,3],{type:"discrete",barWidth:3,lineColor:"#26B99A",width:"85"}))}function init_autocomplete(){if("undefined"!=typeof autocomplete){console.log("init_autocomplete");var e={AD:"Andorra",A2:"Andorra Test",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AN:"Netherlands Antilles",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei",BO:"Bolivia",BQ:"British Antarctic Territory",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos [Keeling] Islands",CD:"Congo - Kinshasa",CF:"Central African Republic",CG:"Congo - Brazzaville",CH:"Switzerland",CI:"Côte d’Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CS:"Serbia and Montenegro",CT:"Canton and Enderbury Islands",CU:"Cuba",CV:"Cape Verde",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DD:"East Germany",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Micronesia",FO:"Faroe Islands",FQ:"French Southern and Antarctic Territories",FR:"France",FX:"Metropolitan France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong SAR China",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",JT:"Johnston Island",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MI:"Midway Islands",MK:"Macedonia",ML:"Mali",MM:"Myanmar [Burma]",MN:"Mongolia",MO:"Macau SAR China",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NQ:"Dronning Maud Land",NR:"Nauru",NT:"Neutral Zone",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PC:"Pacific Islands Trust Territory",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn Islands",PR:"Puerto Rico",PS:"Palestinian Territories",PT:"Portugal",PU:"U.S. Miscellaneous Pacific Islands",PW:"Palau",PY:"Paraguay",PZ:"Panama Canal Zone",QA:"Qatar",RE:"Réunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",ST:"São Tomé and Príncipe",SU:"Union of Soviet Socialist Republics",SV:"El Salvador",SY:"Syria",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"U.S. Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Vatican City",VC:"Saint Vincent and the Grenadines",VD:"North Vietnam",VE:"Venezuela",VG:"British Virgin Islands",VI:"U.S. Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WK:"Wake Island",WS:"Samoa",YD:"People's Democratic Republic of Yemen",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"Unknown or Invalid Region"},a=$.map(e,function(e,a){return{value:e,data:a}});$("#autocomplete-custom-append").autocomplete({lookup:a})}}function init_autosize(){"undefined"!=typeof $.fn.autosize&&autosize($(".resizable_textarea"))}function init_parsley(){if("undefined"!=typeof parsley){console.log("init_parsley"),$("parsley:field:validate",function(){e()}),$("#demo-form .btn").on("click",function(){$("#demo-form").parsley().validate(),e()});var e=function(){!0===$("#demo-form").parsley().isValid()?($(".bs-callout-info").removeClass("hidden"),$(".bs-callout-warning").addClass("hidden")):($(".bs-callout-info").addClass("hidden"),$(".bs-callout-warning").removeClass("hidden"))};$("parsley:field:validate",function(){e()}),$("#demo-form2 .btn").on("click",function(){$("#demo-form2").parsley().validate(),e()});var e=function(){!0===$("#demo-form2").parsley().isValid()?($(".bs-callout-info").removeClass("hidden"),$(".bs-callout-warning").addClass("hidden")):($(".bs-callout-info").addClass("hidden"),$(".bs-callout-warning").removeClass("hidden"))};try{hljs.initHighlightingOnLoad()}catch(e){}}}function onAddTag(e){alert("Added a tag: "+e)}function onRemoveTag(e){alert("Removed a tag: "+e)}function onChangeTag(e,a){alert("Changed a tag: "+a)}function init_TagsInput(){"undefined"!=typeof $.fn.tagsInput&&$("#tags_1").tagsInput({width:"auto"})}function init_select2(){"undefined"!=typeof select2&&(console.log("init_toolbox"),$(".select2_single").select2({placeholder:"Select a state",allowClear:!0}),$(".select2_group").select2({}),$(".select2_multiple").select2({maximumSelectionLength:4,placeholder:"With Max Selection limit 4",allowClear:!0}))}function init_wysiwyg(){function e(e,a){var t="";"unsupported-file-type"===e?t="Unsupported format "+a:console.log("error uploading file",e,a),$('
    File upload error '+t+"
    ").prependTo("#alerts")}"undefined"!=typeof $.fn.wysiwyg&&(console.log("init_wysiwyg"),$(".editor-wrapper").each(function(){var a=$(this).attr("id");$(this).wysiwyg({toolbarSelector:'[data-target="#'+a+'"]',fileUploadError:e})}),window.prettyPrint,prettyPrint())}function init_cropper(){if("undefined"!=typeof $.fn.cropper){console.log("init_cropper");var e=$("#image"),a=$("#download"),t=$("#dataX"),n=$("#dataY"),o=$("#dataHeight"),i=$("#dataWidth"),r=$("#dataRotate"),l=$("#dataScaleX"),s=$("#dataScaleY"),c={aspectRatio:16/9,preview:".img-preview",crop:function(e){t.val(Math.round(e.x)),n.val(Math.round(e.y)),o.val(Math.round(e.height)),i.val(Math.round(e.width)),r.val(e.rotate),l.val(e.scaleX),s.val(e.scaleY)}};$('[data-toggle="tooltip"]').tooltip(),e.on({"build.cropper":function(e){console.log(e.type)},"built.cropper":function(e){console.log(e.type)},"cropstart.cropper":function(e){console.log(e.type,e.action)},"cropmove.cropper":function(e){console.log(e.type,e.action)},"cropend.cropper":function(e){console.log(e.type,e.action)},"crop.cropper":function(e){console.log(e.type,e.x,e.y,e.width,e.height,e.rotate,e.scaleX,e.scaleY)},"zoom.cropper":function(e){console.log(e.type,e.ratio)}}).cropper(c),$.isFunction(document.createElement("canvas").getContext)||$('button[data-method="getCroppedCanvas"]').prop("disabled",!0),"undefined"==typeof document.createElement("cropper").style.transition&&($('button[data-method="rotate"]').prop("disabled",!0),$('button[data-method="scale"]').prop("disabled",!0)),"undefined"==typeof a[0].download&&a.addClass("disabled"),$(".docs-toggles").on("change","input",function(){var a,t,n=$(this),o=n.attr("name"),i=n.prop("type");e.data("cropper")&&("checkbox"===i?(c[o]=n.prop("checked"),a=e.cropper("getCropBoxData"),t=e.cropper("getCanvasData"),c.built=function(){e.cropper("setCropBoxData",a),e.cropper("setCanvasData",t)}):"radio"===i&&(c[o]=n.val()),e.cropper("destroy").cropper(c))}),$(".docs-buttons").on("click","[data-method]",function(){var e,t,n=$(this),o=n.data();if(!n.prop("disabled")&&!n.hasClass("disabled")&&i.data("cropper")&&o.method){if(o=$.extend({},o),"undefined"!=typeof o.target&&(e=$(o.target),"undefined"==typeof o.option))try{o.option=JSON.parse(e.val())}catch(i){console.log(i.message)}switch(t=i.cropper(o.method,o.option,o.secondOption),o.method){case"scaleX":case"scaleY":$(this).data("option",-o.option);break;case"getCroppedCanvas":t&&($("#getCroppedCanvasModal").modal().find(".modal-body").html(t),a.hasClass("disabled")||a.attr("href",t.toDataURL()))}if($.isPlainObject(t)&&e)try{e.val(JSON.stringify(t))}catch(i){console.log(i.message)}}}),$(document.body).on("keydown",function(a){if(e.data("cropper")&&!(this.scrollTop>300))switch(a.which){case 37:a.preventDefault(),e.cropper("move",-1,0);break;case 38:a.preventDefault(),e.cropper("move",0,-1);break;case 39:a.preventDefault(),e.cropper("move",1,0);break;case 40:a.preventDefault(),e.cropper("move",0,1)}});var d,u=$("#inputImage"),m=window.URL||window.webkitURL;m?u.change(function(){var a,t=this.files;e.data("cropper")&&t&&t.length&&(a=t[0],/^image\/\w+$/.test(a.type)?(d=m.createObjectURL(a),e.one("built.cropper",function(){m.revokeObjectURL(d)}).cropper("reset").cropper("replace",d),u.val("")):window.alert("Please choose an image file."))}):u.prop("disabled",!0).parent().addClass("disabled")}}function init_knob(){if("undefined"!=typeof $.fn.knob){console.log("init_knob"),$(".knob").knob({change:function(e){},release:function(e){console.log("release : "+e)},cancel:function(){console.log("cancel : ",this)},draw:function(){if("tron"==this.$.data("skin")){this.cursorExt=.3;var e,a=this.arc(this.cv),t=1;return this.g.lineWidth=this.lineWidth,this.o.displayPrevious&&(e=this.arc(this.v),this.g.beginPath(),this.g.strokeStyle=this.pColor,this.g.arc(this.xy,this.xy,this.radius-this.lineWidth,e.s,e.e,e.d),this.g.stroke()),this.g.beginPath(),this.g.strokeStyle=t?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+2*this.lineWidth/3,0,2*Math.PI,!1),this.g.stroke(),!1}}});var e,a=0,t=0,n=0,o=$("div.idir"),i=$("div.ival"),r=function(){n++,o.show().html("+").fadeOut(),i.html(n)},l=function(){n--,o.show().html("-").fadeOut(),i.html(n)};$("input.infinite").knob({min:0,max:20,stopper:!1,change:function(){e>this.cv?a?(l(),a=0):(a=1,t=0):e