A working installer

pull/64/head
Ruben Daniels 2015-03-31 22:17:41 +00:00 zatwierdzone przez nightwing
rodzic cc9334a30e
commit 71bfc0da7f
9 zmienionych plików z 104 dodań i 24 usunięć

Wyświetl plik

@ -502,7 +502,10 @@ module.exports = function(options) {
"plugins/c9.ide.installer/commands/bash",
"plugins/c9.ide.installer/commands/npm",
"plugins/c9.ide.installer/commands/symlink",
"plugins/c9.ide.installer/commands/tar.gz",
{
packagePath: "plugins/c9.ide.installer/commands/tar.gz",
bashBin: options.bashBin
},
"plugins/c9.ide.installer/commands/ubuntu",
{
packagePath: "plugins/c9.ide.installer/installer",

Wyświetl plik

@ -137,10 +137,12 @@ function DefaultHandlers(mouseHandler) {
}
this.$clickNode = null;
} else if (dom.hasCssClass(target, "checkbox")) {
var nodes = editor.selection.getSelectedNodes();
node.isChecked = !node.isChecked;
nodes.forEach(function(n){ n.isChecked = node.isChecked });
provider._signal(node.isChecked ? "check" : "uncheck", nodes);
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()) {

Wyświetl plik

@ -77,13 +77,13 @@
"c9.ide.behaviors": "#6aad7006a0",
"c9.ide.closeconfirmation": "#a28bfd8272",
"c9.ide.configuration": "#b8470f4107",
"c9.ide.dialog.wizard": "#3641096e13",
"c9.ide.dialog.wizard": "#e03db0af98",
"c9.ide.fontawesome": "#781602c5d8",
"c9.ide.format": "#f51451ac57",
"c9.ide.help.support": "#60e88f5680",
"c9.ide.imgeditor": "#08bbc53578",
"c9.ide.immediate": "#6845a93705",
"c9.ide.installer": "#f996c8aa17",
"c9.ide.installer": "#a04eed6a5f",
"c9.ide.mount": "#32e79866ee",
"c9.ide.navigate": "#64156c7f4a",
"c9.ide.newresource": "#9a7464cc47",

Wyświetl plik

@ -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)

Wyświetl plik

@ -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;
}
});

Wyświetl plik

@ -71,24 +71,17 @@ define(function(require, module, exports) {
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;
@ -168,8 +161,8 @@ define(function(require, module, exports) {
html: titles.$int
});
if (resizable)
plugin.resizable = resizable;
if (options.resizable)
plugin.resizable = options.resizable;
}
/***** Method *****/
@ -365,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();
@ -443,12 +441,16 @@ define(function(require, module, exports) {
resizable = v;
if (!dialog) return;
dialog.setAttribute("height", v ? dialog.getHeight() : "");
dialog.setAttribute("width", v ? dialog.getWidth() : "");
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" : "");

Wyświetl plik

@ -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;

Wyświetl plik

@ -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(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: white url("@{image-path}/@{menu-check}");
background-position: -2px -2px;
}
.ace_tree .tree-row .checkbox.half-checked{
background: #DDDDDD url("@{image-path}/@{menu-check}");
background-position: -2px -2px;
}
.custom-tree.ace_tree .tree-row .toggler{
.image-2x("@{tree-arrow}", 20px, 10px);
margin: 0 1px 0 0;

Wyświetl plik

@ -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,7 +81,9 @@ define(function(require, exports, module) {
scrollbarVisibilityChanged: acetree.renderer,
resize: acetree.renderer,
expand: model,
collapse: model
collapse: model,
check: model,
uncheck: model
};
emit.sticky("draw");
@ -262,7 +265,10 @@ define(function(require, exports, module) {
model.getCheckboxHTML = value
? function(node){
return "<span class='checkbox "
+ (node.isChecked ? "checked" : "") + "'></span>";
+ (node.isChecked == -1
? "half-checked "
: (node.isChecked ? "checked " : ""))
+ "'></span>";
}
: null;
},
@ -360,7 +366,7 @@ define(function(require, exports, module) {
*
*/
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;