View MooToolsEntityEncoding.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!String.regexEncode){ | |
String.regexChars = ['\\', '&','^', '$', '*', '+', '?', '.', '(', ')', '|', '{', '}', '[', ']']; | |
String.regexEncodeRegexObject = new RegExp('([\\'+String.regexChars.join('|\\')+'])', 'g'); | |
String.implement({ | |
regexEncode : function(){ | |
return this.replace(String.regexEncodeRegexObject, '\\$1'); | |
} | |
}); | |
} |
View Function.whenTrue.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!Function.actionTimeout) Function.actionTimeout = 16384; | |
if(!Function.whenTrue){ | |
Function.implement({ | |
whenTrue : function(actionFunction, args, delayFunction, timeoutFunction, timeout, counter){ | |
if(!timeout) timeout = Function.actionTimeout; | |
if(!counter) counter = 0; | |
if(!timeoutFunction) timeoutFunction = function(event){ | |
throw('Condition not met after '+event.time+'ms'); | |
}; | |
var result = this(); |
View element_style_aggregation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!Element.siblingsBefore){ | |
Element.implement({ | |
siblingsBefore : function(){ | |
var results = []; | |
var found = false; | |
this.getParent().getChildren().each(function(child){ | |
if(this == child) found = true; | |
if(!found) results.push(child); | |
}); | |
return new Elements(results); |
NewerOlder