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