prototype/src/prototype.js

67 lines
2.1 KiB
JavaScript
Raw Normal View History

2009-01-27 21:42:32 +00:00
/* Prototype JavaScript framework, version <%= PROTOTYPE_VERSION %>
* (c) 2005-2009 Sam Stephenson
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://www.prototypejs.org/
*
*--------------------------------------------------------------------------*/
2007-01-18 22:24:27 +00:00
var Prototype = {
Version: '<%= PROTOTYPE_VERSION %>',
Browser: (function(){
var ua = navigator.userAgent;
// Opera (at least) 8.x+ has "Opera" as a [[Class]] of `window.opera`
// This is a safer inference than plain boolean type conversion of `window.opera`
var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
return {
IE: !!window.attachEvent && !isOpera,
Opera: isOpera,
WebKit: ua.indexOf('AppleWebKit/') > -1,
Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
MobileSafari: /Apple.*Mobile.*Safari/.test(ua)
}
})(),
2007-01-18 22:24:27 +00:00
BrowserFeatures: {
XPath: !!document.evaluate,
SelectorsAPI: !!document.querySelector,
ElementExtensions: (function() {
var constructor = window.Element || window.HTMLElement;
return !!(constructor && constructor.prototype);
})(),
SpecificElementExtensions: (function() {
// First, try the named class
if (typeof window.HTMLDivElement !== 'undefined')
return true;
var div = document.createElement('div');
var form = document.createElement('form');
var isSupported = false;
if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
isSupported = true;
}
div = form = null;
return isSupported;
})()
2007-01-18 22:24:27 +00:00
},
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
emptyFunction: function() { },
2007-01-18 22:24:27 +00:00
K: function(x) { return x }
};
if (Prototype.Browser.MobileSafari)
Prototype.BrowserFeatures.SpecificElementExtensions = false;
2009-01-27 21:42:32 +00:00
//= require "lang"
//= require "ajax"
//= require "dom"
2007-01-18 22:24:27 +00:00
2009-01-27 21:42:32 +00:00
//= require "deprecated"