Merge branch 'master' of github.com:ajaxorg/ace
This commit is contained in:
commit
6433e4cf77
60 changed files with 355 additions and 302 deletions
|
|
@ -3684,17 +3684,33 @@ var EditSession = function(text, mode) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$scrollTop = 0;
|
this.$scrollTop = 0;
|
||||||
this.setScrollTopRow = function(scrollTopRow) {
|
this.setScrollTop = function(scrollTop) {
|
||||||
if (this.$scrollTop === scrollTopRow) return;
|
scrollTop = Math.round(Math.max(0, scrollTop));
|
||||||
|
if (this.$scrollTop === scrollTop)
|
||||||
|
return;
|
||||||
|
|
||||||
this.$scrollTop = scrollTopRow;
|
this.$scrollTop = scrollTop;
|
||||||
this._emit("changeScrollTop");
|
this._emit("changeScrollTop", scrollTop);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScrollTopRow = function() {
|
this.getScrollTop = function() {
|
||||||
return this.$scrollTop;
|
return this.$scrollTop;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$scrollLeft = 0;
|
||||||
|
this.setScrollLeft = function(scrollLeft) {
|
||||||
|
scrollLeft = Math.round(Math.max(0, scrollLeft));
|
||||||
|
if (this.$scrollLeft === scrollLeft)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.$scrollLeft = scrollLeft;
|
||||||
|
this._emit("changeScrollLeft", scrollLeft);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getScrollLeft = function() {
|
||||||
|
return this.$scrollLeft;
|
||||||
|
};
|
||||||
|
|
||||||
this.getWidth = function() {
|
this.getWidth = function() {
|
||||||
this.$computeWidth();
|
this.$computeWidth();
|
||||||
return this.width;
|
return this.width;
|
||||||
|
|
@ -11461,12 +11477,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -20494,9 +20509,6 @@ var Editor = function(renderer, session) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
|
|
||||||
renderer.on("scrollX", this._emit.bind(this, "scrollX"));
|
|
||||||
renderer.on("scrollY", this._emit.bind(this, "scrollY"));
|
|
||||||
|
|
||||||
this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
|
this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
|
||||||
this.keyBinding = new KeyBinding(this);
|
this.keyBinding = new KeyBinding(this);
|
||||||
|
|
||||||
|
|
@ -20547,12 +20559,12 @@ var Editor = function(renderer, session) {
|
||||||
this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint);
|
this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint);
|
||||||
this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation);
|
this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation);
|
||||||
this.session.removeEventListener("changeOverwrite", this.$onCursorChange);
|
this.session.removeEventListener("changeOverwrite", this.$onCursorChange);
|
||||||
|
this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange);
|
||||||
|
this.session.removeEventListener("changeLeftTop", this.$onScrollLeftChange);
|
||||||
|
|
||||||
var selection = this.session.getSelection();
|
var selection = this.session.getSelection();
|
||||||
selection.removeEventListener("changeCursor", this.$onCursorChange);
|
selection.removeEventListener("changeCursor", this.$onCursorChange);
|
||||||
selection.removeEventListener("changeSelection", this.$onSelectionChange);
|
selection.removeEventListener("changeSelection", this.$onSelectionChange);
|
||||||
|
|
||||||
this.session.setScrollTopRow(this.renderer.getScrollTopRow());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
|
|
@ -20594,6 +20606,12 @@ var Editor = function(renderer, session) {
|
||||||
this.$onCursorChange = this.onCursorChange.bind(this);
|
this.$onCursorChange = this.onCursorChange.bind(this);
|
||||||
this.session.addEventListener("changeOverwrite", this.$onCursorChange);
|
this.session.addEventListener("changeOverwrite", this.$onCursorChange);
|
||||||
|
|
||||||
|
this.$onScrollTopChange = this.onScrollTopChange.bind(this);
|
||||||
|
this.session.addEventListener("changeScrollTop", this.$onScrollTopChange);
|
||||||
|
|
||||||
|
this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);
|
||||||
|
this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange);
|
||||||
|
|
||||||
this.selection = session.getSelection();
|
this.selection = session.getSelection();
|
||||||
this.selection.addEventListener("changeCursor", this.$onCursorChange);
|
this.selection.addEventListener("changeCursor", this.$onCursorChange);
|
||||||
|
|
||||||
|
|
@ -20603,13 +20621,14 @@ var Editor = function(renderer, session) {
|
||||||
this.onChangeMode();
|
this.onChangeMode();
|
||||||
|
|
||||||
this.onCursorChange();
|
this.onCursorChange();
|
||||||
|
this.onScrollTopChange();
|
||||||
|
this.onScrollLeftChange();
|
||||||
this.onSelectionChange();
|
this.onSelectionChange();
|
||||||
this.onChangeFrontMarker();
|
this.onChangeFrontMarker();
|
||||||
this.onChangeBackMarker();
|
this.onChangeBackMarker();
|
||||||
this.onChangeBreakpoint();
|
this.onChangeBreakpoint();
|
||||||
this.onChangeAnnotation();
|
this.onChangeAnnotation();
|
||||||
this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
|
this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
|
||||||
this.renderer.scrollToRow(session.getScrollTopRow());
|
|
||||||
this.renderer.updateFull();
|
this.renderer.updateFull();
|
||||||
|
|
||||||
this._emit("changeSession", {
|
this._emit("changeSession", {
|
||||||
|
|
@ -20727,6 +20746,14 @@ var Editor = function(renderer, session) {
|
||||||
this.renderer.updateLines(rows.first, rows.last);
|
this.renderer.updateLines(rows.first, rows.last);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.onScrollTopChange = function() {
|
||||||
|
this.renderer.scrollToY(this.session.getScrollTop());
|
||||||
|
};
|
||||||
|
|
||||||
|
this.onScrollLeftChange = function() {
|
||||||
|
this.renderer.scrollToX(this.session.getScrollLeft());
|
||||||
|
};
|
||||||
|
|
||||||
this.onCursorChange = function() {
|
this.onCursorChange = function() {
|
||||||
this.renderer.updateCursor();
|
this.renderer.updateCursor();
|
||||||
|
|
||||||
|
|
@ -23807,11 +23834,12 @@ exports.CommandManager = CommandManager;
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
define('ace/virtual_renderer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/useragent', 'ace/layer/gutter', 'ace/layer/marker', 'ace/layer/text', 'ace/layer/cursor', 'ace/scrollbar', 'ace/renderloop', 'ace/lib/event_emitter', 'text!ace/css/editor.css'], function(require, exports, module) {
|
define('ace/virtual_renderer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/event', 'ace/lib/useragent', 'ace/layer/gutter', 'ace/layer/marker', 'ace/layer/text', 'ace/layer/cursor', 'ace/scrollbar', 'ace/renderloop', 'ace/lib/event_emitter', 'text!ace/css/editor.css'], function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var oop = require("./lib/oop");
|
var oop = require("./lib/oop");
|
||||||
var dom = require("./lib/dom");
|
var dom = require("./lib/dom");
|
||||||
|
var event = require("./lib/event");
|
||||||
var useragent = require("./lib/useragent");
|
var useragent = require("./lib/useragent");
|
||||||
var GutterLayer = require("./layer/gutter").Gutter;
|
var GutterLayer = require("./layer/gutter").Gutter;
|
||||||
var MarkerLayer = require("./layer/marker").Marker;
|
var MarkerLayer = require("./layer/marker").Marker;
|
||||||
|
|
@ -23825,6 +23853,8 @@ var editorCss = require("text!./css/editor.css");
|
||||||
dom.importCssString(editorCss, "ace_editor");
|
dom.importCssString(editorCss, "ace_editor");
|
||||||
|
|
||||||
var VirtualRenderer = function(container, theme) {
|
var VirtualRenderer = function(container, theme) {
|
||||||
|
var _self = this;
|
||||||
|
|
||||||
this.container = container;
|
this.container = container;
|
||||||
|
|
||||||
// TODO: this breaks rendering in Cloud9 with multiple ace instances
|
// TODO: this breaks rendering in Cloud9 with multiple ace instances
|
||||||
|
|
@ -23868,16 +23898,22 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.$horizScrollAlwaysVisible = true;
|
this.$horizScrollAlwaysVisible = true;
|
||||||
|
|
||||||
this.scrollBar = new ScrollBar(container);
|
this.scrollBar = new ScrollBar(container);
|
||||||
this.scrollBar.addEventListener("scroll", this.onScroll.bind(this));
|
this.scrollBar.addEventListener("scroll", function(e) {
|
||||||
|
_self.session.setScrollTop(e.data);
|
||||||
|
});
|
||||||
|
|
||||||
this.scrollTop = 0;
|
this.scrollTop = 0;
|
||||||
|
this.scrollLeft = 0;
|
||||||
|
|
||||||
|
event.addListener(this.scroller, "scroll", function() {
|
||||||
|
_self.session.setScrollLeft(_self.scroller.scrollLeft);
|
||||||
|
});
|
||||||
|
|
||||||
this.cursorPos = {
|
this.cursorPos = {
|
||||||
row : 0,
|
row : 0,
|
||||||
column : 0
|
column : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
var _self = this;
|
|
||||||
this.$textLayer.addEventListener("changeCharaterSize", function() {
|
this.$textLayer.addEventListener("changeCharaterSize", function() {
|
||||||
_self.characterWidth = textLayer.getCharacterWidth();
|
_self.characterWidth = textLayer.getCharacterWidth();
|
||||||
_self.lineHeight = textLayer.getLineHeight();
|
_self.lineHeight = textLayer.getLineHeight();
|
||||||
|
|
@ -24002,7 +24038,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scrollBar.setHeight(size.scrollerHeight);
|
this.scrollBar.setHeight(size.scrollerHeight);
|
||||||
|
|
||||||
if (this.session) {
|
if (this.session) {
|
||||||
this.scrollToY(this.getScrollTop());
|
this.session.setScrollTop(this.getScrollTop());
|
||||||
changes = changes | this.CHANGE_FULL;
|
changes = changes | this.CHANGE_FULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -24162,10 +24198,6 @@ var VirtualRenderer = function(container, theme) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onScroll = function(e) {
|
|
||||||
this.scrollToY(e.data);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$updateScrollBar = function() {
|
this.$updateScrollBar = function() {
|
||||||
this.scrollBar.setInnerHeight(this.layerConfig.maxHeight);
|
this.scrollBar.setInnerHeight(this.layerConfig.maxHeight);
|
||||||
this.scrollBar.setScrollTop(this.scrollTop);
|
this.scrollBar.setScrollTop(this.scrollTop);
|
||||||
|
|
@ -24257,7 +24289,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
||||||
|
|
||||||
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
||||||
this.scrollTop = Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight));
|
this.session.setScrollTop(Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight)));
|
||||||
|
|
||||||
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
||||||
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
||||||
|
|
@ -24405,14 +24437,14 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var top = pos.top;
|
var top = pos.top;
|
||||||
|
|
||||||
if (this.scrollTop > top) {
|
if (this.scrollTop > top) {
|
||||||
this.scrollToY(top);
|
this.session.setScrollTop(top);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) {
|
if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) {
|
||||||
this.scrollToY(top + this.lineHeight - this.$size.scrollerHeight);
|
this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
var scrollLeft = this.scroller.scrollLeft;
|
var scrollLeft = this.scrollLeft;
|
||||||
|
|
||||||
if (scrollLeft > left) {
|
if (scrollLeft > left) {
|
||||||
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
|
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
|
||||||
|
|
@ -24429,11 +24461,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScrollTop = function() {
|
this.getScrollTop = function() {
|
||||||
return this.scrollTop;
|
return this.session.getScrollTop();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScrollLeft = function() {
|
this.getScrollLeft = function() {
|
||||||
return this.scroller.scrollLeft;
|
return this.session.getScrollTop();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScrollTopRow = function() {
|
this.getScrollTopRow = function() {
|
||||||
|
|
@ -24445,7 +24477,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToRow = function(row) {
|
this.scrollToRow = function(row) {
|
||||||
this.scrollToY(row * this.lineHeight);
|
this.session.setScrollTop(row * this.lineHeight);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToLine = function(line, center) {
|
this.scrollToLine = function(line, center) {
|
||||||
|
|
@ -24458,17 +24490,15 @@ var VirtualRenderer = function(container, theme) {
|
||||||
if (center) {
|
if (center) {
|
||||||
offset -= this.$size.scrollerHeight / 2;
|
offset -= this.$size.scrollerHeight / 2;
|
||||||
}
|
}
|
||||||
this.scrollToY(offset);
|
this.session.setScrollTop(offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToY = function(scrollTop) {
|
this.scrollToY = function(scrollTop) {
|
||||||
// after calling scrollBar.setScrollTop
|
// after calling scrollBar.setScrollTop
|
||||||
// scrollbar sends us event with same scrollTop. ignore it
|
// scrollbar sends us event with same scrollTop. ignore it
|
||||||
scrollTop = Math.max(0, scrollTop);
|
|
||||||
if (this.scrollTop !== scrollTop) {
|
if (this.scrollTop !== scrollTop) {
|
||||||
this.$loop.schedule(this.CHANGE_SCROLL);
|
this.$loop.schedule(this.CHANGE_SCROLL);
|
||||||
this.scrollTop = scrollTop;
|
this.scrollTop = scrollTop;
|
||||||
this._emit("scrollY", scrollTop);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -24477,18 +24507,18 @@ var VirtualRenderer = function(container, theme) {
|
||||||
scrollLeft = 0;
|
scrollLeft = 0;
|
||||||
|
|
||||||
this.scroller.scrollLeft = scrollLeft;
|
this.scroller.scrollLeft = scrollLeft;
|
||||||
this._emit("scrollX", this.scroller.scrollLeft);
|
scrollLeft = this.scroller.scrollLeft;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollBy = function(deltaX, deltaY) {
|
this.scrollBy = function(deltaX, deltaY) {
|
||||||
deltaY && this.scrollToY(this.scrollTop + deltaY);
|
deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);
|
||||||
deltaX && this.scrollToX(this.scroller.scrollLeft + deltaX);
|
deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.isScrollableBy = function(deltaX, deltaY) {
|
this.isScrollableBy = function(deltaX, deltaY) {
|
||||||
if (deltaY < 0 && this.scrollTop > 0)
|
if (deltaY < 0 && this.session.getScrollTop() > 0)
|
||||||
return true;
|
return true;
|
||||||
if (deltaY > 0 && this.scrollTop + this.$size.scrollerHeight < this.layerConfig.maxHeight)
|
if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight < this.layerConfig.maxHeight)
|
||||||
return true;
|
return true;
|
||||||
// todo: handle horizontal scrolling
|
// todo: handle horizontal scrolling
|
||||||
};
|
};
|
||||||
|
|
@ -24496,10 +24526,14 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.screenToTextCoordinates = function(pageX, pageY) {
|
this.screenToTextCoordinates = function(pageX, pageY) {
|
||||||
var canvasPos = this.scroller.getBoundingClientRect();
|
var canvasPos = this.scroller.getBoundingClientRect();
|
||||||
|
|
||||||
var col = Math.round((pageX + this.scroller.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft())
|
var col = Math.round(
|
||||||
/ this.characterWidth);
|
(pageX + this.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft())
|
||||||
var row = Math.floor((pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop())
|
/ this.characterWidth
|
||||||
/ this.lineHeight);
|
);
|
||||||
|
var row = Math.floor(
|
||||||
|
(pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop())
|
||||||
|
/ this.lineHeight
|
||||||
|
);
|
||||||
|
|
||||||
return this.session.screenToDocumentPosition(row, Math.max(col, 0));
|
return this.session.screenToDocumentPosition(row, Math.max(col, 0));
|
||||||
};
|
};
|
||||||
|
|
@ -24512,8 +24546,8 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var y = pos.row * this.lineHeight;
|
var y = pos.row * this.lineHeight;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pageX: canvasPos.left + x - this.getScrollLeft(),
|
pageX: canvasPos.left + x - this.scrollLeft,
|
||||||
pageY: canvasPos.top + y - this.getScrollTop()
|
pageY: canvasPos.top + y - this.scrollTop
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -25981,6 +26015,12 @@ define("text!ace/css/editor.css", [], "@import url(//fonts.googleapis.com/css?fa
|
||||||
" background-position: 2px center;\n" +
|
" background-position: 2px center;\n" +
|
||||||
"}\n" +
|
"}\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
|
".ace_gutter-cell.ace_info {\n" +
|
||||||
|
" background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");\n" +
|
||||||
|
" background-repeat: no-repeat;\n" +
|
||||||
|
" background-position: 2px center;\n" +
|
||||||
|
"}\n" +
|
||||||
|
"\n" +
|
||||||
".ace_editor .ace_sb {\n" +
|
".ace_editor .ace_sb {\n" +
|
||||||
" position: absolute;\n" +
|
" position: absolute;\n" +
|
||||||
" overflow-x: hidden;\n" +
|
" overflow-x: hidden;\n" +
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ function initSender() {
|
||||||
var main;
|
var main;
|
||||||
var sender;
|
var sender;
|
||||||
|
|
||||||
var onmessage = function(e) {
|
onmessage = function(e) {
|
||||||
var msg = e.data;
|
var msg = e.data;
|
||||||
if (msg.command) {
|
if (msg.command) {
|
||||||
main[msg.command].apply(main, msg.args);
|
main[msg.command].apply(main, msg.args);
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ function initSender() {
|
||||||
var main;
|
var main;
|
||||||
var sender;
|
var sender;
|
||||||
|
|
||||||
var onmessage = function(e) {
|
onmessage = function(e) {
|
||||||
var msg = e.data;
|
var msg = e.data;
|
||||||
if (msg.command) {
|
if (msg.command) {
|
||||||
main[msg.command].apply(main, msg.args);
|
main[msg.command].apply(main, msg.args);
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ function initSender() {
|
||||||
var main;
|
var main;
|
||||||
var sender;
|
var sender;
|
||||||
|
|
||||||
var onmessage = function(e) {
|
onmessage = function(e) {
|
||||||
var msg = e.data;
|
var msg = e.data;
|
||||||
if (msg.command) {
|
if (msg.command) {
|
||||||
main[msg.command].apply(main, msg.args);
|
main[msg.command].apply(main, msg.args);
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
Ace
|
Ace
|
||||||
version 0.2.0
|
version 0.2.0
|
||||||
commit f3cd1d1f7e5e952f2e4a474def8be4fcac1ab507
|
commit c52d1b203027b580564254c830a28dab4b8ad1b3
|
||||||
|
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -709,12 +709,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -709,12 +709,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1843,12 +1843,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1843,12 +1843,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -561,12 +561,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -561,12 +561,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -795,12 +795,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -795,12 +795,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -854,12 +854,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -854,12 +854,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -796,12 +796,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -796,12 +796,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -771,12 +771,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -771,12 +771,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -851,12 +851,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -851,12 +851,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -796,12 +796,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -796,12 +796,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1850,12 +1850,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1850,12 +1850,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -3013,9 +3013,6 @@ var Editor = function(renderer, session) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
|
|
||||||
renderer.on("scrollX", this._emit.bind(this, "scrollX"));
|
|
||||||
renderer.on("scrollY", this._emit.bind(this, "scrollY"));
|
|
||||||
|
|
||||||
this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
|
this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
|
||||||
this.keyBinding = new KeyBinding(this);
|
this.keyBinding = new KeyBinding(this);
|
||||||
|
|
||||||
|
|
@ -3066,12 +3063,12 @@ var Editor = function(renderer, session) {
|
||||||
this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint);
|
this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint);
|
||||||
this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation);
|
this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation);
|
||||||
this.session.removeEventListener("changeOverwrite", this.$onCursorChange);
|
this.session.removeEventListener("changeOverwrite", this.$onCursorChange);
|
||||||
|
this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange);
|
||||||
|
this.session.removeEventListener("changeLeftTop", this.$onScrollLeftChange);
|
||||||
|
|
||||||
var selection = this.session.getSelection();
|
var selection = this.session.getSelection();
|
||||||
selection.removeEventListener("changeCursor", this.$onCursorChange);
|
selection.removeEventListener("changeCursor", this.$onCursorChange);
|
||||||
selection.removeEventListener("changeSelection", this.$onSelectionChange);
|
selection.removeEventListener("changeSelection", this.$onSelectionChange);
|
||||||
|
|
||||||
this.session.setScrollTopRow(this.renderer.getScrollTopRow());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
|
|
@ -3113,6 +3110,12 @@ var Editor = function(renderer, session) {
|
||||||
this.$onCursorChange = this.onCursorChange.bind(this);
|
this.$onCursorChange = this.onCursorChange.bind(this);
|
||||||
this.session.addEventListener("changeOverwrite", this.$onCursorChange);
|
this.session.addEventListener("changeOverwrite", this.$onCursorChange);
|
||||||
|
|
||||||
|
this.$onScrollTopChange = this.onScrollTopChange.bind(this);
|
||||||
|
this.session.addEventListener("changeScrollTop", this.$onScrollTopChange);
|
||||||
|
|
||||||
|
this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);
|
||||||
|
this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange);
|
||||||
|
|
||||||
this.selection = session.getSelection();
|
this.selection = session.getSelection();
|
||||||
this.selection.addEventListener("changeCursor", this.$onCursorChange);
|
this.selection.addEventListener("changeCursor", this.$onCursorChange);
|
||||||
|
|
||||||
|
|
@ -3122,13 +3125,14 @@ var Editor = function(renderer, session) {
|
||||||
this.onChangeMode();
|
this.onChangeMode();
|
||||||
|
|
||||||
this.onCursorChange();
|
this.onCursorChange();
|
||||||
|
this.onScrollTopChange();
|
||||||
|
this.onScrollLeftChange();
|
||||||
this.onSelectionChange();
|
this.onSelectionChange();
|
||||||
this.onChangeFrontMarker();
|
this.onChangeFrontMarker();
|
||||||
this.onChangeBackMarker();
|
this.onChangeBackMarker();
|
||||||
this.onChangeBreakpoint();
|
this.onChangeBreakpoint();
|
||||||
this.onChangeAnnotation();
|
this.onChangeAnnotation();
|
||||||
this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
|
this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
|
||||||
this.renderer.scrollToRow(session.getScrollTopRow());
|
|
||||||
this.renderer.updateFull();
|
this.renderer.updateFull();
|
||||||
|
|
||||||
this._emit("changeSession", {
|
this._emit("changeSession", {
|
||||||
|
|
@ -3246,6 +3250,14 @@ var Editor = function(renderer, session) {
|
||||||
this.renderer.updateLines(rows.first, rows.last);
|
this.renderer.updateLines(rows.first, rows.last);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.onScrollTopChange = function() {
|
||||||
|
this.renderer.scrollToY(this.session.getScrollTop());
|
||||||
|
};
|
||||||
|
|
||||||
|
this.onScrollLeftChange = function() {
|
||||||
|
this.renderer.scrollToX(this.session.getScrollLeft());
|
||||||
|
};
|
||||||
|
|
||||||
this.onCursorChange = function() {
|
this.onCursorChange = function() {
|
||||||
this.renderer.updateCursor();
|
this.renderer.updateCursor();
|
||||||
|
|
||||||
|
|
@ -6563,17 +6575,33 @@ var EditSession = function(text, mode) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$scrollTop = 0;
|
this.$scrollTop = 0;
|
||||||
this.setScrollTopRow = function(scrollTopRow) {
|
this.setScrollTop = function(scrollTop) {
|
||||||
if (this.$scrollTop === scrollTopRow) return;
|
scrollTop = Math.round(Math.max(0, scrollTop));
|
||||||
|
if (this.$scrollTop === scrollTop)
|
||||||
|
return;
|
||||||
|
|
||||||
this.$scrollTop = scrollTopRow;
|
this.$scrollTop = scrollTop;
|
||||||
this._emit("changeScrollTop");
|
this._emit("changeScrollTop", scrollTop);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScrollTopRow = function() {
|
this.getScrollTop = function() {
|
||||||
return this.$scrollTop;
|
return this.$scrollTop;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$scrollLeft = 0;
|
||||||
|
this.setScrollLeft = function(scrollLeft) {
|
||||||
|
scrollLeft = Math.round(Math.max(0, scrollLeft));
|
||||||
|
if (this.$scrollLeft === scrollLeft)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.$scrollLeft = scrollLeft;
|
||||||
|
this._emit("changeScrollLeft", scrollLeft);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getScrollLeft = function() {
|
||||||
|
return this.$scrollLeft;
|
||||||
|
};
|
||||||
|
|
||||||
this.getWidth = function() {
|
this.getWidth = function() {
|
||||||
this.$computeWidth();
|
this.$computeWidth();
|
||||||
return this.width;
|
return this.width;
|
||||||
|
|
@ -12136,11 +12164,12 @@ exports.UndoManager = UndoManager;
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
__ace_shadowed__.define('ace/virtual_renderer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/useragent', 'ace/layer/gutter', 'ace/layer/marker', 'ace/layer/text', 'ace/layer/cursor', 'ace/scrollbar', 'ace/renderloop', 'ace/lib/event_emitter', 'text!ace/css/editor.css'], function(require, exports, module) {
|
__ace_shadowed__.define('ace/virtual_renderer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/event', 'ace/lib/useragent', 'ace/layer/gutter', 'ace/layer/marker', 'ace/layer/text', 'ace/layer/cursor', 'ace/scrollbar', 'ace/renderloop', 'ace/lib/event_emitter', 'text!ace/css/editor.css'], function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var oop = require("./lib/oop");
|
var oop = require("./lib/oop");
|
||||||
var dom = require("./lib/dom");
|
var dom = require("./lib/dom");
|
||||||
|
var event = require("./lib/event");
|
||||||
var useragent = require("./lib/useragent");
|
var useragent = require("./lib/useragent");
|
||||||
var GutterLayer = require("./layer/gutter").Gutter;
|
var GutterLayer = require("./layer/gutter").Gutter;
|
||||||
var MarkerLayer = require("./layer/marker").Marker;
|
var MarkerLayer = require("./layer/marker").Marker;
|
||||||
|
|
@ -12154,6 +12183,8 @@ var editorCss = require("text!./css/editor.css");
|
||||||
dom.importCssString(editorCss, "ace_editor");
|
dom.importCssString(editorCss, "ace_editor");
|
||||||
|
|
||||||
var VirtualRenderer = function(container, theme) {
|
var VirtualRenderer = function(container, theme) {
|
||||||
|
var _self = this;
|
||||||
|
|
||||||
this.container = container;
|
this.container = container;
|
||||||
|
|
||||||
// TODO: this breaks rendering in Cloud9 with multiple ace instances
|
// TODO: this breaks rendering in Cloud9 with multiple ace instances
|
||||||
|
|
@ -12197,16 +12228,22 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.$horizScrollAlwaysVisible = true;
|
this.$horizScrollAlwaysVisible = true;
|
||||||
|
|
||||||
this.scrollBar = new ScrollBar(container);
|
this.scrollBar = new ScrollBar(container);
|
||||||
this.scrollBar.addEventListener("scroll", this.onScroll.bind(this));
|
this.scrollBar.addEventListener("scroll", function(e) {
|
||||||
|
_self.session.setScrollTop(e.data);
|
||||||
|
});
|
||||||
|
|
||||||
this.scrollTop = 0;
|
this.scrollTop = 0;
|
||||||
|
this.scrollLeft = 0;
|
||||||
|
|
||||||
|
event.addListener(this.scroller, "scroll", function() {
|
||||||
|
_self.session.setScrollLeft(_self.scroller.scrollLeft);
|
||||||
|
});
|
||||||
|
|
||||||
this.cursorPos = {
|
this.cursorPos = {
|
||||||
row : 0,
|
row : 0,
|
||||||
column : 0
|
column : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
var _self = this;
|
|
||||||
this.$textLayer.addEventListener("changeCharaterSize", function() {
|
this.$textLayer.addEventListener("changeCharaterSize", function() {
|
||||||
_self.characterWidth = textLayer.getCharacterWidth();
|
_self.characterWidth = textLayer.getCharacterWidth();
|
||||||
_self.lineHeight = textLayer.getLineHeight();
|
_self.lineHeight = textLayer.getLineHeight();
|
||||||
|
|
@ -12331,7 +12368,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scrollBar.setHeight(size.scrollerHeight);
|
this.scrollBar.setHeight(size.scrollerHeight);
|
||||||
|
|
||||||
if (this.session) {
|
if (this.session) {
|
||||||
this.scrollToY(this.getScrollTop());
|
this.session.setScrollTop(this.getScrollTop());
|
||||||
changes = changes | this.CHANGE_FULL;
|
changes = changes | this.CHANGE_FULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12491,10 +12528,6 @@ var VirtualRenderer = function(container, theme) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onScroll = function(e) {
|
|
||||||
this.scrollToY(e.data);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$updateScrollBar = function() {
|
this.$updateScrollBar = function() {
|
||||||
this.scrollBar.setInnerHeight(this.layerConfig.maxHeight);
|
this.scrollBar.setInnerHeight(this.layerConfig.maxHeight);
|
||||||
this.scrollBar.setScrollTop(this.scrollTop);
|
this.scrollBar.setScrollTop(this.scrollTop);
|
||||||
|
|
@ -12586,7 +12619,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
||||||
|
|
||||||
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
||||||
this.scrollTop = Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight));
|
this.session.setScrollTop(Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight)));
|
||||||
|
|
||||||
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
|
||||||
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
|
||||||
|
|
@ -12734,14 +12767,14 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var top = pos.top;
|
var top = pos.top;
|
||||||
|
|
||||||
if (this.scrollTop > top) {
|
if (this.scrollTop > top) {
|
||||||
this.scrollToY(top);
|
this.session.setScrollTop(top);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) {
|
if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) {
|
||||||
this.scrollToY(top + this.lineHeight - this.$size.scrollerHeight);
|
this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
var scrollLeft = this.scroller.scrollLeft;
|
var scrollLeft = this.scrollLeft;
|
||||||
|
|
||||||
if (scrollLeft > left) {
|
if (scrollLeft > left) {
|
||||||
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
|
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
|
||||||
|
|
@ -12758,11 +12791,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScrollTop = function() {
|
this.getScrollTop = function() {
|
||||||
return this.scrollTop;
|
return this.session.getScrollTop();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScrollLeft = function() {
|
this.getScrollLeft = function() {
|
||||||
return this.scroller.scrollLeft;
|
return this.session.getScrollTop();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScrollTopRow = function() {
|
this.getScrollTopRow = function() {
|
||||||
|
|
@ -12774,7 +12807,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToRow = function(row) {
|
this.scrollToRow = function(row) {
|
||||||
this.scrollToY(row * this.lineHeight);
|
this.session.setScrollTop(row * this.lineHeight);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToLine = function(line, center) {
|
this.scrollToLine = function(line, center) {
|
||||||
|
|
@ -12787,17 +12820,15 @@ var VirtualRenderer = function(container, theme) {
|
||||||
if (center) {
|
if (center) {
|
||||||
offset -= this.$size.scrollerHeight / 2;
|
offset -= this.$size.scrollerHeight / 2;
|
||||||
}
|
}
|
||||||
this.scrollToY(offset);
|
this.session.setScrollTop(offset);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToY = function(scrollTop) {
|
this.scrollToY = function(scrollTop) {
|
||||||
// after calling scrollBar.setScrollTop
|
// after calling scrollBar.setScrollTop
|
||||||
// scrollbar sends us event with same scrollTop. ignore it
|
// scrollbar sends us event with same scrollTop. ignore it
|
||||||
scrollTop = Math.max(0, scrollTop);
|
|
||||||
if (this.scrollTop !== scrollTop) {
|
if (this.scrollTop !== scrollTop) {
|
||||||
this.$loop.schedule(this.CHANGE_SCROLL);
|
this.$loop.schedule(this.CHANGE_SCROLL);
|
||||||
this.scrollTop = scrollTop;
|
this.scrollTop = scrollTop;
|
||||||
this._emit("scrollY", scrollTop);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -12806,18 +12837,18 @@ var VirtualRenderer = function(container, theme) {
|
||||||
scrollLeft = 0;
|
scrollLeft = 0;
|
||||||
|
|
||||||
this.scroller.scrollLeft = scrollLeft;
|
this.scroller.scrollLeft = scrollLeft;
|
||||||
this._emit("scrollX", this.scroller.scrollLeft);
|
scrollLeft = this.scroller.scrollLeft;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollBy = function(deltaX, deltaY) {
|
this.scrollBy = function(deltaX, deltaY) {
|
||||||
deltaY && this.scrollToY(this.scrollTop + deltaY);
|
deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);
|
||||||
deltaX && this.scrollToX(this.scroller.scrollLeft + deltaX);
|
deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.isScrollableBy = function(deltaX, deltaY) {
|
this.isScrollableBy = function(deltaX, deltaY) {
|
||||||
if (deltaY < 0 && this.scrollTop > 0)
|
if (deltaY < 0 && this.session.getScrollTop() > 0)
|
||||||
return true;
|
return true;
|
||||||
if (deltaY > 0 && this.scrollTop + this.$size.scrollerHeight < this.layerConfig.maxHeight)
|
if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight < this.layerConfig.maxHeight)
|
||||||
return true;
|
return true;
|
||||||
// todo: handle horizontal scrolling
|
// todo: handle horizontal scrolling
|
||||||
};
|
};
|
||||||
|
|
@ -12825,10 +12856,14 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.screenToTextCoordinates = function(pageX, pageY) {
|
this.screenToTextCoordinates = function(pageX, pageY) {
|
||||||
var canvasPos = this.scroller.getBoundingClientRect();
|
var canvasPos = this.scroller.getBoundingClientRect();
|
||||||
|
|
||||||
var col = Math.round((pageX + this.scroller.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft())
|
var col = Math.round(
|
||||||
/ this.characterWidth);
|
(pageX + this.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft())
|
||||||
var row = Math.floor((pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop())
|
/ this.characterWidth
|
||||||
/ this.lineHeight);
|
);
|
||||||
|
var row = Math.floor(
|
||||||
|
(pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop())
|
||||||
|
/ this.lineHeight
|
||||||
|
);
|
||||||
|
|
||||||
return this.session.screenToDocumentPosition(row, Math.max(col, 0));
|
return this.session.screenToDocumentPosition(row, Math.max(col, 0));
|
||||||
};
|
};
|
||||||
|
|
@ -12841,8 +12876,8 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var y = pos.row * this.lineHeight;
|
var y = pos.row * this.lineHeight;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pageX: canvasPos.left + x - this.getScrollLeft(),
|
pageX: canvasPos.left + x - this.scrollLeft,
|
||||||
pageY: canvasPos.top + y - this.getScrollTop()
|
pageY: canvasPos.top + y - this.scrollTop
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -14310,6 +14345,12 @@ __ace_shadowed__.define("text!ace/css/editor.css", [], "@import url(//fonts.goog
|
||||||
" background-position: 2px center;\n" +
|
" background-position: 2px center;\n" +
|
||||||
"}\n" +
|
"}\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
|
".ace_gutter-cell.ace_info {\n" +
|
||||||
|
" background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");\n" +
|
||||||
|
" background-repeat: no-repeat;\n" +
|
||||||
|
" background-position: 2px center;\n" +
|
||||||
|
"}\n" +
|
||||||
|
"\n" +
|
||||||
".ace_editor .ace_sb {\n" +
|
".ace_editor .ace_sb {\n" +
|
||||||
" position: absolute;\n" +
|
" position: absolute;\n" +
|
||||||
" overflow-x: hidden;\n" +
|
" overflow-x: hidden;\n" +
|
||||||
|
|
|
||||||
|
|
@ -709,12 +709,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1843,12 +1843,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -561,12 +561,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -795,12 +795,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -854,12 +854,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -796,12 +796,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -771,12 +771,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -851,12 +851,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -796,12 +796,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1850,12 +1850,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@
|
||||||
<li><a href="http://www.weecod.com">Weecod</a></li>
|
<li><a href="http://www.weecod.com">Weecod</a></li>
|
||||||
<li><a href="http://www.applaudcloud.com">AppLaud Cloud</a></li>
|
<li><a href="http://www.applaudcloud.com">AppLaud Cloud</a></li>
|
||||||
<li><a href='http://rubymonk.com'>RubyMonk</a></li>
|
<li><a href='http://rubymonk.com'>RubyMonk</a></li>
|
||||||
|
<li><a href='http://rocktronica.github.com/tmpltr/'>tmpltr</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>Syntax Highlighters</h4>
|
<h4>Syntax Highlighters</h4>
|
||||||
<ul class="menu-list">
|
<ul class="menu-list">
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ace-row { clear: both; }
|
.ace_line { clear: both; }
|
||||||
|
|
||||||
*.ace_gutter-cell {
|
*.ace_gutter-cell {
|
||||||
-moz-user-select: -moz-none;
|
-moz-user-select: -moz-none;
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,9 @@ var baseStyles = require("../requirejs/text!./static.css");
|
||||||
* @returns {object} An object containing: html, 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("");
|
var session = new EditSession("");
|
||||||
session.setMode(mode);
|
session.setMode(mode);
|
||||||
session.setUseWorker(false);
|
session.setUseWorker(false);
|
||||||
|
|
@ -72,8 +74,8 @@ exports.render = function(input, mode, theme) {
|
||||||
|
|
||||||
for(var ix = 0; ix < length; ix++) {
|
for(var ix = 0; ix < length; ix++) {
|
||||||
var lineTokens = tokens[ix].tokens;
|
var lineTokens = tokens[ix].tokens;
|
||||||
stringBuilder.push("<div class='ace-row'>");
|
stringBuilder.push("<div class='ace_line'>");
|
||||||
stringBuilder.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>" + (ix+1) + "</span>");
|
stringBuilder.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>" + (ix + lineStart) + "</span>");
|
||||||
textLayer.$renderLine(stringBuilder, 0, lineTokens, true);
|
textLayer.$renderLine(stringBuilder, 0, lineTokens, true);
|
||||||
stringBuilder.push("</div>");
|
stringBuilder.push("</div>");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,12 +104,11 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
oop.implement(this, EventEmitter);
|
oop.implement(this, EventEmitter);
|
||||||
|
|
||||||
this.$normalizePath = function(path) {
|
this.$normalizePath = function(path) {
|
||||||
if (!path.match(/^\w+:/)) {
|
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
|
||||||
path = location.protocol + "//" + location.host
|
path = location.protocol + "//" + location.host
|
||||||
// paths starting with a slash are relative to the root (host)
|
// paths starting with a slash are relative to the root (host)
|
||||||
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
+ (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
|
||||||
+ "/" + path.replace(/^[\/]+/, "");
|
+ "/" + path.replace(/^[\/]+/, "");
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue