1var cacheJq={}; 2 3$.fn.oneAnimationEnd=function(fn){ 4 this.one('animationend webkitanimationend', fn); 5 if (!Modernizr.csstransitions) this.trigger('animationend'); 6 return this 7} 8 9$.fn.oneTransEnd=function(fn, prop){ 10 //"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd" 11 var trans=Modernizr.csstransitions; 12 //console.log(typeof prop); 13 return trans ? this.on('webkittransitionend transitionend', function fu(e){ 14 if ((prop && e.originalEvent.propertyName.replace(/-webkit-|-moz-|-ms-/, '')!=prop) || e.target!=this) return; 15 //console.log(e.originalEvent.propertyName, prop, e.target); 16 $(this).off('webkittransitionend transitionend', fu) 17 fn.call(this, e) 18 }) : this.each(fn); 19 return this 20} 21 22$.event.fixHooks.mousewheel=$.event.fixHooks.wheel={ 23 filter:function(e, oe){ 24 e.deltaY=oe.deltaY||-oe.wheelDeltaY; 25 if (e.deltaY===undefined) e.deltaY=-oe.wheelDelta||0; 26 e.deltaX=oe.deltaX||-oe.wheelDeltaX||0; 27 e.deltaZ=oe.deltaZ||0; 28 e.deltaMode=oe.deltaMode||0; 29 e.toPx=function(el){ 30 if (e.deltaMode===1) {e.deltaY*=40; e.deltaX*=40; e.deltaZ*=40}; 31 if (e.deltaMode==2) { 32 e.deltaY*=$(el||this).innerHeight(); 33 e.deltaX*=$(el||this).innerWidth(); 34 }; 35 } 36 return e 37 } 38}; 39 40if (!window.WheelEvent) $.extend($.event.special, { 41 wheel: {delegateType: 'mousewheel', bindType: 'mousewheel'}, 42 //mousewheel: {preDispatch: function(e) {e.type='wheel'}} 43}); 44 45$.fn.wheel=function(data, fn) { 46 return arguments.length? this.on('wheel', null, data, fn):this.trigger('wheel'); 47} 48 49var isDisableSmoothScroll=false; 50function smooth_scroll(e) { 51 if (isDisableSmoothScroll) return; 52 if (e.ctrlKey) return; 53 e.preventDefault(); 54 55 var targ=$(e.target), l, t, x, y, to={}, data={}, isB, dur=0, scale=window.devicePixelRatio||1; 56 if (!targ.parent()[0].tagName) targ=$('body'); 57 while (targ[0]!=$('html')[0]) { 58 x=/scroll|auto/.test(targ.css('overflow-x')); 59 y=/scroll|auto/.test(targ.css('overflow-y')); 60 if (x||y||(isB=x=y=targ.is('body:not(.themodal-lock)'))) { 61 l=(targ.data('left0')||(isB?$win:targ).scrollLeft()); 62 t=(targ.data('top0')||(isB?$win:targ).scrollTop()); 63 x=x&&e.deltaX&&(e.deltaX<0?l>0:(l+(isB?$win.width():targ[0].clientWidth)<targ[0].scrollWidth)); 64 y=y&&e.deltaY&&(e.deltaY<0?t>0:(t+(isB?$win.height():targ[0].clientHeight)<targ[0].scrollHeight)); 65 if (x||y) break; 66 } 67 targ=targ.parent(); 68 } 69 if (targ[0]==$('html')[0]) return; 70 if (x) { 71 to.scrollLeft=data.left0=l+=Math.round(e.deltaX/scale); 72 dur=Math.abs(l-targ.scrollLeft())*2.5 73 }; 74 if (y) { 75 to.scrollTop=data.top0=t+=Math.round(e.deltaY/scale); 76 dur=Math.max(dur, (Math.abs(t-targ.scrollTop())*2.5)) 77 }; 78 if (isB) targ=$('body, html'); 79 if (dur<200)dur=200; 80 targ.data(data).stop() 81 .animate(to, Math.min(400, dur), 'easeOutQuad', function(){targ.data({top0: 0, left0: 0})}); 82} 83 84function getLoader(cl,isHide,isWhite,notCache){ 85 cl=cl||'';notCache=notCache||0; 86 isHide&&cl+' hidden'; 87 var $loader=$('#css_loader').clone().addClass(cl).removeAttr('id'); 88 isWhite&&$loader.find('.spinner').addClass('spinnerw'); 89 var key='loader_'+cl; 90 if(!notCache)cacheJq[key]=$loader; 91 return $loader; 92} 93 94var $jq = getCacheJq = function(sel,context){ 95 context=context||false; 96 var key=sel; 97 if(context!==false){ 98 key=sel+'_'+context; 99 } 100 if(typeof cacheJq[key] == 'undefined' || !cacheJq[key][0]){ 101 if(context){ 102 cacheJq[key]=$(sel,context); 103 }else{ 104 cacheJq[key]=$(sel); 105 } 106 } 107 return cacheJq[key]; 108} 109 110function selectText(el){ 111 el.focus(); 112 var range = document.createRange(); 113 range.selectNodeContents(el); 114 var selection = window.getSelection(); 115 selection.removeAllRanges(); 116 selection.addRange(range); 117} 118 119$.fn.addLoader = function(){ 120 var $btn=$(this); 121 if($btn.is('.color_t')||$btn.is('.color_fade'))return; 122 var clLoader=$btn.data('clLoader'); 123 if(!clLoader)clLoader='btn_action_loader'; 124 var typeLoader=$btn.data('typeLoader'); 125 if(typeLoader=='fade_btn'){ 126 $btn.addClass('color_fade').append(getLoader(clLoader,true,true).delay(1).removeClass('hidden',0)
126); 127 if($btn.data('clChildren')){ 128 $btn.find($btn.data('clChildren')).siblings(':not(.css_loader)').stop().fadeTo(200,0); 129 }else{ 130 $btn.children('button, .frame').stop().fadeTo(200,.5); 131 $btn.children(':not(.css_loader)').not('button, .frame').stop().fadeTo(200,0); 132 } 133 }else{ 134 $btn.addClass('color_t').append(getLoader(clLoader,false,true)); 135 } 136 return $btn; 137} 138 139$.fn.removeLoader = function(){ 140 var $btn=$(this); 141 if($btn.is('.color_t')||$btn.is('.color_fade')){ 142 if($btn.is('.color_fade')){ 143 if($btn.data('clChildren')){ 144 $btn.find($btn.data('clChildren')).siblings().stop().fadeTo(200,1,function(){ 145 $btn.find('.css_loader').remove(); 146 $btn.removeClass('color_fade'); 147 }) 148 }else{ 149 $btn.children(':not(.css_loader)').stop().fadeTo(200,1,function(){ 150 $btn.find('.css_loader').remove(); 151 $btn.removeClass('color_fade'); 152 }) 153 } 154 $btn.find('.css_loader').oneTransEnd(function(){ 155 $(this).remove(); 156 }).addClass('hidden'); 157 }else{ 158 $btn.find('.css_loader').remove(); 159 $btn.removeClass('color_t'); 160 } 161 } 162 return $btn; 163}
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.