[buddypress-trac] [BuddyPress] #3821: Unbind selectors from tokens in jQuery

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Dec 9 10:28:34 UTC 2011


#3821: Unbind selectors from tokens in jQuery
-------------------------+-----------------------------
 Reporter:  hnla         |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Theme        |    Version:
 Severity:  normal       |   Keywords:  needs-testing
-------------------------+-----------------------------
 This patch removes all of the selectors that are bound to their tokens e.g
 jq('div.item-list-tabs') becomes simply ('.item-list-tabs')

 Primary purpose of this change is to facilitate the ability to be able to
 re-factor markup without breaking JS and more specifically to allow re-
 factoring of templates to html5 selectors (As in example above where 'div'
 becomes 'nav')

 This, in theory, is a safe change that ought not to cause any issues.

 Possible consequences might arise if devs have gone and used the token
 elsewhere on another element but in reality that would have been an unwise
 move?

 I have changed all instances of selectors to leave only tokens throughout
 global.js reading through these changes are ok but am still testing across
 installations to try and spot problems and suggest this patch does require
 testing in depth before accepting

 '''Notes:'''

 Line 594 nnwards where we build 'bp_filter_request' could be an issue and
 needs checking carefully; I have removed the div from the selector in the
 queries in these various blocks and it ought not to present issues.

 Interesting to note in some areas, where for instance I removed div from
 'div#message', I find, later on, instances where it is written as
 '#message' suggesting this removal is a safe action especially as an ID
 may only be used once per page so 'div' is unnecessary albeit formally
 correct.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3821>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list