pixelfed/resources/assets/js/bootstrap.js

38 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-04-15 23:56:48 +00:00
window._ = require('lodash');
window.Popper = require('popper.js').default;
2018-08-10 03:50:09 +00:00
import swal from 'sweetalert';
2018-04-15 23:56:48 +00:00
try {
window.pixelfed = {};
2018-04-15 23:56:48 +00:00
window.$ = window.jQuery = require('jquery');
require('bootstrap');
2018-05-20 03:12:56 +00:00
window.InfiniteScroll = require('infinite-scroll');
window.filesize = require('filesize');
window.typeahead = require('./lib/typeahead');
window.Bloodhound = require('./lib/bloodhound');
2018-08-10 03:50:09 +00:00
window.Vue = require('vue');
2018-05-20 03:12:56 +00:00
require('./components/localstorage');
2018-06-04 02:20:54 +00:00
require('./components/likebutton');
require('./components/commentform');
2018-05-20 03:12:56 +00:00
require('./components/searchform');
2018-06-01 03:21:02 +00:00
require('./components/bookmarkform');
2018-06-14 02:57:16 +00:00
require('./components/statusform');
2018-04-15 23:56:48 +00:00
2018-08-10 03:50:09 +00:00
Vue.component(
'follow-suggestions',
require('./components/FollowSuggestions.vue')
);
} catch (e) {}
2018-04-15 23:56:48 +00:00
2018-08-10 03:50:09 +00:00
$('[data-toggle="tooltip"]').tooltip();
2018-04-15 23:56:48 +00:00
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
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');
}