Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Added correct skin, moved shorten to the left of the dialog to prevent it looking weird on Chrome when animating

Mike McGann4e90eafdaeab
diff --git a/src/css/wv.link.css b/src/css/wv.link.css
index 8bc618c3c..093a6dfef 100644
--- a/src/css/wv.link.css
+++ b/src/css/wv.link.css
@@ -5,6 +5,5 @@
#wv-link-shorten {
margin-top: 15px;
width: 100%;
- text-align: center;
}
diff --git a/src/ext/ui/iCheck-1.0.2/skins/square/blue.png b/src/ext/ui/iCheck-1.0.2/skins/square/blue.png
deleted file mode 100644
index a3e040fcc..000000000
Binary files a/src/ext/ui/iCheck-1.0.2/skins/square/blue.png and /dev/null differ
diff --git a/src/ext/ui/iCheck-1.0.2/skins/square/[email protected] b/src/ext/ui/iCheck-1.0.2/skins/square/[email protected]
deleted file mode 100644
index 8fdea12f9..000000000
Binary files a/src/ext/ui/iCheck-1.0.2/skins/square/[email protected] and /dev/null differ
diff --git a/src/ext/ui/iCheck-1.0.2/skins/square/blue.css b/src/ext/ui/iCheck-1.0.2/skins/square/grey.css
similarity index 61%
rename from src/ext/ui/iCheck-1.0.2/skins/square/blue.css
rename to src/ext/ui/iCheck-1.0.2/skins/square/grey.css
index f8db2ab6a..909db1ab7 100644
--- a/src/ext/ui/iCheck-1.0.2/skins/square/blue.css
+++ b/src/ext/ui/iCheck-1.0.2/skins/square/grey.css
@@ -1,7 +1,7 @@
-/* iCheck plugin Square skin, blue
+/* iCheck plugin Square skin, grey
----------------------------------- */
-.icheckbox_square-blue,
-.iradio_square-blue {
+.icheckbox_square-grey,
+.iradio_square-grey {
display: inline-block;
*display: inline;
vertical-align: middle;
@@ -9,50 +9,50 @@
padding: 0;
width: 22px;
height: 22px;
- background: url(blue.png) no-repeat;
+ background: url(grey.png) no-repeat;
border: none;
cursor: pointer;
}
-.icheckbox_square-blue {
+.icheckbox_square-grey {
background-position: 0 0;
}
- .icheckbox_square-blue.hover {
+ .icheckbox_square-grey.hover {
background-position: -24px 0;
}
- .icheckbox_square-blue.checked {
+ .icheckbox_square-grey.checked {
background-position: -48px 0;
}
- .icheckbox_square-blue.disabled {
+ .icheckbox_square-grey.disabled {
background-position: -72px 0;
cursor: default;
}
- .icheckbox_square-blue.checked.disabled {
+ .icheckbox_square-grey.checked.disabled {
background-position: -96px 0;
}
-.iradio_square-blue {
+.iradio_square-grey {
background-position: -120px 0;
}
- .iradio_square-blue.hover {
+ .iradio_square-grey.hover {
background-position: -144px 0;
}
- .iradio_square-blue.checked {
+ .iradio_square-grey.checked {
background-position: -168px 0;
}
- .iradio_square-blue.disabled {
+ .iradio_square-grey.disabled {
background-position: -192px 0;
cursor: default;
}
- .iradio_square-blue.checked.disabled {
+ .iradio_square-grey.checked.disabled {
background-position: -216px 0;
}
/* HiDPI support */
@media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) {
- .icheckbox_square-blue,
- .iradio_square-blue {
- background-image: url([email protected]);
+ .icheckbox_square-grey,
+ .iradio_square-grey {
+ background-image: url([email protected]);
-webkit-background-size: 240px 24px;
background-size: 240px 24px;
}
diff --git a/src/ext/ui/iCheck-1.0.2/skins/square/grey.png b/src/ext/ui/iCheck-1.0.2/skins/square/grey.png
new file mode 100644
index 000000000..f69375854
Binary files /dev/null and b/src/ext/ui/iCheck-1.0.2/skins/square/grey.png differ
diff --git a/src/ext/ui/iCheck-1.0.2/skins/square/[email protected] b/src/ext/ui/iCheck-1.0.2/skins/square/[email protected]
new file mode 100644
index 000000000..5d6341c05
Binary files /dev/null and b/src/ext/ui/iCheck-1.0.2/skins/square/[email protected] differ
diff --git a/src/js/link/wv.link.ui.js b/src/js/link/wv.link.ui.js
index 66e8a377e..527e0c105 100644
--- a/src/js/link/wv.link.ui.js
+++ b/src/js/link/wv.link.ui.js
@@ -67,7 +67,7 @@ wv.link.ui = wv.link.ui || function(models) {
var item = "<div id='wv-link' >" +
"<input type='text' value='' name='permalink_content' id='permalink_content' />";
if ( config.features.urlShortening ) {
- item += "<div id='wv-link-shorten'>" +
+ item += "<span autofocus></span><div id='wv-link-shorten'>" +
"<input type='checkbox' value='' id='wv-link-shorten-check' />" +
"<label id='wv-link-shorten-label' for='wv-link-shorten-check'>Shorten this link</label>" +
"</div>";
@@ -76,9 +76,21 @@ wv.link.ui = wv.link.ui || function(models) {
$dialog.html(item).iCheck({checkboxClass: 'icheckbox_square-grey'});
$('#permalink_content').val(link);
+
+ // If selected during the animation, the cursor will go to the
+ // end of the input box
setTimeout(function() {
$('#permalink_content').focus();
$('#permalink_content').select();
+ watcher = setInterval(function() {
+ var newLink = models.link.get();
+ if ( newLink !== longLink ) {
+ link = newLink;
+ longLink = link;
+ $("#wv-link-shorten-check").iCheck("uncheck");
+ update();
+ }
+ }, 100);
}, 500);
$dialog.dialog({
@@ -141,15 +153,7 @@ wv.link.ui = wv.link.ui || function(models) {
$("#wv-link-shorten-check").prop("checked", false);
- watcher = setInterval(function() {
- var newLink = models.link.get();
- if ( newLink !== longLink ) {
- link = newLink;
- longLink = link;
- $("#wv-link-shorten-check").iCheck("uncheck");
- update();
- }
- }, 100);
+
};
init();