versions/0.2.2/oj.js
function _compileAny(any, options){
    // Array
    if (oj.isArray(any))
      _compileTag(any, options)

    // String
    else if (oj.isString(any)){
      if (options.html != null)
        options.html.push(any)

      if (any.length > 0 && any[0] === '<'){
        var root = document.createElement('div')
        root.innerHTML = any
        if (options.dom != null)
          options.dom.appendChild(root)
      } else {
        if (options.dom != null)
          options.dom.appendChild(document.createTextNode(any))
      }

    // Boolean or Number
    } else if (oj.isBoolean(any) || oj.isNumber(any)){
      if (options.html != null)
        options.html.push("" + any)

      if (options.dom != null)
        options.dom.appendChild(document.createTextNode("" + any))

    // Function
    } else if (oj.isFunction(any)){

      // Wrap function call to allow full oj generation within any
      _compileAny(oj(any), options)

    // Date
    } else if (oj.isDate(any)){
      if (options.html != null)
        options.html.push("" + (any.toLocaleString()))

      if (options.dom != null)
        options.dom.appendChild(document.createTextNode("" + (any.toLocaleString())))

    // OJ Type or Instance
    } else if (oj.isOJ(any)){
      if (options.types != null)
        options.types.push(any)

      if (options.html != null)
        options.html.push(any.toHTML(options))

      if (options.dom != null)
        options.dom.appendChild(any.toDOM(options))

      if (options.css != null)
        _extend(options.css, any.toCSSMap(options))
    }
    // Do nothing for: null, undefined, object
  }
function _compileAny(any, options){
    // Array
    if (oj.isArray(any))
      _compileTag(any, options)

    // String
    else if (oj.isString(any)){
      if (options.html != null)
        options.html.push(any)

      if (any.length > 0 && any[0] === '<'){
        var root = document.createElement('div')
        root.innerHTML = any
        if (options.dom != null)
          options.dom.appendChild(root)
      } else {
        if (options.dom != null)
          options.dom.appendChild(document.createTextNode(any))
      }

    // Boolean or Number
    } else if (oj.isBoolean(any) || oj.isNumber(any)){
      if (options.html != null)
        options.html.push("" + any)

      if (options.dom != null)
        options.dom.appendChild(document.createTextNode("" + any))

    // Function
    } else if (oj.isFunction(any)){

      // Wrap function call to allow full oj generation within any
      _compileAny(oj(any), options)

    // Date
    } else if (oj.isDate(any)){
      if (options.html != null)
        options.html.push("" + (any.toLocaleString()))

      if (options.dom != null)
        options.dom.appendChild(document.createTextNode("" + (any.toLocaleString())))

    // OJ Type or Instance
    } else if (oj.isOJ(any)){
      if (options.types != null)
        options.types.push(any)

      if (options.html != null)
        options.html.push(any.toHTML(options))

      if (options.dom != null)
        options.dom.appendChild(any.toDOM(options))

      if (options.css != null)
        _extend(options.css, any.toCSSMap(options))
    }
    // Do nothing for: null, undefined, object
  }
function _compileAny ( any , options ) { // Array if ( oj . isArray ( any ) ) _compileTag ( any , options ) // String else if ( oj . isString ( any ) ) { if ( options . html != null ) options . html . push ( any ) if ( any . length > 0 && any [ 0 ] === '<' ) { var root = document . createElement ( 'div' ) root . innerHTML = any if ( options . dom != null ) options . dom . appendChild ( root ) } else { if ( options . dom != null ) options . dom . appendChild ( document . createTextNode ( any ) ) } // Boolean or Number } else if ( oj . isBoolean ( any ) || oj . isNumber ( any ) ) { if ( options . html != null ) options . html . push ( "" + any ) if ( options . dom != null ) options . dom . appendChild ( document . createTextNode ( "" + any ) ) // Function } else if ( oj . isFunction ( any ) ) { // Wrap function call to allow full oj generation within any _compileAny ( oj ( any ) , options ) // Date } else if ( oj . isDate ( any ) ) { if ( options . html != null ) options . html . push ( "" + ( any . toLocaleString ( ) ) ) if ( options . dom != null ) options . dom . appendChild ( document . createTextNode ( "" + ( any . toLocaleString ( ) ) ) ) // OJ Type or Instance } else if ( oj . isOJ ( any ) ) { if ( options . types != null ) options . types . push ( any ) if ( options . html != null ) options . html . push ( any . toHTML ( options ) ) if ( options . dom != null ) options . dom . appendChild ( any . toDOM ( options ) ) if ( options . css != null ) _extend ( options . css , any . toCSSMap ( options ) ) } // Do nothing for: null, undefined, object }
_compileAny Recursive helper for compiling ojml or any type
_compileAny Recursive helper for compiling ojml or any type