diff --git a/includes/media.filter.inc b/includes/media.filter.inc index 5f2c82e..7ca4494 100644 --- a/includes/media.filter.inc +++ b/includes/media.filter.inc @@ -351,6 +351,18 @@ function media_format_form($form, $form_state, $file) { '#default_value' => $default_view_mode ); + $form['options']['alt'] = array( + '#type' => 'textfield', + '#title' => t('Alternate text'), + '#default_value' => '' + ); + + $form['options']['title'] = array( + '#type' => 'textfield', + '#title' => t('Title'), + '#default_value' => '' + ); + // Similar to a form_alter, but we want this to run first so that media.types.inc // can add the fields specific to a given type (like alt tags on media). // If implemented as an alter, this might not happen, making other alters not diff --git a/js/wysiwyg-media.js b/js/wysiwyg-media.js index 97697f0..3630e8a 100644 --- a/js/wysiwyg-media.js +++ b/js/wysiwyg-media.js @@ -83,7 +83,7 @@ Drupal.wysiwyg.plugins.media = { if (additional) { for (k in additional) { if (additional.hasOwnProperty(k)) { - if (k === 'attr') { + if (k === 'attr' || k === 'alt' || k === "title") { imgElement.attr(k, additional[k]); } }