1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2025-03-05 19:20:18 +00:00
pixelfed/resources/assets/js/components.js

52 lines
1.7 KiB
JavaScript
Raw Normal View History

2023-06-11 15:36:00 -06:00
import Vue from 'vue';
window.Vue = Vue;
2018-11-08 20:43:32 -07:00
import BootstrapVue from 'bootstrap-vue'
2018-12-01 21:03:27 -07:00
import InfiniteLoading from 'vue-infinite-loading';
import Loading from 'vue-loading-overlay';
2018-12-24 23:00:50 -07:00
import VueTimeago from 'vue-timeago';
2019-10-15 21:38:47 -06:00
import VueCarousel from 'vue-carousel';
import VueBlurHash from 'vue-blurhash'
import 'vue-blurhash/dist/vue-blurhash.css'
Vue.use(VueBlurHash);
2019-10-15 21:38:47 -06:00
Vue.use(VueCarousel);
2018-11-08 20:43:32 -07:00
Vue.use(BootstrapVue);
2018-12-01 21:03:27 -07:00
Vue.use(InfiniteLoading);
Vue.use(Loading);
2019-05-02 21:09:39 -06:00
Vue.use(VueTimeago, {
name: 'Timeago',
locale: 'en'
});
2019-05-03 23:11:09 -04:00
2018-11-13 12:43:46 -07:00
pixelfed.readmore = () => {
2018-11-28 19:27:38 -07:00
$('.read-more').each(function(k,v) {
2018-11-13 12:43:46 -07:00
let el = $(this);
let attr = el.attr('data-readmore');
if(typeof attr !== typeof undefined && attr !== false) {
return;
}
el.readmore({
2019-04-17 23:02:26 -06:00
collapsedHeight: 45,
heightMargin: 48,
2021-02-15 17:36:52 -07: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 12:43:46 -07:00
});
});
};
try {
document.createEvent("TouchEvent");
$('body').addClass('touch');
} catch (e) {
}
2018-11-08 20:43:32 -07:00
window.filesize = require('filesize');
import swal from 'sweetalert';
2019-10-15 21:38:47 -06:00
$('[data-toggle="tooltip"]').tooltip()
2018-11-22 13:21:36 -07: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);