acquia/personalize_module — pull request #23 by katbailey (2014-05-07 19:27:37+00:00)
Title: CH-468: Allow execution of javascript as content variations

The changes in personalize.js have to do with the fact that it is now perfectly legitimate to have an option set on the page for which there is no corresponding markup. Usually there would be a div with an id like '#personalize-osid-123' and we pass a jQuery object based on this selector to the executor. Previously, the only reason this could be empty was if the option set was part of an MVT, where the other option set(s) were being rendered but this one for some reason didn't exist on the page. But the arbitrary js functionality is our first example of an option set that *is* on the page but for which there is no div. So now it is up to the executor in question to deal with the possibility of receiving an empty jQuery object for the option set.

It's also worth mentioning here that previewing won't really work for an option set using arbitrary JS as we've no way of going back to the control option (if there is one) after running one of the other options. Not sure what can be done about that.