Sha256: 76560a08d699a7f84e881142b02f7c478639e28bbb957ec24a39846c92e1399a

Contents?: true

Size: 1.69 KB

Versions: 11

Compression:

Stored size: 1.69 KB

Contents

$debug("Defining HTMLCollection");
/*
* HTMLCollection - DOM Level 2
* Implementation Provided by Steven Wood
*/
var HTMLCollection = function(nodelist, type){

  __setArray__(this, []);
  for (var i=0; i<nodelist.length; i++) {
      this[i] = nodelist[i];
  }
  
  this.length = nodelist.length;

}

HTMLCollection.prototype = {
        
    item : function (idx) {
        var ret = null;
        if ((idx >= 0) && (idx < this.length)) { 
            ret = this[idx];                    
        }
    
        return ret;   
    },
    
    namedItem : function (name) {
    }
};

// $w.HTMLCollection = HTMLCollection;

/*var HTMLCollection = function(nodelist, type){
  var $items = [], 
      $item, i;
  if(type === "Anchor" ){
    for(i=0;i<nodelist.length;i++){ 
      //The name property is required to be add to the collection
      if(nodelist.item(i).name){
        item = new nodelist.item(i);
        $items.push(item);
        this[nodelist.item(i).name] = item;
      }
    }
  }else if(type === "Link"){
    for(i=0;i<nodelist.length;i++){ 
      //The name property is required to be add to the collection
      if(nodelist.item(i).href){
        item = new nodelist.item(i);
        $items.push(item);
        this[nodelist.item(i).name] = item;
      }
    }
  }else if(type === "Form"){
    for(i=0;i<nodelist.length;i++){ 
      //The name property is required to be add to the collection
      if(nodelist.item(i).href){
        item = new nodelist.item(i);
        $items.push(item);
        this[nodelist.item(i).name] = item;
      }
    }
  }
  setArray(this, $items);
  return __extend__(this, {
    item : function(i){return this[i];},
    namedItem : function(name){return this[name];}
  });
};*/

	

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
envjs19-0.3.8.20101029121421 src/html/collection.js
envjs-0.3.8 src/html/collection.js
envjs-0.3.7 src/html/collection.js
envjs-0.3.6 src/html/collection.js
envjs-0.3.5 src/html/collection.js
envjs-0.3.4 src/html/collection.js
envjs-0.3.3 src/html/collection.js
envjs-0.3.2 src/html/collection.js
envjs-0.3.1 src/html/collection.js
envjs-0.3.0 src/html/collection.js
envjs-0.2.0 src/html/collection.js