Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Code formatting

ZachTRice4902ad0894cb
diff --git a/web/js/link/wv.link.ui.js b/web/js/link/wv.link.ui.js
index ae85632be..e92708b3e 100644
--- a/web/js/link/wv.link.ui.js
+++ b/web/js/link/wv.link.ui.js
@@ -81,33 +81,34 @@ wv.link.ui = wv.link.ui || function(models, config) {
item += "<div id='social-share'>";
// Facebook: https://developers.facebook.com/docs/sharing/reference/share-dialog#redirect
- item += "<a id='fb-share' class='icon-link fa fa-facebook fa-2x' href='https://www.facebook.com/dialog/share?";
- item += "app_id=" + fbAppId;
- item += "&href=" + defaultLink;
- item += "&redirect_uri=" + fbRedirectUri;
- item += "&display=popup' ";
- item += "target='_blank' ";
- item += "title='Share via Facebook!'></a>";
+ item += "<a id='fb-share' class='icon-link fa fa-facebook fa-2x' href='https://www.facebook.com/dialog/share?" +
+ "app_id=" + fbAppId +
+ "&href=" + defaultLink +
+ "&redirect_uri=" + fbRedirectUri +
+ "&display=popup' " +
+ "target='_blank' " +
+ "title='Share via Facebook!'></a>";
// Twitter: https://dev.twitter.com/web/tweet-button/parameters#web-intent-example
- item += "<a id='tw-share' class='icon-link fa fa-twitter fa-2x' href='https://twitter.com/intent/tweet?";
- item += "url=" + defaultLink;
- item += "&text=" + twMessage + "%20-' ";
- item += "target='_blank' ";
- item += "title='Share via Twitter!'></a>";
+ item += "<a id='tw-share' class='icon-link fa fa-twitter fa-2x' href='https://twitter.com/intent/tweet?" +
+ "url=" + defaultLink +
+ "&text=" + twMessage + "%20-' " +
+ "target='_blank' " +
+ "title='Share via Twitter!'></a>";
// Google Plus: https://developers.google.com/+/web/share/#sharelink-endpoint
- item += "<a id='gp-share' class='icon-link fa fa-google-plus fa-2x' href='https://plus.google.com/share?";
- item += "url=" + defaultLink + " ";
- item += "'target='_blank' ";
- item += "title='Share via Google Plus!'></a>";
+ item += "<a id='gp-share' class='icon-link fa fa-google-plus fa-2x' href='https://plus.google.com/share?" +
+ "url=" + defaultLink + " '" +
+ "target='_blank' " +
+ "title='Share via Google Plus!'></a>";
// Email
- item += "<a id='email-share' class='icon-link fa fa-envelope fa-2x' href='mailto:?";
- item += "subject=" + emailMessage;
- item += "&body=" + emailMessage + "%20-%20" + defaultLink + " '";
- item += "target='_self' ";
- item += "title='Share via Email!'></a>";
+ item += "<a id='email-share' class='icon-link fa fa-envelope fa-2x' href='mailto:?" +
+ "subject=" + emailMessage +
+ "&body=" + emailMessage + "%20-%20" + defaultLink + " '" +
+ "target='_self' " +
+ "title='Share via Email!'></a>";
+
item += "</div>";
$dialog.html(item).iCheck({checkboxClass: 'icheckbox_square-grey'});
@@ -156,21 +157,35 @@ wv.link.ui = wv.link.ui || function(models, config) {
if ( result.status_code === 200 ) {
var shortLink = result.data.url;
var shortEncodedLink = encodeURIComponent(shortLink);
+
// Set Facebook
var fbLink = document.getElementById("fb-share");
- fbLink.setAttribute("href", "https://www.facebook.com/dialog/share?app_id=" + fbAppId + "&href=" + shortEncodedLink + "&redirect_uri=" + fbRedirectUri + "&display=popup");
+ fbLink.setAttribute("href", "https://www.facebook.com/dialog/share?" +
+ "app_id=" + fbAppId +
+ "&href=" + shortEncodedLink +
+ "&redirect_uri=" + fbRedirectUri +
+ "&display=popup"
+ );
// Set Twitter
var twLink = document.getElementById("tw-share");
- twLink.setAttribute("href", "https://twitter.com/intent/tweet?url=" + shortEncodedLink + "&text=" + twMessage + "%20-");
+ twLink.setAttribute("href", "https://twitter.com/intent/tweet?" +
+ "url=" + shortEncodedLink +
+ "&text=" + twMessage + "%20-"
+ );
// Set Google Plus
var gpLink = document.getElementById("gp-share");
- gpLink.setAttribute("href", "https://plus.google.com/share?url=" + shortEncodedLink + "");
+ gpLink.setAttribute("href", "https://plus.google.com/share?" +
+ "url=" + shortEncodedLink
+ );
// Set Email
var emailLink = document.getElementById("email-share");
- emailLink.setAttribute("href", "mailto:?subject=" + emailMessage + "&body=" + emailMessage + "%20-%20" + shortEncodedLink + "");
+ emailLink.setAttribute("href", "mailto:?" +
+ "subject=" + emailMessage +
+ "&body=" + emailMessage + "%20-%20" + shortEncodedLink
+ );
return false;
} else {
error(result.status_code, result.status_txt);