removing javascript out of the pageSetup and into template to mount on dev55 for...
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 7 Jun 2017 16:39:46 +0000 (12:39 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 7 Jun 2017 16:39:46 +0000 (12:39 -0400)
moving into the frontpage template

js/app.js
js/custom/pageSetup.js

index 4013c6a..53d4804 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -263,58 +263,57 @@ $(document).ready(function () {
 //        window.addEventListener('scroll', checkScroll, false);
 //        window.addEventListener('resize', checkScroll, false);
 //})
-    $.fn.isOnScreen = function(){
-
-        var win = $(window);
-
-        var viewport = {
-            top : win.scrollTop(),
-            left : win.scrollLeft()
-        };
-        viewport.right = viewport.left + win.width();
-        viewport.bottom = viewport.top + win.height();
-
-        var bounds = this.offset();
-        bounds.right = bounds.left + this.outerWidth();
-        bounds.bottom = bounds.top + this.outerHeight();
-
-        return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
-
-    };
-    $(window).on("load", function(){
-        var video_visible = $("#wp-custom-header").isOnScreen();
-        var clicked = false;
-        var paused;
-
-        if(!video_visible){
-            $("#wp-custom-header-video-button").trigger('click');
-            paused = true;
-            console.log("PAUSED");
-        } else {
-            paused = false;
-            console.log('PLAYING');
-        }
-
-        $(window).on("scroll", function(){
-            console.log(clicked, paused, video_visible);
-            
-            video_visible = $("#wp-custom-header").isOnScreen();
-            
-            if(video_visible && clicked === false && paused === true){
-                $("#wp-custom-header-video-button").trigger('click');
-                clicked = true;
-                paused = false;
-                console.log('PLAY');
-            }
-            else if(!video_visible && paused === false ){
-                paused = true;
-                 $("#wp-custom-header-video-button").trigger('click');
-                clicked = false;
-                console.log( "PAUSE");
-            } else {
-                console.log("Nothing is happening");
-            }
-        })
-    });
-
+//    $.fn.isOnScreen = function(){
+//
+//        var win = $(window);
+//
+//        var viewport = {
+//            top : win.scrollTop(),
+//            left : win.scrollLeft()
+//        };
+//        viewport.right = viewport.left + win.width();
+//        viewport.bottom = viewport.top + win.height();
+//
+//        var bounds = this.offset();
+//        bounds.right = bounds.left + this.outerWidth();
+//        bounds.bottom = bounds.top + this.outerHeight();
+//
+//        return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
+//
+//    };
+//    $(window).on("load", function(){
+//        var video_visible = $("#wp-custom-header").isOnScreen();
+//        var clicked = false;
+//        var paused;
+//
+//        if(!video_visible){
+//            $("#wp-custom-header-video-button").trigger('click');
+//            paused = true;
+//            console.log("PAUSED");
+//        } else {
+//            paused = false;
+//            console.log('PLAYING');
+//        }
+//
+//        $(window).on("scroll", function(){
+//            console.log(clicked, paused, video_visible);
+//            
+//            video_visible = $("#wp-custom-header").isOnScreen();
+//            
+//            if(video_visible && clicked === false && paused === true){
+//                $("#wp-custom-header-video-button").trigger('click');
+//                clicked = true;
+//                paused = false;
+//                console.log('PLAY');
+//            }
+//            else if(!video_visible && paused === false ){
+//                paused = true;
+//                 $("#wp-custom-header-video-button").trigger('click');
+//                clicked = false;
+//                console.log( "PAUSE");
+//            } else {
+//                console.log("Nothing is happening");
+//            }
+//        })
+//    });
 });
index 5b56d99..a04e61a 100644 (file)
@@ -60,58 +60,57 @@ $(document).ready(function () {
 //        window.addEventListener('scroll', checkScroll, false);
 //        window.addEventListener('resize', checkScroll, false);
 //})
-    $.fn.isOnScreen = function(){
-
-        var win = $(window);
-
-        var viewport = {
-            top : win.scrollTop(),
-            left : win.scrollLeft()
-        };
-        viewport.right = viewport.left + win.width();
-        viewport.bottom = viewport.top + win.height();
-
-        var bounds = this.offset();
-        bounds.right = bounds.left + this.outerWidth();
-        bounds.bottom = bounds.top + this.outerHeight();
-
-        return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
-
-    };
-    $(window).on("load", function(){
-        var video_visible = $("#wp-custom-header").isOnScreen();
-        var clicked = false;
-        var paused;
-
-        if(!video_visible){
-            $("#wp-custom-header-video-button").trigger('click');
-            paused = true;
-            console.log("PAUSED");
-        } else {
-            paused = false;
-            console.log('PLAYING');
-        }
-
-        $(window).on("scroll", function(){
-            console.log(clicked, paused, video_visible);
-            
-            video_visible = $("#wp-custom-header").isOnScreen();
-            
-            if(video_visible && clicked === false && paused === true){
-                $("#wp-custom-header-video-button").trigger('click');
-                clicked = true;
-                paused = false;
-                console.log('PLAY');
-            }
-            else if(!video_visible && paused === false ){
-                paused = true;
-                 $("#wp-custom-header-video-button").trigger('click');
-                clicked = false;
-                console.log( "PAUSE");
-            } else {
-                console.log("Nothing is happening");
-            }
-        })
-    });
-
+//    $.fn.isOnScreen = function(){
+//
+//        var win = $(window);
+//
+//        var viewport = {
+//            top : win.scrollTop(),
+//            left : win.scrollLeft()
+//        };
+//        viewport.right = viewport.left + win.width();
+//        viewport.bottom = viewport.top + win.height();
+//
+//        var bounds = this.offset();
+//        bounds.right = bounds.left + this.outerWidth();
+//        bounds.bottom = bounds.top + this.outerHeight();
+//
+//        return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
+//
+//    };
+//    $(window).on("load", function(){
+//        var video_visible = $("#wp-custom-header").isOnScreen();
+//        var clicked = false;
+//        var paused;
+//
+//        if(!video_visible){
+//            $("#wp-custom-header-video-button").trigger('click');
+//            paused = true;
+//            console.log("PAUSED");
+//        } else {
+//            paused = false;
+//            console.log('PLAYING');
+//        }
+//
+//        $(window).on("scroll", function(){
+//            console.log(clicked, paused, video_visible);
+//            
+//            video_visible = $("#wp-custom-header").isOnScreen();
+//            
+//            if(video_visible && clicked === false && paused === true){
+//                $("#wp-custom-header-video-button").trigger('click');
+//                clicked = true;
+//                paused = false;
+//                console.log('PLAY');
+//            }
+//            else if(!video_visible && paused === false ){
+//                paused = true;
+//                 $("#wp-custom-header-video-button").trigger('click');
+//                clicked = false;
+//                console.log( "PAUSE");
+//            } else {
+//                console.log("Nothing is happening");
+//            }
+//        })
+//    });
 });