CS: eslint

parent 0cbafba0
require('./bootstrap'); require('./bootstrap');
import Vue from 'vue' import Vue from 'vue';
import VueI18n from 'vue-i18n' import VueI18n from 'vue-i18n';
import VueRouter from 'vue-router' import VueRouter from 'vue-router';
import ElementUI from 'element-ui' import ElementUI from 'element-ui';
import DataTables from 'vue-data-tables' import DataTables from 'vue-data-tables';
import VueEvents from 'vue-events' import VueEvents from 'vue-events';
import locale from 'element-ui/lib/locale/lang/en' import locale from 'element-ui/lib/locale/lang/en';
import VueSimplemde from 'vue-simplemde' import VueSimplemde from 'vue-simplemde';
Vue.use(ElementUI, { locale }); Vue.use(ElementUI, { locale });
Vue.use(DataTables, { locale }); Vue.use(DataTables, { locale });
Vue.use(VueI18n); Vue.use(VueI18n);
Vue.use(VueRouter); Vue.use(VueRouter);
Vue.use(require('vue-shortkey'), { prevent: ['input', 'textarea'] }); Vue.use(require('vue-shortkey'), { prevent: ['input', 'textarea'] });
Vue.use(VueEvents); Vue.use(VueEvents);
Vue.use(VueSimplemde); Vue.use(VueSimplemde);
require('./mixins'); require('./mixins');
...@@ -24,6 +25,7 @@ Vue.component('DeleteButton', require('../../../Modules/Core/Assets/js/component ...@@ -24,6 +25,7 @@ Vue.component('DeleteButton', require('../../../Modules/Core/Assets/js/component
Vue.component('TagsInput', require('../../../Modules/Tag/Assets/js/components/TagInput.vue')); Vue.component('TagsInput', require('../../../Modules/Tag/Assets/js/components/TagInput.vue'));
Vue.component('SingleMedia', require('../../../Modules/Media/Assets/js/components/SingleMedia.vue')); Vue.component('SingleMedia', require('../../../Modules/Media/Assets/js/components/SingleMedia.vue'));
Vue.component('MediaManager', require('../../../Modules/Media/Assets/js/components/MediaManager.vue')); Vue.component('MediaManager', require('../../../Modules/Media/Assets/js/components/MediaManager.vue'));
import PageRoutes from '../../../Modules/Page/Assets/js/PageRoutes'; import PageRoutes from '../../../Modules/Page/Assets/js/PageRoutes';
import MediaRoutes from '../../../Modules/Media/Assets/js/MediaRoutes'; import MediaRoutes from '../../../Modules/Media/Assets/js/MediaRoutes';
...@@ -34,7 +36,7 @@ const adminPrefix = window.AsgardCMS.adminPrefix; ...@@ -34,7 +36,7 @@ const adminPrefix = window.AsgardCMS.adminPrefix;
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
base: makeBaseUrl(), base: makeBaseUrl(),
routes : [ routes: [
...PageRoutes, ...PageRoutes,
...MediaRoutes, ...MediaRoutes,
], ],
...@@ -47,7 +49,7 @@ function makeBaseUrl() { ...@@ -47,7 +49,7 @@ function makeBaseUrl() {
return `${currentLocale}/${adminPrefix}`; return `${currentLocale}/${adminPrefix}`;
} }
let messages = { const messages = {
[currentLocale]: window.AsgardCMS.translations, [currentLocale]: window.AsgardCMS.translations,
}; };
...@@ -62,7 +64,7 @@ const app = new Vue({ ...@@ -62,7 +64,7 @@ const app = new Vue({
i18n, i18n,
}); });
window.axios.interceptors.response.use(null, function(error) { window.axios.interceptors.response.use(null, (error) => {
if (error.response === undefined) { if (error.response === undefined) {
console.log(error); console.log(error);
return; return;
......
...@@ -29,7 +29,7 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; ...@@ -29,7 +29,7 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
* a simple convenience so we don't have to attach every token manually. * a simple convenience so we don't have to attach every token manually.
*/ */
let token = document.head.querySelector('meta[name="csrf-token"]'); const token = document.head.querySelector('meta[name="csrf-token"]');
if (token) { if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
...@@ -37,15 +37,15 @@ if (token) { ...@@ -37,15 +37,15 @@ if (token) {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
} }
let userApiToken = document.head.querySelector('meta[name="user-api-token"]'); const userApiToken = document.head.querySelector('meta[name="user-api-token"]');
if (userApiToken) { if (userApiToken) {
window.axios.defaults.headers.common['Authorization'] = 'Bearer ' + userApiToken.content; window.axios.defaults.headers.common.Authorization = `Bearer ${userApiToken.content}`;
} else { } else {
console.error('User API token not found in a meta tag.'); console.error('User API token not found in a meta tag.');
} }
let currentLocale = document.head.querySelector('meta[name="current-locale"]'); const currentLocale = document.head.querySelector('meta[name="current-locale"]');
if (currentLocale) { if (currentLocale) {
window.AsgardCMS.currentLocale = currentLocale.content; window.AsgardCMS.currentLocale = currentLocale.content;
......
import Vue from 'vue' import Vue from 'vue';
import TranslationHelper from '../../../Modules/Core/Assets/js/mixins/TranslationHelper' import TranslationHelper from '../../../Modules/Core/Assets/js/mixins/TranslationHelper';
Vue.mixin(TranslationHelper); Vue.mixin(TranslationHelper);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment