Add attribute-parsing code to widget constructor.
authorMike Taylor <mike@indexdata.com>
Mon, 31 Mar 2014 15:26:51 +0000 (16:26 +0100)
committerMike Taylor <mike@indexdata.com>
Mon, 31 Mar 2014 15:26:51 +0000 (16:26 +0100)
Handles three cases:

1. data-mkws-config -- argument is a JSON fragment containing any
number of key=value pairs to be added to the configuration
2. Any other data-mkws-NAME -- argument is a string, and is set as the
value of the configuration item NAME.
3. Any other attribute NAME that is not one of a hardwired set that are
recognised and discarded -- argument is a string, and is set
as the value of the attribute name.

Case 1 is the industrial-strength one that can be used when setting a
complex value, such as a list of facets:
data-mkws-config='{ "facets": ["xtargets", "author", "subject"] }'
Case 2 is the general-purpose way of setting any string value simply:
data-mkws-perpage="50"
Case 3 is a simplifying short-cut for case 2:
perpage="20"


No differences found