Permalink
Browse files

installed Socialite jquery plugin

refactored javascript loading from assetic
tweaked social sharing buttons
  • Loading branch information...
inmarelibero committed Dec 7, 2012
1 parent f764999 commit afc25c0dd776e9510d551ab739bf7d2bff68ce8f
Showing with 4,140 additions and 42 deletions.
  1. +9 −8 app/config/assetic.yml
  2. +0 −1 src/Bricks/SiteBundle/Resources/less/controller-brick.less
  3. +23 −0 src/Bricks/SiteBundle/Resources/less/layout.less
  4. +16 −15 src/Bricks/SiteBundle/Resources/views/Brick/show.html.twig
  5. +19 −18 src/Bricks/SiteBundle/Resources/views/layout.html.twig
  6. +2,025 −0 web/assets/bootstrap/js/bootstrap.js
  7. +6 −0 web/assets/bootstrap/js/bootstrap.min.js
  8. +154 −0 web/assets/socialite/README.md
  9. +27 −0 web/assets/socialite/demo/demo.css
  10. +164 −0 web/assets/socialite/demo/hover.html
  11. BIN web/assets/socialite/demo/images/social-sprite.png
  12. +202 −0 web/assets/socialite/demo/scroll.html
  13. +42 −0 web/assets/socialite/extensions/socialite.bufferapp.js
  14. +72 −0 web/assets/socialite/extensions/socialite.extension-template.js
  15. +65 −0 web/assets/socialite/extensions/socialite.facebook.js
  16. +57 −0 web/assets/socialite/extensions/socialite.github.js
  17. +67 −0 web/assets/socialite/extensions/socialite.googleplus.js
  18. +30 −0 web/assets/socialite/extensions/socialite.hackernews.js
  19. +32 −0 web/assets/socialite/extensions/socialite.linkedin.js
  20. +47 −0 web/assets/socialite/extensions/socialite.pinterest.js
  21. +34 −0 web/assets/socialite/extensions/socialite.spotify.js
  22. +89 −0 web/assets/socialite/extensions/socialite.twitter.js
  23. +81 −0 web/assets/socialite/extensions/socialite.vkontakte.js
  24. +66 −0 web/assets/socialite/extensions/socialite.weibo.js
  25. +56 −0 web/assets/socialite/license.txt
  26. +708 −0 web/assets/socialite/socialite.js
  27. +49 −0 web/assets/socialite/socialite.min.js
