mirror of
https://github.com/flarum/framework.git
synced 2025-01-30 13:15:16 +08:00
2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
module.exports=function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=29)}([function(t,n){t.exports=flarum.core.compat.app},function(t,n){t.exports=flarum.core.compat.extend},function(t,n){t.exports=flarum.core.compat["helpers/username"]},function(t,n,r){t.exports=!r(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n){t.exports=flarum.core.compat["helpers/punctuateSeries"]},function(t,n){t.exports=flarum.core.compat["components/CommentPost"]},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(7);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=r)},function(t,n){t.exports=flarum.core.compat.Model},function(t,n){t.exports=flarum.core.compat["models/Post"]},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var e=r(33)("keys"),o=r(31);t.exports=function(t){return e[t]||(e[t]=o(t))}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(39),o=r(37);t.exports=function(t){return e(o(t))}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){var e=r(7),o=r(4).document,i=e(o)&&e(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,r){var e=r(8),o=r(46),i=r(45),u=Object.defineProperty;n.f=r(3)?Object.defineProperty:function(t,n,r){if(e(t),n=i(n,!0),e(r),o)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},,function(t,n){t.exports=flarum.core.compat["components/Notification"]},function(t,n){t.exports=flarum.core.compat["helpers/avatar"]},function(t,n){t.exports=flarum.core.compat["components/Modal"]},function(t,n,r){t.exports=r(52)},function(t,n){t.exports=flarum.core.compat["helpers/icon"]},function(t,n){t.exports=flarum.core.compat["components/Button"]},function(t,n){t.exports=flarum.core.compat["components/NotificationGrid"]},,function(t,n,r){"use strict";r.r(n);var e=r(1),o=r(0),i=r.n(o),u=r(11),a=r.n(u),c=r(10),s=r.n(c),f=r(27),p=r.n(f),l=r(26),d=r.n(l),v=r(6),h=r.n(v),y=r(5),x=r.n(y),b=r(2),_=r.n(b),k=r(25),g=r.n(k),O=r(24),j=r.n(O);function w(t,n){t.prototype=j()(n.prototype),t.prototype.constructor=t,t.__proto__=n}var P=r(23),M=r.n(P),S=r(22),E=r.n(S),C=function(t){function n(){return t.apply(this,arguments)||this}w(n,t);var r=n.prototype;return r.className=function(){return"PostLikesModal Modal--small"},r.title=function(){return app.translator.trans("flarum-likes.forum.post_likes.title")},r.content=function(){return m("div",{className:"Modal-body"},m("ul",{className:"PostLikesModal-list"},this.props.post.likes().map(function(t){return m("li",null,m("a",{href:app.route.user(t),config:m.route},E()(t)," "," ",_()(t)))})))},n}(M.a),L=r(21),T=function(t){function n(){return t.apply(this,arguments)||this}w(n,t);var r=n.prototype;return r.icon=function(){return"far fa-thumbs-up"},r.href=function(){return app.route.post(this.props.notification.subject())},r.content=function(){var t=this.props.notification,n=t.fromUser(),r=t.additionalUnreadCount();return app.translator.transChoice("flarum-likes.forum.notifications.post_liked_text",r+1,{user:n,username:r?x()([_()(n),app.translator.transChoice("flarum-likes.forum.notifications.others_text",r,{count:r})]):void 0})},r.excerpt=function(){return this.props.notification.subject().contentPlain()},n}(r.n(L).a);i.a.initializers.add("flarum-likes",function(){i.a.notificationComponents.postLiked=T,a.a.prototype.canLike=s.a.attribute("canLike"),a.a.prototype.likes=s.a.hasMany("likes"),Object(e.extend)(h.a.prototype,"actionItems",function(t){var n=this.props.post;if(!n.isHidden()&&n.canLike()){var r=i.a.session.user&&n.likes().some(function(t){return t===i.a.session.user});t.add("like",d.a.component({children:i.a.translator.trans(r?"flarum-likes.forum.post.unlike_link":"flarum-likes.forum.post.like_link"),className:"Button Button--link",onclick:function(){r=!r,n.save({isLiked:r});var t=n.data.relationships.likes.data;t.some(function(n,r){if(n.id===i.a.session.user.id())return t.splice(r,1),!0}),r&&t.unshift({type:"users",id:i.a.session.user.id()})}}))}}),Object(e.extend)(h.a.prototype,"footerItems",function(t){var n=this.props.post,r=n.likes();if(r&&r.length){var e=r.length>4,o=r.sort(function(t){return t===i.a.session.user?-1:1}).slice(0,e?3:4).map(function(t){return m("a",{href:i.a.route.user(t),config:m.route},t===i.a.session.user?i.a.translator.trans("flarum-likes.forum.post.you_text"):_()(t))});if(e){var u=r.length-o.length;o.push(m("a",{href:"#",onclick:function(t){t.preventDefault(),i.a.modal.show(new C({post:n}))}},i.a.translator.transChoice("flarum-likes.forum.post.others_link",u,{count:u})))}t.add("liked",m("div",{className:"Post-likedBy"},g()("far fa-thumbs-up"),i.a.translator.transChoice("flarum-likes.forum.post.liked_by"+(r[0]===i.a.session.user?"_self":"")+"_text",o.length,{count:o.length,users:x()(o)})))}}),Object(e.extend)(p.a.prototype,"notificationTypes",function(t){t.add("postLiked",{name:"postLiked",icon:"far fa-thumbs-up",label:i.a.translator.trans("flarum-likes.forum.settings.notify_post_liked_label")})})})},function(t,n,r){var e=r(4).document;t.exports=e&&e.documentElement},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n){t.exports=!0},function(t,n,r){var e=r(9),o=r(4),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:e.version,mode:r(32)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n,r){var e=r(14),o=Math.max,i=Math.min;t.exports=function(t,n){return(t=e(t))<0?o(t+n,0):i(t,n)}},function(t,n,r){var e=r(14),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){var e=r(15),o=r(35),i=r(34);t.exports=function(t){return function(n,r,u){var a,c=e(n),s=o(c.length),f=i(u,s);if(t&&r!=r){for(;s>f;)if((a=c[f++])!=a)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===r)return t||f||0;return!t&&-1}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(38);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n,r){var e=r(16),o=r(15),i=r(36)(!1),u=r(13)("IE_PROTO");t.exports=function(t,n){var r,a=o(t),c=0,s=[];for(r in a)r!=u&&e(a,r)&&s.push(r);for(;n.length>c;)e(a,r=n[c++])&&(~i(s,r)||s.push(r));return s}},function(t,n,r){var e=r(40),o=r(12);t.exports=Object.keys||function(t){return e(t,o)}},function(t,n,r){var e=r(19),o=r(8),i=r(41);t.exports=r(3)?Object.defineProperties:function(t,n){o(t);for(var r,u=i(n),a=u.length,c=0;a>c;)e.f(t,r=u[c++],n[r]);return t}},function(t,n,r){var e=r(8),o=r(42),i=r(12),u=r(13)("IE_PROTO"),a=function(){},c=function(){var t,n=r(17)("iframe"),e=i.length;for(n.style.display="none",r(30).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;e--;)delete c.prototype[i[e]];return c()};t.exports=Object.create||function(t,n){var r;return null!==t?(a.prototype=e(t),r=new a,a.prototype=null,r[u]=t):r=c(),void 0===n?r:o(r,n)}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(7);t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){t.exports=!r(3)&&!r(18)(function(){return 7!=Object.defineProperty(r(17)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(19),o=r(44);t.exports=r(3)?function(t,n,r){return e.f(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,r){var e=r(48);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n,r){var e=r(4),o=r(9),i=r(49),u=r(47),a=r(16),c=function(t,n,r){var s,f,p,l=t&c.F,m=t&c.G,d=t&c.S,v=t&c.P,h=t&c.B,y=t&c.W,x=m?o:o[n]||(o[n]={}),b=x.prototype,_=m?e:d?e[n]:(e[n]||{}).prototype;for(s in m&&(r=n),r)(f=!l&&_&&void 0!==_[s])&&a(x,s)||(p=f?_[s]:r[s],x[s]=m&&"function"!=typeof _[s]?r[s]:h&&f?i(p,e):y&&_[s]==p?function(t){var n=function(n,r,e){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,r)}return new t(n,r,e)}return t.apply(this,arguments)};return n.prototype=t.prototype,n}(p):v&&"function"==typeof p?i(Function.call,p):p,v&&((x.virtual||(x.virtual={}))[s]=p,t&c.R&&b&&!b[s]&&u(b,s,p)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,n,r){var e=r(50);e(e.S,"Object",{create:r(43)})},function(t,n,r){r(51);var e=r(9).Object;t.exports=function(t,n){return e.create(t,n)}}]);
|
|
//# sourceMappingURL=forum.js.map
|