Consider
drupal_add_js(array(
'radio86_media' => array('barfoo' => 'booboo')), 'setting'
);
and
$form['#attached']['js'] = array(
drupal_get_path('module', 'radio86_media') . '/select_media.js',
);
These two 'lines' work well separately, but I think they could (and should) be combined so that the variable setting is set on the second line, combining the logic.
I've been fumbling around it and just can't get it to work. With this current way, I can console.log the barfoo variable via JS by using Drupal.settings.radio86_media.barfoo so it does work, but I really would like to have it combined.
Any suggestions greatly appreciated!