2007-01-18 22:24:27 +00:00
|
|
|
<%= include 'HEADER' %>
|
|
|
|
|
|
|
|
var Prototype = {
|
|
|
|
Version: '<%= PROTOTYPE_VERSION %>',
|
2007-02-19 22:23:10 +00:00
|
|
|
|
|
|
|
Browser: {
|
2008-07-17 20:22:18 +00:00
|
|
|
IE: !!(window.attachEvent &&
|
|
|
|
navigator.userAgent.indexOf('Opera') === -1),
|
|
|
|
Opera: navigator.userAgent.indexOf('Opera') > -1,
|
2007-02-19 22:23:10 +00:00
|
|
|
WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
|
2008-07-17 20:22:18 +00:00
|
|
|
Gecko: navigator.userAgent.indexOf('Gecko') > -1 &&
|
|
|
|
navigator.userAgent.indexOf('KHTML') === -1,
|
2007-10-08 17:30:40 +00:00
|
|
|
MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
|
2007-02-19 22:23:10 +00:00
|
|
|
},
|
2007-04-24 03:31:14 +00:00
|
|
|
|
2007-01-18 22:24:27 +00:00
|
|
|
BrowserFeatures: {
|
2007-01-27 19:45:34 +00:00
|
|
|
XPath: !!document.evaluate,
|
2008-03-30 03:21:58 +00:00
|
|
|
SelectorsAPI: !!document.querySelector,
|
2009-01-22 02:29:23 +00:00
|
|
|
ElementExtensions: (function() {
|
|
|
|
if (window.HTMLElement && window.HTMLElement.prototype)
|
|
|
|
return true;
|
|
|
|
if (window.Element && window.Element.prototype)
|
|
|
|
return true;
|
|
|
|
})(),
|
|
|
|
SpecificElementExtensions: (function() {
|
|
|
|
// First, try the named class
|
|
|
|
if (typeof window.HTMLDivElement !== 'undefined')
|
|
|
|
return true;
|
|
|
|
|
|
|
|
var div = document.createElement('div');
|
|
|
|
if (div['__proto__'] && div['__proto__'] !==
|
|
|
|
document.createElement('form')['__proto__']) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
})()
|
2007-01-18 22:24:27 +00:00
|
|
|
},
|
2007-04-24 03:31:14 +00:00
|
|
|
|
2007-06-13 20:57:19 +00:00
|
|
|
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
|
|
|
|
JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
|
2007-04-24 03:31:14 +00:00
|
|
|
|
|
|
|
emptyFunction: function() { },
|
2007-01-18 22:24:27 +00:00
|
|
|
K: function(x) { return x }
|
2007-07-26 02:03:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (Prototype.Browser.MobileSafari)
|
|
|
|
Prototype.BrowserFeatures.SpecificElementExtensions = false;
|
2007-10-16 03:08:31 +00:00
|
|
|
|
2008-12-11 10:42:15 +00:00
|
|
|
var Abstract = { };
|
|
|
|
|
2008-12-14 04:36:59 +00:00
|
|
|
/**
|
|
|
|
* == lang ==
|
|
|
|
* Language extensions.
|
|
|
|
**/
|
|
|
|
|
|
|
|
/** section: lang
|
|
|
|
* Try
|
|
|
|
**/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Try.these(function...) -> ?
|
|
|
|
* - function (Function): A function that may throw an exception.
|
|
|
|
* Accepts an arbitrary number of functions and returns the result of the
|
|
|
|
* first one that doesn't throw an error.
|
|
|
|
**/
|
2008-12-11 10:42:15 +00:00
|
|
|
var Try = {
|
|
|
|
these: function() {
|
|
|
|
var returnValue;
|
|
|
|
|
|
|
|
for (var i = 0, length = arguments.length; i < length; i++) {
|
|
|
|
var lambda = arguments[i];
|
|
|
|
try {
|
|
|
|
returnValue = lambda();
|
|
|
|
break;
|
|
|
|
} catch (e) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
return returnValue;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-12-11 10:45:10 +00:00
|
|
|
<%= include 'lang/class.js', 'lang/object.js', 'lang/function.js' %>
|
2007-01-18 22:24:27 +00:00
|
|
|
|
2008-12-11 10:45:10 +00:00
|
|
|
<%= include 'lang/date.js', 'lang/regexp.js', 'lang/periodical_executer.js' %>
|
2007-01-18 22:24:27 +00:00
|
|
|
|
2008-12-11 10:45:10 +00:00
|
|
|
<%= include 'lang/string.js', 'lang/template.js' %>
|
2007-01-18 22:24:27 +00:00
|
|
|
|
2008-12-11 10:45:10 +00:00
|
|
|
<%= include 'lang/enumerable.js', 'lang/array.js', 'lang/hash.js' %>
|
|
|
|
|
|
|
|
<%= include 'lang/number.js', 'lang/range.js' %>
|
|
|
|
|
|
|
|
<%= include 'ajax/ajax.js', 'ajax/responders.js', 'ajax/base.js', 'ajax/request.js', 'ajax/response.js' %>
|
|
|
|
|
|
|
|
<%= include 'ajax/updater.js', 'ajax/periodical_updater.js' %>
|
|
|
|
|
|
|
|
<%= include 'dom/dom.js', 'dom/selector.js', 'dom/form.js', 'dom/event.js' %>
|
|
|
|
|
|
|
|
<%= include 'deprecated.js' %>
|
2007-01-18 22:24:27 +00:00
|
|
|
|
|
|
|
Element.addMethods();
|