Instead of requiring a call to:

$('a.media-audio').media( { width: 200, height: 15, autoplay: true } )

... or the jquery_media_add function add straight inline JavaScript to the page, it would be nicer to add an entry to Drupal.settings, and then loop through all the elements through the Drupal behaviors.

For an example of this, have a look at the Mouse Wheel module, in the mousewheel_add function as well as mousewheel.js. If you take a look at it, you see that mousewheel_add() adds mousewheel.js, the jQuery plugin, as well as the settings. mousewheel.js will register the Drupal behavior to apply the MouseWheel elements on the page....

Comments

aaron’s picture

Category: feature » task

Ah, great idea! Thanks, Rob. I'll refactor the module to use that functionality.