| 205 | | if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { |
|---|
| 206 | | escapeHTML: function() { |
|---|
| 207 | | return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); |
|---|
| 208 | | }, |
|---|
| 209 | | unescapeHTML: function() { |
|---|
| 210 | | return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); |
|---|
| 211 | | } |
|---|
| 212 | | }); |
|---|
| | 205 | if (Prototype.Browser.WebKit || Prototype.Browser.IE) { |
|---|
| | 206 | Object.extend(String.prototype, { |
|---|
| | 207 | escapeHTML: function() { |
|---|
| | 208 | return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); |
|---|
| | 209 | }, |
|---|
| | 210 | unescapeHTML: function() { |
|---|
| | 211 | return this.replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); |
|---|
| | 212 | } |
|---|
| | 213 | }); |
|---|
| | 214 | } else { |
|---|
| | 215 | Object.extend(String.prototype.escapeHTML, { |
|---|
| | 216 | div: document.createElement('div'), |
|---|
| | 217 | text: document.createTextNode('') |
|---|
| | 218 | }); |
|---|
| | 219 | |
|---|
| | 220 | with (String.prototype.escapeHTML) div.appendChild(text); |
|---|
| | 221 | } |
|---|