-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add polyfills for setTimeout and setInterval
- Loading branch information
Showing
6 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
cat js/eldarion-ajax-core.js js/eldarion-ajax-handlers.js | uglifyjs -ncm > js/.tmp.min.js | ||
cat js/polyfills.js js/eldarion-ajax-core.js js/eldarion-ajax-handlers.js | uglifyjs -ncm > js/.tmp.min.js | ||
cat js/copyright.js js/.tmp.min.js > js/eldarion-ajax.min.js | ||
rm js/.tmp.min.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*\ | ||
|*| | ||
|*| IE-specific polyfill which enables the passage of arbitrary arguments to the | ||
|*| callback functions of javascript timers (HTML5 standard syntax). | ||
|*| | ||
|*| https://developer.mozilla.org/en-US/docs/DOM/window.setInterval | ||
|*| | ||
|*| Syntax: | ||
|*| var timeoutID = window.setTimeout(func, delay, [param1, param2, ...]); | ||
|*| var timeoutID = window.setTimeout(code, delay); | ||
|*| var intervalID = window.setInterval(func, delay[, param1, param2, ...]); | ||
|*| var intervalID = window.setInterval(code, delay); | ||
|*| | ||
\*/ | ||
|
||
if (document.all && !window.setTimeout.isPolyfill) { | ||
var __nativeST__ = window.setTimeout; | ||
window.setTimeout = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) { | ||
var aArgs = Array.prototype.slice.call(arguments, 2); | ||
return __nativeST__(vCallback instanceof Function ? function () { | ||
vCallback.apply(null, aArgs); | ||
} : vCallback, nDelay); | ||
}; | ||
window.setTimeout.isPolyfill = true; | ||
} | ||
|
||
if (document.all && !window.setInterval.isPolyfill) { | ||
var __nativeSI__ = window.setInterval; | ||
window.setInterval = function (vCallback, nDelay /*, argumentToPass1, argumentToPass2, etc. */) { | ||
var aArgs = Array.prototype.slice.call(arguments, 2); | ||
return __nativeSI__(vCallback instanceof Function ? function () { | ||
vCallback.apply(null, aArgs); | ||
} : vCallback, nDelay); | ||
}; | ||
window.setInterval.isPolyfill = true; | ||
} |
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
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
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
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