Merge remote-tracking branch 'origin/master' into fix/clone-newclient
@ -462,6 +462,7 @@ module.exports = function(options) {
|
||||
cdn: options.useCdn
|
||||
},
|
||||
"plugins/c9.ide.theme.flat/flat-light",
|
||||
"plugins/c9.ide.theme.flat/flat-dark",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.layout.classic/preload",
|
||||
themePrefix: options.themePrefix,
|
||||
|
||||
@ -132,7 +132,10 @@ module.exports = function(config, optimist) {
|
||||
"connect-architect/connect.remote-address",
|
||||
"connect-architect/connect.render",
|
||||
"connect-architect/connect.render.ejs",
|
||||
"connect-architect/connect.redirect",
|
||||
{
|
||||
packagePath: "connect-architect/connect.redirect",
|
||||
trustedDomainsRe: /.*/,
|
||||
},
|
||||
"connect-architect/connect.cors",
|
||||
"./c9.connect.favicon/favicon",
|
||||
// "./c9.logger/stdout-logger",
|
||||
|
||||
4
node_modules/ace/lib/ace/edit_session.js
generated
vendored
@ -1158,7 +1158,7 @@ EditSession.$uid = 0;
|
||||
this.addFolds(delta.folds);
|
||||
}
|
||||
}
|
||||
if (!dontSelect) {
|
||||
if (!dontSelect && this.$undoSelect) {
|
||||
// console.log(deltas.selectionBefore + "uuu")
|
||||
if (deltas.selectionBefore)
|
||||
this.selection.fromJSON(deltas.selectionBefore);
|
||||
@ -1187,7 +1187,7 @@ EditSession.$uid = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dontSelect) {
|
||||
if (!dontSelect && this.$undoSelect) {
|
||||
if (deltas.selectionAfter)
|
||||
this.selection.fromJSON(deltas.selectionAfter);
|
||||
else
|
||||
|
||||
2
node_modules/ace/lib/ace/layer/font_metrics.js
generated
vendored
@ -172,7 +172,7 @@ var FontMetrics = exports.FontMetrics = function(parentEl, interval) {
|
||||
this.getCharacterWidth = function(ch) {
|
||||
var w = this.charSizes[ch];
|
||||
if (w === undefined) {
|
||||
this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width;
|
||||
w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width;
|
||||
}
|
||||
return w;
|
||||
};
|
||||
|
||||
127
node_modules/ace/lib/ace/placeholder.js
generated
vendored
@ -70,7 +70,7 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||
this.$pos = pos;
|
||||
// Used for reset
|
||||
var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || {length: -1};
|
||||
this.$undoStackDepth = undoStack.length;
|
||||
this.$undoStackDepth = undoStack.length;
|
||||
this.setup();
|
||||
|
||||
session.selection.on("changeCursor", this.$onCursorChange);
|
||||
@ -90,21 +90,21 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||
var _self = this;
|
||||
var doc = this.doc;
|
||||
var session = this.session;
|
||||
var pos = this.$pos;
|
||||
|
||||
this.selectionBefore = session.selection.toJSON();
|
||||
if (session.selection.inMultiSelectMode)
|
||||
session.selection.toSingleRange();
|
||||
|
||||
this.pos = doc.createAnchor(pos.row, pos.column);
|
||||
this.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false);
|
||||
this.pos.on("change", function(event) {
|
||||
session.removeMarker(_self.markerId);
|
||||
_self.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.mainClass, null, false);
|
||||
});
|
||||
this.pos = doc.createAnchor(this.$pos.row, this.$pos.column);
|
||||
var pos = this.pos;
|
||||
pos.$insertRight = true;
|
||||
pos.detach();
|
||||
pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false);
|
||||
this.others = [];
|
||||
this.$others.forEach(function(other) {
|
||||
var anchor = doc.createAnchor(other.row, other.column);
|
||||
anchor.$insertRight = true;
|
||||
anchor.detach();
|
||||
_self.others.push(anchor);
|
||||
});
|
||||
session.setUndoSelect(false);
|
||||
@ -117,16 +117,12 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||
*
|
||||
**/
|
||||
this.showOtherMarkers = function() {
|
||||
if(this.othersActive) return;
|
||||
if (this.othersActive) return;
|
||||
var session = this.session;
|
||||
var _self = this;
|
||||
this.othersActive = true;
|
||||
this.others.forEach(function(anchor) {
|
||||
anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column+_self.length), _self.othersClass, null, false);
|
||||
anchor.on("change", function(event) {
|
||||
session.removeMarker(anchor.markerId);
|
||||
anchor.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.othersClass, null, false);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@ -137,7 +133,7 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||
*
|
||||
**/
|
||||
this.hideOtherMarkers = function() {
|
||||
if(!this.othersActive) return;
|
||||
if (!this.othersActive) return;
|
||||
this.othersActive = false;
|
||||
for (var i = 0; i < this.others.length; i++) {
|
||||
this.session.removeMarker(this.others[i].markerId);
|
||||
@ -151,64 +147,61 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||
*
|
||||
**/
|
||||
this.onUpdate = function(delta) {
|
||||
if (this.$updating)
|
||||
return this.updateAnchors(delta);
|
||||
|
||||
var range = delta;
|
||||
if(range.start.row !== range.end.row) return;
|
||||
if(range.start.row !== this.pos.row) return;
|
||||
if (this.$updating) return;
|
||||
if (range.start.row !== range.end.row) return;
|
||||
if (range.start.row !== this.pos.row) return;
|
||||
this.$updating = true;
|
||||
var lengthDiff = delta.action === "insert" ? range.end.column - range.start.column : range.start.column - range.end.column;
|
||||
var inMainRange = range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1;
|
||||
var distanceFromStart = range.start.column - this.pos.column;
|
||||
|
||||
if(range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1) {
|
||||
var distanceFromStart = range.start.column - this.pos.column;
|
||||
this.updateAnchors(delta);
|
||||
|
||||
if (inMainRange)
|
||||
this.length += lengthDiff;
|
||||
if(!this.session.$fromUndo) {
|
||||
if(delta.action === 'insert') {
|
||||
for (var i = this.others.length - 1; i >= 0; i--) {
|
||||
var otherPos = this.others[i];
|
||||
var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart};
|
||||
if(otherPos.row === range.start.row && range.start.column < otherPos.column)
|
||||
newPos.column += lengthDiff;
|
||||
this.doc.insertMergedLines(newPos, delta.lines);
|
||||
}
|
||||
} else if(delta.action === 'remove') {
|
||||
for (var i = this.others.length - 1; i >= 0; i--) {
|
||||
var otherPos = this.others[i];
|
||||
var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart};
|
||||
if(otherPos.row === range.start.row && range.start.column < otherPos.column)
|
||||
newPos.column += lengthDiff;
|
||||
this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff));
|
||||
}
|
||||
|
||||
if (inMainRange && !this.session.$fromUndo) {
|
||||
if (delta.action === 'insert') {
|
||||
for (var i = this.others.length - 1; i >= 0; i--) {
|
||||
var otherPos = this.others[i];
|
||||
var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart};
|
||||
this.doc.insertMergedLines(newPos, delta.lines);
|
||||
}
|
||||
// Special case: insert in beginning
|
||||
if(range.start.column === this.pos.column && delta.action === 'insert') {
|
||||
setTimeout(function() {
|
||||
this.pos.setPosition(this.pos.row, this.pos.column - lengthDiff);
|
||||
for (var i = 0; i < this.others.length; i++) {
|
||||
var other = this.others[i];
|
||||
var newPos = {row: other.row, column: other.column - lengthDiff};
|
||||
if(other.row === range.start.row && range.start.column < other.column)
|
||||
newPos.column += lengthDiff;
|
||||
other.setPosition(newPos.row, newPos.column);
|
||||
}
|
||||
}.bind(this), 0);
|
||||
} else if (delta.action === 'remove') {
|
||||
for (var i = this.others.length - 1; i >= 0; i--) {
|
||||
var otherPos = this.others[i];
|
||||
var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart};
|
||||
this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff));
|
||||
}
|
||||
else if(range.start.column === this.pos.column && delta.action === 'remove') {
|
||||
setTimeout(function() {
|
||||
for (var i = 0; i < this.others.length; i++) {
|
||||
var other = this.others[i];
|
||||
if(other.row === range.start.row && range.start.column < other.column) {
|
||||
other.setPosition(other.row, other.column - lengthDiff);
|
||||
}
|
||||
}
|
||||
}.bind(this), 0);
|
||||
}
|
||||
}
|
||||
this.pos._emit("change", {value: this.pos});
|
||||
for (var i = 0; i < this.others.length; i++) {
|
||||
this.others[i]._emit("change", {value: this.others[i]});
|
||||
}
|
||||
}
|
||||
|
||||
this.$updating = false;
|
||||
this.updateMarkers();
|
||||
};
|
||||
|
||||
this.updateAnchors = function(delta) {
|
||||
this.pos.onChange(delta);
|
||||
for (var i = this.others.length; i--;)
|
||||
this.others[i].onChange(delta);
|
||||
this.updateMarkers();
|
||||
};
|
||||
|
||||
this.updateMarkers = function() {
|
||||
if (this.$updating)
|
||||
return;
|
||||
var _self = this;
|
||||
var session = this.session;
|
||||
var updateMarker = function(pos, className) {
|
||||
session.removeMarker(pos.markerId);
|
||||
pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column+_self.length), className, null, false);
|
||||
};
|
||||
updateMarker(this.pos, this.mainClass);
|
||||
for (var i = this.others.length; i--;)
|
||||
updateMarker(this.others[i], this.othersClass);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -237,14 +230,10 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||
*
|
||||
**/
|
||||
this.detach = function() {
|
||||
this.session.removeMarker(this.markerId);
|
||||
this.session.removeMarker(this.pos && this.pos.markerId);
|
||||
this.hideOtherMarkers();
|
||||
this.doc.removeEventListener("change", this.$onUpdate);
|
||||
this.session.selection.removeEventListener("changeCursor", this.$onCursorChange);
|
||||
this.pos.detach();
|
||||
for (var i = 0; i < this.others.length; i++) {
|
||||
this.others[i].detach();
|
||||
}
|
||||
this.session.setUndoSelect(true);
|
||||
this.session = null;
|
||||
};
|
||||
@ -256,8 +245,8 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||
*
|
||||
**/
|
||||
this.cancel = function() {
|
||||
if(this.$undoStackDepth === -1)
|
||||
throw Error("Canceling placeholders only supported with undo manager attached to session.");
|
||||
if (this.$undoStackDepth === -1)
|
||||
return;
|
||||
var undoManager = this.session.getUndoManager();
|
||||
var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth;
|
||||
for (var i = 0; i < undosRequired; i++) {
|
||||
|
||||
4
node_modules/architect-build/build_support/mini_require.js
generated
vendored
@ -254,8 +254,8 @@ var normalizeNames = function(parentId, moduleNames) {
|
||||
});
|
||||
};
|
||||
|
||||
var require = function(module, callback) {
|
||||
return _require("", module, callback);
|
||||
var require = function(module, callback, errback) {
|
||||
return _require("", module, callback, errback);
|
||||
};
|
||||
|
||||
var config = require.config = function(cfg) {
|
||||
|
||||
20
node_modules/connect-architect/connect.redirect/redirect.js
generated
vendored
@ -1,13 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var url = require("url");
|
||||
var assert = require("assert");
|
||||
|
||||
module.exports = function(options, imports, register) {
|
||||
assert(options.trustedDomainsRe, "Options 'trustedDomainsRe' must be set");
|
||||
|
||||
var trustedDomainsRe = options.trustedDomainsRe || /.*/;
|
||||
var trustedDomainsRe = options.trustedDomainsRe;
|
||||
|
||||
imports.connect.addResponseMethod("redirect", function(location) {
|
||||
this.writeHead(302, {Location: location});
|
||||
this.setHeader("Location", location);
|
||||
this.writeHead(302);
|
||||
this.end("");
|
||||
});
|
||||
imports.connect.addResponseMethod("secureRedirect", function(location) {
|
||||
@ -15,18 +18,19 @@ module.exports = function(options, imports, register) {
|
||||
|
||||
if (!trustedDomainsRe.test(parsedLocation.host))
|
||||
location = parsedLocation.path;
|
||||
|
||||
this.writeHead(302, {Location: location});
|
||||
this.end("");
|
||||
|
||||
this.redirect(location);
|
||||
});
|
||||
imports.connect.addResponseMethod("returnTo", function(req, defaultReturn) {
|
||||
var url = defaultReturn || "/";
|
||||
if (req.session && req.session.returnTo) {
|
||||
if (req.parsedUrl && req.parsedUrl.query.redirect) {
|
||||
url = req.parsedUrl.query.redirect;
|
||||
}
|
||||
else if (req.session && req.session.returnTo) {
|
||||
url = req.session.returnTo;
|
||||
delete req.session.returnTo;
|
||||
}
|
||||
|
||||
this.redirect(url);
|
||||
this.secureRedirect(url);
|
||||
});
|
||||
imports.connect.addResponseMethod("moved", function(location) {
|
||||
this.writeHead(301, {Location: location});
|
||||
|
||||
24
node_modules/vfs-local/localfs.js
generated
vendored
@ -130,8 +130,12 @@ module.exports = function setup(fsOptions) {
|
||||
}
|
||||
|
||||
// Fetch environment variables from the login shell
|
||||
var waitForEnv = null;
|
||||
if (!isWin) {
|
||||
waitForEnv = [];
|
||||
_execFile(BASH, ["-lc", "printenv -0"], function(error, stdout, stderr) {
|
||||
var pending = waitForEnv;
|
||||
waitForEnv = null;
|
||||
if (!error && !stderr && stdout) {
|
||||
var env = fsOptions.defaultEnv;
|
||||
stdout.split("\x00").forEach(function(entry) {
|
||||
@ -140,6 +144,7 @@ module.exports = function setup(fsOptions) {
|
||||
env[entry.slice(0, i)] = entry.slice(i + 1);
|
||||
});
|
||||
}
|
||||
pending.forEach(function(x) { x(); });
|
||||
});
|
||||
}
|
||||
|
||||
@ -452,9 +457,13 @@ module.exports = function setup(fsOptions) {
|
||||
}
|
||||
|
||||
function metadata(path, options, callback) {
|
||||
if (path.charAt(0) == "~")
|
||||
path = join(process.env.HOME, path.substr(1));
|
||||
|
||||
var dirpath = (path.substr(0,5) == "/_/_/"
|
||||
? METAPATH + dirname(path.substr(4))
|
||||
: WSMETAPATH + "/" + dirname(path));
|
||||
|
||||
resolvePath(dirpath, options, function (err, dir) {
|
||||
if (err) return callback(err);
|
||||
|
||||
@ -474,7 +483,11 @@ module.exports = function setup(fsOptions) {
|
||||
}
|
||||
|
||||
function getMetadata(path, options, callback){
|
||||
if (path.charAt(0) == "~")
|
||||
path = join(process.env.HOME, path.substr(1));
|
||||
|
||||
var metaPath = join(WSMETAPATH, path);
|
||||
|
||||
resolvePath(metaPath, options, function (err, path) {
|
||||
if (err) return callback(err);
|
||||
fs.readFile(path, callback);
|
||||
@ -1447,6 +1460,9 @@ module.exports = function setup(fsOptions) {
|
||||
}
|
||||
|
||||
function spawn(executablePath, options, callback) {
|
||||
if (waitForEnv)
|
||||
return waitForEnv.push(spawn.bind(null, executablePath, options, callback));
|
||||
|
||||
var args = options.args || [];
|
||||
|
||||
_setDefaultEnv(options);
|
||||
@ -1887,6 +1903,8 @@ module.exports = function setup(fsOptions) {
|
||||
|
||||
if (!attach) {
|
||||
meta.pty.on("data", function wait(data){
|
||||
if (data)
|
||||
meta.pty.removeListener("data", wait);
|
||||
// Look for error states in plain text from tmux
|
||||
if (data.indexOf("can't create socket") > -1) {
|
||||
var err = new Error(data);
|
||||
@ -1894,9 +1912,6 @@ module.exports = function setup(fsOptions) {
|
||||
err.code = "EPERM";
|
||||
meta.pty.emit("data", err);
|
||||
}
|
||||
else if (data) {
|
||||
meta.pty.removeListener("data", wait);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -2166,6 +2181,9 @@ module.exports = function setup(fsOptions) {
|
||||
}
|
||||
|
||||
function execFile(executablePath, options, callback) {
|
||||
if (waitForEnv)
|
||||
return waitForEnv.push(execFile.bind(null, executablePath, options, callback));
|
||||
|
||||
if (isWin && execFileWin(executablePath, options, callback))
|
||||
return;
|
||||
|
||||
|
||||
42
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "c9",
|
||||
"description": "New Cloud9 Client",
|
||||
"version": "3.1.222",
|
||||
"version": "3.1.349",
|
||||
"author": "Ajax.org B.V. <info@ajax.org>",
|
||||
"private": true,
|
||||
"main": "bin/c9",
|
||||
@ -42,7 +42,7 @@
|
||||
"read": "~1.0.5",
|
||||
"form-data": "~0.2.0",
|
||||
"chai": "~1.5.0",
|
||||
"mocha": "~1.8.1"
|
||||
"mocha": "~2.3.3"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"licenses": [],
|
||||
@ -55,7 +55,7 @@
|
||||
"c9"
|
||||
],
|
||||
"c9plugins": {
|
||||
"c9.ide.language": "#a6ffafabce",
|
||||
"c9.ide.language": "#4c2e69b46c",
|
||||
"c9.ide.language.css": "#a649f2a710",
|
||||
"c9.ide.language.generic": "#77d43cfaf0",
|
||||
"c9.ide.language.html": "#0f4078c187",
|
||||
@ -71,49 +71,49 @@
|
||||
"c9.ide.find": "#35379124ca",
|
||||
"c9.ide.find.infiles": "#c132ad243c",
|
||||
"c9.ide.find.replace": "#44772dd796",
|
||||
"c9.ide.run.debug": "#1415524d85",
|
||||
"c9.ide.run.debug": "#dbe6c81252",
|
||||
"c9.automate": "#47e2c429c9",
|
||||
"c9.ide.ace.emmet": "#6dc4585e02",
|
||||
"c9.ide.ace.gotoline": "#a8ff07c8f4",
|
||||
"c9.ide.ace.keymaps": "#2e3c6e3c8f",
|
||||
"c9.ide.ace.repl": "#4b88a85b7b",
|
||||
"c9.ide.ace.split": "#0ae0151c78",
|
||||
"c9.ide.ace.statusbar": "#d95be89d53",
|
||||
"c9.ide.ace.statusbar": "#2155083cf6",
|
||||
"c9.ide.ace.stripws": "#cf0f42ac59",
|
||||
"c9.ide.behaviors": "#05e5681e2e",
|
||||
"c9.ide.behaviors": "#ee32d7da73",
|
||||
"c9.ide.closeconfirmation": "#cee4674141",
|
||||
"c9.ide.configuration": "#a9066299a2",
|
||||
"c9.ide.dialog.wizard": "#7667ec79a8",
|
||||
"c9.ide.fontawesome": "#781602c5d8",
|
||||
"c9.ide.format": "#5ec97fb083",
|
||||
"c9.ide.help.support": "#e95f98f87c",
|
||||
"c9.ide.imgeditor": "#66a9733dc1",
|
||||
"c9.ide.immediate": "#29fd6d3f51",
|
||||
"c9.ide.imgeditor": "#03a313cbab",
|
||||
"c9.ide.immediate": "#a962119bec",
|
||||
"c9.ide.installer": "#0fde9f0067",
|
||||
"c9.ide.mount": "#3e017a3324",
|
||||
"c9.ide.mount": "#c4b3a1e4b7",
|
||||
"c9.ide.navigate": "#c191d9b92f",
|
||||
"c9.ide.newresource": "#981a408a7b",
|
||||
"c9.ide.openfiles": "#7fa4a97fed",
|
||||
"c9.ide.preview": "#b6d2dfe356",
|
||||
"c9.ide.preview.browser": "#c50007ebbc",
|
||||
"c9.ide.preview.markdown": "#ab8d30ad9f",
|
||||
"c9.ide.preview": "#72a4521169",
|
||||
"c9.ide.preview.browser": "#cec211a76a",
|
||||
"c9.ide.preview.markdown": "#8ed82f1197",
|
||||
"c9.ide.pubsub": "#a85fb27eca",
|
||||
"c9.ide.readonly": "#c699cb172b",
|
||||
"c9.ide.readonly": "#e67bb593bd",
|
||||
"c9.ide.recentfiles": "#7c099abf40",
|
||||
"c9.ide.remote": "#301d2ab519",
|
||||
"c9.ide.processlist": "#2b12cd1bdd",
|
||||
"c9.ide.run": "#f9b7d60b96",
|
||||
"c9.ide.run": "#4b031257ee",
|
||||
"c9.ide.run.build": "#0598fff697",
|
||||
"c9.ide.run.debug.xdebug": "#61dcbd0180",
|
||||
"c9.ide.save": "#4a4a60a004",
|
||||
"c9.ide.scm": "#7b0c0714b4",
|
||||
"c9.ide.terminal.monitor": "#b76f1c9f24",
|
||||
"c9.ide.test": "#ebc037901c",
|
||||
"c9.ide.run.debug.xdebug": "#891f40a245",
|
||||
"c9.ide.save": "#76cf52ab6d",
|
||||
"c9.ide.scm": "#bd5ca2557c",
|
||||
"c9.ide.terminal.monitor": "#35afa7f97f",
|
||||
"c9.ide.test": "#f3e5dad5cc",
|
||||
"c9.ide.test.mocha": "#586fb0cdc2",
|
||||
"c9.ide.theme.flat": "#2de8414db7",
|
||||
"c9.ide.theme.flat": "#92cda0fb40",
|
||||
"c9.ide.threewaymerge": "#229382aa0b",
|
||||
"c9.ide.undo": "#b028bcb4d5",
|
||||
"c9.ide.upload": "#0bd010d3dc",
|
||||
"c9.ide.welcome": "#08bca785f5"
|
||||
"c9.ide.welcome": "#412fe300da"
|
||||
}
|
||||
}
|
||||
@ -530,7 +530,7 @@ define(function(require, exports, module) {
|
||||
});
|
||||
}
|
||||
|
||||
function cleanUp(what) {
|
||||
function cleanUp(what, otherPlugin) {
|
||||
if (!what || ~what.indexOf("elements")) {
|
||||
// Loop through elements
|
||||
elements.forEach(function(element) {
|
||||
@ -546,6 +546,7 @@ define(function(require, exports, module) {
|
||||
events.forEach(function(eventRecord) {
|
||||
var event = eventRegistry[eventRecord[0]];
|
||||
if (!event) return; // this happens with mock plugins during testing
|
||||
if (otherPlugin && otherPlugin.name != event.name) return;
|
||||
var type = eventRecord[1];
|
||||
var id = eventRecord[2];
|
||||
var _events = event._events;
|
||||
|
||||
@ -83,13 +83,12 @@ define(function(require, module, exports) {
|
||||
}
|
||||
|
||||
var timer;
|
||||
var timedout = false;
|
||||
if (timeout) {
|
||||
timer = setTimeout(function() {
|
||||
timedout = true;
|
||||
xhr.abort();
|
||||
var err = new Error("Timeout");
|
||||
err.code = "ETIMEOUT";
|
||||
err.data = {url: url, query: options.query};
|
||||
done(err);
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
@ -14,14 +14,15 @@ function plugin(options, imports, register) {
|
||||
var raygun = imports.raygun;
|
||||
|
||||
function error(err, customData, user) {
|
||||
if (typeof err === "string") {
|
||||
if (typeof err == "string")
|
||||
err = new Error(err);
|
||||
}
|
||||
raygun.errorClient.setUser(user);
|
||||
raygun.errorClient.send(err, customData);
|
||||
}
|
||||
|
||||
function warn(err, customData, user) {
|
||||
if (typeof err == "string")
|
||||
err = new Error(err);
|
||||
raygun.warningClient.setUser(user);
|
||||
raygun.warningClient.send(err, customData);
|
||||
}
|
||||
|
||||
@ -56,20 +56,20 @@ define(function(require, exports, module) {
|
||||
removeSingleNode(e);
|
||||
});
|
||||
|
||||
watcher.on("change", function(e) {
|
||||
onstat({path: e.path, result: [null, e.stat]});
|
||||
watcher.on("change.all", function(e) {
|
||||
onstat({ path: e.path, result: [null, e.stat] });
|
||||
});
|
||||
|
||||
watcher.on("directory", function(e) {
|
||||
watcher.on("directory.all", function(e) {
|
||||
// @todo make onreaddir incremental
|
||||
onreaddir({path: e.path, result: [null, e.files]});
|
||||
onreaddir({ path: e.path, result: [null, e.files] });
|
||||
});
|
||||
|
||||
// Read
|
||||
fs.on("beforeReaddir", function (e) {
|
||||
var node = findNode(e.path);
|
||||
if (!node)
|
||||
return; //Parent is not visible
|
||||
return; // Parent is not visible
|
||||
|
||||
// Indicate this directory is being read
|
||||
model.setAttribute(node, "status", "loading");
|
||||
@ -147,6 +147,8 @@ define(function(require, exports, module) {
|
||||
fs.on("afterReaddir", onreaddir, plugin);
|
||||
|
||||
function onstat(e) {
|
||||
var stat;
|
||||
|
||||
if (!e.error) {
|
||||
// update cache
|
||||
var there = true;
|
||||
@ -168,14 +170,14 @@ define(function(require, exports, module) {
|
||||
deleteNode(node);
|
||||
}
|
||||
else {
|
||||
var stat = e.result[1];
|
||||
stat = e.result[1];
|
||||
if (typeof stat != "object")
|
||||
stat = null;
|
||||
createNode(e.path, stat);
|
||||
}
|
||||
}
|
||||
else if (there) {
|
||||
var stat = e.result[1];
|
||||
stat = e.result[1];
|
||||
if (typeof stat != "object")
|
||||
stat = null;
|
||||
createNode(e.path, stat, node);
|
||||
@ -202,18 +204,19 @@ define(function(require, exports, module) {
|
||||
|
||||
function addSingleNode(e, isFolder, linkInfo) {
|
||||
var node = findNode(e.path);
|
||||
if (node) return; //Node already exists
|
||||
if (node) return; // Node already exists
|
||||
|
||||
if (!showHidden && isFileHidden(e.path))
|
||||
return;
|
||||
|
||||
var parent = findNode(dirname(e.path));
|
||||
if (parent) { //Dir is in cache
|
||||
if (parent) { // Dir is in cache
|
||||
var stat = isFolder
|
||||
? {mime : "folder"}
|
||||
? { mime : "folder" }
|
||||
: (linkInfo
|
||||
? {link: true, linkStat: {fullPath: linkInfo}}
|
||||
: null);
|
||||
? { link: true, linkStat: { fullPath: linkInfo } }
|
||||
: {});
|
||||
stat.mtime = Math.floor(Date.now() / 1000);
|
||||
node = createNode(e.path, stat);
|
||||
|
||||
emit("add", {path : e.path, node : node});
|
||||
@ -563,7 +566,10 @@ define(function(require, exports, module) {
|
||||
node.mtime = stat.mtime;
|
||||
if (original_stat || stat.linkErr)
|
||||
node.link = stat.fullPath || stat.linkErr;
|
||||
node.isFolder = isFolder;
|
||||
if (isFolder)
|
||||
node.isFolder = isFolder;
|
||||
else
|
||||
delete node.isFolder;
|
||||
}
|
||||
|
||||
if (node.isFolder && !node.map)
|
||||
@ -736,6 +742,10 @@ define(function(require, exports, module) {
|
||||
});
|
||||
plugin.on("unload", function(){
|
||||
loaded = false;
|
||||
showHidden = false;
|
||||
hiddenFilePattern = "";
|
||||
hiddenFileRe = /^$/;
|
||||
orphans = {};
|
||||
});
|
||||
|
||||
/***** Register and define API *****/
|
||||
|
||||
@ -737,7 +737,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
||||
fsCache.off("add", c2);
|
||||
fsCache.off("update", c3);
|
||||
expect(fsCache.findNode(vpath)).to.exist;
|
||||
expect(fsCache.findNode(vpath).isFolder).to.equal(false);
|
||||
expect(fsCache.findNode(vpath).isFolder).to.equal(undefined);
|
||||
expect(fsCache.findNode(vpath).link).to.equal(target);
|
||||
expect(fsCache.findNode(vpath).label).to.equal(vpath.substr(1));
|
||||
expect(fsCache.findNode(vpath).path).to.equal(vpath);
|
||||
@ -829,7 +829,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root", "events"],
|
||||
var vpath = "/listing.json";
|
||||
expect(fsCache.findNode(vpath)).to.exist;
|
||||
expect(fsCache.findNode(vpath).size).to.equal(920);
|
||||
watcher.emit("change", {
|
||||
watcher.emit("change.all", {
|
||||
type: "change",
|
||||
filename: vpath.substr(1),
|
||||
path: vpath,
|
||||
|
||||
@ -38,4 +38,4 @@ var i = 0;
|
||||
console.log(greeter(user), Date.now(), i++);
|
||||
setInterval(function(){
|
||||
console.log(greeter(user), Date.now(), i++);
|
||||
}, 10000);
|
||||
}, 1000);
|
||||
|
||||
@ -100,6 +100,7 @@ define(function(require, exports, module) {
|
||||
"light" : "ace/theme/cloud9_day",
|
||||
"light-gray" : "ace/theme/cloud9_day",
|
||||
"flat-light" : "ace/theme/cloud9_day",
|
||||
"flat-dark" : "ace/theme/cloud9_night_low_color",
|
||||
"dark" : "ace/theme/cloud9_night_low_color",
|
||||
"dark-gray" : "ace/theme/cloud9_night_low_color"
|
||||
};
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
define(function(require, exports, module) {
|
||||
main.consumes = [
|
||||
"PreferencePanel", "ace", "ui", "configure", "settings"
|
||||
"PreferencePanel", "ace", "ui", "configure", "settings",
|
||||
"preferences.experimental"
|
||||
];
|
||||
main.provides = ["preferences.themes"];
|
||||
return main;
|
||||
@ -11,6 +12,9 @@ define(function(require, exports, module) {
|
||||
var ace = imports.ace;
|
||||
var configure = imports.configure;
|
||||
var settings = imports.settings;
|
||||
var experimental = imports["preferences.experimental"];
|
||||
|
||||
var FLATDARK = experimental.addExperiment("flat-dark=1", "UI/Flat Dark Theme");
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
@ -52,7 +56,24 @@ define(function(require, exports, module) {
|
||||
|
||||
var list = getThemes();
|
||||
|
||||
var rb1, rb2, rb3, rb4, rb5;
|
||||
var rb1, rb2, rb3, rb4, rb5, rb6;
|
||||
|
||||
var flatThemes = []
|
||||
rb6 = new ui.radiobutton({
|
||||
group: "theme-color",
|
||||
class: "themepicker",
|
||||
style: "background:#252525;",
|
||||
value: "flat-dark"
|
||||
});
|
||||
rb5 = new ui.radiobutton({
|
||||
group: "theme-color",
|
||||
class: "themepicker",
|
||||
style: "background:#dcdbdb;",
|
||||
value: "flat-light"
|
||||
});
|
||||
if (FLATDARK) flatThemes.push(rb6);
|
||||
flatThemes.push(rb5);
|
||||
|
||||
plugin.form.add([
|
||||
{
|
||||
type: "custom",
|
||||
@ -79,14 +100,7 @@ define(function(require, exports, module) {
|
||||
style: "padding-top:5px"
|
||||
}),
|
||||
new ui.bar({
|
||||
childNodes: [
|
||||
rb5 = new ui.radiobutton({
|
||||
group: "theme-color",
|
||||
class: "themepicker",
|
||||
style: "background:#dcdbdb;",
|
||||
value: "flat-light"
|
||||
})
|
||||
]
|
||||
childNodes: flatThemes
|
||||
})
|
||||
]
|
||||
})
|
||||
@ -154,7 +168,7 @@ define(function(require, exports, module) {
|
||||
settings.set("user/general/@skin", e.value);
|
||||
};
|
||||
var setTheme = function(e) {
|
||||
[rb1, rb2, rb5].some(function(rb) {
|
||||
[rb1, rb2, rb5, rb6].some(function(rb) {
|
||||
if (rb.value == e.value) {
|
||||
rb.select();
|
||||
return true;
|
||||
|
||||
@ -107,20 +107,9 @@ define(function(require, exports, module) {
|
||||
}) || true;
|
||||
}
|
||||
|
||||
function logout(callback) {
|
||||
accessToken = "invalid";
|
||||
loggingIn = false;
|
||||
|
||||
http.request("/_auth/logout", function(err1) {
|
||||
http.request(ideBaseUrl + "/auth/signout", {
|
||||
method: "POST",
|
||||
withCredentials: true
|
||||
}, function(err2) {
|
||||
loggedIn = false;
|
||||
emit("logout", {uid: uid, newUid: ANONYMOUS});
|
||||
callback && callback(err1 || err2);
|
||||
});
|
||||
});
|
||||
function logout(redirect) {
|
||||
redirect = redirect || window.location.href;
|
||||
window.location.href = ideBaseUrl + "/api/nc/logout?redirect=" + encodeURIComponent(redirect);
|
||||
}
|
||||
|
||||
function createLoopDetector(count, duration) {
|
||||
|
||||
@ -18,18 +18,18 @@
|
||||
class = "filesave-inner-padding"
|
||||
padding = "5">
|
||||
<div>
|
||||
<a:hsplitbox
|
||||
id = "boxFilename"
|
||||
align = "center"
|
||||
padding = "5"
|
||||
height = "28" >
|
||||
<a:label class="lblFilename" width="70" margin="5 0 0 0">Filename:</a:label>
|
||||
<a:textbox
|
||||
id = "txtFilename"
|
||||
flex = "7"
|
||||
class = "ace_searchbox tb_textbox searchbox searchTxt tb_console tb_textboxInitial"
|
||||
focusselect = "true" />
|
||||
</a:hsplitbox>
|
||||
<a:hsplitbox
|
||||
id = "boxFilename"
|
||||
align = "center"
|
||||
padding = "5"
|
||||
height = "28" >
|
||||
<a:label class="lblFilename" width="70" margin="5 0 0 0">Filename:</a:label>
|
||||
<a:textbox
|
||||
id = "txtFilename"
|
||||
flex = "7"
|
||||
class = "ace_searchbox tb_textbox searchbox searchTxt tb_console tb_textboxInitial"
|
||||
focusselect = "true" />
|
||||
</a:hsplitbox>
|
||||
</div>
|
||||
|
||||
<div class="dgLikeContaier" margin="5 0 5 0" flex="1">
|
||||
@ -50,7 +50,7 @@
|
||||
focusselect = "true" />
|
||||
</a:hbox>
|
||||
|
||||
<a:hbox edge="23 0 0" pack="end" padding="8">
|
||||
<a:hbox edge="13 0 0" pack="end" padding="8">
|
||||
<!--class = "btnIconOnly smallCaption newFolder"-->
|
||||
<a:button
|
||||
id = "btnCreateFolder"
|
||||
|
||||
@ -108,10 +108,16 @@ define(function(require, module, exports) {
|
||||
}
|
||||
else {
|
||||
tab.aml.on("afterclose", function(){
|
||||
setTimeout(function(){
|
||||
if (tab.meta.$closeSync) {
|
||||
tab.unload(e);
|
||||
closing--;
|
||||
});
|
||||
}
|
||||
else {
|
||||
setTimeout(function(){
|
||||
tab.unload(e);
|
||||
closing--;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -280,7 +280,9 @@ define(function(require, module, exports) {
|
||||
|
||||
// @todo Explain difference with unload in docs
|
||||
function close(noAnim) {
|
||||
if (!amlPane.remove) return false;
|
||||
amlPane.remove(amlTab, null, noAnim);
|
||||
return true;
|
||||
}
|
||||
|
||||
/***** Lifecycle *****/
|
||||
@ -289,6 +291,13 @@ define(function(require, module, exports) {
|
||||
load();
|
||||
});
|
||||
|
||||
plugin.on("beforeUnload", function(){
|
||||
if (!plugin.meta.$closing) {
|
||||
if (close())
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
plugin.on("unload", function(e) {
|
||||
closed = true;
|
||||
|
||||
|
||||
@ -132,11 +132,8 @@ define(function(require, module, exports) {
|
||||
function removeTab(e) {
|
||||
if (!e.error) {
|
||||
var tab = findTab(e.path);
|
||||
if (tab) {
|
||||
tab.document.meta.$ignoreSave = true;
|
||||
tab.close();
|
||||
delete tab.document.meta.$ignoreSave;
|
||||
}
|
||||
if (tab)
|
||||
tab.unload();
|
||||
}
|
||||
}
|
||||
fs.on("afterUnlink", removeTab);
|
||||
@ -145,9 +142,8 @@ define(function(require, module, exports) {
|
||||
var path = e.path;
|
||||
Object.keys(tabs).forEach(function(id) {
|
||||
var tab = tabs[id];
|
||||
if (tab.path && tab.path.indexOf(path) === 0) {
|
||||
if (tab.path && tab.path.indexOf(path) === 0)
|
||||
tab.unload();
|
||||
}
|
||||
});
|
||||
});
|
||||
// Close a pane when it doesn't open
|
||||
@ -791,7 +787,10 @@ define(function(require, module, exports) {
|
||||
var pane = list[i], nodes = pane.getTabs();
|
||||
for (var j = nodes.length - 1; j >= 0; j--) {
|
||||
var tab = nodes[j];
|
||||
if (!soft) tab.unload();
|
||||
if (!soft) {
|
||||
tab.meta.$closeSync = true;
|
||||
tab.unload();
|
||||
}
|
||||
else {
|
||||
tab.aml.parentNode.removeChild(tab.aml);
|
||||
tab.pane = null;
|
||||
@ -1346,6 +1345,8 @@ define(function(require, module, exports) {
|
||||
}
|
||||
|
||||
function cancelPreview(keep) {
|
||||
var lastFocussedTab = focussedTab;
|
||||
|
||||
// Unload last preview tab
|
||||
if (lastPreviewTab) {
|
||||
lastPreviewTab.unload();
|
||||
@ -1365,11 +1366,13 @@ define(function(require, module, exports) {
|
||||
delete previewTab.document.meta.existing;
|
||||
}
|
||||
else {
|
||||
previewTab.unload();
|
||||
var tab = previewTab;
|
||||
previewTab = null;
|
||||
tab.unload(); // TODO this focusses the last tab. If there is a speed concern, fix this.
|
||||
}
|
||||
|
||||
previewTab = null;
|
||||
focussedTab && focussedTab.activate();
|
||||
lastFocussedTab && lastFocussedTab.activate();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -165,6 +165,7 @@ TraceKit.report = (function reportModuleWrapper() {
|
||||
else
|
||||
{
|
||||
if (lastExceptionStack) {
|
||||
errorObj = lastException;
|
||||
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);
|
||||
stack = lastExceptionStack;
|
||||
lastExceptionStack = null;
|
||||
@ -187,7 +188,7 @@ TraceKit.report = (function reportModuleWrapper() {
|
||||
}
|
||||
}
|
||||
|
||||
notifyHandlers(stack, 'from window.onerror');
|
||||
notifyHandlers(stack, 'from window.onerror', {errorObj: errorObj});
|
||||
|
||||
if (_oldOnerrorHandler) {
|
||||
return _oldOnerrorHandler.apply(this, arguments);
|
||||
@ -201,7 +202,7 @@ TraceKit.report = (function reportModuleWrapper() {
|
||||
* @param {Error} ex
|
||||
*/
|
||||
function report(ex) {
|
||||
var args = _slice.call(arguments, 1);
|
||||
var args = _slice.call(arguments, 0);
|
||||
if (lastExceptionStack) {
|
||||
if (lastException === ex) {
|
||||
return; // already caught by an inner catch block, ignore
|
||||
@ -1423,6 +1424,7 @@ window.TraceKit = TraceKit;
|
||||
'DealPly is not defined': { factor: 10e5 },
|
||||
"Cannot read property 'style' of null": { factor: 10e3 },
|
||||
"Project with id '<id>' does not exist": { factor: 10e2 },
|
||||
"Workspace not found": { factor: 10e2 },
|
||||
};
|
||||
var groupedErrors = [{
|
||||
regex: /^((?:Project|User) with id ')(\d+)(' does not exist)/i,
|
||||
@ -1462,13 +1464,13 @@ window.TraceKit = TraceKit;
|
||||
});
|
||||
}
|
||||
|
||||
if (options === undefined) {
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (isEmpty(options.customData)) {
|
||||
if (typeof _customData === 'function') {
|
||||
options.customData = _customData();
|
||||
options.customData = _customData(options.errorObj);
|
||||
} else {
|
||||
options.customData = _customData;
|
||||
}
|
||||
|
||||
@ -167,7 +167,6 @@ define(function(require, exports, module) {
|
||||
title: "Introduction",
|
||||
position: 1,
|
||||
node: intro = new ui.bar({
|
||||
height: 149,
|
||||
"class" : "intro",
|
||||
style: "padding:12px;position:relative;"
|
||||
})
|
||||
|
||||
BIN
plugins/c9.ide.layout.classic/icons/bug_flat_dark.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
plugins/c9.ide.layout.classic/icons/bug_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 806 B |
|
After Width: | Height: | Size: 1.7 KiB |
BIN
plugins/c9.ide.layout.classic/icons/folder_flat_dark.png
Normal file
|
After Width: | Height: | Size: 247 B |
BIN
plugins/c9.ide.layout.classic/icons/folder_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 449 B |
BIN
plugins/c9.ide.layout.classic/icons/pause_flat_dark.png
Normal file
|
After Width: | Height: | Size: 371 B |
BIN
plugins/c9.ide.layout.classic/icons/pause_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 688 B |
BIN
plugins/c9.ide.layout.classic/icons/play_flat_dark.png
Normal file
|
After Width: | Height: | Size: 709 B |
BIN
plugins/c9.ide.layout.classic/icons/play_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
plugins/c9.ide.layout.classic/icons/pref-ico_flat_dark.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
plugins/c9.ide.layout.classic/icons/pref-ico_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
BIN
plugins/c9.ide.layout.classic/icons/run_flat_dark.png
Normal file
|
After Width: | Height: | Size: 885 B |
BIN
plugins/c9.ide.layout.classic/icons/run_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
plugins/c9.ide.layout.classic/icons/step_flat_dark.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
plugins/c9.ide.layout.classic/icons/step_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
plugins/c9.ide.layout.classic/icons/stepback_flat_dark.png
Normal file
|
After Width: | Height: | Size: 615 B |
BIN
plugins/c9.ide.layout.classic/icons/stepback_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
plugins/c9.ide.layout.classic/icons/stepinto_flat_dark.png
Normal file
|
After Width: | Height: | Size: 503 B |
BIN
plugins/c9.ide.layout.classic/icons/stepinto_flat_dark@2x.png
Normal file
|
After Width: | Height: | Size: 999 B |
|
After Width: | Height: | Size: 634 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 771 B |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
plugins/c9.ide.layout.classic/images/c9-no-repeat_flat_dark.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 32 KiB |
BIN
plugins/c9.ide.layout.classic/images/c9-repeat-x_flat_dark.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 45 KiB |
@ -25,6 +25,7 @@ define(function(require, exports, module) {
|
||||
require("text!./themes/default-light-gray.less");
|
||||
require("text!./themes/default-light.less");
|
||||
require("text!./themes/default-flat-light.less");
|
||||
require("text!./themes/default-flat-dark.less");
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
@ -144,7 +145,8 @@ define(function(require, exports, module) {
|
||||
"dark-gray": 1,
|
||||
"light-gray": 1,
|
||||
"light": 1,
|
||||
"flat-light": 1
|
||||
"flat-light": 1,
|
||||
"flat-dark": 1
|
||||
};
|
||||
|
||||
function updateTheme(noquestion, type) {
|
||||
@ -221,7 +223,7 @@ define(function(require, exports, module) {
|
||||
"Click Yes to change the theme or No to keep the current theme.",
|
||||
function(){ // yes
|
||||
ignoreTheme = true;
|
||||
var theme = {"dark": "dark", "light": "flat-light"}[kind];
|
||||
var theme = {"dark": "flat-dark", "light": "flat-light"}[kind];
|
||||
settings.set("user/general/@skin", theme);
|
||||
updateTheme(false, type);
|
||||
ignoreTheme = false;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
border-radius: @dialog-border-radius;
|
||||
box-shadow: @dialog-shadow;
|
||||
|
||||
color: @dialog-content-color;
|
||||
background: @dialog-background-color; /* Especially for retina */
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
height : 17px;
|
||||
line-height : 15px;
|
||||
font-size : 12px;
|
||||
color : #303030;
|
||||
color : @tbsimple-color;
|
||||
font-family : menlo,courier new,fixed,swiss,sans-serif;
|
||||
outline : none;
|
||||
background-color : transparent;
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
height : @pane-button-height;
|
||||
box-sizing: border-box;
|
||||
position : relative;
|
||||
padding : 4px 0 0 0;
|
||||
padding : 5px 0 0 0;
|
||||
overflow: visible;
|
||||
color : #000;
|
||||
|
||||
|
||||
@ -18,6 +18,6 @@
|
||||
width: 1px;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
background: rgba(255,255,255,0.06);
|
||||
background: @border-highlight;
|
||||
z-index: 1000;
|
||||
}
|
||||
@ -27,7 +27,7 @@
|
||||
border : 0;
|
||||
height : 17px;
|
||||
font-size : 12px;
|
||||
color : #333333;
|
||||
color : @tbsimple-color;
|
||||
font-family : Arial;
|
||||
outline : none;
|
||||
background-color : transparent;
|
||||
|
||||
@ -23,14 +23,15 @@ define(function(require, exports, module) {
|
||||
"dark-gray" : "",
|
||||
"light-gray" : "",
|
||||
"light" : "",
|
||||
"flat-light" : ""
|
||||
"flat-light" : "",
|
||||
"flat-dark" : ""
|
||||
};
|
||||
|
||||
/***** Methods *****/
|
||||
|
||||
function preload(callback) {
|
||||
settings.setDefaults("user/general", [
|
||||
["skin", options.defaultTheme || "dark"] // "flat-light"
|
||||
["skin", options.defaultTheme || "flat-dark"]
|
||||
]);
|
||||
if (!packed || options.loadTheme) return callback();
|
||||
try {
|
||||
|
||||
@ -594,6 +594,7 @@
|
||||
@dialog-header-font-size: 14px;
|
||||
@dialog-header-font-weight: bold;
|
||||
|
||||
@dialog-content-color: #222;
|
||||
@dialog-content-background: lighten(#dfdfe0, @lighten-chrome) url("@{image-path}/modalbg.png") repeat 0 0;
|
||||
@dialog-content-dark-background-color: lighten(#303130, @lighten-chrome);
|
||||
@dialog-content-dark-gradient: linear-gradient(top,rgba(0, 0, 0, 0.29) 0%, rgba(0, 0, 0, 0.11) 8px, rgba(0, 0, 0, 0.01) 13px, transparent 15px);
|
||||
@ -1127,7 +1128,7 @@
|
||||
@preference-menu-button-icon-top: 0;
|
||||
@preference-menu-button-icon-height: auto;
|
||||
|
||||
@preferences-nav-border-color: lighten(#232323, @lighten-chrome);
|
||||
@preferences-nav-border: 1px solid lighten(#232323, @lighten-chrome);
|
||||
@preferences-nav-background: lighten(#303030, @lighten-chrome) url("@{image-path}/c9-noise.png");
|
||||
@preferences-nav-shadow-color: lighten(rgba(255, 255, 255, 0.03), @lighten-chrome);
|
||||
@preferences-nav-main-color: lighten(#AAAAAA, @lighten-chrome);
|
||||
|
||||
@ -594,6 +594,7 @@
|
||||
@dialog-header-font-size: 14px;
|
||||
@dialog-header-font-weight: bold;
|
||||
|
||||
@dialog-content-color: #222;
|
||||
@dialog-content-background: lighten(#dfdfe0, @lighten-chrome) url("@{image-path}/modalbg.png") repeat 0 0;
|
||||
@dialog-content-dark-background-color: lighten(#303130, @lighten-chrome);
|
||||
@dialog-content-dark-gradient: linear-gradient(top,rgba(0, 0, 0, 0.29) 0%, rgba(0, 0, 0, 0.11) 8px, rgba(0, 0, 0, 0.01) 13px, transparent 15px);
|
||||
@ -1127,7 +1128,7 @@
|
||||
@preference-menu-button-icon-top: 0;
|
||||
@preference-menu-button-icon-height: auto;
|
||||
|
||||
@preferences-nav-border-color: lighten(#232323, @lighten-chrome);
|
||||
@preferences-nav-border: 1px solid lighten(#232323, @lighten-chrome);
|
||||
@preferences-nav-background: lighten(#303030, @lighten-chrome) url("@{image-path}/c9-noise.png");
|
||||
@preferences-nav-shadow-color: lighten(rgba(255, 255, 255, 0.03), @lighten-chrome);
|
||||
@preferences-nav-main-color: lighten(#AAAAAA, @lighten-chrome);
|
||||
|
||||
1724
plugins/c9.ide.layout.classic/themes/default-flat-dark.less
Normal file
@ -391,11 +391,11 @@
|
||||
@pane-button-right: -42px -125px; //-126px;
|
||||
@pane-button-left-active: 0 -125px; //-126px;
|
||||
@pane-button-right-active: -42px -125px; //-126px;
|
||||
@pane-button-mask-left: 0 -96px; //-95px;
|
||||
@pane-button-mask-right: -42px -96px; //-95px;
|
||||
@pane-button-mask-left: 0 -95px; //-95px;
|
||||
@pane-button-mask-right: -42px -95px; //-95px;
|
||||
|
||||
@pane-button-dark-mask-left: 0 -94px; //-95px;
|
||||
@pane-button-dark-mask-right: -42px -94px; //-95px;
|
||||
@pane-button-dark-mask-left: 0 -95px; //-95px;
|
||||
@pane-button-dark-mask-right: -42px -95px; //-95px;
|
||||
|
||||
@pane-button-dark-middle-active: @pane-button-middle;
|
||||
@pane-button-dark-left-active: @pane-button-left-active;
|
||||
@ -594,6 +594,7 @@
|
||||
@dialog-header-font-size: 16px;
|
||||
@dialog-header-font-weight: normal;
|
||||
|
||||
@dialog-content-color: #222;
|
||||
@dialog-content-background: darken(#FEFEFE, @darken-chrome);
|
||||
@dialog-content-dark-background-color: @dialog-content-background;
|
||||
@dialog-content-dark-gradient: linear-gradient(top, transparent 0%, transparent 100%);
|
||||
@ -1127,7 +1128,7 @@
|
||||
@preference-menu-button-icon-top: 7px;
|
||||
@preference-menu-button-icon-height: 25px;
|
||||
|
||||
@preferences-nav-border-color: darken(#DEDEDE, @darken-chrome);
|
||||
@preferences-nav-border: 1px solid darken(#DEDEDE, @darken-chrome);
|
||||
@preferences-nav-background: darken(#FBFBFB, @darken-chrome);
|
||||
@preferences-nav-shadow-color: transparent;
|
||||
@preferences-nav-main-color: darken(#333, @darken-chrome);
|
||||
@ -1192,7 +1193,7 @@
|
||||
@preferences-datagrid-highlight-column-color: transparent;
|
||||
|
||||
@preferences-filter-box-background: lightgrey;
|
||||
@preferences-intro-padding: 12px 12px 32px 12px;
|
||||
@preferences-intro-padding: 12px;
|
||||
@preferences-intro-title-text-shadow: none;
|
||||
@preferences-intro-title-padding: 8px 0 6px 47px;
|
||||
@preferences-intro-color: darken(#333, @darken-chrome);
|
||||
|
||||
@ -594,6 +594,7 @@
|
||||
@dialog-header-font-size: 14px;
|
||||
@dialog-header-font-weight: bold;
|
||||
|
||||
@dialog-content-color: #222;
|
||||
@dialog-content-background: darken(#dfdfe0, @darken-chrome) url("@{image-path}/modalbg.png") repeat 0 0;
|
||||
@dialog-content-dark-background-color: darken(#303130, @darken-chrome);
|
||||
@dialog-content-dark-gradient: linear-gradient(top,rgba(0, 0, 0, 0.29) 0%, rgba(0, 0, 0, 0.11) 8px, rgba(0, 0, 0, 0.01) 13px, transparent 15px);
|
||||
@ -1127,7 +1128,7 @@
|
||||
@preference-menu-button-icon-top: 0;
|
||||
@preference-menu-button-icon-height: auto;
|
||||
|
||||
@preferences-nav-border-color: darken(#C0C0C0, @darken-chrome);
|
||||
@preferences-nav-border: 1px solid darken(#C0C0C0, @darken-chrome);
|
||||
@preferences-nav-background: darken(#E0E0E0, @darken-chrome);
|
||||
@preferences-nav-shadow-color: darken(rgba(255, 255, 255, 0.03), @darken-chrome);
|
||||
@preferences-nav-main-color: darken(#666, @darken-chrome);
|
||||
|
||||
@ -594,6 +594,7 @@
|
||||
@dialog-header-font-size: 14px;
|
||||
@dialog-header-font-weight: bold;
|
||||
|
||||
@dialog-content-color: #222;
|
||||
@dialog-content-background: darken(#dfdfe0, @darken-chrome) url("@{image-path}/modalbg.png") repeat 0 0;
|
||||
@dialog-content-dark-background-color: darken(#303130, @darken-chrome);
|
||||
@dialog-content-dark-gradient: linear-gradient(top,rgba(0, 0, 0, 0.29) 0%, rgba(0, 0, 0, 0.11) 8px, rgba(0, 0, 0, 0.01) 13px, transparent 15px);
|
||||
@ -1127,7 +1128,7 @@
|
||||
@preference-menu-button-icon-top: 0;
|
||||
@preference-menu-button-icon-height: auto;
|
||||
|
||||
@preferences-nav-border-color: darken(#C0C0C0, @darken-chrome);
|
||||
@preferences-nav-border: 1px solid darken(#C0C0C0, @darken-chrome);
|
||||
@preferences-nav-background: darken(#E0E0E0, @darken-chrome);
|
||||
@preferences-nav-shadow-color: darken(rgba(255, 255, 255, 0.03), @darken-chrome);
|
||||
@preferences-nav-main-color: darken(#666, @darken-chrome);
|
||||
|
||||
224
plugins/c9.ide.layout.classic/themes/flat-dark.less
Normal file
@ -0,0 +1,224 @@
|
||||
@import "plugins/c9.ide.layout.classic/themes/flat-light.less";
|
||||
|
||||
.bartools .c9-toolbarbutton-glossyOver{
|
||||
background: #E6E6E6;
|
||||
}
|
||||
|
||||
.bartools .c9-toolbarbutton-glossymenuDown{
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0px 3px 15px 0px rgba(0, 0, 0, 0.29);
|
||||
border: 1px solid #dedede;
|
||||
}
|
||||
|
||||
.output .toolbar .c9-toolbarbutton-glossyOver{
|
||||
border: 1px solid transparent !important;
|
||||
background: rgba(255,255,255, 0.1) !important;
|
||||
}
|
||||
.output .toolbar .c9-toolbarbutton-glossyDown{
|
||||
border: 1px solid transparent !important;
|
||||
background: rgba(255,255,255, 0.14) !important;
|
||||
}
|
||||
|
||||
.searchresults .item{
|
||||
padding : 3px 3px 3px 5px;
|
||||
}
|
||||
|
||||
.envcontainer {
|
||||
box-shadow: 1px 1px 6px 0px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.blackdg .ace_wrapper {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.keybindings .blackdg .ace_wrapper {
|
||||
background-color: rgb(239, 239, 239);
|
||||
}
|
||||
.console>.hbox>.btn_consoleOver{
|
||||
background: #E6E6E6;
|
||||
}
|
||||
.console>.hbox>.btn_consoleDown {
|
||||
background: #E6E6E6;
|
||||
}
|
||||
.c9-toolbarbutton-glossyDisabled.light .c9-icon{
|
||||
opacity: 0.6;
|
||||
}
|
||||
.rbcontainer.themepicker.rbcontainerSelected div:after {
|
||||
border: 3px solid #D8D8D8;
|
||||
}
|
||||
|
||||
.ace_scroller.ace_scroll-left > .scroll_shadow {
|
||||
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.2) inset !important;
|
||||
}
|
||||
|
||||
.bar-preferences .blackdg .ace_tree-editor{
|
||||
color: #333;
|
||||
background: rgb(239, 239, 239);
|
||||
}
|
||||
|
||||
.c9-toolbarbutton-glossy.saving .c9-label, .c9-toolbarbutton-glossy.saved .c9-label {
|
||||
background-position: 0 -523px;
|
||||
color: rgb(158, 158, 158);
|
||||
}
|
||||
.cbcontainerFocus span {
|
||||
border: 1px dotted #BBB;
|
||||
}
|
||||
|
||||
.grouped_checkbox_holder.mount{
|
||||
background: #FAFAFA;
|
||||
border: 1px solid #DEDEDE;
|
||||
}
|
||||
.grouped_checkbox_holder.mount .cbcontainerDown,
|
||||
.grouped_checkbox_holder.mount .cbcontainerChecked {
|
||||
background: #63acff;
|
||||
}
|
||||
.grouped_checkbox_holder.mount .cbcontainer span{
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
.has_apf .grouped_checkbox_holder.mount .cbcontainerOver:not(.cbcontainerChecked),
|
||||
.has_apf .grouped_checkbox_holder.mount .cbcontainerFocus:not(.cbcontainerChecked){
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
||||
.has_apf .grouped_checkbox_holder.mount .cbcontainerDown span,
|
||||
.has_apf .grouped_checkbox_holder.mount .cbcontainerChecked span{
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.language_highlight_occurrence_other,
|
||||
.language_highlight_occurrence_main {
|
||||
border-color: #ADADAD;
|
||||
}
|
||||
|
||||
.bk-window.relative, .bk-window2.relative{
|
||||
box-shadow: 0 0 30px rgba(0,0,0,0.2) !important;
|
||||
}
|
||||
|
||||
.ace_tree.ace_tree_focus .selected .extrainfo{
|
||||
color: #FFFFFF;
|
||||
.font-smoothing(true);
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
.image-2x("/static/@{pane-button-save-image}", @pane-button-save-image-width, @pane-button-save-image-height);
|
||||
.animation(~"loading-24-spinner 1.2s steps(24) infinite")!important;
|
||||
}
|
||||
|
||||
.ace_tree .tree-row .checkbox{
|
||||
outline: 1px solid rgba(0, 0, 0, 0.16);
|
||||
background: white;
|
||||
}
|
||||
.ace_tree .tree-row .checkbox.checked{
|
||||
background-position: -2px -2px;
|
||||
}
|
||||
.ace_tree .tree-row .checkbox.half-checked{
|
||||
background-color: #DDDDDD;
|
||||
background-position: -2px -2px;
|
||||
}
|
||||
.top-test-panel{
|
||||
border-bottom: 1px solid @border-highlight;
|
||||
}
|
||||
|
||||
.top-test-panel{
|
||||
border-bottom: 1px solid @border-highlight-dark;
|
||||
}
|
||||
|
||||
.runner-form-header{
|
||||
border-bottom: 1px solid @border-highlight-dark;
|
||||
}
|
||||
|
||||
.dgLikeContaier {
|
||||
background-color: @element-background;
|
||||
border: 1px solid @element-background;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.cboffline{
|
||||
background: @element-background;
|
||||
border: 1px solid @element-background;
|
||||
}
|
||||
.cboffline:after{
|
||||
background: @element-chrome-highlight;
|
||||
border: 1px solid @element-chrome-highlight;
|
||||
}
|
||||
.cbofflineChecked{
|
||||
background: @element-background;
|
||||
border-color: @element-background;
|
||||
}
|
||||
.cbofflineChecked:after{
|
||||
border-color: @selected-focus-background;
|
||||
background-color: @selected-focus-background;
|
||||
}
|
||||
.cboffline:hover{
|
||||
background: @element-background-hover;
|
||||
}
|
||||
|
||||
.spinner{
|
||||
border: 1px solid @element-background;
|
||||
background: @element-background;
|
||||
}
|
||||
|
||||
.spinner .buttons .minus{
|
||||
font-size: 16px;
|
||||
padding: 4px 9px;
|
||||
color: #767676;
|
||||
border-right: 1px solid @element-border;
|
||||
}
|
||||
.spinner .buttons .plus{
|
||||
font-size: 15px;
|
||||
padding: 4px 7px;
|
||||
color: #767676;
|
||||
border-left: 1px solid @element-border;
|
||||
}
|
||||
.spinner .buttons .minus:hover{
|
||||
background: @element-background-hover;
|
||||
color: #f07272;
|
||||
}
|
||||
.spinner .buttons .plus:hover{
|
||||
background: @element-background-hover;
|
||||
color: #98c878;
|
||||
}
|
||||
|
||||
.searchbox .ace_editor{
|
||||
.font-smoothing(true);
|
||||
}
|
||||
|
||||
.searchbox .ace-tm .ace_marker-layer .ace_selected-word {
|
||||
display: none;
|
||||
}
|
||||
.searchbox .ace-tm .ace_marker-layer .ace_selection {
|
||||
background: rgb(119, 130, 49);
|
||||
}
|
||||
.searchbox .ace-tm .ace_cursor {
|
||||
color: @textbox-color;
|
||||
}
|
||||
|
||||
.bar-preferences .taFocus,
|
||||
.bar-preferences .ta:hover,
|
||||
.taFocus, .ta:hover,
|
||||
.searchbox .sbtb_middle:hover,
|
||||
.searchboxFocus .sbtb_middle,
|
||||
.bar-preferences .tbsimpleFocus,
|
||||
.tbsimpleFocus,
|
||||
.tbsimple:hover{
|
||||
background: @element-background-hover;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.panel-bar .searchbox .sbtb_middle{
|
||||
background: #232323;
|
||||
}
|
||||
|
||||
.panel-bar .searchbox .sbtb_middle:hover,
|
||||
.panel-bar .searchboxFocus .sbtb_middle {
|
||||
background: #202020;
|
||||
}
|
||||
|
||||
.has_apf .bar-preferences .blackdg{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
@media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 1.25dppx) {
|
||||
|
||||
}
|
||||
@ -488,14 +488,14 @@ body .runner-form-header{
|
||||
background-position : 0 -126px;
|
||||
}
|
||||
.dark.session_btn.curbtn .tab_middle:before {
|
||||
-webkit-mask-position : 0 -94px;
|
||||
-webkit-mask-position : 0 -95px;
|
||||
}
|
||||
.dark.session_btn.curbtn .tab_middle:after,
|
||||
.session_btn.curbtn .tab_middle:after {
|
||||
background-position : -42px -126px;
|
||||
}
|
||||
.dark.session_btn.curbtn .tab_middle:after {
|
||||
-webkit-mask-position : -42px -94px;
|
||||
-webkit-mask-position : -42px -95px;
|
||||
}
|
||||
.session_btn.curbtn .tab_shadow:before {
|
||||
background-position : 0 -123px;
|
||||
|
||||
@ -137,7 +137,7 @@ define(function(require, exports, module) {
|
||||
|
||||
function signout() {
|
||||
vfsEndpoint.clearCache();
|
||||
auth.logout(function() { location.href = ideBaseUrl; });
|
||||
auth.logout(ideBaseUrl);
|
||||
}
|
||||
|
||||
function onReLogin() {
|
||||
@ -147,9 +147,7 @@ define(function(require, exports, module) {
|
||||
"Please hit OK to reload the IDE.",
|
||||
function() {
|
||||
vfsEndpoint.clearCache();
|
||||
auth.logout(function() {
|
||||
document.location.reload();
|
||||
});
|
||||
auth.logout();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ define(function(require, exports, module) {
|
||||
var plugins = [];
|
||||
|
||||
var ENABLED = c9.location.indexOf("debug=2") > -1;
|
||||
var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");;
|
||||
var HASSDK = experimental.addExperiment("sdk", false, "SDK/Load Custom Plugins");;
|
||||
|
||||
var reParts = /^(builders|keymaps|modes|outline|runners|snippets|themes)\/(.*)/;
|
||||
var reModule = /(?:_highlight_rules|_test|_worker|_fold|_behaviou?r)\.js$/;
|
||||
@ -183,6 +183,9 @@ define(function(require, exports, module) {
|
||||
cfg.staticPrefix = host + join(base, name);
|
||||
cfg.apikey = "0000000000000000000000000000=";
|
||||
|
||||
// Set version for package manager
|
||||
cfg.version = options.version;
|
||||
|
||||
config.push(cfg);
|
||||
plugins.push(name + "/" + path);
|
||||
});
|
||||
|
||||
@ -27,7 +27,7 @@ define(function(require, exports, module) {
|
||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
var emit = plugin.getEmitter();
|
||||
|
||||
var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");
|
||||
var HASSDK = experimental.addExperiment("sdk", false, "SDK/Load Custom Plugins");
|
||||
|
||||
var installing;
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ define(function(require, exports, module) {
|
||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
// var emit = plugin.getEmitter();
|
||||
|
||||
var ENABLED = experimental.addExperiment("plugins=0", "SDK/Load Plugins From Workspace");
|
||||
var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");
|
||||
var ENABLED = experimental.addExperiment("plugins", false, "SDK/Load Plugins From Workspace");
|
||||
var HASSDK = experimental.addExperiment("sdk", false, "SDK/Load Custom Plugins");
|
||||
|
||||
var plugins = options.plugins;
|
||||
var loadFromDisk = options.loadFromDisk
|
||||
|
||||
@ -96,17 +96,19 @@ define(function(require, exports, module) {
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
var ENABLED = c9.location.indexOf("debug=2") > -1
|
||||
|| experimental.addExperiment("plugin-manager", false, "SDK/Plugin Manager");
|
||||
|
||||
var plugin = new PreferencePanel("Ajax.org", main.consumes, {
|
||||
caption: "Plugin Manager",
|
||||
className: "plugins",
|
||||
form: false,
|
||||
noscroll: true,
|
||||
index: 200
|
||||
index: 200,
|
||||
visible: ENABLED,
|
||||
});
|
||||
// var emit = plugin.getEmitter();
|
||||
|
||||
var HASSDK = experimental.addExperiment("sdk=1", "SDK/Load Custom Plugins");
|
||||
|
||||
var model, datagrid, filterbox;
|
||||
var btnUninstall, btnReport, btnReadme, btnCloud9, btnReload;
|
||||
|
||||
@ -115,7 +117,7 @@ define(function(require, exports, module) {
|
||||
if (loaded) return false;
|
||||
loaded = true;
|
||||
|
||||
if (!HASSDK) return;
|
||||
if (!ENABLED) return;
|
||||
|
||||
// @TODO enable/disable plugins -> move to ext
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ define(function(require, exports, module) {
|
||||
var emit = handle.getEmitter();
|
||||
emit.setMaxListeners(1000);
|
||||
|
||||
var HASSDK = experimental.addExperiment("sdk=0", "SDK/Load Custom Plugins");
|
||||
var HASSDK = experimental.addExperiment("sdk", false, "SDK/Load Custom Plugins");
|
||||
|
||||
function focusOpenPackages(){
|
||||
var pages = tabs.getTabs();
|
||||
|
||||
@ -1,17 +1,16 @@
|
||||
define(function(require, exports, module) {
|
||||
main.consumes = [
|
||||
"PreferencePanel", "ui", "dialog.confirm", "settings",
|
||||
"preferences", "c9"
|
||||
"PreferencePanel", "ui", "dialog.alert", "settings", "c9"
|
||||
];
|
||||
main.provides = ["preferences.experimental"];
|
||||
return main;
|
||||
|
||||
function main(options, imports, register) {
|
||||
var PreferencePanel = imports.PreferencePanel;
|
||||
var prefs = imports.preferences;
|
||||
var settings = imports.settings;
|
||||
var ui = imports.ui;
|
||||
var c9 = imports.c9;
|
||||
var alert = imports["dialog.alert"].show;
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
@ -23,7 +22,7 @@ define(function(require, exports, module) {
|
||||
var emit = plugin.getEmitter();
|
||||
emit.setMaxListeners(1000);
|
||||
|
||||
var intro;
|
||||
var intro, hasAlerted;
|
||||
|
||||
var loaded = false;
|
||||
function load() {
|
||||
@ -37,7 +36,6 @@ define(function(require, exports, module) {
|
||||
title: "Introduction",
|
||||
position: 1,
|
||||
node: intro = new ui.bar({
|
||||
height: 102,
|
||||
"class" : "intro",
|
||||
style: "padding:12px;position:relative;"
|
||||
})
|
||||
@ -52,7 +50,7 @@ define(function(require, exports, module) {
|
||||
intro.$int.innerHTML =
|
||||
'<h1>Experimental Features (reload to apply changes)</h1><p style="white-space:normal">Cloud9 is continuously in '
|
||||
+ 'development. New features in alpha or beta are first hidden '
|
||||
+ 'and can be enabled via this page. <i>Use at your own risk</i></p>';
|
||||
+ 'and can be enabled via this page. <i>Use at your own risk</i>.</p>';
|
||||
}
|
||||
|
||||
/***** Methods *****/
|
||||
@ -60,31 +58,37 @@ define(function(require, exports, module) {
|
||||
// =0 means the value should be set to 0 to disable otherwise it is enabled
|
||||
// =1 means the value should be set to 1 to enable otherwise it is disabled
|
||||
var found = {};
|
||||
function addExperiment(query, name){
|
||||
var key = query.split("=");
|
||||
var defValue = Number(key[1]); key = key[0];
|
||||
var uniqueId = key.replace(/\//g, "-");
|
||||
function addExperiment(name, defaultValue, caption){
|
||||
var uniqueId = name.replace(/\//g, "-");
|
||||
|
||||
var parts = name.split("/");
|
||||
var parts = caption.split("/");
|
||||
var current, obj = { "Experimental": current = {} };
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
current[parts[i]] = current = {};
|
||||
}
|
||||
current.type = "checkbox";
|
||||
current.setting = "state/experiments/@" + uniqueId;
|
||||
current.onchange = function(e){
|
||||
if (!hasAlerted) {
|
||||
alert("Refresh Needed",
|
||||
"Please Refresh Cloud9 To Activate This Change",
|
||||
"To see the effect of this change, please refresh Cloud9.");
|
||||
hasAlerted = true;
|
||||
}
|
||||
};
|
||||
|
||||
if (!found[name])
|
||||
if (!found[caption])
|
||||
plugin.add(obj, plugin);
|
||||
found[name] = true;
|
||||
found[caption] = true;
|
||||
|
||||
settings.setDefaults("state/experiments", [[uniqueId, !defValue]]);
|
||||
settings.setDefaults("state/experiments", [[uniqueId, Number(defaultValue)]]);
|
||||
|
||||
// return value from url if present, otherwise return the setting
|
||||
var idx = c9.location.indexOf(key + "=");
|
||||
var idx = c9.location.indexOf(name + "=");
|
||||
if (idx !== -1) {
|
||||
if (c9.location.indexOf(key + "=0") != -1)
|
||||
if (c9.location.indexOf(name + "=0") != -1)
|
||||
return false;
|
||||
if (c9.location.indexOf(key + "=1") != -1)
|
||||
if (c9.location.indexOf(name + "=1") != -1)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -116,7 +120,15 @@ define(function(require, exports, module) {
|
||||
],
|
||||
|
||||
/**
|
||||
* Define a new experimental feature.
|
||||
*
|
||||
* @param {String} name The internal name of this experiment, e.g. foo
|
||||
*
|
||||
* @param {Boolean} defaultValue The default state of this experiment when not configure
|
||||
*
|
||||
* @param {String} caption The name of this setting in the UI, e.g. SDK/Plugin Manager
|
||||
*
|
||||
* @return {Boolean} true if this experiment is currently enabled
|
||||
*/
|
||||
addExperiment: addExperiment
|
||||
});
|
||||
|
||||
@ -35,7 +35,6 @@ define(function(require, exports, module) {
|
||||
title: "Introduction",
|
||||
position: 1,
|
||||
node: intro = new ui.bar({
|
||||
height: 102,
|
||||
"class" : "intro",
|
||||
style: "padding:12px;position:relative;"
|
||||
})
|
||||
|
||||
@ -18,6 +18,7 @@ define(function(require, module, exports) {
|
||||
var caption = options.caption;
|
||||
var noscroll = options.noscroll;
|
||||
var className = options.className || "";
|
||||
var visible = options.visible == null || options.visible;
|
||||
var index = options.index || 100;
|
||||
var headings = {};
|
||||
var subHeadings = {};
|
||||
@ -240,6 +241,8 @@ define(function(require, module, exports) {
|
||||
/***** LifeCycle *****/
|
||||
|
||||
plugin.on("load", function(){
|
||||
if (!visible) return;
|
||||
|
||||
navHtml = prefs.addNavigation(caption, index, null, plugin);
|
||||
navHtml.addEventListener("mousedown", function(){
|
||||
prefs.activate(plugin);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
.bar-preferences .navigation{
|
||||
padding : 15px 0 0 0;
|
||||
border-right : 1px solid @preferences-nav-border-color;
|
||||
border-right : @preferences-nav-border;
|
||||
|
||||
background: @preferences-nav-background;
|
||||
.box-shadow(~"0 1px 0 0 @{preferences-nav-shadow-color} inset");
|
||||
|
||||
@ -33,7 +33,6 @@ define(function(require, exports, module) {
|
||||
title: "Introduction",
|
||||
position: 1,
|
||||
node: intro = new ui.bar({
|
||||
height: 102,
|
||||
"class" : "intro",
|
||||
style: "padding:12px;position:relative;"
|
||||
})
|
||||
|
||||
@ -100,6 +100,9 @@ var HoverLink = function(editor) {
|
||||
};
|
||||
|
||||
this.onClick = function(e) {
|
||||
if (!this.editor.isFocused())
|
||||
return;
|
||||
|
||||
if (this.link && this.isOpen) { // && this.link.isFocused
|
||||
if (this.editor.selection.isEmpty()) {
|
||||
this.editor.selection.setSelectionRange(this.range);
|
||||
@ -298,10 +301,10 @@ var HoverLink = function(editor) {
|
||||
match.value = value.replace(/['">)}\].,;:]+$/, "");
|
||||
}
|
||||
else if (/^[ab]?\//.test(value) && /^([+\-]{3}|diff)/.test(line)) { // diff
|
||||
match.type = "path";
|
||||
match.basePath = "";
|
||||
match.start++;
|
||||
match.value = value.substr(2);
|
||||
match.type = "path";
|
||||
match.basePath = "";
|
||||
match.start++;
|
||||
match.value = value.substr(2);
|
||||
}
|
||||
else if (prompt.command === "git") { // git status
|
||||
var prefix = line.substr(0, match.start);
|
||||
@ -378,6 +381,9 @@ var HoverLink = function(editor) {
|
||||
};
|
||||
|
||||
this.onMouseMove = function(e) {
|
||||
if (e.shiftKey || e.ctrlKey || e.metaKey || !this.editor.isFocused())
|
||||
return this.clear();
|
||||
|
||||
if (this.editor.$mouseHandler.isMousePressed) {
|
||||
if (!this.editor.selection.isEmpty())
|
||||
this.clear();
|
||||
|
||||
@ -30,7 +30,7 @@ define(function(require, exports, module) {
|
||||
var BASEPATH = options.previewUrl;
|
||||
|
||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
var menu, lastLink;
|
||||
var menuPath, lastLink;
|
||||
|
||||
var reHome = new RegExp("^" + util.escapeRegExp(c9.home));
|
||||
|
||||
@ -38,17 +38,17 @@ define(function(require, exports, module) {
|
||||
|
||||
terminal.on("create", function(e) {
|
||||
var ace = e.editor.ace;
|
||||
if (!ace)
|
||||
return;
|
||||
if (!ace) return;
|
||||
|
||||
ace.hoverLink = new HoverLink(ace);
|
||||
ace.hoverLink.on("open", showMenu);
|
||||
});
|
||||
}, plugin);
|
||||
|
||||
function createMenu(e) {
|
||||
if (menu)
|
||||
function createMenu() {
|
||||
if (menuPath)
|
||||
return;
|
||||
|
||||
var submenu = new Menu({
|
||||
var submenu = new Menu({
|
||||
items: [
|
||||
new MenuItem({ value: "path", caption: "Copy Path" }),
|
||||
new MenuItem({ value: "directory", caption: "Copy Directory" }),
|
||||
@ -71,9 +71,6 @@ define(function(require, exports, module) {
|
||||
? "Unable to access via preview"
|
||||
: BASEPATH + info.path });
|
||||
}
|
||||
// else if (e.value == "github") {
|
||||
|
||||
// }
|
||||
}
|
||||
}, plugin);
|
||||
|
||||
@ -92,10 +89,9 @@ define(function(require, exports, module) {
|
||||
new MenuItem({ caption: "Copy Special", submenu: submenu }),
|
||||
new Divider(),
|
||||
new MenuItem({ value: "reveal", caption: "Reveal in File Tree" })
|
||||
// new MenuItem({ caption: "Open in GitHub" }),
|
||||
];
|
||||
|
||||
menu = new Menu({
|
||||
menuPath = new Menu({
|
||||
items: menuItems,
|
||||
onitemclick: function(e) {
|
||||
var info = buildPath(lastLink, true);
|
||||
@ -121,91 +117,116 @@ define(function(require, exports, module) {
|
||||
}
|
||||
}, plugin);
|
||||
}
|
||||
|
||||
var menuLink;
|
||||
function createLinkMenu(){
|
||||
menuLink = new Menu({
|
||||
items: [
|
||||
new MenuItem({ value: "open", caption: "Open" }),
|
||||
new MenuItem({ value: "open-in-preview", caption: "Open In Preview" }),
|
||||
new MenuItem({ value: "copy", caption: "Copy" }),
|
||||
],
|
||||
onitemclick: function(e) {
|
||||
if (e.value == "open")
|
||||
openLink(lastLink.value);
|
||||
if (e.value == "open-in-preview")
|
||||
openLink(lastLink.value, true);
|
||||
else if (e.value == "copy")
|
||||
commands.exec("copy", null, { data: lastLink.value });
|
||||
}
|
||||
}, plugin);
|
||||
}
|
||||
|
||||
/***** Methods *****/
|
||||
|
||||
function showMenu(e) {
|
||||
if (e.type == "link" && (tabManager.focussedTab || 0).editorType)
|
||||
return open(e);
|
||||
if (e.action == "open")
|
||||
return open(e);
|
||||
|
||||
createMenu(e);
|
||||
|
||||
lastLink = e;
|
||||
|
||||
menu.once("show", function(){
|
||||
var isGit = e && e.command === "git";
|
||||
var items = menu.items;
|
||||
for (var i = 0; i < 6; i++) {
|
||||
items[i].aml.visible = -1;
|
||||
items[i][isGit ? "show" : "hide"]();
|
||||
}
|
||||
});
|
||||
var menu;
|
||||
if (e.type == "link" && (tabManager.focussedTab || 0).editorType) {
|
||||
createLinkMenu();
|
||||
menu = menuLink;
|
||||
}
|
||||
else {
|
||||
createMenu();
|
||||
menuPath.once("show", function(){
|
||||
var isGit = e && e.command === "git";
|
||||
var items = menuPath.items;
|
||||
for (var i = 0; i < 6; i++) {
|
||||
items[i].aml.visible = -1;
|
||||
items[i][isGit ? "show" : "hide"]();
|
||||
}
|
||||
});
|
||||
|
||||
var ace = e.editor;
|
||||
menuPath.once("hide", function(){
|
||||
ace.selection.clearSelection();
|
||||
});
|
||||
|
||||
menu = menuPath;
|
||||
}
|
||||
|
||||
menu.show(e.x, e.y);
|
||||
|
||||
var ace = e.editor;
|
||||
menu.once("hide", function(){
|
||||
ace.selection.clearSelection();
|
||||
});
|
||||
}
|
||||
|
||||
function open(e, cb) {
|
||||
if (typeof e == "string")
|
||||
e = {type: "path", value: e};
|
||||
|
||||
if (e.type == "link") {
|
||||
var href = e.value;
|
||||
if (!/(https?|ftp|file):/.test(href)) {
|
||||
href = "http://" + href;
|
||||
}
|
||||
href = href.replace(/(^https?:\/\/)(0.0.0.0|localhost)(?=:|\/|$)/, function(_, protocol, host) {
|
||||
host = c9.hostname || window.location.host;
|
||||
return protocol + host.replace(/:\d+/, "");
|
||||
});
|
||||
if (e.metaKey || e.ctrlKey)
|
||||
window.open(href);
|
||||
else
|
||||
commands.exec("preview", null, { path: href });
|
||||
} else if (e.type == "path") {
|
||||
var info = buildPath(e);
|
||||
var path = info.path;
|
||||
|
||||
var m = /:(\d*)(?::(\d*))?$/.exec(path);
|
||||
var jump = {};
|
||||
if (m) {
|
||||
if (m[1])
|
||||
jump.row = parseInt(m[1], 10) - 1;
|
||||
if (m[2])
|
||||
jump.column = parseInt(m[2], 10);
|
||||
path = path.slice(0, m.index);
|
||||
}
|
||||
|
||||
// Make sure home dir is marked correctly
|
||||
path = path.replace(reHome, "~");
|
||||
if (path[0] != "/") path = "/" + path;
|
||||
|
||||
fs.stat(path, function(err, stat) {
|
||||
if (err) {
|
||||
return commands.exec("navigate", null, { keyword: path });
|
||||
}
|
||||
if (stat.linkStat)
|
||||
stat = stat.linkStat;
|
||||
if (/directory/.test(stat.mime)) {
|
||||
return tabbehavior.revealtab({path: path});
|
||||
}
|
||||
tabManager.open({
|
||||
path: path,
|
||||
focus: true,
|
||||
document: {
|
||||
ace: {
|
||||
jump: jump
|
||||
}
|
||||
}
|
||||
}, cb);
|
||||
});
|
||||
function openLink(href, inPreview){
|
||||
if (!/^(https?|ftp|file):/.test(href)) {
|
||||
href = "http://" + href;
|
||||
}
|
||||
href = href.replace(/(^https?:\/\/)(0.0.0.0|localhost)(?=:|\/|$)/, function(_, protocol, host) {
|
||||
host = c9.hostname || window.location.host;
|
||||
return protocol + host.replace(/:\d+/, "");
|
||||
});
|
||||
|
||||
if (inPreview)
|
||||
commands.exec("preview", null, { path: href });
|
||||
else
|
||||
window.open(href);
|
||||
}
|
||||
|
||||
function open(e) {
|
||||
if (e.type == "link")
|
||||
return openLink(e.value);
|
||||
|
||||
var info = buildPath(e);
|
||||
var path = info.path;
|
||||
|
||||
var m = /:(\d*)(?::(\d*))?$/.exec(path);
|
||||
var jump = {};
|
||||
if (m) {
|
||||
if (m[1])
|
||||
jump.row = parseInt(m[1], 10) - 1;
|
||||
if (m[2])
|
||||
jump.column = parseInt(m[2], 10);
|
||||
path = path.slice(0, m.index);
|
||||
}
|
||||
|
||||
// Make sure home dir is marked correctly
|
||||
path = path.replace(reHome, "~");
|
||||
if (path[0] != "/") path = "/" + path;
|
||||
|
||||
fs.stat(path, function(err, stat) {
|
||||
if (err) {
|
||||
return commands.exec("navigate", null, { keyword: path });
|
||||
}
|
||||
if (stat.linkStat)
|
||||
stat = stat.linkStat;
|
||||
if (/directory/.test(stat.mime)) {
|
||||
return tabbehavior.revealtab({path: path});
|
||||
}
|
||||
tabManager.open({
|
||||
path: path,
|
||||
focus: true,
|
||||
document: {
|
||||
ace: {
|
||||
jump: jump
|
||||
}
|
||||
}
|
||||
}, function(){});
|
||||
});
|
||||
}
|
||||
|
||||
function buildPath(e) {
|
||||
|
||||
@ -33,10 +33,12 @@
|
||||
color: #fff;
|
||||
outline: none;
|
||||
}
|
||||
.c9terminal .c9terminalcontainer.dark .terminal .reverse-video {
|
||||
.c9terminal .c9terminalcontainer.dark .terminal .reverse-video,
|
||||
.c9terminal .c9terminalcontainer.flat-dark .terminal .reverse-video{
|
||||
outline : 1px solid rgba(255,255,255,0.4);
|
||||
}
|
||||
.c9terminalFocus .c9terminalcontainer.dark .terminal .reverse-video {
|
||||
.c9terminalFocus .c9terminalcontainer.dark .terminal .reverse-video,
|
||||
.c9terminalFocus .c9terminalcontainer.flat-dark .terminal .reverse-video {
|
||||
outline: none;
|
||||
background-color: #f0f0f0;
|
||||
color: #000;
|
||||
|
||||
@ -59,6 +59,7 @@ define(function(require, exports, module) {
|
||||
|
||||
var defaults = {
|
||||
"flat-light" : ["#eaf0f7", "#000000", "#bed1e3", false],
|
||||
"flat-dark" : ["#153649", "#FFFFFF", "#515D77", true],
|
||||
"light" : ["rgb(248, 248, 231)", "#000000", "rgb(137, 193, 253)", false],
|
||||
"light-gray" : ["rgb(248, 248, 231)", "#000000", "rgb(137, 193, 253)", false],
|
||||
"dark" : ["#153649", "#FFFFFF", "#515D77", true],
|
||||
@ -914,11 +915,19 @@ define(function(require, exports, module) {
|
||||
function setTabColor(){
|
||||
var bg = settings.get("user/terminal/@backgroundColor");
|
||||
var shade = util.shadeColor(bg, 0.75);
|
||||
doc.tab.backgroundColor = shade.isLight ? bg : shade.color;
|
||||
var skinName = settings.get("user/general/@skin");
|
||||
var isLight = ~skinName.indexOf("flat") || shade.isLight;
|
||||
doc.tab.backgroundColor = isLight ? bg : shade.color;
|
||||
|
||||
if (shade.isLight) {
|
||||
doc.tab.classList.remove("dark");
|
||||
container.className = "c9terminalcontainer";
|
||||
if (isLight) {
|
||||
if (~skinName.indexOf("flat") && !shade.isLight) {
|
||||
doc.tab.classList.add("dark");
|
||||
container.className = "c9terminalcontainer flat-dark";
|
||||
}
|
||||
else {
|
||||
doc.tab.classList.remove("dark");
|
||||
container.className = "c9terminalcontainer";
|
||||
}
|
||||
}
|
||||
else {
|
||||
doc.tab.classList.add("dark");
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
color : @selected-color;
|
||||
}
|
||||
|
||||
.filetree .tree-row.projectRoot, .filetree .tree-row:first-child {
|
||||
.filetree .tree-row.projectRoot:first-child {
|
||||
margin-right: @tree-first-row-margin-right;
|
||||
}
|
||||
|
||||
|
||||
@ -277,6 +277,7 @@ define(function(require, exports, module) {
|
||||
btnTreeSettings.setAttribute("submenu", mnuFilesSettings);
|
||||
tree.renderer.on("scrollbarVisibilityChanged", updateScrollBarSize);
|
||||
tree.renderer.on("resize", updateScrollBarSize);
|
||||
tree.renderer.scrollBarV.$minWidth = 10;
|
||||
function updateScrollBarSize() {
|
||||
var scrollBarV = tree.renderer.scrollBarV;
|
||||
var w = scrollBarV.isVisible ? scrollBarV.getWidth() : 0;
|
||||
|
||||
@ -190,8 +190,11 @@ define(function(require, exports, module) {
|
||||
? createBind(options.path)
|
||||
: (options.defaultValue || ""),
|
||||
values: options.values,
|
||||
skin: "cboffline"
|
||||
// width: "55"
|
||||
skin: "cboffline",
|
||||
onafterchange: function(e) {
|
||||
if (options.onchange)
|
||||
options.onchange({ value: e.value });
|
||||
}
|
||||
})
|
||||
];
|
||||
break;
|
||||
@ -499,8 +502,8 @@ define(function(require, exports, module) {
|
||||
htmlNode = htmlNode.$int;
|
||||
}
|
||||
// if we have apf node, make sure apf child-parent links do not get broken
|
||||
if (htmlNode.host && container.host) {
|
||||
htmlNode.host.insertBefore(container.host, beforeNode && beforeNode.host);
|
||||
if (htmlNode.host) {
|
||||
htmlNode.host.insertBefore(container, beforeNode && beforeNode.host);
|
||||
} else {
|
||||
htmlNode.insertBefore(container.$ext, beforeNode || null);
|
||||
}
|
||||
|
||||
@ -406,6 +406,7 @@ apf.vbox = function(struct, tagName) {
|
||||
this.$altExt.appendChild(this.$ext);
|
||||
this.$altExt.style.boxSizing = "border-box";
|
||||
this.$altExt.style.display = apf.CSS_DISPLAY_FLEX;
|
||||
this.$altExt.style.flexDirection = this.parentNode.$vbox ? "column" : "row";
|
||||
this.$altExt.style[apf.CSSPREFIX + "BoxOrient"] = "vertical";
|
||||
this.$ext.style[apf.CSS_FLEX_PROP] = 1;
|
||||
var size = this.parentNode.$vbox ? "height" : "width";
|
||||
|
||||
@ -188,6 +188,7 @@ define(function(require, exports, module) {
|
||||
|
||||
function fireWatcherEvent(eventSuffix) {
|
||||
if (event == "error") {
|
||||
if (eventSuffix != ".all") return;
|
||||
// console.error("[watchers] received error for", path, err, stat);
|
||||
}
|
||||
else if (event == "delete") {
|
||||
|
||||
@ -41,7 +41,7 @@ define(function(require, exports, module) {
|
||||
}
|
||||
var skins = options.withSkins;
|
||||
if (skins === true || skins === "all")
|
||||
skins = ["dark", "light", "dark-gray", "light-gray", "flat-light"];
|
||||
skins = ["dark", "light", "dark-gray", "light-gray", "flat-light", "flat-dark"];
|
||||
else
|
||||
skins = skins ? skins.split(/,\s*/) : [];
|
||||
|
||||
|
||||
58
plugins/c9.vfs.client/vfs.listener.js
Normal file
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Listens to pub sub events from the VFS server and reconnects VFS as neccessary
|
||||
*/
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
main.consumes = [
|
||||
"Plugin", "pubsub", "vfs", "metrics", "vfs.endpoint"
|
||||
];
|
||||
main.provides = ["vfs.listener"];
|
||||
return main;
|
||||
|
||||
function main(options, imports, register) {
|
||||
var Plugin = imports.Plugin;
|
||||
var pubsub = imports.pubsub;
|
||||
var vfs = imports.vfs;
|
||||
var vfsEndpoint = imports["vfs.endpoint"];
|
||||
var metrics = imports.metrics;
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
|
||||
var loaded = false;
|
||||
function load() {
|
||||
if (loaded) return false;
|
||||
loaded = true;
|
||||
|
||||
pubsub.on("message", function(m) {
|
||||
if (m.type !== "workspace") return;
|
||||
|
||||
if (m.action == "state_changed") {
|
||||
metrics.increment("vfs.state_changed", 1, true);
|
||||
|
||||
vfsEndpoint.clearCache();
|
||||
vfs.reconnect();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/***** Lifecycle *****/
|
||||
|
||||
plugin.on("load", function() {
|
||||
load();
|
||||
});
|
||||
plugin.on("unload", function() {
|
||||
loaded = false;
|
||||
});
|
||||
|
||||
/***** Register and define API *****/
|
||||
|
||||
plugin.freezePublicAPI({});
|
||||
|
||||
register(null, {
|
||||
"vfs.listener": plugin
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -55,7 +55,6 @@ define(function(require, exports, module) {
|
||||
errorDialog.vfs = plugin;
|
||||
|
||||
var buffer = [];
|
||||
var withInstall = options.withInstall;
|
||||
var dashboardUrl = options.dashboardUrl;
|
||||
var region, vfsBaseUrl, homeUrl, projectUrl, pingUrl, serviceUrl;
|
||||
var eioOptions, connection, consumer, vfs;
|
||||
@ -95,9 +94,7 @@ define(function(require, exports, module) {
|
||||
connection.on("disconnect", onDisconnect);
|
||||
connection.on("connect", onConnect);
|
||||
|
||||
reconnect(function(err) {
|
||||
connection.connect();
|
||||
});
|
||||
reconnectNow();
|
||||
|
||||
function connectEngine() {
|
||||
if (auth.accessToken) {
|
||||
@ -204,6 +201,12 @@ define(function(require, exports, module) {
|
||||
+ (isfile ? "&isfile=1" : ""));
|
||||
}
|
||||
|
||||
function reconnectNow() {
|
||||
reconnect(function(_err) {
|
||||
connection.connect();
|
||||
});
|
||||
}
|
||||
|
||||
function reconnect(callback) {
|
||||
connection.socket.setSocket(null);
|
||||
|
||||
@ -294,10 +297,7 @@ define(function(require, exports, module) {
|
||||
function callback(shouldReconnect) {
|
||||
if (shouldReconnect) {
|
||||
vfsEndpoint.clearCache();
|
||||
reconnect(function(err) {
|
||||
if (err) return console.log(err);
|
||||
connection.connect();
|
||||
});
|
||||
reconnectNow();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -384,6 +384,7 @@ define(function(require, exports, module) {
|
||||
rest: rest,
|
||||
download: download,
|
||||
url: vfsUrl,
|
||||
reconnect: reconnectNow,
|
||||
|
||||
// File management
|
||||
resolve: vfsCall.bind(null, "resolve"),
|
||||
|
||||
@ -108,15 +108,26 @@
|
||||
|
||||
var tests = [];
|
||||
var stats = this.stats;
|
||||
mocha.lastReport = null;
|
||||
mocha.report = { stats: stats, tests: tests };
|
||||
mocha.getReport = function() {
|
||||
return {
|
||||
stats: JSON.parse(JSON.stringify(stats)),
|
||||
tests: tests.map(clean)
|
||||
};
|
||||
};
|
||||
|
||||
runner.on('test end', function(test) {
|
||||
stats.percent = stats.tests / runner.total * 100 | 0;
|
||||
tests.push(clean(test));
|
||||
tests.push(test);
|
||||
});
|
||||
|
||||
runner.on('end', function() {
|
||||
console.log(JSON.stringify(mocha.report, null, 4));
|
||||
// tests might generate errors after they finished running
|
||||
// e.g. using on instead of once can call done second time during app unload
|
||||
// so we save the report at the time when test runner ended.
|
||||
mocha.lastReport = mocha.getReport();
|
||||
console.log(mocha.report);
|
||||
});
|
||||
|
||||
function parseError(err) {
|
||||
@ -252,7 +263,7 @@
|
||||
}
|
||||
|
||||
function getReport() {
|
||||
return mocha.report;
|
||||
return mocha.lastReport;
|
||||
}
|
||||
|
||||
function safeDisconnect(cb) {
|
||||
@ -293,19 +304,30 @@
|
||||
|
||||
c9Test.last = test;
|
||||
mocha.suite.suites.length = 0;
|
||||
var app = window.app;
|
||||
if (app && app.services && app.services.ext)
|
||||
app.services.ext.unloadAllPlugins();
|
||||
function unloadApp() {
|
||||
var app = window.app;
|
||||
window.app = null;
|
||||
try {
|
||||
if (app && app.services && app.services.ext)
|
||||
app.services.ext.unloadAllPlugins();
|
||||
} catch(e) {
|
||||
callback && callback(e, getReport());
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
if (unloadApp()) return;
|
||||
|
||||
setupDom(test);
|
||||
cleanupRequireModules();
|
||||
lastDone = function(err, res) {
|
||||
lastDone = null;
|
||||
if (!onload.remain && unloadApp()) return;
|
||||
callback && callback(err, res || getReport());
|
||||
};
|
||||
|
||||
safeDisconnect(function() {
|
||||
app = null;
|
||||
window.app = null;
|
||||
if (typeof test == "function") {
|
||||
test();
|
||||
if (!running) onload();
|
||||
|
||||
@ -8,6 +8,7 @@ require([
|
||||
"lib/architect/architect"
|
||||
], function (chai, skin, events, theme, architect) {
|
||||
"use strict";
|
||||
chai.Assertion.includeStack = true; // enable stack trace in errors
|
||||
var expect = chai.expect;
|
||||
var EventEmitter = events.EventEmitter;
|
||||
|
||||
|
||||
@ -15,8 +15,9 @@ module.exports = function(manifest, installPath) {
|
||||
var sdk = !manifest.sdk;
|
||||
var win32 = process.platform == "win32";
|
||||
|
||||
if (win32 && process.env.HOME === undefined) {
|
||||
process.env.HOME = process.env.HOMEDRIVE + process.env.HOMEPATH;
|
||||
if (win32) {
|
||||
if (process.env.HOME === undefined)
|
||||
process.env.HOME = process.env.HOMEDRIVE + process.env.HOMEPATH;
|
||||
if (!/msys\/bin|Git\/bin/.test(process.env.PATH))
|
||||
process.env.PATH = path.join(process.env.HOME, ".c9", "msys/bin") + ";" + process.env.PATH;
|
||||
}
|
||||
|
||||