aboutsummaryrefslogtreecommitdiffstats
path: root/infrastructure/ace/www
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--infrastructure/ace/www/ace2_outer.js14
-rw-r--r--infrastructure/ace/www/domline.js9
-rw-r--r--infrastructure/ace/www/linestylefilter.js9
3 files changed, 29 insertions, 3 deletions
diff --git a/infrastructure/ace/www/ace2_outer.js b/infrastructure/ace/www/ace2_outer.js
index e6d430d..f947534 100644
--- a/infrastructure/ace/www/ace2_outer.js
+++ b/infrastructure/ace/www/ace2_outer.js
@@ -168,7 +168,7 @@ function Ace2Editor() {
var iframeHTML = ["'"+doctype+"<html><head>'"];
- top.plugins.callHook(
+ plugins.callHook(
"aceInitInnerdocbodyHead", {iframeHTML:iframeHTML});
// these lines must conform to a specific format because they are passed by the build script:
@@ -203,6 +203,18 @@ function Ace2Editor() {
'\x3cscript>', outerScript, '\x3c/script>',
'</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;
diff --git a/infrastructure/ace/www/domline.js b/infrastructure/ace/www/domline.js
index 90e9943..f1d19e4 100644
--- a/infrastructure/ace/www/domline.js
+++ b/infrastructure/ace/www/domline.js
@@ -101,7 +101,14 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) {
var extraOpenTags = "";
var extraCloseTags = "";
- (function () { try { return top.plugins; } catch (e) { return plugins; }; })().callHook(
+ var plugins_;
+ if (typeof(plugins)!='undefined') {
+ plugins_ = plugins;
+ } else {
+ plugins_ = parent.parent.plugins;
+ }
+
+ plugins_.callHook(
"aceCreateDomLine", {domline:domline, cls:cls}
).map(function (modifier) {
cls = modifier.cls;
diff --git a/infrastructure/ace/www/linestylefilter.js b/infrastructure/ace/www/linestylefilter.js
index c163120..196cb63 100644
--- a/infrastructure/ace/www/linestylefilter.js
+++ b/infrastructure/ace/www/linestylefilter.js
@@ -238,7 +238,14 @@ linestylefilter.textAndClassFuncSplitter = function(func, splitPointsOpt) {
linestylefilter.getFilterStack = function(lineText, textAndClassFunc, browser) {
var func = linestylefilter.getURLFilter(lineText, textAndClassFunc);
- var hookFilters = (function () { try { return top.plugins; } catch (e) { return plugins; }; })().callHook(
+ var plugins_;
+ if (typeof(plugins)!='undefined') {
+ plugins_ = plugins;
+ } else {
+ plugins_ = parent.parent.plugins;
+ }
+
+ var hookFilters = plugins_.callHook(
"aceGetFilterStack", {linestylefilter:linestylefilter, browser:browser});
hookFilters.map(function (hookFilter) {
func = hookFilter(lineText, func);