CoreFiles by mySites.guru
joomla-field-permissions-es5.min.js1 lines, 5,326 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
22684c11548e2ae022b2c88df0d368a2
sha1
9177969141307c997f5e681701f1bd8b5ba1082a
sha256
68a3a0ea51415453ceb9e49ebde82f4ec96f6ce13e00554215cacdf2709af123
"use strict";function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}function _possibleConstructorReturn(a,b){return b&&("object"===_typeof(b)||"function"==typeof b)?b:_assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&_setPrototypeOf(a,b)}function _wrapNativeSuper(a){var b="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(a){function c(){return _construct(a,arguments,_getPrototypeOf(this).constructor)}if(null===a||!_isNativeFunction(a))return a;if("function"!=typeof a)throw new TypeError("Super expression must either be null or a function");if("undefined"!=typeof b){if(b.has(a))return b.get(a);b.set(a,c)}return c.prototype=Object.create(a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(c,a)},_wrapNativeSuper(a)}function isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(a){return!1}}function _construct(){return _construct=isNativeReflectConstruct()?Reflect.construct:function(b,c,d){var e=[null];e.push.apply(e,c);var a=Function.bind.apply(b,e),f=new a;return d&&_setPrototypeOf(f,d.prototype),f},_construct.apply(null,arguments)}function _isNativeFunction(a){return-1!==Function.toString.call(a).indexOf("[native code]")}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}(function(a,b){var c=function(a){function c(){var a;if(_classCallCheck(this,c),a=_possibleConstructorReturn(this,_getPrototypeOf(c).call(this)),!b)throw new Error("Joomla API is not properly initiated");if(!a.getAttribute("data-uri"))throw new Error("No valid url for validation");return a}return _inherits(c,a),_createClass(c,[{key:"connectedCallback",value:function d(){var a=this,b="data-onchange-task",c=[].slice.call(document.querySelectorAll("["+b+"]"));c&&c.forEach(function(c){c.addEventListener("change",function(c){c.preventDefault();var d=c.target.getAttribute(b);"permissions.apply"==d&&a.sendPermissions(c)})})}},{key:"sendPermissions",value:function p(a){var c=a.target,d=document.getElementById("icon_"+c.id);d.removeAttribute("class"),d.setAttribute("class","fa fa-spinner fa-spin");var e="not",f=this.getUrlParam("component"),g=this.getUrlParam("extension"),h=this.getUrlParam("option"),i=this.getUrlParam("view"),j=f,k=c.value,l="";document.getElementById("jform_context")&&(l=document.getElementById("jform_context").value,l=l.split(".")[0]),"com_config"==h&&!1==f&&!1==g?e="root.1":!1==g&&"component"==i?e=f:l?(e="group"==i?l+".fieldgroup."+this.getUrlParam("id"):l+".field."+this.getUrlParam("id"),j=document.getElementById("jform_title").value):!1!=g&&!1!=i?(e=g+"."+i+"."+this.getUrlParam("id"),j=document.getElementById("jform_title").value):!1==g&&!1!=i&&(e=h+"."+i+"."+this.getUrlParam("id"),j=document.getElementById("jform_title").value);var m=c.id.replace("jform_rules_",""),n=m.lastIndexOf("_"),o={comp:e,action:m.substring(0,n),rule:m.substring(n+1),value:k,title:j};b.removeMessages(),b.request({url:this.getAttribute("data-uri"),method:"POST",data:JSON.stringify(o),perform:!0,headers:{"Content-Type":"application/json"},onSuccess:function e(a){try{a=JSON.parse(a)}catch(a){console.log(a)}if(d.removeAttribute("class"),a.data&&!0===a.data.result){d.setAttribute("class","fa fa-check");var f=c.parentNode.parentNode.nextElementSibling.querySelector("span");f.removeAttribute("class"),f.setAttribute("class",a.data["class"]),f.innerHTML=a.data.text}"object"===_typeof(a.messages)&&null!==a.messages&&(b.renderMessages(a.messages),a.data&&!0===a.data.result?d.setAttribute("class","fa fa-check"):d.setAttribute("class","fa fa-times"))},onError:function a(){d.removeAttribute("style"),b.renderMessages(b.ajaxErrorsMessages(jqXHR,textStatus,error)),d.setAttribute("class","fa fa-times")}})}},{key:"getUrlParam",value:function f(a){for(var b,c=window.location.search.substring(1),d=c.split("&"),e=0;e<d.length;e+=1)if(b=d[e].split("="),b[0]==a)return b[1];return!1}}]),c}(_wrapNativeSuper(HTMLElement));a.define("joomla-field-permissions",c)})(customElements,Joomla);

No other release has this exact content. See every version of this file.