Update weather widget area to use jquery to load it
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 22 Oct 2014 17:17:12 +0000 (13:17 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 22 Oct 2014 17:17:12 +0000 (13:17 -0400)
js/app.js
js/custom/weather-widget.js

index fea8051..43681b8 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -45,25 +45,25 @@ function get_footer_position() {
 }
 
 
-;$(function(){
-  if ($('.weather-widget').length && $('.weather-widget-popup').length) {
-    $('.weather-widget').appendTo($('.weather-widget-popup'));
-    $('.weather-widget-popup > a').on('click', function(){
-        console.log('toggle me');
-      if ($('.weather-widget').is(':visible')) {
-          console.log('hidden now showing');
-        $('.weather-widget').css({'display': 'none'});
-      }
-      else {
-          console.log('shown now hiding');
-        $('.weather-widget').css({'display': 'block'});
-      }
-      return false;
-    });
-    $('.inner-wrap').click(function() {
-      if ($('.weather-widget').is(':visible')) {
-        $('.weather-widget').toggle();
-      }
-    });
-  }
+;$(function () {
+    if ($('.weather-widget').length && $('.weather-widget-popup').length) {
+        $('.weather-widget').appendTo($('.weather-widget-popup'));
+        $('.weather-widget-popup > a').on('click', function () {
+            console.log('toggle me');
+            if ($('.weather-widget').is(':visible')) {
+                $('.weather-widget-inner').html('<p>Loading ...</p>');
+                $('.weather-widget').css({'display': 'none'});
+            }
+            else {
+                $('.weather-widget-inner').html('<iframe id="explicit" src="//www.weatherfor.us/load.php?location=Alpena%2C+MI&amp;unit=f" allowtransparency="true" style="background: transparent; width: 720px; height: 250px; overflow: hidden;" scrolling="no" frameborder="0"></iframe>');
+                $('.weather-widget').css({'display': 'block'});
+            }
+            return false;
+        });
+        $('.inner-wrap').click(function () {
+            if ($('.weather-widget').is(':visible')) {
+                $('.weather-widget').toggle();
+            }
+        });
+    }
 });
\ No newline at end of file
index 3d5ab00..466c74e 100644 (file)
@@ -1,22 +1,22 @@
-$(function(){
-  if ($('.weather-widget').length && $('.weather-widget-popup').length) {
-    $('.weather-widget').appendTo($('.weather-widget-popup'));
-    $('.weather-widget-popup > a').on('click', function(){
-        console.log('toggle me');
-      if ($('.weather-widget').is(':visible')) {
-          console.log('hidden now showing');
-        $('.weather-widget').css({'display': 'none'});
-      }
-      else {
-          console.log('shown now hiding');
-        $('.weather-widget').css({'display': 'block'});
-      }
-      return false;
-    });
-    $('.inner-wrap').click(function() {
-      if ($('.weather-widget').is(':visible')) {
-        $('.weather-widget').toggle();
-      }
-    });
-  }
+$(function () {
+    if ($('.weather-widget').length && $('.weather-widget-popup').length) {
+        $('.weather-widget').appendTo($('.weather-widget-popup'));
+        $('.weather-widget-popup > a').on('click', function () {
+            console.log('toggle me');
+            if ($('.weather-widget').is(':visible')) {
+                $('.weather-widget-inner').html('<p>Loading ...</p>');
+                $('.weather-widget').css({'display': 'none'});
+            }
+            else {
+                $('.weather-widget-inner').html('<iframe id="explicit" src="//www.weatherfor.us/load.php?location=Alpena%2C+MI&amp;unit=f" allowtransparency="true" style="background: transparent; width: 720px; height: 250px; overflow: hidden;" scrolling="no" frameborder="0"></iframe>');
+                $('.weather-widget').css({'display': 'block'});
+            }
+            return false;
+        });
+        $('.inner-wrap').click(function () {
+            if ($('.weather-widget').is(':visible')) {
+                $('.weather-widget').toggle();
+            }
+        });
+    }
 });
\ No newline at end of file