mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
Merge remote-tracking branch 'origin/master' into merge-account-profile
Conflicts: configs/account.js
This commit is contained in:
commit
eee93a429e
226
configs/api.standalone.js
Normal file
226
configs/api.standalone.js
Normal file
@ -0,0 +1,226 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
|
||||
module.exports.addApi = function(plugins, config) {
|
||||
config.apiUrl = "";
|
||||
var apiPlugins = [{
|
||||
setup: function(options, imports, register) {
|
||||
mockRedis(options, imports, register);
|
||||
},
|
||||
provides: ["mq", "db", "mailer"],
|
||||
consumes: ["api"]
|
||||
}, {
|
||||
packagePath: "./c9.logtimestamp/logtimestamp",
|
||||
mode: config.mode
|
||||
},
|
||||
"./c9.error/logger.raygun_mock",
|
||||
"./c9.api/ping",
|
||||
{
|
||||
packagePath: "./c9.api/health",
|
||||
revision: config.manifest.revision,
|
||||
version: config.manifest.version,
|
||||
},
|
||||
"./c9.api/user",
|
||||
"./c9.api/project",
|
||||
"./c9.api/applications",
|
||||
"./c9.api/session",
|
||||
"./c9.api/collab",
|
||||
"./c9.api/settings",
|
||||
"./c9.api/vfs",
|
||||
"./c9.api/preview",
|
||||
"connect-architect/connect.bodyparser",
|
||||
"connect-architect/connect.query",
|
||||
"./c9.passport/passport",
|
||||
"./c9.passport/bearer",
|
||||
"./c9.passport/basic"];
|
||||
|
||||
return plugins.concat(apiPlugins);
|
||||
};
|
||||
|
||||
function mockRedis(options, imports, register) {
|
||||
var api = imports.api;
|
||||
if (api.bindUser)
|
||||
return;
|
||||
|
||||
api.bindUser = function(call) {
|
||||
return function(req, res, next) {
|
||||
call(req.user, req.params, function(err, json) {
|
||||
if (err) return next(err);
|
||||
res.json(json);
|
||||
});
|
||||
};
|
||||
};
|
||||
api.authenticate = function() {
|
||||
return function(req, res, next) {
|
||||
req.user = new User(req.query.access_token);
|
||||
next();
|
||||
};
|
||||
};
|
||||
var users = {
|
||||
"-1": {
|
||||
name: "John Doe", email: "johndoe@example.org",
|
||||
}
|
||||
};
|
||||
|
||||
var projects = [{
|
||||
owner: -1, members: ["rw", -1, 1, 2, 3, "r", 4, 5]
|
||||
}];
|
||||
|
||||
function User(id) {
|
||||
if (typeof id == "object")
|
||||
id = id.id;
|
||||
if (!/^\d+/.test(id))
|
||||
id = -1;
|
||||
var u = users[id];
|
||||
if (!u) {
|
||||
u = users[id] = {
|
||||
name: "user" + id,
|
||||
email: "user" + id + "@c9.io",
|
||||
fullname: "User " + id
|
||||
};
|
||||
}
|
||||
|
||||
u.id = id;
|
||||
return {
|
||||
name: u.name,
|
||||
fullname: u.fullname,
|
||||
email: u.email,
|
||||
id: id
|
||||
};
|
||||
}
|
||||
|
||||
function Project(id) {
|
||||
if (typeof id == "object")
|
||||
id = id.id;
|
||||
var p = projects[id];
|
||||
if (!p)
|
||||
return console.log(id);
|
||||
return {
|
||||
isPrivate: function() {
|
||||
return false;
|
||||
},
|
||||
owner: new User(p.owner),
|
||||
getMembers: function(cb) {
|
||||
var memebers = [], acl;
|
||||
var ownerId = this.owner.id;
|
||||
p.members.forEach(function(memberId) {
|
||||
if (typeof memberId == "string")
|
||||
return (acl = memberId);
|
||||
memebers.push(new Member(memberId, acl, ownerId));
|
||||
});
|
||||
cb && cb(null, memebers);
|
||||
return memebers;
|
||||
},
|
||||
id: id
|
||||
};
|
||||
}
|
||||
|
||||
function Member(id, acl, ownerId) {
|
||||
return {
|
||||
user: id,
|
||||
status: "",
|
||||
acl: acl,
|
||||
role: id == ownerId ? "a" : "c",
|
||||
save: function(project, cb) {
|
||||
cb();
|
||||
},
|
||||
remove: function(project, cb) {
|
||||
var p = projects[project.id];
|
||||
var i = p.members.indexOf(id);
|
||||
if (i != -1)
|
||||
p.members.splice(i, 1);
|
||||
cb();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function DB(type) {
|
||||
var key, query;
|
||||
var dbApi = {
|
||||
findOne: function(keyv, cb) {
|
||||
key = keyv;
|
||||
if (cb)
|
||||
return dbApi.exec(cb);
|
||||
return dbApi;
|
||||
},
|
||||
populate: function(queryV) {
|
||||
query = queryV;
|
||||
return dbApi;
|
||||
},
|
||||
exec: function(cb) {
|
||||
var result;
|
||||
switch (type) {
|
||||
case "Project":
|
||||
result = new Project(0);
|
||||
break;
|
||||
case "User":
|
||||
result = new User(key.uid);
|
||||
break;
|
||||
case "AccessToken":
|
||||
if (query == "user") {
|
||||
var id = /\d/.test(key.token) ? key.token : -1;
|
||||
result = {user: new User(id)};
|
||||
}
|
||||
break;
|
||||
case "WorkspaceMember":
|
||||
var p = key.project;
|
||||
var user = new User(key.user);
|
||||
result = p.getMembers().filter(function(m) {
|
||||
return m.user == user.id;
|
||||
})[0];
|
||||
break;
|
||||
default:
|
||||
console.log(":(((");
|
||||
}
|
||||
cb(null, result);
|
||||
return dbApi;
|
||||
},
|
||||
};
|
||||
dbApi.ROLE_NONE = "n";
|
||||
dbApi.ROLE_VISITOR = "v"; // @deprecated
|
||||
dbApi.ROLE_COLLABORATOR = "c";
|
||||
dbApi.ROLE_ADMIN = "a";
|
||||
dbApi.ACL_RW = "rw";
|
||||
dbApi.ACL_R = "r";
|
||||
dbApi.COLLABSTATE_PENDING_ADMIN = "pending-admin";
|
||||
dbApi.COLLABSTATE_PENDING_USER = "pending-user"; // @deprecated
|
||||
dbApi.COLLABSTATE_PENDING_NONE = "pending-none";
|
||||
return dbApi;
|
||||
}
|
||||
|
||||
var pubsub = {
|
||||
publish: function() {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
function noop() { return {}; }
|
||||
|
||||
register(null, {
|
||||
"mq": {
|
||||
connection: noop,
|
||||
close: noop,
|
||||
onReady: noop,
|
||||
onceReady: noop,
|
||||
},
|
||||
"db": {
|
||||
User: new DB("User"),
|
||||
Project: new DB("Project"),
|
||||
Remote: new DB("Remote"),
|
||||
AccessToken: new DB("AccessToken"),
|
||||
WorkspaceMember: new DB("WorkspaceMember"),
|
||||
Vfs: new DB("Vfs"),
|
||||
DockerHost: new DB("DockerHost"),
|
||||
Container: new DB("Container"),
|
||||
Image: new DB("Image"),
|
||||
Lock: new DB("Lock"),
|
||||
Nonce: new DB("Nonce"),
|
||||
// PubSub as part of the database infrastructure
|
||||
getSubscriber: function() { return pubsub },
|
||||
getPublisher: function() { return pubsub },
|
||||
},
|
||||
mailer: {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
242
local/install.sh
242
local/install.sh
@ -1,242 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
set -e
|
||||
has() {
|
||||
type "$1" > /dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
# Redirect stdout ( > ) into a named pipe ( >() ) running "tee"
|
||||
exec > >(tee /tmp/installlog.txt)
|
||||
|
||||
# Without this, only stdout would be captured - i.e. your
|
||||
# log file would not contain any error messages.
|
||||
exec 2>&1
|
||||
|
||||
NODE_VERSION=v0.10.28
|
||||
APPSUPPORT_USER=$HOME/.c9
|
||||
SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
RUNTIME=$SCRIPT/..
|
||||
INSTALL_DIR=/tmp/c9-`date '+%s'`
|
||||
ORIGINAL_USER=`basename $HOME`
|
||||
OSX_INSTALLER_PATH=$2
|
||||
|
||||
start() {
|
||||
if [ $# -lt 1 ]; then
|
||||
start base
|
||||
return
|
||||
fi
|
||||
|
||||
# Try to figure out the os and arch for binary fetching
|
||||
local uname="$(uname -a)"
|
||||
local os=
|
||||
local arch="$(uname -m)"
|
||||
case "$uname" in
|
||||
Linux\ *) os=linux ;;
|
||||
Darwin\ *) os=darwin ;;
|
||||
SunOS\ *) os=sunos ;;
|
||||
FreeBSD\ *) os=freebsd ;;
|
||||
esac
|
||||
case "$uname" in
|
||||
*x86_64*) arch=x64 ;;
|
||||
*i*86*) arch=x86 ;;
|
||||
*armv6l*) arch=arm-pi ;;
|
||||
esac
|
||||
|
||||
if [ $os != "linux" ] && [ $os != "darwin" ]; then
|
||||
echo "Unsupported Platform: $os $arch" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $arch != "x64" ] && [ $arch != "x86" ]; then
|
||||
echo "Unsupported Architecture: $os $arch" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $os == "darwin" ]; then
|
||||
APPSUPPORT_USER="$HOME/Library/Application Support/Cloud9"
|
||||
APPTARGET=$OSX_INSTALLER_PATH
|
||||
APPSUPPORT="/Library/Application Support/Cloud9"
|
||||
RUNTIME="${APPTARGET}/Contents/Resources/app.nw"
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
"help" )
|
||||
echo
|
||||
echo "Cloud9 Installer"
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo " install help Show this message"
|
||||
echo " install install [name [name ...]] Download and install a set of packages"
|
||||
echo " install ls List available packages"
|
||||
echo
|
||||
;;
|
||||
|
||||
"ls" )
|
||||
echo "!node - Node.js"
|
||||
echo "!tmux_install - TMUX"
|
||||
echo "!nak - NAK"
|
||||
echo "!vfsextend - VFS extend"
|
||||
echo "!ptyjs - pty.js"
|
||||
echo "!c9cli - C9 CLI"
|
||||
echo "!sc - Sauce Connect"
|
||||
echo "coffee - Coffee Script"
|
||||
echo "less - Less"
|
||||
echo "sass - Sass"
|
||||
echo "typescript - TypeScript"
|
||||
echo "stylus - Stylus"
|
||||
# echo "go - Go"
|
||||
# echo "heroku - Heroku"
|
||||
# echo "rhc - RedHat OpenShift"
|
||||
# echo "gae - Google AppEngine"
|
||||
;;
|
||||
|
||||
"install" )
|
||||
shift
|
||||
|
||||
# make sure dirs are around
|
||||
mkdir -p "$APPSUPPORT/bin"
|
||||
mkdir -p "$APPSUPPORT/node_modules"
|
||||
cd "$APPSUPPORT"
|
||||
|
||||
cp -a "$SCRIPT" "$INSTALL_DIR"
|
||||
|
||||
# install packages
|
||||
while [ $# -ne 0 ]
|
||||
do
|
||||
time eval ${1} $os $arch
|
||||
shift
|
||||
done
|
||||
|
||||
# finalize
|
||||
#pushd $APPSUPPORT/node_modules/.bin
|
||||
#for FILE in $APPSUPPORT/node_modules/.bin/*; do
|
||||
# if [ `uname` == Darwin ]; then
|
||||
# sed -i "" -E s:'#!/usr/bin/env node':"#!$NODE":g $(readlink $FILE)
|
||||
# else
|
||||
# sed -i -E s:'#!/usr/bin/env node':"#!$NODE":g $(readlink $FILE)
|
||||
# fi
|
||||
#done
|
||||
#popd
|
||||
|
||||
VERSION=`cat $RUNTIME/version || echo 1`
|
||||
echo 1 > "$APPSUPPORT/installed"
|
||||
echo $VERSION > "$APPSUPPORT/version"
|
||||
|
||||
# set chown/chmod of application dirs for update
|
||||
echo "Testing existence of APPTARGET (${APPTARGET})"
|
||||
if [ -d "$APPTARGET" ]; then
|
||||
echo "Updating permissions of APPTARGET (${APPTARGET})"
|
||||
chown -R root:admin "$APPTARGET" || chown -R root:staff "$APPTARGET"
|
||||
chmod -R 775 "$APPTARGET"
|
||||
fi
|
||||
|
||||
echo "Testing existence of APPSUPPORT (${APPSUPPORT})"
|
||||
if [ -d "$APPSUPPORT" ]; then
|
||||
echo "Updating permissions of APPSUPPORT (${APPSUPPORT})"
|
||||
chown -R root:admin "$APPSUPPORT" || chown -R root:staff "$APPSUPPORT"
|
||||
chmod -R 775 "$APPSUPPORT"
|
||||
fi
|
||||
|
||||
echo "Testing existence of APPSUPPORT_USER (${APPSUPPORT_USER})"
|
||||
if [ -n "$ORIGINAL_USER" ] && [ -d "$APPSUPPORT_USER" ]; then
|
||||
echo "Updating permissions of APPSUPPORT_USER (${APPSUPPORT_USER})"
|
||||
chown -R $ORIGINAL_USER "$APPSUPPORT_USER"
|
||||
fi
|
||||
|
||||
rm -Rf $INSTALL_DIR
|
||||
|
||||
echo :Done.
|
||||
;;
|
||||
|
||||
"base" )
|
||||
echo "Installing base packages. Use '`basename $0` help' for more options"
|
||||
start install node tmux_install nak ptyjs sc vfsextend c9cli
|
||||
;;
|
||||
|
||||
* )
|
||||
start base
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# NodeJS
|
||||
|
||||
node(){
|
||||
# clean up
|
||||
rm -rf node
|
||||
rm -rf node-$NODE_VERSION*
|
||||
|
||||
echo :Installing Node $NODE_VERSION
|
||||
|
||||
cd "$INSTALL_DIR"
|
||||
tar xvfz node-$NODE_VERSION-$1-$2.tar.gz
|
||||
rm -Rf "$APPSUPPORT/node"
|
||||
mv node-$NODE_VERSION-$1-$2 "$APPSUPPORT/node"
|
||||
}
|
||||
|
||||
tmux_install(){
|
||||
echo :Installing TMUX
|
||||
mkdir -p "$APPSUPPORT/bin"
|
||||
|
||||
if [ $os = "darwin" ]; then
|
||||
cd "$INSTALL_DIR"
|
||||
python rudix.py -i libevent-2.0.21-0.pkg
|
||||
python rudix.py -i tmux-1.9-0.pkg
|
||||
|
||||
if ! type "/usr/local/bin/tmux"; then
|
||||
echo "Installation Failed"
|
||||
exit 100
|
||||
fi
|
||||
|
||||
ln -sf "/usr/local/bin/tmux" "$APPSUPPORT/bin/tmux"
|
||||
# Linux
|
||||
else
|
||||
echo "Unsupported"
|
||||
fi
|
||||
}
|
||||
|
||||
vfsextend(){
|
||||
echo :Installing VFS extend
|
||||
cd "$INSTALL_DIR"
|
||||
tar xvfz c9-vfs-extend.tar.gz
|
||||
rm -Rf "$APPSUPPORT/c9-vfs-extend"
|
||||
mv c9-vfs-extend "$APPSUPPORT"
|
||||
}
|
||||
|
||||
sc(){
|
||||
echo :Installing Sauce Connect
|
||||
cd "$INSTALL_DIR"
|
||||
tar xvzf sc-4.0-latest.tar.gz
|
||||
rm -rf "$APPSUPPORT/sc"
|
||||
mv sc-4.0-latest "$APPSUPPORT/sc"
|
||||
}
|
||||
|
||||
nak(){
|
||||
echo :Installing Nak
|
||||
cd "$INSTALL_DIR"
|
||||
tar -zxvf nak.tar.gz
|
||||
mkdir -p "$APPSUPPORT/node_modules/.bin"
|
||||
rm -Rf "$APPSUPPORT/node_modules/nak"
|
||||
mv nak "$APPSUPPORT/node_modules"
|
||||
ln -s "$APPSUPPORT/node_modules/nak/bin/nak" "$APPSUPPORT/node_modules/.bin/nak" &2> /dev/null
|
||||
}
|
||||
|
||||
ptyjs(){
|
||||
echo :Installing pty.js
|
||||
cd "$INSTALL_DIR"
|
||||
tar -zxvf pty-$NODE_VERSION-$1-$2.tar.gz
|
||||
mkdir -p "$APPSUPPORT/node_modules"
|
||||
rm -Rf "$APPSUPPORT/node_modules/pty.js"
|
||||
mv pty.js "$APPSUPPORT/node_modules"
|
||||
}
|
||||
|
||||
c9cli(){
|
||||
if [ -d "/usr/local/bin/" ]; then
|
||||
chmod +x "$RUNTIME/bin/c9"
|
||||
ln -s -f "$RUNTIME/bin/c9" /usr/local/bin/c9
|
||||
else
|
||||
echo "unable to add c9cli to the path"
|
||||
fi
|
||||
}
|
||||
|
||||
start $@
|
||||
@ -23,7 +23,7 @@ var SAFE_PORTS = [2222, 2310, 3000, 3001, 3030, 3210, 3333, 4000, 4001,
|
||||
7777, 8000, 8001, 8003, 8031, 8080, 8081, 8765, 8777,
|
||||
8888, 9000, 9001, 9080, 9090, 9876, 9877, 9999, 49221];
|
||||
|
||||
var installPath = process.platform == "darwin"
|
||||
var installPath = process.platform == "dar-win" // disabled for sdk
|
||||
? "/Library/Application Support/Cloud9"
|
||||
: join(process.env.HOME, ".c9");
|
||||
|
||||
|
||||
2
node_modules/ace/lib/ace/ext/emmet.js
generated
vendored
2
node_modules/ace/lib/ace/ext/emmet.js
generated
vendored
@ -393,7 +393,7 @@ exports.updateCommands = function(editor, enabled) {
|
||||
};
|
||||
|
||||
exports.isSupportedMode = function(modeId) {
|
||||
return modeId && /css|less|scss|sass|stylus|html|php|twig|ejs/.test(modeId);
|
||||
return modeId && /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(modeId);
|
||||
};
|
||||
|
||||
var onChangeMode = function(e, target) {
|
||||
|
||||
3
node_modules/ace/lib/ace/worker/worker.js
generated
vendored
3
node_modules/ace/lib/ace/worker/worker.js
generated
vendored
@ -71,7 +71,8 @@ window.require = function(parentId, id) {
|
||||
if (!window.require.tlns)
|
||||
return console.log("unable to load " + id);
|
||||
chunks[0] = window.require.tlns[chunks[0]] || chunks[0];
|
||||
var path = chunks.join("/") + ".js";
|
||||
var path = chunks.join("/");
|
||||
if (path.slice(-3) != ".js") path += ".js";
|
||||
|
||||
window.require.id = id;
|
||||
window.require.modules[id] = {}; // prevent infinite loop on broken modules
|
||||
|
||||
4
node_modules/architect-build/build_support/mini_require.js
generated
vendored
4
node_modules/architect-build/build_support/mini_require.js
generated
vendored
@ -211,6 +211,10 @@ var loadScript = function(path, id, callback) {
|
||||
s.src = path;
|
||||
s.charset = 'utf-8';
|
||||
s.async = true;
|
||||
|
||||
if (path.lastIndexOf(require.MODULE_LOAD_URL, 0) == 0)
|
||||
s.crossOrigin = true;
|
||||
|
||||
head.appendChild(s);
|
||||
|
||||
s.onload = s.onreadystatechange = function(_, isAbort) {
|
||||
|
||||
4
node_modules/c9/package.json
generated
vendored
4
node_modules/c9/package.json
generated
vendored
@ -6,11 +6,11 @@
|
||||
"author": "Cloud9 Inc. <info@c9.io>",
|
||||
|
||||
"dependencies": {
|
||||
"async": "~0.2.7",
|
||||
"async": "~0.9.0",
|
||||
"tmp": "~0.0.20"
|
||||
},
|
||||
|
||||
"scripts": {
|
||||
"test": "for file in *_test.js; do node $file; done"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
package.json
10
package.json
@ -18,6 +18,7 @@
|
||||
"connect": "~2.12.0",
|
||||
"debug": "~0.7.4",
|
||||
"ejs": "~0.8.3",
|
||||
"emmet": "git://github.com/cloud9ide/emmet-core.git#2ff6dc06ad",
|
||||
"engine.io": "~1.5.1",
|
||||
"engine.io-client": "~1.5.1",
|
||||
"eslint": "git://github.com/cloud9ide/eslint.git#e2d052aafd81ea0aa6d1d4fd9f88f3613e386160",
|
||||
@ -28,7 +29,7 @@
|
||||
"msgpack-js": "~0.1.1",
|
||||
"msgpack-js-browser": "~0.1.4",
|
||||
"nak": "",
|
||||
"netutil": "~0.0.1",
|
||||
"netutil": "~0.0.2",
|
||||
"optimist": "~0.6.0",
|
||||
"qs": "0.6.6",
|
||||
"rusha": "~0.7.2",
|
||||
@ -44,8 +45,7 @@
|
||||
"form-data": "~0.2.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"pty.js": "~0.2.3",
|
||||
"heapdump": "0.2.10"
|
||||
"pty.js": "git://github.com/cloud9ide/pty.js.git#10e31e23ed"
|
||||
},
|
||||
"licenses": [],
|
||||
"c9plugins": {
|
||||
@ -65,7 +65,7 @@
|
||||
"c9.ide.find": "#989c06e6a7",
|
||||
"c9.ide.find.infiles": "#f98dfef554",
|
||||
"c9.ide.find.replace": "#e4daf722b8",
|
||||
"c9.ide.run.debug": "#6b7ab83781",
|
||||
"c9.ide.run.debug": "#379e508be6",
|
||||
"c9.automate": "#86bf1ee1ca",
|
||||
"c9.ide.ace.emmet": "#e5f1a92ac3",
|
||||
"c9.ide.ace.gotoline": "#4d1a93172c",
|
||||
@ -96,7 +96,7 @@
|
||||
"c9.ide.recentfiles": "#7c099abf40",
|
||||
"c9.ide.remote": "#cd45e81d2f",
|
||||
"c9.ide.run": "#e510a39b4b",
|
||||
"c9.ide.run.build": "#6726030127",
|
||||
"c9.ide.run.build": "#915e48b363",
|
||||
"c9.ide.run.debug.xdebug": "#b91d23f48b",
|
||||
"c9.ide.save": "#a32a8f4346",
|
||||
"c9.ide.terminal.monitor": "#b0b4d03280",
|
||||
|
||||
@ -689,7 +689,7 @@ define(function(require, exports, module) {
|
||||
* plugin.freezePublicAPI({
|
||||
* doSomething : doSomething
|
||||
* });
|
||||
* });
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* @class Plugin
|
||||
|
||||
@ -33,11 +33,10 @@ function plugin(options, imports, register) {
|
||||
client = clients[client];
|
||||
client._send = client.send;
|
||||
client.send = function(exception, customData, callback, request) {
|
||||
var ex = exception;
|
||||
if (!exception.stack)
|
||||
ex = new Error(exception.message || exception);
|
||||
exception = new Error(exception.message || exception);
|
||||
|
||||
return this._send(ex, customData, callback, request);
|
||||
return this._send.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ define(function(require, module, exports) {
|
||||
}
|
||||
amlTab && amlTab.setAttribute("class", this.names.join(" "));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function initStyleSheet(fg, bg) {
|
||||
var cssClass = plugin.name.replace(/[^a-zA-Z0-9\-_\u00A0-\uFFFF]/g, "-");
|
||||
@ -49,10 +49,14 @@ define(function(require, module, exports) {
|
||||
rule = "." + cssClass + ".curbtn .tab_middle, ."
|
||||
+ cssClass + ".curbtn .tab_middle::after, ."
|
||||
+ cssClass + ".curbtn .tab_middle::before";
|
||||
|
||||
ui.importStylesheet([
|
||||
[rule, "background-color:" + (bg || "inherit") + ";"
|
||||
+ "color:" + (fg || "inherit") + ";"]
|
||||
if (!bg) bg = "inherit";
|
||||
if (!fg) fg = "inherit";
|
||||
|
||||
(
|
||||
ui.setStyleRule(rule, "background-color", bg, stylesheet) &&
|
||||
ui.setStyleRule(rule, "foreground-color", fg, stylesheet)
|
||||
) || ui.importStylesheet([
|
||||
[rule, "background-color:" + bg + ";" + "color:" + fg + ";"]
|
||||
], window, stylesheet);
|
||||
}
|
||||
|
||||
@ -280,6 +284,8 @@ define(function(require, module, exports) {
|
||||
plugin.on("unload", function(e) {
|
||||
closed = true;
|
||||
|
||||
if (rule)
|
||||
ui.removeStyleRule(rule, stylesheet);
|
||||
// If there are no more pages left, reset location
|
||||
var last = amlPane.getPages().length === 0;
|
||||
if (last)
|
||||
|
||||
@ -1419,7 +1419,7 @@ window.TraceKit = TraceKit;
|
||||
|
||||
var blackListedErrors = {
|
||||
'Error with empty message': {},
|
||||
'Script error': {}
|
||||
'Script error.': {}
|
||||
};
|
||||
function processUnhandledException(stackTrace, options) {
|
||||
var stack = [],
|
||||
|
||||
@ -60,7 +60,7 @@ define(function(require, exports, module) {
|
||||
group: "ignore",
|
||||
bindKey: {
|
||||
win: "F12|Ctrl-Shift-I",
|
||||
mac: "F12|Cmd-`|Cmd-R|Cmd-Option-I|Cmd-H|Cmd-M"
|
||||
mac: "F12|Cmd-`|Cmd-Option-I|Cmd-H|Cmd-M"
|
||||
},
|
||||
exec: function(){},
|
||||
passEvent: true,
|
||||
@ -69,8 +69,8 @@ define(function(require, exports, module) {
|
||||
name: "cancelBrowserAction",
|
||||
group: "ignore",
|
||||
bindKey: {
|
||||
mac: "Command-S",
|
||||
win: "Ctrl-S|Alt-Left|Alt-Right",
|
||||
mac: "Command-S|Cmd-R",
|
||||
win: "Ctrl-S|Ctrl-R|Alt-Left|Alt-Right",
|
||||
position: -10000
|
||||
},
|
||||
exec: function(){},
|
||||
@ -308,12 +308,7 @@ define(function(require, exports, module) {
|
||||
|
||||
function getExceptionList(){
|
||||
// Whitelist certain IDE keys for use from terminal and preview
|
||||
return [{
|
||||
bindKey: { win: "F12|Ctrl-Shift-I", mac: "F12|Cmd-`|Cmd-R|Cmd-Option-I|Cmd-H|Cmd-M" },
|
||||
name: "passKeysToBrowser",
|
||||
passEvent: true,
|
||||
exec: function(){}
|
||||
},
|
||||
return [
|
||||
{
|
||||
bindKey: { win: null, mac: "Command-O" },
|
||||
name: "navigateAlt",
|
||||
|
||||
@ -24,7 +24,6 @@ define(function(require, exports, module) {
|
||||
var plugin = new Panel("Ajax.org", main.consumes, {
|
||||
index: options.index || 300,
|
||||
caption: "Commands",
|
||||
elementName: "winCommands",
|
||||
minWidth: 150,
|
||||
autohide: true,
|
||||
where: options.where || "left"
|
||||
@ -69,7 +68,7 @@ define(function(require, exports, module) {
|
||||
|
||||
var treeParent = plugin.getElement("commandsList");
|
||||
txtFilter = plugin.getElement("txtFilter");
|
||||
winCommands = plugin.getElement("winCommands");
|
||||
winCommands = options.aml;
|
||||
|
||||
// Create the Ace Tree
|
||||
tree = new Tree(treeParent.$int);
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
<a:application xmlns:a="http://ajax.org/2005/aml">
|
||||
<a:bar id="winCommands" skin="panel-bar" visible="false">
|
||||
<a:codebox id="txtFilter" realtime="true" skin="codebox" clearbutton="true"
|
||||
focusselect="true" height="27" left="10" top="10" right="10" singleline="true" />
|
||||
<a:bar id="commandsList" style="position:absolute;top:47px;right:10px;left:10px;bottom:0" class="searchresults" />
|
||||
</a:bar>
|
||||
<a:codebox id="txtFilter" realtime="true" skin="codebox" clearbutton="true"
|
||||
focusselect="true" height="27" left="10" top="10" right="10" singleline="true" />
|
||||
<a:bar id="commandsList" style="position:absolute;top:47px;right:10px;left:10px;bottom:0" class="searchresults" />
|
||||
</a:application>
|
||||
@ -17,19 +17,18 @@ define(function(require, module, exports) {
|
||||
var uCaseFirst = require("c9/string").uCaseFirst;
|
||||
|
||||
function Panel(developer, deps, options) {
|
||||
// Panel extends ext.Plugin
|
||||
var plugin = new Plugin(developer, deps);
|
||||
var emit = plugin.getEmitter();
|
||||
|
||||
var autohide = options.autohide || false;
|
||||
var index = options.index || 100;
|
||||
var className = options.className;
|
||||
var buttonCSSClass = options.buttonCSSClass;
|
||||
var panelCSSClass = options.panelCSSClass;
|
||||
var caption = options.caption;
|
||||
var elementName = options.elementName;
|
||||
var width = options.width;
|
||||
var minWidth = options.minWidth;
|
||||
|
||||
var mnuItem, button, area, lastPanel, xpath, where;
|
||||
var mnuItem, button, area, lastPanel, xpath, where, aml;
|
||||
|
||||
plugin.on("load", function(){
|
||||
xpath = "state/panels/" + plugin.name;
|
||||
@ -153,23 +152,27 @@ define(function(require, module, exports) {
|
||||
if (drawn) return false;
|
||||
drawn = true;
|
||||
|
||||
aml = area.aml.appendChild(new ui.bar({
|
||||
"skin": "panel-bar",
|
||||
"class" : panelCSSClass || "",
|
||||
"visible": false
|
||||
}));
|
||||
plugin.addElement(aml);
|
||||
|
||||
emit.sticky("draw", {
|
||||
html: area.container,
|
||||
aml: area.aml
|
||||
html: aml.$int,
|
||||
aml: aml
|
||||
});
|
||||
|
||||
var aml = plugin.getElement(elementName);
|
||||
if (aml) {
|
||||
aml.$ext.style.zIndex = 100;
|
||||
aml.$ext.style.minWidth = ""; //Needed for the anims
|
||||
aml.$ext.style.position = "absolute";
|
||||
aml.$ext.style.left = where == "left" ? area.width + "px" : 0;
|
||||
aml.$ext.style.top = 0;
|
||||
aml.$ext.style.right = where == "right" ? area.width + "px" : 0;
|
||||
aml.$ext.style.bottom = 0;
|
||||
|
||||
aml.$display = apf.CSSPREFIX + "Flex";
|
||||
}
|
||||
aml.$ext.style.zIndex = 100;
|
||||
aml.$ext.style.minWidth = ""; //Needed for the anims
|
||||
aml.$ext.style.position = "absolute";
|
||||
aml.$ext.style.left = where == "left" ? area.width + "px" : 0;
|
||||
aml.$ext.style.top = 0;
|
||||
aml.$ext.style.right = where == "right" ? area.width + "px" : 0;
|
||||
aml.$ext.style.bottom = 0;
|
||||
|
||||
aml.$display = apf.CSSPREFIX + "Flex";
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -178,7 +181,6 @@ define(function(require, module, exports) {
|
||||
area = toArea;
|
||||
|
||||
try {
|
||||
var aml = plugin.getElement(elementName);
|
||||
if (aml)
|
||||
area.aml.appendChild(aml);
|
||||
} catch (e) {}
|
||||
@ -203,7 +205,7 @@ define(function(require, module, exports) {
|
||||
state: true,
|
||||
caption: caption,
|
||||
auto: false,
|
||||
"class" : className || "",
|
||||
"class" : buttonCSSClass || "",
|
||||
onmousedown: function(){
|
||||
panels.areas[where].toggle(plugin.name, autohide, true);
|
||||
},
|
||||
@ -312,8 +314,8 @@ define(function(require, module, exports) {
|
||||
* autohiding panel. The developer is responsible for hiding
|
||||
* the panel. This behavior will animate the panel during
|
||||
* @param hide and show over other panels, if there are any.
|
||||
* @param {String} [options.elementName] Specifies the name of the aml element that renders the panel
|
||||
* @param {String} [options.className] Specifies the name of the css class that is applied to the panel
|
||||
* @param {String} [options.buttonCSSClass] Specifies the name of the css class that is applied to the button
|
||||
* @param {String} [options.panelCSSClass] Specifies the name of the css class that is applied to the panel
|
||||
* @param {Number} [options.width] Specifies the default width of the panel
|
||||
* @param {Number} [options.minWidth] Specifies the minimal width of the panel
|
||||
* @param {String} [options.where] Accepts "left" or "right" to determine where the panel is added
|
||||
@ -350,7 +352,11 @@ define(function(require, module, exports) {
|
||||
* @private
|
||||
* @readonly
|
||||
*/
|
||||
get aml(){ return plugin.getElement(elementName); },
|
||||
get aml(){ return aml; },
|
||||
/**
|
||||
* @property {HTMLElement} container
|
||||
*/
|
||||
get container(){ return aml.$ext; },
|
||||
|
||||
/**
|
||||
* The area that this panel is a part of.
|
||||
|
||||
@ -33,7 +33,7 @@ define(function(require, exports, module) {
|
||||
// var emit = plugin.getEmitter();
|
||||
|
||||
var ENABLED = c9.location.indexOf("debug=2") > -1;
|
||||
var HASSDK = c9.location.indexOf("sdk=1") > -1;
|
||||
var HASSDK = c9.location.indexOf("sdk=0") === -1;
|
||||
|
||||
var loaded = false;
|
||||
function load() {
|
||||
|
||||
@ -20,7 +20,7 @@ define(function(require, exports, module) {
|
||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
// var emit = plugin.getEmitter();
|
||||
|
||||
var HASSDK = c9.location.indexOf("sdk=1") > -1;
|
||||
var HASSDK = c9.location.indexOf("sdk=0") === -1;
|
||||
|
||||
var queue = [];
|
||||
var installing;
|
||||
|
||||
@ -23,7 +23,7 @@ define(function(require, exports, module) {
|
||||
// var emit = plugin.getEmitter();
|
||||
|
||||
var ENABLED = c9.location.indexOf("plugins=0") == -1;
|
||||
var HASSDK = c9.location.indexOf("sdk=1") > -1;
|
||||
var HASSDK = c9.location.indexOf("sdk=0") === -1;
|
||||
|
||||
var plugins = options.plugins;
|
||||
var names = [];
|
||||
|
||||
@ -99,7 +99,8 @@ define(function(require, exports, module) {
|
||||
});
|
||||
// var emit = plugin.getEmitter();
|
||||
|
||||
var HASSDK = c9.location.indexOf("sdk=1") > -1;
|
||||
var HASSDK = c9.location.indexOf("sdk=0") === -1;
|
||||
var ENABLED = c9.location.indexOf("sdk=1") > -1;
|
||||
|
||||
var model, datagrid, filterbox;
|
||||
var btnUninstall, btnReport, btnReadme, btnCloud9;
|
||||
@ -122,14 +123,16 @@ define(function(require, exports, module) {
|
||||
// updateCommandsFromSettings();
|
||||
// }, plugin);
|
||||
|
||||
menus.addItemByPath("File/New Plugin", null, 210, plugin);
|
||||
Object.keys(TEMPLATES).forEach(function(name){
|
||||
menus.addItemByPath("File/New Plugin/" + TEMPLATES[name], new ui.item({
|
||||
onclick: function(){
|
||||
createNewPlugin(name);
|
||||
}
|
||||
}), 210, plugin);
|
||||
});
|
||||
if (ENABLED) {
|
||||
menus.addItemByPath("File/New Plugin", null, 210, plugin);
|
||||
Object.keys(TEMPLATES).forEach(function(name){
|
||||
menus.addItemByPath("File/New Plugin/" + TEMPLATES[name], new ui.item({
|
||||
onclick: function(){
|
||||
createNewPlugin(name);
|
||||
}
|
||||
}), 210, plugin);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var drawn;
|
||||
|
||||
@ -44,7 +44,7 @@ define(function(require, exports, module) {
|
||||
var plugin = new Panel("Ajax.org", main.consumes, {
|
||||
index: options.index || 100,
|
||||
caption: "Workspace",
|
||||
elementName: "winFilesViewer",
|
||||
panelCSSClass: "workspace_files",
|
||||
minWidth: 130,
|
||||
where: options.where || "left"
|
||||
});
|
||||
@ -227,7 +227,7 @@ define(function(require, exports, module) {
|
||||
|
||||
// Fetch UI elements
|
||||
container = plugin.getElement("container");
|
||||
winFilesViewer = plugin.getElement("winFilesViewer");
|
||||
winFilesViewer = options.aml
|
||||
|
||||
// Create the Ace Tree
|
||||
tree = new Tree(container.$int);
|
||||
@ -314,7 +314,6 @@ define(function(require, exports, module) {
|
||||
id: "mnuitemHiddenFiles",
|
||||
type: "check",
|
||||
caption: "Show Hidden Files",
|
||||
visible: "{tree.container.visible}",
|
||||
checked: "user/projecttree/@showhidden",
|
||||
onclick: function(e) {
|
||||
setTimeout(function() {
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
<a:application xmlns:a="http://ajax.org/2005/aml">
|
||||
<a:bar id="winFilesViewer" skin="panel-bar" class="workspace_files">
|
||||
<a:button id="btnTreeSettings"
|
||||
skin="header-btn"
|
||||
class="panel-settings" />
|
||||
<a:menu id="mnuFilesSettings" />
|
||||
<a:menu id="mnuCtxTree" />
|
||||
|
||||
<a:bar id="winOpenfiles" class="openfiles" height="10" visible="false" />
|
||||
<a:bar id="container" class="filetree real" focussable="true" contextmenu="mnuCtxTree" />
|
||||
</a:bar>
|
||||
<a:button id="btnTreeSettings"
|
||||
skin="header-btn"
|
||||
class="panel-settings" />
|
||||
<a:menu id="mnuFilesSettings" />
|
||||
<a:menu id="mnuCtxTree" />
|
||||
|
||||
<a:bar id="winOpenfiles" class="openfiles" height="10" visible="false" />
|
||||
<a:bar id="container" class="filetree real" focussable="true" contextmenu="mnuCtxTree" />
|
||||
</a:application>
|
||||
File diff suppressed because it is too large
Load Diff
@ -636,6 +636,10 @@ define(function(require, module, exports) {
|
||||
*/
|
||||
setStyleRule: apf.setStyleRule,
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
removeStyleRule: apf.removeStyleRule,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
|
||||
2
plugins/c9.login.client/bootstrap.js
vendored
2
plugins/c9.login.client/bootstrap.js
vendored
@ -93,6 +93,8 @@ function loadScript(path, token, callback) {
|
||||
|
||||
var and = path.indexOf("?") >= 0 ? "&" : "?";
|
||||
s.src = path + (token ? and + "access_token=" + encodeURIComponent(token) : "");
|
||||
if (s.src.indexOf("://" + window.location.host) == -1)
|
||||
s.crossOrigin = true;
|
||||
head.appendChild(s);
|
||||
|
||||
s.onload = s.onreadystatechange = function(_, isAbort) {
|
||||
|
||||
@ -166,7 +166,7 @@ define(function(require, exports, module) {
|
||||
var server = servers[i];
|
||||
auth.request(server.url + "/" + options.pid, {
|
||||
method: "POST",
|
||||
timeout: 120000,
|
||||
timeout: 20000,
|
||||
body: {
|
||||
version: version
|
||||
},
|
||||
|
||||
2971
plugins/c9.vfs.extend/collab-server.js
Normal file
2971
plugins/c9.vfs.extend/collab-server.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,71 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
NODE_VERSION=v0.10.21
|
||||
|
||||
cd $HOME
|
||||
mkdir -p .c9/bin
|
||||
mkdir -p .c9/node_modules
|
||||
cd .c9
|
||||
|
||||
rm -rf node
|
||||
rm -rf node-$NODE_VERSION*
|
||||
|
||||
echo :Installing Node $NODE_VERSION
|
||||
echo Downloading Node $NODE_VERSION...
|
||||
curl -sSOL http://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-darwin-x64.tar.gz
|
||||
tar xvfz node-$NODE_VERSION-darwin-x64.tar.gz
|
||||
mv node-$NODE_VERSION-darwin-x64 node
|
||||
rm node-$NODE_VERSION-darwin-x64.tar.gz
|
||||
|
||||
NPM=$HOME/.c9/node/bin/npm
|
||||
NODE=$HOME/.c9/node/bin/node
|
||||
|
||||
echo :Installing pty.js
|
||||
$NPM install pty.js
|
||||
echo :Installing Nak
|
||||
$NPM install https://github.com/c9/nak/tarball/ea1299a3688f307d2269c93bd9692101eb4f262e
|
||||
echo :Installing Coffee Script
|
||||
$NPM install coffee
|
||||
echo :Installing Less
|
||||
$NPM install less
|
||||
echo :Installing Sass
|
||||
$NPM install sass
|
||||
echo :Installing TypeScript
|
||||
$NPM install typescript
|
||||
|
||||
echo :Correcting Paths
|
||||
for FILE in $HOME/.c9/node_modules/.bin/*
|
||||
do
|
||||
perl -i -p -e 's/#!\/usr\/bin\/env node/#!'${NODE//\//\\\/}'/' $(readlink $FILE)
|
||||
done
|
||||
|
||||
echo :Installing TMUX
|
||||
echo Downloading TMUX 1.6...
|
||||
curl -sSOL http://downloads.sourceforge.net/tmux/tmux-1.6.tar.gz
|
||||
echo Downloading Libevent 2.0...
|
||||
curl -sSOL http://downloads.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.16-stable.tar.gz
|
||||
|
||||
# Unpack the sources
|
||||
|
||||
tar xzf tmux-1.6.tar.gz
|
||||
tar xzf libevent-2.0.16-stable.tar.gz
|
||||
|
||||
# Compiling libevent
|
||||
|
||||
cd libevent-2.0.16-stable
|
||||
./configure --prefix=/opt
|
||||
make
|
||||
#sudo make install
|
||||
|
||||
# Compiling tmux
|
||||
|
||||
cd ../tmux-1.6
|
||||
LDFLAGS="-L/opt/lib" CPPFLAGS="-I/opt/include" LIBS="-lresolv" ./configure --prefix=/opt
|
||||
make
|
||||
#sudo make install
|
||||
|
||||
mkdir -p ~/.c9/bin
|
||||
cp ./tmux ~/.c9/bin/tmux
|
||||
|
||||
echo 1 > $HOME/.c9/installed
|
||||
echo :Done.
|
||||
@ -69,7 +69,7 @@ updateAllPackages() {
|
||||
for m in ${c9packages[@]}; do echo $m;
|
||||
i=$(($i + 1))
|
||||
echo "updating plugin ${blue}$i${resetColor} of ${blue}$count${resetColor}"
|
||||
updatePackage $m || true
|
||||
updatePackage $m
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,10 @@ function main(config, settings, options, callback) {
|
||||
|
||||
var plugins = require(config)(settings, optimist(process.argv))
|
||||
.map(function(plugin) {
|
||||
if (typeof plugin == "string")
|
||||
plugin = { packagePath: plugin };
|
||||
plugin.packaging = true;
|
||||
|
||||
if (plugin.packagePath == "connect-architect/connect") {
|
||||
plugin.packagePath = "./c9.static/connect";
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ module.exports = function(manifest, installPath, settingDir) {
|
||||
var fs = require("fs");
|
||||
|
||||
if (typeof installPath != "string") {
|
||||
installPath = process.platform == "darwin"
|
||||
installPath = process.platform == "darwin" && false // disabled for sdk
|
||||
? "/Library/Application Support/Cloud9"
|
||||
: path.join(process.env.HOME, ".c9");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user