pleroma/priv/static/packs/flavours/glitch/settings.js

2 lines
14 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{212:function(t,e,n){"use strict";function a(t){["interactive","complete"].includes(document.readyState)?t():document.addEventListener("DOMContentLoaded",t)}n.r(e),n.d(e,"default",function(){return a})},215:function(t,e,n){"use strict";e.a=function(){var t=!(Array.prototype.includes&&HTMLCanvasElement.prototype.toBlob&&window.Intl&&Number.isNaN&&Object.assign&&Object.values&&window.Symbol),e=!(window.IntersectionObserver&&window.IntersectionObserverEntry&&"isIntersecting"in IntersectionObserverEntry.prototype&&window.requestIdleCallback&&"object-fit"in(new Image).style);return Promise.all([t&&Promise.all([n.e(1),n.e(2)]).then(n.bind(null,458)),e&&Promise.all([n.e(1),n.e(13)]).then(n.bind(null,455))])}},59:function(t,e,n){var a,o;(function(){(function(){(function(){this.Rails={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:{selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",formDisableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",formEnableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]"}}).call(this)}).call(this);var r=this.Rails;(function(){(function(){var t;t=null,r.loadCSPNonce=function(){var e;return t=null!=(e=document.querySelector("meta[name=csp-nonce]"))?e.content:void 0},r.cspNonce=function(){return null!=t?t:r.loadCSPNonce()}}).call(this),function(){var t;t=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,r.matches=function(e,n){return null!=n.exclude?t.call(e,n.selector)&&!t.call(e,n.exclude):t.call(e,n)},r.getData=function(t,e){var n;return null!=(n=t._ujsData)?n[e]:void 0},r.setData=function(t,e,n){return null==t._ujsData&&(t._ujsData={}),t._ujsData[e]=n},r.$=function(t){return Array.prototype.slice.call(document.querySelectorAll(t))}}.call(this),function(){var t,e,n;t=r.$,n=r.csrfToken=function(){var t;return(t=document.querySelector("meta[name=csrf-token]"))&&t.content},e=r.csrfParam=function(){var t;return(t=document.querySelector("meta[name=csrf-param]"))&&t.content},r.CSRFProtection=function(t){var e;if(null!=(e=n()))return t.setRequestHeader("X-CSRF-Token",e)},r.refreshCSRFTokens=function(){var a,o;if(o=n(),a=e(),null!=o&&null!=a)return t('form input[name="'+a+'"]').forEach(function(t){return t.value=o})}}.call(this),function(){var t,e,n,a;n=r.matches,"function"!=typeof(t=window.CustomEvent)&&((t=function(t,e){var n;return(n=document.createEvent("CustomEvent")).initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}).prototype=window.Event.prototype,a=t.prototype.preventDefault,t.prototype.preventDefault=function(){var t;return t=a.call(this),this.cancelable&&!this.defaultPrevented&&Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),t}),e=r.fire=function(e,n,a){var o;return o=new t(n,{bubbles:!0,cancelable:!0,detail:a}),e.dispatchEvent(o),!o.defaultPrevented},r.stopEverything=function(t){return e(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()},r.delegate=function(t,e,a,o){return t.addEventListener(a,function(t){var a;for(a=t.target;a instanceof Element&&!n(a,e);)a=a.parentNode;if(a instanceof Element&&!1===o.call(a,t))return t.preventDefault(),t.stopPropagation()})}}.call(this),function(){var t,e,n,a,o,i;a=r.cspNonce,e=r.CSRFProtection,r.fire,t={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},r.ajax=function(t){var e;return t=o(t),e=n(t,function(){var n,a;return a=i(null!=(n=e.response)?n:e.responseText,e.getResponseHeader("Content-Type")),2===Math.floor(e.status/100)?"function"==typeof t.success&&t.success(a,e.statusText,e):"function"==typeof t.error&&t.error(a,e.statusText,e),"function"==typeof t.complete?t.complete(e,e.statusText):void 0}),!(null!=t.beforeSend&&!t.beforeSend(e,t))&&(e.readyState===XMLHttpRequest.OPENED?e.send(t.data):void 0)},o=function(e){return e.url=e.url||location.href,e.type=e.type.toUpperCase(),"GET"===e.type&&e.data&&(e.url.indexOf("?")<0?e.url+="?"+e.data:e.url+="&"+e.data),null==t[e.dataType]&&(e.dataType="*"),e.accept=t[e.dataType],"*"!==e.dataType&&(e.accept+=", */*; q=0.01"),e},n=function(t,n){var a;return(a=new XMLHttpRequest).open(t.type,t.url,!0),a.setRequestHeader("Accept",t.accept),"string"==typeof t.data&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),e(a),a.withCredentials=!!t.withCredentials,a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE)return n(a)},a},i=function(t,e){var n,o;if("string"==typeof t&&"string"==typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(t){}else if(e.match(/\b(?:java|ecma)script\b/))(o=document.createElement("script")).setAttribute("nonce",a()),o.text=t,document.head.appendChild(o).parentNode.removeChild(o);else if(e.match(/\b(xml|html|svg)\b/)){n=new DOMParser,e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(t){}}return t},r.href=function(t){return t.href},r.isCrossDomain=function(t){var e,n;(e=document.createElement("a")).href=location.href,n=document.createElement("a");try{return n.href=t,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host==n.protocol+"//"+n.host)}catch(t){return t,!0}}}.call(this),function(){var t,e;t=r.matches,e=function(t){return Array.prototype.slice.call(t)},r.serializeElement=function(n,a){var o,r;return o=[n],t(n,"form")&&(o=e(n.elements)),r=[],o.forEach(function(n){if(n.name&&!n.disabled)return t(n,"select")?e(n.options).forEach(function(t){if(t.selected)return r.push({name:n.name,value:t.value})}):n.checked||-1===["radio","checkbox","submit"].indexOf(n.type)?r.push({name:n.name,value:n.value}):void 0}),a&&r.push(a),r.map(function(t){return null!=t.name?encodeURIComponent(t.name)+"="+encodeURIComponent(t.value):t}).join("&")},r.formElements=function(n,a){return t(n,"form")?e(n.elements).filter(function(e){return t(e,a)}):e(n.querySelectorAll(a))}}.call(this),function(){var t,e,n;e=r.fire,n=r.stopEverything,r.handleConfirm=function(e){if(!t(this))return n(e)},t=function(t){var n,a,o;if(!(o=t.getAttribute("data-confirm")))return!0;if(n=!1,e(t,"confirm")){try{n=confirm(o)}catch(t){}a=e(t,"confirm:complete",[n])}return n&&a}}.call(this),function(){var t,e,n,a,o,i,l,c,u,s,d;u=r.matches,c=r.getData,s=r.setData,d=r.stopEverything,l=r.formElements,r.handleDisabledElement=function(t){if(this,this.disabled)return d(t)},r.enableElement=function(t){var e;return e=t instanceof Event?t.target:t,u(e,r.linkDisableSelector)?i(e):u(e,r.buttonDisableSelector)||u(e,r.formEnableSelector)?a(e):u(e,r.formSubmitSelector)?o(e):void 0},r.disableElement=function(a){var o;return o=a instanceof Event?a.target:a,u(o,r.linkDisableSelector)?n(o):u(o,r.buttonDisableSelector)||u(o,r.formDisableSelector)?t(o):u(o,r.formSubmitSelector)?e(o):void 0},n=function(t){var e;return null!=(e=t.getAttribute("data-disable-with"))&&(s(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",d),s(t,"ujs:disabled",!0)},i=function(t){var e;return null!=(e=c(t,"ujs:enable-with"))&&(t.innerHTML=e,s(t,"ujs:enable-with",null)),t.removeEventListener("click",d),s(t,"ujs:disabled",null)},e=function(e){return l(e,r.formDisableSelector).forEach(t)},t=function(t){var e;return null!=(e=t.getAttribute("data-disable-with"))&&(u(t,"button")?(s(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(s(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,s(t,"ujs:disabled",!0)},o=function(t){return l(t,r.formEnableSelector).forEach(a)},a=function(t){var e;return null!=(e=c(t,"ujs:enable-with"))&&(u(t,"button")?t.innerHTML=e:t.value=e,s(t,"ujs:enable-with",null)),t.disabled=!1,s(t,"ujs:disabled",null)}}.call(this),function(){var t;t=r.stopEverything,r.handleMethod=function(e){var n,a,o,i,l,c;if(this,c=this.getAttribute("data-method"))return l=r.href(this),a=r.csrfToken(),n=r.csrfParam(),o=document.createElement("form"),i="<input name='_method' value='"+c+"' type='hidden' />",null==n||null==a||r.isCrossDomain(l)||(i+="<input name='"+n+"' value='"+a+"' type='hidden' />"),i+='<input type="submit" />',o.method="post",o.action=l,o.target=this.target,o.innerHTML=i,o.style.display="none",document.body.appendChild(o),o.querySelector('[type="submit"]').click(),t(e)}}.call(this),function(){var t,e,n,a,o,i,l,c,u,s=[].slice;i=r.matches,n=r.getData,c=r.setData,e=r.fire,u=r.stopEverything,t=r.ajax,a=r.isCrossDomain,l=r.serializeElement,o=function(t){var e;return null!=(e=t.getAttribute("data-remote"))&&"false"!==e},r.handleRemote=function(d){var m,f,p,b,h,v,y;return!o(b=this)||(e(b,"ajax:before")?(y=b.getAttribute("data-with-credentials"),p=b.getAttribute("data-type")||"script",i(b,r.formSubmitSelector)?(m=n(b,"ujs:submit-button"),h=n(b,"ujs:submit-button-formmethod")||b.method,v=n(b,"ujs:submit-button-formaction")||b.getAttribute("action")||location.href,"GET"===h.toUpperCase()&&(v=v.replace(/\?.*$/,"")),"multipart/form-data"===b.enctype?(f=new FormData(b),null!=m&&f.append(m.name,m.value)):f=l(b,m),c(b,"ujs:submit-button",null),c(b,"ujs:submit-button-formmethod",null),c(b,"ujs:submit-button-formaction",null)):i(b,r.buttonClickSelector)||i(b,r.inputChangeSelector)?(h=b.getAttribute("data-method"),v=b.getAttribute("data-url"),f=l(b,b.getAttribute("data-params"))):(h=b.getAttribute("data-method"),v=r.href(b),f=b.getAttribute("data-params")),t({type:h||"GET",url:v,data:f,dataType:p,beforeSend:function(t,n){return e(b,"ajax:beforeSend",[t,n])?e(b,"ajax:send",[t]):(e(b,"ajax:stopped"),!1)},success:function(){var t;return t=1<=arguments.length?s.call(arguments,0):[],e(b,"ajax:success",t)},error:function(){var t;return t=1<=arguments.length?s.call(arguments,0):[],e(b,"ajax:error",t)},complete:function(){var t;return t=1<=arguments.length?s.call(arguments,0):[],e(b,"ajax:complete",t)},crossDomain:a(v),withCredentials:null!=y&&"false"!==y}),u(d)):(e(b,"ajax:stopped"),!1))},r.formSubmitButtonClick=function(t){var e;if(this,e=this.form)return this.name&&c(e,"ujs:submit-button",{name:this.name,value:this.value}),c(e,"ujs:formnovalidate-button",this.formNoValidate),c(e,"ujs:submit-button-formaction",this.getAttribute("formaction")),c(e,"ujs:submit-button-formmethod",this.getAttribute("formmethod"))},r.preventInsignificantClick=function(t){var e,n,a;if(this,a=(this.getAttribute("data-method")||"GET").toUpperCase(),e=this.getAttribute("data-params"),n=(t.metaKey||t.ctrlKey)&&"GET"===a&&!e,!(0===t.button)||n)return t.stopImmediatePropagation()}}.call(this),function(){var t,e,n,a,o,i,l,c,u,s,d,m,f,p,b;if(i=r.fire,n=r.delegate,c=r.getData,t=r.$,b=r.refreshCSRFTokens,e=r.CSRFProtection,f=r.loadCSPNonce,o=r.enableElement,a=r.disableElement,s=r.handleDisabledElement,u=r.handleConfirm,p=r.preventInsignificantClick,m=r.handleRemote,l=r.formSubmitButtonClick,d=r.handleMethod,"undefined"!=typeof jQuery&&null!==jQuery&&null!=jQuery.ajax){if(jQuery.rails)throw new Error("If you load both jquery_ujs and rails-ujs, use rails-ujs only.");jQuery.rails=r,jQuery.ajaxPrefilter(function(t,n,a){if(!t.crossDomain)return e(a)})}r.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",function(){return t(r.formEnableSelector).forEach(function(t){if(c(t,"ujs:disabled"))return o(t)}),t(r.linkDisableSelector).forEach(function(t){if(c(t,"ujs:disabled"))return o(t)})}),n(document,r.linkDisableSelector,"ajax:complete",o),n(document,r.linkDisableSelector,"ajax:stopped",o),n(document,r.buttonDisableSelector,"ajax:complete",o),n(document,r.buttonDisableSelector,"ajax:stopped",o),n(document,r.linkClickSelector,"click",p),n(document,r.linkClickSelector,"click",s),n(document,r.linkClickSelector,"click",u),n(document,r.linkClickSelector,"click",a),n(document,r.linkClickSelector,"click",m),n(document,r.linkClickSelector,"click",d),n(document,r.buttonClickSelector,"click",p),n(document,r.buttonClickSelector,"click",s),n(document,r.buttonClickSelector,"click",u),n(document,r.buttonClickSelector,"click",a),n(document,r.buttonClickSelector,"click",m),n(document,r.inputChangeSelector,"change",s),n(document,r.inputChangeSelector,"change",u),n(document,r.inputChangeSelector,"change",m),n(document,r.formSubmitSelector,"submit",s),n(document,r.formSubmitSelector,"submit",u),n(document,r.formSubmitSelector,"submit",m),n(document,r.formSubmitSelector,"submit",function(t){return setTimeout(function(){return a(t)},13)}),n(document,r.formSubmitSelector,"ajax:send",a),n(document,r.formSubmitSelector,"ajax:complete",o),n(document,r.formInputClickSelector,"click",p),n(document,r.formInputClickSelector,"click",s),n(document,r.formInputClickSelector,"click",u),n(document,r.formInputClickSelector,"click",l),document.addEventListener("DOMContentLoaded",b),document.addEventListener("DOMContentLoaded",f),window._rails_loaded=!0},window.Rails===r&&i(document,"rails:attachBindings")&&r.start()}.call(this)}).call(this),t.exports?t.exports=r:void 0===(o="function"==typeof(a=r)?a.call(e,n,e,t):a)||(t.exports=o)}).call(this)},905:function(t,e,n){"use strict";n.r(e);var a=n(215);n(212);Object(a.a)().then(function(){(0,n(59).delegate)(document,".sidebar__toggle__icon","click",function(){var t=document.querySelector(".sidebar ul");"block"===t.style.display?t.style.display="none":t.style.display="block"})}).catch(function(t){console.error(t)})}},[[905,0]]]);
//# sourceMappingURL=settings.js.map