kopia lustrzana https://github.com/c9/core
commit
f4a05c8f30
|
@ -94,7 +94,8 @@ function fetchText(path, callback) {
|
||||||
xhr.onload = function (e) {
|
xhr.onload = function (e) {
|
||||||
if (xhr.readyState !== 4)
|
if (xhr.readyState !== 4)
|
||||||
return;
|
return;
|
||||||
if (xhr.status !== 200)
|
// loading from file:// returns 0
|
||||||
|
if (xhr.status !== 200 && xhr.status !== 0)
|
||||||
return done(new Error(xhr.statusText));
|
return done(new Error(xhr.statusText));
|
||||||
done(null, xhr.responseText);
|
done(null, xhr.responseText);
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,8 +38,14 @@
|
||||||
document.body.className = document.body.className.replace("loading " + loadingIde.className, "");
|
document.body.className = document.body.className.replace("loading " + loadingIde.className, "");
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<!--packed{
|
||||||
|
<script src="./build/standalone/config/default.js"></script>
|
||||||
|
packed}-->
|
||||||
|
<!--dev{-->
|
||||||
<script src="/static/mini_require.js"></script>
|
<script src="/static/mini_require.js"></script>
|
||||||
<script src="/configs/require_config.js"></script>
|
<script src="/configs/require_config.js"></script>
|
||||||
|
<!--dev}-->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var vfsPlugin = {
|
var vfsPlugin = {
|
||||||
consumes: [],
|
consumes: [],
|
||||||
|
@ -51,7 +57,13 @@
|
||||||
var connection = {};
|
var connection = {};
|
||||||
// initialize mock fsData
|
// initialize mock fsData
|
||||||
var fsData = {};
|
var fsData = {};
|
||||||
findNode("/hello", true, "world");
|
findNode("/README.md", true, [
|
||||||
|
"# Welcome to Cloud9 offline demo!",
|
||||||
|
"",
|
||||||
|
"This is a demo of Cloud9 ui, with a mock vfs server working with localStorage",
|
||||||
|
"Some features that need a real server have been disabled",
|
||||||
|
"So be sure to try the real thing at https://c9.io!"
|
||||||
|
].join("\n"));
|
||||||
findNode("~", true);
|
findNode("~", true);
|
||||||
// Try loading data from localStorage
|
// Try loading data from localStorage
|
||||||
try {
|
try {
|
||||||
|
@ -236,17 +248,24 @@
|
||||||
|
|
||||||
// Save and retrieve Metadata
|
// Save and retrieve Metadata
|
||||||
metadata: function(path, value, sync, cb) {
|
metadata: function(path, value, sync, cb) {
|
||||||
|
var parts = ("/.c9/metadata" + path).split("/")
|
||||||
|
var name = "!" + parts.pop();
|
||||||
|
var parent = findNode(parts.join("/"), true);
|
||||||
|
if (sync)
|
||||||
|
parent[name] = JSON.stringify(value);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
cb()
|
parent[name] = JSON.stringify(value);
|
||||||
|
cb();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
readFileWithMetadata: function(path, options, cb) {
|
readFileWithMetadata: function(path, options, cb) {
|
||||||
var data = findNode(path);
|
var data = findNode(path);
|
||||||
|
var metadata = findNode("/.c9/metadata" + path);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if (typeof data != "string")
|
if (typeof data != "string")
|
||||||
return cb(ENOENT());
|
return cb(ENOENT());
|
||||||
// TODO metadata
|
// TODO metadata
|
||||||
cb(null, data)
|
cb(null, data, metadata)
|
||||||
});
|
});
|
||||||
return { abort: function() {} };
|
return { abort: function() {} };
|
||||||
},
|
},
|
||||||
|
@ -331,7 +350,6 @@
|
||||||
"plugins/c9.ide.terminal/terminal",
|
"plugins/c9.ide.terminal/terminal",
|
||||||
"plugins/c9.ide.test/all",
|
"plugins/c9.ide.test/all",
|
||||||
"plugins/c9.ide.find/find",
|
"plugins/c9.ide.find/find",
|
||||||
"plugins/c9.ide.language.jsonalyzer/jsonalyzer",
|
|
||||||
"plugins/c9.ide.terminal/link_handler",
|
"plugins/c9.ide.terminal/link_handler",
|
||||||
"plugins/c9.ide.test/coverage",
|
"plugins/c9.ide.test/coverage",
|
||||||
"plugins/c9.ide.test/coverage",
|
"plugins/c9.ide.test/coverage",
|
||||||
|
@ -340,12 +358,9 @@
|
||||||
|
|
||||||
"plugins/c9.ide.find.infiles/findinfiles",
|
"plugins/c9.ide.find.infiles/findinfiles",
|
||||||
"plugins/c9.ide.language.codeintel/codeintel",
|
"plugins/c9.ide.language.codeintel/codeintel",
|
||||||
"plugins/c9.ide.language.core/outline",
|
|
||||||
"plugins/c9.ide.language.go/go",
|
"plugins/c9.ide.language.go/go",
|
||||||
"plugins/c9.ide.language.python/python",
|
"plugins/c9.ide.language.python/python",
|
||||||
"plugins/c9.ide.navigate/navigate",
|
|
||||||
"plugins/c9.ide.test/coverageview",
|
"plugins/c9.ide.test/coverageview",
|
||||||
"plugins/c9.ide.tree/favorites",
|
|
||||||
"plugins/c9.cli.bridge/bridge_commands",
|
"plugins/c9.cli.bridge/bridge_commands",
|
||||||
"plugins/c9.ide.ace.keymaps/cli",
|
"plugins/c9.ide.ace.keymaps/cli",
|
||||||
"plugins/c9.ide.configuration/configure",
|
"plugins/c9.ide.configuration/configure",
|
||||||
|
@ -360,6 +375,7 @@
|
||||||
if (/\/c9.ide.installer/.test(packagePath)) return false;
|
if (/\/c9.ide.installer/.test(packagePath)) return false;
|
||||||
if (/\/c9.vfs.client/.test(packagePath)) return false;
|
if (/\/c9.vfs.client/.test(packagePath)) return false;
|
||||||
if (/\/c9.ide.plugins/.test(packagePath)) return false;
|
if (/\/c9.ide.plugins/.test(packagePath)) return false;
|
||||||
|
if (/\/c9.ide.scm/.test(packagePath)) return false;
|
||||||
if (excludes.indexOf(packagePath) != -1) return false;
|
if (excludes.indexOf(packagePath) != -1) return false;
|
||||||
|
|
||||||
if (packagePath == "plugins/c9.fs/fs")
|
if (packagePath == "plugins/c9.fs/fs")
|
||||||
|
@ -373,17 +389,34 @@
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
plugins.push(vfsPlugin);
|
plugins.push(vfsPlugin);
|
||||||
|
plugins.push({
|
||||||
|
provides: ["find", "installer"],
|
||||||
|
consumes: [],
|
||||||
|
setup: function(options, imports, register) {
|
||||||
|
function noop() {}
|
||||||
|
register(null, {
|
||||||
|
find: { on: noop, once: noop, getFileList: noop },
|
||||||
|
installer: {},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
return plugins;
|
return plugins;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var start = Date.now();
|
var start = Date.now();
|
||||||
|
/*packed{
|
||||||
|
var href = location.href.split(/[#&]/)[0].replace(/[^\/]*$/, "");
|
||||||
|
require.MODULE_LOAD_URL = href + "build/standalone/modules";
|
||||||
|
require.config({paths: {
|
||||||
|
configs: href + "configs",
|
||||||
|
lib: href + "build/static/lib",
|
||||||
|
}});
|
||||||
|
/*packed}*/
|
||||||
var plugins;
|
var plugins;
|
||||||
require(["lib/architect/architect", "configs/ide/default"], function (architect, defaultConfig) {
|
require(["lib/architect/architect", "configs/ide/default"], function (architect, defaultConfig) {
|
||||||
var plugins = defaultConfig({
|
var plugins = defaultConfig({
|
||||||
staticPrefix: "/static",
|
staticPrefix: href,
|
||||||
workspaceDir: "/",
|
workspaceDir: "/",
|
||||||
workspaceId: "/",
|
workspaceId: "/",
|
||||||
workspaceName: "/",
|
workspaceName: "/",
|
||||||
|
@ -396,7 +429,13 @@
|
||||||
standalone: true,
|
standalone: true,
|
||||||
previewUrl: "",
|
previewUrl: "",
|
||||||
dashboardUrl: "",
|
dashboardUrl: "",
|
||||||
|
/*dev{*/
|
||||||
themePrefix: "/static/standalone/skin/default",
|
themePrefix: "/static/standalone/skin/default",
|
||||||
|
/*dev}*/
|
||||||
|
/*packed{
|
||||||
|
themePrefix: href + "build/standalone/skin/default",
|
||||||
|
CORSWorkerPrefix: href + "build/standalone/worker",
|
||||||
|
/*packed}*/
|
||||||
});
|
});
|
||||||
plugins = offlineConfig(plugins);
|
plugins = offlineConfig(plugins);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,9 @@ while [ "$1" ]; do
|
||||||
--obfuscate)
|
--obfuscate)
|
||||||
OBFUSCATE_OPTION="--obfuscate"
|
OBFUSCATE_OPTION="--obfuscate"
|
||||||
;;
|
;;
|
||||||
|
--copy-static-resources)
|
||||||
|
COPY_STATICS_OPTION="--copy-static-resources"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo Unknown option: $1
|
echo Unknown option: $1
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -30,7 +33,8 @@ esac
|
||||||
CACHE=$CURDIR/../build
|
CACHE=$CURDIR/../build
|
||||||
|
|
||||||
#CDN="echo server.js cdn-cli"
|
#CDN="echo server.js cdn-cli"
|
||||||
CDN="$CURDIR/../server.js cdn-cli -s standalone --server-config standalone --server-settings standalone --version=standalone --cache $CACHE $COMPRESS_OPTION $OBFUSCATE_OPTION"
|
CDN="$CURDIR/../server.js cdn-cli -s standalone --server-config standalone --server-settings standalone
|
||||||
|
--version=standalone --cache $CACHE $COMPRESS_OPTION $OBFUSCATE_OPTION $COPY_STATICS_OPTION"
|
||||||
|
|
||||||
# build async loaded ace modules
|
# build async loaded ace modules
|
||||||
$CDN --module ace
|
$CDN --module ace
|
||||||
|
|
Ładowanie…
Reference in New Issue