diff options
author | Marcel Klehr <mklehr@gmx.net> | 2013-05-08 07:19:15 -0700 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2013-05-08 07:19:15 -0700 |
commit | 90d159868864a879ea5f4903d0611fd4869c6612 (patch) | |
tree | cf42d4ab30a2190607729b82b50508c76ba235a6 /src/static/js | |
parent | 42e164c1b6efa8c3962f917ec095aa9fcf7d60ff (diff) | |
parent | 98c43aff43535ed8d05e4c073590c77d4be4d9c6 (diff) | |
download | etherpad-lite-90d159868864a879ea5f4903d0611fd4869c6612.zip |
Merge pull request #1751 from goldquest/dev_IE8-fix
Fixing IE8 errors
Diffstat (limited to 'src/static/js')
-rw-r--r-- | src/static/js/changesettracker.js | 11 | ||||
-rw-r--r-- | src/static/js/html10n.js | 9 | ||||
-rw-r--r-- | src/static/js/pad.js | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/src/static/js/changesettracker.js b/src/static/js/changesettracker.js index dde4f5c7..8c4c1c21 100644 --- a/src/static/js/changesettracker.js +++ b/src/static/js/changesettracker.js @@ -57,6 +57,7 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider) { changeCallback(); } + catch(pseudoError) {} finally { changeCallbackTimeout = null; @@ -161,6 +162,16 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider) } else { + + // add forEach function to Array.prototype for IE8 + if (!('forEach' in Array.prototype)) { + Array.prototype.forEach= function(action, that /*opt*/) { + for (var i= 0, n= this.length; i<n; i++) + if (i in this) + action.call(that, this[i], i, this); + }; + } + // Get my authorID var authorId = parent.parent.pad.myUserInfo.userId; diff --git a/src/static/js/html10n.js b/src/static/js/html10n.js index e1c884cd..90d51e22 100644 --- a/src/static/js/html10n.js +++ b/src/static/js/html10n.js @@ -79,6 +79,15 @@ window.html10n = (function(window, document, undefined) { return -1; } } + + // fix Array.prototype.forEach in IE + if (!('forEach' in Array.prototype)) { + Array.prototype.forEach= function(action, that /*opt*/) { + for (var i= 0, n= this.length; i<n; i++) + if (i in this) + action.call(that, this[i], i, this); + }; + } /** * MicroEvent - to make any js object an event emitter (server or browser) diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 504bc21e..9a42bccc 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -463,7 +463,7 @@ var pad = { { try { - doc.execCommand("BackgroundImageCache", false, true); + document.execCommand("BackgroundImageCache", false, true); } catch (e) {} |