Merge branch 'master' of github.com:ajaxorg/ace into server-side-rendering
This commit is contained in:
commit
dff21be992
23 changed files with 91 additions and 154 deletions
|
|
@ -23,6 +23,7 @@
|
||||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||||
* Julian Viereck <julian DOT viereck AT gmail DOT com>
|
* Julian Viereck <julian DOT viereck AT gmail DOT com>
|
||||||
* Mihai Sucan <mihai.sucan@gmail.com>
|
* Mihai Sucan <mihai.sucan@gmail.com>
|
||||||
|
* Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
|
@ -121,8 +122,8 @@ var Text = function(parentEl) {
|
||||||
// Note: characterWidth can be a float!
|
// Note: characterWidth can be a float!
|
||||||
measureNode.innerHTML = lang.stringRepeat("Xy", n);
|
measureNode.innerHTML = lang.stringRepeat("Xy", n);
|
||||||
|
|
||||||
if (document.body) {
|
if (this.element.ownerDocument.body) {
|
||||||
document.body.appendChild(measureNode);
|
this.element.ownerDocument.body.appendChild(measureNode);
|
||||||
} else {
|
} else {
|
||||||
var container = this.element.parentNode;
|
var container = this.element.parentNode;
|
||||||
while (!dom.hasCssClass(container, "ace_editor"))
|
while (!dom.hasCssClass(container, "ace_editor"))
|
||||||
|
|
@ -257,7 +258,7 @@ var Text = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$renderLinesFragment = function(config, firstRow, lastRow) {
|
this.$renderLinesFragment = function(config, firstRow, lastRow) {
|
||||||
var fragment = document.createDocumentFragment(),
|
var fragment = this.element.ownerDocument.createDocumentFragment(),
|
||||||
row = firstRow,
|
row = firstRow,
|
||||||
fold = this.session.getNextFold(row),
|
fold = this.session.getNextFold(row),
|
||||||
foldStart = fold ?fold.start.row :Infinity;
|
foldStart = fold ?fold.start.row :Infinity;
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||||
|
* Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
|
@ -39,10 +40,11 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
var event = require("pilot/event");
|
var event = require("pilot/event");
|
||||||
|
|
||||||
var RenderLoop = function(onRender) {
|
var RenderLoop = function(onRender, window) {
|
||||||
this.onRender = onRender;
|
this.onRender = onRender;
|
||||||
this.pending = false;
|
this.pending = false;
|
||||||
this.changes = 0;
|
this.changes = 0;
|
||||||
|
this.setTimeoutZero = this.setTimeoutZero.bind(window);
|
||||||
};
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
@ -70,31 +72,31 @@ var RenderLoop = function(onRender) {
|
||||||
window.msRequestAnimationFrame;
|
window.msRequestAnimationFrame;
|
||||||
|
|
||||||
if (this.setTimeoutZero) {
|
if (this.setTimeoutZero) {
|
||||||
|
this.setTimeoutZero = this.setTimeoutZero;
|
||||||
this.setTimeoutZero = this.setTimeoutZero.bind(window)
|
|
||||||
} else if (window.postMessage) {
|
} else if (window.postMessage) {
|
||||||
|
|
||||||
this.messageName = "zero-timeout-message";
|
this.setTimeoutZero = (function(messageName, attached, listener) {
|
||||||
|
return function setTimeoutZero(callback) {
|
||||||
this.setTimeoutZero = function(callback) {
|
// Set up listener if not listening already.
|
||||||
if (!this.attached) {
|
if (!attached) {
|
||||||
var _self = this;
|
event.addListener(this, "message", function(e) {
|
||||||
event.addListener(window, "message", function(e) {
|
if (listener && e.data == messageName) {
|
||||||
if (_self.callback && e.data == _self.messageName) {
|
|
||||||
event.stopPropagation(e);
|
event.stopPropagation(e);
|
||||||
_self.callback();
|
listener();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.attached = true;
|
attached = true;
|
||||||
}
|
|
||||||
this.callback = callback;
|
|
||||||
window.postMessage(this.messageName, "*");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listener = callback;
|
||||||
|
this.postMessage(messageName, "*");
|
||||||
|
};
|
||||||
|
})("zero-timeout-message", false, null);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.setTimeoutZero = function(callback) {
|
this.setTimeoutZero = function(callback) {
|
||||||
setTimeout(callback, 0);
|
this.setTimeout(callback, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Fabian Jakobs <fabian AT ajax DOT org>
|
* Fabian Jakobs <fabian AT ajax DOT org>
|
||||||
|
* Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
|
@ -56,7 +57,7 @@ var ScrollBar = function(parent) {
|
||||||
// of 0px
|
// of 0px
|
||||||
// in Firefox 6+ scrollbar is hidden if element has the same width as scrollbar
|
// in Firefox 6+ scrollbar is hidden if element has the same width as scrollbar
|
||||||
// make element a little bit wider to retain scrollbar when page is zoomed
|
// make element a little bit wider to retain scrollbar when page is zoomed
|
||||||
this.width = dom.scrollbarWidth();
|
this.width = dom.scrollbarWidth(parent.ownerDocument);
|
||||||
this.element.style.width = (this.width || 15) + 5 + "px";
|
this.element.style.width = (this.width || 15) + 5 + "px";
|
||||||
|
|
||||||
event.addListener(this.element, "scroll", this.onScroll.bind(this));
|
event.addListener(this.element, "scroll", this.onScroll.bind(this));
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,8 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssClass = "ace-clouds";
|
||||||
|
exports.cssText = ".ace-clouds .ace_editor {\
|
||||||
var cssText = ".ace-clouds .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -252,8 +251,4 @@ define(function(require, exports, module) {
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-clouds";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,8 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssClass = "ace-clouds-midnight";
|
||||||
|
exports.cssText = ".ace-clouds-midnight .ace_editor {\
|
||||||
var cssText = ".ace-clouds-midnight .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -253,8 +252,4 @@ background-color:#E92E2E;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-clouds-midnight";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,8 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssClass = "ace-cobalt";
|
||||||
|
exports.cssText = ".ace-cobalt .ace_editor {\
|
||||||
var cssText = ".ace-cobalt .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -255,8 +254,4 @@ background-color:#001221;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-cobalt";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-crimson-editor .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-crimson-editor .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -195,8 +193,6 @@ define(function(require, exports, module) {
|
||||||
color: rgb(192, 0, 192);\
|
color: rgb(192, 0, 192);\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// Import CSS once.
|
exports.cssClass = "ace-crimson-editor";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-crimson-editor";
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-dawn .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-dawn .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -258,8 +256,6 @@ color:#5A525F;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-dawn";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-dawn";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-eclipse .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-eclipse .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -143,8 +141,6 @@ define(function(require, exports, module) {
|
||||||
background: rgb(232, 242, 254);\
|
background: rgb(232, 242, 254);\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-eclipse";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-eclipse";
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-idle-fingers .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-idle-fingers .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -255,8 +253,6 @@ color:#BC9458;\
|
||||||
background-color:#FFF980; \
|
background-color:#FFF980; \
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-idle-fingers";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-idle-fingers";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-kr-theme .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-kr-theme .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -254,8 +252,6 @@ color:#706D5B;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-kr-theme";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-kr-theme";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-merbivore .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-merbivore .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -246,8 +244,6 @@ background-color:#990000;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-merbivore";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-merbivore";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-merbivore-soft .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-merbivore-soft .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -246,8 +244,6 @@ background-color:#FE3838;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-merbivore-soft";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-merbivore-soft";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-mono-industrial .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-mono-industrial .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -254,8 +252,6 @@ background-color:#151C19;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-mono-industrial";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-mono-industrial";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-monokai .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-monokai .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -254,8 +252,6 @@ background-color:#AE81FF;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-monokai";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-monokai";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-pastel-on-dark .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-pastel-on-dark .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -195,8 +193,6 @@ color:#D2A8A1;\
|
||||||
color:#494949;\
|
color:#494949;\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-pastel-on-dark";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-pastel-on-dark";
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-solarized-dark .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-solarized-dark .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -253,8 +251,6 @@ color:#657B83;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-solarized-dark";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-solarized-dark";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-solarized-light .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-solarized-light .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -252,8 +250,6 @@ define(function(require, exports, module) {
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-solarized-light";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-solarized-light";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,9 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
|
||||||
|
|
||||||
var cssText = ".ace-tm .ace_editor {\
|
exports.cssClass = "ace-tm";
|
||||||
|
exports.cssText = ".ace-tm .ace_editor {\
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -206,8 +206,4 @@ define(function(require, exports, module) {
|
||||||
color: rgb(255, 0, 0)\
|
color: rgb(255, 0, 0)\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-tm";
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,8 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssClass = "ace-twilight";
|
||||||
|
exports.cssText = ".ace-twilight .ace_editor {\
|
||||||
var cssText = ".ace-twilight .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -256,8 +255,4 @@ color:#5F5A60;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-twilight";
|
|
||||||
});
|
});
|
||||||
|
|
@ -37,9 +37,7 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
|
|
||||||
var dom = require("pilot/dom");
|
exports.cssText = ".ace-vibrant-ink .ace_editor {\
|
||||||
|
|
||||||
var cssText = ".ace-vibrant-ink .ace_editor {\
|
|
||||||
border: 2px solid rgb(159, 159, 159);\
|
border: 2px solid rgb(159, 159, 159);\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
|
|
@ -255,8 +253,6 @@ color:#99CC99;\
|
||||||
\
|
\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
// import CSS once
|
exports.cssClass = "ace-vibrant-ink";
|
||||||
dom.importCssString(cssText);
|
|
||||||
|
|
||||||
exports.cssClass = "ace-vibrant-ink";
|
|
||||||
});
|
});
|
||||||
|
|
@ -53,11 +53,11 @@ var RenderLoop = require("ace/renderloop").RenderLoop;
|
||||||
var EventEmitter = require("pilot/event_emitter").EventEmitter;
|
var EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||||
var editorCss = require("ace/requirejs/text!ace/css/editor.css");
|
var editorCss = require("ace/requirejs/text!ace/css/editor.css");
|
||||||
|
|
||||||
// import CSS once
|
|
||||||
dom.importCssString(editorCss);
|
|
||||||
|
|
||||||
var VirtualRenderer = function(container, theme) {
|
var VirtualRenderer = function(container, theme) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
|
|
||||||
|
// Imports CSS once per DOM document ('ace_editor' serves as an identifier).
|
||||||
|
dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
|
||||||
dom.addCssClass(this.container, "ace_editor");
|
dom.addCssClass(this.container, "ace_editor");
|
||||||
|
|
||||||
this.setTheme(theme);
|
this.setTheme(theme);
|
||||||
|
|
@ -135,7 +135,10 @@ var VirtualRenderer = function(container, theme) {
|
||||||
height : 1
|
height : 1
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$loop = new RenderLoop(this.$renderChanges.bind(this));
|
this.$loop = new RenderLoop(
|
||||||
|
this.$renderChanges.bind(this),
|
||||||
|
this.container.ownerDocument.defaultView
|
||||||
|
);
|
||||||
this.$loop.schedule(this.CHANGE_FULL);
|
this.$loop.schedule(this.CHANGE_FULL);
|
||||||
|
|
||||||
this.setPadding(4);
|
this.setPadding(4);
|
||||||
|
|
@ -800,6 +803,12 @@ var VirtualRenderer = function(container, theme) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function afterLoad(theme) {
|
function afterLoad(theme) {
|
||||||
|
dom.importCssString(
|
||||||
|
theme.cssText,
|
||||||
|
theme.cssClass,
|
||||||
|
_self.container.ownerDocument
|
||||||
|
);
|
||||||
|
|
||||||
if (_self.$theme)
|
if (_self.$theme)
|
||||||
dom.removeCssClass(_self.container, _self.$theme);
|
dom.removeCssClass(_self.container, _self.$theme);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 48ddaa841476ddf9210ccbb2b310952db8212084
|
Subproject commit c720ab56a80ba8cc10d0c86a9c4f1fa9cfc83b1b
|
||||||
Loading…
Add table
Add a link
Reference in a new issue