| | 1117 | var _nativeExtensions = false; |
|---|
| | 1118 | |
|---|
| | 1119 | if(!HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) { |
|---|
| | 1120 | var HTMLElement = {} |
|---|
| | 1121 | HTMLElement.prototype = document.createElement('div').__proto__; |
|---|
| | 1122 | } |
|---|
| | 1123 | |
|---|
| | 1124 | if(typeof HTMLElement != 'undefined') { |
|---|
| | 1125 | var methods = Element.Methods, cache = Element.extend.cache; |
|---|
| | 1126 | for (property in methods) { |
|---|
| | 1127 | var value = methods[property]; |
|---|
| | 1128 | if (typeof value == 'function') |
|---|
| | 1129 | HTMLElement.prototype[property] = cache.findOrStore(value); |
|---|
| | 1130 | } |
|---|
| | 1131 | _nativeExtensions = true; |
|---|
| | 1132 | } |
|---|
| | 1133 | |
|---|
| | 1134 | Element.addMethods = function(methods) { |
|---|
| | 1135 | Object.extend(Element.Methods, methods); |
|---|
| | 1136 | |
|---|
| | 1137 | if(_nativeExtensions) { |
|---|
| | 1138 | var tmp = document.createElement('div'); |
|---|
| | 1139 | var methods = Element.Methods, cache = Element.extend.cache; |
|---|
| | 1140 | for (property in methods) { |
|---|
| | 1141 | var value = methods[property]; |
|---|
| | 1142 | if (typeof value == 'function') |
|---|
| | 1143 | HTMLElement.prototype[property] = cache.findOrStore(value); |
|---|
| | 1144 | } |
|---|
| | 1145 | } |
|---|
| | 1146 | } |
|---|
| | 1147 | |
|---|