Jon P
Jon P

Reputation: 19772

How to Suppress Image Description Dialog in TinyMCE 3?

We are using Tiny MCE 3 for a tool that is to be used for internal projects only so mandatory alt attribute on image tags is overkill.

When using the Insert/Edit Image dialogue, there is confirm dialogue (see below) that asks if you want to continue without an Image Description.

TinyMCE Image Description Dialogue

How do I suppress this dialogue so we can add images quicker (and dirtier)? I have had no luck with Google or the TinyMCE docs on this one.

Note this is for Tiny MCE 3.x, although we may migrate in the near future to 4.0.

Upvotes: 0

Views: 84

Answers (1)

Michael Fromin
Michael Fromin

Reputation: 13746

You can do one of two things to change this...

Configuration Setting accessibility_warnings:

There is a setting you can put in the configuration that will turn off all accessibility warnings:

tinyMCE.init({
    ...
    accessibility_warnings : false
});

Modify source code of image.js in the advimage plugin

This file has code to check for the alt attribute. In TinyMCE 3.5.10 I see this on line 104:

if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
  if (!f.alt.value) {                   
    tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'),     
      function(s) {
        if (s)
          t.insertAndClose();
      });
    return;
  }
}

If you comment that out it won't check for the alt attribute anymore. Of course you now have to re-do this change if you install an update to TinyMCE.

As a side note TinyMCE 3 is no longer getting any updates (I work for the company that owns TinyMCE). It would be a really good idea to move to TinyMCE 4 (currently at 4.5.3) as that is the codebase that is getting enhancements at this point.

Upvotes: 1

Related Questions