1"use strict"; var $ = jQuery; 2module.exports = function(script){ 3 var me = this; 4 var tools = require('../tools/tools.js'); 5 var ScrollAnimation = require('../app/scroll-animation.js'); 6 var $window = $(window); 7 var isPoorBrowser = $('html').hasClass('poor-browser'); 8 var scrollAnimation = new ScrollAnimation(me, script); 9 this.windowTopPos = undefined; 10 this.windowBottomPos = undefined; 11 this.windowH = undefined; 12 this.scroll = function(windowTopP){ 13 me.windowH = $window.height(); 14 me.windowTopPos = windowTopP 15 me.windowBottomPos = windowTopP+me.windowH; 16 if(me.windowTopPos < script.topNav.state1Top()){ 17 script.topNav.state1(); 18 }else{ 19 script.topNav.state2(); 20 } 21 scrollAnimation.scroll() 22 for(var i=0; i<script.players.length; i++){ 23 var viewPos = me.calcPosition(script.players[i].$view); 24 if(viewPos.visible){ 25 script.players[i].play(); 26 }else{ 27 script.players[i].pause(); 28 } 29 } 30 } 31 this.calcPosition = function ($block){ 32 var blockH = $block.height(); 33 var blockTopPos = $block.data('position'); 34 var blockBottomPos = blockTopPos + blockH; 35 return { 36 top: blockTopPos, 37 bottom: blockBottomPos, 38 height: blockH, 39 visible: blockTopPos<me.windowBottomPos && blockBottomPos>me.windowTopPos 40 }; 41 } 42};
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.