1 2 // if (typeof viewsUpdater == "undefined") 3 // { 4 // function viewsUpdater() { 5 // console.log('page_photo'); 6 // if (window.location.host == 'iz.ru') 7 // { 8 // var timer, incrInterval; 9 // var viewsCounters = jQuery('.article_page__left__top__views__label'); 10 11 // if (viewsCounters.length) { 12 // timer = window.setInterval(function() { 13 // jQuery(viewsCounters).each(function(){ 14 // var current_counter_block = jQuery(this); 15 // if (current_counter_block.offset().top > jQuery(window).scrollTop() - Number(jQuery(window).height()) * 0.25 && current_counter_block.offset().top < Number(jQuery(window).height()) + Number(jQuery(window).scrollTop()) ) { 16 17 // var pathname_url = jQuery(this).parents(".inside_page").attr('data-url'); 18 19 // if (pathname_url != undefined && pathname_url != 'undefined' && pathname_url.match(/undefined/gi) == null) 20 // { 21 // pathname_url = pathname_url.replace("http://iz.dev", "").replace("http://a.iz.ru", "").replace("http://dev.iz.ru", "").replace("https://iz.ru", "") 22 23 // if (1==1) { 24 // $.get('/_views' + pathname_url, function(data) { 25 // if(data) { 26 // var current = Number(data) 27 // , start = Number(current_counter_block.text()) 28 // , diff = current - start; 29 // if (diff <= 24) { 30 // current_counter_block.text(current); 31 // } else { 32 // var incr = Math.round(diff/24); 33 34 // if(incr<1) { 35 // incr = 1; 36 // } 37 38 // var incrInterval = window.setInterval(function(){ 39 // if ((start += incr) < current) { 40 // current_counter_block.text(start); 41 // } else { 42 // current_counter_block.text(current); 43 // window.clearInterval(incrInterval); 44 // } 45 // }, 50); 46 // } 47 // } 48 // }); 49 // } 50 // } 51 // } 52 53 // }); 54 // }, 2000); 55 // } 56 // } 57 // }; 58 // } 59 60function getParameterUrlByName(name, url) { 61 if (!url) url = window.location.href; 62 name = name.replace(/[\[\]]/g, "\\$&"); 63 var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 64 results = regex.exec(url); 65 if (!results) return null; 66 if (!results[2]) return ''; 67 return decodeURIComponent(results[2].replace(/\+/g, " ")); 68} 69 70// оÑÐ½Ð¾Ð²Ð½Ð°Ñ Ð³Ð°Ð»ÐµÑÐµÑ ÑоÑогÑаÑий 71var big_photos_list__inside = jQuery('.big_photos_list__inside'); 72 73function build_slider() { 74 // ÐÑогÑÑжаем каÑÑинки, не воÑедÑие в lazyload 75 var $owlImages = big_photos_list__inside.find('img[data-src!=""]'); 76 $owlImages.each(function(index) { 77 var $this = jQuery(this), 78 attrSRC = $this.attr('src'); 79 if (attrSRC && attrSRC.match(/data:/)) { 80 let dataSrc = $this.data('src'); 81 82 // ucr.io 83 // if (dataSrc.search('//cdn.iz.ru') !== -1) { 84 // let resize = window.outerWidth < 361 ? '' : ''; 85 // dataSrc = 'https://iz-photo.ucr.io/' + resize + '-/format/auto/-/progressive/yes/-/quality/lightest/' + dataSrc.replace('//cdn.iz.ru', 'https://iz.ru'); // ucr.io url 86 // } 87 $this.attr('src', dataSrc); 88 } 89 }); 90 91 big_photos_list__inside = big_photos_list__inside.owlCarousel({ 92 items: 1, 93 loop: false, 94 margin: 0, 95 autoplay: false, 96 autoplayTimeout: 5000, 97 autoplayHoverPause: true, 98 nav: true, 99 rewind: true, 100 lazyLoad:true, 101 responsiveRefreshRate: 200, 102 smartSpeed: 800, 103 navText: ["<div class='go_to_prev'><div class='icon'></div></div>","<div class='go_to_next'><div class='icon'></div></div>"] 104 }); 105 106 // вÑÑавниваем кнопки в каÑÑÑеле по ÑенÑÑÑ ÐºÐ°ÑÑинки 107 jQuery('.article_page__left .big_photos_list .go_to_next, .article_page__left .big_photos_list .go_to_prev').css('top', (jQuery('.article_page__left .big_photos_list .big_photo__img').height() / 2 ) + 'px'); 108} 109 110jQuery(window).on('orientationchange', function(){ 111 var $bigPhotosList = jQuery('.article_page__left .big_photos_list__inside .big_photo__img'); 112 if ($bigPhotosList.length) { 113 setTimeout(function() { 114 jQuery('.article_page__left .big_photos_list .go_to_next, .article_page__left .big_photos_list .go_to_prev').css('top', ($bigPhotosList.height() / 2 ) + 'px'); 115 }, 600); 116 } 117}); 118 119jQuery('.big_photos_list__inside').on('changed.owl.carousel', function(event) { 120 var item_block = jQuery('.big_photos_list__inside .big_photo').eq(event.item.index); 121 122 var item_block_img_url = ''; 123 if (item_block.find('img').attr('data-original-src') != undefined) { 124 item_block_img_url = item_block.find('img').attr('data-original-src'); 125 } else { 126 item_block_img_url = item_block.find('img').attr('src'); 127 } 128 item_block_img_url = item_block_img_url.replace('http://portal', '//cdn.iz.ru').replace('http://dev.iz.ru', '//cdn.iz.ru').replace('http://a.iz.ru', '//cdn.iz.ru') 129 item_block_img_url = 'https:' + item_block_img_url; 130 jQuery('meta[name="twitter:image"]').attr('content', item_block_img_url); 131 jQuery('meta[property="og:image"]').attr('content', item_block_img_url); 132 jQuery('.ya-share2').attr('data-image', item_block_img_url); 133 134 // var tt = jQuery('meta[property="og:image"]').prop('content'); 135 // jQuery('.page-content.active .share_bottom2__inside .ya-share2').updateContent({ 136 // url: tt 137 // }); 138 139}); 140 141// ÑаÑÑÑавлÑем номеÑа Ñлайдов в ÑоÑогалеÑее 142jQuery(".big_photos_list").each(function(index__photos) { 143 var count_photos_in_gallery = jQuery(".big_photos_list").eq(index__photos).find(jQuery(".big_photo__img")).length; 144 jQuery(".big_photos_list").eq(index__photos).find(jQuery(".big_photo__img")).each(function(index){ 145 jQuery(this).find('.big_photo__img__full_screen').attr("data-number", index+1); 146 jQuery(this).append('<div class="big_photo__img__numbers_bottom">'+(index+1)+'/'+count_photos_in_gallery+'</div>') 147 }); 148}); 149 150if ( jQuery(".popup__gallery__slides__inside").length > 0 ) { 151 // ÑÑнкÑÐ¸Ñ Ð´Ð»Ñ Ð¿ÐµÑеÑаÑÑеÑа ÑиÑин вÑплÑваÑÑей галеÑеи 152 function check_sizes() { 153 // вÑÑавниваем кнопки в каÑÑÑеле по ÑенÑÑÑ ÐºÐ°ÑÑинки 154 jQuery('.article_page__left .big_photos_list .go_to_next, .article_page__left .big_photos_list .go_to_prev').css('top', (jQuery('.article_page__left .big_photos_list .big_photo__img').height() / 2 ) + 'px'); 155 156 var window_height = jQuery(window).height(); 157 var item__photo = window_height - 125; 158 var item__img = item__photo/100*90; 159 if (!after768()) { 160 } else { 161 jQuery(".popup__gallery__slides__inside").width(jQuery(window).width()/100*80);} 162 } 163 164 // пÑи ÑеÑайзе окна обновлем вÑоÑÑ Ð±Ð¾ÐºÐ¾Ð² галеÑеи 165 jQuery(window).resize(function(){ 166 check_sizes(); 167 }); 168 check_sizes(); 169 170 // кнопка закÑÑÑÑ Ð¿Ð¾Ð¿Ð°Ð¿ 171 jQuery(".popup__gallery__close").click(function(){ 172 jQuery(".popup__gallery").removeClass("active"); 173 window.location.hash = ""; 174 }); 175 176 // еÑли нажали ESC Ñо закÑÑваем полноÑкеÑаннÑй Ñежим 177 jQuery(document).keydown(function(e) { 178 if( e.keyCode === 27 ) { 179 jQuery(".popup__gallery").removeClass("active"); 180 window.location.hash = ""; 181 return false;
182 } 183 }); 184 185 // еÑли кликаем по ÑÐ¾Ð½Ñ Ð² попапе Ñо ÑкÑÑваем его 186 jQuery('.popup__gallery').click(function(e){ 187 if ( !jQuery(e.target).closest('.popup__gallery__slides__inside__item').length && !jQuery(e.target).closest('.popup__gallery__share').length && !jQuery(e.target).closest('.owl-prev').length && !jQuery(e.target).closest('.owl-next').length ){ 188 jQuery(this).removeClass("active"); 189 window.location.hash = ""; 190 } 191 }); 192 193 // ÑÑнкÑÐ¸Ñ Ð¿Ð¾ÑÑÑÐ¾ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð¿Ð°Ð¿Ð° Ñ Ð³Ð°Ð»ÐµÑеей 194 function show_gallery(number_photo) { 195 // number_photo - Ð½Ð¾Ð¼ÐµÑ ÐºÐ°ÑÑинки коÑоÑÑÑ Ð½Ñжно показаÑÑ ÑÑÐ°Ð·Ñ Ð² попае 196 // блок в коÑоÑом бÑÐ´ÐµÑ ÑÐ»Ð°Ð¹Ð´ÐµÑ Ñ ÑоÑками 197 var popup__gallery = jQuery('.popup__gallery__slides__inside'); 198 199 // еÑли ÑÐ»Ð°Ð¹Ð´ÐµÑ Ð½Ðµ ÑÑÑановлен Ñо иниÑиализиÑÑем его 200 if ( jQuery(".popup__gallery").hasClass("activated") == false ) { 201 var photos = ''; // в ÑÑой ÑÑÑоке бÑдÑÑ Ð²Ñе пÑнкÑÑ Ð³Ð°Ð»ÐµÑеи 202 var count_photos = 0; // обÑее кол-во ÑоÑок 203 jQuery(".article_page__left .big_photo").each(function(index){ 204 if (typeof jQuery(this).find("img").attr("src") != "undefined") { 205 count_photos = Number(count_photos) + 1; 206 } 207 }); 208 jQuery(".article_page__left .big_photo").each(function(index){ 209 // делаем ÑазмеÑÐºÑ 210 if (typeof jQuery(this).find("img").attr("src") != "undefined") { 211 212 var srcAttr = jQuery(this).find("img").attr("src"), 213 dataSrcAttr = jQuery(this).find("img").attr("data-src"), 214 parseSrc = srcAttr.indexOf('image/png;base64') != -1 && '' != dataSrcAttr ? dataSrcAttr : srcAttr ; 215 216 photos += '<div class="popup__gallery__slides__inside__item">'+ 217 '<div class="popup__gallery__slides__inside__item__photo">'+ 218 '<div class="display_table">'+ 219 '<div class="display_table__cell">'+ 220 '<img src="' + parseSrc + '" alt="">'+ 221 '</div>'+ 222 '</div>'+ 223 '</div>'+ 224 '<div class="popup__gallery__slides__inside__item__author">'+ 225 jQuery(this).find(".big_photo__source_photo").text()+ 226 '</div>'+ 227 '<div class="popup__gallery__slides__inside__item__counter">'+ 228 (Number(index) + 1) +'/'+ count_photos + 229 '</div>'+ 230 '<div class="clearfix"></div>'+ 231 '<div class="popup__gallery__slides__inside__item__description">'+ 232 jQuery(this).find(".big_photo__description").text()+ 233 '</div>'+ 234 '</div>'; 235 } 236 }); 237 jQuery('.popup__gallery__slides__inside').html(photos); // вÑÑавлÑем ÑобÑаннÑе пÑнкÑÑ Ð² блок 238 popup__gallery = jQuery('.popup__gallery__slides__inside'); // пеÑеопÑеделÑем пеÑеменнÑÑ 239 // иниÑиализиÑÑем галаеÑÑ 240 241 // ÐÑогÑÑжаем каÑÑинки, не воÑедÑие в lazyload 242 var $owlImages = popup__gallery.find('img[data-src!=""]'); 243 $owlImages.each(function(index) { 244 var $this = jQuery(this), 245 attrSRC = $this.attr('src'); 246 if (attrSRC && attrSRC.match(/data:/)) { 247 $this.attr('src', $this.data('src')); 248 } 249 }); 250 251 popup__gallery.owlCarousel({ 252 items: 1, 253 loop: false, 254 margin: 0, 255 autoplay: false, 256 nav: true, 257 lazyLoad:true, 258 smartSpeed: 600, 259 navText: ["<div class='go_to_prev'><div class='icon'></div></div>","<div class='go_to_next'><div class='icon'></div></div>"] 260 }); 261 jQuery(".popup__gallery").addClass("activated"); 262 popup__gallery.on('changed.owl.carousel', function(property) { 263 window.location.hash = "show-photo=" + property.item.index; 264 }); 265 } 266 267 popup__gallery.trigger('to.owl.carousel', [number_photo-1]); // пеÑелиÑÑÑваем ÑÑÐ°Ð·Ñ Ð³Ð°Ð»ÐµÑÐµÑ Ðº Ñой каÑÑинке на коÑоÑÑÑ ÐºÐ»Ð¸ÐºÐ½Ñли 268 269 jQuery(".popup__gallery").addClass("active"); // показÑваем галеÑÐµÑ 270 } 271 272 jQuery(".big_photos_list__btns__item").click(function() { 273 274 if (jQuery(this).hasClass("active") == false) { 275 jQuery(".big_photos_list__btns__item").removeClass("active"); 276 jQuery(this).addClass("active") 277 if (jQuery(this).attr("data-type") == "list") { 278 //ga('send', 'event', 'gallery', 'list-button'); 279 280 big_photos_list__inside.trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded'); 281 282 try { 283 284 // jQuery("img[data-src][src *= base64]").each(function () { 285 // let dataSrc = jQuery(this).data('src'); 286 // // ucr.io 287 // if (dataSrc.search('//cdn.iz.ru') !== -1) { 288 // let resize = window.outerWidth < 361 ? '' : ''; 289 // jQuery(this).attr('data-src', 'https://iz-photo.ucr.io/' + resize + '-/format/auto/-/progressive/yes/-/quality/lightest/' + dataSrc.replace('//cdn.iz.ru', 'https://iz.ru')); // ucr.io url 290 // } 291 // }); 292 293 jQuery("img[data-src][src *= base64]") 294 .filter(function(){ 295 return jQuery(this).parents('.owl-carousel').length <= 0; 296 }).lazyload({ 297 data_attribute: 'src', 298 load : function() 299 { 300 301 setTimeout(function() { 302 jQuery(window).trigger('scroll'); 303 jQuery(document).trigger('scroll'); 304 }, 400); 305 } 306 }); 307 } catch(err){}; 308 309 } else { 310 jQuery('.big_photos_list__inside').addClass("owl-carousel"); 311 build_slider(); 312 //ga('send', 'event', 'gallery', 'slider-button'); 313 } 314 } 315 }); 316} 317 jQuery(document).ready(function(){ 318 319 320 if (jQuery(window).width()>=768) { 321 var left_column_padding = jQuery(".article_page__left").css("padding-right").replace("px", ""); 322 if (jQuery(window).width() >= 812) { 323 var right_column = jQuery(".article_page__right").width(); 324 } 325 var main_margins = jQuery(".page-content .block-container-margins").css("margin-right").replace("px", ""); 326 var total = Number(main_margins) * 2 + Number(right_column) + Number(left_column_padding); 327 var main_area = jQuery(".page-content .block-container").width(); 328 var total_area = main_area - total; 329 330 if (total_area > 900) jQuery(".big_photos_list").width(900); 331 else jQuery(".big_photos_list").width(total_area); 332 333 console.log('total_area'); 334 console.log(total_area); 335 jQuery(".article_page__left").width(total_area); 336 } 337 338 if (jQuery("html").hasClass("landscape")){ 339 jQuery("html.landscape .popup__gallery__slides .owl-item img").css('height', jQuery(window).height()+'px', 'important'); 340 } 341 build_slider(); 342 }); 343 344 345 jQuery(window).on("resize", function(){ 346 jQuery("html.landscape .popup__gallery__slides .owl-item img").css('height', jQuery(window).height()+'px', 'important'); 347 jQuery("html.portrait .popup__gallery__slides .owl-item img").css('height', 'auto', 'important'); 348 }); 349 350 jQuery(window).on("load", function(){ 351 check_shares_block(); 352 build_slider(); 353 if (jQuery('.slider-block2__inside').length > 0) { 354 var slider_block2__inside = jQuery('.slider-block2__inside'); 355 setTimeout(function(){ 356 slider_block2__inside.parent().width(jQuery(".text-article__inside").width()); 357 358 // ÐÑогÑÑжаем каÑÑинки, не воÑедÑие в lazyload 359 var $owlImages = slider_block2__inside.find('img[data-src!=""]'); 360 $owlImages.each(function(index) { 361 var $this = jQuery(this), 362 attrSRC = $this.attr('src'); 363 if (attrSRC && attrSRC.match(/data:/)) { 364 $this.attr('src', $this.data('src')); 365 } 366 }); 367 368 slider_block2__inside.owlCarousel({ 369 items: 1, 370 loop: false, 371 margin: 0, 372 autoplay: false, 373 autoplayTimeout: 7000, 374 autoplayHoverPause: true, 375 nav: true, 376 lazyLoad:true, 377 navText: ["<div class='go_to_prev'><div class='icon'></div></div>","<div class='go_to_next'><div class='icon'></div></div>"] 378 }); 379 }, 0); 380 } 381 382 // пÑовеÑÑем нÑжно ли показÑваÑÑ ÑÑÐ°Ð·Ñ Ð³Ð°Ð»ÐµÑÐµÑ Ð² завиÑимоÑÑи Ð¾Ñ Ñ ÐµÑа 383 var hash = window.location.hash; 384 if (hash.length > 1) { 385 hash = hash.replace("#", ""); 386 hash = hash.split("="); 387 if (hash[0] == "show-photo") { 388 jQuery('.big_photo__img__full_screen').trigger("click");
389 show_gallery(Number(hash[1]) + 1); 390 } 391 } 392 // if (typeof started_viewsUpdater == "undefined" || started_viewsUpdater == 0) viewsUpdater(); 393 }); 394 395 jQuery(window).on("scroll", function() { 396 });
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.