Further modules included.
[yaffs-website] / web / modules / contrib / media_entity_twitter / js / twitter.js
1 /**
2  * @file
3  */
4
5 (function ($, Drupal) {
6   "use strict";
7
8   Drupal.behaviors.twitterMediaEntity = {
9     attach: function (context) {
10       function _init () {
11         twttr.widgets.load(context);
12       }
13
14       // If the tweet is being embedded in a CKEditor's iFrame the widgets
15       // library might not have been loaded yet.
16       if (typeof twttr == 'undefined') {
17         $.getScript('//platform.twitter.com/widgets.js', _init);
18       }
19       else {
20         _init();
21       }
22     }
23   };
24
25 })(jQuery, Drupal);