# HG changeset patch # User Brian Neal # Date 1319070997 0 # Node ID f0f3966ea44fdb4ee8a133c05ed3f07f484b8d92 # Parent f785a646a5fcb7ca78b72b00a750a96dc37e5a20 For #233, switched to asynchronous loading of the social media sharing javascript. Also switched to Facebook's javascript SDK instead of using an iframe for the like/share button. diff -r f785a646a5fc -r f0f3966ea44f gpp/core/templatetags/core_tags.py --- a/gpp/core/templatetags/core_tags.py Wed Oct 19 23:31:22 2011 +0000 +++ b/gpp/core/templatetags/core_tags.py Thu Oct 20 00:36:37 2011 +0000 @@ -57,8 +57,8 @@ Displays social media sharing buttons. """ - if url.startswith('/'): - url = 'http://%s%s' % (Site.objects.get_current().domain, url) + site = Site.objects.get_current() + url = _fully_qualify(url, site.domain) return { 'title': title, diff -r f785a646a5fc -r f0f3966ea44f gpp/settings.py --- a/gpp/settings.py Wed Oct 19 23:31:22 2011 +0000 +++ b/gpp/settings.py Thu Oct 20 00:36:37 2011 +0000 @@ -316,11 +316,8 @@ 'js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_std.js', ], - 'social': [ - 'http://platform.twitter.com/widgets.js', - 'https://apis.google.com/js/plusone.js', - ], } + GPP_THIRD_PARTY_CSS = { 'jquery-ui': [ 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/redmond/jquery-ui.css', diff -r f785a646a5fc -r f0f3966ea44f gpp/templates/base.html --- a/gpp/templates/base.html Wed Oct 19 23:31:22 2011 +0000 +++ b/gpp/templates/base.html Thu Oct 20 00:36:37 2011 +0000 @@ -36,7 +36,7 @@ - +{% block begin_body %}{% endblock %}
-
+{% block end_body %}{% endblock %} diff -r f785a646a5fc -r f0f3966ea44f gpp/templates/core/social_sharing_begin.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/templates/core/social_sharing_begin.html Thu Oct 20 00:36:37 2011 +0000 @@ -0,0 +1,8 @@ +
+ diff -r f785a646a5fc -r f0f3966ea44f gpp/templates/core/social_sharing_end.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/templates/core/social_sharing_end.html Thu Oct 20 00:36:37 2011 +0000 @@ -0,0 +1,12 @@ + + diff -r f785a646a5fc -r f0f3966ea44f gpp/templates/core/social_sharing_tag.html --- a/gpp/templates/core/social_sharing_tag.html Wed Oct 19 23:31:22 2011 +0000 +++ b/gpp/templates/core/social_sharing_tag.html Thu Oct 20 00:36:37 2011 +0000 @@ -7,7 +7,7 @@
  • - +
  • diff -r f785a646a5fc -r f0f3966ea44f gpp/templates/home.html --- a/gpp/templates/home.html Wed Oct 19 23:31:22 2011 +0000 +++ b/gpp/templates/home.html Thu Oct 20 00:36:37 2011 +0000 @@ -31,8 +31,8 @@ -{% script_tags "social" %} {% endblock %} +{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block content %}

    Welcome to SurfGuitar101!

    @@ -69,3 +69,4 @@
    {% endcache %} {% endblock %} +{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %} diff -r f785a646a5fc -r f0f3966ea44f gpp/templates/news/index.html --- a/gpp/templates/news/index.html Wed Oct 19 23:31:22 2011 +0000 +++ b/gpp/templates/news/index.html Thu Oct 20 00:36:37 2011 +0000 @@ -4,9 +4,7 @@ {% block news_css %} {% endblock %} -{% block custom_js %} -{% script_tags "social" %} -{% endblock %} +{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block news_content %}

    {{ title }}

    @@ -22,3 +20,4 @@ {% endif %} {% endblock %} +{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %} diff -r f785a646a5fc -r f0f3966ea44f gpp/templates/news/story.html --- a/gpp/templates/news/story.html Wed Oct 19 23:31:22 2011 +0000 +++ b/gpp/templates/news/story.html Thu Oct 20 00:36:37 2011 +0000 @@ -16,8 +16,8 @@ {% script_tags "markitup jquery-ui" %} {% endif %} -{% script_tags "social" %} {% endblock %} +{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block news_content %}

    {{ story.title }}

    @@ -68,3 +68,4 @@ {% endif %}
    {% endblock %} +{% block end_body %}{% include 'core/social_sharing_end.html' %}{% endblock %} diff -r f785a646a5fc -r f0f3966ea44f gpp/templates/podcast/detail.html --- a/gpp/templates/podcast/detail.html Wed Oct 19 23:31:22 2011 +0000 +++ b/gpp/templates/podcast/detail.html Thu Oct 20 00:36:37 2011 +0000 @@ -26,8 +26,8 @@ }); //]]> -{% script_tags "social" %} {% endblock %} +{% block begin_body %}{% include 'core/social_sharing_begin.html' %}{% endblock %} {% block podcast-content %}