samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

Shortcode popup issue with custom editor instances #452

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There's a problem in the way the script admin/tinymce/tinymce.js that handles 
the shortcode popup of TinyMCE editor, inserts the code in the editor area.
The script looks for an editor instance named "content" but this does work only 
for pages/posts content areas, and not for other editor instances.
In example, I made a plugin which uses TynyMCE editor for widgets content, and 
the NextGEN button/popup doesn't add the code to the editor, because of this. 
I'm pretty sure that also other plugins using TinyMCE instances are affected in 
the same way.
Please could you change this behavior, and let the shortcode be added to editor 
instance which opened the popup?

Additional info:
Using NextGen 1.9.1 on WP 3.3

Original issue reported on code.google.com by chi...@gmail.com on 28 Dec 2011 at 11:35

GoogleCodeExporter commented 8 years ago
OK, but for what should I look instead ? What is the global instance which will 
work in all cases ?

Original comment by alex.cologne on 28 Dec 2011 at 11:40

GoogleCodeExporter commented 8 years ago
Around line 67 of admin/tinymce/tinymce.js
you may replace

        window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext);

with

        activeEditor = window.tinyMCE.activeEditor.id;
        window.tinyMCE.execInstanceCommand(activeEditor, 'mceInsertContent', false, tagtext);

Original comment by chi...@gmail.com on 28 Dec 2011 at 2:58

GoogleCodeExporter commented 8 years ago
Done in r1061

Original comment by alex.cologne on 17 Jan 2012 at 7:16