components.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import Vue from 'vue';
  2. window.Vue = Vue;
  3. import BootstrapVue from 'bootstrap-vue'
  4. import InfiniteLoading from 'vue-infinite-loading';
  5. import Loading from 'vue-loading-overlay';
  6. import VueTimeago from 'vue-timeago';
  7. import VueCarousel from 'vue-carousel';
  8. import VueBlurHash from 'vue-blurhash'
  9. import 'vue-blurhash/dist/vue-blurhash.css'
  10. Vue.use(VueBlurHash);
  11. Vue.use(VueCarousel);
  12. Vue.use(BootstrapVue);
  13. Vue.use(InfiniteLoading);
  14. Vue.use(Loading);
  15. Vue.use(VueTimeago, {
  16. name: 'Timeago',
  17. locale: 'en'
  18. });
  19. pixelfed.readmore = () => {
  20. $('.read-more').each(function(k,v) {
  21. let el = $(this);
  22. let attr = el.attr('data-readmore');
  23. if(typeof attr !== typeof undefined && attr !== false) {
  24. return;
  25. }
  26. el.readmore({
  27. collapsedHeight: 45,
  28. heightMargin: 48,
  29. moreLink: '<a href="#" class="d-block small font-weight-bold text-dark text-center">Show more</a>',
  30. lessLink: '<a href="#" class="d-block small font-weight-bold text-dark text-center">Show less</a>',
  31. });
  32. });
  33. };
  34. try {
  35. document.createEvent("TouchEvent");
  36. $('body').addClass('touch');
  37. } catch (e) {
  38. }
  39. window.filesize = require('filesize');
  40. import swal from 'sweetalert';
  41. $('[data-toggle="tooltip"]').tooltip()
  42. const warningTitleCSS = 'color:red; font-size:60px; font-weight: bold; -webkit-text-stroke: 1px black;';
  43. const warningDescCSS = 'font-size: 18px;';
  44. console.log('%cStop!', warningTitleCSS);
  45. 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);