kopia lustrzana https://github.com/c9/core
Merge branch 'master' of github.com:c9/newclient into fix/deps
Conflicts: .c9/project.settingspull/223/head
commit
71fea3f694
|
@ -186,6 +186,7 @@ module.exports = function(config, optimist) {
|
|||
"./c9.vfs.server/cache",
|
||||
"./c9.vfs.server/download",
|
||||
"./c9.vfs.server/filelist",
|
||||
"./c9.vfs.server/fetchcache",
|
||||
"./c9.vfs.server/statics",
|
||||
"./c9.analytics/mock_analytics",
|
||||
"./c9.metrics/mock_metrics",
|
||||
|
|
|
@ -294,6 +294,8 @@ function LineWidgets(session) {
|
|||
if (!w || !w.el) continue;
|
||||
if (w.session != this.session) continue;
|
||||
if (!w._inDocument) {
|
||||
if (this.session.lineWidgets[w.row] != w)
|
||||
continue;
|
||||
w._inDocument = true;
|
||||
renderer.container.appendChild(w.el);
|
||||
}
|
||||
|
|
|
@ -98,6 +98,7 @@ var VScrollBar = function(parent, renderer) {
|
|||
this.width = dom.scrollbarWidth(parent.ownerDocument);
|
||||
this.inner.style.width =
|
||||
this.element.style.width = (this.width || 15) + 5 + "px";
|
||||
this.$minWidth = 0;
|
||||
};
|
||||
|
||||
oop.inherits(VScrollBar, ScrollBar);
|
||||
|
@ -124,7 +125,7 @@ oop.inherits(VScrollBar, ScrollBar);
|
|||
* @returns {Number}
|
||||
**/
|
||||
this.getWidth = function() {
|
||||
return this.isVisible ? this.width : 0;
|
||||
return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -799,8 +799,10 @@ var Selection = function(session) {
|
|||
var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column);
|
||||
|
||||
if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) {
|
||||
if (this.session.lineWidgets && this.session.lineWidgets[docPos.row])
|
||||
docPos.row++;
|
||||
if (this.session.lineWidgets && this.session.lineWidgets[docPos.row]) {
|
||||
if (docPos.row > 0 || rows > 0)
|
||||
docPos.row++;
|
||||
}
|
||||
}
|
||||
|
||||
// move the cursor and update the desired column
|
||||
|
|
|
@ -1,15 +1,24 @@
|
|||
var _ = require("lodash");
|
||||
|
||||
|
||||
var internalDomain = ['c9.io', 'clou9beta.com'];
|
||||
|
||||
function hasInternalDomain(email) {
|
||||
if (!email) return false;
|
||||
|
||||
var emailElements = email.split("@");
|
||||
var emailDomain = emailElements[emailElements.length - 1];
|
||||
|
||||
return _.contains(internalDomain, emailDomain);
|
||||
if (define === undefined) {
|
||||
var define = function(fn) {
|
||||
fn(require, exports, module);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = hasInternalDomain;
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var _ = require("lodash");
|
||||
|
||||
var internalDomain = ['c9.io', 'clou9beta.com'];
|
||||
|
||||
function hasInternalDomain(email) {
|
||||
if (!email) return false;
|
||||
|
||||
var emailElements = email.split("@");
|
||||
var emailDomain = emailElements[emailElements.length - 1];
|
||||
|
||||
return _.contains(internalDomain, emailDomain);
|
||||
}
|
||||
|
||||
module.exports = hasInternalDomain;
|
||||
});
|
|
@ -25,9 +25,27 @@ function main(options, imports, register) {
|
|||
/**
|
||||
* Get a desired base URL, given some context.
|
||||
*
|
||||
* @param req The current request object or URL
|
||||
* @param {String} [sourceUrlPattern] The source URL pattern, e.g. https://ide.$DOMAIN
|
||||
* @param {String} targetBaseUrlPattern The target URL pattern, e.g. https://$DOMAIN
|
||||
* Example for a request coming into the IDE service:
|
||||
*
|
||||
* ```
|
||||
* getBaseUrl(req, "https://ide.$DOMAIN", "https://preview.$DOMAIN");
|
||||
* ```
|
||||
*
|
||||
* The above example will determine the domain name from the request,
|
||||
* by stripping off the "https://ide." part. So, for a domain like
|
||||
* "https://ide.c9.io" we'll get "c9.io". For a domain like
|
||||
* "https://ide.dogfooding-lennartcl.c9.io" we'll get dogfooding-lennartcl.c9.io.
|
||||
* If there is no match, a warning is shown. The target pattern
|
||||
* is used to construct the resulting URL, e.g. https://preview.c9.io.
|
||||
*
|
||||
* @param req
|
||||
* The current request object or URL
|
||||
* @param {String} [sourceUrlPattern]
|
||||
* The URL pattern of the current service, e.g. https://ide.$DOMAIN if
|
||||
* we are getting an incoming request for the IDE service
|
||||
* @param {String} targetBaseUrlPattern
|
||||
* The URL pattern of the target service. E.g., if we want to
|
||||
* construct the base URL of the API service, this might be https://api.$DOMAIN.
|
||||
*/
|
||||
plugin.getBaseUrl = function(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
|
||||
var sourceHost = req.headers && req.headers.host
|
||||
|
|
14
package.json
14
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "c9",
|
||||
"description": "New Cloud9 Client",
|
||||
"version": "3.1.34",
|
||||
"version": "3.1.51",
|
||||
"author": "Ajax.org B.V. <info@ajax.org>",
|
||||
"private": true,
|
||||
"main": "bin/c9",
|
||||
|
@ -55,7 +55,7 @@
|
|||
"c9"
|
||||
],
|
||||
"c9plugins": {
|
||||
"c9.ide.language": "#ff78609c3f",
|
||||
"c9.ide.language": "#2a4a36fc18",
|
||||
"c9.ide.language.css": "#a649f2a710",
|
||||
"c9.ide.language.generic": "#77d43cfaf0",
|
||||
"c9.ide.language.html": "#0f4078c187",
|
||||
|
@ -80,7 +80,7 @@
|
|||
"c9.ide.ace.split": "#0ae0151c78",
|
||||
"c9.ide.ace.statusbar": "#d95be89d53",
|
||||
"c9.ide.ace.stripws": "#cf0f42ac59",
|
||||
"c9.ide.behaviors": "#e2c7f68242",
|
||||
"c9.ide.behaviors": "#05e5681e2e",
|
||||
"c9.ide.closeconfirmation": "#cee4674141",
|
||||
"c9.ide.configuration": "#a9066299a2",
|
||||
"c9.ide.dialog.wizard": "#7667ec79a8",
|
||||
|
@ -102,14 +102,14 @@
|
|||
"c9.ide.recentfiles": "#7c099abf40",
|
||||
"c9.ide.remote": "#301d2ab519",
|
||||
"c9.ide.processlist": "#2b12cd1bdd",
|
||||
"c9.ide.run": "#89a02ba00a",
|
||||
"c9.ide.run": "#f360984649",
|
||||
"c9.ide.run.build": "#0598fff697",
|
||||
"c9.ide.run.debug.xdebug": "#61dcbd0180",
|
||||
"c9.ide.save": "#e00549cb0f",
|
||||
"c9.ide.scm": "#62011267ea",
|
||||
"c9.ide.scm": "#573585193a",
|
||||
"c9.ide.terminal.monitor": "#b76f1c9f24",
|
||||
"c9.ide.test": "#d312a01ac6",
|
||||
"c9.ide.test.mocha": "#79ff886c04",
|
||||
"c9.ide.test": "#302388c9eb",
|
||||
"c9.ide.test.mocha": "#c81861817e",
|
||||
"c9.ide.theme.flat": "#2de8414db7",
|
||||
"c9.ide.threewaymerge": "#229382aa0b",
|
||||
"c9.ide.undo": "#b028bcb4d5",
|
||||
|
|
|
@ -1070,7 +1070,7 @@ define(function(require, module, exports) {
|
|||
options.document.title = basename(path);
|
||||
options.document.tooltip = path;
|
||||
}
|
||||
if (typeof options.value == "string")
|
||||
if (typeof options.value == "string" && !options.newOnError)
|
||||
options.document.value = options.value;
|
||||
// if (options.document.filter === undefined)
|
||||
// options.document.filter = true;
|
||||
|
@ -1086,7 +1086,7 @@ define(function(require, module, exports) {
|
|||
var doc = options.document;
|
||||
var loadFromDisk = path
|
||||
&& (!doc || doc.value === undefined)
|
||||
&& options.value === undefined
|
||||
&& (options.value === undefined || options.newOnError)
|
||||
// autoload to false prevents loading data, used by image editor
|
||||
&& (!editor || editor.autoload !== false);
|
||||
|
||||
|
|
|
@ -1226,7 +1226,7 @@
|
|||
@dropdown-black-image-height: 5px;
|
||||
@dropdown-black-background-position: 50% 50%;
|
||||
@dropdown-black-height: 28px;
|
||||
@dropdown-black-padding: 8px 0 5px 9px;
|
||||
@dropdown-black-padding: 7px 8px 5px 9px;
|
||||
@dropdown-black-font-family: @general-font-family;
|
||||
@dropdown-black-font-size: 13px;
|
||||
@dropdown-black-button-width: 24px;
|
||||
|
|
|
@ -305,6 +305,9 @@
|
|||
.filetree .tree-row > span.caption {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.filetree .tree-row.heading > span.caption {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.toolbar-top.basic .c9-menu-btnDown.scripts{
|
||||
border: 0;
|
||||
|
@ -417,6 +420,8 @@
|
|||
.has_apf .toolbar-top .sbtb_middle{
|
||||
height: auto;
|
||||
padding: 4px 25px 3px 5px;
|
||||
border: 0;
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
||||
.top-test-panel{
|
||||
|
@ -424,8 +429,13 @@
|
|||
box-shadow: none;
|
||||
}
|
||||
|
||||
.runner-form-header{
|
||||
border-bottom: 1px solid @border-highlight-dark;
|
||||
body .runner-form-header{
|
||||
background: whitesmoke;
|
||||
}
|
||||
|
||||
.runtestbtn .icon{
|
||||
background-position: 1px 2px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
@media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 1.25dppx) {
|
||||
|
@ -483,4 +493,7 @@
|
|||
.c9-toolbarbutton-glossy .c9-icon {
|
||||
height: 19px;
|
||||
}
|
||||
.runtestbtn .icon{
|
||||
height: 21px;
|
||||
}
|
||||
}
|
|
@ -278,9 +278,9 @@ define(function(require, exports, module) {
|
|||
tree.renderer.on("scrollbarVisibilityChanged", updateScrollBarSize);
|
||||
tree.renderer.on("resize", updateScrollBarSize);
|
||||
function updateScrollBarSize() {
|
||||
var w = tree.renderer.scrollBarV.getWidth();
|
||||
var scrollBarV = tree.renderer.scrollBarV;
|
||||
var w = scrollBarV.isVisible ? scrollBarV.getWidth() : 0;
|
||||
btnTreeSettings.$ext.style.marginRight = Math.max(w - 2, 0) + "px";
|
||||
tree.renderer.scroller.style.right = Math.max(w, 10) + "px";
|
||||
}
|
||||
|
||||
tree.on("drop", function(e) {
|
||||
|
|
|
@ -240,9 +240,13 @@ define(function(require, exports, module) {
|
|||
value: options.path
|
||||
? createBind(options.path)
|
||||
: (options.defaultValue || ""),
|
||||
min: options.min,
|
||||
max: options.max,
|
||||
realtime: typeof options.realtime !== "undefined" ? options.realtime : 1
|
||||
min: options.min || 0,
|
||||
max: options.max || 10,
|
||||
realtime: typeof options.realtime !== "undefined" ? options.realtime : 1,
|
||||
onafterchange: function(e) {
|
||||
if (options.onchange)
|
||||
options.onchange({ value: e.value });
|
||||
},
|
||||
})
|
||||
];
|
||||
break;
|
||||
|
@ -254,16 +258,24 @@ define(function(require, exports, module) {
|
|||
: (options.defaultCheckboxValue || ""),
|
||||
width: width, maxwidth: maxwidth,
|
||||
label: name + ":",
|
||||
skin: "checkbox_black"
|
||||
skin: "checkbox_black",
|
||||
onafterchange: function(e) {
|
||||
if (options.onchange)
|
||||
options.onchange({ value: e.value, type: "checkbox" });
|
||||
},
|
||||
}),
|
||||
new ui.spinner({
|
||||
width: options.width || widths["checked-spinner"],
|
||||
value: options.path
|
||||
? createBind(options.path)
|
||||
: (options.defaultValue || ""),
|
||||
min: options.min,
|
||||
max: options.max,
|
||||
realtime: typeof options.realtime !== "undefined" ? options.realtime : 1
|
||||
min: options.min || 0,
|
||||
max: options.max || 10,
|
||||
realtime: typeof options.realtime !== "undefined" ? options.realtime : 1,
|
||||
onafterchange: function(e) {
|
||||
if (options.onchange)
|
||||
options.onchange({ value: e.value, type: "spinner" });
|
||||
},
|
||||
})
|
||||
];
|
||||
break;
|
||||
|
@ -275,7 +287,11 @@ define(function(require, exports, module) {
|
|||
: (options.defaultValue || ""),
|
||||
width: options.width || widths["checked-single"],
|
||||
label: name,
|
||||
skin: "checkbox_black"
|
||||
skin: "checkbox_black",
|
||||
onafterchange: function(e){
|
||||
if (options.onchange)
|
||||
options.onchange({ value: e.value });
|
||||
}
|
||||
})
|
||||
];
|
||||
break;
|
||||
|
|
|
@ -190,7 +190,7 @@ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|||
* ```
|
||||
*/
|
||||
|
||||
EventEmitter.prototype.once = function(type, listener) {
|
||||
EventEmitter.prototype.once = function(type, listener, plugin) {
|
||||
var self = this;
|
||||
|
||||
var wrapped = function() {
|
||||
|
@ -199,7 +199,7 @@ EventEmitter.prototype.once = function(type, listener) {
|
|||
}
|
||||
wrapped.listener = listener;
|
||||
|
||||
self.on(type, wrapped);
|
||||
self.on(type, wrapped, plugin);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,106 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
main.consumes = ["Plugin", "vfs.cache", "connect"];
|
||||
main.provides = ["vfs.fetchcache"];
|
||||
return main;
|
||||
|
||||
function main(options, imports, register) {
|
||||
var Plugin = imports.Plugin;
|
||||
var cache = imports["vfs.cache"];
|
||||
|
||||
var error = require("http-error");
|
||||
var Path = require("path");
|
||||
var async = require("async");
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
var plugin = new Plugin("Ajax.org", main.consumes);
|
||||
|
||||
var compress = imports.connect.getModule().compress();
|
||||
|
||||
cache.registerExtension(function(vfs, callback) {
|
||||
var restful = vfs.restful.home;
|
||||
|
||||
vfs.restful.home = function(req, res, next) {
|
||||
var path = unescape(req.uri.pathname);
|
||||
|
||||
if (req.method == "GET" && path.indexOf("/.c9/cache") === 0) {
|
||||
compress(req, res, function(err) {
|
||||
if (err) return next(err);
|
||||
|
||||
fetchcache(vfs.vfs, vfs.vfs.env.HOME, vfs.vfsOptions, req, res, next);
|
||||
});
|
||||
}
|
||||
else
|
||||
restful(req, res, next);
|
||||
};
|
||||
|
||||
callback();
|
||||
});
|
||||
|
||||
function readFile(vfs, path, callback) {
|
||||
vfs.readfile(path, { encoding: "utf8" }, function(err, meta) {
|
||||
if (err)
|
||||
return callback(err);
|
||||
|
||||
var data = "";
|
||||
meta.stream.on("data", function(d) {
|
||||
data += d;
|
||||
})
|
||||
|
||||
var done;
|
||||
meta.stream.on("error", function(e) {
|
||||
if (done) return;
|
||||
done = true;
|
||||
callback(e);
|
||||
});
|
||||
|
||||
meta.stream.on("end", function() {
|
||||
if (done) return;
|
||||
done = true;
|
||||
callback(null, data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function fetchcache(vfs, root, vfsOptions, req, res, next) {
|
||||
var path = unescape(req.uri.pathname);
|
||||
|
||||
// sandbox path to workspaceDir
|
||||
path = Path.join(root, path);
|
||||
// if (path.indexOf(root) !== 0)
|
||||
// return next(new error.Forbidden("Can't list files outside of the workspace"));
|
||||
|
||||
// Fetch index
|
||||
readFile(vfs, Path.join(path, "index"), function(err, list){
|
||||
if (err) {
|
||||
var httpErr = new error.NotFound(err.message);
|
||||
return next(httpErr);
|
||||
}
|
||||
|
||||
// Fetch each file in the index
|
||||
async.mapLimit(list.split("\n"), 50, function(p, callback){
|
||||
readFile(vfs, Path.join(path, p.replace(/\//g, "\\")), function(ignore, data){
|
||||
var json;
|
||||
try { json = JSON.parse(data); }
|
||||
catch(e) { json = { type: "file", path: p } }
|
||||
|
||||
callback(null, json);
|
||||
});
|
||||
}, function(ignore, results){
|
||||
res.writeHead(200, { "Content-Type": "text/json" });
|
||||
res.write(JSON.stringify(results));
|
||||
res.end();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
plugin.freezePublicAPI({
|
||||
// for testing only
|
||||
fetchcache: fetchcache
|
||||
});
|
||||
|
||||
register(null, { "vfs.fetchcache" : plugin });
|
||||
}
|
||||
});
|
|
@ -24,12 +24,13 @@ var DEFAULT_SETTINGS = getDefaultSettings();
|
|||
|
||||
var shortcuts = {
|
||||
"dev" : ["ide", "preview", "vfs", "api", "sapi", "proxy", "redis", "profile", "oldclient", "homepage", "apps-proxy", "-s", "devel"],
|
||||
"odev" : ["ide", "preview", "vfs", "api", "proxy", "oldclient", "homepage", "apps-proxy", "profile", "worker", "-s", "onlinedev"],
|
||||
"onlinedev" : ["ide", "preview", "vfs", "api", "proxy", "oldclient", "homepage", "apps-proxy", "profile", "worker", "-s", "onlinedev"],
|
||||
"bill" : ["ide", "preview", "vfs", "api", "proxy", "oldclient", "homepage", "apps-proxy", "profile", "-s", "billing"],
|
||||
"beta" : ["ide", "preview", "vfs", "proxy", "-s", "beta"],
|
||||
"ci" : ["ide", "preview", "vfs", "proxy", "-s", "ci"],
|
||||
"s" : ["standalone", "-s", "standalone"]
|
||||
};
|
||||
shortcuts.odev = shortcuts.onlinedev; // For backwards compatibility, if you see this in 2016 remove this line
|
||||
var delayLoadConfigs = ["preview", "api", "oldclient", "apps-proxy", "worker"];
|
||||
|
||||
module.exports = main;
|
||||
|
|
Ładowanie…
Reference in New Issue