Merge remote-tracking branch 'origin/master' into clone-workspaces

This commit is contained in:
Tim Robinson 2015-04-13 10:00:48 +00:00
parent 0a6b1e4442
commit 39ffe96559
34 changed files with 455 additions and 95 deletions

4
.gitignore vendored
View File

@ -1,5 +1,6 @@
build/installer/
build/win32
build/sdk
build/win32*
build/node.exe
build/node*.zip
build/Cloud9-dev.app
@ -77,3 +78,4 @@ plugins/c9.proxy/haproxy-*
npm-debug.log
foo.js
hello.js
plugins/c9.docker/containers/ci/files/github_c9_newclient

View File

@ -1,6 +1,5 @@
var assert = require("assert");
module.exports = function(options) {
assert(options.staticPrefix, "Option 'staticPrefix' must be set");
assert(options.workspaceDir, "Option 'workspaceDir' must be set");
@ -47,6 +46,7 @@ module.exports = function(options) {
env: options.env || "devel",
home: options.home,
platform: options.platform,
arch: options.arch,
installed: options.installed,
projectId: options.project.id,
projectName: options.projectName || "Project",
@ -92,7 +92,6 @@ module.exports = function(options) {
"plugins/c9.vfs.client/vfs.ping",
{
packagePath: "plugins/c9.vfs.client/vfs_client",
withInstall: false,
debug: debug,
installPath: options.installPath,
dashboardUrl: options.dashboardUrl,
@ -223,7 +222,10 @@ module.exports = function(options) {
autoInit: !options.local
},
"plugins/c9.ide.ui/forms",
"plugins/c9.ide.ui/widgets.list",
{
packagePath: "plugins/c9.ide.ui/widgets.list",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
"plugins/c9.ide.ui/widgets.tree",
"plugins/c9.ide.ui/widgets.datagrid",
"plugins/c9.ide.ui/focus",
@ -495,7 +497,28 @@ module.exports = function(options) {
},
"plugins/c9.ide.panels/panel",
"plugins/c9.ide.panels/area",
"plugins/c9.ide.installer/installer_mock",
// Installer
{
packagePath: "plugins/c9.ide.installer/gui",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
},
"plugins/c9.automate/automate",
"plugins/c9.ide.installer/commands/centos",
"plugins/c9.ide.installer/commands/bash",
"plugins/c9.ide.installer/commands/npm",
"plugins/c9.ide.installer/commands/symlink",
{
packagePath: "plugins/c9.ide.installer/commands/tar.gz",
bashBin: options.bashBin
},
"plugins/c9.ide.installer/commands/ubuntu",
{
packagePath: "plugins/c9.ide.installer/installer",
homeDir: options.homeDir,
installSelfCheck: true,
installPath: options.installPath
},
// Previewer
{

View File

@ -139,6 +139,7 @@ module.exports = function(config, optimist) {
whitelist: {
"c9.core": true,
"c9.fs": true,
"c9.automate": true,
"c9.login.client": true,
"c9.vfs.client": true,
"c9.cli.bridge": true,

View File

@ -319,7 +319,6 @@ var DataProvider = function(root) {
index = Math.min(Math.max(0, index), this.visibleItems.length - 1);
return this.visibleItems[index];
};
this.getIconHTML = function(node) {
return "";
};

View File

@ -98,6 +98,7 @@ var Cells = function(parentEl) {
? (provider.isOpen(datarow) ? "open" : "closed")
: "empty")
+ "'></span>"
+ (provider.getCheckboxHTML ? provider.getCheckboxHTML(datarow) : "")
+ provider.getIconHTML(datarow)
+ ( provider.getContentHTML ? provider.getContentHTML(datarow)
: "<span class='caption' style='width: " + hsize + "px;height: " + vsize + "px'>"

View File

@ -136,6 +136,14 @@ function DefaultHandlers(mouseHandler) {
}
}
this.$clickNode = null;
} else if (dom.hasCssClass(target, "checkbox")) {
node.isChecked = !node.isChecked;
if (inSelection) {
var nodes = editor.selection.getSelectedNodes();
nodes.forEach(function(n){ n.isChecked = node.isChecked });
}
provider._signal(node.isChecked ? "check" : "uncheck", inSelection ? nodes : [node]);
provider._signal("change")
} else if (dom.hasCssClass(target, "icon-ok")) {
if (ev.getShiftKey()) {
editor.selection.expandSelection(node, null, true);

4
node_modules/vfs-local/localfs.js generated vendored
View File

@ -211,7 +211,7 @@ module.exports = function setup(fsOptions) {
var args = Array.prototype.slice.apply(arguments);
var d = domain.create();
d.on("error", function(e) {
console.error("VFS Exception in function '" + func + "':\n" + e.stack);
console.error("VFS Exception in function '" + func + "':\n", (e.stack || e));
vfs.emit("error", {
message: e.message,
func: func,
@ -220,7 +220,7 @@ module.exports = function setup(fsOptions) {
});
console.log("Scheduling process exit");
setTimeout(function() {
console.log("Exiting after uncaught exception in '" + func + "':\n" + e.stack)
console.log("Exiting after uncaught exception in '" + func + "':\n", (e.stack || e))
process.exit(1);
}, 2000);
});

View File

@ -93,7 +93,7 @@
"c9.ide.pubsub": "#92ec19ed3a",
"c9.ide.readonly": "#f6f07bbe42",
"c9.ide.recentfiles": "#7c099abf40",
"c9.ide.remote": "#301d2ab519",
"c9.ide.remote": "#cd45e81d2f",
"c9.ide.processlist": "#bc11818bb5",
"c9.ide.run": "#567ad01865",
"c9.ide.run.build": "#ad45874c88",

View File

@ -740,10 +740,29 @@ define(function(require, exports, module) {
var err = code !== 0
? new Error("Failed to unpack package")
: null;
if (err) return callback(err);
// Done
callback(err, {
version: version
proc.spawn(join(process.env.HOME, ".c9/node/bin/npm"), {
args: ["install"],
cwd: packagePath
}, function(err, p){
if (err) return callback(err);
if (verbose) {
p.stdout.on("data", function(c){
process.stdout.write(c.toString("utf8"));
});
p.stderr.on("data", function(c){
process.stderr.write(c.toString("utf8"));
});
}
p.on("exit", function(code){
// Done
callback(err, {
version: version
});
});
});
});
});

View File

@ -24,6 +24,7 @@ define(function(require, module, exports) {
var loaded = false;
var loggedIn = false;
var isReady = false;
var state = 0;
var STORAGE = 1 << 1;
@ -109,6 +110,7 @@ define(function(require, module, exports) {
}
function ready(){
isReady = true;
emit.sticky("ready");
}
@ -284,6 +286,10 @@ define(function(require, module, exports) {
*/
get startLoadTime(){ return startLoadTime; },
set startLoadTime(v){ startLoadTime = v; },
/**
*
*/
get isReady(){ return isReady; },
_events: [
/**

View File

@ -0,0 +1,7 @@
function onClick() {
say("hi");
}
function say(text) {
alert(text);
}

View File

@ -28,4 +28,4 @@ var i = 0;
console.log(greeter(user), Date.now(), i++);
setInterval(function(){
console.log(greeter(user), Date.now(), i++);
}, 1000);
}, 10000);

View File

@ -7,11 +7,14 @@ define(function(require, exports, module) {
var vfs = imports.vfs;
var Plugin = imports.Plugin;
var ProcessToPty = require("./proc2pty");
/***** Initialization *****/
var plugin = new Plugin("Ajax.org", main.consumes);
var emit = plugin.getEmitter();
var installMode;
var tmuxName = options.tmuxName;
/***** Register and define API *****/
@ -171,6 +174,15 @@ define(function(require, exports, module) {
* @singleton
**/
plugin.freezePublicAPI({
/**
* @ignore
*/
get installMode(){ return installMode; },
set installMode(_vfs) {
vfs = _vfs || imports.vfs;
installMode = _vfs ? true : false;
},
_events: [
/**
* @event beforeSpawn Fires right before a file is executed
@ -334,6 +346,14 @@ define(function(require, exports, module) {
* @fires afterPty
*/
pty: function(path, options, callback) {
if (installMode) {
plugin.spawn(path, options, function(err, process){
if (err) return callback(err);
callback(null, new ProcessToPty(process));
});
return;
}
emit("beforePty", {path: path, options: options});
if (!options.encoding)

27
plugins/c9.fs/proc2pty.js Normal file
View File

@ -0,0 +1,27 @@
define(function(require, exports, module) {
var EventEmitter = require("events").EventEmitter;
module.exports = function(process){
var pty = new EventEmitter();
pty.write = function(data){
process.stdin.write(data);
};
pty.resize = function(){};
pty.destroy =
pty.end = function(){
process.kill();
};
process.stdout.on("data", function(chunk){
pty.emit("data", chunk);
});
process.stderr.on("data", function(chunk){
pty.emit("data", chunk);
});
process.on("exit", function(code){
pty.emit("exit", code);
});
return pty;
}
});

View File

@ -534,7 +534,7 @@ define(function(require, exports, module) {
editor = apf.activeElement;
if (!isAce(editor, true))
return false;
if (!editor.ace.commands.byName[command.name])
if (!editor.ace.commands.byName[command.name] && !command.shared)
return false;
return isAvailable ? isAvailable(editor.ace) : true;
@ -582,7 +582,29 @@ define(function(require, exports, module) {
commands.addCommand(commands.commands.togglerecording, handle);
commands.addCommand(commands.commands.replaymacro, handle);
// when event for cmd-z in textarea is not canceled
// chrome tries to find another textarea with pending undo and focus it
// we do not want this to happen when ace instance is focused
commands.addCommand(fnWrap({
name: "cancelBrowserUndoInAce",
bindKey: {
mac: "Cmd-Z|Cmd-Shift-Z|Cmd-Y",
win: "Ctrl-Z|Ctrl-Shift-Z|Ctrl-Y",
position: -10000
},
group: "ignore",
exec: function(e) {},
readOnly: true,
shared: true
}), handle);
function sharedCommand(command) {
command.isAvailable = function(editor) {
return editor && editor.type == "ace";
};
command.group = "Code Editor";
return command;
}
commands.addCommand(sharedCommand({
name: "syntax",
exec: function(_, syntax) {
if (typeof syntax == "object")
@ -597,7 +619,7 @@ define(function(require, exports, module) {
commands: modes.caption
}), handle);
commands.addCommand(fnWrap({
commands.addCommand(sharedCommand({
name: "largerfont",
bindKey: { mac : "Command-+|Command-=", win : "Ctrl-+|Ctrl-=" },
exec: function(e) {
@ -606,7 +628,7 @@ define(function(require, exports, module) {
}
}), handle);
commands.addCommand(fnWrap({
commands.addCommand(sharedCommand({
name: "smallerfont",
bindKey: { mac : "Command--", win : "Ctrl--" },
exec: function(e) {
@ -615,16 +637,13 @@ define(function(require, exports, module) {
}
}), handle);
commands.addCommand({
commands.addCommand(sharedCommand({
name: "toggleWordWrap",
bindKey: {win: "Ctrl-Q", mac: "Ctrl-W"},
exec: function(editor) {
editor.setOption("wrap", editor.getOption("wrap") == "off");
},
isAvailable: function(editor) {
return editor && editor.type == "ace";
}
}, handle);
}), handle);
}
/***** Preferences *****/

View File

@ -67,26 +67,21 @@ define(function(require, module, exports) {
var left = options.left;
var top = options.top;
var width = options.width || 512;
var height = options.height;
var title = options.title;
var heading = options.heading;
var body = options.body;
var custom = options.custom;
var className = options.class;
var modal = options.modal;
var zindex = options.zindex;
var allowClose = options.allowClose;
var elements = options.elements || [];
var resizable = options.resizable || false;
var resizable = false;
var widths = options.widths || {};
var count = 0;
var dialog, buttons, titles;
var loaded;
function load(){
if (loaded) return;
loaded = true;
}
var drawn = false;
function draw(htmlNode) {
if (drawn) return;
@ -101,9 +96,13 @@ define(function(require, module, exports) {
modal: modal,
buttons: allowClose ? "close" : "",
width: width,
height: height,
zindex: zindex || "",
skin: "bk-window2",
class: "relative" + (options.dark ? " dark" : ""),
class: "dialog "
+ (height ? "" : "relative")
+ (options.dark ? " dark" : "")
+ (className ? " " + className : ""),
childNodes: [
new ui.vbox({
id: "titles",
@ -162,8 +161,8 @@ define(function(require, module, exports) {
html: titles.$int
});
if (resizable)
plugin.resizable = resizable;
if (options.resizable)
plugin.resizable = options.resizable;
}
/***** Method *****/
@ -359,6 +358,11 @@ define(function(require, module, exports) {
return node;
}
plugin.on("unload", function(){
drawn = false;
resizable = false;
});
/***** Register and define API *****/
plugin.freezePublicAPI.baseclass();
@ -437,13 +441,20 @@ define(function(require, module, exports) {
resizable = v;
if (!dialog) return;
dialog.setAttribute("height", v ? dialog.getHeight() : "");
dialog.setAttribute("width", v ? dialog.getWidth() : "");
dialog.setAttribute("class", v ? "" : "relative");
titles.setAttribute("anchors", v ? "0 0 46 0" : "");
buttons.setAttribute("bottom", v ? "0" : "");
buttons.setAttribute("left", v ? "0" : "");
buttons.setAttribute("right", v ? "0" : "");
if (!height)
dialog.setAttribute("height", v ? dialog.getHeight() : "");
if (!width)
dialog.setAttribute("width", v ? dialog.getWidth() : "");
dialog.setAttribute("class", "dialog "
+ (v ? "" : "relative")
+ (options.dark ? " dark" : "")
+ (className ? " " + className : ""));
// titles.setAttribute("anchors", v ? "0 0 46 0" : "");
// buttons.setAttribute("bottom", v ? "0" : "");
// buttons.setAttribute("left", v ? "0" : "");
// buttons.setAttribute("right", v ? "0" : "");
dialog.setAttribute("resizable", v);
},
/**
@ -465,6 +476,11 @@ define(function(require, module, exports) {
* @readonly
*/
get modal(){ return modal; },
/**
* @property {Boolean} visible
* @readonly
*/
get visible(){ return dialog && dialog.visible; },
/**
* @property {Boolean} allowClose
*/

View File

@ -129,4 +129,21 @@
right: 20px;
top: 25px;
}
.bk-window.dialog .bk-container{
display: flex;
flex-direction: column;
}
.bk-window.dialog .bk-container > div:first-child{
flex: 1;
position: relative;
}
.bk-window.wizard .bk-container > div:first-child > div{
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
padding: 20px;
}

View File

@ -1599,11 +1599,11 @@
// Installer
@installer-font-smoothing: true;
@installer-background: #272727;
@installer-border-top: 1px solid rgba(255, 255, 255, 0.1);
@installer-box-shadow: 0 -1px black;
@installer-color: rgb(182, 182, 182);
@installer-text-shadow: 1px 1px 0 rgb(10, 10, 10);
@installer-background: transparent;
@installer-border-top: 0;
@installer-box-shadow: none;
@installer-color: #333;
@installer-text-shadow: none;
@installer-font-family: Arial;
@installer-log-color: #fff;
@ -1612,7 +1612,7 @@
@installer-log-border-color: rgba(255,255,255,0.06) rgba(0,0,0,0.3) rgba(0,0,0,0.3) rgba(255,255,255,0.06);
@installer-log-border-radius: 0;
@installer-log-box-shadow: 1px 0 0 rgba(255,255,255,0.06), 0 1px 0 rgba(255,255,255,0.06), -1px 0 0 rgba(0,0,0,0.3), 0 -1px 0 rgba(0,0,0,0.3);
@installer-log-checkbox-color: #f1f1f1;
@installer-log-checkbox-color: #333;
@installer-log-progress-color: white;
// Notification

View File

@ -1599,11 +1599,11 @@
// Installer
@installer-font-smoothing: true;
@installer-background: #272727;
@installer-border-top: 1px solid rgba(255, 255, 255, 0.1);
@installer-box-shadow: 0 -1px black;
@installer-color: rgb(182, 182, 182);
@installer-text-shadow: 1px 1px 0 rgb(10, 10, 10);
@installer-background: transparent;
@installer-border-top: 0;
@installer-box-shadow: none;
@installer-color: #333;
@installer-text-shadow: none;
@installer-font-family: Arial;
@installer-log-color: #fff;
@ -1612,7 +1612,7 @@
@installer-log-border-color: rgba(255,255,255,0.06) rgba(0,0,0,0.3) rgba(0,0,0,0.3) rgba(255,255,255,0.06);
@installer-log-border-radius: 0;
@installer-log-box-shadow: 1px 0 0 rgba(255,255,255,0.06), 0 1px 0 rgba(255,255,255,0.06), -1px 0 0 rgba(0,0,0,0.3), 0 -1px 0 rgba(0,0,0,0.3);
@installer-log-checkbox-color: #f1f1f1;
@installer-log-checkbox-color: #333;
@installer-log-progress-color: white;
// Notification

View File

@ -390,6 +390,27 @@
padding : 5px 3px 1px 5px;
}
.ace_tree .tree-row .checkbox{
outline: 1px solid rgba(0, 0, 0, 0.16);
background: white;
width: 13px;
height: 13px;
margin: -2px 5px 0 0px;
display: inline-block;
vertical-align: middle;
pointer-events: auto;
}
.ace_tree .tree-row .checkbox.checked{
background-position: -2px -2px;
}
.ace_tree .tree-row .checkbox.half-checked{
background-color: #DDDDDD;
background-position: -2px -2px;
}
.installer .execute .progress{
bottom: -44px;
}
@media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 1.25dppx) {
.listBP .checked .checkbox {
background-position: 0px -61px !important;

View File

@ -0,0 +1,121 @@
/**
* Stub for collecting workspace/service metrics.
*
* For logging metrics to a service like datadog.
*
* Actual metrics are implemented by an external plugin that has
* many dependencies, including dependencies on VFS.
* VFS and other plugins have dependencies on "metrics".
* This stub plugin breaks the dependency cycle.
*/
define(function(require, exports, module) {
"use strict";
main.consumes = ["Plugin"];
main.provides = ["metrics"];
return main;
/**
* Collects workspace/service metrics.
*/
function main(options, imports, register) {
var Plugin = imports.Plugin;
var plugin = new Plugin("Ajax.org", main.consumes);
var api;
var delayedCalls = [];
var apiFunction = options.hosted
? function(apiName, varArgs) {
var args = [].slice.apply(arguments);
if (!api)
return arguments[1] && delayedCalls.push(args);
var name = args.shift();
return api[name].apply(api, args);
}
: function() {};
function publishApi(newApi) {
api = newApi;
delayedCalls.forEach(function(args) {
var name = args.shift();
api[name].apply(api, args);
});
delayedCalls = [];
}
plugin.freezePublicAPI({
/**
* @internal @ignore
*/
$publishApi: publishApi,
$setRequestApi: apiFunction.bind(null, "$setRequestApi"),
/**
* Increment a metric value for this user/workspace,
* e.g. increment the number of times the user was disconnected by 1.
*
* These metrics get logged to a service like datadog,
* namespaced in c9.ide.metrics.
*
* Example:
*
* metrics.increment("disconnected", 1, true);
*
* @param {String} name
* @param {Number} [value]
* @param {Boolean} [now]
* Whether to send it within 50ms (or
* when we have a connection) or some time between now
* and up to 5 min or so.
*/
increment: apiFunction.bind(null, "increment"),
/**
* Set a metric value for this user/workspace,
* e.g. the time it takes to load this workspace.
*
* These metrics get logged to a service like datadog,
* namespaced in c9.ide.metrics.
*
* Example:
*
* metrics.log("load_workspace", Date.now() - start, [500, 1000, 5000]);
*
* @param {String} name
* @param {Number} value
* @param {Number[]} [levels]
* If specified, splits up the metric into different levels, e.g.
* for [500, 1000, 5000], a 'value' of 600 would
* log a load_workspace_500 metric. A 'value' of 6000
* would log a load_workspace_over_5000 metric.
* @param {Boolean} [now]
* Whether to send within 50ms (or
* when we have a connection) or some time between now
* and up to 5 min or so.
*/
log: apiFunction.bind(null, "log"),
/**
* Get the latest metrics collected, or null if not available yet.
*
* @internal
* @ignore
* @return {Number}
*/
getLatest: apiFunction.bind(null, "getLatest"),
/**
* Get the last vfs ping time.
*
* @return {Object}
*/
getLastPing: apiFunction.bind(null, "getLastPing"),
});
register(null, { metrics: plugin });
}
});

@ -1 +0,0 @@
Subproject commit 35a5dedaeb20cf6f8a9f1021de23d8dd96860f11

View File

@ -778,7 +778,7 @@ define(function(require, exports, module) {
+ "installed. Would you like to open the installer "
+ "to update to the latest version?",
function(){ // Yes
installer.show();
installer.reinstall("Cloud9 IDE");
},
function(){ // No
// Do nothing

View File

@ -8,7 +8,7 @@ define(function(require, module, exports) {
require("plugins/c9.ide.ui/codebox")(imports.apf);
var settings;
var packed = require("text!./style.css").length === 0;
var packed = require("text!./style.less").length === 0;
var less = require("./lib_less1.5");
if (less) less.async = true;
var packedThemes = packed || options.packedThemes !== false;

View File

@ -16,9 +16,10 @@ define(function(require, exports, module) {
if (!options) throw new Error("options are required");
if (!options.baseName)
options.baseName = "tree";
options.baseName = "datagrid";
if (!options.theme)
options.theme = "blackdg";
options.theme = "blackdg ace-tree-" + (options.baseName || "datagrid");
var model = new TreeModel();
model.columns = options.columns;

View File

@ -1,7 +1,7 @@
.custom-tree.ace_tree {
background: transparent;
border: none;
font: 11px Tahoma, Arial;
// font: @general-font-size @general-font-family;
.font-smoothing(@tree-font-smoothing)
}
@ -43,6 +43,25 @@
line-height: 1.5em;
}
.ace_tree .tree-row .checkbox{
outline: 1px solid rgba(255, 255, 255, 0.35);
background: #2D2D2D;
width: 13px;
height: 13px;
margin: 1px 5px 0 0px;
display: inline-block;
vertical-align: middle;
pointer-events: auto;
}
.ace_tree .tree-row .checkbox.checked{
background-image: url("@{image-path}/@{menu-check}");
background-position: -2px -18px;
}
.ace_tree .tree-row .checkbox.half-checked{
background-color: #565656;
background-position: -2px -18px;
}
.custom-tree.ace_tree .tree-row .toggler{
.image-2x("@{tree-arrow}", 20px, 10px);
margin: 0 1px 0 0;

View File

@ -19,7 +19,7 @@ define(function(require, exports, module) {
};
ui.on("load", function(){
ui.insertCss(require("text!./widgets.less"), ui);
ui.insertCss(require("text!./widgets.less"), options.staticPrefix, ui);
});
/***** Constructors *****/
@ -56,6 +56,7 @@ define(function(require, exports, module) {
? new TreeModel()
: new ListModel());
model.filterCaseInsensitive = true;
model.$sortNodes = false;
if (!options.rowHeight)
options.rowHeight = 23;
@ -80,12 +81,14 @@ define(function(require, exports, module) {
scrollbarVisibilityChanged: acetree.renderer,
resize: acetree.renderer,
expand: model,
collapse: model
collapse: model,
check: model,
uncheck: model
};
emit.sticky("draw");
}
plugin.on("load", function(){
if (options.container)
plugin.attachTo(options.container);
@ -254,6 +257,35 @@ define(function(require, exports, module) {
? new AceTreeEditor(acetree)
: null;
},
/**
*
*/
get enableCheckboxes(){ return model.getCheckboxHTML ? true : false; },
set enableCheckboxes(value){
model.getCheckboxHTML = value
? function(node){
return "<span class='checkbox "
+ (node.isChecked == -1
? "half-checked "
: (node.isChecked ? "checked " : ""))
+ "'></span>";
}
: null;
if (value) {
acetree.commands.bindKey("Space", function(e) {
var nodes = acetree.selection.getSelectedNodes();
var node = acetree.selection.getCursor();
node.isChecked = !node.isChecked;
nodes.forEach(function(n){ n.isChecked = node.isChecked });
model._signal(node.isChecked ? "check" : "uncheck", nodes);
model._signal("change");
});
}
else {
acetree.commands.bindKey("Space", null);
}
},
/**
*
*/
@ -339,11 +371,16 @@ define(function(require, exports, module) {
*/
get getIconHTML(){ return model.getIconHTML; },
set getIconHTML(fn){ model.getIconHTML = fn; },
/**
*
*/
get getCheckboxHTML(){ return model.getCheckboxHTML; },
set getCheckboxHTML(fn){ model.getCheckboxHTML = fn; },
/**
*
*/
get sort(){ return model.sort; },
set sort(fn){
set sort(fn){ debugger;
model.$sortNodes = fn ? true : false;
model.$sorted = fn ? true : false;
model.sort = fn;
@ -417,6 +454,14 @@ define(function(require, exports, module) {
* @event afterRename Fires
*/
"afterRename",
/**
* @event check Fires
*/
"check",
/**
* @event uncheck Fires
*/
"uncheck",
/**
* @event select Fires
*/
@ -494,6 +539,22 @@ define(function(require, exports, module) {
disable: function(){
return acetree.enable();
},
/**
*
*/
check: function(node, half){
node.isChecked = half ? -1 : true;
model._signal("check", node);
model._signal("change");
},
/**
*
*/
uncheck: function(node){
node.isChecked = false;
model._signal("uncheck", node);
model._signal("change");
},
/**
*
*/

View File

@ -1,9 +1,3 @@
/**
* Smith.io client
*
* @copyright 2013, Ajax.org B.V.
*/
define(function(require, exports, module) {
"use strict";
@ -58,7 +52,6 @@ define(function(require, exports, module) {
errorDialog.vfs = plugin;
var buffer = [];
var installChecked = false;
var withInstall = options.withInstall;
var dashboardUrl = options.dashboardUrl;
var region, vfsBaseUrl, homeUrl, projectUrl, pingUrl, serviceUrl;
@ -287,13 +280,8 @@ define(function(require, exports, module) {
return;
}
if (!installChecked) {
checkInstall(_vfs, callback);
installChecked = true;
}
else {
if (emit("beforeConnect", { done: callback, vfs: _vfs }) !== false)
callback();
}
function callback(shouldReconnect) {
if (shouldReconnect) {
@ -320,19 +308,6 @@ define(function(require, exports, module) {
});
}
function checkInstall(vfs, callback) {
if (!withInstall)
return callback(false);
vfs.stat(options.installPath + "/installed", {}, function(err, stat) {
if (err && err.code == "ENOENT") {
emit.sticky("install", { callback: callback, vfs: vfs });
}
else
callback();
});
}
var bufferedVfsCalls = [];
function vfsCall(method, path, options, callback) {
if (Array.isArray(method))
@ -354,7 +329,6 @@ define(function(require, exports, module) {
id = null;
buffer = [];
installChecked = false;
region = null;
vfsBaseUrl = null;
homeUrl = null;

View File

@ -226,7 +226,7 @@ function plugin(options, imports, register) {
options._projects = [options.workspaceDir];
}
var wd = options._projects[pid] || options._projects[0];
console.log(user)
return {
workspaceDir: wd,
extendOptions: {
@ -316,7 +316,6 @@ function getConfig(requested, options) {
try {
data = fs.readFileSync(settings[type], "utf8");
} catch (e) {
console.log(e);
}
settings[type] = data;
}

View File

@ -35,6 +35,7 @@
app.on("ready", function(){
// if (app.services.c9.debug)
window.app = app.services;
app.services.c9.ready();
});
});
});

View File

@ -400,6 +400,7 @@ require([
console.warn(msg);
}
},
"installer": { createSession : function(){}, reinstall: function(){} },
"run.gui": { getElement : function(){} },
"debugger": {debug: function() {}, stop: function(){}},
"focusManager": {
@ -412,9 +413,6 @@ require([
getLastest: function() { throw Error("Not implemented"); },
},
error_handler: {reportError: function(){}},
installer: {
show: function(){}
},
proc: {
execFile: function() {},
spawn: function() {}

View File

@ -93,7 +93,7 @@ updateCore() {
}
installGlobalDeps() {
if ! [[ -f ~/.c9/installed ]]; then
if ! [[ -f ~/.c9/installed ]] && ! [[ $os == "windows" ]]; then
curl https://raw.githubusercontent.com/c9/install/master/install.sh | bash
fi
}

View File

@ -44,6 +44,7 @@ module.exports = function(manifest, installPath) {
host: process.env.IP || "0.0.0.0",
testing: false,
platform: process.platform,
arch: process.arch,
tmux: path.join(installPath, "bin/tmux"),
nakBin: path.join(__dirname, "../node_modules/nak/bin/nak"),
bashBin: "bash",