PageSourceSearch

https://redcross.ru/bitrix/components/aspro/eyed.allcorp3/templates/.default/script.min.js

js redcross.ru collected 2026-09-24 19:01:21 UTC 12,357 bytes, 2 lines download raw bytes

1void 0===window.JEyed&&(window.JEyed=function(result){var _private={inited:!1,speakTimer:!1,options:"object"==typeof result&&"object"==typeof result.OPTIONS?result.OPTIONS:{}};Object.defineProperties(this,{inited:{get:function(){return _private.inited},set:function(value){value&&(_private.inited=!0)}},speakTimer:{get:function(){return _private.speakTimer},set:function(value){_private.speakTimer=value}}}),this.result=function(key){if("object"==typeof result&&void 0!==key&&Object.keys(result).indexOf(key)>-1)return result[key]},this.options=function(key,value){var that=this;if(void 0!==key&&Object.keys(_private.options).indexOf(key)>-1){if(void 0===value)return _private.options[key];if(this.node){var item=this.node.querySelector(".eyed-panel__item[data-option="+key+"]");if(item){var itemValues=Array.prototype.slice.call(item.querySelectorAll(".eyed-panel__item-value"));if(itemValues)for(var i in itemValues)BX.removeClass(itemValues[i],"active");var itemValue=item.querySelector('.eyed-panel__item-value[data-option_value="'+value+'"]');itemValue&&(_private.options[key]=value,"SPEAKER"===key?0==value&&this.stopSpeak():"FONT-SIZE"===key?this.dispatchWindowResize():"IMAGES"===key&&this.dispatchWindowResize(),BX.addClass(itemValue,"active"))}}}},this.getClasses=function(){var classes=[];for(var key in _private.options)if(Object.hasOwnProperty.call(_private.options,key)){var value=_private.options[key];0==value?value="off":1==value&&(value="on"),classes.push("eyed--"+key.toLowerCase()+"--"+value.toLowerCase())}return classes.push("eyed"),classes},this.save=function(){BX.setCookie(this.result("COOKIE").OPTIONS,JSON.stringify(_private.options),{path:arAsproOptions.SITE_DIR,expires:30672e3}),this.updateBodyClasses()};var that=this;this.init()},window.JEyed.prototype={node:null,textNode:null,textRate:1.1,handlers:{},init:function(){var that=this;this.inited||(this.inited=!0,this.node=BX("eyed-panel"),this.node.eyed=this,this.textNode=BX.create({tag:"div",props:{class:"eyed-panel__speech"},style:{display:"none"},events:{},children:{},text:"",html:""}),this.bindEvents(),this.speak(document.title))},bindEvents:function(){var that=this;if(that.node){var item,item;if("function"!=typeof that.onToggleClick&&(that.onToggleClick=function(e){e||(e=window.event);var target=e.target||e.srcElement;if(void 0!==target&&target){for(var toggle=null,parent=target;parent;){if(void 0!==parent.matches&&parent.matches(".eyed-toggle")){toggle=parent;break}parent=parent.parentElement||parent.parentNode}toggle&&(that.isActive()?that.disable():that.activate())}}),document.addEventListener("click",that.onToggleClick),that.getSynth())that.getSynth().onerror=function(e){that.stopSpeak()};else if(that.options("SPEAKER"))that.options("SPEAKER",0),that.save(),(item=that.node.querySelector('.eyed-panel__item[data-option="SPEAKER"]'))&&BX.remove(item);if(-1!==navigator.userAgent.indexOf("MSIE"))if(that.options("COLOR-SCHEME","black"),that.save(),item=that.node.querySelector('.eyed-panel__item[data-option="COLOR-SCHEME"]')){var itemValues=Array.prototype.slice.call(item.querySelectorAll('.eyed-panel__item-value:not([data-option_value="black"])'));if(itemValues)for(var i in itemValues)BX.remove(itemValues[i])}that.bindEyedEvents()}},unbindEvents:function(){"function"==typeof this.onToggleClick&&document.removeEventListener("click",this.onToggleClick),this.unbindEyedEvents()},bindEyedEvents:function(){var that=this;that.node&&("function"!=typeof that.onDocClick&&(that.onDocClick=function(e){if(that.isActive()){e||(e=window.event);var target=e.target||e.srcElement;if(void 0!==target&&target){for(var panel=null,parent=target;parent;){if(void 0!==parent.matches&&parent.matches("#eyed-panel")){panel=parent;break}parent=parent.parentElement||parent.parentNode}if(panel){for(var itemValue=null,parent=target;parent;){if(void 0!==parent.matches&&parent.matches(".eyed-panel__item-value")){itemValue=parent;break}parent=parent.parentElement||parent.parentNode}if(itemValue&&(BX.PreventDefault(e),!BX.hasClass(itemValue,"active"))){var item=itemValue.closest(".eyed-panel__item");if(item){var key=BX.data(item,"option"),value=BX.data(itemValue,"option_value").toString();key.length&&value.length&&(that.options(key,value),that.save())}}}}}}),document.addEventListener("click",that.onDocClick),that.getSynth()&&("function"!=typeof that.onDocMouseDown&&(that.onDocMouseDown=function(e){if(that.isActive()){e||(e=window.event);var target=e.target||e.srcElement;if(void 0!==target&&target){for(var panel=null,parent=target;parent;){if(void 0!==parent.matches&&parent.matches("#eyed-panel")){panel=parent;break}parent=parent.parentElement||parent.parentNode}panel||that.isActive()&&0!=that.options("SPEAKER")&&that.stopSpeak()}}}),document.addEventListener("mousedown",that.onDocMouseDown),"function"!=typeof that.onDocMouseUp&&(that.onDocMouseUp=function(e){if(that.isActive()){e||(e=window.event);var target=e.target||e.srcElement;if(void 0!==target&&target){for(var panel=null,parent=target;parent;){if(void 0!==parent.matches&&parent.matches("#eyed-panel")){panel=parent;break}parent=parent.parentElement||parent.parentNode}panel||setTimeout((function(){var text=that.getSelection();void 0!==text&&text.length?that.speak(text):that.stopSpeak()}),100)}}}),document.addEventListener("mouseup",that.onDocMouseUp),"function"!=typeof that.onDocMouseOver&&(that.onDocMouseOver=function(e){if(that.isActive()){e||(e=window.event);var target=e.target||e.srcElement;if(void 0!==target&&target){var link=target.closest("a")||target.closest(".btn")||target.closest(".switcher-title")||target.closest("[data-eyed_speak]")||target.closest("[title]")||target.closest('[data-event="jqm"]');
1if(link){var overTimer=setInterval((function(){if(!that.speakTimer){overTimer&&(clearInterval(overTimer),overTimer=!1);var text=that.getNodeText(link);void 0!==text&&text.length&&that.speak(text)}}),100),onLinkMouseOut=function(){overTimer&&(clearInterval(overTimer),overTimer=!1),link.removeEventListener("mouseout",onLinkMouseOut)};link.addEventListener("mouseout",onLinkMouseOut)}}}}),document.addEventListener("mouseover",that.onDocMouseOver)))},unbindEyedEvents:function(){"function"==typeof this.onDocClick&&document.removeEventListener("click",this.onDocClick),"function"==typeof this.onDocMouseDown&&document.removeEventListener("mousedown",this.onDocMouseDown),"function"==typeof this.onDocMouseUp&&document.removeEventListener("mouseup",this.onDocMouseUp),"function"==typeof this.onDocMouseOver&&document.removeEventListener("mouseover",this.onDocMouseOver)},isActive:function(){return"Y"===BX.getCookie(this.result("COOKIE").ACTIVE)},activate:function(){var that=this;BX.setCookie(this.result("COOKIE").ACTIVE,"Y",{path:arAsproOptions.SITE_DIR,expires:30672e3}),this.updateBodyClasses(),this.bindEyedEvents();var toggles=Array.prototype.slice.call(document.querySelectorAll(".eyed-toggle"));if(toggles)for(var i in toggles){var title;if(toggles[i].setAttribute("title",BX.message("EA_T_NORMAL_VERSION")),BX.hasClass(toggles[i],"footer__eyed"))(title=BX.findChild(toggles[i],{tag:"span",class:"footer-eyed__name"},!0))&&(title.innerText=BX.message("EA_T_NORMAL_VERSION"));else if(BX.hasClass(toggles[i],"header-eyed")){var title;(title=BX.findChild(toggles[i],{tag:"span",class:"header-eyed__name"},!0))&&(title.innerText=BX.message("EA_T_NORMAL_VERSION"))}}},disable:function(){var that=this;BX.setCookie(this.result("COOKIE").ACTIVE,"",{path:arAsproOptions.SITE_DIR,expires:30672e3}),this.updateBodyClasses(),this.unbindEyedEvents();var toggles=Array.prototype.slice.call(document.querySelectorAll(".eyed-toggle"));if(toggles)for(var i in toggles){var title;if(toggles[i].setAttribute("title",BX.message("EA_T_EYED_VERSION")),BX.hasClass(toggles[i],"footer__eyed"))(title=BX.findChild(toggles[i],{tag:"span",class:"footer-eyed__name"},!0))&&(title.innerText=BX.message("EA_T_EYED_VERSION"));else if(BX.hasClass(toggles[i],"header-eyed")){var title;(title=BX.findChild(toggles[i],{tag:"span",class:"header-eyed__name"},!0))&&(title.innerText=BX.message("EA_T_EYED_VERSION"))}}},dispatchWindowResize:function(){if("function"==typeof Event||-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0){var resizeEvent=window.document.createEvent("UIEvents");resizeEvent.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(resizeEvent)}else{var event=new Event("resize");window.dispatchEvent(event)}},updateBodyClasses:function(){var that=this,classes=this.getClasses();if(classes){var attrClass=document.body.getAttribute("class");if(attrClass=(attrClass=attrClass.replace(/eyed[^\s]*/gi,"")).replace(/\s{2,}/gi," "),this.isActive())for(var key in classes)Object.hasOwnProperty.call(classes,key)&&(attrClass+=" "+classes[key]);document.body.setAttribute("class",attrClass)}},refresh:function(){var componentAction="getEyed",componentName="aspro:eyed.allcorp3",sessid=BX.message("bitrix_sessid"),lang=BX.message("LANGUAGE_ID"),siteId=arAsproOptions.SITE_ID,signedParams=this.result("SIGNED_PARAMS"),that=this;BX.ajax({url:"/bitrix/services/main/ajax.php?mode=ajax&c="+encodeURIComponent(componentName)+"&action=getEyed&sessid="+sessid+"&SITE_ID="+siteId+"&siteId="+siteId+"&lang="+lang+"&signedParameters="+encodeURIComponent(signedParams)+"&clear_cache_session=Y",method:"POST",async:!0,processData:!0,scriptsRunFirst:!0,emulateOnload:!0,start:!0,cache:!1,onsuccess:function(response){response.trim().length&&that.node&&(that.unbindEvents(),that.node.parentElement.insertAdjacentHTML("afterBegin",response),that.node.remove(),that.node=BX("eyed-panel"),that.node.eyed=that,that.bindEvents())},onfailure:function(){}})},checkState:function(){var toggles=Array.prototype.slice.call(document.querySelectorAll(".eyed-toggle")),togglesInPanel=Array.prototype.slice.call(document.querySelectorAll(".eyed-panel .eyed-toggle"));toggles.length>
1togglesInPanel.length?this.enable():this.destroy()},isEnabled:function(){return!(!this.node||!this.node.querySelector(".eyed-panel__inner"))},destroy:function(){this.isEnabled()&&(this.disable(),this.unbindEvents(),this.node&&(this.node.innerHTML=""))},enable:function(){this.isEnabled()||(this.refresh(),this.bindEvents())},getSelection:function(){var text=window.getSelection&&window.getSelection().toString()||document.selection&&document.selection.createRange().text;return void 0!==text&&this.clearText(text)},getNodeText:function(node){var text="";if(node){if(node.closest(".header-cart[title]"))var text=this.clearText(node.closest(".header-cart").getAttribute("title").toString().trim());else if(!BX.hasClass(node,"developer")&&!BX.hasClass(node,"HEADER"))var text=this.clearText(node.innerText.toString().trim());if((void 0===text||!text.length)&&BX.data(node,"eyed-speak"))var text=this.clearText(BX.data(node,"eyed_speak").toString().trim());if((void 0===text||!text.length)&&node.getAttribute("title"))var text=this.clearText(node.getAttribute("title").toString().trim());if((void 0===text||!text.length)&&"A"===node.tagName){var item=node.closest(".grid-list__item")||node.closest(".owl-item");if(item)var title,text=item.querySelector(".switcher-title").innerText.toString().trim()}}return text},clearText:function(text){this.textNode.innerHTML=text,text=this.textNode.innerText.replace(" *","");var regex=BX.message("__EA_T_TEXT_REGEX");if(regex.length){if(regex=new RegExp(regex,"i"),text.match(regex))return text;text=""}return text},getTextLang:function(text){return"ru-RU"},getSynth:function(){return window.speechSynthesis||window.mozspeechSynthesis||window.webkitspeechSynthesis},speak:function(text){var that=this;if(that.textNode&&that.isActive()&&0!=that.options("SPEAKER")&&that.getSynth()&&(that.stopSpeak(),void 0!==text&&text.length)){text=that.clearText(text);try{var message=new SpeechSynthesisUtterance(text);message.lang=that.getTextLang(text),message.rate=that.textRate,message.onerror=function(e){throw e},message.onend=function(e){that.speakTimer&&(clearInterval(that.speakTimer),that.speakTimer=!1)},that.getSynth().speak(message),that.speakTimer=setInterval((function(){that.getSynth().paused&&that.getSynth().resume()}),100)}catch(e){console.error(e),that.stopSpeak()}}},stopSpeak:function(){var that=this;this.speakTimer&&(clearInterval(this.speakTimer),this.speakTimer=!1),this.get
1Synth()&&this.getSynth().cancel()}});
2//# sourceMappingURL=script.min.js.map

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.