Add bookmarklet/textarea build
This commit is contained in:
parent
66562856c8
commit
73e94d3f97
5 changed files with 884 additions and 8 deletions
|
|
@ -209,7 +209,7 @@ var EditSession = function(text, mode) {
|
|||
|
||||
this.addMarker = function(range, clazz, type, inFront) {
|
||||
var id = this.$markerId++;
|
||||
|
||||
|
||||
var marker = {
|
||||
range : range,
|
||||
type : type || "line",
|
||||
|
|
@ -217,7 +217,7 @@ var EditSession = function(text, mode) {
|
|||
clazz : clazz,
|
||||
inFront: !!inFront
|
||||
}
|
||||
|
||||
|
||||
if (inFront) {
|
||||
this.$frontMarkers[id] = marker;
|
||||
this._dispatchEvent("changeFrontMarker")
|
||||
|
|
@ -225,26 +225,26 @@ var EditSession = function(text, mode) {
|
|||
this.$backMarkers[id] = marker;
|
||||
this._dispatchEvent("changeBackMarker")
|
||||
}
|
||||
|
||||
|
||||
return id;
|
||||
};
|
||||
|
||||
|
||||
this.removeMarker = function(markerId) {
|
||||
var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];
|
||||
if (!marker)
|
||||
return;
|
||||
|
||||
|
||||
var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
|
||||
if (marker) {
|
||||
delete (markers[markerId]);
|
||||
this._dispatchEvent(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.getMarkers = function(inFront) {
|
||||
return inFront ? this.$frontMarkers : this.$backMarkers;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Error:
|
||||
* {
|
||||
|
|
@ -334,7 +334,7 @@ var EditSession = function(text, mode) {
|
|||
if (this.$worker)
|
||||
this.$worker.terminate();
|
||||
|
||||
if (window.Worker)
|
||||
if (window.Worker && !require.noWorker)
|
||||
this.$worker = mode.createWorker(this);
|
||||
else
|
||||
this.$worker = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue