1;"use strict"; 2 3function replaceOriginalAdFoxMethods(){ 4 5 if ( window.Ya && window.Ya.adfoxCode ){ 6 window.Ya.adfoxCode._create = window.Ya.adfoxCode.create; 7 window.Ya.adfoxCode._createScroll = window.Ya.adfoxCode.createScroll; 8 window.Ya.adfoxCode._createAdaptive = window.Ya.adfoxCode.createAdaptive; 9 } else { 10 window.Ya = { 11 adfoxCode: { 12 _create : function(){}, 13 _createScroll : function(){}, 14 _createAdaptive : function(){} 15 } 16 } 17 } 18 19 window.Ya.adfoxCode.create = function( options ) { 20 options = AdFoxCallbackCheck( options ); 21 window.Ya.adfoxCode._create( options ); 22 }; 23 24 window.Ya.adfoxCode.createScroll = function( options, states, a_options ) { 25 options = AdFoxCallbackCheck( options, states, a_options ); 26 if ( states || a_options ){ 27 window.Ya.adfoxCode._createScroll( options, states, a_options ); 28 } else { 29 window.Ya.adfoxCode._createScroll( options ); 30 } 31 }; 32 33 window.Ya.adfoxCode.createAdaptive = function( options, states, a_options ) { 34 options = AdFoxCallbackCheck( options, states, a_options ); 35 if ( a_options ){ 36 window.Ya.adfoxCode._createAdaptive( options, states, a_options ); 37 } else { 38 window.Ya.adfoxCode._createAdaptive( options, states ); 39 } 40 }; 41 42 function AdFoxCallbackCheck( options, states, a_options ){ 43 var onLoad = typeof options.onLoad === 'function' ? options.onLoad : AdFoxOnLoad; 44 var onRender = typeof options.onRender === 'function' ? options.onRender : AdFoxOnRender; 45 var onError = typeof options.onError === 'function' ? options.onError : AdFoxOnError; 46 var onStub = typeof options.onStub === 'function' ? options.onStub : AdFoxOnStub; 47 options.onLoad = function( data ){ onLoad( data, options ); }; 48 options.onRender = function(){ onRender( options ); }; 49 if ( states || a_options ){ 50 options.onError = function( error ){ onError( error, options, states, a_options ); }; 51 } else { 52 options.onError = function( error ){ onError( error, options ); }; 53 } 54 options.onStub = function(){ onStub( options ); }; 55 return options; 56 } 57 58 function AdFoxOnLoad( data, options ){ 59 console.log( 'adfx onLoad ' + options.containerId + ' - ' + data.bundleName ); 60 } 61 62 function AdFoxOnRender( options ){ 63 console.log( 'adfx onRender ' + options.containerId + ' ACTIVE ADDED' ); 64 $( '#' + options.containerId + '' ).parents( '.banner:first' ).addClass( 'm-active' ); 65 $( window ).scroll().resize(); 66 } 67 68 function AdFoxOnError( error, options, states, a_options ){ 69 if ( states || a_options ){ 70 console.log( 'adfx onError ' + options.containerId, error, options, states, a_options ); 71 } else { 72 console.log( 'adfx onError ' + options.containerId, error, options ); 73 } 74 } 75 76 function AdFoxOnStub( options ){ 77 var $bBanners = $( '#' + options.containerId + '' ).parents( '.banner:first' ); 78 var $bSlot = $( '#' + options.containerId + '' ).closest('[data-type="banner"]'); 79 80 if ( $bBanners.hasClass( 'm-not-stub' ) ){ 81 console.log( 'adfx onStub ' + options.containerId ); 82 } else { 83 $bBanners.removeClass( 'm-active' ).addClass( 'm-stub-removed' ); 84 console.log( 'adfx onStub ' + options.containerId + ' ACTIVE REMOVED' ); 85 86 if(Boolean($bSlot.data('hide-not-load'))){ 87 $bSlot.addClass('m-hidden'); 88 } 89 } 90 } 91 92 93} 94 95 96
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.