Update script for includes method call
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 19 Aug 2016 19:07:59 +0000 (15:07 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 19 Aug 2016 19:07:59 +0000 (15:07 -0400)
IE older version give an error. Using the indexOf method instead.

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

index 0456694..9123880 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -30,15 +30,15 @@ $(document).ready(function () {
         //console.log('ul = ' + menuImg);
         //console.log('menu-id = ' + menuNum);
     });
-    
+
     var blog = $("#blog-posts-over");
     $(blog).find(".search_result_context").find("br").remove();
-    
+
     var book = $("#bookit");
     var res_form = $("#resContent");
     var arrival_date = $("#arrive");
     var departure_date = $("#depart");
-    
+
     $(book).on("click", function () {
        $(res_form).slideToggle("slow", function () {
 
@@ -49,36 +49,36 @@ $(document).ready(function () {
     var book_pos = book.offset();
     var x_pos =  book_pos.left;
     var length = $(res_form).width();
-    
+
     function toggle_slide(){
         if($(".searchform").css("display") === "none"){
             $(".searchform").slideDown("slow", function() {
                 $(this).find('.search-input').focus();
-            });   
+            });
         } else {
             $(".searchform").slideUp("slow", function() {
-           
-            }); 
+
+            });
         }
     }
-    
+
     $(res_form).css("left", x_pos - (length - book_width) + "px");
-    
+
     $("#search-input").on("click", function (){
         toggle_slide();
     });
-    
+
     $(".search-input").on("blur", function () {
         toggle_slide();
     });
-    
+
     var start_date = $(".reservation-front").find("#start-date");
     var end_date = $(".reservation-front").find("#end-date");
-    
+
     // this section is to remove duplicate ID's preventing datepicker from working
     var start_datepicker_large = $("#resContent").find("#start-jrdatepicker");
     var end_datepicker_large = $("#resContent").find("#end-jrdatepicker");
-    
+
     // remove id from the pc view datepicker so it doesn't conflict with mobile view (booking widget)
     function remove_datepicker(){
         if ($(window).width() < 1024) {
@@ -86,7 +86,7 @@ $(document).ready(function () {
             $(end_date).attr("id", "none");
             $(start_datepicker_large).attr("id", "none");
             $(end_datepicker_large).attr("id", "none");
-        
+
         } else {
             $(start_date).attr("id", "start-date")
             $(end_date).attr("id", "end-date");
@@ -95,39 +95,39 @@ $(document).ready(function () {
         }
     }
     remove_datepicker();
-    
-    $(window).resize( function () { 
+
+    $(window).resize( function () {
         remove_datepicker();
         book_width = $(book).width();
         book_pos = book.offset();
         x_pos =  book_pos.left;
         $(res_form).css("left", x_pos - (length - book_width) + "px");
     });
-    
+
     var event_feed = $("#feed");
     var event_rotate = $(".rotate");
     event_rotate.find("button").addClass("view-all");
     event_feed.addClass("feed");
     event_feed.children("div").addClass("feed-block");
-    
+
     Array.max = function( array ){
         return Math.max.apply( Math, array );
     };
-    
+
     var event_header_heights = [];
     $(event_feed).find('div').each( function () {
          var event_header = $(this).find('h6');
          event_header_heights.push(event_header.height());
     });
-    
+
     var header_height_max = Array.max(event_header_heights);
-    
+
      // replace the event's img element with a wrapper div that has a background image of the same src
      $(event_feed).find("div").each( function () {
         var event_header = $(this).find('h6');
         var prev = $(this).prev();
         var next = $(this).next();
-         
+
          event_header.css("height", header_height_max + "px");
 
         var img_src = $(this).find("img").attr('src');
@@ -135,17 +135,17 @@ $(document).ready(function () {
         $(this).find('img').remove();
 
     });
-    
+
     var view_btn = $(".glm-block.view-all");
     var btn_text_length, btn_text;
-    
+
     // initialize the slick sliders on the events and blocks front page
     function check_window_width(){
 
         if($(window).width() > 1023){
             if($(".glm-blocks-container").hasClass('slick-initialized') ) {
                 $(".glm-blocks-container").slick('unslick')
-            } 
+            }
             $(".glm-blocks-container").slick({
                 infinite: true,
                 slidesToShow: 4,
@@ -153,17 +153,17 @@ $(document).ready(function () {
             });
             if($(".feed").hasClass('slick-initialized') ) {
                $(".feed").slick('unslick')
-            } 
+            }
             $(".feed").slick({
                 infinite: true,
                 slidesToShow: 3,
                 slidesToScroll: 1
             });
-            
+
         } else if($(window).width() < 1025 && $(window).width() > 639){
             if($(".glm-blocks-container").hasClass('slick-initialized')) {
                 $(".glm-blocks-container").slick('unslick');
-            } 
+            }
             $(".glm-blocks-container").slick({
                 infinite: true,
                 slidesToShow: 3,
@@ -171,7 +171,7 @@ $(document).ready(function () {
             });
              if($(".feed").hasClass('slick-initialized') ) {
                $(".feed").slick('unslick')
-            } 
+            }
              $(".feed").slick({
                 infinite: true,
                 slidesToShow: 2,
@@ -180,7 +180,7 @@ $(document).ready(function () {
         } else if($(window).width() < 641 && $(window).width() > 319){
             if($(".glm-blocks-container").hasClass('slick-initialized')) {
                 $(".glm-blocks-container").slick('unslick');
-            } 
+            }
             $(".glm-blocks-container").slick({
                 infinite: true,
                 slidesToShow: 1,
@@ -188,7 +188,7 @@ $(document).ready(function () {
             });
              if($(".feed").hasClass('slick-initialized') ) {
                $(".feed").slick('unslick')
-            } 
+            }
              $(".feed").slick({
                 infinite: true,
                 slidesToShow: 1,
@@ -196,15 +196,15 @@ $(document).ready(function () {
             });
         }
     }
-    
+
     check_window_width();
     $(window).resize(function () {
         check_window_width();
     });
-    
+
     var url = window.location.href;
     var sidebar =  $('#side-nav').find( 'ul.sidebar');
-    
+
     // 'current' class style to sidebar item that matches the current url
       sidebar.find('li').find('a').each(function() {
         if ($(this).prop('href') == url) {
@@ -221,22 +221,22 @@ $(document).ready(function () {
     var off_canvas_button = $(".menu-icon");
     var slideshow = $("#slideshow");
     var exit = $(".exit-off-canvas");
-    
-//    off_canvas_button.on("click", function () { 
+
+//    off_canvas_button.on("click", function () {
 //        if(inner_wrapper.hasClass("topbar-fixed")){
 //            inner_wrapper.removeClass("topbar-fixed");
 //            slideshow.css("padding-top", "145px");
-//        } 
+//        }
 //    });
 //    exit.on("click", function () {
 //        setTimeout( function () {
 //            if( !inner_wrapper.hasClass("topbar-fixed")){
 ////                inner_wrapper.addClass("topbar-fixed");
 //                slideshow.css("padding-top", "0px");
-//            } 
+//            }
 //        }, 300);
 //    });
-    
+
     $(window).on("scroll", function () {
         var scrollTop = $(window).scrollTop();
 
@@ -245,33 +245,34 @@ $(document).ready(function () {
                 $(sticky).addClass("fixed");
                 $(inner_wrapper).addClass("topbar-fixed");
             }
-        } 
+        }
     });
-     
-    if (url.includes('sitemap') || url.includes("Sitemap")){
+
+    //if (url.includes('sitemap') || url.includes("Sitemap")){
+    if ( url.indexOf( 'sitemap' ) > -1 || url.indexOf( 'Sitemap' ) > -1 ) {
         var sitemap = $("#main-content").find("ul:first");
         sitemap.addClass("sitemap");
     }
     $('<h2> Pages </h2>').insertBefore(sitemap);
-    
+
     var front_map = $("#map-blog").find("svg").attr("id", "Layer_2");
     var block_overlay = $(".block-overlay");
     var block_frame = $(".block-frame");
     var block_link = $(".block-link");
     var glm_blocks_container = $(".glm-blocks-container");
-    
-    
+
+
     block_overlay.each( function (){
        $(this).find("img").addClass("block-image");
-        
+
     });
 
     block_frame.each( function (){
         var url = $(this).find(block_overlay).children("a").attr("href");
        $(this).wrap("<a class='block-link' href='" + url + "'></a>");
     });
-   
-   if( $(window).width() > 640){    
+
+   if( $(window).width() > 640){
        block_frame.hover( function(){
             $(this).addClass("current-frame");
            if( $(this).hasClass("darken")){
index e26668f..d8c0663 100644 (file)
@@ -21,15 +21,15 @@ $(document).ready(function () {
         //console.log('ul = ' + menuImg);
         //console.log('menu-id = ' + menuNum);
     });
-    
+
     var blog = $("#blog-posts-over");
     $(blog).find(".search_result_context").find("br").remove();
-    
+
     var book = $("#bookit");
     var res_form = $("#resContent");
     var arrival_date = $("#arrive");
     var departure_date = $("#depart");
-    
+
     $(book).on("click", function () {
        $(res_form).slideToggle("slow", function () {
 
@@ -40,36 +40,36 @@ $(document).ready(function () {
     var book_pos = book.offset();
     var x_pos =  book_pos.left;
     var length = $(res_form).width();
-    
+
     function toggle_slide(){
         if($(".searchform").css("display") === "none"){
             $(".searchform").slideDown("slow", function() {
                 $(this).find('.search-input').focus();
-            });   
+            });
         } else {
             $(".searchform").slideUp("slow", function() {
-           
-            }); 
+
+            });
         }
     }
-    
+
     $(res_form).css("left", x_pos - (length - book_width) + "px");
-    
+
     $("#search-input").on("click", function (){
         toggle_slide();
     });
-    
+
     $(".search-input").on("blur", function () {
         toggle_slide();
     });
-    
+
     var start_date = $(".reservation-front").find("#start-date");
     var end_date = $(".reservation-front").find("#end-date");
-    
+
     // this section is to remove duplicate ID's preventing datepicker from working
     var start_datepicker_large = $("#resContent").find("#start-jrdatepicker");
     var end_datepicker_large = $("#resContent").find("#end-jrdatepicker");
-    
+
     // remove id from the pc view datepicker so it doesn't conflict with mobile view (booking widget)
     function remove_datepicker(){
         if ($(window).width() < 1024) {
@@ -77,7 +77,7 @@ $(document).ready(function () {
             $(end_date).attr("id", "none");
             $(start_datepicker_large).attr("id", "none");
             $(end_datepicker_large).attr("id", "none");
-        
+
         } else {
             $(start_date).attr("id", "start-date")
             $(end_date).attr("id", "end-date");
@@ -86,39 +86,39 @@ $(document).ready(function () {
         }
     }
     remove_datepicker();
-    
-    $(window).resize( function () { 
+
+    $(window).resize( function () {
         remove_datepicker();
         book_width = $(book).width();
         book_pos = book.offset();
         x_pos =  book_pos.left;
         $(res_form).css("left", x_pos - (length - book_width) + "px");
     });
-    
+
     var event_feed = $("#feed");
     var event_rotate = $(".rotate");
     event_rotate.find("button").addClass("view-all");
     event_feed.addClass("feed");
     event_feed.children("div").addClass("feed-block");
-    
+
     Array.max = function( array ){
         return Math.max.apply( Math, array );
     };
-    
+
     var event_header_heights = [];
     $(event_feed).find('div').each( function () {
          var event_header = $(this).find('h6');
          event_header_heights.push(event_header.height());
     });
-    
+
     var header_height_max = Array.max(event_header_heights);
-    
+
      // replace the event's img element with a wrapper div that has a background image of the same src
      $(event_feed).find("div").each( function () {
         var event_header = $(this).find('h6');
         var prev = $(this).prev();
         var next = $(this).next();
-         
+
          event_header.css("height", header_height_max + "px");
 
         var img_src = $(this).find("img").attr('src');
@@ -126,17 +126,17 @@ $(document).ready(function () {
         $(this).find('img').remove();
 
     });
-    
+
     var view_btn = $(".glm-block.view-all");
     var btn_text_length, btn_text;
-    
+
     // initialize the slick sliders on the events and blocks front page
     function check_window_width(){
 
         if($(window).width() > 1023){
             if($(".glm-blocks-container").hasClass('slick-initialized') ) {
                 $(".glm-blocks-container").slick('unslick')
-            } 
+            }
             $(".glm-blocks-container").slick({
                 infinite: true,
                 slidesToShow: 4,
@@ -144,17 +144,17 @@ $(document).ready(function () {
             });
             if($(".feed").hasClass('slick-initialized') ) {
                $(".feed").slick('unslick')
-            } 
+            }
             $(".feed").slick({
                 infinite: true,
                 slidesToShow: 3,
                 slidesToScroll: 1
             });
-            
+
         } else if($(window).width() < 1025 && $(window).width() > 639){
             if($(".glm-blocks-container").hasClass('slick-initialized')) {
                 $(".glm-blocks-container").slick('unslick');
-            } 
+            }
             $(".glm-blocks-container").slick({
                 infinite: true,
                 slidesToShow: 3,
@@ -162,7 +162,7 @@ $(document).ready(function () {
             });
              if($(".feed").hasClass('slick-initialized') ) {
                $(".feed").slick('unslick')
-            } 
+            }
              $(".feed").slick({
                 infinite: true,
                 slidesToShow: 2,
@@ -171,7 +171,7 @@ $(document).ready(function () {
         } else if($(window).width() < 641 && $(window).width() > 319){
             if($(".glm-blocks-container").hasClass('slick-initialized')) {
                 $(".glm-blocks-container").slick('unslick');
-            } 
+            }
             $(".glm-blocks-container").slick({
                 infinite: true,
                 slidesToShow: 1,
@@ -179,7 +179,7 @@ $(document).ready(function () {
             });
              if($(".feed").hasClass('slick-initialized') ) {
                $(".feed").slick('unslick')
-            } 
+            }
              $(".feed").slick({
                 infinite: true,
                 slidesToShow: 1,
@@ -187,15 +187,15 @@ $(document).ready(function () {
             });
         }
     }
-    
+
     check_window_width();
     $(window).resize(function () {
         check_window_width();
     });
-    
+
     var url = window.location.href;
     var sidebar =  $('#side-nav').find( 'ul.sidebar');
-    
+
     // 'current' class style to sidebar item that matches the current url
       sidebar.find('li').find('a').each(function() {
         if ($(this).prop('href') == url) {
@@ -212,22 +212,22 @@ $(document).ready(function () {
     var off_canvas_button = $(".menu-icon");
     var slideshow = $("#slideshow");
     var exit = $(".exit-off-canvas");
-    
-//    off_canvas_button.on("click", function () { 
+
+//    off_canvas_button.on("click", function () {
 //        if(inner_wrapper.hasClass("topbar-fixed")){
 //            inner_wrapper.removeClass("topbar-fixed");
 //            slideshow.css("padding-top", "145px");
-//        } 
+//        }
 //    });
 //    exit.on("click", function () {
 //        setTimeout( function () {
 //            if( !inner_wrapper.hasClass("topbar-fixed")){
 ////                inner_wrapper.addClass("topbar-fixed");
 //                slideshow.css("padding-top", "0px");
-//            } 
+//            }
 //        }, 300);
 //    });
-    
+
     $(window).on("scroll", function () {
         var scrollTop = $(window).scrollTop();
 
@@ -236,33 +236,34 @@ $(document).ready(function () {
                 $(sticky).addClass("fixed");
                 $(inner_wrapper).addClass("topbar-fixed");
             }
-        } 
+        }
     });
-     
-    if (url.includes('sitemap') || url.includes("Sitemap")){
+
+    //if (url.includes('sitemap') || url.includes("Sitemap")){
+    if ( url.indexOf( 'sitemap' ) > -1 || url.indexOf( 'Sitemap' ) > -1 ) {
         var sitemap = $("#main-content").find("ul:first");
         sitemap.addClass("sitemap");
     }
     $('<h2> Pages </h2>').insertBefore(sitemap);
-    
+
     var front_map = $("#map-blog").find("svg").attr("id", "Layer_2");
     var block_overlay = $(".block-overlay");
     var block_frame = $(".block-frame");
     var block_link = $(".block-link");
     var glm_blocks_container = $(".glm-blocks-container");
-    
-    
+
+
     block_overlay.each( function (){
        $(this).find("img").addClass("block-image");
-        
+
     });
 
     block_frame.each( function (){
         var url = $(this).find(block_overlay).children("a").attr("href");
        $(this).wrap("<a class='block-link' href='" + url + "'></a>");
     });
-   
-   if( $(window).width() > 640){    
+
+   if( $(window).width() > 640){
        block_frame.hover( function(){
             $(this).addClass("current-frame");
            if( $(this).hasClass("darken")){