Ticket #8182: prototype-1.5.1-element-update.patch
| File prototype-1.5.1-element-update.patch, 2.5 kB (added by alar, 2 years ago) |
|---|
-
prototype.js
old new 10 10 Version: '1.5.1', 11 11 12 12 Browser: { 13 IE: !!(window.attachEvent && !window.opera), 14 Opera: !!window.opera, 15 WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, 16 Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1 13 IE: !!(window.attachEvent && !window.opera), 14 Opera: !!window.opera, 15 WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, 16 Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, 17 Konqueror: navigator.vendor && navigator.vendor.indexOf('KDE') > -1 17 18 }, 18 19 19 20 BrowserFeatures: { … … 1720 1721 'alpha(opacity=' + (value * 100) + ')'; 1721 1722 return element; 1722 1723 }; 1723 1724 // IE is missing .innerHTML support for TABLE-related elements 1724 } 1725 else if (Prototype.Browser.Gecko) { 1726 Element.Methods.setOpacity = function(element, value) { 1727 element = $(element); 1728 element.style.opacity = (value == 1) ? 0.999999 : 1729 (value === '') ? '' : (value < 0.00001) ? 0 : value; 1730 return element; 1731 }; 1732 } 1733 if (Prototype.Browser.IE || Prototype.Browser.Konqueror) { 1734 // IE and Konqueror are missing .innerHTML support for TABLE-related elements 1725 1735 Element.Methods.update = function(element, html) { 1726 1736 element = $(element); 1727 1737 html = typeof html == 'undefined' ? '' : html.toString(); 1728 1738 var tagName = element.tagName.toUpperCase(); 1729 if (['THEAD','TBODY','TR','TD'].include(tagName)) { 1739 if ((Prototype.Browser.Konqueror && ['TABLE','THEAD','TFOOT','TBODY'].include(tagName)) 1740 || (Prototype.Browser.IE && ['TABLE','THEAD','TFOOT','TBODY','TR','TD'].include(tagName))) { 1730 1741 var div = document.createElement('div'); 1731 1742 switch (tagName) { 1743 case 'TABLE': 1744 div.innerHTML = '<table>' + html.stripScripts() + '</table>'; 1745 depth = 1; 1746 break; 1732 1747 case 'THEAD': 1748 case 'TFOOT': 1733 1749 case 'TBODY': 1734 1750 div.innerHTML = '<table><tbody>' + html.stripScripts() + '</tbody></table>'; 1735 1751 depth = 2; … … 1750 1766 } 1751 1767 setTimeout(function() { html.evalScripts() }, 10); 1752 1768 return element; 1753 }1754 }1755 else if (Prototype.Browser.Gecko) {1756 Element.Methods.setOpacity = function(element, value) {1757 element = $(element);1758 element.style.opacity = (value == 1) ? 0.999999 :1759 (value === '') ? '' : (value < 0.00001) ? 0 : value;1760 return element;1761 1769 }; 1762 1770 } 1763 1771