[wp-trac] [WordPress Trac] #24067: TinyMCE 4.0
WordPress Trac
noreply at wordpress.org
Sun Feb 2 08:14:31 UTC 2014
#24067: TinyMCE 4.0
-------------------------+-----------------------
Reporter: josh401 | Owner: azaozz
Type: enhancement | Status: accepted
Priority: high | Milestone: 3.9
Component: TinyMCE | Version: 3.8
Severity: minor | Resolution:
Keywords: | Focuses:
-------------------------+-----------------------
Comment (by josh401):
Replying to [comment:112 azaozz]:
> We can enqueue jQuery from WP_Editor, then use it in `editor.js` and the
init script. That will simplify them a bit and ensure that jQuery is
always present for use outside/around the editor.
This sounds ideal :)
A question:
When we create a new addon for tinymce4, we write a `plugin.js` file. It
always begins with `tinymce.PluginManager.add() {...}`. If I wanted to
use jQuery in this file.. can I just wrap the entire contents with a
jQuery wrapper? `jQuery(document).ready(function($) {
tinymce.pluginManager.add() {...}});`
It seems to work fine.. but I was wondering if this method is okay... or
if there is a better method. I thought the jQuery build of TinyMCE would
allow jQuery to be used in the `plugin.js` files.. without a wrapper.
I don't mind either way.. but is there a 'best practice'?
Thank you!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/24067#comment:113>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list