ramnathv/htmlwidgets — pull request #32 by yihui (2014-11-16 03:50:37+00:00)
Title: add two functions withJS() and JSEvals() as well as a helper function HTMLWidgets.evaluateStringMember()

so that we can mark certain elements of a list as JS code that can be evaluated later, e.g.

```r
datatable(iris, options = list(pageLength = 10, render = JS('function(...) {...}')))
```

We can find the element `render` by `JSEvals(substitute(options))`, and do `HTMLWidgets.evaluateStringMember(options, 'render')` in JavaScript.

The marker function `JS()` is hidden inside `withJS()` so that we do not need to export and document it. This is for the consideration of other package authors, because otherwise everybody has to import JS(), re-export it, and document it. Then users must attach the package to use `JS()` (it does not suffice to load the package only). I want to avoid all the trouble.

BTW, it is very confusing to me whether to use camelCase or under_score in this package. I think someone needs to sort this out before publishing it to CRAN. I'm okay with either style; just do not mix them.