1(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/database/assign-to-subscription"],{1013:(t,s,e)=>{"use strict";e.r(s);var i=e(85);class n extends i.PopupForm{_initConfiguration(t){super._initConfiguration({locale:i.Locale.getSection("smb.components.lists.databases"),fullHeight:!0,...t}),this._ids=this._getConfigParam("ids",[]),this._handlerUrl=this._getConfigParam("handlerUrl","/database/assign-to-subscription"),this._sendButtonId=this._getConfigParam("sendButtonId","btn-send"),this._cancelButtonId=this._getConfigParam("cancelButtonId","btn-cancel")}render(){super.render(),this.setBoxType("form-box"),this.setTitle(this.lmsg("assignToSubscriptionPopupTitle")),document.getElementById(this._contentAreaId).innerHTML=`<p>${this.lmsg("assignToSubscriptionPopupDesc")}</p><form method="post" id="${this._id}-form"><div class="form-row"><div class="field-name"><label for="${this._id}-domain-name">${this.lmsg("assignToSubscription")}</label></div><div class="field-value" id="${this._id}-container"></div></form>`,this.initSearch(),this.initOnSubmitEvent(),this.addOkButton(),this.addCancelButton()}initSearch(){this._searchComponent=new i.LookUp({id:`${this._id}-domain-name`,name:`${this._id}-domain-name`,renderTo:`${this._id}-container`,locale:this.getLocale(),dataUrl:"/database/subscription-list/",copyTitleValue:!0})}onSubmitEvent(t){return this.handler(),t.preventDefault(),!1}initOnSubmitEvent(){const t=document.getElementById(`${this._id}-form`);t._formSubmit=t.submit,t.submit=this.onOkClick.bind(this),t.addEventListener("submit",this.onSubmitEvent.bind(this))}addOkButton(){this.addRightButton(i.Locale.getSection("components.buttons").lmsg("ok"),this.onOkClick,!0,!0,{id:this._sendButtonId})}addCancelButton(){this.addRightButton(i.Locale.getSection("components.buttons").lmsg("cancel"),this.onCancelClick,!1,!1,{id:this._cancelButtonId})}onOkClick(){this.handler()}onCancelClick(){this.hide()}disable(){const t=document.getElementById(this._sendButtonId);t&&(t.disabled=!0,t.classList.add("disabled"),this._sendButtonTitle||(this._sendButtonTitle=t.innerHTML),t.innerHTML=`<span class="wait">${this.lmsg("loading")}</span>`);const s=document.getElementById(this._cancelButtonId);s&&(s.disabled=!0,s.classList.add("disabled"))}enable(){const t=document.getElementById(this._sendButtonId);t&&(t.disabled=!1,t.innerHTML=this._sendButtonTitle,t.classList.remove("disabled"));const s=document.getElementById(this._cancelButtonId);s&&(s.disabled=!1,s.classList.remove("disabled"))}onException(t,s){this._addErrorMessage(`Internal error: ${s}`),this.enable()}onSuccess(t){(0,i.clearStatusMessages)();try{const s=JSON.parse(t.responseText);this.processForm(s)}catch{0!=t.status&&((0,i.showInternalError)(t.responseText),this.hide())}}processForm(t){t.status&&"error"===t.status?($A(t.statusMessages).each((function(t){(0,i.addStatusMessage)(t.status,t.content,{title:t.title})})),this.hide()):document.location.reload()}handler(){const t=this._searchComponent.getDisplayValue();t&&new Ajax.Request((0,i.prepareUrl)(this._handlerUrl),{method:"post",parameters:{domainName:t,"ids[]":this._ids},onException:this.onException.bind(this),onSuccess:this.onSuccess.bind(this)})}}s.default=n}}]); 2//# sourceMappingURL=assign-to-subscription.js.map?2afbded9fecb85bf8cfb
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.