Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Wrapped startTour in a closure to keep panel variables around to dispose when needed

Mike McGannb2038dcd9488
diff --git a/index.html b/index.html
index 8d0f310ee..fd37ffa12 100755
--- a/index.html
+++ b/index.html
@@ -88,7 +88,6 @@
<!-- js.dev --> <script type="text/javascript" src="js/switch.js"></script>
<!-- js.dev --> <script type="text/javascript" src="js/selector.js"></script>
<!-- js.dev --> <script type="text/javascript" src="js/sote.js"></script>
- <!-- js.dev --> <script type="text/javascript" src="js/tour.js"></script>
<!-- js.dev --> <script type="text/javascript" src="js/Logging.js"></script>
<!-- js.dev --> <script type="text/javascript" src="js/Date.js"></script>
@@ -116,6 +115,7 @@
<!-- js.dev --> <script type="text/javascript" src="js/Worldview/Widget/Palette.js"></script>
<!-- js.dev --> <script type="text/javascript" src="js/Worldview/Widget/WorldviewMap.js"></script>
+ <!-- js.dev --> <script type="text/javascript" src="js/tour.js"></script>
<!-- js.dev --> <script type="text/javascript" src="js/main.js"></script>
</head>
@@ -124,7 +124,7 @@
<div data-role="content">
<div id="banner"><img class='logo' src='images/logo.png' />
<ul id="toolbarlist">
- <li><!--<a id='aboutus_link' class='toolbaricon' title='Information' href='javascript:showOverlay();'>--><div id='info_drop'><div id='info' title='Information'><img src='images/information.png' /></div><div class='hidden'><a href="mailto:[email protected]?subject=Feedback for EOSDIS Worldview tool" target="_blank" title='Feedback'>Feedback</a><a href='javascript:startTour(true);' title='Start Tour'>Start Tour</a><a href='javascript:showOverlay();' title='About Worldview'>About</a></div></div><!--</a>--></li>
+ <li><!--<a id='aboutus_link' class='toolbaricon' title='Information' href='javascript:showOverlay();'>--><div id='info_drop'><div id='info' title='Information'><img src='images/information.png' /></div><div class='hidden'><a href="mailto:[email protected]?subject=Feedback for EOSDIS Worldview tool" target="_blank" title='Feedback'>Feedback</a><a href='javascript:Worldview.Tour.start(true);' title='Start Tour'>Start Tour</a><a href='javascript:showOverlay();' title='About Worldview'>About</a></div></div><!--</a>--></li>
<!--<li><a id='camera_link' class='toolbaricon' href='javascript:showRubberBand();'><img src='images/camera.png' /></a></li>-->
<li><div id='camera'></div></li>
<li><div id="switch"></div></li>
diff --git a/js/main.js b/js/main.js
index 16c1a2fd6..26f0f2e19 100644
--- a/js/main.js
+++ b/js/main.js
@@ -113,7 +113,7 @@ $(function() {// Initialize "static" vars
log.warn("Development version");
}
- startTour(false);
+ Worldview.Tour.start(false);
};
var onConfigLoad = function(config) {
diff --git a/js/tour.js b/js/tour.js
index 87552a2dd..f4937ccbd 100644
--- a/js/tour.js
+++ b/js/tour.js
@@ -1,276 +1,294 @@
-/**
- * Create the splash screen and tour panels and control iteration over them.
- */
-function startTour(noDisable) {
-
- // determine screen size - don't show if too small
- var devWidth = window.screen.availWidth;
- var devHeight = window.screen.availHeight;
-
- var viewWidth = $(window).width();
- var viewHeight = $(window).height();
-
- console.log("DEVICE: width = " + devWidth + ", height = " + devHeight);
- console.log("VIEWPORT: width = " + viewWidth + ", height = " + viewHeight);
-
- if(devWidth < 500 || viewWidth < 500 || devHeight < 500 || viewHeight < 500) {
- if(noDisable) {
- Worldview.notify("Unfortunately the Worldview tour can only be viewed in larger web browser windows.");
- }
- return;
- }
-
-
- // set up storage and decide whether to show the splash
- var storageEngine;
- try {
- storageEngine = YAHOO.util.StorageManager.get(
- YAHOO.util.StorageEngineHTML5.ENGINE_NAME,
- YAHOO.util.StorageManager.LOCATION_LOCAL,
- {
- force: false,
- order: [
- YAHOO.util.StorageEngineHTML5
- ]
- });
- } catch(e) {
- alert("No supported storage mechanism present");
- storageEngine = false;
- }
-
- var hideSplash;
- if(storageEngine) {
- storageEngine.subscribe(storageEngine.CE_READY, function() {
- hideSplash = storageEngine.getItem('hideSplash');
- });
- }
-
- // return if the user has disabled the splash
- if(hideSplash && !noDisable) {
- return;
- }
-
- /* --- Set Up --- */
-
- var padding = 15; // padding - used for all of the tour windows
- var pos, width, height, xval, yval; // helpful calulation vars
-
- // splash screen overlay
- if(this.splashOverlay){
- this.splashOverlay.destroy();
- }
- this.splashOverlay = new YAHOO.widget.Panel("splash", { zIndex:1020, visible:false, modal:true, draggable:false, } );
+Worldview.namespace("Tour");
- var item = "<div class=\"splash\">"+
- "<h3>Welcome to Worldview!</h3>"+
- "</br>"+
- "<center>"+
- "<p class=\"splash\">This new tool from NASA's <a href='http://earthdata.nasa.gov/about-eosdis' target='_blank'>EOSDIS</a> allows users to interactively browse satellite imagery in near real-time, generally within 3 hours of observation. Use the tools described below to change the imagery on the map and compare it to past observations.</p>"+
- "</br></br>"+
- "<table class=\"splash\">"+
- "<tr>"+
- "<td><img src=\"images/picker-mini.png\" alt=\"Product Picker\" width=\"100\" class=\"splash\"/></td>"+
- "<td><img src=\"images/date-mini.png\" alt=\"Date Slider\" width=\"100\" class=\"splash\"/></td>"+
- "<td><img src=\"images/toolbar-mini.png\" alt=\"Toolbar\" width=\"100\" class=\"splash\"/></td>"+
- "<td><img src=\"images/map-mini.png\" alt=\"Map\" width=\"100\" class=\"splash\"/></td>"+
- "</tr>"+
- "<tr>"+
- "<td><p class=\"splash\">Use the <span class=\"highlight\">Product Picker</span> on the left to choose the type of imagery to display on the map.</p></td>"+
- "<td><p class=\"splash\">Use the <span class=\"highlight\">Date Slider</span> on the bottom to choose the date of the observations.</p></td>"+
- "<td><p class=\"splash\">Use the <span class=\"highlight\">Tool Bar</span> at the top to see other tools for changing and saving the view.</p></td>"+
- "<td><p class=\"splash\">Use the <span class=\"highlight\">Map</span> itself to pan or zoom in on an area.</p></td>"+
- "</tr>"+
- "<tr>"+
- "<td><p></p></td>"+
- "</tr>"+
- "<tr>"+
- "<td rowspan=\"2\" colspan=\"2\"><button id='takeTour' type='button' class=\"takeTour\"; background-image:url('../images/splash-button.png')\">Take Tour</button></td>"+
- "<td rowspan=\"2\" colspan=\"2\"><button id='skipTour' type='button' class=\"skipTour\">Skip Tour</button></td>"+
- "</tr>"+
- "<tr></tr>"+
- "<tr>"+
- "<td><p class=\"splash\"><input id='dontShowAgain' value=\"false\" type='checkbox'>Do not show again</p></td>"+
- "</tr>"+
- "</table>"+
- "</center>"+
- "</div>";
-
- splashOverlay.setBody(item);
- splashOverlay.show();
-
- /* set up all of the callout panels */
- var productText = "<div>"+
- "<h3>Product Picker</h3>"+
- "</br>"+
- "<p class='tour'>A <span class='highlight'>Base Layer</span> is an opaque background image - you can show one at a time. An <span class='highlight'>Overlay</span> is a partially transparent layer to view on top of the background - you can stack overlays.</p>"+
- "<p class='tour'>By using the <img src=\"images/addLayers.png\" alt=\"Add Layers\" class=\"tour\"/> icon, you can browse all layers or choose an interest area. After choosing your overlays, you can drag them up and down to reorder them.</p>"+
- "<p class='tour'> <span class='tryIt'>Try It!</span></p>"+
- "<p class='tour'>Click the \"Add Layers\" icon, select the \"Fires\" interest area, and choose the following layers.</p>"+
- "<p class='tour'>Base Layer: </p>"+
- "<ul class='tour'>"+
- "<li>Corrected Reflectance (True Color) Aqua/MODIS</li>"+
- "</ul>"+
- "<p class='tour'>Overlays: </p>"+
- "<ul class='tour'>"+
- "<li>Fires (Day and Night) Aqua/MODIS Fire and Thermal Anomalies</li>"+
- "<li>Carbon Monoxide (Total Column, Day) Aqua/AIRS</li>"+
- "</ul>"+
- "</br>"+
- "</div>";
- document.getElementById("productPanel").innerHTML = productText;
-
- var dateText = "<div class=\"tour\">"+
- "<h3>Date Slider</h3>"+
- "</br>"+
- "<p class='tour'>The <span class='highlight'>Date Slider</span> is used to show imagery that was observed on a specific date. You can click the slider to choose a date or drag the slider to view changes over time.</p>"+
- "<p class='tour'><span class='tryIt'>Try It!</span></p>"+
- "<p class='tour'>Use the date slider to change the date to 2012 Aug 23.</p>"+
- "</div>";
- document.getElementById("datePanel").innerHTML = dateText;
-
- var toolbarText = "<div>"+
- "<h3>Toolbar</h3>"+
- "</br>"+
- "<p>The toolbar provides several additional utilities for interacting with Worldview.</p>"+
- "<table class=\"tour\">"+
- "<tr>" +
- "<td><img src=\"images/permalinkon.png\"</td>"+
- "<td><p class=\"tour\">The permalink icon lets you create a permanent, shareable link to a particular view in Worldview.</p></td>"+
- "</tr>" +
- "<tr>" +
- "<td><img src=\"images/globe.png\"</td>"+
- "<td><p class=\"tour\">The globe icon lets you change between Arctic, geographic, and Antarctic projections of the world.</p></td>"+
- "</tr>" +
- "<tr>" +
- "<td><img src=\"images/camera.png\"</td>"+
- "<td><p class=\"tour\">The camera icon lets you download an image of your current view in Worldview. Palettes are not yet supporoted with this feature.</p></td>"+
- "</tr>" +
- "<tr>" +
- "<td><img src=\"images/informationon.png\"</td>"+
- "<td><p class=\"tour\">The information icon provides you with more information on Worldview and its data sources.</p></td>"+
- "</tr>" +
- "</table>" +
- "</br>"+
- "</div>";
- document.getElementById("toolbarPanel").innerHTML = toolbarText;
-
- var mapText = "<div>"+
- "<h3>Map</h3>"+
- "</br>"+
- "<p class='tour\'>There are several ways you can interact with the map to pan or zoom.</p>"+
- "<p class='tour\'>To pan, drag the map.</p>"+
- "<p class='tour\'>To zoom:</p>"+
- "<ul class='tour\'>"+
- "<li>Use the mouse wheel</li>"+
- "<li>Use the +/- icons on the right</li>"+
- "<li>Double-click (centers and zooms)</li>"+
- "<li>Shift-click-drag (zooms in on a box)</li>"+
- "</ul>"+
- "</br>"+
- "<p class='tour'><span class='tryIt'>Try It!</span></p>"+
- "<p class='tour\'>Move the map to North America and zoom in on northern California, USA.</p>"+
- "<img src=\"images/fire-location.png\" alt=\"Location\" width=\"200\" class=\"splash\"/>"+
- "</br>"+
- "</div>";
-
- document.getElementById("mapPanel").innerHTML = mapText;
+(function(ns) {
+
+ // ns = Worldview.Tour
+
+ // Keep these around in a closure so we can dispose of them as needed
+ var conclusionPanel = null;
+ var splashOverlay = null;
+ /**
+ * Create the splash screen and tour panels and control iteration over them.
+ */
+ ns.start = function(noDisable) {
+
+ // determine screen size - don't show if too small
+ var devWidth = window.screen.availWidth;
+ var devHeight = window.screen.availHeight;
+
+ var viewWidth = $(window).width();
+ var viewHeight = $(window).height();
+
+ console.log("DEVICE: width = " + devWidth + ", height = " + devHeight);
+ console.log("VIEWPORT: width = " + viewWidth + ", height = " + viewHeight);
+
+ if(devWidth < 500 || viewWidth < 500 || devHeight < 500 || viewHeight < 500) {
+ if(noDisable) {
+ Worldview.notify("Unfortunately the Worldview tour can only be viewed in larger web browser windows.");
+ }
+ return;
+ }
+
+
+ // set up storage and decide whether to show the splash
+ var storageEngine;
+ try {
+ storageEngine = YAHOO.util.StorageManager.get(
+ YAHOO.util.StorageEngineHTML5.ENGINE_NAME,
+ YAHOO.util.StorageManager.LOCATION_LOCAL,
+ {
+ force: false,
+ order: [
+ YAHOO.util.StorageEngineHTML5
+ ]
+ });
+ } catch(e) {
+ alert("No supported storage mechanism present");
+ storageEngine = false;
+ }
+
+ var hideSplash;
+ if(storageEngine) {
+ storageEngine.subscribe(storageEngine.CE_READY, function() {
+ hideSplash = storageEngine.getItem('hideSplash');
+ });
+ }
+
+ // return if the user has disabled the splash
+ if(hideSplash && !noDisable) {
+ return;
+ }
+
+ /* --- Set Up --- */
+
+ var padding = 15; // padding - used for all of the tour windows
+ var pos, width, height, xval, yval; // helpful calulation vars
+
+ // splash screen overlay
+ if(splashOverlay){
+ splashOverlay.destroy();
+ }
+ splashOverlay = new YAHOO.widget.Panel("splash", { zIndex:1020, visible:false, modal:true, draggable:false, } );
+
+ var item = "<div class=\"splash\">"+
+ "<h3>Welcome to Worldview!</h3>"+
+ "</br>"+
+ "<center>"+
+ "<p class=\"splash\">This new tool from NASA's <a href='http://earthdata.nasa.gov/about-eosdis' target='_blank'>EOSDIS</a> allows users to interactively browse satellite imagery in near real-time, generally within 3 hours of observation. Use the tools described below to change the imagery on the map and compare it to past observations.</p>"+
+ "</br></br>"+
+ "<table class=\"splash\">"+
+ "<tr>"+
+ "<td><img src=\"images/picker-mini.png\" alt=\"Product Picker\" width=\"100\" class=\"splash\"/></td>"+
+ "<td><img src=\"images/date-mini.png\" alt=\"Date Slider\" width=\"100\" class=\"splash\"/></td>"+
+ "<td><img src=\"images/toolbar-mini.png\" alt=\"Toolbar\" width=\"100\" class=\"splash\"/></td>"+
+ "<td><img src=\"images/map-mini.png\" alt=\"Map\" width=\"100\" class=\"splash\"/></td>"+
+ "</tr>"+
+ "<tr>"+
+ "<td><p class=\"splash\">Use the <span class=\"highlight\">Product Picker</span> on the left to choose the type of imagery to display on the map.</p></td>"+
+ "<td><p class=\"splash\">Use the <span class=\"highlight\">Date Slider</span> on the bottom to choose the date of the observations.</p></td>"+
+ "<td><p class=\"splash\">Use the <span class=\"highlight\">Tool Bar</span> at the top to see other tools for changing and saving the view.</p></td>"+
+ "<td><p class=\"splash\">Use the <span class=\"highlight\">Map</span> itself to pan or zoom in on an area.</p></td>"+
+ "</tr>"+
+ "<tr>"+
+ "<td><p></p></td>"+
+ "</tr>"+
+ "<tr>"+
+ "<td rowspan=\"2\" colspan=\"2\"><button id='takeTour' type='button' class=\"takeTour\"; background-image:url('../images/splash-button.png')\">Take Tour</button></td>"+
+ "<td rowspan=\"2\" colspan=\"2\"><button id='skipTour' type='button' class=\"skipTour\">Skip Tour</button></td>"+
+ "</tr>"+
+ "<tr></tr>"+
+ "<tr>"+
+ "<td><p class=\"splash\"><input id='dontShowAgain' value=\"false\" type='checkbox'>Do not show again</p></td>"+
+ "</tr>"+
+ "</table>"+
+ "</center>"+
+ "</div>";
+
+ splashOverlay.setBody(item);
+ splashOverlay.show();
+
+ /* set up all of the callout panels */
+ var productText = "<div>"+
+ "<h3>Product Picker</h3>"+
+ "</br>"+
+ "<p class='tour'>A <span class='highlight'>Base Layer</span> is an opaque background image - you can show one at a time. An <span class='highlight'>Overlay</span> is a partially transparent layer to view on top of the background - you can stack overlays.</p>"+
+ "<p class='tour'>By using the <img src=\"images/addLayers.png\" alt=\"Add Layers\" class=\"tour\"/> icon, you can browse all layers or choose an interest area. After choosing your overlays, you can drag them up and down to reorder them.</p>"+
+ "<p class='tour'> <span class='tryIt'>Try It!</span></p>"+
+ "<p class='tour'>Click the \"Add Layers\" icon, select the \"Fires\" interest area, and choose the following layers.</p>"+
+ "<p class='tour'>Base Layer: </p>"+
+ "<ul class='tour'>"+
+ "<li>Corrected Reflectance (True Color) Aqua/MODIS</li>"+
+ "</ul>"+
+ "<p class='tour'>Overlays: </p>"+
+ "<ul class='tour'>"+
+ "<li>Fires (Day and Night) Aqua/MODIS Fire and Thermal Anomalies</li>"+
+ "<li>Carbon Monoxide (Total Column, Day) Aqua/AIRS</li>"+
+ "</ul>"+
+ "</br>"+
+ "</div>";
+ document.getElementById("productPanel").innerHTML = productText;
+
+ var dateText = "<div class=\"tour\">"+
+ "<h3>Date Slider</h3>"+
+ "</br>"+
+ "<p class='tour'>The <span class='highlight'>Date Slider</span> is used to show imagery that was observed on a specific date. You can click the slider to choose a date or drag the slider to view changes over time.</p>"+
+ "<p class='tour'><span class='tryIt'>Try It!</span></p>"+
+ "<p class='tour'>Use the date slider to change the date to 2012 Aug 23.</p>"+
+ "</div>";
+ document.getElementById("datePanel").innerHTML = dateText;
+
+ var toolbarText = "<div>"+
+ "<h3>Toolbar</h3>"+
+ "</br>"+
+ "<p>The toolbar provides several additional utilities for interacting with Worldview.</p>"+
+ "<table class=\"tour\">"+
+ "<tr>" +
+ "<td><img src=\"images/permalinkon.png\"</td>"+
+ "<td><p class=\"tour\">The permalink icon lets you create a permanent, shareable link to a particular view in Worldview.</p></td>"+
+ "</tr>" +
+ "<tr>" +
+ "<td><img src=\"images/globe.png\"</td>"+
+ "<td><p class=\"tour\">The globe icon lets you change between Arctic, geographic, and Antarctic projections of the world.</p></td>"+
+ "</tr>" +
+ "<tr>" +
+ "<td><img src=\"images/camera.png\"</td>"+
+ "<td><p class=\"tour\">The camera icon lets you download an image of your current view in Worldview. Palettes are not yet supporoted with this feature.</p></td>"+
+ "</tr>" +
+ "<tr>" +
+ "<td><img src=\"images/informationon.png\"</td>"+
+ "<td><p class=\"tour\">The information icon provides you with more information on Worldview and its data sources.</p></td>"+
+ "</tr>" +
+ "</table>" +
+ "</br>"+
+ "</div>";
+ document.getElementById("toolbarPanel").innerHTML = toolbarText;
+
+ var mapText = "<div>"+
+ "<h3>Map</h3>"+
+ "</br>"+
+ "<p class='tour\'>There are several ways you can interact with the map to pan or zoom.</p>"+
+ "<p class='tour\'>To pan, drag the map.</p>"+
+ "<p class='tour\'>To zoom:</p>"+
+ "<ul class='tour\'>"+
+ "<li>Use the mouse wheel</li>"+
+ "<li>Use the +/- icons on the right</li>"+
+ "<li>Double-click (centers and zooms)</li>"+
+ "<li>Shift-click-drag (zooms in on a box)</li>"+
+ "</ul>"+
+ "</br>"+
+ "<p class='tour'><span class='tryIt'>Try It!</span></p>"+
+ "<p class='tour\'>Move the map to North America and zoom in on northern California, USA.</p>"+
+ "<img src=\"images/fire-location.png\" alt=\"Location\" width=\"200\" class=\"splash\"/>"+
+ "</br>"+
+ "</div>";
+
+ document.getElementById("mapPanel").innerHTML = mapText;
+
+
+ /* conclusion screen after completing the tour */
+ if(conclusionPanel){
+ conclusionPanel.destroy();
+ }
+ conclusionPanel = new YAHOO.widget.Panel("conclusionPanel", { zIndex:1020,
+ visible:false,
+ modal:true,
+ draggable:false});
+ var conclusionText = "<div class=\"splash\">"+
+ "<center>"+
+ "<h3>Finished!</h3>"+
+ "</br>"+
+ "<p class='tour'>You have now completed a tour of Worldview! If you followed the “Try It” steps, you’re now looking at fires in northern California as they were observed by satellites on August 23, 2012. You can use the tools in any order. We hope you continue exploring! <p>"+
+ "</br>"+
+ "<table class='tour'>"+
+ "<tr>"+
+ "<td rowspan=\"2\" colspan=\"2\"><button id='repeat' type='button' class='repeatTour'>Repeat Tour</button></td>"+
+ "<td rowspan=\"2\" colspan=\"2\"><button id='done' type='button' class='done'>Done!</button></td>"+
+ "</tr>"+
+ "</table>"+
+ "</center>"+
+ "</div>";
+
+ conclusionPanel.setBody(conclusionText);
+
+
+ /*
+ * Restart the tour at the beginning.
+ */
+ var repeatTour = function(e) {
+ console.log("repeating tour");
+ e.stopPropagation();
+ $('#joyRideTipContent').joyride({template : {'link':'<a href="#" class="joyride-close-tip">X</a>'},
+ postStepCallback : function (index, tip) {
+ if(index == 3) {
+ console.log("finished tour");
+ conclusionPanel.show();
+ conclusionPanel.center();
+ }
+ }});
+ conclusionPanel.hide();
+ console.log("exiting repeat");
+ }
+
+ /*
+ * Hide the tour.
+ */
+ var handleDone = function(e) {
+ e.stopPropagation();
+ console.log("tour done");
+ conclusionPanel.hide();
+ console.log("exiting tour done");
+ }
+
+ /*
+ * Close the splash and go straight to worldview.
+ */
+ var handleSkipTour = function() {
+ splashOverlay.hide();
+ };
+
+ /*
+ * Close the splash and start the tour.
+ */
+ var handleTakeTour = function(e) {
+ console.log("handleTakeTour " + e.target.id);
+ e.stopPropagation();
+ splashOverlay.hide();
+
+ $('#joyRideTipContent').joyride({template : {'link':'<a href="#" class="joyride-close-tip">X</a>'},
+ postStepCallback : function (index, tip) {
+ if(index == 3) {
+ console.log("finished tour");
+ conclusionPanel.show();
+ conclusionPanel.center();
+ }
+ }});
+ }
+
+ /*
+ * Toggle the value of the "hideSplash" flag.
+ */
+ var setDoNotShow = function() {
+ hideSplash = storageEngine.getItem('hideSplash');
+ storageEngine.setItem('hideSplash', !hideSplash);
+ };
+
+
+ // assign events and start
+ YAHOO.util.Event.on('takeTour', 'click', handleTakeTour);
+ YAHOO.util.Event.on('skipTour', 'click', handleSkipTour);
+ YAHOO.util.Event.on('dontShowAgain', 'click', setDoNotShow);
+ YAHOO.util.Event.on('repeat', 'click', repeatTour);
+ YAHOO.util.Event.on('done', 'click', handleDone);
+ console.log("set all handlers");
+
+ splashOverlay.render(document.body);
+ conclusionPanel.render(document.body);
+ splashOverlay.show();
+ splashOverlay.center();
+ }
+
+})(Worldview.Tour);
- /* conclusion screen after completing the tour */
- if(!this.conclusionPanel){
- var conclusionPanel = new YAHOO.widget.Panel("conclusionPanel", { zIndex:1020,
- visible:false,
- modal:true,
- draggable:false});
- var conclusionText = "<div class=\"splash\">"+
- "<center>"+
- "<h3>Finished!</h3>"+
- "</br>"+
- "<p class='tour'>You have now completed a tour of Worldview! If you followed the “Try It” steps, you’re now looking at fires in northern California as they were observed by satellites on August 23, 2012. You can use the tools in any order. We hope you continue exploring! <p>"+
- "</br>"+
- "<table class='tour'>"+
- "<tr>"+
- "<td rowspan=\"2\" colspan=\"2\"><button id='repeat' type='button' class='repeatTour'>Repeat Tour</button></td>"+
- "<td rowspan=\"2\" colspan=\"2\"><button id='done' type='button' class='done'>Done!</button></td>"+
- "</tr>"+
- "</table>"+
- "</center>"+
- "</div>";
-
- conclusionPanel.setBody(conclusionText);
- }
- /*
- * Restart the tour at the beginning.
- */
- var repeatTour = function(e) {
- console.log("repeating tour");
- e.stopPropagation();
- $('#joyRideTipContent').joyride({template : {'link':'<a href="#" class="joyride-close-tip">X</a>'},
- postStepCallback : function (index, tip) {
- if(index == 3) {
- console.log("finished tour");
- conclusionPanel.show();
- conclusionPanel.center();
- }
- }});
- conclusionPanel.hide();
- console.log("exiting repeat");
- }
- /*
- * Hide the tour.
- */
- var handleDone = function(e) {
- e.stopPropagation();
- console.log("tour done");
- conclusionPanel.hide();
- console.log("exiting tour done");
- }
- /*
- * Close the splash and go straight to worldview.
- */
- var handleSkipTour = function() {
- splashOverlay.hide();
- };
-
- /*
- * Close the splash and start the tour.
- */
- var handleTakeTour = function(e) {
- console.log("handleTakeTour " + e.target.id);
- e.stopPropagation();
- splashOverlay.hide();
-
- $('#joyRideTipContent').joyride({template : {'link':'<a href="#" class="joyride-close-tip">X</a>'},
- postStepCallback : function (index, tip) {
- if(index == 3) {
- console.log("finished tour");
- conclusionPanel.show();
- conclusionPanel.center();
- }
- }});
- }
-
- /*
- * Toggle the value of the "hideSplash" flag.
- */
- var setDoNotShow = function() {
- hideSplash = storageEngine.getItem('hideSplash');
- storageEngine.setItem('hideSplash', !hideSplash);
- };
-
-
- // assign events and start
- YAHOO.util.Event.on('takeTour', 'click', handleTakeTour);
- YAHOO.util.Event.on('skipTour', 'click', handleSkipTour);
- YAHOO.util.Event.on('dontShowAgain', 'click', setDoNotShow);
- YAHOO.util.Event.on('repeat', 'click', repeatTour);
- YAHOO.util.Event.on('done', 'click', handleDone);
- console.log("set all handlers");
-
- splashOverlay.render(document.body);
- conclusionPanel.render(document.body);
- splashOverlay.show();
- splashOverlay.center();
-}