Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fixed problem where tour panels stretch for narrow windows. changed the way mobile and border flags are handled.

Beth Timmonsa87fb2c8ca1c
diff --git a/css/ext/joyride-2.0.3/joyride-2.0.3.css b/css/ext/joyride-2.0.3/joyride-2.0.3.css
index 0c508759d..8b40572aa 100644
--- a/css/ext/joyride-2.0.3/joyride-2.0.3.css
+++ b/css/ext/joyride-2.0.3/joyride-2.0.3.css
@@ -32,20 +32,19 @@ body {
}
/* Mobile */
-@media only screen and (max-width: 767px) {
- .joyride-tip-guide {
- width: 95% !important;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- left: 2.5% !important;
- }
- .joyride-tip-guide-wrapper {
- width: 100%;
- }
+/* @media only screen and (max-width: 767px) */
+.joyride-tip-guide.mobile {
+ width: 95% !important;
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+ left: 2.5% !important;
}
-
+.joyride-tip-guide-wrapper.mobile {
+ width: 100%;
+}
+
/* Add a little css triangle pip, older browser just miss out on the fanciness of it */
.joyride-tip-guide span.joyride-nub {
display: block;
diff --git a/index.html b/index.html
index 639310c23..755408473 100755
--- a/index.html
+++ b/index.html
@@ -150,10 +150,10 @@
</div>
</div>
<ol id="joyRideTipContent">
- <li id="datePanel" data-id="timeecbutton" data-button="Next" data-options="tipLocation:top;tipAnimation:fade;nubPosition:bottom;bordered:true"></li>
- <li id="productPanel" data-id="products" data-button="Next" data-options="tipLocation:right;nubPosition:left;tipAnimation:fade;prevButton:true;bordered:true"></li>
- <li id="mapPanel" data-id="OpenLayers.Control.Panel_46" data-button="Next" data-options="tipLocation:left;nubPosition:left;prevButton:true;bordered:true"></li>
- <li id="toolbarPanel" data-id="toolbarlist" data-button="Next" data-options="tipLocation:bottom;nubPosition:top;tipAnimation:fade;prevButton:true;bordered:true"></li>
+ <li id="datePanel" data-id="timeecbutton" data-button="Next" data-options="tipLocation:top;tipAnimation:fade;nubPosition:bottom"></li>
+ <li id="productPanel" data-id="products" data-button="Next" data-options="tipLocation:right;nubPosition:left;tipAnimation:fade;prevButton:true"></li>
+ <li id="mapPanel" data-id="OpenLayers.Control.Panel_46" data-button="Next" data-options="tipLocation:left;nubPosition:left;prevButton:true"></li>
+ <li id="toolbarPanel" data-id="toolbarlist" data-button="Next" data-options="tipLocation:bottom;nubPosition:top;tipAnimation:fade;prevButton:true"></li>
</ol>
<!-- Crazy Egg Metrics -->
diff --git a/js/ext/joyride-2.0.3/jquery.joyride-2.0.3.js b/js/ext/joyride-2.0.3/jquery.joyride-2.0.3.js
index e42e27966..063020c35 100644
--- a/js/ext/joyride-2.0.3/jquery.joyride-2.0.3.js
+++ b/js/ext/joyride-2.0.3/jquery.joyride-2.0.3.js
@@ -31,6 +31,7 @@
'postRideCallback' : $.noop, // A method to call once the tour closes (canceled or complete)
'postStepCallback' : $.noop, // A method to call after each step
'bordered' : false, // true or false to control whether a border is shown
+ 'adjustForPhone' : true, // change window position for phones (if false, windows show in default position)
'template' : { // HTML segments for tip layout
'link' : '<a href="#close" class="joyride-close-tip">X</a>',
'timer' : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
@@ -168,25 +169,15 @@
var opts_arr = (opts.li.data('options') || ':').split(';');
var opts_len = opts_arr.length;
var ii, p;
- var isBordered;
+ var isBordered = settings.bordered;
- // parse options
- for (ii = opts_len - 1; ii >= 0; ii--) {
- p = opts_arr[ii].split(':');
-
- if(p.length == 2) {
- if(p[0] == "bordered") {
- isBordered = p[1];
- }
- }
- }
-
opts.tip_class = opts.tip_class || '';
if(isBordered) {
opts.tip_class = "bordered";
}
$blank = $(settings.template.tip).addClass(opts.tip_class);
+
content = $.trim($(opts.li).html()) +
methods.button_text(opts.button_text, opts.li) +
settings.template.link +
@@ -226,10 +217,7 @@
p = opts_arr[ii].split(':');
if (p.length === 2) {
- if(p[0] == "bordered") {
- console.log("in button_text, bordered = " + p[1]);
- }
- if(p[0] == "prevButton") {
+ if(p[0] == "prevButton") {
if(p[1] == "true") {
hasPrev = true;
}
@@ -490,11 +478,18 @@
// detect phones with media queries if supported.
is_phone : function () {
- if (Modernizr) {
- return Modernizr.mq('only screen and (max-width: 767px)');
- }
+ if(settings.adjustForPhone) {
+ console.log("adjustForPhone");
+ if (Modernizr) {
+ return Modernizr.mq('only screen and (max-width: 767px)');
+ }
- return (settings.$window.width() < 767) ? true : false;
+ return (settings.$window.width() < 767) ? true : false;
+ }
+ else {
+ console.log("no adjustForPhone");
+ return false;
+ }
},
hide : function () {
@@ -605,6 +600,8 @@
nub_height = Math.ceil($nub.outerHeight() / 2),
toggle = init || false;
+ settings.$next_tip.removeClass("mobile");
+
// tip must not be "display: none" to calculate position
if (toggle) {
settings.$next_tip.css('visibility', 'hidden');
@@ -678,6 +675,8 @@
nub_height = Math.ceil($nub.outerHeight() / 2),
toggle = init || false;
+ settings.$next_tip.addClass("mobile");
+
// tip must not be "display: none" to calculate position
if (toggle) {
settings.$prev_tip.css('visibility', 'hidden');
@@ -743,6 +742,7 @@
},
pos_phone : function (init) {
+ console.log("pos_phone");
var tip_height = settings.$next_tip.outerHeight(),
tip_offset = settings.$next_tip.offset(),
target_height = settings.$target.outerHeight(),
@@ -755,11 +755,13 @@
.removeClass('right')
.removeClass('left');
+ settings.$next_tip.addClass("mobile");
+
if (toggle) {
settings.$next_tip.css('visibility', 'hidden');
settings.$next_tip.show();
}
-
+
if (!/body/i.test(settings.$target.selector)) {
if (methods.top()) {
diff --git a/js/tour.js b/js/tour.js
index 95f1e3ef1..1b15034af 100644
--- a/js/tour.js
+++ b/js/tour.js
@@ -23,7 +23,7 @@ Worldview.namespace("Tour");
console.log("DEVICE: width = " + devWidth + ", height = " + devHeight);
console.log("VIEWPORT: width = " + viewWidth + ", height = " + viewHeight);
- if(devWidth < 500 || viewWidth < 500 || devHeight < 500 || viewHeight < 500) {
+ if(devWidth < 768 || viewWidth < 768 || devHeight < 600 || viewHeight < 600) {
if(noDisable) {
Worldview.notify("Unfortunately the Worldview tour can only be viewed in larger web browser windows.");
}
@@ -218,7 +218,9 @@ Worldview.namespace("Tour");
var repeatTour = function(e) {
console.log("repeating tour");
e.stopPropagation();
- $('#joyRideTipContent').joyride({template : {'link':'<a href="#" class="joyride-close-tip">X</a>'},
+ $('#joyRideTipContent').joyride({adjustForPhone:false,
+ bordered:true,
+ template : {'link':'<a href="#" class="joyride-close-tip">X</a>'},
postStepCallback : function (index, tip) {
if(index == 3) {
console.log("finished tour");
@@ -255,7 +257,9 @@ Worldview.namespace("Tour");
e.stopPropagation();
splashOverlay.hide();
- $('#joyRideTipContent').joyride({template : {'link':'<a href="#" class="joyride-close-tip">X</a>'},
+ $('#joyRideTipContent').joyride({adjustForPhone:false,
+ bordered:true,
+ template : {'link':'<a href="#" class="joyride-close-tip">X</a>'},
postStepCallback : function (index, tip) {
if(index == 3) {
console.log("finished tour");