Skip to content

Commit

Permalink
[mms] Upgrade prototype.js to most recent git version (e3d5200cef3236…
Browse files Browse the repository at this point in the history
…b257ddcfb1eb3eabc5c586bedd).
  • Loading branch information
slusarz committed Sep 22, 2013
1 parent 2dc6afa commit 0d65a8d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
36 changes: 23 additions & 13 deletions framework/Core/js/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,10 @@ Object.extend(String.prototype, (function() {
var key = decodeURIComponent(pair.shift()),
value = pair.length > 1 ? pair.join('=') : pair[0];

if (value != undefined) value = decodeURIComponent(value);
if (value != undefined) {
value = value.gsub('+', ' ');
value = decodeURIComponent(value);
}

if (key in hash) {
if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
Expand Down Expand Up @@ -747,12 +750,17 @@ Object.extend(String.prototype, (function() {
return this.indexOf(pattern) > -1;
}

function startsWith(pattern) {
return this.lastIndexOf(pattern, 0) === 0;
function startsWith(pattern, position) {
position = Object.isNumber(position) ? position : 0;
return this.lastIndexOf(pattern, position) === position;
}

function endsWith(pattern) {
var d = this.length - pattern.length;
function endsWith(pattern, position) {
pattern = String(pattern);
position = Object.isNumber(position) ? position : this.length;
if (position < 0) position = 0;
if (position > this.length) position = this.length;
var d = position - pattern.length;
return d >= 0 && this.indexOf(pattern, d) === d;
}

Expand Down Expand Up @@ -794,8 +802,8 @@ Object.extend(String.prototype, (function() {
isJSON: isJSON,
evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON,
include: include,
startsWith: startsWith,
endsWith: endsWith,
startsWith: String.prototype.startsWith || startsWith,
endsWith: String.prototype.endsWith || endsWith,
empty: empty,
blank: blank,
interpolate: interpolate
Expand Down Expand Up @@ -1104,7 +1112,7 @@ Array.from = $A;
(function() {
var arrayProto = Array.prototype,
slice = arrayProto.slice,
_each = Prototype.Browser.IE ? null : arrayProto.forEach; // use native browser JS 1.6 implementation if available
_each = arrayProto.forEach; // use native browser JS 1.6 implementation if available

function each(iterator, context) {
for (var i = 0, length = this.length >>> 0; i < length; i++) {
Expand Down Expand Up @@ -1780,7 +1788,8 @@ Ajax.Request = Class.create(Ajax.Base, {
}

for (var name in headers)
this.transport.setRequestHeader(name, headers[name]);
if (headers[name] != null)
this.transport.setRequestHeader(name, headers[name]);
},

success: function() {
Expand Down Expand Up @@ -2759,9 +2768,9 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
}

var PROBLEMATIC_ATTRIBUTE_READING = (function() {
DIV.setAttribute('onclick', Prototype.emptyFunction);
DIV.setAttribute('onclick', []);
var value = DIV.getAttribute('onclick');
var isFunction = (typeof value === 'function');
var isFunction = Object.isArray(value);
DIV.removeAttribute('onclick');
return isFunction;
})();
Expand Down Expand Up @@ -3161,7 +3170,7 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
var filter = Element.getStyle(element, 'filter');
if (filter.length === 0) return 1.0;
var match = (filter || '').match(/alpha\(opacity=(.*)\)/);
if (match[1]) return parseFloat(match[1]) / 100;
if (match && match[1]) return parseFloat(match[1]) / 100;
return 1.0;
}

Expand Down Expand Up @@ -4078,7 +4087,8 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
function viewportOffset(forElement) {
var valueT = 0, valueL = 0, docBody = document.body;

var element = $(forElement);
forElement = $(forElement);
var element = forElement;
do {
valueT += element.offsetTop || 0;
valueL += element.offsetLeft || 0;
Expand Down
2 changes: 2 additions & 0 deletions framework/Core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Upgrade prototype.js to most recent git version (e3d5200cef3236b257ddcfb1eb3eabc5c586bedd).
* [mms] Cache permission results within a PHP access.
* [mms] Don&apos;t initialize unnecessary prefs object when creating the topbar.
* [mjr] Support ActiveSync SOFTDELETE.
Expand Down Expand Up @@ -3161,6 +3162,7 @@
<date>2013-09-05</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Upgrade prototype.js to most recent git version (e3d5200cef3236b257ddcfb1eb3eabc5c586bedd).
* [mms] Cache permission results within a PHP access.
* [mms] Don&apos;t initialize unnecessary prefs object when creating the topbar.
* [mjr] Support ActiveSync SOFTDELETE.
Expand Down

0 comments on commit 0d65a8d

Please sign in to comment.