micro.js 996 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. require('./bootstrap');
  2. window.Vue = require('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 {Howl, Howler} from 'howler';
  8. Vue.use(BootstrapVue);
  9. Vue.use(InfiniteLoading);
  10. Vue.use(Loading);
  11. Vue.use(VueTimeago);
  12. pixelfed.readmore = () => {
  13. $('.read-more').each(function(k,v) {
  14. let el = $(this);
  15. let attr = el.attr('data-readmore');
  16. if(typeof attr !== typeof undefined && attr !== false) {
  17. return;
  18. }
  19. el.readmore({
  20. collapsedHeight: 44,
  21. heightMargin: 20,
  22. moreLink: '<a href="#" class="font-weight-bold small">Read more</a>',
  23. lessLink: '<a href="#" class="font-weight-bold small">Hide</a>',
  24. });
  25. });
  26. };
  27. try {
  28. document.createEvent("TouchEvent");
  29. $('body').addClass('touch');
  30. } catch (e) {
  31. }
  32. Vue.component(
  33. 'micro',
  34. require('./components/Micro.vue').default
  35. );