var jQuery = require('jquery'); window.jQuery = jQuery window.$ = jQuery // window._ = require('lodash'); //the only place I saw this used was vue.js, and we don't use that anymore /**************************************** Much of what you'll see below is just plain require()'ed, this is because it is mostly jQuery stuff, which attaches itself to the $() function/object So we don't have to assign it to anything, it will just automagically attach itself *****************************************/ require("jquery-ui/dist/jquery-ui") jQuery.fn.uitooltip = jQuery.fn.tooltip; require('bootstrap-less'); require('select2'); require('admin-lte'); require('tether'); require('jquery-slimscroll'); require('jquery.iframe-transport'); //probably not needed anymore, if I'm honest require('blueimp-file-upload') require('bootstrap-colorpicker') require('bootstrap-datepicker') require('ekko-lightbox') //TODO - this doesn't seem jquery-ish, we might need to do something weird here // it *does* require Bootstrap, which requires jquery, so maybe that's OK // it seems to work... require('./extensions/pGenerator.jquery'); //WEIRD, but works //require('chart.js') // Weirdly, this seems to "just work." Without this line, the dashboard blows up // but it's *HUGE* - and we only use it one place. So we're taking it out of the bundle window.SignaturePad = require('./signature_pad'); //ALSO WEIRD - but works require('jquery-validation') window.List = require('list.js') window.ClipboardJS = require('clipboard') // TODO - find everything using moment.js and kill it or upgrade it? It's huge // - adminLTE (UGH) // - bootstrap-daterangepicker // - fullcalendar (what's that? it's used by AdminLTE) /** * Module containing core application logic. * @param {jQuery} $ Insulated jQuery object * @param {JSON} settings Insulated `window.snipeit.settings` object. * @return {IIFE} Immediately invoked. Returns self. */ lineOptions = { legend: { position: "bottom" }, scales: { yAxes: [{ ticks: { fontColor: "rgba(0,0,0,0.5)", fontStyle: "bold", beginAtZero: true, maxTicksLimit: 5, padding: 20 }, gridLines: { drawTicks: false, display: false } }], xAxes: [{ gridLines: { zeroLineColor: "transparent" }, ticks: { padding: 20, fontColor: "rgba(0,0,0,0.5)", fontStyle: "bold" } }] } }; pieOptions = { //Boolean - Whether we should show a stroke on each segment segmentShowStroke: true, //String - The colour of each segment stroke segmentStrokeColor: "#fff", //Number - The width of each segment stroke segmentStrokeWidth: 1, //Number - The percentage of the chart that we cut out of the middle percentageInnerCutout: 50, // This is 0 for Pie charts //Number - Amount of animation steps animationSteps: 100, //String - Animation easing effect animationEasing: "easeOutBounce", //Boolean - Whether we animate the rotation of the Doughnut animateRotate: true, //Boolean - Whether we animate scaling the Doughnut from the centre animateScale: false, //Boolean - whether to make the chart responsive to window resizing responsive: true, // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container maintainAspectRatio: false, //String - A legend template legendTemplate: "