BX.namespace("BX.IBlock");function JCIBlockProperty(e){if(!e){return}this.intERROR=0;this.PREFIX=e.PREFIX;this.PREFIX_TR=this.PREFIX+"ROW_";this.FORM_ID=e.FORM_ID;this.TABLE_PROP_ID=e.TABLE_PROP_ID;this.PROP_COUNT_ID=e.PROP_COUNT_ID;this.IBLOCK_ID=e.IBLOCK_ID;this.LANG=e.LANG;this.TITLE=e.TITLE;this.CELLS=[];this.CELL_IND=-1;this.CELL_CENT=[];this.OBJNAME=e.OBJ;BX.ready(BX.delegate(this.Init,this))}JCIBlockProperty.prototype.Init=function(){var e=null,t=0;this.FORM_DATA=BX(this.FORM_ID);if(!this.FORM_DATA){this.intERROR=-1;return}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}e=BX.findChildren(this.PROP_TBL,{tag:"input",attribute:{type:"button"}},true);if(!!e){for(t=0;tthis.intERROR)return{};e=this.PREFIX+e;return{PROPERTY_TYPE:this.FORM_DATA[e+"_PROPERTY_TYPE"].value,NAME:this.FORM_DATA[e+"_NAME"].value,ACTIVE:this.FORM_DATA[e+"_ACTIVE_Y"].checked?this.FORM_DATA[e+"_ACTIVE_Y"].value:this.FORM_DATA[e+"_ACTIVE_N"].value,MULTIPLE:this.FORM_DATA[e+"_MULTIPLE_Y"].checked?this.FORM_DATA[e+"_MULTIPLE_Y"].value:this.FORM_DATA[e+"_MULTIPLE_N"].value,IS_REQUIRED:this.FORM_DATA[e+"_IS_REQUIRED_Y"].checked?this.FORM_DATA[e+"_IS_REQUIRED_Y"].value:this.FORM_DATA[e+"_IS_REQUIRED_N"].value,SORT:this.FORM_DATA[e+"_SORT"].value,CODE:this.FORM_DATA[e+"_CODE"].value,PROPINFO:this.FORM_DATA[e+"_PROPINFO"].value}};JCIBlockProperty.prototype.SetPropInfo=function(e,t,i){var r=0,n=null,s=null,o=null;if(0>this.intERROR){return}if(!i){return}if(BX.bitrix_sessid()!==i){return}e=this.PREFIX+e;this.FORM_DATA[e+"_NAME"].value=t.NAME;this.FORM_DATA[e+"_SORT"].value=t.SORT;this.FORM_DATA[e+"_CODE"].value=t.CODE;n=BX(e+"_ACTIVE_Y");n.checked="Y"===t.ACTIVE;s=BX(e+"_MULTIPLE_Y");s.checked="Y"===t.MULTIPLE;o=BX(e+"_IS_REQUIRED_Y");o.checked="Y"===t.IS_REQUIRED;this.FORM_DATA[e+"_PROPINFO"].value=t.PROPINFO;for(r=0;rthis.intERROR)return"";if(!e||!this[e])return"";return this[e]};JCIBlockProperty.prototype.SetProperty=function(e,t){if(0>this.intERROR){return}if(e){this[e]=t}};JCIBlockProperty.prototype.ShowPropertyDialog=function(){if(0>this.intERROR){return}var e=BX.proxy_context,t="",i={};if(!!e&&e.hasAttribute("data-propid")){t=e.getAttribute("data-propid");i={PARAMS:{PREFIX:this.PREFIX,ID:t,IBLOCK_ID:this.IBLOCK_ID,TITLE:this.TITLE,RECEIVER:this.OBJNAME},PROP:this.GetPropInfo(t),sessid:BX.bitrix_sessid()};new BX.CAdminDialog({title:this.TITLE,content_url:"/bitrix/admin/iblock_edit_property.php?lang="+this.LANG+"&propedit="+t+"&bxpublic=Y&receiver="+this.OBJNAME,content_post:i,draggable:true,resizable:true,buttons:[BX.CAdminDialog.btnSave,BX.CAdminDialog.btnCancel]}).Show()}};JCIBlockProperty.prototype.SetCells=function(e,t,i){var r=0;if(0>this.intERROR){return}if(e){this.CELLS=BX.clone(e,true)}for(r=0;rthis.intERROR){return}var e=0,t=parseInt(this.PROP_COUNT.value,10),i="",r=null,n=null,s="",o=null;r=this.PROP_TBL.insertRow(this.PROP_TBL.rows.length);r.id=this.PREFIX_TR+"n"+t;for(e=0;e0){for(e=0,t=i.length;e';s.cells[1].align="left";s.cells[1].innerHTML=this.sSelect+" "+'';var o=BX.findChildren(t,{class:this.variable_name+"_row_for_"+r},true);if(o)for(var a=0;a0){BX.ajax.loadJSON("/bitrix/admin/iblock_edit.php"+"?ajax=y"+"&sessid="+BX.bitrix_sessid()+"&entity_type="+this.entity_type+"&iblock_id="+this.iblock_id+"&id="+this.id,{added:e},(function(e){if(e){for(var t in e){var i=parseInt(e[t][0]);var r=parseInt(e[t][1]);var n="";if(i>0&&r>0)n=BX.message("langApply1Title");else if(i>0)n=BX.message("langApply2Title");else if(r>0)n=BX.message("langApply3Title");if(n)BX("overwrite_"+t).innerHTML='
'+n+" ("+(i+r)+")"}}}))}BX.onCustomEvent("onAdminTabsChange")};JCIBlockAccess.prototype.ShowInfo=function(){var e=this.entity_type;var t=this.iblock_id;var i=this.id;var r=new BX.CWindowButton({title:"Query",action:function(){var r=BX("prompt_user_id");BX("info_result").innerHTML="";BX.showWait();BX.ajax.loadJSON("/bitrix/admin/iblock_edit.php"+"?ajax=y"+"&sessid="+BX.bitrix_sessid()+"&entity_type="+e+"&iblock_id="+t+"&id="+i,{info:r.value},(function(e){if(e){for(var t in e){BX("info_result").innerHTML+=''+t+""}}BX.closeWait()}))}});if(null==this.iblock_info_obDialog){this.iblock_info_obDialog=new BX.CDialog({content:'
User ID:
',buttons:[r,BX.CDialog.btnCancel],width:420,height:200})}this.iblock_info_obDialog.Show();var n=BX("prompt_user_id");n.focus();n.select()};JCIBlockAccess.DeleteRow=function(e,t,i){var r=BX.findParent(e,{tag:"tr"});var n=BX.findParent(r,{tag:"table"});var s=BX.findChildren(n,{class:i+"_row_for_"+t+" iblock-strike-out"},true);if(s)for(var o=0;o[^\0]*?<"+"/"+"script"+">","ig");var c=n.match(u);if(c){for(var f=0;f0){for(var t=0,i=e.length;ti.clientHeight){var r=i.offsetHeight-i.clientHeight;var n=i.scrollHeight+r;i.style.height=n+"px"}var s=BX("ck_"+ipropTemplates[t].INPUT_ID);if(s){if(s.checked){i.readOnly=false;BX("mnu_"+ipropTemplates[t].INPUT_ID).disabled=false}else{i.readOnly=true;BX("mnu_"+ipropTemplates[t].INPUT_ID).disabled=true}}}}if(e)setTimeout((function(){InheritedPropertiesTemplates.updateInheritedPropertiesValues(true)}),100)};JCInheritedPropertiesTemplates.prototype.updateInheritedPropertiesValues=function(startup,force){var i,space,input,values,f,k,obj_ta,clearValues;if(startup){for(i=0;i0){if(e.value.length>1){e.value=e.value.charAt(0)}if(e.value.charCodeAt(0)>127){e.value=""}}};function JCPopupEditor(e,t){this.width=e;this.height=t;this.popup_editor_dialog=null;this.input=null}JCPopupEditor.prototype.openEditor=function(e,t){if(!this.popup_editor_dialog){this.popup_editor_dialog=new BX.CDialog({content:'',buttons:this.getButtons(),width:this.width,height:this.height});var i=BX("popup_editor_container");var r=BX("popup_editor_start");i.parentNode.appendChild(r);i.parentNode.removeChild(i);r.style.display="";LoadLHE_popup_editor_id()}this.popup_editor_dialog.Show();this.input=BX(e);popup_editor.SetEditorContent(this.input.value);popup_editor.SetFocus();this.startCharCounter()};JCPopupEditor.prototype.getButtons=function(){var e=this;var t=new BX.CWindowButton({title:BX.message("JS_CORE_WINDOW_SAVE"),id:"savebtn",name:"savebtn",className:BX.browser.IsIE()&&BX.browser.IsDoctype()&&!BX.browser.IsIE10()?"":"adm-btn-save",action:function(){e.stopCharCounter();this.parentWindow.Hide();popup_editor.SetView("html");e.input.value=popup_editor.GetEditorContent();e.input.onchange()}});var i=new BX.CWindowButton({title:BX.message("JS_CORE_WINDOW_CLOSE"),id:"closebtn",name:"closebtn",action:function(){e.stopCharCounter();this.parentWindow.Hide()}});return[t,i]};JCPopupEditor.prototype.startCharCounter=function(){if(!this.charCounterContainer){this.charCounterContainer=BX.create("SPAN");this.charCounterContainer.style.display="inline";this.popup_editor_dialog.PARTS.BUTTONS_CONTAINER.appendChild(this.charCounterContainer)}if(!this.charCounterTimer){this.charCounterTimer=setInterval(BX.delegate((function(){this.updateCharCounter()}),this),500)}};JCPopupEditor.prototype.updateCharCounter=function(){var e=popup_editor.GetEditorContent().length;this.charCounterContainer.innerHTML=e;if(e>255&&!this.charCounterContainer.style.color)this.charCounterContainer.style.color="red";if(e<=255&&this.charCounterContainer.style.color)this.charCounterContainer.style.color=""};JCPopupEditor.prototype.stopCharCounter=function(){if(this.charCounterTimer)clearInterval(this.charCounterTimer);this.charCounterTimer=null}; //# sourceMappingURL=iblock_edit.map.js