From bbfaab263e6a7edf5fb110cc68530887c29629f6 Mon Sep 17 00:00:00 2001 From: Ruben Daniels Date: Wed, 28 Oct 2015 21:10:08 +0000 Subject: [PATCH 01/15] trivial fixes --- plugins/c9.ide.editors/editors.js | 2 ++ plugins/c9.ide.terminal/terminal.js | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/plugins/c9.ide.editors/editors.js b/plugins/c9.ide.editors/editors.js index 510e3273..38c50e54 100644 --- a/plugins/c9.ide.editors/editors.js +++ b/plugins/c9.ide.editors/editors.js @@ -183,6 +183,8 @@ define(function(require, module, exports) { }); plugin.on("unload", function(){ loaded = false; + defaultEditor = null; + group = null; }); /***** Register and define API *****/ diff --git a/plugins/c9.ide.terminal/terminal.js b/plugins/c9.ide.terminal/terminal.js index 832af404..29cbc884 100644 --- a/plugins/c9.ide.terminal/terminal.js +++ b/plugins/c9.ide.terminal/terminal.js @@ -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); From 556d5223f8735e40d99ee338d6eb6c851606cccd Mon Sep 17 00:00:00 2001 From: c9bot Date: Thu, 29 Oct 2015 03:23:38 +0100 Subject: [PATCH 02/15] c9-auto-bump 3.1.127 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 70534d31..bbc7cb87 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.126", + "version": "3.1.127", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From b87ea41386bc27c1e4b1099852db646d2212e44b Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Thu, 29 Oct 2015 15:21:20 +0100 Subject: [PATCH 03/15] hotfix --- node_modules/connect-architect/connect.redirect/redirect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/connect-architect/connect.redirect/redirect.js b/node_modules/connect-architect/connect.redirect/redirect.js index e803c6b1..43b634f6 100644 --- a/node_modules/connect-architect/connect.redirect/redirect.js +++ b/node_modules/connect-architect/connect.redirect/redirect.js @@ -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}); From 7f8807032235352c136a3fc0123d32eeebb5f219 Mon Sep 17 00:00:00 2001 From: c9bot Date: Thu, 29 Oct 2015 15:21:33 +0100 Subject: [PATCH 04/15] c9-auto-bump 3.1.128 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bbc7cb87..1c5067bf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.127", + "version": "3.1.128", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From 4c6eb793de5a9866dfb9ea1ac44f67f5631d1eb8 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Thu, 29 Oct 2015 15:13:31 +0000 Subject: [PATCH 05/15] extract into module --- node_modules/c9/json-with-re.js | 28 ++++++++++++++++++++++++++++ node_modules/c9/json-with-re_test.js | 27 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 node_modules/c9/json-with-re.js create mode 100644 node_modules/c9/json-with-re_test.js diff --git a/node_modules/c9/json-with-re.js b/node_modules/c9/json-with-re.js new file mode 100644 index 00000000..0f748bc1 --- /dev/null +++ b/node_modules/c9/json-with-re.js @@ -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 || "").toString().indexOf("__REGEXP ") == 0) { + var m = value.split("__REGEXP ")[1].match(/\/(.*)\/(.*)?/); + 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); +}; \ No newline at end of file diff --git a/node_modules/c9/json-with-re_test.js b/node_modules/c9/json-with-re_test.js new file mode 100644 index 00000000..5ccb3ecb --- /dev/null +++ b/node_modules/c9/json-with-re_test.js @@ -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); + }); +}); From 0c280207fbf8c3b33cf0486afea6a3324e42c7dc Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Thu, 29 Oct 2015 15:18:16 +0000 Subject: [PATCH 06/15] cleanup --- node_modules/c9/json-with-re.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node_modules/c9/json-with-re.js b/node_modules/c9/json-with-re.js index 0f748bc1..e8f475db 100644 --- a/node_modules/c9/json-with-re.js +++ b/node_modules/c9/json-with-re.js @@ -11,9 +11,9 @@ exports.replacer = function(key, value) { }; exports.reviver = function(key, value) { - if ((value || "").toString().indexOf("__REGEXP ") == 0) { - var m = value.split("__REGEXP ")[1].match(/\/(.*)\/(.*)?/); - return new RegExp(m[1], m[2] || ""); + if ((value + "").indexOf("__REGEXP ") == 0) { + var m = value.match(/__REGEXP \/(.*)\/(.*)?/); + return new RegExp(m[1], m[2]); } else return value; From da21981740513e684733944ee8391b6bda5e6a9d Mon Sep 17 00:00:00 2001 From: c9bot Date: Thu, 29 Oct 2015 16:30:47 +0100 Subject: [PATCH 07/15] c9-auto-bump 3.1.129 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c5067bf..a2c545b8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.128", + "version": "3.1.129", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From 678cf96b1ffbaf971e0c865c9250fc98c32717c0 Mon Sep 17 00:00:00 2001 From: c9bot Date: Thu, 29 Oct 2015 17:40:42 +0100 Subject: [PATCH 08/15] c9-auto-bump 3.1.130 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a2c545b8..d6b956fe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.129", + "version": "3.1.130", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From cf69b96a1aac9fb45c1e4412cf7bc3203d25f2dd Mon Sep 17 00:00:00 2001 From: Matthijs van Henten Date: Thu, 29 Oct 2015 20:50:02 +0000 Subject: [PATCH 09/15] .test is more robust them match --- node_modules/c9/urls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_modules/c9/urls.js b/node_modules/c9/urls.js index c48a3cff..0284030c 100644 --- a/node_modules/c9/urls.js +++ b/node_modules/c9/urls.js @@ -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) From 5779b998b675df7ac5c80c77531dec6a8953bf4c Mon Sep 17 00:00:00 2001 From: c9bot Date: Fri, 30 Oct 2015 00:28:48 +0100 Subject: [PATCH 10/15] c9-auto-bump 3.1.131 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6b956fe..1bd88225 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.130", + "version": "3.1.131", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From feb1b5f13015a0097cb3a3f8c2bacd8f7a4c9b94 Mon Sep 17 00:00:00 2001 From: c9bot Date: Fri, 30 Oct 2015 09:33:58 +0100 Subject: [PATCH 11/15] c9-auto-bump 3.1.132 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1bd88225..6a54d87c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.131", + "version": "3.1.132", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From 25ba890cc196003d8e480b0abb524756dc5c8dd4 Mon Sep 17 00:00:00 2001 From: c9bot Date: Fri, 30 Oct 2015 09:34:31 +0100 Subject: [PATCH 12/15] c9-auto-bump 3.1.133 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a54d87c..8e13c9e2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.132", + "version": "3.1.133", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From 5c787215a0de6e1353f2f78579efae1f7d4b0f40 Mon Sep 17 00:00:00 2001 From: c9bot Date: Fri, 30 Oct 2015 10:07:10 +0100 Subject: [PATCH 13/15] c9-auto-bump 3.1.134 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8e13c9e2..40854eb6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.133", + "version": "3.1.134", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From a5cc1c1bf2556916f0e0292ba8a6475bc2e3572f Mon Sep 17 00:00:00 2001 From: c9bot Date: Fri, 30 Oct 2015 10:39:48 +0100 Subject: [PATCH 14/15] c9-auto-bump 3.1.135 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 40854eb6..9b86268c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.134", + "version": "3.1.135", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9", From bd02d742ff563323fb18ed0b58b19d8ae055c870 Mon Sep 17 00:00:00 2001 From: c9bot Date: Fri, 30 Oct 2015 11:00:20 +0100 Subject: [PATCH 15/15] c9-auto-bump 3.1.136 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9b86268c..3a74d08d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "c9", "description": "New Cloud9 Client", - "version": "3.1.135", + "version": "3.1.136", "author": "Ajax.org B.V. ", "private": true, "main": "bin/c9",