Merge remote-tracking branch 'origin/master' into fix/faster-tests

Conflicts:
	plugins/c9.db.redis/project_stats_test.js
	plugins/c9.sapi/docker_test.js
pull/39/head^2
Tim Robinson 2015-03-03 16:55:27 +00:00
commit 9a1f4296d2
16 zmienionych plików z 154 dodań i 164 usunięć

Wyświetl plik

@ -69,18 +69,14 @@ exports.iSearchCommands = [{
bindKey: {win: "Ctrl-F", mac: "Command-F"},
exec: function(iSearch) {
iSearch.cancelSearch(true);
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: "searchForward",
bindKey: {win: "Ctrl-S|Ctrl-K", mac: "Ctrl-S|Command-G"},
exec: function(iSearch, options) {
options.useCurrentOrPrevSearch = true;
iSearch.next(options);
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: "searchBackward",
bindKey: {win: "Ctrl-R|Ctrl-Shift-K", mac: "Ctrl-R|Command-Shift-G"},
@ -88,42 +84,30 @@ exports.iSearchCommands = [{
options.useCurrentOrPrevSearch = true;
options.backwards = true;
iSearch.next(options);
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: "extendSearchTerm",
exec: function(iSearch, string) {
iSearch.addString(string);
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: "extendSearchTermSpace",
bindKey: "space",
exec: function(iSearch) { iSearch.addString(' '); },
readOnly: true,
isIncrementalSearchCommand: true
exec: function(iSearch) { iSearch.addString(' '); }
}, {
name: "shrinkSearchTerm",
bindKey: "backspace",
exec: function(iSearch) {
iSearch.removeChar();
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: 'confirmSearch',
bindKey: 'return',
exec: function(iSearch) { iSearch.deactivate(); },
readOnly: true,
isIncrementalSearchCommand: true
exec: function(iSearch) { iSearch.deactivate(); }
}, {
name: 'cancelSearch',
bindKey: 'esc|Ctrl-G',
exec: function(iSearch) { iSearch.deactivate(true); },
readOnly: true,
isIncrementalSearchCommand: true
exec: function(iSearch) { iSearch.deactivate(true); }
}, {
name: 'occurisearch',
bindKey: 'Ctrl-O',
@ -131,9 +115,7 @@ exports.iSearchCommands = [{
var options = oop.mixin({}, iSearch.$options);
iSearch.deactivate();
occurStartCommand.exec(iSearch.$editor, options);
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: "yankNextWord",
bindKey: "Ctrl-w",
@ -142,9 +124,7 @@ exports.iSearchCommands = [{
range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorWordRight(); }),
string = ed.session.getTextRange(range);
iSearch.addString(string);
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: "yankNextChar",
bindKey: "Ctrl-Alt-y",
@ -153,15 +133,11 @@ exports.iSearchCommands = [{
range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorRight(); }),
string = ed.session.getTextRange(range);
iSearch.addString(string);
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: 'recenterTopBottom',
bindKey: 'Ctrl-l',
exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); },
readOnly: true,
isIncrementalSearchCommand: true
exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); }
}, {
name: 'selectAllMatches',
bindKey: 'Ctrl-space',
@ -173,18 +149,19 @@ exports.iSearchCommands = [{
return ranges.concat(ea ? ea : []); }, []) : [];
iSearch.deactivate(false);
ranges.forEach(ed.selection.addRange.bind(ed.selection));
},
readOnly: true,
isIncrementalSearchCommand: true
}
}, {
name: 'searchAsRegExp',
bindKey: 'Alt-r',
exec: function(iSearch) {
iSearch.convertNeedleToRegExp();
},
readOnly: true,
isIncrementalSearchCommand: true
}];
}
}].map(function(cmd) {
cmd.readOnly = true;
cmd.isIncrementalSearchCommand = true;
cmd.scrollIntoView = "animate-cursor";
return cmd;
});
function IncrementalSearchKeyboardHandler(iSearch) {
this.$iSearch = iSearch;
@ -192,7 +169,7 @@ function IncrementalSearchKeyboardHandler(iSearch) {
oop.inherits(IncrementalSearchKeyboardHandler, HashHandler);
;(function() {
(function() {
this.attach = function(editor) {
var iSearch = this.$iSearch;
@ -201,15 +178,19 @@ oop.inherits(IncrementalSearchKeyboardHandler, HashHandler);
if (!e.command.isIncrementalSearchCommand) return undefined;
e.stopPropagation();
e.preventDefault();
return e.command.exec(iSearch, e.args || {});
var scrollTop = editor.session.getScrollTop();
var result = e.command.exec(iSearch, e.args || {});
editor.renderer.scrollCursorIntoView(null, 0.5);
editor.renderer.animateScrolling(scrollTop);
return result;
});
}
};
this.detach = function(editor) {
if (!this.$commandExecHandler) return;
editor.commands.removeEventListener('exec', this.$commandExecHandler);
delete this.$commandExecHandler;
}
};
var handleKeyboard$super = this.handleKeyboard;
this.handleKeyboard = function(data, hashId, key, keyCode) {
@ -222,7 +203,7 @@ oop.inherits(IncrementalSearchKeyboardHandler, HashHandler);
if (extendCmd) { return {command: extendCmd, args: key}; }
}
return {command: "null", passEvent: hashId == 0 || hashId == 4};
}
};
}).call(IncrementalSearchKeyboardHandler.prototype);

