I am -1 on the $syntax, but don't feel strongly enough to prevent other
people from using it. Although, for people coming from Python, it oes lead
to confusion - WTF is that $ there for?!?


On Thu, Dec 5, 2013 at 9:11 AM, Jonathan Frederic
<notifications@github.com>wrote:

> In IPython/html/tests/casperjs/util.js:
>
> > +
> > +// Utility function that allows us to easily check if an element exists
> > +// within a cell.  Uses JQuery selector to look for the element.
> > +casper.cell_element_exists = function(index, selector){
> > +    return casper.evaluate(function (index, selector) {
> > +        var $cell = IPython.notebook.get_cell(index).element;
> > +        return $cell.find(selector).length > 0;
> > +    }, index, selector);
> > +};
> > +
> > +// Utility function that allows us to execute a jQuery function on an
> > +// element within a cell.
> > +casper.cell_element_function = function(index, selector, function_name, function_args){
> > +    return casper.evaluate(function (index, selector, function_name, function_args) {
> > +        var $cell = IPython.notebook.get_cell(index).element;
> > +        var $el = $cell.find(selector);
>
> I use $ all over the widget stuff to keep track of what's jQuery and
> what's not (for the same reason Matthias pointed out). Backbone.js uses the
> same practice, that's where I got the idea from.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ipython/ipython/pull/4645/files#r8136055>
> .
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com