View
@@ -25,17 +25,18 @@ assetic:
filters:
- cssrewrite
- ?yui_css
- javascripts:
+ javascripts_header:
inputs:
- %kernel.root_dir%/../web/assets/jquery/jquery-1.8.2.js
- - %kernel.root_dir%/../web/assets/bootstrap/js/bootstrap-transition.js
- - %kernel.root_dir%/../web/assets/bootstrap/js/bootstrap-dropdown.js
- - %kernel.root_dir%/../web/assets/bootstrap/js/bootstrap-tab.js
- - %kernel.root_dir%/../web/assets/bootstrap/js/bootstrap-alert.js
- - %kernel.root_dir%/../web/assets/bootstrap/js/bootstrap-modal.js
- - %kernel.root_dir%/../web/assets/bootstrap/js/bootstrap-tooltip.js
- - %kernel.root_dir%/../web/assets/bootstrap-tags/lib/bootstrap-tags.js
- bundles/fosjsrouting/js/router.js
+ filters:
+ - cssrewrite
+ - ?yui_css
+ javascripts_footer:
+ inputs:
+ - %kernel.root_dir%/../web/assets/bootstrap/js/bootstrap.min.js
+ - %kernel.root_dir%/../web/assets/bootstrap-tags/lib/bootstrap-tags.js
+ - %kernel.root_dir%/../web/assets/socialite/socialite.js
- @BricksSiteBundle/Resources/js/*.js
- @BricksSiteBundle/Resources/js/*/*.js
filters:
@@ -27,7 +27,6 @@ body.route-brick_show {
#social-share {
float: right;
- > * { float: left; }
}
}
@@ -275,3 +275,26 @@ for example: Bricks\SiteBundle\resources\views\macros\macrosInfo.html.twig
padding-left: 180px;
}
}
+
+
+/******************************************************************************************
+SOCIALITE
+
+elements loaded through Socialite jquery plugin
+https://github.com/dbushell/Socialite
+
+css rules inspired by https://github.com/dbushell/Socialite/blob/master/demo/demo.css
+
+important: everything must be inside a tag with class="social-buttons"
+******************************************************************************************/
+.social-buttons {
+ display: block; list-style: none; padding: 0; margin-right: 10px;
+
+ & > div { display: block; margin: 0; padding: 0px; float: left; }
+
+ .twitter-share { width: 100px; height: 22px; background-position: 0 0; }
+ .googleplus-one { width: 50px; height: 22px; background-position: -75px 0; }
+ .facebook-like { width: 50px; height: 65px; background-position: -145px 0; }
+ .linkedin-share { width: 60px; height: 65px; background-position: -215px 0; }
+
+}
@@ -26,22 +26,23 @@
<p class="description">{{ brick.description }}</p>
<div id="info">
- <div id="social-share">
- <div>
- <a href="https://twitter.com/share"
- class="twitter-share-button pull-right"
-
- data-url="{{ app.request.uri }}"
- data-text="{{ brick.title }}"
- data-via="SymfonyBricks"
- >
- Tweet
- </a>
- </div>
- <div>
- <g:plusone width="70"></g:plusone>
- </div>
+ <div id="social-share" class="social-buttons">
+ <a class="socialite twitter-share"
+ href="http://twitter.com/share"
+ data-url="{{ app.request.uri }}"
+ data-text="{{ brick.title }}"
+ data-via="SymfonyBricks"
+ >
+ Twitter
+ </a>
+ <a class="socialite googleplus-one"
+ data-size="medium"
+ data-url="{{ app.request.uri }}"
+ >
+ Google+
+ </a>
</div>
+
<p class="brick-info">
<i class="icon-user"></i> <a href="{{ path('userprofile_show', {'username': brick.user.username}) }}">{{ brick.user }}</a>
|
@@ -17,29 +17,16 @@
{# canonical url #}
<link rel="canonical" href="{% spaceless %}{% block canonical_url %}{{ app.request.uri }}{% endblock canonical_url %}{% endspaceless %}"/>
- {% javascripts '@javascripts' %}
+ {# load header javascripts #}
+ {% javascripts '@javascripts_header' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{# FOSJsRoutingBundle generated routes by controller #}
<script type="text/javascript" src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>
- {% block javascripts_header %}
- {# twitter #}
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
-
- <script type="text/javascript">
- (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>
- {% endblock %}
-
{# google analytics code #}
<script type="text/javascript">
-
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-35256283-1']);
_gaq.push(['_setDomainName', 'symfonybricks.com']);
@@ -50,9 +37,9 @@
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
-
</script>
+ {# load stylesheets #}
{% stylesheets '@stylesheets' %}
<link rel="stylesheet" type="text/css" href="{{ asset_url }}" />
{% endstylesheets %}
@@ -241,9 +228,23 @@
</div>
</footer>
- {% render 'BricksUserBundle:Security:_modalLogin' %}
-
+ {# load footer javascripts #}
+ {% javascripts '@javascripts_footer' %}
+ <script type="text/javascript" src="{{ asset_url }}"></script>
+ {% endjavascripts %}
+
+ <script>
+ $(function() {
+ // initialize Socialite buttons
+ Socialite.load();
+ })
+ </script>
+
+ {# block #}
{% block javascripts_footer '' %}
+
+ {% render 'BricksUserBundle:Security:_modalLogin' %}
+
</body>
</html>
Oops, something went wrong.

0 comments on commit afc25c0

Please sign in to comment.