Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

events is now a feature

Taylor Gunnoe432fa64dcd15
diff --git a/web/js/util/wv.util.js b/web/js/util/wv.util.js
index 0ef4de154..67241b062 100644
--- a/web/js/util/wv.util.js
+++ b/web/js/util/wv.util.js
@@ -261,6 +261,54 @@ wv.util = (function(self) {
return lastDay.getUTCDate();
};
+ /**
+ * Returns the day of week for the given date
+ *
+ * @method giveWeek
+ * @static
+ * @param date {Date} date of which to determine week day
+ * @return {String} the full name of the day of the week
+ */
+ self.giveWeekDay = function( d ) {
+ var day = [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ ];
+
+ return day[d.getUTCDay()];
+ };
+ /**
+ * Returns the month of the year for the given date
+ *
+ * @method giveMonth
+ * @static
+ * @param date {Date} date of which to determine the Month
+ * @return {String} the full name of the month
+ */
+ self.giveMonth = function( d ) {
+ var month = [
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"
+ ];
+
+ return month[d.getUTCMonth()];
+ };
+
self.clamp = function(val, min, max) {
if ( val < min ) { return min; }
if ( val > max ) { return max; }
diff --git a/web/js/wv.main.js b/web/js/wv.main.js
index b55cededd..120e3bc33 100644
--- a/web/js/wv.main.js
+++ b/web/js/wv.main.js
@@ -132,7 +132,7 @@ $(function() {
if ( config.features.dataDownload ) {
models.data = wv.data.model(models, config);
}
- if ( config.features.dataDownload) {
+ if ( config.features.dataDownload ) {
models.link.register(models.data);
}
// HACK: Map needs permalink state loaded before starting. But
@@ -172,10 +172,12 @@ $(function() {
// FIXME: Why is this here?
ui.data.render();
}
+ if ( config.features.naturalEvents ) {
+ ui.events = wv.events(models, ui, config);
+ }
ui.link = wv.link.ui(models, config);
ui.tour = wv.tour(models, ui, config);
ui.info = wv.ui.info(ui, config);
- ui.events = wv.events(models, ui);
//FIXME: Old hack
$(window).resize(function() {