Embed largest image in TinyMCE

We use Elgg 2.3.7, 'embed' and 'extended_tinymce' plugins.

Right now the 'embed' embeds in TinyMCE only medium size images. However, ​we want to embed the largest image size possible.

We tried to find our way but we got lost :)

We would appreciate any guidance.

Thank you

  • Override the view mod/embed/views/default/elgg/embed.js. The only modification necessary is to change line 58 from

    return match.replace('small', 'medium');


    return match.replace('small', 'large');

    This will only affect image embedding you do after this change and won't change the size of the images within already existing posts.

  • Thank you iionly - it works fine.

    As a matter of fact, I have tried this solution previously, but it has not worked. Also, when I tried your suggestion at the fist time, it did not work. However, only after I cleaned my Chrome history it worked.

    As far as I understand the browsers do not cache JS files from https sites. It it correct?

  • Had you also flushed the caches of your site in the admin area? That's necessary after you made the change as the js file is cached on server side with the Elgg caching options enabled. I don't know about browser caching js code. But I guess it might keep it at least for the session.

  • I work on a development site and all the caches are disabled, and as you see below there is no need to do it.

    I made a detailed research with Chrome, FF, IE and Opera. All are the latest version.

    I changed the image size in the JS file a few times, back and forth, from medium to large. Only in Opera I had to clear the history. All the rest responded immediately.

    Regarding Opera, I also tried to flush the site caches, but still I had to clear the history to get the desired results.

    P.S. I work on PC - so I could not check Safari.