pixelfed/resources/assets/js/components.js

48 lines
1.5 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';
2018-12-02 04:03:27 +00:00
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,
2019-04-20 19:28:16 +00:00
moreLink: '<a href="#" class="d-block small text-muted text-center">Read more ...</a>',
lessLink: '<a href="#" class="d-block small text-muted text-center">Hide</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);