mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update bootstrap.js
This commit is contained in:
parent
0c79e08764
commit
dccf50762f
1 changed files with 77 additions and 6 deletions
83
resources/assets/js/bootstrap.js
vendored
83
resources/assets/js/bootstrap.js
vendored
|
@ -1,30 +1,66 @@
|
|||
window._ = require('lodash');
|
||||
window.Popper = require('popper.js').default;
|
||||
import swal from 'sweetalert';
|
||||
|
||||
window.pixelfed = {};
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
require('bootstrap');
|
||||
window.Vue = require('vue');
|
||||
import BootstrapVue from 'bootstrap-vue'
|
||||
Vue.use(BootstrapVue);
|
||||
|
||||
try {
|
||||
window.pixelfed = {};
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
require('bootstrap');
|
||||
window.InfiniteScroll = require('infinite-scroll');
|
||||
window.filesize = require('filesize');
|
||||
window.typeahead = require('./lib/typeahead');
|
||||
window.Bloodhound = require('./lib/bloodhound');
|
||||
window.Vue = require('vue');
|
||||
|
||||
require('./components/localstorage');
|
||||
require('./components/likebutton');
|
||||
require('./components/commentform');
|
||||
require('./components/searchform');
|
||||
require('./components/bookmarkform');
|
||||
require('./components/statusform');
|
||||
// require('./components/embed');
|
||||
// require('./components/shortcuts');
|
||||
|
||||
Vue.component(
|
||||
'follow-suggestions',
|
||||
require('./components/FollowSuggestions.vue')
|
||||
);
|
||||
|
||||
// Vue.component(
|
||||
// 'circle-panel',
|
||||
// require('./components/CirclePanel.vue')
|
||||
// );
|
||||
|
||||
Vue.component(
|
||||
'post-comments',
|
||||
require('./components/PostComments.vue')
|
||||
);
|
||||
|
||||
Vue.component(
|
||||
'passport-clients',
|
||||
require('./components/passport/Clients.vue')
|
||||
);
|
||||
|
||||
Vue.component(
|
||||
'passport-authorized-clients',
|
||||
require('./components/passport/AuthorizedClients.vue')
|
||||
);
|
||||
|
||||
Vue.component(
|
||||
'passport-personal-access-tokens',
|
||||
require('./components/passport/PersonalAccessTokens.vue')
|
||||
);
|
||||
|
||||
} catch (e) {}
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$(document).ready(function() {
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
});
|
||||
});
|
||||
|
||||
window.axios = require('axios');
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
@ -35,3 +71,38 @@ if (token) {
|
|||
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
|
||||
}
|
||||
|
||||
// import Echo from "laravel-echo"
|
||||
|
||||
// window.io = require('socket.io-client');
|
||||
|
||||
// window.pixelfed.bootEcho = function() {
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'socket.io',
|
||||
// host: window.location.hostname + ':2096',
|
||||
// auth: {
|
||||
// headers: {
|
||||
// Authorization: 'Bearer ' + token.content,
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
|
||||
window.pixelfed.copyToClipboard = (str) => {
|
||||
const el = document.createElement('textarea');
|
||||
el.value = str;
|
||||
el.setAttribute('readonly', '');
|
||||
el.style.position = 'absolute';
|
||||
el.style.left = '-9999px';
|
||||
document.body.appendChild(el);
|
||||
const selected =
|
||||
document.getSelection().rangeCount > 0
|
||||
? document.getSelection().getRangeAt(0)
|
||||
: false;
|
||||
el.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(el);
|
||||
if (selected) {
|
||||
document.getSelection().removeAllRanges();
|
||||
document.getSelection().addRange(selected);
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue