diff options
author | Simon B @piratpartiet <simonb@redhog.org> | 2010-04-21 10:57:14 +0200 |
---|---|---|
committer | Simon B @piratpartiet <simonb@redhog.org> | 2010-04-21 10:57:14 +0200 |
commit | a234be69475a98fca3234a73ab70018124ced5cb (patch) | |
tree | 1287b17aa943727af1cfc21be6fae34cc0bc6f15 /infrastructure | |
parent | e794aa43d7977aa58a7ef8704ac212008e0280e9 (diff) | |
download | etherpad-a234be69475a98fca3234a73ab70018124ced5cb.tar.gz etherpad-a234be69475a98fca3234a73ab70018124ced5cb.tar.xz etherpad-a234be69475a98fca3234a73ab70018124ced5cb.zip |
Fix IE lacking Array#map. Closes #70
Diffstat (limited to '')
-rw-r--r-- | infrastructure/ace/www/ace2_outer.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/infrastructure/ace/www/ace2_outer.js b/infrastructure/ace/www/ace2_outer.js index 212c159..f947534 100644 --- a/infrastructure/ace/www/ace2_outer.js +++ b/infrastructure/ace/www/ace2_outer.js @@ -204,6 +204,17 @@ function Ace2Editor() { '</head><body id="outerdocbody"><div id="sidediv"><!-- --></div><div id="linemetricsdiv">x</div><div id="overlaysdiv"><!-- --></div></body></html>']; + if (!Array.prototype.map) Array.prototype.map = function(fun) { //needed for IE + if (typeof fun != "function") throw new TypeError(); + var len = this.length; + var res = new Array(len); + var thisp = arguments[1]; + for (var i = 0; i < len; i++) { + if (i in this) res[i] = fun.call(thisp, this[i], i, this); + } + return res; + }; + var outerFrame = document.createElement("IFRAME"); outerFrame.frameBorder = 0; // for IE info.frame = outerFrame; |