1/* ÐобилÑное Ð¼ÐµÐ½Ñ */ 2var slideout; 3 4function mobileMenuInit(){ 5 /* panels - ÑлеменÑÑ, коÑоÑÑе бÑдÑÑ ÑеагиÑоваÑÑ Ð½Ð° touch ÑобÑÑÐ¸Ñ */ 6 var panels = []; 7 $('.wrap, .wrap-console, .header-wrap, .mobile-menu-overlay').each(function(i, v){panels.push(v);}); 8 9 slideout = new Slideout({ 10 'menu': $('.wrap-sidebar-mobile')[0], 11 'menuOverlay': $('.mobile-menu-overlay')[0], 12 'panels': panels, 13 'maxResolution': 760 14 }); 15} 16 17function showMobileMenu() { 18 slideout.open(); 19} 20 21function hideMobileMenu() { 22 slideout.close(); 23} 24 25function toggleUserMenu() { 26 $('.sidebar .user-menu').fadeToggle(); 27 $('.mobile-user-chevron').toggleClass('is-active'); 28} 29function showUserMenu() { 30 $('.sidebar .user-menu').show(); 31 $('.mobile-user-chevron').addClass('is-active'); 32} 33function hideUserMenu() { 34 $('.sidebar .user-menu').hide(); 35 $('.mobile-user-chevron').removeClass('is-active'); 36} 37 38function sharePopupInit() { 39 $('.tail-share').magnificPopup({ 40 type: 'inline', 41 midClick: true, 42 callbacks: { 43 open: function () { 44 }, 45 close: function () { 46 $('.tail-to-share').removeClass('tail-to-share'); 47 } 48 } 49 }); 50} 51 52function initMfpVideo() { 53 $('.mfp-video').magnificPopup({ 54 type: 'iframe'}); 55} 56 57function layoutHeaderInit() { 58 59} 60 61$(document) 62 .on('click', '.share-button-vk', function(){ 63 var share = $(this).parent(); 64 Share.vkontakte(share.data('url'),share.data('title'),share.data('image'),share.data('desc')) 65 }) 66 .on('click', '.share-button-fb', function(){ 67 var share = $(this).parent(); 68 Share.facebook(share.data('url'),share.data('title'),share.data('image'),share.data('desc')) 69 }) 70 .on('click', '.tail-share', function(){ 71 $(this).parent().children('div').first().addClass('tail-to-share'); 72 var shareData = JSON.parse(Base64.decode($('.tail-to-share').data('share'))); 73 var shareMenu = $('.share-menu'); 74 if (shareData.isFavModel) { 75 shareMenu.addClass('is-fav-model'); 76 } else { 77 shareMenu.removeClass('is-fav-model'); 78 } 79 }) 80 .on('click', '.share-menu-overlay', function(){ 81 $('.tail-to-share').removeClass('tail-to-share'); 82 }) 83 .on('click', '.share-menu-vk', function(){ 84 var jsonString = atob($('.tail-to-share').first().data('share')); 85 var shareData = JSON.parse(jsonString); 86 Share.vkontakte(shareData.url,shareData.title,shareData.image,shareData.desc); 87 setTimeout(function () {$.magnificPopup.instance.close();}, 1000); 88 }) 89 .on('click', '.share-menu-fb', function(){ 90 var shareData = JSON.parse(atob($('.tail-to-share').first().data('share'))); 91 Share.facebook(shareData.url,shareData.title,shareData.image,shareData.desc); 92 setTimeout(function () {$.magnificPopup.instance.close();}, 1000); 93 }) 94 .on('click', '.share-button-fav', function(){ 95 /* ÐобавиÑÑ Ð² избÑанное на ÑÑÑаниÑе маÑеÑиала */ 96 var url = '/user/user-fav'; 97 var block = $(this).parents('div').filter("[data-class]"); 98 var shareContainer = $(this).parent(); 99 if (block.length > 0) { 100 var params = { 101 'model[class]': block.data('class'), 102 'model[id]': block.data('id') 103 }; 104 $.post(url, params) 105 .done(function(){ 106 shareContainer.addClass('is-fav-model'); 107 }); 108 } 109 }) 110 .on('click', '.share-button-fav-remove', function(){ 111 /* УдалиÑÑ Ð¸Ð· избÑанного на ÑÑÑаниÑе маÑеÑиала */ 112 var url = '/user/user-fav-remove'; 113 var block = $(this).parents('div').filter("[data-class]"); 114 var shareContainer = $(this).parent(); 115 if (block.length > 0) { 116 var params = { 117 'model[class]': block.data('class'), 118 'model[id]': block.data('id') 119 }; 120 $.post(url, params) 121 .done(function(){ 122 shareContainer.removeClass('is-fav-model'); 123 }); 124 } 125 }) 126 .on('click', '.share-menu-fav', function(){ 127 /* ÐобавиÑÑ Ð² избÑанное на ÑÑÑаниÑе маÑеÑиала */ 128 var url = '/user/user-fav'; 129 var dataObj = $('.tail-to-share'); 130 var shareData = JSON.parse(Base64.decode(dataObj.data('share'))); 131 // var shareContainer = $(this).parent(); 132 if (shareData) { 133 var params = { 134 'model[class]': shareData.class, 135 'model[id]': shareData.id 136 }; 137 $.post(url, params) 138 .done(function(){ 139 shareData.isFavModel = true; 140 dataObj.data('share', Base64.encode(JSON.stringify(shareData))); 141 $.magnificPopup.instance.close(); 142 }); 143 } 144 return false;
145 }) 146 .on('click', '.share-menu-fav-remove', function(){ 147 /* УдалиÑÑ Ð¸Ð· избÑанного на ÑÑÑаниÑе маÑеÑиала */ 148 var url = '/user/user-fav-remove'; 149 var dataObj = $('.tail-to-share'); 150 var shareData = JSON.parse(Base64.decode(dataObj.data('share'))); 151 var shareContainer = $(this).parent(); 152 if (shareData) { 153 var params = { 154 'model[class]': shareData.class, 155 'model[id]': shareData.id 156 }; 157 $.post(url, params) 158 .done(function(){ 159 shareData.isFavModel = false; 160 dataObj.data('share', Base64.encode(JSON.stringify(shareData))); 161 shareContainer.removeClass('is-fav-model'); 162 var tail = $('.tail-to-share'); 163 var tailsList = tail.parents('.tails-list.fav-list'); 164 $.magnificPopup.instance.close(); 165 if (tailsList.length > 0 && !tail.hasClass('favorite')) { 166 tail.parents('.item').fadeOut(500, function(){ 167 // console.log($(this)); 168 $(this).remove(); 169 var msnr = $('#msnr'); 170 msnr.masonry('reloadItems'); 171 msnr.imagesLoaded(function(){ msnr.masonry() }); 172 }); 173 } 174 }); 175 } 176 }) 177 .on('scroll', scrollHeader2) 178 .on('click', 'a.index-seometa, a.noindex-seometa', function (e) { 179 e.stopImmediatePropagation(); 180 var link = $(this); 181 if (confirm(link.attr('data-confirm')+'??')) { 182 var url = link.attr('href'); 183 $.post(url) 184 .done(function (response) { 185 if (response) { 186 var containerId = $('div[data-pjax-container]').attr('id'); 187 $.pjax.reload({container: "#" + containerId}); 188 } 189 }) 190 .fail(function () { 191 }); 192 } 193 return false; 194 }) 195 .on('click', '.wrap-console-sidebar .menu > ul > li.idle > i, .wrap-console-sidebar .menu > ul > li.idle > span', function () { 196 var li = $(this).parent(); 197 li.toggleClass('in').siblings('li.idle').removeClass('in'); 198 }) 199 .on('click', 'a.delete-seometa', function () { 200 var link = $(this); 201 if (confirm(link.attr('data-confirm-text'))) { 202 var url = link.attr('href'); 203 $.post(url) 204 .done(function (response) { 205 if (response) { 206 location.reload(); 207 } 208 209 return false; 210 }) 211 .fail(function () { 212 }); 213 } 214 215 return false; 216 }) 217 .on('click', '.info-more', function () { 218 $(this).hide().parent().css('max-height', 'unset'); 219 }); 220$(window).on('resize', scrollHeader2); 221 222var mobileHeaderTitle = $('.header-title'); 223if (mobileHeaderTitle.text().length > 15) { 224 mobileHeaderTitle.addClass('long-title'); 225 $('.header-row').addClass('long-title'); 226} 227 228$(function() { 229 function headerHeight() { 230 var headerTabs = $('.header-tabs'); 231 var headerHowHelp = $('.header-how-help'); 232 if (!headerTabs.find('*').is('*') && !headerHowHelp.is(':visible')) { 233 headerTabs.hide(); 234 $('.wrap').css('padding-top', '75px'); 235 } 236 if (!headerTabs.find('*').is('*') && headerHowHelp.is(':visible')) { 237 headerTabs.show(); 238 $('.wrap').css('padding-top', ''); 239 } 240 } 241 242 layoutHeaderInit(); 243 // setTimeout(function() {mobileMenuInit();}, 100); 244 layoutHeader(); 245 mobileMenuInit(); 246 sharePopupInit(); 247 initMfpVideo(); 248}); 249 250function scrollHeader2() { 251 var header = $('.header-main'), 252 headerHeight = header.outerHeight() - 14, 253 headerTabsRow = $('.header-tabs-row'), 254 headerTabsRowHeight = headerTabsRow.outerHeight(), 255 contentWrap = $('.wrap'), 256 sidebarWrap = $('.wrap-sidebar:not(.wrap-sidebar-mobile)'), 257 scrolled = window.pageYOffset; 258 if (headerTabsRow.length == 0) { 259 return true; 260 } 261 262 if (typeof sidebarWrapInitTop == 'undefined') { 263 sidebarWrapInitTop = sidebarWrap.position().top; 264 } 265 266 if (scrolled > 0 && scrolled < headerHeight) { 267 headerTabsRow.addClass('float'); 268 headerTabsRow.removeClass('fixed'); 269 header.css({'z-index': '-1'}); 270 contentWrap.css({'padding-top': 0}); 271 sidebarWrap.css({'top': sidebarWrapInitTop - scrolled}); 272 } else if(scrolled >= headerHeight) { 273 header.css({'z-index': '-1'}); 274 headerTabsRow.addClass('fixed'); 275 contentWrap.css({'padding-top': headerHeight + headerTabsRowHeight + 10}); 276 sidebarWrap.css({'top': sidebarWrapInitTop - headerHeight}); 277 } else { 278 headerTabsRow.removeClass('float fixed'); 279 header.css({'z-index': '3'}); 280 contentWrap.css({'padding-top': 0}); 281 sidebarWrap.css({'top': sidebarWrapInitTop}); 282 } 283 284} 285 286function seoUpdate(event, state) { 287 var input = $(event.target), 288 url = input.attr('data-url'), 289 field = input.attr('name'), 290 data = {}; 291 data[field] = (state ? 1 : 0); 292 $.post(url, data) 293 .done(function (response) {}) 294 .fail(function (error) { 295 console.log(error.responseText); 296 input.bootstrapSwitch('toggleState', true); 297 }); 298} 299 300 301function imageUpdate2(event, state) { 302 var input = $(event.target), 303 url = input.attr('data-url'), 304 id = input.attr('data-id'), 305 attribute = input.attr('data-attribute'), 306 field = input.attr('name'), 307 data = {hasEditable: 1, editableIndex: id, editableKey: id, editableAttribute: attribute}; 308 data[field] = (state ? 1 : 0); 309 $.post(url, data) 310 .done(function (response) { 311 // reloadPjax(); 312 location.reload(); 313 }) 314 .fail(function (error) { 315 console.log(error.responseText); 316 input.bootstrapSwitch('toggleState', true); 317 }); 318} 319 320function reloadPjax(containerId) { 321 if (containerId === undefined) { 322 containerId = $('div[data-pjax-container]').attr('id'); 323 } 324 325 $.pjax.reload({container: '#' + containerId}); 326} 327 328function layoutHeader() { 329 var mobileSideBar = $('.wrap-sidebar').clone().appendTo('body').addClass('wrap-sidebar-mobile'); 330 var userMenu = $('.header-user-menu').clone().prependTo(mobileSideBar.find('.sidebar')); 331 var menuHeader = userMenu.find('.user-menu ul li').first(); 332 var userLabel = $('<div class="user-label"><span></span><i class="fa fa-chevron-down mobile-user-chevron"></i></div>').insertAfter(userMenu.find('.user-image')); 333 userLabel.find('span').text(menuHeader.text()); 334 userMenu.find('.user-menu li a').last().text('ÐÑÑ Ð¾Ð´'); 335 menuHeader.remove(); 336 hideUserMenu(); 337 $('.header-menu-button').click(function () { 338 if ($(this).find('i.fa-arrow-left').length > 0) { 339 showUserMenu(); 340 } 341 showMobileMenu(); 342 }); 343 $('.mobile-menu-overlay').click(function () { 344 hideMobileMenu(); 345 }); 346 userMenu.find('.user-caret').remove(); 347 348 $('.mobile-menu-search').click(function () { 349 hideMobileMenu(); 350 $('html, body').css({'overflow': 'hidden', 'height': '100%'}); 351 $('.site-search .site-search-overlay') 352 .show() 353 .find('input') 354 .focus(); 355 }); 356 $('.site-search .site-search-overlay').click(function (e) { 357 if ($(e.target).hasClass('site-search-overlay')) { 358 $(this).find('form input').val(''); 359 $(this).hide(); 360 $('html, body').css({'overflow': 'auto', 'height': 'auto'}); 361 } 362 }); 363 $('.user-label').click(function () { 364 toggleUserMenu(); 365 }); 366 var searchPlaceholder = $('.header-search input').attr('placeholder'); 367 var searchPlaceholderShort = 'ÐоиÑк по маÑеÑиалам'; 368 $(window).resize(function () { 369 var headerSearchForm = $('.header-search'); 370 if (headerSearchForm.width() < 413) { 371 headerSearchForm.find('input').attr('placeholder', searchPlaceholderShort); 372 } else { 373 headerSearchForm.find('input').attr('placeholder', searchPlaceholder); 374 } 375 }); 376 $(window).trigger('resize'); 377}
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.