1 function fallbackCopyTextToClipboard(text) { 2 var textArea = document.createElement("textarea"); 3 textArea.value = text; 4 5 // Avoid scrolling to bottom 6 textArea.style.top = "0"; 7 textArea.style.left = "0"; 8 textArea.style.position = "fixed"; 9 10 document.body.appendChild(textArea); 11 textArea.focus(); 12 textArea.select(); 13 var ret = false; 14 try { 15 var successful = document.execCommand('copy'); 16 var msg = successful ? 'successful' : 'unsuccessful'; 17 console.log('Fallback: Copying text command was ' + msg); 18 ret = true; 19 } catch (err) { 20 console.error('Fallback: Oops, unable to copy', err); 21 } 22 23 document.body.removeChild(textArea); 24 return ret; 25 } 26 function copyTextToClipboard(text) { 27 if (!navigator.clipboard) { 28 return fallbackCopyTextToClipboard(text); 29 } 30 navigator.clipboard.writeText(text).then(function() { 31 console.log('Async: Copying to clipboard was successful!'); 32 return true; 33 }, function(err) { 34 console.error('Async: Could not copy text: ', err); 35 }); 36 return fallbackCopyTextToClipboard(text); 37 } 38 39 $( function(){ 40 41 if ($(window).width() > 640) { 42 /* 43 * HC-Sticky 44 * ========= 45 * Version: 2.2.7 46 * Author: Some Web Media 47 * Author URL: https://github.com/somewebmedia 48 * Plugin URL: https://github.com/somewebmedia/hc-sticky 49 * Description: JavaScript library that makes any element on your page visible while you scroll 50 * License: MIT 51 */ 52 "use strict";!function(t,e){if("object"==typeof module&&"object"==typeof module.exports){if(!t.document)throw new Error("HC-Sticky requires a browser to run.");module.exports=e(t)}else"function"==typeof define&&define.amd?define("hcSticky",[],e(t)):e(t)}("undefined"!=typeof window?window:this,function(V){var i,n,Q=V.document,U={top:0,bottom:0,bottomEnd:0,innerTop:0,innerSticker:null,stickyClass:"sticky",stickTo:null,followScroll:!0,responsive:null,mobileFirst:!1,onStart:null,onStop:null,onBeforeResize:null,onResize:null,resizeDebounce:100,disable:!1},Y=function(t,e,o){console.warn("%cHC Sticky:%c "+o+"%c '"+t+"'%c is now deprecated and will be removed. Use%c '"+e+"'%c instead.","color: #fa253b","color: default","color: #5595c6","color: default","color: #5595c6","color: default")},$=function(n,f){var o=this;if(f=f||{},!(n="string"==typeof n?Q.querySelector(n):n))return!1;f.queries&&Y("queries","responsive","option"),f.queryFlow&&Y("queryFlow","mobileFirst","option");var p={},u=$.Helpers,s=n.parentNode;"static"===u.getStyle(s,"position")&&(s.style.position="relative");function d(t){u.isEmptyObject(t=t||{})&&!u.isEmptyObject(p)||(p=Object.assign({},U,p,t))}function t(){return p.disable}function e(){var t,e=p.responsive||p.queries;if(e){var o=V.innerWidth;if(t=f,(p=Object.assign({},U,t||{})).mobileFirst)for(var i in e)i<=o&&!u.isEmptyObject(e[i])&&d(e[i]);else{var n,s=[];for(n in e){var r={};r[n]=e[n],s.push(r)}for(var l=s.length-1;0<=l;l--){var a=s[l],c=Object.keys(a)[0];o<=c&&!u.isEmptyObject(a[c])&&d(a[c])}}}}function i(){var t,e,o,i;I.css=(t=n,e=u.getCascadedStyle(t),o=u.getStyle(t),i={height:t.offsetHeight+"px",left:e.left,right:e.right,top:e.top,bottom:e.bottom,position:o.position,display:o.display,verticalAlign:o.verticalAlign,boxSizing:o.boxSizing,marginLeft:e.marginLeft,marginRight:e.marginRight,marginTop:e.marginTop,marginBottom:e.marginBottom,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight},e.float&&(i.float=e.float||"none"),e.cssFloat&&(i.cssFloat=e.cssFloat||"none"),o.MozBoxSizing&&(i.MozBoxSizing=o.MozBoxSizing),i.width="auto"!==e.width?e.width:"border-box"===i.boxSizing||"border-box"===i.MozBoxSizing?t.offsetWidth+"px":o.width,i),P.init(),y=!(!p.stickTo||!("document"===p.stickTo||p.stickTo.nodeType&&9===p.stickTo.nodeType||"object"==typeof p.stickTo&&p.stickTo instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document))),h=p.stickTo?y?Q:u.getElement(p.stickTo):s,z=(R=function(){var t=n.offsetHeight+(parseInt(I.css.marginTop)||0)+(parseInt(I.css.marginBottom)||0),e=(z||0)-t;return-1<=e&&e<=1?z:t})(),v=(H=function(){return y?Math.max(Q.documentElement.clientHeight,Q.body.scrollHeight,Q.documentElement.scrollHeight,Q.body.offsetHeight,Q.documentElement.offsetHeight):h.offsetHeight})(),S=y?0:u.offset(h).top,w=p.stickTo?y?0:u.offset(s).top:S,E=V.innerHeight,N=n.offsetTop-(parseInt(I.css.marginTop)||0),b=u.getElement(p.innerSticker),L=isNaN(p.top)&&-1<p.top.indexOf("%")?parseFloat(p.top)/100*E:p.top,k=isNaN(p.bottom)&&-1<p.bottom.indexOf("%")?parseFloat(p.bottom)/100*E:p.bottom,x=b?b.offsetTop:p.innerTop||0,T=isNaN(p.bottomEnd)&&-1<p.bottomEnd.indexOf("%")?parseFloat(p.bottomEnd)/100*E:p.bottomEnd,j=S-L+x+N}function r(){z=R(),v=H(),O=S+v-L-T,C=E<z;var t,e=V.pageYOffset||Q.documentElement.scrollTop,o=u.offset(n).top,i=o-e;B=e<F?"up":"down",A=e-F,j<(F=e)?O+L+(C?k:0)-(p.followScroll&&C?0:L)<=e+z-x-(E-(j-x)<z-x&&p.followScroll&&0<(t=z-E-x)?t:0)?I.release({position:"absolute",bottom:w+s.offsetHeight-O-L}):C&&p.followScroll?"down"==B?i+z+k<=E+.9?I.stick({bottom:k}):"fixed"===I.position&&I.release({position:"absolute",top:o-L-j-A+x}):Math.ceil(i+x)<0&&"fixed"===I.position?I.release({position:"absolute",top:o-L-j+x-A}):e+L-x<=o&&I.stick({top:L-x}):I.stick({top:L-x}):I.release({stop:!0})}function l(){M&&(V.removeEventListener("scroll",r,u.supportsPassive),M=!1)}function a(){null!==n.offsetParent&&"none"!==u.getStyle(n,"display")?(i(),v<z?l():(r(),M||(V.addEventListener("scroll",r,u.supportsPassive),M=!0))):l()}function c(){n.style.position="",n.style.left="",n.style.top="",n.style.bottom="",n.style.width="",n.classList?n.classList.remove(p.stickyClass):n.className=n.className.replace(new RegExp("(^|\\b)"+p.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),I.css={},!(I.position=null)===P.isAttached&&P.detach()}function g(){c(),e(),(t()?l:a)()}function m(){q&&(V.removeEventListener("resize",W,u.supportsPassive),q=!1),l()}var y,h,b,v,S,w,E,L,k,x,T,j,O,C,z,N,H,R,A,B,I={css:{},position:null,stick:function(t){t=t||{},u.hasClass(n,p.stickyClass)||(!1===P.isAttached&&P.attach(),I.position="fixed",n.style.position="fixed",n.style.left=P.offsetLeft+"px",n.style.width=P.width,void 0===t.bottom?n.style.bottom="auto":n.style.bottom=t.bottom+"px",void 0===t.top?n.style.top="auto":n.style.top=t.top+"px",n.classList?n.classList.add(p.stickyClass):n.className+=" "+p.stickyClass,p.onStart&&p.onStart.call(n,Object.assign({},p)))},release:function(t){var e;(t=t||{}).stop=t.stop||!1,!0!==t.stop&&"fixed"!==I.position&&null!==I.position&&(void 0===t.top&&void 0===t.bottom||void 0!==t.top&&(parseInt(u.getStyle(n,"top"))||0)===t.top||void 0!==t.bottom&&(parseInt(u.getStyle(n,"bottom"))||0)===t.bottom)||(!0===t.stop?!0===P.isAttached&&P.detach():!1===P.isAttached&&P.attach(),e=t.position||I.css.position,I.position=e,n.style.position=e,n.style.left=!0===t.stop?I.css.left:P.positionLeft+"px",n.style.width=("absolute"!==e?I.css:P).width,void 0===t.bottom?n.style.bottom=!0===t.stop?"":"auto":n.style.bottom=t.bottom+"px",void 0===t.top?n.style.top=!0===t.stop?"":"auto":n.style.top=t.top+"px",n.classList?n.classList.remove(p.stickyClass):n.className=n.className.replace(new RegExp("(^|\\b)"+p.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),p.onStop&&p.onStop.call(n,Object.assign({},p)))}},P={el:Q.createElement("div"),offsetLeft:null,positionLeft:null,width:null,isAttached:!1,init:function(){for(var t in P.el.className="sticky-spacer",I.css)P.el.style[t]=I.css[t];P.el.style["z-index"]="-1";var e=u.getStyle(n);P.offsetLeft=u.offset(n).left-(parseInt(e.marginLeft)||0),P.positionLeft=u.position(n).left,P.width=u.getStyle(n,"width")},attach:function(){s.insertBefore(P.el,n),P.isAttached=!0},detach:function(){P.el=s.removeChild(P.el),P.isAttached=!1}},F=V.pageYOffset||Q.documentElement.scrollTop,M=!1,q=!1,D=function(){p.onBeforeResize&&p.onBeforeResize.call(n,Object.assign({},p)),g(),p.onResize&&p.onResize.call(n,Object.assign({},p))},W=p.resizeDebounce?u.debounce(D,p.resizeDebounce):D,D=function(){q||(V.addEventListener("resize",W,u.supportsPassive),q=!0),e(),(t()?l:a)()};this.options=function(t){return t?p[t]:Object.assign({},p)},this.refresh=g,this.update=function(t){d(t),f=Object.assign({},f,t||{}),g()},this.attach=D,this.detach=m,this.destroy=function(){m(),c()},this.triggerMethod=function(t,e){"function"==typeof o[t]&&o[t](e)},this.reinit=function(){Y("reinit","refresh","method"),g()},d(f),D(),V.addEventListener("load",g)};return void 0!==V.jQuery&&(i=V.jQuery,n="hcSticky",i.fn.extend({hcSticky:function(e,o){return this.length?"options"===e?i.data(this.get(0),n).options():this.each(function(){var t=i.data(this,n);t?t.triggerMethod(e,o):(t=new $(this,e),i.data(this,n,t))}):this}})),V.hcSticky=V.hcSticky||$,$}),function(a){var t=a.hcSticky,c=a.document;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o[s]=n[s])}return o},writable:!0,configurable:!0}),Array.prototype.forEach||(Array.prototype.forEach=function(t){var e,o;if(null==this)throw new TypeError("this is null or not defined");var i,n=Object(this),s=n.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(1<arguments.length&&(e=arguments[1]),o=0;o<s;)o in n&&(i=n[o],t.call(e,i,o,n)),o++});var e=!1;try{var o=Object.defineProperty({},"passive",{get:function(){e={passive:!1}}});a.addEventListener("testPassive",null,o),a.removeEventListener("testPassive",null,o)}catch(t){}function n(t,e){return a.getComputedStyle?e?c.defaultView.getComputedStyle(t,null).getPropertyValue(e):c.defaultView.getComputedStyle(t,null):t.currentStyle?e?t.currentStyle[e.replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]:t.currentStyle:void 0}function s(t){var e=t.getBoundingClientRect(),o=a.pageYOffset||c.documentElement.scrollTop,t=a.pageXOffset||c.documentElement.scrollLeft;return{top:e.top+o,left:e.left+t}}t.Helpers={supportsPassive:e,isEmptyObject:function(t){for(var e in t)return!1;return!0},debounce:function(i,n,s){var r;return function(){var t=this,e=arguments,o=s&&!r;clearTimeout(r),r=setTimeout(function(){r=null,s||i.apply(t,e)},n),o&&i.apply(t,e)}},hasClass:function(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},offset:s,position:function(t){var e=t.offsetParent,o=s(e),i=s(t),e=n(e),t=n(t);return o.top+=parseInt(e.borderTopWidth)||0,o.left+=parseInt(e.borderLeftWidth)||0,{top:i.top-o.top-(parseInt(t.marginTop)||0),left
52:i.left-o.left-(parseInt(t.marginLeft)||0)}},getElement:function(t){var e=null;return"string"==typeof t?e=c.querySelector(t):a.jQuery&&t instanceof a.jQuery&&t.length?e=t[0]:t instanceof Element&&(e=t),e},getStyle:n,getCascadedStyle:function(t){var e,o=t.cloneNode(!0);o.style.display="none",Array.prototype.slice.call(o.querySelectorAll('input[type="radio"]')).forEach(function(t){t.removeAttribute("name")}),t.parentNode.insertBefore(o,t.nextSibling),o.currentStyle?e=o.currentStyle:a.getComputedStyle&&(e=c.defaultView.getComputedStyle(o,null));var i,n,s,r={};for(i in e)!isNaN(i)||"string"!=typeof e[i]&&"number"!=typeof e[i]||(r[i]=e[i]);if(Object.keys(r).length<3)for(var l in r={},e)isNaN(l)||(r[e[l].replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]=e.getPropertyValue(e[l]));return r.margin||"auto"!==r.marginLeft?r.margin||r.marginLeft!==r.marginRight||r.marginLeft!==r.marginTop||r.marginLeft!==r.marginBottom||(r.margin=r.marginLeft):r.margin="auto",r.margin||"0px"!==r.marginLeft||"0px"!==r.marginRight||(s=(n=t.offsetLeft-t.parentNode.offsetLeft)-(parseInt(r.left)||0)-(parseInt(r.right)||0),0!=(s=t.parentNode.offsetWidth-t.offsetWidth-n-(parseInt(r.right)||0)+(parseInt(r.left)||0)-s)&&1!=s||(r.margin="auto")),o.parentNode.removeChild(o),o=null,r}}}(window); 53 54 var $sticky = $('.fixed_block_1'); $sticky.hcSticky({stickTo: '.fixed_block__wrapper_1'}); 55 $sticky.hcSticky('update', {top: 62}); 56 57 var $sticky2 = $('.fixed_block_2'); $sticky2.hcSticky({stickTo: '.fixed_block__wrapper_2'}); 58 $sticky2.hcSticky('update', {top: 62}); 59 60 var $sticky3 = $('.fixed_block_3'); $sticky3.hcSticky({stickTo: '.fixed_block__wrapper_3', responsive: {1240: {disable: true}}}); 61 $sticky3.hcSticky('update', {top: 62}); 62 63 $(".fixed_blocks").each(function() { 64 var sticky = new hcSticky(this, { 65 stickTo: this.parentNode, 66 top: 75 67 }); 68 $(this).on("update", function() {$(this).hcSticky('update', {top: 75})}); 69 }); 70 } 71 72 var currentOffset = $(document).scrollTop(); 73 var headerHeight = $('header').height(); 74 var menuHeight = $(window).height() - $('header').height(); 75 76 $('.menu_box').css('padding-top', (headerHeight - currentOffset) + 'px') 77 //$('.menu_box').css('height', menuHeight + 'px'); 78 79 $(function() { 80 var $a = $(".menu_box li[data-section]"), 81 $section = $(".content_column"); 82 var mouseenter = false; 83 $a.on("mouseenter", function(e) { 84 var index = $(this).data("section"); 85 86 $section 87 .filter("[data-section=" + index+ "]") 88 .addClass("active") 89 .siblings(".active") 90 .removeClass("active"); 91 92 $a.removeClass("selected"); 93 $(this).addClass("selected"); 94 }); 95 }); 96 97 $(window).resize(function() { 98 if( !$('header').hasClass('collapsed') ){ 99 headerHeight = $('header').height(); 100 menuHeight = $(window).height() - $('header').height() + $(document).scrollTop(); 101 $('.menu_box').css('padding-top', ( headerHeight - $(document).scrollTop() ) + 'px') 102 // $('.menu_box').css('height', menuHeight + 'px'); 103 } 104 }); 105 106 107 $(document).scroll(function (){ 108 currentOffset = $(document).scrollTop(); 109 menuHeight = $(window).height() - $('header').height(); 110 headerHeight = $('header').height(); 111 112 if( currentOffset > headerHeight ){ 113 $('header').addClass('collapsed'); 114 $('.wrapper').addClass('wrapper_no_jump'); 115 116 $('.menu_box').css('padding-top', '56px'); 117 // $('.menu_box').css('height', menuHeight + 'px'); 118 }else{ 119 $('header').removeClass('collapsed'); 120 $('.wrapper').removeClass('wrapper_no_jump'); 121 122 $('.menu_box').css('padding-top', (headerHeight - currentOffset) + 'px'); 123 // $('.menu_box').css('height', $(window).height() - (headerHeight - currentOffset) + 'px'); 124 } 125 }); 126 127 128 $('.search').click(function() 129 { 130 if( $('.search_box').is(':visible') ){ 131 $('.search_box').removeClass('search_box_show').addClass('search_box_hide'); 132 $('.search').removeClass('search_hide'); 133 $('.top_news').removeClass('top_news_hide'); 134 $('.tag_list').removeClass('hide_tag'); 135 $('.all_news').removeClass('hide_all_news'); 136 }else{ 137 $('.search_box').removeClass('search_box_hide').addClass('search_box_show'); 138 $('.search').addClass('search_hide'); 139 $('.top_news').addClass('top_news_hide'); 140 $('.tag_list').addClass('hide_tag'); 141 $('.all_news').addClass('hide_all_news'); 142 $('.search_box').find("input[name=q]").focus(); 143 } 144 }); 145 146 $('.menu_show').click(function() 147 { 148 if( $('.menu_box').is(':visible') ){ 149 $('.wrapper_overlay').hide(); 150 $('.menu_box').addClass('menu_hide'); 151 $('.menu_back').hide(); 152 }else{ 153 $('.wrapper_overlay').show(); 154 $('.menu_box').removeClass('menu_hide'); 155 $('.menu_back').show(); 156 } 157 return false; 158 }); 159 160 161 162 var newsSwiper = new Swiper("._links_swiper", { 163 slidesPerView: 4, 164 spaceBetween: 16, 165 loop: true, 166 allowTouchMove: true, 167 168 breakpoints: { 169 1200: { 170 slidesPerView: 5, 171 spaceBetween: 16, 172 }, 173 1440: { 174 slidesPerView: 6, 175 spaceBetween: 16, 176 }, 177 } 178 }); 179 180 181 // Preview Slider 182 183 var swiper = new Swiper(".mySwiper", { 184 spaceBetween: 8, 185 slidesPerView: 6, 186 freeMode: true, 187 watchSlidesVisibility: true, 188 watchSlidesProgress: true, 189 }); 190 191 192 // Big Photo Slider 193 194 var swiper2 = new Swiper(".mySwiper2", { 195 loop: true, 196 spaceBetween: 0, 197 pagination: { 198 el: ".s2_swiper-pagination", 199 type: "fraction", 200 }, 201 navigation: { 202 nextEl: ".s2_swiper-button-next", 203 prevEl: ".s2_swiper-button-prev", 204 }, 205 thumbs: { 206 swiper: swiper, 207 } 208 }); 209 210 $(".tags__item .tags__link").on("click", function() { 211 var newsIds = $(this).data("news-ids").toString(); 212 if (newsIds.indexOf(',') > 0) { 213 newsIds = newsIds.split(","); 214 } else { 215 newsIds = [newsIds] 216 } 217 $(".new_post").each(function() { 218 var url = $(this).data("url"); 219 var f = false; 220 for (i in newsIds) { 221 var newsId = newsIds[i]; 222 if (url.indexOf("/" + newsId + ".html") > 0) { 223 f = true; 224 break; 225 } 226 } 227 if (f) { 228 $(this).show(); 229 } else { 230 $(this).hide(); 231 } 232 }); 233 return false; 234 }); 235 236 if ($(".tags.tags--line")[0]) { 237 $(".new_post h4 a").on("click", function() { 238 $(this).parents(".new_post").find(".details").click(); 239 return false; 240 }); 241 $(".new_post .comments").on("click", function() { 242 $(this).parents(".new_post").find(".details").click(); 243 var url = $(this).attr("href"); 244 var idx = url.lastIndexOf('/'); 245 var idx2 = url.indexOf('.', idx); 246 var id = url.substring(idx+1, idx2); 247 setTimeout(function() { 248 document.location.hash = 'comments' + id; 249 }, 2000); 250 return false; 251 });
252 $(".new_post .details").on("click", function() { 253 var more = $("<div class='news_text'></div>"); 254 more.insertAfter($(this)); 255 $(this).prev().addClass("h4"); 256 $(this).remove(); 257 more.html('<img src="https://vz.ru/static/images/loading.gif" width="32" height="32" class="loading">'); 258 var url = $(this).attr("href"); 259 $.get(url + "?json=1", function(data) { 260 more.html(data.message); 261 if (data.comments >= 0) { 262 var commentsBlock = '<div style="margin-bottom: 20px; margin-left: 245px;"><a name="comments' + data.id + '"></a>'; 263 if (url.indexOf("/") == 0) { 264 url = "https://vz.ru" + url; 265 } 266 commentsBlock += '<div id="xdm-container' + data.id + '" data-url="' + url + '"></div></div>'; 267 $(commentsBlock).insertAfter(more.parents(".new_post")); 268 window['updateComments'] = function(commentId, count) { 269 newsCommentsCallback(count, data.id, '', '', data.id); 270 } 271 $.ajax({
272 type: "GET", 273 url: "https://vzglyad.online/forum/site_comments/" + data.id + "/" + "?url=" + encodeURIComponent(url), 274 timeout: 3000, 275 crossDomain: true, 276 xhrFields: { 277 withCredentials: true 278 }, 279 success: function(result) { 280 $( "#xdm-container"+data.id ).html(result); 281 } 282 }); 283 284 } 285 286 }); 287 return false; 288 }); 289 } 290 291 if ($(".other_article")[0]) { 292 $(window).on('scroll resize', function(e) { 293 $.each($(".other_article,article"), function(e, elem) { 294 var placement = elem.getBoundingClientRect(); 295 var elem = $(elem); 296 if( placement.top<window.innerHeight && placement.bottom>0 ) { 297 if (window.location.pathname != elem.data("url")) { 298 history.pushState({}, elem.find("h1").text(), elem.data("url")); 299 //console.log('Hash: ' + elem.data("url") + " title " + elem.find("h1").text()); 300 301 var _gaq = _gaq || []; 302 _gaq.push(['_setAccount', 'UA-3626413-1']); 303 _gaq.push(['_trackPageview', elem.data("url")]); 304 305 (function() { 306 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 307 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 308 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 309 })(); 310 311 $("body").append("<img src='https://counter.yadro.ru/hit?r"+ 312 escape(document.referrer)+((typeof(screen)=="undefined")?"": 313 ";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth? 314 screen.colorDepth:screen.pixelDepth))+";u"+escape(elem.data("url"))+ 315 ";"+Math.random()+ 316 "' width=1 height=1 alt=''>") 317 $("body").append('<img src="//mc.yandex.ru/watch/24834572" style="position:absolute; left:-9999px;" alt="" />'); 318 319 } 320 return false; /* Exit $.each loop */ 321 }; 322 }); 323 }); 324 $(".other_article .other_comments").on("click", function() { 325 var id = $(this).attr("id"); 326 var url = $(this).data("url"); 327 $(this).after("<div class='_comments' id='xdm-container-" + id + "'></div>"); 328 $(this).remove(); 329 $.ajax({
330 type: "GET", 331 url: "https://vzglyad.online/forum/site_comments/" + id + "/" + "?url=" + encodeURIComponent(url), 332 timeout: 3000, 333 crossDomain: true, 334 xhrFields: { 335 withCredentials: true 336 }, 337 success: function(result) { 338 jQuery( "#xdm-container-" + id ).html(result); 339 } 340 }); 341 342 return false; 343 }); 344 } 345 346 var form = $("form.sys_vote_form"); 347 if(form.length > 0) 348 { 349 form.find("button.sys_vote").unbind("click").bind("click", function(){ 350 var button = $(this); 351 var voteForm = button.parents("form.sys_vote_form"); 352 _post("/votehandler/", voteForm.serialize(), function(resp){ 353 if(resp == "true") 354 { 355 var checked = voteForm.find("input[type=radio]:checked, input[type=checkbox]:checked").first(); 356 var aid = checked.length > 0 ? "&aid=" + checked.val() : ""; 357 document.location.href = "/vote/result/" + voteForm.find("input[name=id]").val() + "/?vote=true" + aid; 358 } 359 else 360 { 361 if(voteForm.find(".sys_vote_error").length == 0) 362 { 363 voteForm.append("<div class = 'sys_vote_error' style = 'color: #E23535; font-weight: bold;'>ÐзвиниÑе, Ñ Ð²Ð°Ñего IP-адÑеÑа Ñже голоÑовали</div>"); 364 } 365 } 366 }); 367 return false; 368 }); 369 form.find(".vote_widget__answer input").unbind("change").bind("change", function(){ 370 var voteForm = $(this).parents("form.sys_vote_form"); 371 var answered = voteForm.find(".vote_widget__answer input:checked").length > 0; 372 voteForm.find(".vote_widget__btn_vote").toggleClass("is_active", answered); 373 }); 374 form.find(".vote_insert__answer input").unbind("change").bind("change", function(){ 375 var voteForm = $(this).parents("form.sys_vote_form"); 376 var answered = voteForm.find(".vote_insert__answer input:checked").length > 0; 377 voteForm.find(".vote_insert__btn_vote").toggleClass("is_active", answered); 378 }); 379 } 380 form = $(".news-vote"); 381 if(form.length > 0) 382 { 383 form.find("input.sys_news_vote").unbind("click").bind("click", function(){ 384 var button = $(this); 385 _post("/newsvotehandler/", "id=" + form.find("input[name='news_id']").val() + "&aid=" + button.attr("name").substring(6), function(resp){ 386 if(form.siblings(".sys_vote_error").length == 0) 387 { 388 form.before("<div class = 'sys_vote_error' style = 'color: #E23535; font-weight: bold;'>" + (resp == "false" ? "ÐзвиниÑе, Ñ Ð²Ð°Ñего IP-адÑеÑа Ñже голоÑовали" : "СпаÑибо. ÐÐ°Ñ Ð³Ð¾Ð»Ð¾Ñ Ð·Ð°ÑÑиÑан." ) + "</div>"); 389 } 390 if (resp != "false") { 391 var idx = resp.indexOf(':'); 392 if (idx > 0) { 393 var count1 = parseInt(resp.substring(0, idx)); 394 var count2 = parseInt(resp.substring(idx+1)); 395 var total = (count1 + count2) * 1.0; 396 var percent1 = (total > 0) ? count1*100/total : 0; 397 percent1 = Math.round(percent1*10)/10.0; 398 var votep1 = form.find(".votep1"); 399 votep1.find(".progress").css("width", percent1 + "%"); 400 votep1.find("b").text(count1); 401 var votep2 = form.find(".votep2"); 402 votep2.find(".progress").css("width", (100-percent1) + "%"); 403 votep2.find("b").text(count2); 404 } 405 } 406 }); 407 return false; 408 }); 409 } 410 var jscroll = $(".jscroll"); 411 if (jscroll.length > 0) { 412 var page = 2; 413 jscroll.jscroll({ 414 loadingHtml: '<span class="loading"></span>', 415 padding: 20, 416 nextSelector: 'a.next:last', 417 beforeLoading: function() { 418 $sticky.hcSticky('detach'); 419 $sticky2.hcSticky('detach'); 420 }, 421 callback: function() { 422 $sticky.hcSticky('attach'); 423 $sticky2.hcSticky('attach'); 424 $sticky.hcSticky('update', {top: 52}); 425 $sticky2.hcSticky('update', {top: 52}); 426 var article = $("article"); 427 if (article[0]) { 428 $(".jscroll-added div[data-url='" + article.data("url") + "']").remove(); 429 } 430 431 } 432 }); 433 } 434 $(".share").on("click", function() { 435 $(this).toggleClass("open"); 436 }); 437 $(".share .url").on("click", function() { 438 if (copyTextToClipboard($(this).data("url"))) { 439 var popover = $("<div class='popover'>СÑÑлка бÑла ÑкопиÑована</div>"); 440 popover.insertAfter($(this)); 441 setTimeout(function() { 442 $(".share").removeClass("open"); 443 popover.remove(); 444 }, 2000); 445 } 446 return false; 447 }); 448 var article = $("article"); 449 if (article[0]) { 450 var article_text = article.find(".news_text:not(.noads)").eq(0); 451 if (article_text[0]) { 452 var paragraphs = article_text.children().not('blockquote, div'); 453 paragraphs = paragraphs.filter(function () { 454 var text = $.trim($(this).html().replace(/\s| /g, '')); 455 return text.length > 0 && $(this).find("strong").length == 0; 456 }); 457 var len = paragraphs.length; 458 459 if (/*Cookies.get("adblk") == "yes"*/ false) { 460 } else { 461 if (len > 3) { 462 var rand = Math.floor((Math.random() * 2) ); 463 if (rand == 1) { 464 $('<iframe src="https://code.giraff.io/data/w-vzru-2.html" class="ads_inner" width="100%" height="90" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>').insertAfter(paragraphs.eq(2)); 465 } else { 466 $('<div id="yandex_rtb_R-A-276631-55" class="ads_inner"></div>').insertAfter(paragraphs.eq(2)); 467 window.yaContextCb.push(()=>{ 468 Ya.Context.AdvManager.render({ 469 renderTo: 'yandex_rtb_R-A-276631-55', 470 blockId: 'R-A-276631-55' 471 }); 472 }); 473 474 } 475 } 476 if (len >= 10) { 477 $('<div id="yandex_rtb_R-A-276631-54" class="ads_inner"></div>').insertAfter(paragraphs.eq(len >= 20 ? 12 : 9)); 478 window.yaContextCb.push(()=>{ 479 Ya.Context.AdvManager.render({ 480 blockId: "R-A-276631-54",
481 statId: (Cookies.get("adblk") == "yes") ? 2 : 1, 482 renderTo: "yandex_rtb_R-A-276631-54", 483 async: true 484 }); 485 }); 486 } 487 if (len >= 20) { 488 $('<div id="yandex_rtb_R-A-276631-56" class="ads_inner"></div>').insertAfter(paragraphs.eq(len >= 30 ? 20 : 19)); 489 window.yaContextCb.push(()=>{ 490 Ya.Context.AdvManager.render({ 491 blockId: "R-A-276631-56", 492 statId: (Cookies.get("adblk") == "yes") ? 2 : 1, 493 renderTo: "yandex_rtb_R-A-276631-56", 494 async: true 495 }); 496 }); 497 } 498 if (len >= 30) { 499 $('<div id="yandex_rtb_R-A-276631-55-2" class="ads_inner"></div>').insertAfter(paragraphs.eq(29)); 500 window.yaContextCb.push(()=>{ 501 Ya.Context.AdvManager.render({ 502 renderTo: 'yandex_rtb_R-A-276631-55-2', 503 blockId: 'R-A-276631-55' 504 }); 505 }); 506 } 507 } 508 } 509 //var ad1 = $("#yandex_rtb_R-A-276631-50"); 510 var ad2 = $("#yandex_rtb_R-A-276631-8"); 511 var sc = 0; 512 if (ad2[0]) { 513 setTimeout(function() { 514 $(window).on("scroll", function() { 515 if (Math.abs($(window).scrollTop() - sc) > 2500) { 516 if (($(window).scrollTop() - sc) > 0) { 517 /*Ya.Context.AdvManager.render({ 518 renderTo: 'yandex_rtb_R-A-276631-50', 519 blockId: 'R-A-276631-50' 520 });*/ 521 Ya.Context.AdvManager.render({ 522 renderTo: 'yandex_rtb_R-A-276631-8', 523 blockId: 'R-A-276631-8' 524 }); 525 } 526 sc = $(window).scrollTop(); 527 } 528 }); 529 }, 1000); 530 } 531 } 532 533 var up = $(".up") 534 up.click(function() { 535 var body = $(document); 536 var top = body.scrollTop() // Get position of the body 537 538 if(top!=0) 539 { 540 $("html,body").animate({scrollTop:0}, '500'); 541 } 542 return false; 543 }); 544 var checkUp = function() { 545 var height = $(window).height(); 546 var width = $(window).width(); 547 var top = $(document).scrollTop(); 548 var ww = $(".wrapper").width(); 549 if (top > 1000 && width > ww) { 550 up.css("right", ((width - ww) / 4 - 25) + "px"); 551 up.show(); 552 } else { 553 up.hide(); 554 } 555 } 556 $(window).scroll(checkUp); 557 $(window).resize(checkUp); 558 }); 559 560 561 562 function voteCommentsCallback(num, pageId, time, sign, id) 563 { 564 var url = "/vkcomments_count"; 565 var body = "ptl-ajax=true&ptl-action=update-count"; 566 567 var request = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); 568 569 request.open("POST", url, true); 570 request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 571 request.send(body + "&time=" + time + "&page_id=" + pageId + "&count=" + num + "&sign=" + sign + "&type=vote" + "&id=" + id); 572 } 573 function newsCommentsCallback(num, pageId, time, sign, id) { 574 var url = "/vkcomments_count"; 575 var body = "ptl-ajax=true&ptl-action=update-count"; 576 577 var request = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); 578 579 request.open("POST", url, true); 580 request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); 581 request.send(body + "&time=" + time + "&page_id=" + pageId + "&count=" + num + "&sign=" + sign + "&id=" + id); 582 } 583 function _post(url, param, callback, type) { 584 if(!type) 585 { 586 type = "POST"; 587 } 588 jQuery.ajax({ 589 type: type, 590 url: url, 591 data: param, 592 timeout: 30000, 593 success: callback, 594 error: function(xhr, code){ 595 //alert(code); 596 } 597 }); 598 } 599
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.