prototype: Add Prototype.Browser.MobileSafari which evaluates to true on the iPhone's browser.

This commit is contained in:
Sam Stephenson 2007-07-26 02:03:40 +00:00
parent 8077a0ccee
commit 5645a0783f
2 changed files with 10 additions and 5 deletions

View File

@ -1,5 +1,7 @@
*SVN*
* Add Prototype.Browser.MobileSafari which evaluates to true on the iPhone's browser. [sam]
* Optimize Selector#match and Element#match for simple selectors. Closes #9082. [Andrew Dupont]
* Remove the dependency on Element.ClassNames from Element#addClassName/removeClassName/toggleClassName, and deprecate Element.ClassNames. Closes #9073. [Tobie Langel]

13
src/prototype.js vendored
View File

@ -7,16 +7,16 @@ var Prototype = {
IE: !!(window.attachEvent && !window.opera),
Opera: !!window.opera,
WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1
Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
MobileSafari: !!navigator.userAgent.match(/iPhone.*Mobile.*Safari/)
},
BrowserFeatures: {
XPath: !!document.evaluate,
ElementExtensions: !!window.HTMLElement,
SpecificElementExtensions:
navigator.userAgent.indexOf('iPhone') == -1 &&
(document.createElement('div').__proto__ !==
document.createElement('form').__proto__)
document.createElement('div').__proto__ !==
document.createElement('form').__proto__
},
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
@ -24,7 +24,10 @@ var Prototype = {
emptyFunction: function() { },
K: function(x) { return x }
}
};
if (Prototype.Browser.MobileSafari)
Prototype.BrowserFeatures.SpecificElementExtensions = false;
<%= include 'base.js', 'string.js' %>