%PDF- %PDF-
Direktori : /home/bitrix/www/bitrix/components/bitrix/lists.list.edit/templates/.default/ |
Current File : //home/bitrix/www/bitrix/components/bitrix/lists.list.edit/templates/.default/script.min.js |
BX.namespace("BX.Lists");BX.Lists.ListsEditClass=function(){var t=function(t){this.randomString=t.randomString;this.iblockTypeId=t.iblockTypeId;this.iblockId=t.iblockId;this.socnetGroupId=t.socnetGroupId;this.jsClass="ListsEditClass_"+t.randomString;this.listsUrl=t.listsUrl||"";this.listAction=t.listAction;this.listTemplateEditUrl=t.listTemplateEditUrl;this.init()};t.prototype.init=function(){this.ajaxUrl="/bitrix/components/bitrix/lists.list.edit/ajax.php";this.actionButton=BX("lists-title-action");this.actionPopupItems=[];this.actionPopupObject=null;this.actionPopupId="lists-title-action";BX.bind(this.actionButton,"click",BX.delegate(this.showListAction,this))};t.prototype.showListAction=function(){if(!this.actionPopupItems.length){for(var t=0;t<this.listAction.length;t++){this.actionPopupItems.push({text:this.listAction[t].text,onclick:this.listAction[t].action})}}if(!BX.PopupMenu.getMenuById(this.actionPopupId)){var s=this.actionButton.getBoundingClientRect();this.actionPopupObject=BX.PopupMenu.create(this.actionPopupId,this.actionButton,this.actionPopupItems,{closeByEsc:true,angle:true,offsetLeft:s.width/2,events:{onPopupShow:BX.proxy(function(){BX.addClass(this.actionButton,"webform-button-active")},this),onPopupClose:BX.proxy(function(){BX.removeClass(this.actionButton,"webform-button-active")},this)}})}if(this.actionPopupObject)this.actionPopupObject.popupWindow.show()};t.prototype.copyIblock=function(){BX.Lists.modalWindow({modalId:"bx-lists-migrate-list",title:BX.message("CT_BLLE_COPY_POPUP_TITLE"),draggable:true,contentClassName:"",contentStyle:{width:"400px",padding:"20px 20px 20px 20px"},events:{onPopupClose:function(){this.destroy()}},content:BX.message("CT_BLLE_COPY_POPUP_CONTENT"),buttons:[BX.create("span",{text:BX.message("CT_BLLE_COPY_POPUP_ACCEPT_BUTTON"),props:{id:"lists-popup-button-copy-accept",className:"webform-small-button webform-small-button-accept"},events:{click:BX.delegate(function(){if(BX.hasClass(BX("lists-popup-button-copy-accept"),"webform-small-button-wait"))return;BX.addClass(BX("lists-popup-button-copy-accept"),"webform-small-button-wait");BX.Lists.ajax({method:"POST",dataType:"json",url:BX.Lists.addToLinkParam(this.ajaxUrl,"action","copyIblock"),data:{iblockTypeId:this.iblockTypeId,iblockId:this.iblockId,socnetGroupId:this.socnetGroupId},onsuccess:BX.delegate(function(t){if(t.status=="success"){BX.Lists.showModalWithStatusAction({status:"success",message:t.message});this.listTemplateEditUrl=this.listTemplateEditUrl.replace("#list_id#",t.copyIblockId).replace("#group_id#",this.socnetGroupId);setTimeout(BX.delegate(function(){document.location.href=this.listTemplateEditUrl},this),1e3);BX.removeClass(BX("lists-popup-button-copy-accept"),"webform-small-button-wait")}else{t.errors=t.errors||[{}];BX.Lists.showModalWithStatusAction({status:"error",message:t.errors.pop().message})}},this)})},this)}}),BX.create("span",{text:BX.message("CT_BLLE_COPY_POPUP_CANCEL_BUTTON"),props:{className:"popup-window-button popup-window-button-link popup-window-button-link-cancel"},events:{click:BX.delegate(function(){BX.PopupWindowManager.getCurrentPopup().close()},this)}})]})};t.prototype.deleteIblock=function(t,s){var e=BX(t);var o=BX("action");if(e&&o){BX.Lists.modalWindow({modalId:"bx-lists-migrate-list",title:BX.message("CT_BLLE_DELETE_POPUP_TITLE"),draggable:true,contentClassName:"",contentStyle:{width:"400px",padding:"20px 20px 20px 20px"},events:{onPopupClose:function(){this.destroy()}},content:s,buttons:[BX.create("span",{text:BX.message("CT_BLLE_DELETE_POPUP_ACCEPT_BUTTON"),props:{className:"webform-small-button webform-small-button-accept"},events:{click:BX.delegate(function(){o.value="delete";e.submit()},this)}}),BX.create("span",{text:BX.message("CT_BLLE_DELETE_POPUP_CANCEL_BUTTON"),props:{className:"popup-window-button popup-window-button-link popup-window-button-link-cancel"},events:{click:BX.delegate(function(){BX.PopupWindowManager.getCurrentPopup().close()},this)}})]})}};t.prototype.migrateList=function(t,s){var e=BX(t);var o=BX("action");if(e&&o){BX.Lists.modalWindow({modalId:"bx-lists-migrate-list",title:BX.message("CT_BLLE_MIGRATE_POPUP_TITLE"),draggable:true,contentClassName:"",contentStyle:{width:"400px",padding:"20px 20px 20px 20px"},events:{onPopupClose:function(){this.destroy()}},content:s,buttons:[BX.create("span",{text:BX.message("CT_BLLE_MIGRATE_POPUP_ACCEPT_BUTTON"),props:{className:"webform-small-button webform-small-button-accept"},events:{click:BX.delegate(function(){o.value="migrate";e.submit()},this)}}),BX.create("span",{text:BX.message("CT_BLLE_MIGRATE_POPUP_CANCEL_BUTTON"),props:{className:"popup-window-button popup-window-button-link popup-window-button-link-cancel"},events:{click:BX.delegate(function(){BX.PopupWindowManager.getCurrentPopup().close()},this)}})]})}};return t}();