[wp-trac] [WordPress Trac] #29841: Don't replace non embeddable URLs with a loading placeholder
WordPress Trac
noreply at wordpress.org
Wed Dec 24 21:05:48 UTC 2014
#29841: Don't replace non embeddable URLs with a loading placeholder
-------------------------------------+-------------------------
Reporter: avryl | Owner: avryl
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 4.2
Component: TinyMCE | Version: 4.0
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses: javascript
-------------------------------------+-------------------------
Comment (by azaozz):
Don't think we can reuse the same regex as in PHP. There are quite a few
syntax differences between PCRE and JS. It's true we can keep the default
regex compatible, but plugins can add there too. Trying to convert from
PCRE to JS syntax is no fun.
Thinking we should go with the first option: having another arg on
`wp.mce.views.toViews()` to indicate that we don't want a loading
placeholder while waiting for the response. This would be a good addition
that may be useful in other contexts too.
We can get this working in couple of ways: keep a reference to the <p>
node in the TinyMCE plugin, fire an event when the server sends the embed
code, check if the node content/text hasn't changed, then either add the
whole wpView or leave it as-is if no match. Or we can match that node to a
particular ajax request and replace on completion.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29841#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list