\n
\n
\n";
this.embedInputFn = this.embedInputFn.bind(this);
this.inputFn = this.inputFn.bind(this);
[].slice.call(this.querySelectorAll('.form-check-input.radio')).map(function (el) {
return el.addEventListener('input', _this.embedInputFn);
});
this.setAttribute('embed-it', false);
[].slice.call(this.querySelectorAll('input[type="text"]')).map(function (el) {
el.addEventListener('input', _this.inputFn);
var is = el.dataset.is;
if (is) {
_this.setAttribute(is, el.value.replace(/"/g, '"'));
}
return el;
});
}
};
_proto.disconnectedCallback = function disconnectedCallback() {
var _this2 = this;
if (this.type === 'image') {
this.lazyInput.removeEventListener('input', this.lazyInputFn);
this.altInput.removeEventListener('input', this.inputFn);
this.altCheck.removeEventListener('input', this.altCheckFn);
}
if (['audio', 'video', 'document'].includes(this.type)) {
[].slice.call(this.querySelectorAll('.form-check-input.radio')).map(function (el) {
return el.removeEventListener('input', _this2.embedInputFn);
});
[].slice.call(this.querySelectorAll('input[type="text"]')).map(function (el) {
return el.removeEventListener('input', _this2.embedInputFn);
});
}
this.innerHTML = '';
};
_proto.lazyInputFn = function lazyInputFn(e) {
this.setAttribute('is-lazy', !!e.target.checked);
};
_proto.altCheckFn = function altCheckFn(e) {
this.setAttribute('alt-check', !!e.target.checked);
};
_proto.inputFn = function inputFn(e) {
var is = e.target.dataset.is;
if (is) {
this.setAttribute(is, e.target.value.replace(/"/g, '"'));
}
};
_proto.embedInputFn = function embedInputFn(e) {
var value = e.target.value;
this.setAttribute('embed-it', value !== '0');
var toggable = this.querySelector('.toggable-parts');
if (toggable) {
if (toggable.style.display !== 'block') {
toggable.style.display = 'block';
} else {
toggable.style.display = 'none';
}
}
};
_createClass(JoomlaFieldMediaOptions, [{
key: "type",
get: function get() {
return this.getAttribute('type');
}
}, {
key: "parentId",
get: function get() {
return this.getAttribute('parent-id');
}
}, {
key: "lazytext",
get: function get() {
return this.getAttribute('lazy-label');
}
}, {
key: "alttext",
get: function get() {
return this.getAttribute('alt-label');
}
}, {
key: "altchecktext",
get: function get() {
return this.getAttribute('alt-check-label');
}
}, {
key: "altcheckdesctext",
get: function get() {
return this.getAttribute('alt-check-desc-label');
}
}, {
key: "embedchecktext",
get: function get() {
return this.getAttribute('embed-check-label');
}
}, {
key: "embedcheckdesctext",
get: function get() {
return this.getAttribute('embed-check-desc-label');
}
}, {
key: "downloadchecktext",
get: function get() {
return this.getAttribute('download-check-label');
}
}, {
key: "downloadcheckdesctext",
get: function get() {
return this.getAttribute('download-check-desc-label');
}
}, {
key: "classestext",
get: function get() {
return this.getAttribute('classes-label');
}
}, {
key: "figclassestext",
get: function get() {
return this.getAttribute('figure-classes-label');
}
}, {
key: "figcaptiontext",
get: function get() {
return this.getAttribute('figure-caption-label');
}
}, {
key: "summarytext",
get: function get() {
return this.getAttribute('summary-label');
}
}, {
key: "widthtext",
get: function get() {
return this.getAttribute('width-label');
}
}, {
key: "heighttext",
get: function get() {
return this.getAttribute('height-label');
}
}, {
key: "titletext",
get: function get() {
return this.getAttribute('title-label');
}
}]);
return JoomlaFieldMediaOptions;
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
customElements.define('joomla-field-mediamore', JoomlaFieldMediaOptions);
}());