Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Name exports

Jo Sprague1c5169c791cd
diff --git a/web/js/brand.js b/web/js/brand.js
index a28a274a4..5b5537ff5 100644
--- a/web/js/brand.js
+++ b/web/js/brand.js
@@ -1,2 +1,2 @@
/* This file is just a stub to test the browserify build task */
-export default function () {};
+export function brand () {};
diff --git a/web/js/index.js b/web/js/index.js
index 4038d587e..a8d5a2ba7 100644
--- a/web/js/index.js
+++ b/web/js/index.js
@@ -1,3 +1,3 @@
-export { default as stub } from './stub';
-export { default as polyfill } from './polyfill';
-export { default as util } from './util/util';
+export { stub, stub2 } from './stub';
+export { polyfill } from './polyfill';
+export { util } from './util/util';
diff --git a/web/js/polyfill.js b/web/js/polyfill.js
index 44f3410dd..3dc24b4eb 100644
--- a/web/js/polyfill.js
+++ b/web/js/polyfill.js
@@ -6,9 +6,9 @@
// ===========================================================================
import $ from 'jquery';
-import { default as browser } from './util/browser.js';
+import util from './util/util.js';
-export default function () {
+export function polyfill () {
/*
* Date.toISOString
*
@@ -84,7 +84,7 @@ export default function () {
*
* https://developer.mozilla.org/en-US/docs/Web/API/Window.setTimeout
*/
- if (browser.ie && browser.version <= 9) {
+ if (util.browser.ie && util.browser.version <= 9) {
(function () {
var __nativeST__ = window.setTimeout,
__nativeSI__ = window.setInterval;
diff --git a/web/js/stub.js b/web/js/stub.js
index 3f858af9d..abb7db0dd 100644
--- a/web/js/stub.js
+++ b/web/js/stub.js
@@ -1,8 +1,12 @@
/* This file is just a stub to test the browserify build task */
-import { jQuery as $ } from 'jquery';
-import { GA } from 'worldview-components';
+import $ from 'jquery';
+import GA from 'worldview-components';
-export default function () {
+export function stub() {
console.log($, GA);
};
+
+export const stub2 = (function() {
+ return 'stub';
+})();
diff --git a/web/js/ui/ui.js b/web/js/ui/ui.js
index a28a274a4..d965ff407 100644
--- a/web/js/ui/ui.js
+++ b/web/js/ui/ui.js
@@ -1,2 +1,2 @@
/* This file is just a stub to test the browserify build task */
-export default function () {};
+export function wvui () {};
diff --git a/web/js/util/browser.js b/web/js/util/browser.js
index 95654cbd9..a736ec192 100644
--- a/web/js/util/browser.js
+++ b/web/js/util/browser.js
@@ -1,6 +1,6 @@
import $ from 'jquery';
-export default (function () {
+export const browser = (function () {
var self = {};
/**
diff --git a/web/js/util/events.js b/web/js/util/events.js
index becc3c65f..bf454b8e3 100644
--- a/web/js/util/events.js
+++ b/web/js/util/events.js
@@ -1,6 +1,6 @@
import { each, pull } from 'lodash';
-export default function () {
+export function events () {
var self = {};
// Object of event types. Each event type is an array of listeners.
diff --git a/web/js/util/load.js b/web/js/util/load.js
index e5ba0b2f6..c2c809ef4 100644
--- a/web/js/util/load.js
+++ b/web/js/util/load.js
@@ -1,9 +1,9 @@
import $ from 'jquery';
-import { size } from 'lodash';
-import { default as uiUtils } from '../ui/ui.js';
-import { default as brand } from '../brand.js';
+import size from 'lodash';
+import wvui from '../ui/ui.js';
+import brand from '../brand.js';
-export default (function () {
+export const load = (function () {
var self = {};
var configPromises = {};
var loading = 0;
@@ -25,7 +25,7 @@ export default (function () {
promise = $.getJSON(brand.url(url));
if (loading === 1) {
indicatorTimeout = setTimeout(function () {
- indicatorId = uiUtils.indicator.loading();
+ indicatorId = wvui.indicator.loading();
}, 2000);
}
promise.done(function (result) {
@@ -37,10 +37,10 @@ export default (function () {
if (loading === 0) {
clearTimeout(indicatorTimeout);
indicatorTimeout = null;
- uiUtils.indicator.hide(indicatorId);
+ wvui.indicator.hide(indicatorId);
}
})
- .fail(uiUtils.error);
+ .fail(wvui.error);
configPromises[url] = promise;
}
diff --git a/web/js/util/util.js b/web/js/util/util.js
index 579bd6665..564529ee4 100644
--- a/web/js/util/util.js
+++ b/web/js/util/util.js
@@ -2,12 +2,12 @@
import $ from 'jquery';
import { each, isNull } from 'lodash';
-import { default as uiUtils } from '../ui/ui.js';
-import { default as browser } from './browser.js';
-import { default as events } from './events.js';
-import { default as load } from './load.js';
+import wvui from '../ui/ui.js';
+import browser from './browser.js';
+import events from './events.js';
+import load from './load.js';
-export default (function () {
+export const util = (function () {
var self = {};
var canvas = null;
@@ -535,7 +535,7 @@ export default (function () {
* @param {Exception} cause The exception object that caused the error
*/
self.error = function (message, cause) {
- uiUtils.error(message, cause);
+ wvui.error(message, cause);
};
/**
diff --git a/web/js/wv.main.js b/web/js/wv.main.js
index 6a4fb01b7..e5c5714d2 100644
--- a/web/js/wv.main.js
+++ b/web/js/wv.main.js
@@ -5,7 +5,6 @@ import {GA as googleAnalytics} from 'worldview-components';
// Utils
import util from './util/util'; // Maybe this is the time to remove the util file from core and put everything from there in the worldview-components util....
-import browser from './util/util.browser';
// Date
import {dateParser} from './date/date'; // export default function parse!!!
import DateModel from './date/date.model';
@@ -75,7 +74,7 @@ import {debugConfig, debug} from './debug';
import Brand from './brand';
import Tour from './tour';
-import { default as polyfill } from './polyfill';
+import polyfill from './polyfill';
polyfill(); // Polyfills some browser features
// Document ready function
@@ -255,7 +254,7 @@ window.onload = () => {
ui.dateLabel = DateLabel(models);
}
if (config.startDate) {
- if (!browser.small) { // If mobile device, do not build timeline
+ if (!util.browser.small) { // If mobile device, do not build timeline
timelineInit();
}
ui.dateWheels = DateWheels(models, config);
@@ -281,7 +280,7 @@ window.onload = () => {
// FIXME: Old hack
$(window)
.resize(function() {
- if (browser.small) {
+ if (util.browser.small) {
$('#productsHoldertabs li.first a')
.trigger('click');
}