CoreFiles by mySites.guru
joomla-field-module-order-es5.min.js1 lines, 3,775 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
5384e92b2ce569fcf983edffd5ef567b
sha1
2f94000823383cc5ddcfc57ea11737a61bb1297c
sha256
eb9f3364897f18440ad5b75e13f65a7739f5b39802709b783eb2ebaadd0f8536
!function(){return function e(t,i,n){function r(l,a){if(!i[l]){if(!t[l]){var s="function"==typeof require&&require;if(!a&&s)return s(l,!0);if(o)return o(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var d=i[l]={exports:{}};t[l][0].call(d.exports,function(e){return r(t[l][1][e]||e)},d,d.exports,e,t,i,n)}return i[l].exports}for(var o="function"==typeof require&&require,l=0;l<n.length;l++)r(n[l]);return r}}()({1:[function(e,t,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();customElements.define("joomla-field-module-order",function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.linkedFieldSelector="",e.linkedFieldElement="",e.originalPosition="",e.writeDynaList.bind(e),e.getNewOrder.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,HTMLElement),r(t,[{key:"connectedCallback",value:function(){if(this.linkedFieldSelector=this.getAttribute("data-linked-field")||"jform_position",!this.linkedFieldSelector)throw new Error("No linked field defined!");if(this.linkedFieldElement=document.getElementById(this.linkedFieldSelector),!this.linkedFieldElement)throw new Error("No linked field defined!");var e=this;this.originalPosition=this.linkedFieldElement.value,this.getNewOrder(this.originalPosition),this.linkedFieldElement.addEventListener("change",function(){e.originalPosition=e.linkedFieldElement.value,e.getNewOrder(e.linkedFieldElement.value)})}},{key:"writeDynaList",value:function(e,t,i,n){var r=0,o=document.createElement("select");for(var l in this.hasOwnProperty("disabled")&&o.setAttribute("disabled",""),this.getAttribute("onchange")&&o.setAttribute("onchange",this.getAttribute("onchange")),this.getAttribute("size")&&o.setAttribute("size",this.getAttribute("size")),o.classList.add(e.itemClass),o.setAttribute("name",e.name),o.id=e.id,t)if(t.hasOwnProperty(l)){var a=document.createElement("option"),s=t[l];a.value=s[1],a.innerHTML=s[2],(i&&n===s[1]||!i&&0===r)&&a.setAttribute("selected","selected"),o.appendChild(a),r++}this.innerHTML="",this.appendChild(o)}},{key:"getNewOrder",value:function(e){var t=this.getAttribute("data-url"),i=this.getAttribute("data-client-id"),r=this.getAttribute("data-ordering"),o=this.getAttribute("data-name"),l=this.getAttribute("data-client-attr")?this.getAttribute("data-client-attr"):"custom-select",a=this.getAttribute("id")+"_1",s=[],u=this;Joomla.request({url:t+"client_id="+i+"&position="+e,method:"GET",perform:!0,headers:{"Content-Type":"application/x-www-form-urlencoded"},onSuccess:function(e,t){if(e&&(e=JSON.parse(e)).data.length>0){for(var i=0;i<e.data.length;++i)s[i]=e.data[i].split(",");u.writeDynaList({name:o,id:a,itemClass:l},s,u.originalPosition,r)}"object"==n(e.messages)&&null!==e.messages&&Joomla.renderMessages(e.messages)}})}}]),t}())},{}]},{},[1]);

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