framework/extensions/lock/js/dist/forum.js
2018-06-20 05:26:18 +00:00

2 lines
9.4 KiB
JavaScript

module.exports=function(t){var n={};function o(r){if(n[r])return n[r].exports;var e=n[r]={i:r,l:!1,exports:{}};return t[r].call(e.exports,e,e.exports,o),e.l=!0,e.exports}return o.m=t,o.c=n,o.d=function(t,n,r){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,n){if(1&n&&(t=o(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var e in t)o.d(r,e,function(n){return t[n]}.bind(null,e));return r},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=27)}([function(t,n){t.exports=flarum.core.compat.extend},function(t,n){t.exports=flarum.core.compat.app},function(t,n){t.exports=flarum.core.compat["models/Discussion"]},function(t,n,o){t.exports=!o(16)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var o=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=o)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,o){var r=o(5);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var o=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=o)},function(t,n){t.exports=flarum.core.compat["utils/DiscussionControls"]},function(t,n){t.exports=flarum.core.compat.Model},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,o){var r=o(31)("keys"),e=o(29);t.exports=function(t){return r[t]||(r[t]=e(t))}},function(t,n){var o=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:o)(t)}},function(t,n,o){var r=o(37),e=o(35);t.exports=function(t){return r(e(t))}},function(t,n){var o={}.hasOwnProperty;t.exports=function(t,n){return o.call(t,n)}},function(t,n,o){var r=o(5),e=o(4).document,c=r(e)&&r(e.createElement);t.exports=function(t){return c?e.createElement(t):{}}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,o){var r=o(6),e=o(44),c=o(43),i=Object.defineProperty;n.f=o(3)?Object.defineProperty:function(t,n,o){if(r(t),n=c(n,!0),r(o),e)try{return i(t,n,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported!");return"value"in o&&(t[n]=o.value),t}},,function(t,n){t.exports=flarum.core.compat["components/Button"]},function(t,n){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,n){t.exports=flarum.core.compat["components/Badge"]},function(t,n){t.exports=flarum.core.compat["components/Notification"]},function(t,n){t.exports=flarum.core.compat["components/EventPost"]},function(t,n,o){t.exports=o(50)},function(t,n){t.exports=flarum.core.compat["components/NotificationGrid"]},,function(t,n,o){"use strict";o.r(n);var r=o(0),e=o(1),c=o.n(e),i=o(9),u=o.n(i),a=o(2),f=o.n(a),s=o(25),p=o.n(s),l=o(24),d=o.n(l);function v(t,n){t.prototype=d()(n.prototype),t.prototype.constructor=t,t.__proto__=n}var y=o(23),x=function(t){function n(){return t.apply(this,arguments)||this}v(n,t);var o=n.prototype;return o.icon=function(){return this.props.post.content().locked?"fas fa-lock":"fas fa-unlock"},o.descriptionKey=function(){return this.props.post.content().locked?"flarum-lock.forum.post_stream.discussion_locked_text":"flarum-lock.forum.post_stream.discussion_unlocked_text"},n}(o.n(y).a),h=o(22),b=function(t){function n(){return t.apply(this,arguments)||this}v(n,t);var o=n.prototype;return o.icon=function(){return"fas fa-lock"},o.href=function(){var t=this.props.notification;return app.route.discussion(t.subject(),t.content().postNumber)},o.content=function(){return app.translator.trans("flarum-lock.forum.notifications.discussion_locked_text",{user:this.props.notification.sender()})},n}(o.n(h).a),_=o(21),k=o.n(_);var O=o(8),g=o.n(O),j=o(20),w=o.n(j),P=o(19),S=o.n(P);c.a.initializers.add("flarum-lock",function(){c.a.postComponents.discussionLocked=x,c.a.notificationComponents.discussionLocked=b,f.a.prototype.isLocked=u.a.attribute("isLocked"),f.a.prototype.canLock=u.a.attribute("canLock"),Object(r.extend)(f.a.prototype,"badges",function(t){this.isLocked()&&t.add("locked",k.a.component({type:"locked",label:app.translator.trans("flarum-lock.forum.badge.locked_tooltip"),icon:"fas fa-lock"}))}),Object(r.extend)(g.a,"moderationControls",function(t,n){n.canLock()&&t.add("lock",S.a.component({children:app.translator.trans(n.isLocked()?"flarum-lock.forum.discussion_controls.unlock_button":"flarum-lock.forum.discussion_controls.lock_button"),icon:"fas fa-lock",onclick:this.lockAction.bind(n)}))}),g.a.lockAction=function(){this.save({isLocked:!this.isLocked()}).then(function(){app.current instanceof w.a&&app.current.stream.update(),m.redraw()})},Object(r.extend)(p.a.prototype,"notificationTypes",function(t){t.add("discussionLocked",{name:"discussionLocked",icon:"fas fa-lock",label:c.a.translator.trans("flarum-lock.forum.settings.notify_discussion_locked_label")})})})},function(t,n,o){var r=o(4).document;t.exports=r&&r.documentElement},function(t,n){var o=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++o+r).toString(36))}},function(t,n){t.exports=!0},function(t,n,o){var r=o(7),e=o(4),c=e["__core-js_shared__"]||(e["__core-js_shared__"]={});(t.exports=function(t,n){return c[t]||(c[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:o(30)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n,o){var r=o(12),e=Math.max,c=Math.min;t.exports=function(t,n){return(t=r(t))<0?e(t+n,0):c(t,n)}},function(t,n,o){var r=o(12),e=Math.min;t.exports=function(t){return t>0?e(r(t),9007199254740991):0}},function(t,n,o){var r=o(13),e=o(33),c=o(32);t.exports=function(t){return function(n,o,i){var u,a=r(n),f=e(a.length),s=c(i,f);if(t&&o!=o){for(;f>s;)if((u=a[s++])!=u)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===o)return t||s||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 o={}.toString;t.exports=function(t){return o.call(t).slice(8,-1)}},function(t,n,o){var r=o(36);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n,o){var r=o(14),e=o(13),c=o(34)(!1),i=o(11)("IE_PROTO");t.exports=function(t,n){var o,u=e(t),a=0,f=[];for(o in u)o!=i&&r(u,o)&&f.push(o);for(;n.length>a;)r(u,o=n[a++])&&(~c(f,o)||f.push(o));return f}},function(t,n,o){var r=o(38),e=o(10);t.exports=Object.keys||function(t){return r(t,e)}},function(t,n,o){var r=o(17),e=o(6),c=o(39);t.exports=o(3)?Object.defineProperties:function(t,n){e(t);for(var o,i=c(n),u=i.length,a=0;u>a;)r.f(t,o=i[a++],n[o]);return t}},function(t,n,o){var r=o(6),e=o(40),c=o(10),i=o(11)("IE_PROTO"),u=function(){},a=function(){var t,n=o(15)("iframe"),r=c.length;for(n.style.display="none",o(28).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;r--;)delete a.prototype[c[r]];return a()};t.exports=Object.create||function(t,n){var o;return null!==t?(u.prototype=r(t),o=new u,u.prototype=null,o[i]=t):o=a(),void 0===n?o:e(o,n)}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,o){var r=o(5);t.exports=function(t,n){if(!r(t))return t;var o,e;if(n&&"function"==typeof(o=t.toString)&&!r(e=o.call(t)))return e;if("function"==typeof(o=t.valueOf)&&!r(e=o.call(t)))return e;if(!n&&"function"==typeof(o=t.toString)&&!r(e=o.call(t)))return e;throw TypeError("Can't convert object to primitive value")}},function(t,n,o){t.exports=!o(3)&&!o(16)(function(){return 7!=Object.defineProperty(o(15)("div"),"a",{get:function(){return 7}}).a})},function(t,n,o){var r=o(17),e=o(42);t.exports=o(3)?function(t,n,o){return r.f(t,n,e(1,o))}:function(t,n,o){return t[n]=o,t}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,o){var r=o(46);t.exports=function(t,n,o){if(r(t),void 0===n)return t;switch(o){case 1:return function(o){return t.call(n,o)};case 2:return function(o,r){return t.call(n,o,r)};case 3:return function(o,r,e){return t.call(n,o,r,e)}}return function(){return t.apply(n,arguments)}}},function(t,n,o){var r=o(4),e=o(7),c=o(47),i=o(45),u=o(14),a=function(t,n,o){var f,s,p,l=t&a.F,d=t&a.G,m=t&a.S,v=t&a.P,y=t&a.B,x=t&a.W,h=d?e:e[n]||(e[n]={}),b=h.prototype,_=d?r:m?r[n]:(r[n]||{}).prototype;for(f in d&&(o=n),o)(s=!l&&_&&void 0!==_[f])&&u(h,f)||(p=s?_[f]:o[f],h[f]=d&&"function"!=typeof _[f]?o[f]:y&&s?c(p,r):x&&_[f]==p?function(t){var n=function(n,o,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,o)}return new t(n,o,r)}return t.apply(this,arguments)};return n.prototype=t.prototype,n}(p):v&&"function"==typeof p?c(Function.call,p):p,v&&((h.virtual||(h.virtual={}))[f]=p,t&a.R&&b&&!b[f]&&i(b,f,p)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,n,o){var r=o(48);r(r.S,"Object",{create:o(41)})},function(t,n,o){o(49);var r=o(7).Object;t.exports=function(t,n){return r.create(t,n)}}]);
//# sourceMappingURL=forum.js.map