1 line
9.1 KiB
JavaScript
1 line
9.1 KiB
JavaScript
(()=>{"use strict";var t,n={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return n.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)n.o(o,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n)},o=(t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)},function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),r=function(){this.enabled=!0},e=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n}(r),i=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),s=function(){function t(){this.core_settings=new c,this.jokes={}}return t.check=function(t){return Math.random()<.01*t},t.prototype.add=function(t){this.jokes[t.id]=t},t.prototype.addCustom=function(t,n,o){void 0===o&&(o=null);var e=new(function(o){function r(){var n=null!==o&&o.apply(this,arguments)||this;return n.id=t,n.settings={chance:10},n}return i(r,o),r.prototype.start=function(){n.call(this,this.settings)},r}(r));Object.assign(e.settings,null!=o?o:{}),this.add(e)},Object.defineProperty(t.prototype,"settings",{get:function(){var t={};t.core=this.core_settings;for(var n=0,o=Object.entries(this.jokes);n<o.length;n++){var r=o[n],e=r[0],i=r[1];t[e]=i.settings}return t},set:function(t){for(var n=0,o=Object.entries(t);n<o.length;n++){var r=o[n],e=r[0],i=r[1],s="core"===e?this.core_settings:this.jokes[e].settings;Object.assign(s,i)}},enumerable:!1,configurable:!0}),t.prototype.start=function(n,o){if(void 0===o&&(o=!1),n in this.jokes){var r=this.jokes[n];(o||t.check(r.settings.chance))&&r.start()}},t.prototype.startAll=function(t){void 0===t&&(t=!1);for(var n=0,o=Object.keys(this.jokes);n<o.length;n++){var r=o[n];this.start(r,t)}},t.prototype.regularStart=function(){var n=new Date,o=n.getMonth()+1,r=n.getDate();4===o&&1===r&&t.check(this.core_settings.chance)&&this.startAll()},t}(),c=function(){this.chance=100};const a=jQuery;var u,p,f=n.n(a),l=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),h=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="shake",n.settings=new y,n.data_name="april-fools-shake",n}return l(n,t),n.prototype.rand=function(t){return t+this.settings.force*(2*Math.random()-1)},n.prototype.start=function(){var t=this;this.items=f()(this.settings.selector),this.items.each((function(n,o){var r={};t.settings.directions.forEach((function(t){r[t]=parseInt(f()(o).css("margin-"+t))})),f()(o).data(t.data_name,r)})),this.interval_id=setInterval((function(){t.items.each((function(n,o){for(var r=f()(o).data(t.data_name),e=0,i=Object.entries(r);e<i.length;e++){var s=i[e];f()(o).css("margin-"+s[0],t.rand(s[1]))}}))}),this.settings.interval)},n.prototype.stop=function(){var t=this;clearInterval(this.interval_id),this.items.each((function(n,o){var r={};t.settings.directions.forEach((function(t){f()(o).css("margin-"+t,r[t])})),f()(o).data(t.data_name,r)}))},n}(e),y=function(){this.chance=1,this.directions=["top","left","bottom","left"],this.selector="[id^=pun]",this.interval=100,this.force=.5},_=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),v=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="humanitarian_hell",n.settings=new g,n}return _(n,t),n.prototype.start=function(){f()(this.settings.selector).each((function(){f()(this).html(f()(this).html().replace(/(ть?ся)/g,(function(t){return t.indexOf("ь")>0?"тся":"ться"})))}))},n}(r),g=function(){this.chance=20,this.selector=".post-content"},d=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),O=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="mirror",n.settings=new w,n}return d(n,t),n.prototype.start=function(){f()(".post, .post h3, .post-links, .post-author, .post-content").css("transform","scaleX(-1)").css("-moz-transform","scaleX(-1)").css("-moz-transform","scaleX(-1)").css("filter","FlipH").css("-ms-filter",'"FlipH"'),f()(".post-links, .post-links ul, .post h3 span").css("margin-left","0"),f()(".post h3 span").css("margin-right","25em")},n}(r),w=function(){this.chance=30},j=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),b=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="carnival",n.settings=new m,n}return j(n,t),n.prototype.start=function(){var t=this;f()(this.settings.selector).each((function(n,o){for(var r=[],e=0,i=Object.entries(t.settings.variants);e<i.length;e++){var c=i[e];s.check(t.settings.variant_chance)&&r.push(c[0].replace("{0}",Math.round(Math.random()*c[1]).toString()))}r.length>0&&f()(o).css({filter:r.join(" ")})}))},n}(r),m=function(){this.chance=30,this.selector='img[src*="/avatars/"]',this.variant_chance=20,this.variants={"sepia({0}%)":100,"saturate({0}%)":100,"hue-rotate({0}deg)":360,"invert({0}%)":100}},P=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),k=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="crazy_letters",n.settings=new E,n}return P(n,t),n.prototype.start=function(){var t=this;f()(this.settings.selector).each((function(n,o){for(var r=f()(t).text(),e="",i=0;i<r.length;i++)e+=r[i][i%2?"toLowerCase":"toUpperCase"]();f()(t).text(e)}))},n}(r),E=function(){this.chance=20,this.selector=".pa-author a"},x=function(){var t=function(n,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},t(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),A=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.id="crazy_punctuation",n.settings=new C,n}return x(n,t),n.prototype.transform=function(t){for(var n="",o=0;o<t.length;o++){var r=t[o],e=t[o+1];(this.settings.symbols.includes(r)||" "===e||this.settings.symbols.includes(e))&&(n+=r)}return n},n.prototype.process=function(t){},n.prototype.start=function(){f()(this.settings.selector).find("*").contents().filter((function(t,n){return n.nodeType===Node.TEXT_NODE})).each((function(t,n){console.log(n)}))},n}(r),C=function(){this.chance=20,this.selector=".post-content",this.symbols=",.;:?!-()[]{}'\""};window.AprilJokes=(u=[h,v,O,b,k,A],p=new s,u.forEach((function(t){p.add(new t)})),p.regularStart(),p)})(); |