Wyświetl plik

@ -105,7 +105,7 @@ function objectToRegExp(obj) {
this.$mousedownHandler = ed.addEventListener('mousedown', this.onMouseDown.bind(this));
this.selectionFix(ed);
this.statusMessage(true);
}
};
this.deactivate = function(reset) {
this.cancelSearch(reset);
@ -117,7 +117,7 @@ function objectToRegExp(obj) {
}
ed.onPaste = this.$originalEditorOnPaste;
this.message('');
}
};
this.selectionFix = function(editor) {
// Fix selection bug: When clicked inside the editor
@ -128,7 +128,7 @@ function objectToRegExp(obj) {
if (editor.selection.isEmpty() && !editor.session.$emacsMark) {
editor.clearSelection();
}
}
};
this.highlight = function(regexp) {
var sess = this.$editor.session,
@ -136,7 +136,7 @@ function objectToRegExp(obj) {
new SearchHighlight(null, "ace_isearch-result", "text"));
hl.setRegexp(regexp);
sess._emit("changeBackMarker"); // force highlight layer redraw
}
};
this.cancelSearch = function(reset) {
var e = this.$editor;
@ -150,7 +150,7 @@ function objectToRegExp(obj) {
}
this.highlight(null);
return Range.fromPoints(this.$currentPos, this.$currentPos);
}
};
this.highlightAndFindWithNeedle = function(moveToNext, needleUpdateFunc) {
if (!this.$editor) return null;
@ -163,7 +163,7 @@ function objectToRegExp(obj) {
if (options.needle.length === 0) {
this.statusMessage(true);
return this.cancelSearch(true);
};
}
// try to find the next occurence and enable highlighting marker
options.start = this.$currentPos;
@ -176,13 +176,13 @@ function objectToRegExp(obj) {
this.$editor.selection.setRange(Range.fromPoints(shouldSelect ? this.$startPos : found.end, found.end));
if (moveToNext) this.$currentPos = found.end;
// highlight after cursor move, so selection works properly
this.highlight(options.re)
this.highlight(options.re);
}
this.statusMessage(found);
return found;
}
};
this.addString = function(s) {
return this.highlightAndFindWithNeedle(false, function(needle) {
@ -192,7 +192,7 @@ function objectToRegExp(obj) {
reObj.expression += s;
return objectToRegExp(reObj);
});
}
};
this.removeChar = function(c) {
return this.highlightAndFindWithNeedle(false, function(needle) {
@ -202,7 +202,7 @@ function objectToRegExp(obj) {
reObj.expression = reObj.expression.substring(0, reObj.expression.length-1);
return objectToRegExp(reObj);
});
}
};
this.next = function(options) {
// try to find the next occurence of whatever we have searched for
@ -215,29 +215,29 @@ function objectToRegExp(obj) {
return options.useCurrentOrPrevSearch && needle.length === 0 ?
this.$prevNeedle || '' : needle;
});
}
};
this.onMouseDown = function(evt) {
// when mouse interaction happens then we quit incremental search
this.deactivate();
return true;
}
};
this.onPaste = function(text) {
this.addString(text);
}
};
this.convertNeedleToRegExp = function() {
return this.highlightAndFindWithNeedle(false, function(needle) {
return isRegExp(needle) ? needle : stringToRegExp(needle, 'ig');
});
}
};
this.convertNeedleToString = function() {
return this.highlightAndFindWithNeedle(false, function(needle) {
return isRegExp(needle) ? regExpToObject(needle).expression : needle;
});
}
};
this.statusMessage = function(found) {
var options = this.$options, msg = '';
@ -245,7 +245,7 @@ function objectToRegExp(obj) {
msg += 'isearch: ' + options.needle;
msg += found ? '' : ' (not found)';
this.message(msg);
}
};
this.message = function(msg) {
if (this.$editor.showCommandLine) {
@ -254,7 +254,7 @@ function objectToRegExp(obj) {
} else {
console.log(msg);
}
}
};
}).call(IncrementalSearch.prototype);

