detail.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // 加载 modal
  2. function load_modal(article_id, comment_id) {
  3. let modal_body = '#modal_body_' + comment_id;
  4. let modal_id = '#comment_' + comment_id;
  5. // 加载编辑器
  6. if ($(modal_body).children().length === 0) {
  7. let content = '<iframe src="/comment/post_comment/' +
  8. article_id +
  9. '/' +
  10. comment_id +
  11. '"' +
  12. ' frameborder="0" style="width: 100%; height: 100%;" id="iframe_' +
  13. comment_id +
  14. '"></iframe>';
  15. $(modal_body).append(content);
  16. }
  17. ;
  18. $(modal_id).modal('show');
  19. }
  20. $(".django-ckeditor-widget").removeAttr('style');
  21. $('#sidebar').stickySidebar({
  22. topSpacing: 20,
  23. bottomSpacing: 20,
  24. });
  25. function confirm_delete() {
  26. layer.open({
  27. title: "删除文章",
  28. content: "确认删除这篇文章吗?",
  29. yes: function (index, layero) {
  30. $('form#safe_delete button').click();
  31. layer.close(index);
  32. },
  33. })
  34. }
  35. (function ($) {
  36. "use strict";
  37. if ($('.text-slider').length == 1) {
  38. console.log('233ok')
  39. var typed_strings = $('.text-slider-items').text();
  40. var typed = new Typed('.text-slider', {
  41. strings: typed_strings.split(','),
  42. typeSpeed: 80,
  43. loop: true,
  44. backDelay: 1100,
  45. backSpeed: 30
  46. });
  47. }
  48. function initParallax() {
  49. $('#masthead').parallax("100%", 0.3);
  50. $('#content').parallax("20%", 0.7);
  51. }
  52. initParallax();
  53. })(jQuery);