1(function(a){if(typeof define!=="undefined"&&define.amd){define([],a)}else{if(typeof module!=="undefined"&&module.exports){module.exports=a()}else{window.scrollMonitor=a()}}})(function(){var c=function(){return window.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||document.body.scrollTop};var G={};var k=[];var E="visibilityChange";var B="enterViewport";var z="fullyEnterViewport";var o="exitViewport";var l="partiallyExitViewport";var w="locationChange";var n="stateChange";var p=[E,B,z,o,l,w,n];var F={top:0,bottom:0};var y=function(){return window.innerHeight||document.documentElement.clientHeight};var a=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.documentElement.clientHeight)};G.viewportTop=null;G.viewportBottom=null;G.documentHeight=null;G.viewportHeight=y();var v;var s;var b;function t(){G.viewportTop=c();G.viewportBottom=G.viewportTop+G.viewportHeight;G.documentHeight=a();if(G.documentHeight!==v){b=k.length;while(b--){k[b].recalculateLocation()}v=G.documentHeight}}function r(){G.viewportHeight=y();t();q()}var d;function u(){clearTimeout(d);d=setTimeout(r,100)}var h;function q(){h=k.length;while(h--){k[h].update()}h=k.length;while(h--){k[h].triggerCallbacks()}}function m(P,I){var S=this;this.watchItem=P;if(!I){this.offsets=F}else{if(I===+I){this.offsets={top:I,bottom:I}}else{this.offsets={top:I.top||F.top,bottom:I.bottom||F.bottom}}}this.callbacks={};for(var N=0,M=p.length;N<M;N++){S.callbacks[p[N]]=[]}this.locked=false;var L;var Q;var R;var O;var H;var e;function K(i){if(i.length===0){return}H=i.length;while(H--){e=i[H];e.callback.call(S,s);if(e.isOne){i.splice(H,1)}}}this.triggerCallbacks=function J(){if(this.isInViewport&&!L){K(this.callbacks[B])}if(this.isFullyInViewport&&!Q){K(this.callbacks[z])}if(this.isAboveViewport!==R&&this.isBelowViewport!==O){K(this.callbacks[E]);if(!Q&&!this.isFullyInViewport){K(this.callbacks[z]);K(this.callbacks[l])}if(!L&&!this.isInViewport){K(this.callbacks[B]);K(this.callbacks[o])}}if(!this.isFullyInViewport&&Q){K(this.callbacks[l])}if(!this.isInViewport&&L){K(this.callbacks[o])}if(this.isInViewport!==L){K(this.callbacks[E])}switch(true){case L!==this.isInViewport:case Q!==this.isFullyInViewport:case R!==this.isAboveViewport:case O!==this.isBelowViewport:K(this.callbacks[n])}L=this.isInViewport;Q=this.isFullyInViewport;R=this.isAboveViewport;O=this.isBelowViewport};this.recalculateLocation=function(){if(this.locked){return}var U=this.top;var T=this.bottom;if(this.watchItem.nodeName){var j=this.watchItem.style.display;if(j==="none"){this.watchItem.style.display=""}var i=this.watchItem.getBoundingClientRect();this.top=i.top+G.viewportTop;this.bottom=i.bottom+G.viewportTop;if(j==="none"){this.watchItem.style.display=j}}else{if(this.watchItem===+this.watchItem){if(this.watchItem>0){this.top=this.bottom=this.watchItem}else{this.top=this.bottom=G.documentHeight-this.watchItem}}else{this.top=this.watchItem.top;this.bottom=this.watchItem.bottom}}this.top-=this.offsets.top;this.bottom+=this.offsets.bottom;this.height=this.bottom-this.top;if((U!==undefined||T!==undefined)&&(this.top!==U||this.bottom!==T)){K(this.callbacks[w])}};this.recalculateLocation();this.update();L=this.isInViewport;Q=this.isFullyInViewport;R=this.isAboveViewport;O=this.isBelowViewport}m.prototype={on:function(e,j,i){switch(true){case e===E&&!this.isInViewport&&this.isAboveViewport:case e===B&&this.isInViewport:case e===z&&this.isFullyInViewport:case e===o&&this.isAboveViewport&&!this.isInViewport:case e===l&&this.isAboveViewport:j.call(this,s);if(i){return}}if(this.callbacks[e]){this.callbacks[e].push({callback:j,isOne:i||false})}else{throw new Error("Tried to add a scroll monitor listener of type "+e+". Your options are: "+p.join(", "))}},off:function(H,I){if(this.callbacks[H]){for(var e=0,j;j=this.callbacks[H][e];e++){if(j.callback===I){this.callbacks[H].splice(e,1);break}}}else{throw new Error("Tried to remove a scroll monitor listener of type "+H+". Your options are: "+p.join(", "))}},one:function(e,i){this.on(e,i,true)},recalculateSize:function(){this.height=this.watchItem.offsetHeight+this.offsets.top+this.offsets.bottom;this.bottom=this.top+this.height},update:function(){this.isAboveViewport=this.top<G.viewportTop;this.isBelowViewport=this.bottom>G.viewportBottom;this.isInViewport=(this.top<=G.viewportBottom&&this.bottom>=G.viewportTop);this.isFullyInViewport=(this.top>=G.viewportTop&&this.bottom<=G.viewportBottom)||(this.isAboveViewport&&this.isBelowViewport)},destroy:function(){var I=k.indexOf(this),e=this;k.splice(I,1);for(var J=0,H=p.length;J<H;J++){e.callbacks[p[J]].length=0}},lock:function(){this.locked=true},unlock:function(){this.locked=false}};var g=function(e){return function(j,i){this.on.call(this,e,j,i)}};for(var C=0,A=p.length;C<A;C++){var f=p[C];m.prototype[f]=g(f)}try{t()}catch(D){try{window.$(t)}catch(D){throw new Error("If you must put scrollMonitor in the <head>, you must use jQuery.") 2}}function x(e){s=e;t();q()}if(window.addEventListener){window.addEventListener("scroll",x);window.addEventListener("resize",u)}else{window.attachEvent("onscroll",x);window.attachEvent("onresize",u)}
2G.beget=G.create=function(i,j){if(typeof i==="string"){i=document.querySelector(i)}else{if(i&&i.length>0){i=i[0]}}var e=new m(i,j);k.push(e);e.update();return e};G.update=function(){s=null;t();q()};G.recalculateLocations=function(){G.documentHeight=0;G.update()};return G}); 3 4// ²Ëµ¥ 5$(document).ready(function() { 6 var $account = $('#top-header'); 7 var $header = $('#menu-box, #main-search, #mobile-nav'); 8 var $minisb = $('#content'); 9 var $footer = $('#footer'); 10 11 var accountWatcher = scrollMonitor.create($account); 12 var headerWatcher = scrollMonitor.create($header); 13 14 var footerWatcherTop = $minisb.height() + $header.height(); 15 var footerWatcher = scrollMonitor.create($footer, { 16 top: footerWatcherTop 17 }); 18 19 accountWatcher.lock(); 20 headerWatcher.lock(); 21 22 accountWatcher.visibilityChange(function() { 23 $header.toggleClass('shadow', !accountWatcher.isInViewport); 24 }); 25 headerWatcher.visibilityChange(function() { 26 $minisb.toggleClass('shadow', !headerWatcher.isInViewport); 27 }); 28 29 footerWatcher.fullyEnterViewport(function() { 30 if (footerWatcher.isAboveViewport) { 31 $minisb.removeClass('shadow').addClass('hug-footer') 32 } 33 }); 34 footerWatcher.partiallyExitViewport(function() { 35 if (!footerWatcher.isAboveViewport) { 36 $minisb.addClass('fixed').removeClass('hug-footer') 37 } 38 }); 39}) 40 41// ¸úËæ 42$(document).ready(function() { 43 var $account = $('#sidebar'); 44 var $header = $('.sidebar-roll'); 45 var $minisb = $('#content'); 46 var $footer = $('#footer'); 47 48 var accountWatcher = scrollMonitor.create($account); 49 var headerWatcher = scrollMonitor.create($header); 50 51 var footerWatcherTop = $minisb.height() + $header.height(); 52 53 accountWatcher.lock(); 54 headerWatcher.lock(); 55 56 accountWatcher.visibilityChange(function() { 57 $header.toggleClass('follow', !accountWatcher.isInViewport); 58 }); 59}) 60 61// ¹ö¶¯Áбí 62$(document).ready(function(a) { 63 if (typeof scrollMonitor != 'undefined') { 64 a(".thumbnail, .content-image img, .single-content p img, #related-img img").each(function(i, el) { 65 var ael = a(el), 66 watcher = scrollMonitor.create(el, -100); 67 ael.addClass('box-hide'); 68 watcher.enterViewport(function(ev) { 69 if (!ael.hasClass('box-show')) { 70 ael.addClass('box-show'); 71 } 72 }); 73 }); 74 } 75})
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.