Merge branch 'master' of github.com:ajaxorg/ace
This commit is contained in:
commit
6433e4cf77
60 changed files with 355 additions and 302 deletions
|
|
@ -12,7 +12,7 @@
|
|||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.ace-row { clear: both; }
|
||||
.ace_line { clear: both; }
|
||||
|
||||
*.ace_gutter-cell {
|
||||
-moz-user-select: -moz-none;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ var baseStyles = require("../requirejs/text!./static.css");
|
|||
* @returns {object} An object containing: html, css
|
||||
*/
|
||||
|
||||
exports.render = function(input, mode, theme) {
|
||||
exports.render = function(input, mode, theme, lineStart) {
|
||||
lineStart = parseInt(lineStart || 1, 10);
|
||||
|
||||
var session = new EditSession("");
|
||||
session.setMode(mode);
|
||||
session.setUseWorker(false);
|
||||
|
|
@ -72,8 +74,8 @@ exports.render = function(input, mode, theme) {
|
|||
|
||||
for(var ix = 0; ix < length; ix++) {
|
||||
var lineTokens = tokens[ix].tokens;
|
||||
stringBuilder.push("<div class='ace-row'>");
|
||||
stringBuilder.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>" + (ix+1) + "</span>");
|
||||
stringBuilder.push("<div class='ace_line'>");
|
||||
stringBuilder.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>" + (ix + lineStart) + "</span>");
|
||||
textLayer.$renderLine(stringBuilder, 0, lineTokens, true);
|
||||
stringBuilder.push("</div>");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,12 +104,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
|||
oop.implement(this, EventEmitter);
|
||||
|
||||
this.$normalizePath = function(path) {
|
||||
if (!path.match(/^\w+:/)) {
|
||||
path = location.protocol + "//" + location.host
|
||||
// paths starting with a slash are relative to the root (host)
|
||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||
+ "/" + path.replace(/^[\/]+/, "");
|
||||
}
|
||||
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||
path = location.protocol + "//" + location.host
|
||||
// paths starting with a slash are relative to the root (host)
|
||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||
+ "/" + path.replace(/^[\/]+/, "");
|
||||
return path;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue