Merge pull request +12817 from c9/fix-language

load worker from c9.io to fix loading on ie and firefox
This commit is contained in:
Harutyun Amirjanyan 2016-03-16 22:50:24 +04:00
commit ef2e9add30
3 changed files with 9 additions and 6 deletions

View File

@ -200,7 +200,7 @@ window.onmessage = function(e) {
sender._signal(msg.event, msg.data);
}
else if (msg.command) {
if (main[msg.command])
if (main && main[msg.command])
main[msg.command].apply(main, msg.args);
else if (window[msg.command])
window[msg.command].apply(window, msg.args);

View File

@ -36,7 +36,7 @@ var net = require("../lib/net");
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var config = require("../config");
var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl, importScripts) {
this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);
this.changeListener = this.changeListener.bind(this);
this.onMessage = this.onMessage.bind(this);
@ -75,6 +75,9 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
throw e;
}
}
if (importScripts) {
this.send("importScripts", importScripts);
}
this.$worker.postMessage({
init : true,
tlns : tlns,
@ -94,7 +97,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
this.onMessage = function(e) {
var msg = e.data;
switch(msg.type) {
switch (msg.type) {
case "event":
this._signal(msg.name, {data: msg.data});
break;
@ -157,7 +160,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
};
this.attachToDocument = function(doc) {
if(this.$doc)
if (this.$doc)
this.terminate();
this.$doc = doc;

View File

@ -55,14 +55,14 @@
"c9"
],
"c9plugins": {
"c9.ide.language": "#db77f906a2",
"c9.ide.language": "#f03e5ca0c8",
"c9.ide.language.css": "#be07d72209",
"c9.ide.language.generic": "#92210f5a48",
"c9.ide.language.html": "#22fdc74869",
"c9.ide.language.html.diff": "#24f3608d26",
"c9.ide.language.javascript": "#d1a479805c",
"c9.ide.language.javascript.immediate": "#c8b1e5767a",
"c9.ide.language.javascript.eslint": "#3c57ed1720",
"c9.ide.language.javascript.eslint": "#4de5457db1",
"c9.ide.language.javascript.tern": "#b55d0069bb",
"c9.ide.language.javascript.infer": "#325ac6880e",
"c9.ide.language.jsonalyzer": "#4b329741b1",