Skip to content

Commit

Permalink
[mms] Upgrade prototype.js to most recent git version (0df1298f807818…
Browse files Browse the repository at this point in the history
…471209b7e7971c3480e36a4f71).

Maintain Horde patch from 388a6c0
  • Loading branch information
slusarz committed Apr 4, 2014
1 parent d7109fb commit b3d831a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
42 changes: 37 additions & 5 deletions framework/Core/js/prototype.js
Expand Up @@ -564,14 +564,19 @@ Object.extend(String.prototype, (function() {
return function(match) { return template.evaluate(match) };
}

function isNonEmptyRegExp(regexp) {
return regexp.source && regexp.source !== '(?:)';
}


function gsub(pattern, replacement) {
var result = '', source = this, match;
replacement = prepareReplacement(replacement);

if (Object.isString(pattern))
pattern = RegExp.escape(pattern);

if (!(pattern.length || pattern.source)) {
if (!(pattern.length || isNonEmptyRegExp(pattern))) {
replacement = replacement('');
return replacement + source.split('').join(replacement) + replacement;
}
Expand Down Expand Up @@ -2807,13 +2812,33 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
return element;
}

var PROBLEMATIC_HAS_ATTRIBUTE_WITH_CHECKBOXES = (function () {
if (!HAS_EXTENDED_CREATE_ELEMENT_SYNTAX) {
return false;
}
var checkbox = document.createElement('<input type="checkbox">');
checkbox.checked = true;
var node = checkbox.getAttributeNode('checked');
var buggy = !node.specified;
return !node.specified;
})();

function hasAttribute(element, attribute) {
attribute = ATTRIBUTE_TRANSLATIONS.has[attribute] || attribute;
var node = $(element).getAttributeNode(attribute);
return !!(node && node.specified);
}

GLOBAL.Element.Methods.Simulated.hasAttribute = hasAttribute;
function hasAttribute_IE(element, attribute) {
if (attribute === 'checked') {
return element.checked;
}
return hasAttribute(element, attribute);
}

GLOBAL.Element.Methods.Simulated.hasAttribute =
PROBLEMATIC_HAS_ATTRIBUTE_WITH_CHECKBOXES ?
hasAttribute_IE : hasAttribute;

function classNames(element) {
return new Element.ClassNames(element);
Expand Down Expand Up @@ -4077,9 +4102,16 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
function cumulativeScrollOffset(element) {
var valueT = 0, valueL = 0;
do {
valueT += element.scrollTop || 0;
valueL += element.scrollLeft || 0;
element = element.parentNode;
if (element === document.body) {
var bodyScrollNode = document.documentElement || document.body.parentNode || document.body;
valueT += !Object.isUndefined(window.pageYOffset) ? window.pageYOffset : bodyScrollNode.scrollTop || 0;
valueL += !Object.isUndefined(window.pageXOffset) ? window.pageXOffset : bodyScrollNode.scrollLeft || 0;
break;
} else {
valueT += element.scrollTop || 0;
valueL += element.scrollLeft || 0;
element = element.parentNode;
}
} while (element);
return new Element.Offset(valueL, valueT);
}
Expand Down
2 changes: 2 additions & 0 deletions framework/Core/package.xml
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 (0df1298f807818471209b7e7971c3480e36a4f71).
* [mjr] Fix issue that causes enter to submit the form when inside the pretty autocompleter (Bug #12923).
* [mms] Don&apos;t store preference UI elements in the session cache storage.
* [mjr] Send the PRIMARYSMTPADDRESS to EAS clients, if appropriate (Request #13062).
Expand Down Expand Up @@ -3361,6 +3362,7 @@
<date>2014-02-13</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Upgrade prototype.js to most recent git version (0df1298f807818471209b7e7971c3480e36a4f71).
* [mjr] Fix issue that causes enter to submit the form when inside the pretty autocompleter (Bug #12923).
* [mms] Don&apos;t store preference UI elements in the session cache storage.
* [mjr] Send the PRIMARYSMTPADDRESS to EAS clients, if appropriate (Request #13062).
Expand Down

0 comments on commit b3d831a

Please sign in to comment.