From 5d24b254e53e082adb240b219ad79c97fe2635cb Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 26 Jul 2019 21:29:05 -0600 Subject: [PATCH] Update js, move bootstrap.js to app.js --- resources/assets/js/app.js | 16 +++++++++++++++- resources/assets/js/bootstrap.js | 15 --------------- 2 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 resources/assets/js/bootstrap.js diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index c8b4b8d9c..ad0c293af 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -1 +1,15 @@ -require('./bootstrap'); \ No newline at end of file +window._ = require('lodash'); +window.Popper = require('popper.js').default; +window.pixelfed = window.pixelfed || {}; +window.$ = window.jQuery = require('jquery'); +require('bootstrap'); +window.axios = require('axios'); +window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; +require('readmore-js'); + +let token = document.head.querySelector('meta[name="csrf-token"]'); +if (token) { + window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; +} else { + console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); +} diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js deleted file mode 100644 index ad0c293af..000000000 --- a/resources/assets/js/bootstrap.js +++ /dev/null @@ -1,15 +0,0 @@ -window._ = require('lodash'); -window.Popper = require('popper.js').default; -window.pixelfed = window.pixelfed || {}; -window.$ = window.jQuery = require('jquery'); -require('bootstrap'); -window.axios = require('axios'); -window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; -require('readmore-js'); - -let token = document.head.querySelector('meta[name="csrf-token"]'); -if (token) { - window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; -} else { - console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); -}