Merge branch 'master' into docker-test-server-1.8.3

pull/223/head
Arron Bailiss 2015-11-02 16:17:27 +00:00
commit 752b3a4d4b
7 zmienionych plików z 68 dodań i 4 usunięć

28
node_modules/c9/json-with-re.js wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,28 @@
/**
* JSON (de-)serializer with support for encosing regular expressions
*/
"use strict";
exports.replacer = function(key, value) {
if (value instanceof RegExp)
return ("__REGEXP " + value.toString());
else
return value;
};
exports.reviver = function(key, value) {
if ((value + "").indexOf("__REGEXP ") == 0) {
var m = value.match(/__REGEXP \/(.*)\/(.*)?/);
return new RegExp(m[1], m[2]);
}
else
return value;
};
exports.stringify = function(value, space) {
return JSON.stringify(value, exports.replacer, space);
};
exports.parse = function(rext) {
return JSON.parse(rext, exports.reviver);
};

27
node_modules/c9/json-with-re_test.js wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,27 @@
/*global describe it before after beforeEach afterEach define*/
"use strict";
"use server";
"use mocha";
require("c9/inline-mocha")(module);
var assert = require("assert-diff");
var reJSON = require("./json-with-re");
describe(__filename, function(){
it("should encode regular expressions", function() {
assert.deepEqual(reJSON.stringify({ foo: /foo/ }), '{"foo":"__REGEXP /foo/"}');
assert.deepEqual(reJSON.stringify({ foo: /foo\//gi }), "{\"foo\":\"__REGEXP /foo\\\\//gi\"}");
});
it("should decode regular expressions", function() {
assert.deepEqual(reJSON.parse('{"foo":"__REGEXP /foo/"}'), { foo: /foo/ });
assert.deepEqual(reJSON.parse("{\"foo\":\"__REGEXP /foo\\\\//gi\"}"), { foo: /foo\//gi });
});
it("should deal with null values", function() {
var o = {
foo: null,
bar: /dd/
};
assert.deepEqual(reJSON.parse(reJSON.stringify(o)), o);
});
});

4
node_modules/c9/urls.js wygenerowano vendored
Wyświetl plik

@ -91,12 +91,12 @@ function getBaseUrl(req, sourceBaseUrlPattern, targetBaseUrlPattern) {
targetHost = "c9.io";
}
if (targetHost.match(/^(ide|vfs)./) && !targetBaseUrlPattern)
if (/^(ide|vfs)./.test(targetHost) && !targetBaseUrlPattern)
console.error(new Error("Warning: no targetBaseUrlPattern specified, will stay at " + targetHost), {
sourceBaseUrlPattern: sourceBaseUrlPattern
});
if (targetHost.match(/^(ide|vfs)./))
if (/^(ide|vfs)./.test(targetHost))
console.trace("Warning: possibly incorrect baseUrl constructed, with 'ide.' in the hostname: " + targetHost);
return replaceDomain(targetBaseUrlPattern || sourceBaseUrlPattern, targetHost)

Wyświetl plik

@ -4,7 +4,7 @@ var url = require("url");
module.exports = function(options, imports, register) {
var trustedDomainsRe = options.trustedDomainsRe || {};
var trustedDomainsRe = options.trustedDomainsRe || /.*/;
imports.connect.addResponseMethod("redirect", function(location) {
this.writeHead(302, {Location: location});

Wyświetl plik

@ -1,7 +1,7 @@
{
"name": "c9",
"description": "New Cloud9 Client",
"version": "3.1.126",
"version": "3.1.136",
"author": "Ajax.org B.V. <info@ajax.org>",
"private": true,
"main": "bin/c9",

Wyświetl plik

@ -183,6 +183,8 @@ define(function(require, module, exports) {
});
plugin.on("unload", function(){
loaded = false;
defaultEditor = null;
group = null;
});
/***** Register and define API *****/

Wyświetl plik

@ -356,6 +356,13 @@ define(function(require, exports, module) {
}
});
});
handle.on("unload", function(){
mnuTerminal = null;
lastEditor = null;
lastTerminal = null;
shownDotsHelp = null;
installPrompted = null;
});
handle.draw = function(){
ui.insertMarkup(null, markupMenu, handle);