profile_v3.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. (function (global, factory) {
  2. if (typeof define === "function" && define.amd) {
  3. define("/pages/profile_v3", ["jquery", "Site"], factory);
  4. } else if (typeof exports !== "undefined") {
  5. factory(require("jquery"), require("Site"));
  6. } else {
  7. var mod = {
  8. exports: {}
  9. };
  10. factory(global.jQuery, global.Site);
  11. global.pagesProfile_v3 = mod.exports;
  12. }
  13. })(this, function (_jquery, _Site) {
  14. "use strict";
  15. _jquery = babelHelpers.interopRequireDefault(_jquery);
  16. (0, _jquery.default)(document).ready(function ($$$1) {
  17. (0, _Site.run)();
  18. }); // Example Popup Gallery
  19. // ---------------------
  20. var galleryNum = (0, _jquery.default)('.imgs-gallery').length;
  21. for (var i = 0; i < galleryNum; i++) {
  22. (0, _jquery.default)((0, _jquery.default)('.imgs-gallery')[i]).magnificPopup({
  23. delegate: 'a',
  24. type: 'image',
  25. tLoading: 'Loading image #%curr%...',
  26. mainClass: 'mfp-img-mobile',
  27. gallery: {
  28. enabled: true,
  29. navigateByImgClick: true,
  30. preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
  31. },
  32. image: {
  33. tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
  34. titleSrc: function titleSrc(item) {
  35. return item.el.attr('title') + '<small>by amazingSurge</small>';
  36. }
  37. }
  38. });
  39. } //bind input focus
  40. (0, _jquery.default)('.wall-comment-reply .form-control').on('focus', function (event) {
  41. var $this = (0, _jquery.default)(this);
  42. var $reply_operation = $this.closest('form').find('.reply-operation'),
  43. $reply_cancel = $this.closest('form').find('.reply-operation .reply-cancel');
  44. if (!$reply_operation.hasClass('active')) {
  45. $reply_operation.addClass('active');
  46. }
  47. $reply_cancel.on('click', function () {
  48. $reply_operation.removeClass('active');
  49. });
  50. event.stopPropagation();
  51. });
  52. });