Mercurial > public > sg101
changeset 672:69e8aa135c2e
For issue #34, make social media share buttons more privacy concious.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 26 May 2013 13:29:44 -0500 |
parents | be5b37719059 |
children | 92101013d5ac |
files | core/templatetags/core_tags.py sg101/templates/contests/contest_detail.html sg101/templates/core/social_sharing_begin.html sg101/templates/core/social_sharing_end.html sg101/templates/core/social_sharing_tag.html sg101/templates/home.html sg101/templates/news/index.html sg101/templates/news/story.html sg101/templates/podcast/detail.html sg101/templates/potd/view.html shoutbox/static/js/shoutbox.js static/icons/button-facebook.png static/icons/button-googleplus.png static/icons/button-twitter.png |
diffstat | 14 files changed, 16 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/core/templatetags/core_tags.py Sat May 25 22:17:46 2013 -0500 +++ b/core/templatetags/core_tags.py Sun May 26 13:29:44 2013 -0500 @@ -79,6 +79,7 @@ return { 'title': title, 'url': url, + 'STATIC_URL': settings.STATIC_URL, }
--- a/sg101/templates/contests/contest_detail.html Sat May 25 22:17:46 2013 -0500 +++ b/sg101/templates/contests/contest_detail.html Sun May 26 13:29:44 2013 -0500 @@ -13,7 +13,6 @@ <script type="text/javascript" src="{{ STATIC_URL }}js/contests/contests.js"></script> {% endblock %} -{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block content %} <h2><a href="{% url 'contests-index' %}">Contests</a></h2> <h3><a href="{% url 'contests-contest' slug=contest.slug %}">{{ contest.title }}</a></h3> @@ -64,4 +63,3 @@ <hr /> {% social_sharing contest.title contest.get_absolute_url %} {% endblock %} -{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %}
--- a/sg101/templates/core/social_sharing_begin.html Sat May 25 22:17:46 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -<div id="fb-root"></div> -<script type="text/javascript">(function(d, s, id) { - var js, fjs = d.getElementsByTagName(s)[0]; - if (d.getElementById(id)) {return;} - js = d.createElement(s); js.id = id; js.async = true; - js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; - fjs.parentNode.insertBefore(js, fjs); -}(document, 'script', 'facebook-jssdk'));</script>
--- a/sg101/templates/core/social_sharing_end.html Sat May 25 22:17:46 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> -<script type="text/javascript"> -window.___gcfg = { - lang: 'en-US' -}; - -(function() { - var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; - po.src = 'https://apis.google.com/js/plusone.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); -})(); -</script>
--- a/sg101/templates/core/social_sharing_tag.html Sat May 25 22:17:46 2013 -0500 +++ b/sg101/templates/core/social_sharing_tag.html Sun May 26 13:29:44 2013 -0500 @@ -1,13 +1,13 @@ <div class="social-sharing"> <ul class="no-bullet-inline-block"> -<li style="vertical-align:top"> -<a href="https://twitter.com/share" class="twitter-share-button" data-text="{{ title }}" data-url="{{ url }}" data-count="horizontal" data-via="surfguitar101">Tweet</a> +<li style="vertical-align:top; margin-right:1.5em"> +<a href="https://twitter.com/intent/tweet?text={{ title|urlencode }}&url={{ url|urlencode }}&via=SurfGuitar101"><img src="{{ STATIC_URL }}icons/button-twitter.png" alt="Tweet"/></a> +</li> +<li style="vertical-align:top; margin-right:1.5em"> +<a href="https://plus.google.com/share?url={{ url|urlencode }}"><img src="{{ STATIC_URL }}icons/button-googleplus.png" alt="Share on Google Plus"/></a> </li> <li style="vertical-align:top"> -<div class="g-plusone" data-size="medium" data-href="{{ url }}"></div> -</li> -<li style="vertical-align:top"> -<div class="fb-like" data-href="{{ url }}" data-send="true" data-layout="button_count" data-width="450" data-show-faces="false"></div> +<a href="https://www.facebook.com/sharer/sharer.php?u={{ url|urlencode }}"><img src="{{ STATIC_URL }}icons/button-facebook.png" alt="Share on Facebook"/></a> </li> </ul> </div>
--- a/sg101/templates/home.html Sat May 25 22:17:46 2013 -0500 +++ b/sg101/templates/home.html Sun May 26 13:29:44 2013 -0500 @@ -34,7 +34,6 @@ #home-slideshow img { display: none } </style> {% endblock %} -{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block content %} <h2>Welcome to SurfGuitar101!</h2> <div class="span-9"> @@ -69,4 +68,3 @@ </div> {% endcache %} {% endblock %} -{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %}
--- a/sg101/templates/news/index.html Sat May 25 22:17:46 2013 -0500 +++ b/sg101/templates/news/index.html Sun May 26 13:29:44 2013 -0500 @@ -4,7 +4,6 @@ {% block news_css %} <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/pagination.css" /> {% endblock %} -{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block news_content %} <h3>{{ title }}</h3> @@ -20,4 +19,3 @@ {% endif %} {% endblock %} -{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %}
--- a/sg101/templates/news/story.html Sat May 25 22:17:46 2013 -0500 +++ b/sg101/templates/news/story.html Sun May 26 13:29:44 2013 -0500 @@ -18,7 +18,6 @@ <script type="text/javascript" src="{{ STATIC_URL }}js/comments.js"></script> {% endif %} {% endblock %} -{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block news_content %} <div class="solid-background"> <h3>{{ story.title }}</h3> @@ -69,4 +68,3 @@ {% endif %} </div> {% endblock %} -{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %}
--- a/sg101/templates/podcast/detail.html Sat May 25 22:17:46 2013 -0500 +++ b/sg101/templates/podcast/detail.html Sun May 26 13:29:44 2013 -0500 @@ -28,7 +28,6 @@ //]]> </script> {% endblock %} -{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block podcast-content %} <div class="breadcrumbs"> <a href="{% url 'podcast.views.index' %}">Podcast Index</a> >> {{ podcast.title }} @@ -94,4 +93,3 @@ </ul> {% social_sharing podcast.search_title podcast.get_absolute_url %} {% endblock %} -{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %}
--- a/sg101/templates/potd/view.html Sat May 25 22:17:46 2013 -0500 +++ b/sg101/templates/potd/view.html Sun May 26 13:29:44 2013 -0500 @@ -16,7 +16,6 @@ {% script_tags "markitup jquery-ui" %} <script type="text/javascript" src="{{ STATIC_URL }}js/comments.js"></script> {% endblock %} -{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block content %} {% if is_current %} <h2>Photo Of The Day</h2> @@ -56,4 +55,3 @@ <p>We're sorry, there doesn't seem to be a photo of the day right now.</p> {% endif %} {% endblock %} -{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %}
--- a/shoutbox/static/js/shoutbox.js Sat May 25 22:17:46 2013 -0500 +++ b/shoutbox/static/js/shoutbox.js Sun May 26 13:29:44 2013 -0500 @@ -23,6 +23,15 @@ } }); + // social bookmarking pop-up support + $('.social-sharing').delegate('a', 'click', function(e) { + if ($(window).width() > 700) + { + e.preventDefault(); + window.open(this.href,'share-this','height=300,width=500,status=no,toolbar=no'); + } + }); + $("html").bind("ajaxStart", function() { $(this).addClass('busy'); }).bind("ajaxStop", function() {