Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

About to wv.ui.about

Mike McGann5caedaa6d483
diff --git a/etc/deploy/wv.js.json b/etc/deploy/wv.js.json
index 7eaf026d8..2594e82d2 100644
--- a/etc/deploy/wv.js.json
+++ b/etc/deploy/wv.js.json
@@ -14,8 +14,8 @@
"src/js/util/wv.util.js",
"src/js/util/wv.util.events.js",
"src/js/ui/wv.ui.js",
+ "src/js/ui/wv.ui.about.js",
"src/js/Worldview.js",
- "src/js/Worldview/About.js",
"src/js/Worldview/Support.js",
"src/js/Worldview/Support.js",
"src/js/link/wv.link.model.js",
diff --git a/src/index.html b/src/index.html
index cf22125c5..ecaa54aef 100644
--- a/src/index.html
+++ b/src/index.html
@@ -128,9 +128,9 @@
<!-- link.dev --> <script type="text/javascript" src="js/util/wv.util.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/util/wv.util.events.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/ui/wv.ui.js"></script>
+ <!-- link.dev --> <script type="text/javascript" src="js/ui/wv.ui.about.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview.js"></script>
- <!-- link.dev --> <script type="text/javascript" src="js/Worldview/About.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Support.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Scheduler.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/link/wv.link.model.js"></script>
@@ -240,7 +240,7 @@
<div data-role="content">
<div id="banner"><div id="wv-logo"></div>
<ul id="toolbarlist">
- <li class="toolbar-icon"><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(null, false, true);" title="Start Tour">Start Tour</a><a href="javascript:Worldview.About.show();" title="About Worldview">About</a></div></div></li>
+ <li class="toolbar-icon"><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(null, false, true);" title="Start Tour">Start Tour</a><a href="javascript:wv.ui.about.show();" title="About Worldview">About</a></div></div></li>
<li class="toolbar-icon"><div id="camera"></div></li>
<li class="toolbar-icon"><div id="projection"></div></li>
<li id="wv-link" class="toolbar-icon"></li>
diff --git a/src/js/Worldview.js b/src/js/Worldview.js
index b5baa55d3..faacb5d11 100644
--- a/src/js/Worldview.js
+++ b/src/js/Worldview.js
@@ -156,37 +156,6 @@
}
};
- /**
- * Displays a message to the end user in a dialog box.
- *
- * @method notify
- * @static
- *
- * @param {string} The message to display to the user.
- *
- * @param [title="Notice"] {string} Title for the dialog box.
- */
- ns.notify = function(message, title) {
- if ( window.YAHOO && window.YAHOO.widget &&
- window.YAHOO.widget.Panel ) {
- o = new YAHOO.widget.Panel("WVerror", {
- width: "300px",
- zIndex: 1020,
- visible: false,
- constraintoviewport: true
- });
- title = title || "Notice";
- o.setHeader(title);
- o.setBody(message);
- o.render(document.body);
- o.show();
- o.center();
- o.hideEvent.subscribe(function(i) {
- setTimeout(function() {o.destroy();}, 25);
- });
- }
- };
-
/**
* Asks the end user a yes or no question in a dialog box.
*
diff --git a/src/js/Worldview/Support.js b/src/js/Worldview/Support.js
index 6b6833ada..92da86c19 100644
--- a/src/js/Worldview/Support.js
+++ b/src/js/Worldview/Support.js
@@ -47,7 +47,7 @@ Worldview.namespace("Support");
} else {
prefix = "The " + featureName + " feature";
}
- Worldview.notify(prefix + " is not supported with your web " +
+ wv.ui.notify(prefix + " is not supported with your web " +
"browser. Upgrade or try again in a different browser.");
};
@@ -132,7 +132,7 @@ Worldview.namespace("Support");
mobileSafari = true;
}
addEventListener("load", function() {
- setTimeout(hideURLbar, 0);
+ setTimeout(hideURLbar, 0);
}, false);
addEventListener("orientationchange", function() {
setTimeout(hideURLbar, 0);
@@ -158,8 +158,8 @@ Worldview.namespace("Support");
setHeight($('#app'));
});
}
-
-
+
+
};
var modernSetTimeout = function() {
diff --git a/src/js/Worldview/Widget/DataDownload.js b/src/js/Worldview/Widget/DataDownload.js
index de2731baa..a11da4861 100644
--- a/src/js/Worldview/Widget/DataDownload.js
+++ b/src/js/Worldview/Widget/DataDownload.js
@@ -151,7 +151,7 @@ Worldview.Widget.DataDownload = function(config, spec) {
var $productSelector = $("<input type='radio'></input>")
.attr("value", key)
.attr("data-product", key);
-
+
$header.prepend($productSelector).append($selectedCount);
}
if ( model.selectedProduct === key ) {
@@ -174,7 +174,7 @@ Worldview.Widget.DataDownload = function(config, spec) {
});
})
.append($header);
-
+
$content.append($contentDlGroup);
var $products = $("<ul></ul>")
@@ -330,7 +330,7 @@ Worldview.Widget.DataDownload = function(config, spec) {
log.debug("queryError", status, error);
Worldview.Indicator.hide();
if ( status !== "abort" ) {
- Worldview.notify("Unable to search at this time. Please try " +
+ wv.ui.notify("Unable to search at this time. Please try " +
"again later");
}
};
@@ -339,7 +339,7 @@ Worldview.Widget.DataDownload = function(config, spec) {
queryActive = false;
log.debug("queryTimeout");
Worldview.Indicator.hide();
- Worldview.notify(
+ wv.ui.notify(
"No results received yet. This may be due to a " +
"connectivity issue. Please try again later."
);
diff --git a/src/js/link/wv.link.ui.js b/src/js/link/wv.link.ui.js
index e0755a4ea..806e0b416 100644
--- a/src/js/link/wv.link.ui.js
+++ b/src/js/link/wv.link.ui.js
@@ -70,7 +70,7 @@ wv.link.ui = wv.link.ui || function(models) {
permOverlay.hide();
console.warn("Unable to shorten URL");
console.warn.apply(console, arguments);
- Worldview.notify("Unable to shorten the permalink at this time. " +
+ wv.ui.notify("Unable to shorten the permalink at this time. " +
"Please try again later.");
};
diff --git a/src/js/tour.js b/src/js/tour.js
index e0e24023a..0e0a68a2d 100644
--- a/src/js/tour.js
+++ b/src/js/tour.js
@@ -19,7 +19,7 @@ Worldview.namespace("Tour");
var version = Worldview.Support.VERSION;
if (browser === "IE" && version <= 9) {
if (noDisable) {
- Worldview.notify("The Worldivew tour is not supported in " +
+ wv.ui.notify("The Worldivew tour is not supported in " +
"this browser version. Upgrade or try again in a " +
"different browser.");
}
@@ -36,7 +36,7 @@ Worldview.namespace("Tour");
if(viewWidth < 768 || viewHeight < 680) {
if(noDisable) {
- Worldview.notify("Unfortunately the Worldview tour can only be viewed in larger web browser windows.");
+ wv.ui.notify("Unfortunately the Worldview tour can only be viewed in larger web browser windows.");
}
return;
}
diff --git a/src/js/Worldview/About.js b/src/js/ui/wv.ui.about.js
similarity index 95%
rename from src/js/Worldview/About.js
rename to src/js/ui/wv.ui.about.js
index bd030a4b8..489d1f9eb 100644
--- a/src/js/Worldview/About.js
+++ b/src/js/ui/wv.ui.about.js
@@ -4,15 +4,16 @@
* This code was originally developed at NASA/Goddard Space Flight Center for
* the Earth Science Data and Information System (ESDIS) project.
*
- * Copyright (C) 2013 United States Government as represented by the
+ * Copyright (C) 2013 - 2014 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*/
/**
- * @module Worldview
+ * @module wv.ui
*/
-Worldview.namespace("About");
+var wv = wv || {};
+wv.ui = wv.ui || {};
/**
* Displays the Worldview about box. If this is a desktop device, a full
@@ -20,12 +21,12 @@ Worldview.namespace("About");
* device, a small dialog box is shown with links to a page that contains
* the full information.
*
- * @class About
+ * @class wv.ui.about
* @static
*/
-$(function() {
+wv.ui.about = wv.ui.about || (function() {
- var ns = Worldview.About;
+ var self = {};
var overlay;
/**
@@ -33,8 +34,8 @@ $(function() {
*
* @method show
*/
- ns.show = function() {
- if ( $(window).width() < 750 ) {
+ self.show = function() {
+ if ( wv.ui.mobile() ) {
showMobile();
} else {
showDesktop();
@@ -107,7 +108,10 @@ $(function() {
"<a href='pages/release_notes.html' target='_blank'>Release Notes</a>",
"</div>",
].join("\n");
- Worldview.notify(html, "&nbsp;");
+ wv.ui.notify(html, "&nbsp;");
};
-});
+
+ return self;
+
+})();
diff --git a/src/js/ui/wv.ui.js b/src/js/ui/wv.ui.js
index 839645706..dff915dd5 100644
--- a/src/js/ui/wv.ui.js
+++ b/src/js/ui/wv.ui.js
@@ -76,6 +76,37 @@ wv.ui = (function(self) {
}
};
+ /**
+ * Displays a message to the end user in a dialog box.
+ *
+ * @method notify
+ * @static
+ *
+ * @param {string} The message to display to the user.
+ *
+ * @param [title="Notice"] {string} Title for the dialog box.
+ */
+ self.notify = function(message, title) {
+ if ( window.YAHOO && window.YAHOO.widget &&
+ window.YAHOO.widget.Panel ) {
+ o = new YAHOO.widget.Panel("WVerror", {
+ width: "300px",
+ zIndex: 1020,
+ visible: false,
+ constraintoviewport: true
+ });
+ title = title || "Notice";
+ o.setHeader(title);
+ o.setBody(message);
+ o.render(document.body);
+ o.show();
+ o.center();
+ o.hideEvent.subscribe(function(i) {
+ setTimeout(function() {o.destroy();}, 25);
+ });
+ }
+ };
+
return self;
})(wv.ui || {});
\ No newline at end of file