equal
deleted
inserted
replaced
93 text = text.replace(/^([\s]+)/, ''); |
93 text = text.replace(/^([\s]+)/, ''); |
94 text = text.replace(/([\s]+)$/, ''); |
94 text = text.replace(/([\s]+)$/, ''); |
95 return text; |
95 return text; |
96 } |
96 } |
97 |
97 |
|
98 // Tell which elements have the specified CSS class |
|
99 // Parameters: |
|
100 // * object - HTMLElement |
|
101 // * string - class name |
|
102 // * string - tag name, if omitted will test all elements (slow) |
|
103 function getElementsByClassName(oRoot, className, tagName) |
|
104 { |
|
105 tagName = ( tagName ) ? tagName : '*'; |
|
106 var arrEls = document.getElementsByTagName(tagName); |
|
107 var arrResult = []; |
|
108 for ( var i = 0; i < arrEls.length; i++ ) |
|
109 { |
|
110 if ( $(arrEls[i]).hasClass(className) ) |
|
111 { |
|
112 arrResult.push(arrEls[i]); |
|
113 } |
|
114 } |
|
115 return arrResult; |
|
116 } |
|
117 |
|
118 // shortcut :) |
|
119 document.getElementsByClassName = function(a, b) |
|
120 { |
|
121 return getElementsByClassName(document, a, b); |
|
122 } |
|
123 |