Wyświetl plik

@ -428,7 +428,7 @@ exports.emacsKeys = {
"M-;": "togglecomment",
"C-/|C-x u|S-C--|C-z": "undo",
"S-C-/|S-C-x u|C--|S-C-z": "redo", //infinite undo?
"S-C-/|S-C-x u|C--|S-C-z": "redo", // infinite undo?
// vertical editing
"C-x r": "selectRectangularRegion",
"M-x": {command: "focusCommandLine", args: "M-x "}
@ -483,7 +483,7 @@ exports.handler.addCommands({
// different. Deactivate the mark when setMark is run with active
// mark
if (transientMarkModeActive && (mark || !hasNoSelection)) {
if (editor.inMultiSelectMode) editor.forEachSelection({exec: editor.clearSelection.bind(editor)})
if (editor.inMultiSelectMode) editor.forEachSelection({exec: editor.clearSelection.bind(editor)});
else editor.clearSelection();
if (mark) editor.pushEmacsMark(null);
return;

Wyświetl plik

@ -236,10 +236,18 @@ MultiHashHandler.prototype = HashHandler.prototype;
}
}
if (data.$keyChain && keyCode > 0)
data.$keyChain = "";
if (data.$keyChain) {
if ((!hashId || hashId == 4) && keyString.length == 1)
data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input
else if (hashId == -1 || keyCode > 0)
data.$keyChain = ""; // reset keyChain
}
return {command: command};
};
this.getStatusText = function(editor, data) {
return data.$keyChain || "";
};
}).call(HashHandler.prototype);

34
node_modules/c9/git.js wygenerowano vendored
Wyświetl plik

