load worker from c9.io to fix loading on ie and firefox

pull/272/head
nightwing 2016-03-16 01:19:48 +04:00
rodzic 24f001d98a
commit 50640cbeef
3 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -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);

Wyświetl plik

@ -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;

Wyświetl plik

@ -55,7 +55,7 @@
"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",