Thread Starter
YuMyo
(@nikho)
Sorry, it was a plugin conflict. In this case with Editor repositioner plugin, which wrap the post editor inside a metabox. At the same time I verified that the “attributes dialog” does not work for textareas (custom fileds), where you may want to load TinyMce.
Any idea to make shortcode-pro more modular ?
Thread Starter
YuMyo
(@nikho)
Shortcode UI works smoothly everywhere TinyMce is called, no matter if is a custom filed or a different meta box. However I still much prefer the Shortcodes Pro approach in terms of UI and user interaction so I really hope to find a fix to make it available no matter where TinyMce is instantiated.
Thread Starter
YuMyo
(@nikho)
The problem seems to be related in shortcodespro-overlay.php around line 108:
window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, shortcodeContent);
tinyMCEPopup.editor.execCommand('mceRepaint');
tinyMCEPopup.close();
Thread Starter
YuMyo
(@nikho)
OK, finally I’ve solved it by my self : )
in shortcodespro-overlay.php on line 109 change:
window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, shortcodeContent);
into:
window.tinyMCE.execCommand('content', 'mceInsertContent', false, shortcodeContent);
Now Shortcodes Pro work smoothly everywhere!
For more info see:
/www.tinymce.com/wiki.php/Command_identifiers
Well done Nikho… just could be of some javascript. In this case the tiny mc. Although i use tinymc as well i would recomend to take a look for some kind pro wordpress html5 editor as http://aloha-editor.org/demos/wordpress-demo/
Thread Starter
YuMyo
(@nikho)
There’s a typo in my latest comment, this is the proper syntax:
window.tinyMCE.execCommand('mceInsertContent', false, shortcodeContent);
Jose, I’ve looked at the Aloha Editor a couple of times but it still miss a clean approach IMO. I think we need a solid markdown parser, which hopefully merge all the different implementations (markdown, markdown-extra, multi-markdown). It seems like someone just did it https://github.com/PieroWbmstr/Extended_Markdown
On the other hand we could rely on some javascript to handle the preview, like the epic editor does http://epiceditor.com/ But the Epic editor relies on marked.js, which actually supports just a subset of the Extended Markdown features. So the quest for the perfect editor remains open…
Nikho, I’ve tried your solution on a WordPress 3.5 install, but I’m still getting the ‘checkSubmit is not defined’ error. Also I’m not seeing any attributes in dropdowns, if I create any attributes of the ‘select’ type.
Does this work for you in 3.5?
Thread Starter
YuMyo
(@nikho)
Yes Pete, just tested. Be sure to use latest version of the plugin.