/** * @file * Create the 'Vimeo' tab for the WYSIWYG plugins. */ // (function ($) { // namespace('Drupal.media.browser.plugin'); // // Drupal.media.browser.plugin.media_vimeo = function(mediaBrowser, options) { // return { // init: function() { // tabset = mediaBrowser.getTabset(); // tabset.tabs('add', '#media_vimeo', 'Vimeo'); // mediaBrowser.listen('tabs.show', function (e, id) { // if (id == 'media_vimeo') { // // We only need to set this once. // // We probably could set it upon load. // if (mediaBrowser.getActivePanel().html() == '') { // mediaBrowser.getActivePanel().html(options.media_vimeo); // } // } // }); // } // } // }; // // // For now, I guess self registration makes sense. // // Really though, we should be doing it via drupal_add_js and some settings // // from the drupal variable. // //@todo: needs a review. // Drupal.media.browser.register('media_vimeo', Drupal.media.browser.plugin.media_vimeo, {}); // })(jQuery); (function ($) { namespace('media.browser.plugin'); Drupal.media.browser.plugin.vimeo_library = function(mediaBrowser, options) { return { mediaFiles: [], init: function() { tabset = mediaBrowser.getTabset(); tabset.tabs('add', '#vimeo_library', 'Vimeo'); var that = this; mediaBrowser.listen('tabs.show', function (e, id) { if (id == 'vimeo_library') { // This is kinda rough, I'm not sure who should delegate what here. mediaBrowser.getActivePanel().addClass('throbber'); mediaBrowser.getActivePanel().html(''); //mediaBrowser.getActivePanel().addClass('throbber'); // Assumes we have to refresh everytime. // Remove any existing content mediaBrowser.getActivePanel().append('