Created
April 27, 2012 09:24
-
-
Save freynaud/2507758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MyUIAElementArray(elements) { | |
this.elements = elements; | |
this.length = elements.length; | |
this.toArray =function(){ | |
return this.elements; | |
} | |
this.firstWithName = function(name) { | |
for( i = 0; i < this.elements.length; i++) { | |
var current = elements[i]; | |
if(current.name() === name) { | |
return current; | |
} | |
} | |
throw UIAException("cannot find an element with name=" + name); | |
} | |
this.buttons = function() { | |
return this._getElementsOfType("UIAButton"); | |
} | |
this.links = function() { | |
return this._getElementsOfType("UIALink"); | |
} | |
this.images = function() { | |
return this._getElementsOfType("UIAImage"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment