diff --git a/source/_patterns/04-components/facebook/facebook.js b/source/_patterns/04-components/facebook/facebook.js deleted file mode 100644 index 4f717afe0bb16733a348820a2b733df4cba65c7f..0000000000000000000000000000000000000000 --- a/source/_patterns/04-components/facebook/facebook.js +++ /dev/null @@ -1,23 +0,0 @@ -(function ($, Drupal) { - 'use strict'; - - // The styling for this mobile menu is located in source/_patterns/04-components/menus/menu--main/. - - Drupal.behaviors.facebook = { - attach(context, settings) { - $('.uw-facebook__data').each(function () { - - var fbwidth = $(this).parent().width(); - - if (fbwidth == 0) { - fbwidth = 239; - } - - var fburl = encodeURIComponent('/' + $(this).data('username')); - - $(this).before('<iframe src="https://www.facebook.com/plugins/likebox.php?href=' + fburl + '&width=' + fbwidth + '&height=350&colorscheme=light&show_faces=false&border_color&stream=true&header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; max-width: 500px;width:' + fbwidth + 'px; height:350px;" allowTransparency="true"></iframe>'); - $(this).remove(); - }); - }, - }; -})(jQuery, Drupal); diff --git a/source/_patterns/04-components/facebook/facebook.twig b/source/_patterns/04-components/facebook/facebook.twig index 74c2957c1f1baa556224e0cc8a35cdb0cd43c33c..20adc650e595ffa6823a55fc291923ae4b01511b 100644 --- a/source/_patterns/04-components/facebook/facebook.twig +++ b/source/_patterns/04-components/facebook/facebook.twig @@ -1,6 +1,20 @@ -<div class="uw-facebook"> - <div class="uw-facebook__wrapper"> - <div class="uw-facebook__data" data-username="{{ username }}"> - </div> - </div> -</div> +<div class="uw-facebook"> + <div class="uw-facebook__wrapper"> + <script async defer src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2"></script> + {% if feed_type == 'timeline' %} + <div class="fb-page" + data-href="https://www.facebook.com/{{ username }}" + data-tabs="timeline" + data-width="500" + data-hide-cover="false" + data-show-facepile="false" + adapt_container_width="true"> + </div> + {% else %} + <div class="fb-post" + data-href="{{ url }}" + data-width="500"> + </div> + {% endif %} + </div> +</div> diff --git a/source/_patterns/04-components/facebook/facebook.yml b/source/_patterns/04-components/facebook/facebook.yml index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..91a1f1043cf6ff8a6de3870cb57b3c9110823e23 100644 --- a/source/_patterns/04-components/facebook/facebook.yml +++ b/source/_patterns/04-components/facebook/facebook.yml @@ -0,0 +1,5 @@ +feed_type: 'singlepost' +url: 'https://www.facebook.com/university.waterloo/photos/a.413434815757/10158092685535758/?type=3&__xts__%5B0%5D=68.ARBMF_TWIqmabPEvgm2lDS_9tdueCSGzKC0hHLKDklHAINNO6G3UjO8uhvXt-UW3biG9j5pQwbI0CW7LbTCj2gixcH7f_uKe3-AlkAarFGkYYFfMfHNHUFs4UX_oCgir9oyKSBvyA7E8M3r1sf-wW8XyMVZ0ch9EYbfuChTQgXP0GfvcAs-jYZgmZu-2ohe5CpzrHCwHLxGun-_sa4uBm0SZ7aoPqmAqI8PmhEReeeDWD6Qm46wOFj0Bah0UFIxwQeKjhQ_rk_i4ijgfV3FiarIHb-Ns8jdkYdJ0eTUuF1Qr36iBUPkd6PIOVX03d_YCbNbkycOKY41Qkho&__tn__=-R' +include_text_video: 'true' +username: 'university.waterloo' +display_name: 'UW'