Moved chart.js library into vendor.js

This commit is contained in:
Wes Hulette 2018-09-28 16:03:52 -04:00
parent 991a00b38f
commit 11f128a84f
17 changed files with 79 additions and 177 deletions

69
npm-shrinkwrap.json generated
View file

@ -1961,15 +1961,38 @@
"integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=",
"dev": true "dev": true
}, },
"charm": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/charm/-/charm-0.1.2.tgz",
"integrity": "sha1-BsIe7RobBq62dVPNxT4jJ0usIpY="
},
"chart.js": { "chart.js": {
"version": "1.0.2", "version": "2.7.2",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-1.0.2.tgz", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.7.2.tgz",
"integrity": "sha1-rVfSIpz9jM9ZVRR+gSG0kR5p3+c=" "integrity": "sha512-90wl3V9xRZ8tnMvMlpcW+0Yg13BelsGS9P9t0ClaDxv/hdypHDr/YAGf+728m11P5ljwyB0ZHfPKCapZFqSqYA==",
"requires": {
"chartjs-color": "^2.1.0",
"moment": "^2.10.2"
}
},
"chartjs-color": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.2.0.tgz",
"integrity": "sha1-hKL7dVeH7YXDndbdjHsdiEKbrq4=",
"requires": {
"chartjs-color-string": "^0.5.0",
"color-convert": "^0.5.3"
},
"dependencies": {
"color-convert": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz",
"integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0="
}
}
},
"chartjs-color-string": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/chartjs-color-string/-/chartjs-color-string-0.5.0.tgz",
"integrity": "sha512-amWNvCOXlOUYxZVDSa0YOab5K/lmEhbFNKI55PWc4mlv28BDzA7zaoQTGxSBgJMHIW+hGX8YUrvw/FH4LyhwSQ==",
"requires": {
"color-name": "^1.0.0"
}
}, },
"chokidar": { "chokidar": {
"version": "2.0.4", "version": "2.0.4",
@ -2201,8 +2224,7 @@
"color-name": { "color-name": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
"dev": true
}, },
"color-string": { "color-string": {
"version": "0.3.0", "version": "0.3.0",
@ -6715,38 +6737,11 @@
"minimist": "0.0.8" "minimist": "0.0.8"
} }
}, },
"module-deps": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.1.0.tgz",
"integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==",
"requires": {
"JSONStream": "^1.0.3",
"browser-resolve": "^1.7.0",
"cached-path-relative": "^1.0.0",
"concat-stream": "~1.6.0",
"defined": "^1.0.0",
"detective": "^5.0.2",
"duplexer2": "^0.1.2",
"inherits": "^2.0.1",
"parents": "^1.0.0",
"readable-stream": "^2.0.2",
"resolve": "^1.4.0",
"stream-combiner2": "^1.1.1",
"subarg": "^1.0.0",
"through2": "^2.0.0",
"xtend": "^4.0.0"
}
},
"moment": { "moment": {
"version": "2.22.2", "version": "2.22.2",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz",
"integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y="
}, },
"morris.js": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/morris.js/-/morris.js-0.5.0.tgz",
"integrity": "sha1-cldnE1z64Fmq51mZuyzmocXRtEs="
},
"move-concurrently": { "move-concurrently": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",

View file

@ -30,6 +30,7 @@
"bootstrap-datepicker": "^1.6.4", "bootstrap-datepicker": "^1.6.4",
"bootstrap-less": "^3.3.8", "bootstrap-less": "^3.3.8",
"bootstrap-table": "^1.12.1", "bootstrap-table": "^1.12.1",
"chart.js": "^2.7.2",
"ekko-lightbox": "^5.1.1", "ekko-lightbox": "^5.1.1",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"icheck": "^1.0.2", "icheck": "^1.0.2",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,11 +1,11 @@
{ {
"/js/app.js": "/js/app.js?id=cb3b214bf844383831d7", "/js/app.js": "/js/app.js?id=d5f4ce25af088f5c0b3b",
"/css/AdminLTE.css": "/css/AdminLTE.css?id=a501321b732a1aca5cc9", "/css/AdminLTE.css": "/css/AdminLTE.css?id=3f11a229453c98bd7d9d",
"/css/app.css": "/css/app.css?id=c3b4e5ea2063d7f76241", "/css/app.css": "/css/app.css?id=6c077c0864a66fa68f27",
"/css/overrides.css": "/css/overrides.css?id=3f6a7848656e6755847e", "/css/overrides.css": "/css/overrides.css?id=6b828d7767ff152a582b",
"/css/dist/all.css": "/css/dist/all.css?id=c78a60594ab97ac02719", "/css/dist/all.css": "/css/dist/all.css?id=52eeb0ac804d01ab930e",
"/css/build/all.css": "/css/build/all.css?id=c78a60594ab97ac02719", "/css/build/all.css": "/css/build/all.css?id=52eeb0ac804d01ab930e",
"/js/vendor.js": "/js/vendor.js?id=534ce0a6cfd17eec12d1", "/js/vendor.js": "/js/vendor.js?id=b1deab531243218b0614",
"/js/html5shiv.min.js": "/js/html5shiv.min.js?id=ba846cb704dbfbc5f1b3", "/js/html5shiv.min.js": "/js/html5shiv.min.js?id=ba846cb704dbfbc5f1b3",
"/js/respond.min.js": "/js/respond.min.js?id=afc1984a3d17110449dc", "/js/respond.min.js": "/js/respond.min.js?id=afc1984a3d17110449dc",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=7223478ba9bf2c6dfb4f", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=7223478ba9bf2c6dfb4f",

View file

@ -6,7 +6,7 @@
* @return {IIFE} Immediately invoked. Returns self. * @return {IIFE} Immediately invoked. Returns self.
*/ */
var lineOptions = { lineOptions = {
legend: { legend: {
position: "bottom" position: "bottom"
@ -39,7 +39,7 @@ var lineOptions = {
}; };
var pieOptions = { pieOptions = {
//Boolean - Whether we should show a stroke on each segment //Boolean - Whether we should show a stroke on each segment
segmentShowStroke: true, segmentShowStroke: true,
//String - The colour of each segment stroke //String - The colour of each segment stroke

View file

@ -279,95 +279,36 @@
@section('moar_scripts') @section('moar_scripts')
@include ('partials.bootstrap-table', ['simple_view' => true, 'nopages' => true]) @include ('partials.bootstrap-table', ['simple_view' => true, 'nopages' => true])
@if ($snipeSettings->load_remote=='1')
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
@else
<script src="{{ asset('js/plugins/chartjs/Chart.min.js') }}"></script>
@endif
<script nonce="{{ csrf_token() }}">
/* ChartJS
* -------
*/
// -----------------------
// - LINE CHART -
// -----------------------
//var ctx = document.getElementById('salesChart').getContext("2d")
//var myChart = new Chart(ctx, {
// type: 'line'
//});
//$.ajax({
// type: 'GET',
// url: '{{ route('api.statuslabels.assets.bytype') }}',
// headers: {
// "X-Requested-With": 'XMLHttpRequest',
// "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
// },
// dataType: 'json',
// success: function (data) {
// var ctx = new Chart(ctx,{
// type: 'line',
// data: data,
// options: lineOptions
// });
// },
// error: function (data) {
// window.location.reload(true);
// }
// });
// ---------------------------
// - END MONTHLY SALES CHART -
// ---------------------------
var pieChartCanvas = $("#statusPieChart").get(0).getContext("2d");
var pieChart = new Chart(pieChartCanvas);
var ctx = document.getElementById("statusPieChart");
$.ajax({
type: 'GET',
url: '{{ route('api.statuslabels.assets.bytype') }}',
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
},
dataType: 'json',
success: function (data) {
var myPieChart = new Chart(ctx,{
type: 'doughnut',
data: data,
options: pieOptions
});
},
error: function (data) {
// window.location.reload(true);
}
});
</script>
@stop @stop
@push('js')
<script nonce="{{ csrf_token() }}">
// ---------------------------
// - ASSET STATUS CHART -
// ---------------------------
var pieChartCanvas = $("#statusPieChart").get(0).getContext("2d");
var pieChart = new Chart(pieChartCanvas);
var ctx = document.getElementById("statusPieChart");
$.ajax({
type: 'GET',
url: '{{ route('api.statuslabels.assets.bytype') }}',
headers: {
"X-Requested-With": 'XMLHttpRequest',
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
},
dataType: 'json',
success: function (data) {
var myPieChart = new Chart(ctx,{
type : 'doughnut',
data : data,
options: pieOptions
});
},
error: function (data) {
// window.location.reload(true);
}
});
</script>
@endpush

View file

@ -787,17 +787,16 @@
</div> </div>
</div> </div>
{{-- Javascript files --}}
<script src="{{ url(mix('js/app.js')) }}" nonce="{{ csrf_token() }}"></script> <script src="{{ url(mix('js/app.js')) }}" nonce="{{ csrf_token() }}"></script>
<script src="{{ url(mix('js/vendor.js')) }}" nonce="{{ csrf_token() }}"></script> <script src="{{ url(mix('js/vendor.js')) }}" nonce="{{ csrf_token() }}"></script>
{{-- Page level javascript --}}
@stack('js') @stack('js')
@section('moar_scripts') @section('moar_scripts')
@show @show
<script nonce="{{ csrf_token() }}"> <script nonce="{{ csrf_token() }}">
$(function () { $(function () {
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover(); $('[data-toggle="popover"]').popover();

View file

@ -41,41 +41,6 @@ mix
.minify("./public/css/signature-pad.css") .minify("./public/css/signature-pad.css")
.version(); .version();
/**
* Copy image for iCheck
*/
mix.copyDirectory(
"./node_modules/admin-lte/plugins/iCheck/minimal/blue*.png",
"./public/css"
);
// 'resources/assets/js/vue.js', // Snipe-IT's initializer for Vue.js
// './public/js/build'
// ).sourceMaps()
// .scripts([
// './node_modules/jquery-ui/jquery-ui.js',
// './public/js/build/vue.js', //this is the modularized nifty Vue.js thing we just built, above!
// './node_modules/tether/dist/js/tether.min.js',
// './node_modules/jquery-slimscroll/jquery.slimscroll.js',
// './node_modules/jquery.iframe-transport/jquery.iframe-transport.js',
// './node_modules/blueimp-file-upload/js/jquery.fileupload.js',
// './node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js',
// './node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
// './node_modules/icheck/icheck.js',
// './node_modules/ekko-lightbox/dist/ekko-lightbox.js',
// './resources/assets/js/app.js', //this is part of AdminLTE
// './resources/assets/js/snipeit.js', //this is the actual Snipe-IT JS
// './resources/assets/js/snipeit_modals.js'
// ],
// './public/js/dist/all.js');
/**
* Copy Fontawesome fonts to public fonts directory
*/
mix.copyDirectory("./node_modules/font-awesome/fonts", "./public/fonts");
// mix.copy('./public/css/dist/all.css', './public/css/build/all.css').copy('./public/js/dist/all.js', './public/js/build/all.js');
// mix.version();
// Combine main SnipeIT JS files // Combine main SnipeIT JS files
mix.js([ mix.js([
'./resources/assets/js/vue.js', './resources/assets/js/vue.js',
@ -98,13 +63,14 @@ mix.combine([
'./node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js', './node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
'./node_modules/ekko-lightbox/dist/ekko-lightbox.js', './node_modules/ekko-lightbox/dist/ekko-lightbox.js',
'./node_modules/icheck/icheck.js', './node_modules/icheck/icheck.js',
'./resources/assets/js/extensions/pGenerator.jquery.js' './resources/assets/js/extensions/pGenerator.jquery.js',
'./node_modules/chart.js/dist/Chart.js',
], 'public/js/vendor.js') ], 'public/js/vendor.js')
.version(); .version();
mix.copy([ mix.copy([
'./resources/assets/js/html5shiv.min.js', './resources/assets/js/html5shiv.min.js',
'./resources/assets/js/respond.min.js' './resources/assets/js/respond.min.js',
], './public/js'); ], './public/js');
/** /**