RCFilters UI: In the highlight code, use .data() the way it was meant to be used
authorRoan Kattouw <roan.kattouw@gmail.com>
Fri, 6 Oct 2017 02:26:44 +0000 (19:26 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Fri, 6 Oct 2017 02:29:51 +0000 (19:29 -0700)
commitdc54c450d68cf715461aaf0889ccefe8a204256a
treef6daa5ff3cb410ad2b2f4b48e4f346e2ac23f130
parentdc0624fce0a8620bdcbf515491ac7a5755814ae4
RCFilters UI: In the highlight code, use .data() the way it was meant to be used

Use .data( 'highlightedFilters' ) instead of .attr( 'data-highlightedFilters' ),
and make the value an array rather than a string that we have to convert
back and forth every time. We have to use .attr() for data-color because it's
used by CSS, but data-highlightedFilters isn't used by anything else.

Using an array makes the code much simpler. Also add the class
mw-rcfilters-highlighted to every highlighted item, so we can find
them back easily and don't have to use $( '[data-highlightedFilters]' )
(attribute selectors are slow, and this wouldn't work with .data() anyway).

Bonus: use the comma-separator message

Change-Id: I04de7f8fb74d60fb23ef47bf50bacfeb176a55b1
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js