/Resources/views/initialize.html.twig

http://github.com/FriendsOfSymfony/FOSFacebookBundle · Twig Template · 23 lines · 22 code · 1 blank · 0 comment · 3 complexity · 37bc1c266c5564e82f028dc01e3f25b9 MD5 · raw file

  1. <div id="fb-root"></div>
  2. {% if not async %}
  3. <script type="text/javascript" src="http://connect.facebook.net/{{ culture }}/all.js"></script>
  4. {% endif %}
  5. <script type="text/javascript">
  6. {% autoescape false %}
  7. {% if async %}
  8. window.fbAsyncInit = function() {
  9. {% endif %}
  10. FB.init({{ {'appId':appId, 'xfbml':xfbml, 'oauth':oauth, 'status':status, 'cookie':cookie, 'logging':logging, 'channelUrl':channelUrl}|json_encode }});
  11. {% if async %}
  12. {{ fbAsyncInit }}
  13. };
  14. (function() {
  15. var e = document.createElement('script');
  16. e.src = document.location.protocol + {{ "//connect.facebook.net/%s/all.js"|format(culture)|json_encode }};
  17. e.async = true;
  18. document.getElementById('fb-root').appendChild(e);
  19. }());
  20. {% endif %}
  21. {% endautoescape %}
  22. </script>