Skip to content

Commit 3caa54b

Browse files
Merge pull request prototypejs#307 from jdalton/no_repo_for_old_ie
Remove old browser support. New official support will be IE >=9, Edge, Safari >= 8, and recent versions of Firefox, Chrome, and Opera.
2 parents 5fddd3e + 54f3695 commit 3caa54b

27 files changed

+443
-2090
lines changed

src/prototype/ajax/ajax.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
var Ajax = {
66
getTransport: function() {
7-
return Try.these(
8-
function() {return new XMLHttpRequest()},
9-
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
10-
function() {return new ActiveXObject('Microsoft.XMLHTTP')}
11-
) || false;
7+
return new XMLHttpRequest();
128
},
139

1410
/**

src/prototype/ajax/response.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ Ajax.Response = Class.create({
161161
// Except Chrome doesn't seem to need this, and calling
162162
// `decodeURIComponent` on text that's already in the proper encoding
163163
// will throw a `URIError`. The ugly solution is to assume that a
164-
// `URIError` raised here signifies that the text is, in fact, already
164+
// `URIError` raised here signifies that the text is, in fact, already
165165
// in the correct encoding, and treat the failure as a good sign.
166166
//
167167
// This is ugly, but so too is sending extended characters in an HTTP
168168
// header with no spec to back you up.
169169
}
170-
170+
171171
try {
172172
return json.evalJSON(this.request.options.sanitizeJSON ||
173173
!this.request.isSameOrigin());

src/prototype/deprecated.js

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -117,41 +117,6 @@ var Position = {
117117

118118
/*--------------------------------------------------------------------------*/
119119

120-
if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
121-
function iter(name) {
122-
return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
123-
}
124-
125-
instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
126-
function(element, className) {
127-
className = className.toString().strip();
128-
var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
129-
return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
130-
} : function(element, className) {
131-
className = className.toString().strip();
132-
var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
133-
if (!classNames && !className) return elements;
134-
135-
var nodes = $(element).getElementsByTagName('*');
136-
className = ' ' + className + ' ';
137-
138-
for (var i = 0, child, cn; child = nodes[i]; i++) {
139-
if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
140-
(classNames && classNames.all(function(name) {
141-
return !name.toString().blank() && cn.include(' ' + name + ' ');
142-
}))))
143-
elements.push(Element.extend(child));
144-
}
145-
return elements;
146-
};
147-
148-
return function(className, parentElement) {
149-
return $(parentElement || document.body).getElementsByClassName(className);
150-
};
151-
}(Element.Methods);
152-
153-
/*--------------------------------------------------------------------------*/
154-
155120
Element.ClassNames = Class.create();
156121
Element.ClassNames.prototype = {
157122
initialize: function(element) {
@@ -250,7 +215,7 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
250215
for (var i = 0, length = elements.length; i < length; i++) {
251216
var element = elements[i];
252217
if (match(element, expression)) {
253-
results.push(Element.extend(element));
218+
results.push(element);
254219
}
255220
}
256221
return results;
@@ -272,7 +237,7 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
272237
for (var i = 0, length = elements.length; i < length; i++) {
273238
element = elements[i];
274239
if (Prototype.Selector.match(element, expression) && index === matchIndex++) {
275-
return Element.extend(element);
240+
return element;
276241
}
277242
}
278243
},

0 commit comments

Comments
 (0)