components.js 1.5 KB

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