components.js 1.5 KB

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