kopia lustrzana https://github.com/c9/core
improve gh-pages of c9/core
rodzic
049c2271cc
commit
e38d74471c
|
@ -94,7 +94,8 @@ function fetchText(path, callback) {
|
|||
xhr.onload = function (e) {
|
||||
if (xhr.readyState !== 4)
|
||||
return;
|
||||
if (xhr.status !== 200)
|
||||
// loading from file:// returns 0
|
||||
if (xhr.status !== 200 && xhr.status !== 0)
|
||||
return done(new Error(xhr.statusText));
|
||||
done(null, xhr.responseText);
|
||||
};
|
||||
|
|
|
@ -38,8 +38,14 @@
|
|||
document.body.className = document.body.className.replace("loading " + loadingIde.className, "");
|
||||
};
|
||||
</script>
|
||||
<!--packed{
|
||||
<script src="./build/standalone/config/default.js"></script>
|
||||
packed}-->
|
||||
<!--dev{-->
|
||||
<script src="/static/mini_require.js"></script>
|
||||
<script src="/configs/require_config.js"></script>
|
||||
<!--dev}-->
|
||||
|
||||
<script>
|
||||
var vfsPlugin = {
|
||||
consumes: [],
|
||||
|
@ -51,7 +57,13 @@
|
|||
var connection = {};
|
||||
// initialize mock 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);
|
||||
// Try loading data from localStorage
|
||||
try {
|
||||
|
@ -236,17 +248,24 @@
|
|||
|
||||
// Save and retrieve Metadata
|
||||
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() {
|
||||
cb()
|
||||
parent[name] = JSON.stringify(value);
|
||||
cb();
|
||||
});
|
||||
},
|
||||
readFileWithMetadata: function(path, options, cb) {
|
||||
var data = findNode(path);
|
||||
var metadata = findNode("/.c9/metadata" + path);
|
||||
setTimeout(function() {
|
||||
if (typeof data != "string")
|
||||
return cb(ENOENT());
|
||||
// TODO metadata
|
||||
cb(null, data)
|
||||
cb(null, data, metadata)
|
||||
});
|
||||
return { abort: function() {} };
|
||||
},
|
||||
|
@ -331,7 +350,6 @@
|
|||
"plugins/c9.ide.terminal/terminal",
|
||||
"plugins/c9.ide.test/all",
|
||||
"plugins/c9.ide.find/find",
|
||||
"plugins/c9.ide.language.jsonalyzer/jsonalyzer",
|
||||
"plugins/c9.ide.terminal/link_handler",
|
||||
"plugins/c9.ide.test/coverage",
|
||||
"plugins/c9.ide.test/coverage",
|
||||
|
@ -340,12 +358,9 @@
|
|||
|
||||
"plugins/c9.ide.find.infiles/findinfiles",
|
||||
"plugins/c9.ide.language.codeintel/codeintel",
|
||||
"plugins/c9.ide.language.core/outline",
|
||||
"plugins/c9.ide.language.go/go",
|
||||
"plugins/c9.ide.language.python/python",
|
||||
"plugins/c9.ide.navigate/navigate",
|
||||
"plugins/c9.ide.test/coverageview",
|
||||
"plugins/c9.ide.tree/favorites",
|
||||
"plugins/c9.cli.bridge/bridge_commands",
|
||||
"plugins/c9.ide.ace.keymaps/cli",
|
||||
"plugins/c9.ide.configuration/configure",
|
||||
|
@ -360,6 +375,7 @@
|
|||
if (/\/c9.ide.installer/.test(packagePath)) return false;
|
||||
if (/\/c9.vfs.client/.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 (packagePath == "plugins/c9.fs/fs")
|
||||
|
@ -373,17 +389,34 @@
|
|||
return true;
|
||||
});
|
||||
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;
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
|
||||
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;
|
||||
require(["lib/architect/architect", "configs/ide/default"], function (architect, defaultConfig) {
|
||||
var plugins = defaultConfig({
|
||||
staticPrefix: "/static",
|
||||
staticPrefix: href,
|
||||
workspaceDir: "/",
|
||||
workspaceId: "/",
|
||||
workspaceName: "/",
|
||||
|
@ -396,7 +429,13 @@
|
|||
standalone: true,
|
||||
previewUrl: "",
|
||||
dashboardUrl: "",
|
||||
/*dev{*/
|
||||
themePrefix: "/static/standalone/skin/default",
|
||||
/*dev}*/
|
||||
/*packed{
|
||||
themePrefix: href + "build/standalone/skin/default",
|
||||
CORSWorkerPrefix: href + "build/standalone/worker",
|
||||
/*packed}*/
|
||||
});
|
||||
plugins = offlineConfig(plugins);
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ while [ "$1" ]; do
|
|||
--obfuscate)
|
||||
OBFUSCATE_OPTION="--obfuscate"
|
||||
;;
|
||||
--copy-static-resources)
|
||||
COPY_STATICS_OPTION="--copy-static-resources"
|
||||
;;
|
||||
*)
|
||||
echo Unknown option: $1
|
||||
exit 1
|
||||
|
@ -30,7 +33,8 @@ esac
|
|||
CACHE=$CURDIR/../build
|
||||
|
||||
#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
|
||||
$CDN --module ace
|
||||
|
|
Ładowanie…
Reference in New Issue