File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/components/ammina/regions.selector/templates/template1/script.min.js
Back
(function(e){var a={init:function(o,i){a.self=this;a.arResultInfo=o;a.arParamsInfo=i;e("body").prepend(e(".bam-regions-confirm"));e("body").append(e(".bam-regions-popup"));e("body").append(e(".bam-regions-popupbg"));a.divMain=e(this);a.divConfirm=e(".bam-regions-confirm");a.divPopup=e(".bam-regions-popup");a.divPopupBg=e(".bam-regions-popupbg");if(a.arParamsInfo["CHANGE_CITY_MANUAL"]!="Y"){return}if(a.arParamsInfo["CITY_VERIFYCATION"]=="Y"&&a.arResultInfo["CONFIRM_REQUEST_SHOW"]){a._showConfirmCityWindow();e(a.divConfirm).on("click",".bam-regions-confirm-button-yes",function(){a._clickConfirmButtonYes(this);return false});e(a.divConfirm).on("click",".bam-regions-confirm-button-no",function(){a._clickConfirmButtonNo(this);return false})}e(a.divMain).on("click",".bam-regions-link",function(){a._clickShowPopupForm(this);return false});e(a.divPopup).on("change",".bam-regions-popup-content-search",function(){a._changeSearchCity(this);return false});e(a.divPopup).on("keyup",".bam-regions-popup-content-search",function(){a._changeSearchCity(this);return false});e(a.divPopup).on("click",".bam-regions-popup-content-item-link",function(){a._selectCityFromPopup(this);return false});e(a.divPopup).on("click",".bam-regions-popup-close",function(){a._clickHidePopupForm(this);return false});e(window).resize(function(){a._doResizeContent()});return this},destroy:function(){return this},_showConfirmCityWindow:function(){a.divConfirm.fadeIn()},_clickConfirmButtonYes:function(o){var i={};i["PREVENT_CITY"]=a.arParamsInfo["PREVENT_CITY"];i["sid"]=a.arParamsInfo["SITE_ID"];i["AJAX"]="Y";i["action"]="setPreventCity";e.ajax(a.urlAjax,{cache:false,context:e(o),data:i,dataType:"json",method:"POST",type:"POST",success:function(o){if(o.STATUS=="SUCCESS"){a.divConfirm.fadeOut(400,function(){a.divConfirm.remove();a.divConfirm=null});if(o.LOCATION!=undefined&&o.LOCATION.length>0){window.location=o.LOCATION}}}})},_clickConfirmButtonNo:function(o){a.divConfirm.hide(1,function(){a.divConfirm.remove();a.divConfirm=null});a._clickShowPopupForm(o)},_clickShowPopupForm:function(o){if(a.divConfirm){a.divConfirm.hide(1,function(){a.divConfirm.remove();a.divConfirm=null})}a.doShowPopupForm()},_clickHidePopupForm:function(o){a.divPopup.hide();a.divPopupBg.hide()},doShowPopupForm:function(){if(this.arParamsInfo["USE_GPS"]=="Y"&&navigator.geolocation&&a.gpsPosition==false){a.gpsWait=true;a.divPopupBg.fadeIn(400);navigator.geolocation.getCurrentPosition(a.navigatorPosition,a.navigatorError);var o=setInterval(function(){if(!a.gpsWait){clearInterval(o);a._doShowPopupForm()}},20)}else{a._doShowPopupForm()}},_doShowPopupForm:function(){a.divPopup.html("");a.divPopup.append(e(a.popupTemplate));var o=a.arParamsInfo;o["GPS"]=a.gpsPosition;o["AJAX"]="Y";o["action"]="getCityForm";e.ajax(a.urlAjax,{cache:false,context:a.divPopup,data:o,dataType:"json",method:"POST",type:"POST",success:function(o){if(o.RESULT["IS_OK"]){a.divPopup.find(".bam-regions-popup-title h3").html(o.RESULT["TITLE"]);a.divPopup.find(".bam-regions-popup-content-search").attr("placeholder",o.RESULT["INPUT_PLACEHOLDER"]);a._doShowListCity(o.RESULT["ITEMS"])}}});a.divPopupBg.fadeIn(400);a.divPopup.fadeIn(400,function(){a._doResizeContent()})},_changeSearchCity:function(o){var i=a.arParamsInfo;i["GPS"]=a.gpsPosition;i["AJAX"]="Y";i["action"]="getCityForm";i["qcity"]=e(o).val();e.ajax(a.urlAjax,{cache:true,context:a.divPopup,data:i,dataType:"json",method:"POST",type:"POST",success:function(o){if(o.RESULT["IS_OK"]){a._doShowListCity(o.RESULT["ITEMS"])}}})},navigatorPosition:function(o){a.gpsPosition=o;a.gpsWait=false},navigatorError:function(){a.gpsPosition=false;a.gpsWait=false},_doShowListCity:function(o){var n=a.divPopup.find(".bam-regions-popup-content-list");var t="";n.html("");e.each(o,function(o,i){if(i["IS_CURRENT"]=="Y"){t=a.popupListContentItemCurrentTemplate}else{t=a.popupListContentItemTemplate}if(i.DOMAIN_NAME!=undefined){t=t.replace("#CITY_NAME#",i.DOMAIN_NAME);t=t.replace("#CITY_ID#",i.CITY_ID);t=t.replace("#CITY_TITLE#",i.FULL_NAME)}else{t=t.replace("#CITY_NAME#",i.CITY_NAME+" <span>("+i.FULL_NAME_NO_CITY+")</span>");t=t.replace("#CITY_ID#",i.CITY_ID);t=t.replace("#CITY_TITLE#",i.FULL_NAME_NO_CITY)}n.append(e(t))})},_selectCityFromPopup:function(i){var o={};o["PREVENT_CITY"]=e(i).data("id");o["sid"]=a.arParamsInfo["SITE_ID"];o["AJAX"]="Y";o["action"]="setPreventCity";e.ajax(a.urlAjax,{cache:false,context:e(i),data:o,dataType:"json",method:"POST",type:"POST",success:function(o){if(o.STATUS=="SUCCESS"){a._clickHidePopupForm(i);if(o.LOCATION!=undefined&&o.LOCATION.length>0){window.location=o.LOCATION}else{window.location.reload()}}}})},_doResizeContent:function(){if(a.divPopup.find(".bam-regions-popup-content-list").length>0){a.divPopup.find(".bam-regions-popup-content-list").height(a.divPopup.find(".bam-regions-popup-window").height()-100)}},arResultInfo:{},arParamsInfo:{},self:null,divConfirm:null,divPopup:null,divPopupBg:null,urlAjax:"/bitrix/components/ammina/regions.selector/ajax.php",popupTemplate:'<div class="bam-regions-popup-window"><div class="bam-regions-popup-title"><h3></h3><a href="javascript:void(0)" class="bam-regions-popup-close"></a></div><div class="bam-regions-popup-content"><input type="text" value="" class="bam-regions-popup-content-search" placeholder=""/><div class="bam-regions-popup-content-list"></div></div></div>',popupListContentItemTemplate:'<div class="bam-regions-popup-content-item"><a href="javascript:void(0)" class="bam-regions-popup-content-item-link" data-id="#CITY_ID#" title="#CITY_TITLE#">#CITY_NAME#</a></div>',popupListContentItemCurrentTemplate:'<div class="bam-regions-popup-content-item"><a href="javascript:void(0)" class="bam-regions-popup-content-item-link bam-regions-popup-content-item-link-current" data-id="#CITY_ID#" title="#CITY_TITLE#">#CITY_NAME#</a></div>',gpsWait:false,gpsPosition:false};e.fn.amminaRegions=function(o){if(a[o]){return a[o].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof o==="object"||!o){return a.init.apply(this,arguments)}else{e.error("Not exists method "+o)}}})(jQuery);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings