vendor/opentok.js
function(selector, context) {
    var results = [];

    if (typeof(selector) === 'string') {
      var idSelector = detectIdSelectors.exec(selector);
      context = context || document;

      if (idSelector && idSelector[1]) {
        var element = context.getElementById(idSelector[1]);
        if (element) results.push(element);
      }
      else {
        results = context.querySelectorAll(selector);
      }
    }
    else if (selector &&
              (selector.nodeType || window.XMLHttpRequest && selector instanceof XMLHttpRequest)) {

      // allow OTHelpers(DOMNode) and OTHelpers(xmlHttpRequest)
      results = [selector];
      context = selector;
    }
    else if (OTHelpers.isArray(selector)) {
      results = selector.slice();
      context  = null;
    }

    return new ElementCollection(results, context);
  }
function(selector, context) {
    var results = [];

    if (typeof(selector) === 'string') {
      var idSelector = detectIdSelectors.exec(selector);
      context = context || document;

      if (idSelector && idSelector[1]) {
        var element = context.getElementById(idSelector[1]);
        if (element) results.push(element);
      }
      else {
        results = context.querySelectorAll(selector);
      }
    }
    else if (selector &&
              (selector.nodeType || window.XMLHttpRequest && selector instanceof XMLHttpRequest)) {

      // allow OTHelpers(DOMNode) and OTHelpers(xmlHttpRequest)
      results = [selector];
      context = selector;
    }
    else if (OTHelpers.isArray(selector)) {
      results = selector.slice();
      context  = null;
    }

    return new ElementCollection(results, context);
  }
function ( selector , context ) { var results = [ ] ; if ( typeof ( selector ) === 'string' ) { var idSelector = detectIdSelectors . exec ( selector ) ; context = context || document ; if ( idSelector && idSelector [ 1 ] ) { var element = context . getElementById ( idSelector [ 1 ] ) ; if ( element ) results . push ( element ) ; } else { results = context . querySelectorAll ( selector ) ; } } else if ( selector && ( selector . nodeType || window . XMLHttpRequest && selector instanceof XMLHttpRequest ) ) { // allow OTHelpers(DOMNode) and OTHelpers(xmlHttpRequest) results = [ selector ] ; context = selector ; } else if ( OTHelpers . isArray ( selector ) ) { results = selector . slice ( ) ; context = null ; } return new ElementCollection ( results , context ) ; }
The top-level namespace, also performs basic DOMElement selecting.  @example Get the DOM element with the id of 'domId' OTHelpers('#domId')  @example Get all video elements OTHelpers('video')  @example Get all elements with the class name of 'foo' OTHelpers('.foo')  @example Get all elements with the class name of 'foo', and do something with the first. var collection = OTHelpers('.foo'); console.log(collection.first);   The second argument is the context, that is document or parent Element, to select from.  @example Get a video element within the element with the id of 'domId' OTHelpers('video', OTHelpers('#domId'))    OTHelpers will accept any of the following and return a collection: OTHelpers() OTHelpers('css selector', optionalParentNode) OTHelpers(DomNode) OTHelpers([array of DomNode])  The collection is a ElementCollection object, see the ElementCollection docs for usage info.
The top - level namespace also performs basic DOMElement selecting .