This commit is contained in:
Fabian Jakobs 2012-03-02 11:40:40 +01:00
commit fcded20cbe
28 changed files with 6433 additions and 1935 deletions

File diff suppressed because one or more lines are too long

View file

@ -14111,7 +14111,7 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
oop.implement(this, EventEmitter);
this.$normalizePath = function(path) {
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
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(/\/[^\/]*$/, ""))

View file

@ -14111,7 +14111,7 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
oop.implement(this, EventEmitter);
this.$normalizePath = function(path) {
path = path.replace(/^[a-z]+:\/\/[^\/]+\//, ""); // Remove domain name and rebuild it
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(/\/[^\/]*$/, ""))

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -35,7 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
ace.define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
ace.define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
@ -45,6 +45,7 @@ var HighlightRules = require("./json_highlight_rules").JsonHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var Mode = function() {
this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
@ -76,7 +77,23 @@ oop.inherits(Mode, TextMode);
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "worker-json.js", "ace/mode/json_worker", "JsonWorker");
worker.attachToDocument(session.getDocument());
worker.on("error", function(e) {
session.setAnnotations([e.data]);
});
worker.on("ok", function() {
session.clearAnnotations();
});
return worker;
};
}).call(Mode.prototype);
exports.Mode = Mode;

View file

@ -35,7 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
@ -45,6 +45,7 @@ var HighlightRules = require("./json_highlight_rules").JsonHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var Mode = function() {
this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
@ -76,7 +77,23 @@ oop.inherits(Mode, TextMode);
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "worker-json.js", "ace/mode/json_worker", "JsonWorker");
worker.attachToDocument(session.getDocument());
worker.on("error", function(e) {
session.setAnnotations([e.data]);
});
worker.on("ok", function() {
session.clearAnnotations();
});
return worker;
};
}).call(Mode.prototype);
exports.Mode = Mode;

File diff suppressed because one or more lines are too long

View file

@ -1539,10 +1539,10 @@ exports.implement = function(proto, mixin) {
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
define('ace/mode/coffee_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/coffee/coffee-script'], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var Mirror = require("../worker/mirror").Mirror;
var coffee = require("../mode/coffee/coffee-script");
@ -1558,29 +1558,29 @@ var Worker = exports.Worker = function(sender) {
oop.inherits(Worker, Mirror);
(function() {
this.onUpdate = function() {
var value = this.doc.getValue();
try {
coffee.parse(value);
} catch(e) {
var m = e.message.match(/Parse error on line (\d+): (.*)/);
if (m) {
this.sender.emit("error", {
row: parseInt(m[1]) - 1,
row: parseInt(m[1], 10) - 1,
column: null,
text: m[2],
type: "error"
});
return;
}
if (e instanceof SyntaxError) {
var m = e.message.match(/ on line (\d+)/);
if (m) {
if (m) {
this.sender.emit("error", {
row: parseInt(m[1]) - 1,
row: parseInt(m[1], 10) - 1,
column: null,
text: e.message.replace(m[0], ""),
type: "error"
@ -1591,7 +1591,7 @@ oop.inherits(Worker, Mirror);
}
this.sender.emit("ok");
};
}).call(Worker.prototype);
});define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {

3062
build/src/worker-json.js Normal file

File diff suppressed because it is too large Load diff