@ -1,16 +1,44 @@
"use strict";
require("amd-loader");
var Url = require("url");
var Fs = require("fs");
var Path = require("path");
var exec = require("child_process").exec;
exports.parse = require("./git_url_parse");
exports.isValidUrl = function(url) {
return !!exports.parse(url);
};
exports.parse = function(url) {
var m = url.match(/^(git)@([\w\.\d\-\_]+)(?:\/|:)([\w\.\d\-\_\/]+)/);
if (m) {
return {
protocol: "ssh:",
auth: m[1],
hostname: m[2],
pathname: m[3]
};
}
var parsed = Url.parse(url);
if (
parsed &&
parsed.protocol &&
parsed.protocol.match(/^(git|http|https):$/) &&
parsed.hostname &&
parsed.slashes &&
parsed.pathname
)
return {
protocol: parsed.protocol,
auth: parsed.auth || "",
hostname: parsed.hostname,
pathname: parsed.pathname.replace(/^\/+/, ""),
full: url
};
else
return null;
};
exports.getHeadRevision = function(path, callback) {
exec("git rev-parse HEAD", {

2
node_modules/c9/git_test.js wygenerowano vendored
Wyświetl plik

@ -62,7 +62,7 @@ module.exports = {
assert.equal(rev.length, 40);
next();
},
},
"test get head branch": function(next) {
git.getHeadBranch(__dirname, function(err, rev) {

36
node_modules/c9/git_url_parse.js wygenerowano vendored
Wyświetl plik

@ -1,36 +0,0 @@
define(function(require, exports, module) {
"use strict";
var Url = require("url");
module.exports = function(url) {
var m = url.match(/^(git)@([\w\.\d\-\_]+)(?:\/|:)([\w\.\d\-\_\/]+)/);
if (m) {
return {
protocol: "ssh:",
auth: m[1],
hostname: m[2],
pathname: m[3]
};
}
var parsed = Url.parse(url);
if (
parsed &&
parsed.protocol &&
parsed.protocol.match(/^(git|http|https):$/) &&
parsed.hostname &&
parsed.slashes &&
parsed.pathname
)
return {
protocol: parsed.protocol,
auth: parsed.auth || "",
hostname: parsed.hostname,
pathname: parsed.pathname.replace(/^\/+/, ""),
full: url
};
else
return null;
};
});

12
node_modules/vfs-local/localfs.js wygenerowano vendored
Wyświetl plik

@ -1157,7 +1157,6 @@ module.exports = function setup(fsOptions) {
}
try {
removeFromList();
fileWatchers[path] = fileWatchers[path] || [];
fileWatchers[path].push(_self);
@ -1235,15 +1234,14 @@ module.exports = function setup(fsOptions) {
}
}
var handleWatchEvent = this.handleWatchEvent = function(event, filename, isVfsWrite) {
function handleWatchEvent(event, filename) {
console.log("watch event", event, filename, path);
// it is a temp file
if (filename && filename.substr(-1) == "~"
&& filename.charAt(0) == ".")
return;
createStatEntry(pathBasename(path), path, function(entry) {
entry.vfsWrite = isVfsWrite || false;
if (entry.err) {
event = "delete";
close();
@ -1294,7 +1292,7 @@ module.exports = function setup(fsOptions) {
}
var sendToAllListeners = this.sendToAllListeners = function(event, filename, entry, files) {
listeners.forEach(function(fn) {
listeners.forEach(function(fn){
fn(event, filename, entry, files);
});
};
@ -1370,11 +1368,7 @@ module.exports = function setup(fsOptions) {
function writeToWatchedFile(path, callback) {
if (!fileWatchers[path])
return callback(function(c) { c(); });
var watchers = fileWatchers[path].slice();
var parentDir = dirname(path) + "/";
var dirWatchers = (fileWatchers[parentDir] || []).slice();
watchers.forEach(function(w) {
w.pause();
});

Wyświetl plik

@ -68,7 +68,7 @@
"c9.ide.run.debug": "#36245ee2aa",
"c9.ide.ace.emmet": "#e5f1a92ac3",
"c9.ide.ace.gotoline": "#4d1a93172c",
"c9.ide.ace.keymaps": "#2477fd8ac6",
"c9.ide.ace.keymaps": "#6c4bb65b1f",
"c9.ide.ace.repl": "#ada99852fa",
"c9.ide.ace.split": "#0ae0151c78",
"c9.ide.ace.statusbar": "#d7b45bb7c3",

Wyświetl plik

@ -614,6 +614,17 @@ define(function(require, exports, module) {
settings.set("user/ace/@fontSize", --currSize < 1 ? 1 : currSize);
}
}), handle);
commands.addCommand({
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);
}
/***** Preferences *****/

Wyświetl plik

@ -326,7 +326,6 @@ define(function(require, exports, module) {
commands.find,
commands.openterminal,
commands.navigate,
commands.navigate_altkey,
commands.searchinfiles,
commands.close_term_pane,
commands.closeallbutme,

Wyświetl plik

@ -1,4 +1,5 @@
define(function(require, exports, module) {
var isWindows = require("ace/lib/useragent").isWindows;
module.exports = function initInput(ace) {
var HashHandler = require("ace/keyboard/hash_handler").HashHandler;
var KEY_MODS = require("ace/lib/keys").KEY_MODS;
@ -156,6 +157,9 @@ define(function(require, exports, module) {
passEvent: !hashId || hashId === KEY_MODS.shift || (
// on mac key combos without ctrl or cmd trigger textinput
specialKeys.platform === "mac" && !(hashId & (KEY_MODS.ctrl | KEY_MODS.cmd))
) || (
// on windows 8+ calling preventDefault on win+space breaks textinput
specialKeys.platform === "win" && hashId == KEY_MODS.cmd && (keyCode == 32 || keyCode == -1)
)
};
};

Wyświetl plik

@ -12,18 +12,19 @@ define(function(require, exports, module) {
var c9 = imports.c9;
var util = imports.util;
var Panel = imports.Panel;
var fs = imports.fs;
var panels = imports.panels;
var settings = imports.settings;
var layout = imports.layout;
var fs = imports.fs;
var ui = imports.ui;
var menus = imports.menus;
var tabs = imports.tabManager;
var menus = imports.menus;
var layout = imports.layout;
var clipboard = imports.clipboard;
var commands = imports.commands;
var watcher = imports.watcher;
var prefs = imports.preferences;
var fsCache = imports["fs.cache"];
var alert = imports["dialog.alert"].show;
var fsCache = imports["fs.cache"];
var confirmRemove = imports["dialog.fileremove"].show;
var confirmRename = imports["dialog.fileoverwrite"].show;
var showError = imports["dialog.error"].show;
@ -99,6 +100,15 @@ define(function(require, exports, module) {
if (panels.isActive("tree"))
tree && tree.resize();
});
commands.addCommand({
name: "focusTree",
// shortcut can be modified here
bindKey: { mac: "Shift-Esc", win: "Shift-Esc"},
exec: function() {
panels.activate("tree");
plugin.focus();
}
}, plugin);
// On Ready Resize initially
c9.once("ready", function(){ tree && tree.resize(); });

Wyświetl plik

@ -175,39 +175,33 @@ define(function(require, exports, module) {
if (WAIT_FOR_SIGNAL)
ignore(path, 200);
// console.warn("[watchers] ignored event for", path, stat.vfsWrite ? "(was vfsWrite)" : "(was on ignore list)");
fireWatcherEvent(".all");
} else {
fireWatcherEvent("");
fireWatcherEvent(".all");
return;
}
function fireWatcherEvent(eventSuffix) {
if (event == "error") {
// console.error("[watchers] received error for", path, err, stat);
}
else if (event == "delete") {
fs.unwatch(path, handler);
delete handlers[path];
// console.log("[watchers] received", event, "event for", path, stat);
emit("delete" + eventSuffix, { path : path });
}
else if (event == "directory") {
emit("directory" + eventSuffix, {
path: path,
files: files,
stat: stat
});
}
else {
// console.log("[watchers] received", event, "event for", path, stat);
emit("change" + eventSuffix, {
type: event, // change || rename
filename: filename,
path: path,
stat: stat
});
}
if (event == "error") {
// console.error("[watchers] received error for", path, err, stat);
}
else if (event == "delete") {
fs.unwatch(path, handler);
delete handlers[path];
// console.log("[watchers] received", event, "event for", path, stat);
emit("delete", { path : path });
}
else if (event == "directory") {
emit("directory", {
path: path,
files: files,
stat: stat
});
}
else {
// console.log("[watchers] received", event, "event for", path, stat);
emit("change", {
type: event, //change || rename
filename: filename,
path: path,
stat: stat
});
}
});
}

Wyświetl plik

@ -206,7 +206,12 @@ function main(options, imports, register) {
function sharedModules() {
return [
"lib/architect/architect"
"lib/architect/architect",
"ace/mode/html",
"ace/mode/javascript",
"ace/mode/css",
"ace/mode/c9search",
"ace/multi_select"
];
}

Wyświetl plik

@ -20,8 +20,6 @@ if (!module.parent) {
.boolean("symlink")
.describe("compress", "Compress output files")
.boolean("compress")
.describe("react-style", "compile react less CSS")
.boolean("react-style")
.describe("dest", "destination folder for the static files")
.boolean("help")
.describe("help", "Show command line options.");
@ -108,12 +106,6 @@ function main(config, settings, options, callback) {
app.services.makestatic.getMounts(options.dest, callback);
else if (options.symlink)
app.services.makestatic.symlink(options.dest, callback);
else if (options["react-style"])
app.services["react.style"].compile(function(err, code) {
if (err) return callback(err);
console.log(code);
callback();
});
else
app.services.makestatic.copy(options.dest, callback);
});