[wp-trac] [WordPress Trac] #31590: Comment reply links can cause JS error on slow connections/large pages
WordPress Trac
noreply at wordpress.org
Sun Jul 19 03:50:43 UTC 2015
#31590: Comment reply links can cause JS error on slow connections/large pages
------------------------------------+-----------------------------------
Reporter: peterwilsoncc | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 2.7
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses: javascript, template
------------------------------------+-----------------------------------
Changes (by peterwilsoncc):
* keywords: has-patch => has-patch dev-feedback
Comment:
In attachment:31590.2.diff:
* replace obtrusive JavaScript with unobtrusive JavaScript
* requires browser support for `addEventListener` and `querySelector`,
other browsers fall back to `?replytocom`links
* checked for compatibility with Jetpack comments (works)
* calls `addComment.init()` on script load. The init function is exposed
so other scripts can call it should the need occur. This is for future
proofing, I figure we'll see a bit more lazy loading of comments once the
API is committed to core.
* element ids, field ids, and classes are in a config object at the head
of the file. This will allow overrides to be set should it be considered
useful down the track
I've checked it with:
* Jetpack comments (both browsers which do and don't cut the mustard)
* Disqus
* Intense Debate
* Facebook
Only Jetpack continues to use WPDB.
I have an alternative [https://github.com/peterwilsoncc/rapid-comment-
reply/tree/dev-historyState branch which updates the location bar] with
history.replaceState in Github should there be interest.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31590#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list