pixelfed/resources/assets/js/components.js

51 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-11-09 03:43:32 +00:00
window.Vue = require('vue');
import BootstrapVue from 'bootstrap-vue'
2018-12-02 04:03:27 +00:00
import InfiniteLoading from 'vue-infinite-loading';
import Loading from 'vue-loading-overlay';
2018-12-25 06:00:50 +00:00
import VueTimeago from 'vue-timeago';
2019-10-16 03:38:47 +00:00
import VueCarousel from 'vue-carousel';
import VueBlurHash from 'vue-blurhash'
import 'vue-blurhash/dist/vue-blurhash.css'
Vue.use(VueBlurHash);
2019-10-16 03:38:47 +00:00
Vue.use(VueCarousel);
2018-11-09 03:43:32 +00:00
Vue.use(BootstrapVue);
2018-12-02 04:03:27 +00:00
Vue.use(InfiniteLoading);
Vue.use(Loading);
2019-05-03 03:09:39 +00:00
Vue.use(VueTimeago, {
name: 'Timeago',
locale: 'en'
});
2019-05-04 03:11:09 +00:00
2018-11-13 19:43:46 +00:00
pixelfed.readmore = () => {
2018-11-29 02:27:38 +00:00
$('.read-more').each(function(k,v) {
2018-11-13 19:43:46 +00:00
let el = $(this);
let attr = el.attr('data-readmore');
if(typeof attr !== typeof undefined && attr !== false) {
return;
}
el.readmore({
2019-04-18 05:02:26 +00:00
collapsedHeight: 45,
heightMargin: 48,
2021-02-16 00:36:52 +00:00
moreLink: '<a href="#" class="d-block small font-weight-bold text-dark text-center">Show more</a>',
lessLink: '<a href="#" class="d-block small font-weight-bold text-dark text-center">Show less</a>',
2018-11-13 19:43:46 +00:00
});
});
};
try {
document.createEvent("TouchEvent");
$('body').addClass('touch');
} catch (e) {
}
2018-11-09 03:43:32 +00:00
window.filesize = require('filesize');
import swal from 'sweetalert';
2019-10-16 03:38:47 +00:00
$('[data-toggle="tooltip"]').tooltip()
2018-11-22 20:21:36 +00:00
const warningTitleCSS = 'color:red; font-size:60px; font-weight: bold; -webkit-text-stroke: 1px black;';
const warningDescCSS = 'font-size: 18px;';
console.log('%cStop!', warningTitleCSS);
console.log("%cThis is a browser feature intended for developers. If someone told you to copy and paste something here to enable a Pixelfed feature or \"hack\" someone's account, it is a scam and will give them access to your Pixelfed account.", warningDescCSS);