Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Build can now be configured by options

Mike McGann4a3ca1567f64
diff --git a/.gitignore b/.gitignore
index 78ae67106..a39f4e723 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ tools
*~
*.swp
conf/web/eosdis
+options.json
diff --git a/Gruntfile.js b/Gruntfile.js
index 5fa6ba01f..6ff9de9d3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -28,20 +28,43 @@ module.exports = function(grunt) {
var wvJs = grunt.file.readJSON("etc/deploy/wv.js.json");
var wvCss = grunt.file.readJSON("etc/deploy/wv.css.json");
+ // Copyright notice to place at the top of the minified JavaScript and
+ // CSS files
+ var banner = grunt.file.read("etc/deploy/banner.txt");
+
+ // Build options
+ var pkg = grunt.file.readJSON("package.json");
+ var options = {};
+ if ( fs.existsSync("options.json") ) {
+ options = grunt.file.readJSON("options.json");
+ }
+ options.officialName = options.officialName || "EOSDIS Worldview (Alpha)";
+ options.longName = options.longName || "EOSDIS Worldview";
+ options.shortName = options.shortName || "Worldview";
+
+ options.email = options.email || "[email protected]";
+ options.webmasters = options.webmasters || "";
+
var bitly = fs.existsSync("conf/bitly_config.py");
var eosdis = fs.existsSync("conf/web/eosdis");
var gibsOps = !process.env.GIBS_HOST;
- var official = bitly && eosdis && gibsOps;
- var pkg = grunt.file.readJSON("package.json");
+ var official = bitly && eosdis && gibsOps &&
+ options.email === "[email protected]";
console.log();
console.log("============================================================");
- console.log("[" + pkg.name + "] " + pkg.longName + ", Version " +
+ console.log("[" + pkg.name + "] " + options.officialName + ", Version " +
pkg.version + "-" + pkg.release);
console.log("");
+ console.log("Long name : " + options.officialName);
+ console.log("Short name : " + options.shortName);
console.log("GIBS public servers: " + gibsOps);
console.log("bit.ly support : " + bitly);
console.log("EOSDIS options : " + eosdis);
+ console.log("Support email : " + options.email);
+ console.log("Webmasters : " + options.webmasters);
+
+
if ( !official ) {
console.error();
grunt.log.error("WARNING: This is NOT a standard configuration");
@@ -49,9 +72,6 @@ module.exports = function(grunt) {
console.log("============================================================");
console.log();
- // Copyright notice to place at the top of the minified JavaScript and
- // CSS files
- var banner = grunt.file.read("etc/deploy/banner.txt");
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
@@ -228,7 +248,7 @@ module.exports = function(grunt) {
replace: {
// Official name of the application
- name: {
+ tokens: {
src: [
"build/worldview-debug/web/*.html",
"build/worldview-debug/web/js/**/*.js",
@@ -236,50 +256,32 @@ module.exports = function(grunt) {
],
overwrite: true,
replacements: [{
+ from: "@OFFICIAL_NAME@",
+ to: options.officialName
+ }, {
from: "@LONG_NAME@",
- to: "<%= pkg.longName %>"
+ to: options.longName
},{
from: "@NAME@",
- to: "<%= pkg.shortName %>"
- }]
- },
- // Add in the timestamp of the build as needed
- timestamp: {
- src: [
- "build/worldview-debug/web/js/**/*.js",
- "build/worldview-debug/web/pages/**/*.html"
- ],
- overwrite: true,
- replacements: [{
+ to: options.shortName
+ },{
+ from: "@EMAIL@",
+ to: options.email
+ },{
+ from: "@WEBMASTERS@",
+ to: options.webmasters
+ },{
from: "@BUILD_TIMESTAMP@",
to: buildTimestamp
- }]
- },
- // Add in the version of this build as needed. Update the version
- // in package.json
- version: {
- src: [
- "build/worldview-debug/web/js/**/*.js",
- "build/worldview-debug/web/pages/**/*.html"
- ],
- overwrite: true,
- replacements: [{
+ },{
from: "@BUILD_VERSION@",
to: "<%= pkg.version %>"
- }]
- },
- // Add in a timestamp nonce to URIs for cache busting
- nonce: {
- src: [
- "build/worldview-debug/web/**/*.html",
- "build/worldview-debug/web/**/*.js"
- ],
- overwrite: true,
- replacements: [{
+ },{
from: "@BUILD_NONCE@",
to: buildNonce
}]
},
+
// Remove all development links <!-- link.dev --> and uncomment
// all the release links <1-- link.prod -->
links: {
@@ -493,10 +495,7 @@ module.exports = function(grunt) {
"config",
"copy:source",
"concat",
- "replace:name",
- "replace:timestamp",
- "replace:nonce",
- "replace:version",
+ "replace:tokens",
"replace:links",
"remove:source",
"copy:release",
diff --git a/options.sample.json b/options.sample.json
new file mode 100644
index 000000000..ff7d79c15
--- /dev/null
+++ b/options.sample.json
@@ -0,0 +1,7 @@
+{
+ "officialName": "EOSDIS Worldview (Alpha)",
+ "longName": "EOSDIS Worldview",
+ "shortName": "Worldview",
+ "email": "[email protected]",
+ "webmasters": "[email protected]"
+}
diff --git a/package.json b/package.json
index 18376fb9b..bafd2b08a 100644
--- a/package.json
+++ b/package.json
@@ -1,14 +1,12 @@
{
"name": "worldview",
- "longName": "EOSDIS Worldview (Alpha)",
- "shortName": "Worldview",
"version": "0.7.0",
"release": "1",
- "author": "Worldview Team <[email protected]>",
+ "author": "Worldview Team",
"description": "Browse full-resolution, near real-time satellite imagery",
"repository": {
"type": "git",
- "url": "https://git.earthdata.nasa.gov/scm/wor/worldview.git"
+ "url": "https://github.com/nasa-gibs/worldview.git"
},
"devDependencies": {
"buster": "0.7.x",
diff --git a/src/index.html b/src/index.html
index eacc3ac20..13a377420 100644
--- a/src/index.html
+++ b/src/index.html
@@ -14,7 +14,7 @@
-->
<html>
<head>
- <title>@LONG_NAME@</title>
+ <title>@OFFICIAL_NAME@</title>
<script type="text/javascript">
if ( /MSIE (\d+\.\d+);/.test(navigator.userAgent) && ! /unsupported/.test(location.search) ) {
@@ -187,20 +187,6 @@
<div id="banner"><div id="wv-logo"></div>
<ul id="toolbarlist">
<li id="wv-info-button" class="wv-toolbar-button"></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 id="wv-tour" title="Start Tour">Start Tour</a>
- <a href="javascript:wv.ui.about.show();" title="About Worldview">About</a>
- </div>
- </div>
- </li>
- -->
<li id="wv-image-button" class="wv-toolbar-button"></li>
<li id="wv-proj-button" class="wv-toolbar-button"></li>
<li id="wv-link-button" class="wv-toolbar-button"></li>
diff --git a/src/js/ui/wv.ui.info.js b/src/js/ui/wv.ui.info.js
index 0a379f7b2..e1781e6d1 100644
--- a/src/js/ui/wv.ui.info.js
+++ b/src/js/ui/wv.ui.info.js
@@ -38,7 +38,7 @@ wv.ui.info = wv.ui.info || (function(ui) {
var $menu = $("<div></div>").attr("id", "wv-info-menu");
var $menuItems = $("<ul></ul>");
- var $feedback = $("<li><a><i class='ui-icon icon-large fa fa-envelope fa-fw'></i>Feedback</a></li>");
+ var $feedback = $("<li><a href='mailto:@MAIL@?subject=Feedback for @LONG_NAME@ tool' target='_blank'><i class='ui-icon icon-large fa fa-envelope fa-fw'></i>Feedback</a></li>");
var $tour = $("<li><a><i class='ui-icon fa fa-truck fa-fw'></i>Start Tour</a></li>");
var $about = $("<li><a><i class='ui-icon fa fa-file fa-fw'></i>About</a></li>");
diff --git a/src/js/ui/wv.ui.js b/src/js/ui/wv.ui.js
index 05fd2f480..d1533d220 100644
--- a/src/js/ui/wv.ui.js
+++ b/src/js/ui/wv.ui.js
@@ -44,8 +44,8 @@ wv.ui = (function(self) {
"</div>" +
"<div class='error-body'>Please reload the page and try " +
"again. If you continue to have problems, contact us at " +
- "<a href='mailto:[email protected]'>" +
+ "<a href='mailto:@MAIL@'>" +
+ "@MAIL@</a>" +
"</div>", {
title: "Error",
height: 175
diff --git a/src/js/wv.main.js b/src/js/wv.main.js
index a2122bb0b..e640c93e7 100644
--- a/src/js/wv.main.js
+++ b/src/js/wv.main.js
@@ -196,8 +196,8 @@ $(function() {
"Incomplete configuration<br><br>" +
layersRemoved + " layer(s) were removed<br><br>" +
"Contact us at " +
- "<a href='mailto:[email protected]'>" +
+ "<a href='mailto:@MAIL@'>" +
+ "@MAIL@</a>");
}
};
diff --git a/src/pages/about.html b/src/pages/about.html
index 4f90b5484..3a2f161a4 100644
--- a/src/pages/about.html
+++ b/src/pages/about.html
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
- <title>@LONG_NAME@ - About</title>
+ <title>@OFFICIAL_NAME@ - About</title>
<link type="text/css" href="css/wv.document.css?v=@BUILD_NONCE@" rel="Stylesheet" />
<link type="text/css" href="css/wv.standalone.css?v=@BUILD_NONCE@" rel="Stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -142,14 +142,7 @@
<div>
@BUILD_TIMESTAMP@
</div>
- <div>
- Release Management:
- <a href='mailto:[email protected]'>Mike McGann</a>
- </div>
- <div>
- Responsible NASA Official:
- <a href='mailto:[email protected]'>Ryan Boller</a>
- </div>
+ @WEBMASTERS@
</p>
</div>
diff --git a/src/pages/release_notes.html b/src/pages/release_notes.html
index d4ab694ef..90c9c58b7 100644
--- a/src/pages/release_notes.html
+++ b/src/pages/release_notes.html
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
- <title>EOSDIS Worldview - Release Notes</title>
+ <title>@OFFICIAL_NAME@ - Release Notes</title>
<link type="text/css" href="../css/pages.css?v=@BUILD_NONCE@" rel="Stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
@@ -12,7 +12,7 @@
</div>
<div id="page">
- <h1 class="title">NASA EOSDIS Worldview</h1>
+ <h1 class="title">@OFFICIAL_NAME@</h1>
<h2 class="subtitle">Release Notes</h2>
<hr/>
diff --git a/src/pages/unsupported_browser.html b/src/pages/unsupported_browser.html
index ecf9cea72..467cf8bbb 100644
--- a/src/pages/unsupported_browser.html
+++ b/src/pages/unsupported_browser.html
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
- <title>EOSDIS Worldview (Alpha)</title>
+ <title>@OFFICIAL_NAME@</title>
<style>
body {
background-color: black;