Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Began converting react component based code to something usable

ZachTRicecccedac1958d
diff --git a/web/js/link/wv.link.ui.js b/web/js/link/wv.link.ui.js
index 4ae920ed6..edccbca02 100644
--- a/web/js/link/wv.link.ui.js
+++ b/web/js/link/wv.link.ui.js
@@ -68,6 +68,32 @@ wv.link.ui = wv.link.ui || function(models, config) {
"</div>";
}
item += "</div>";
+
+ // social sharing
+ var baselink = 'https://worldview.earthdata.nasa.gov/';
+ var fbAppId = 'yourFacebookAppId';
+ var fbMessage = "Share this on facebook!";
+
+ item += "<div id='social-share'>";
+ // Facebook
+ // https://www.facebook.com/dialog/feed?app_id=yourFacebookAppId&display=popup&caption=React%20Social!&link=https%3A%2F%2Fgithub.com%2Folahol%2Freact-social%2F&picture=&redirect_uri=https%3A%2F%2Fwww.facebook.com%2F
+ // https://www.facebook.com/dialog/feed?
+ // app_id=145634995501895
+ // &display=popup&amp;caption=An%20example%20caption
+ // &link=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
+ // &redirect_uri=https://developers.facebook.com/tools/explorer
+ item += "<a class='' href='' target='' title='Share via Facebook!'><i class='fa fa-facebook-square'></i></a>";
+
+ // Twitter
+ item += "<a class='' href='' target='' title='Share via Twitter!'><i class='fa fa-twitter-square'></i></a>";
+
+ // Google Plus
+ item += "<a class='' href='' target='' title='Share via Google Plus!'><i class='fa fa-google-plus-square'></i></a>";
+
+ // Email
+ item += "<a class='' href='' target='' title='Share via Email!'><i class='fa fa-envelope-square'></i></a>";
+ item += "</div>";
+
$dialog.html(item).iCheck({checkboxClass: 'icheckbox_square-grey'});
// If selected during the animation, the cursor will go to the
@@ -140,49 +166,49 @@ wv.link.ui = wv.link.ui || function(models, config) {
$("#wv-link-shorten-check").prop("checked", false);
- function ShareInit() {
-
- class ShareApp extends React.Component {
- render() {
-
- return React.createElement('div', {},
- // facebook
- // https://www.facebook.com/dialog/feed?app_id=yourFacebookAppId&display=popup&caption=React%20Social!&link=https%3A%2F%2Fgithub.com%2Folahol%2Freact-social%2F&picture=&redirect_uri=https%3A%2F%2Fwww.facebook.com%2F
- // https://www.facebook.com/dialog/feed?
- // app_id=145634995501895
- // &display=popup&amp;caption=An%20example%20caption
- // &link=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
- // &redirect_uri=https://developers.facebook.com/tools/explorer
-
- React.createElement("a", {href: this.props.link, title: "Share via Facebook"},
- React.createElement("i", {className: "fa fa-facebook-square"})
- ),
-
- // twitter
- // https://twitter.com/intent/tweet?text=React%20Social!%20https%3A%2F%2Fgithub.com%2Folahol%2Freact-social%2F
- React.createElement("a", {href: this.props.link, title: "Share via Facebook"},
- React.createElement("i", {className: "fa fa-twitter-square"})
- ),
-
- // google plus
- React.createElement("a", {href: this.props.link, title: "Share via Facebook"},
- React.createElement("i", {className: "fa fa-google-plus-square"})
- ),
-
- // email
- React.createElement("a", {href: this.props.link, title: "Share via Facebook"},
- React.createElement("i", {className: "fa fa-envelope-square"})
- ));
- }
- }
-
- ReactDOM.render(React.createElement(ShareApp,
- {link: 'https://worldview.earthdata.nasa.gov/'},
- {facebookAppId: "yourFacebookAppId"},
- {message: "React Social!"}),
- $('#wv-link-shorten')[0]);
- }
- ShareInit();
+ // function ShareInit() {
+ //
+ // class ShareApp extends React.Component {
+ // render() {
+ //
+ // return React.createElement('div', {},
+ // // facebook
+ // // https://www.facebook.com/dialog/feed?app_id=yourFacebookAppId&display=popup&caption=React%20Social!&link=https%3A%2F%2Fgithub.com%2Folahol%2Freact-social%2F&picture=&redirect_uri=https%3A%2F%2Fwww.facebook.com%2F
+ // // https://www.facebook.com/dialog/feed?
+ // // app_id=145634995501895
+ // // &display=popup&amp;caption=An%20example%20caption
+ // // &link=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
+ // // &redirect_uri=https://developers.facebook.com/tools/explorer
+ //
+ // React.createElement("a", {href: this.props.link, title: "Share via Facebook"},
+ // React.createElement("i", {className: "fa fa-facebook-square"})
+ // ),
+ //
+ // // twitter
+ // // https://twitter.com/intent/tweet?text=React%20Social!%20https%3A%2F%2Fgithub.com%2Folahol%2Freact-social%2F
+ // React.createElement("a", {href: this.props.link, title: "Share via Facebook"},
+ // React.createElement("i", {className: "fa fa-twitter-square"})
+ // ),
+ //
+ // // google plus
+ // React.createElement("a", {href: this.props.link, title: "Share via Facebook"},
+ // React.createElement("i", {className: "fa fa-google-plus-square"})
+ // ),
+ //
+ // // email
+ // React.createElement("a", {href: this.props.link, title: "Share via Facebook"},
+ // React.createElement("i", {className: "fa fa-envelope-square"})
+ // ));
+ // }
+ // }
+ //
+ // ReactDOM.render(React.createElement(ShareApp,
+ // {link: 'https://worldview.earthdata.nasa.gov/'},
+ // {facebookAppId: "yourFacebookAppId"},
+ // {message: "React Social!"}),
+ // $('#wv-link-shorten')[0]);
+ // }
+ // ShareInit();
};