Remove dependencies on native `map`.
This commit is contained in:
parent
f010f3ae9d
commit
3678625c7c
|
@ -371,19 +371,6 @@ function Ace2Editor()
|
|||
// (throbs busy while typing)
|
||||
outerHTML.push('<link rel="stylesheet" type="text/css" href="data:text/css,"/>', '\x3cscript>\n', outerScript.replace(/<\//g, '<\\/'), '\n\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;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
// requires: undefined
|
||||
|
||||
var plugins = require('/plugins').plugins;
|
||||
var map = require('/ace2_common').map;
|
||||
|
||||
var domline = {};
|
||||
domline.noop = function()
|
||||
|
@ -145,10 +146,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
|||
|
||||
var plugins_ = plugins;
|
||||
|
||||
plugins_.callHook("aceCreateDomLine", {
|
||||
map(plugins_.callHook("aceCreateDomLine", {
|
||||
domline: domline,
|
||||
cls: cls
|
||||
}).map(function(modifier)
|
||||
}), function(modifier)
|
||||
{
|
||||
cls = modifier.cls;
|
||||
extraOpenTags = extraOpenTags + modifier.extraOpenTags;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
// requires: undefined
|
||||
|
||||
var plugins = require('/plugins').plugins;
|
||||
var map = require('/ace2_common').map;
|
||||
|
||||
var domline = {};
|
||||
domline.noop = function()
|
||||
|
@ -144,10 +145,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
|||
|
||||
var plugins_ = plugins;
|
||||
|
||||
plugins_.callHook("aceCreateDomLine", {
|
||||
map(plugins_.callHook("aceCreateDomLine", {
|
||||
domline: domline,
|
||||
cls: cls
|
||||
}).map(function(modifier)
|
||||
}), function(modifier)
|
||||
{
|
||||
cls = modifier.cls;
|
||||
extraOpenTags = extraOpenTags + modifier.extraOpenTags;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
var Changeset = require('/easysync2').Changeset
|
||||
var plugins = require('/plugins').plugins;
|
||||
var map = require('/ace2_common').map;
|
||||
|
||||
var linestylefilter = {};
|
||||
|
||||
|
@ -305,7 +306,7 @@ linestylefilter.getFilterStack = function(lineText, textAndClassFunc, browser)
|
|||
linestylefilter: linestylefilter,
|
||||
browser: browser
|
||||
});
|
||||
hookFilters.map(function(hookFilter)
|
||||
map(hookFilters, function(hookFilter)
|
||||
{
|
||||
func = hookFilter(lineText, func);
|
||||
});
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
var Changeset = require('/easysync2_client').Changeset
|
||||
var plugins = require('/plugins').plugins;
|
||||
var map = require('/ace2_common').map;
|
||||
|
||||
var linestylefilter = {};
|
||||
|
||||
|
@ -303,7 +304,7 @@ linestylefilter.getFilterStack = function(lineText, textAndClassFunc, browser)
|
|||
linestylefilter: linestylefilter,
|
||||
browser: browser
|
||||
});
|
||||
hookFilters.map(function(hookFilter)
|
||||
map(hookFilters, function(hookFilter)
|
||||
{
|
||||
func = hookFilter(lineText, func);
|
||||
});
|
||||
|
|
|
@ -25,10 +25,12 @@ var plugins = {
|
|||
if (sep == undefined) sep = '';
|
||||
if (pre == undefined) pre = '';
|
||||
if (post == undefined) post = '';
|
||||
return plugins.callHook(hookName, args).map(function(x)
|
||||
{
|
||||
return pre + x + post
|
||||
}).join(sep || "");
|
||||
var newCallhooks = [];
|
||||
var callhooks = plugins.callHook(hookName, args);
|
||||
for (var i = 0, ii = callhooks.length; i < ii; i++) {
|
||||
newCallhooks[i] = pre + callhooks[i] + post;
|
||||
}
|
||||
return newCallhooks.join(sep || "");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue