kopia lustrzana https://github.com/c9/core
backward compat
rodzic
e9f84cb591
commit
baf384acab
|
@ -100,7 +100,7 @@
|
||||||
"c9.ide.preview": "#5f5fff0185",
|
"c9.ide.preview": "#5f5fff0185",
|
||||||
"c9.ide.preview.browser": "#897177be7f",
|
"c9.ide.preview.browser": "#897177be7f",
|
||||||
"c9.ide.preview.markdown": "#c3174d86e0",
|
"c9.ide.preview.markdown": "#c3174d86e0",
|
||||||
"c9.ide.pubsub": "#933baeb7b4",
|
"c9.ide.pubsub": "#b20bdfb12a",
|
||||||
"c9.ide.readonly": "#719881e192",
|
"c9.ide.readonly": "#719881e192",
|
||||||
"c9.ide.recentfiles": "#7c099abf40",
|
"c9.ide.recentfiles": "#7c099abf40",
|
||||||
"c9.ide.remote": "#301d2ab519",
|
"c9.ide.remote": "#301d2ab519",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
main.consumes = ["Plugin", "ext", "c9", "vfs", "metrics"];
|
main.consumes = ["Plugin", "ext", "c9", "vfs"];
|
||||||
main.provides = ["vfs.ping"];
|
main.provides = ["vfs.ping"];
|
||||||
return main;
|
return main;
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ define(function(require, exports, module) {
|
||||||
var Plugin = imports.Plugin;
|
var Plugin = imports.Plugin;
|
||||||
var c9 = imports.c9;
|
var c9 = imports.c9;
|
||||||
var ext = imports.ext;
|
var ext = imports.ext;
|
||||||
var metrics = imports.metrics;
|
|
||||||
|
|
||||||
/***** Initialization *****/
|
/***** Initialization *****/
|
||||||
|
|
||||||
|
@ -17,13 +16,17 @@ define(function(require, exports, module) {
|
||||||
var api;
|
var api;
|
||||||
|
|
||||||
var loaded = false;
|
var loaded = false;
|
||||||
function load(){
|
function load(oldVfs) {
|
||||||
if (loaded) return;
|
if (loaded && !oldVfs) return;
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
|
||||||
ext.loadRemotePlugin("ping", {
|
ext.loadRemotePlugin("ping", {
|
||||||
file: "c9.vfs.client/ping-service.js"
|
file: oldVfs ? undefined : "c9.vfs.client/ping-service.js",
|
||||||
|
code: oldVfs ? require("text!./ping-service.js") : undefined
|
||||||
}, function(err, remote) {
|
}, function(err, remote) {
|
||||||
|
if (!remote && !oldVfs)
|
||||||
|
return load(true);
|
||||||
|
|
||||||
if (!remote)
|
if (!remote)
|
||||||
return console.error(err);
|
return console.error(err);
|
||||||
|
|
||||||
|
|
|
@ -83,11 +83,13 @@ module.exports = function(vfs, options) {
|
||||||
return callback(new error.Forbidden("VFS extend: " + name + " is not authorized in read only mode"));
|
return callback(new error.Forbidden("VFS extend: " + name + " is not authorized in read only mode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.code || options.stream)
|
// localfs extend checks for file, then code, then stream
|
||||||
return vfs.extend(name, options, callback);
|
if (!options.file) {
|
||||||
|
if (options.code || options.stream)
|
||||||
|
return vfs.extend(name, options, callback);
|
||||||
|
|
||||||
if (!options.file)
|
|
||||||
return callback(new error.Forbidden("Option 'file' is missing"));
|
return callback(new error.Forbidden("Option 'file' is missing"));
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof options.file != "string")
|
if (typeof options.file != "string")
|
||||||
return callback(new error.Forbidden("Invalid option 'file'"));
|
return callback(new error.Forbidden("Invalid option 'file'"));
|
||||||
|
|
Ładowanie…
Reference in New Issue