From a11af58899c7022ea2c8a98a4d1874305cf55da5 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 26 Oct 2015 02:14:00 +0400 Subject: [PATCH 1/8] fix typo --- node_modules/ace/lib/ace/layer/font_metrics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/ace/lib/ace/layer/font_metrics.js b/node_modules/ace/lib/ace/layer/font_metrics.js index 7fea61e4..3959cb29 100644 --- a/node_modules/ace/lib/ace/layer/font_metrics.js +++ b/node_modules/ace/lib/ace/layer/font_metrics.js @@ -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; }; From 68046d4445529db1e19c5c46a18e408c04bdbd4d Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 26 Oct 2015 02:17:25 +0400 Subject: [PATCH 2/8] fix removeLicenceComments breaking packaged file --- node_modules/architect-build/module-deps.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/node_modules/architect-build/module-deps.js b/node_modules/architect-build/module-deps.js index 083429bd..daae178c 100644 --- a/node_modules/architect-build/module-deps.js +++ b/node_modules/architect-build/module-deps.js @@ -346,8 +346,11 @@ function removeUseStrict(module) { } function removeLicenceComments(module) { - if (/\.(js|jsx|css|less)/.test(module.path)) - module.source = module.source.replace(/(?:(;)|\n|^)\s*\/\*[\d\D]*?\*\/|(\n|^)\s*\/\/.*/g, "$1"); + if (/\.(js|jsx|css|less)/.test(module.path)) { + module.source = module.source.replace(/(\n|;|^|,)(?:[ \t]*(?:\/\*(?:[^*]|[*](?![/]))*?\*\/|\/\/.*\n))+(\n?)/gm, function(match, $1, $2) { + return $1 == $2 ? $1 : $1 + $2; + }); + } } function removeLicenceCommentsKeepLines(module) { if (/\.(js|jsx|css|less)/.test(module.path)) { From faa9773840909cd9434e0c87ce0eba43ea47a16d Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 26 Oct 2015 04:11:52 +0400 Subject: [PATCH 3/8] fix misaligned buttons in conflict marker --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13718b9b..4836f193 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "c9.ide.run.build": "#0598fff697", "c9.ide.run.debug.xdebug": "#61dcbd0180", "c9.ide.save": "#4a4a60a004", - "c9.ide.scm": "#dbad171e75", + "c9.ide.scm": "#37a4ed0acf", "c9.ide.terminal.monitor": "#b76f1c9f24", "c9.ide.test": "#26cd260224", "c9.ide.test.mocha": "#f6cc482886", From 515478ef969d944ff7805462d640d4738d21bdc7 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 26 Oct 2015 04:24:29 +0400 Subject: [PATCH 4/8] fix +9984 Rename variable broken for two instances on the same line --- node_modules/ace/lib/ace/edit_session.js | 4 +- node_modules/ace/lib/ace/placeholder.js | 127 +++++++++++------------ package.json | 2 +- 3 files changed, 61 insertions(+), 72 deletions(-) diff --git a/node_modules/ace/lib/ace/edit_session.js b/node_modules/ace/lib/ace/edit_session.js index 81ae0680..7813b3d0 100644 --- a/node_modules/ace/lib/ace/edit_session.js +++ b/node_modules/ace/lib/ace/edit_session.js @@ -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 diff --git a/node_modules/ace/lib/ace/placeholder.js b/node_modules/ace/lib/ace/placeholder.js index 0e299594..c4c88b11 100644 --- a/node_modules/ace/lib/ace/placeholder.js +++ b/node_modules/ace/lib/ace/placeholder.js @@ -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++) { diff --git a/package.json b/package.json index 4836f193..34dc13f6 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "c9" ], "c9plugins": { - "c9.ide.language": "#2a4a36fc18", + "c9.ide.language": "#2b5184c931", "c9.ide.language.css": "#a649f2a710", "c9.ide.language.generic": "#77d43cfaf0", "c9.ide.language.html": "#0f4078c187", From b129c7a2e900550081da234b1f57a51d14d162fa Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 26 Oct 2015 22:24:59 +0400 Subject: [PATCH 5/8] fix min width of filetree scrollbar --- plugins/c9.ide.tree/style.css | 2 +- plugins/c9.ide.tree/tree.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/c9.ide.tree/style.css b/plugins/c9.ide.tree/style.css index 7137f666..7d23332f 100644 --- a/plugins/c9.ide.tree/style.css +++ b/plugins/c9.ide.tree/style.css @@ -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; } diff --git a/plugins/c9.ide.tree/tree.js b/plugins/c9.ide.tree/tree.js index 788068a8..477b0540 100644 --- a/plugins/c9.ide.tree/tree.js +++ b/plugins/c9.ide.tree/tree.js @@ -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; From ef5af704cdb11f22e7bef9804fe8090059a16b32 Mon Sep 17 00:00:00 2001 From: Matthijs van Henten Date: Tue, 27 Oct 2015 15:02:46 +0100 Subject: [PATCH 6/8] Revert "Fix issues with rename" --- node_modules/ace/lib/ace/edit_session.js | 4 +- .../ace/lib/ace/layer/font_metrics.js | 2 +- node_modules/ace/lib/ace/placeholder.js | 127 ++++++++++-------- node_modules/architect-build/module-deps.js | 7 +- package.json | 4 +- plugins/c9.ide.tree/style.css | 2 +- plugins/c9.ide.tree/tree.js | 1 - 7 files changed, 77 insertions(+), 70 deletions(-) diff --git a/node_modules/ace/lib/ace/edit_session.js b/node_modules/ace/lib/ace/edit_session.js index 7813b3d0..81ae0680 100644 --- a/node_modules/ace/lib/ace/edit_session.js +++ b/node_modules/ace/lib/ace/edit_session.js @@ -1158,7 +1158,7 @@ EditSession.$uid = 0; this.addFolds(delta.folds); } } - if (!dontSelect && this.$undoSelect) { + if (!dontSelect) { // console.log(deltas.selectionBefore + "uuu") if (deltas.selectionBefore) this.selection.fromJSON(deltas.selectionBefore); @@ -1187,7 +1187,7 @@ EditSession.$uid = 0; } } - if (!dontSelect && this.$undoSelect) { + if (!dontSelect) { if (deltas.selectionAfter) this.selection.fromJSON(deltas.selectionAfter); else diff --git a/node_modules/ace/lib/ace/layer/font_metrics.js b/node_modules/ace/lib/ace/layer/font_metrics.js index 3959cb29..7fea61e4 100644 --- a/node_modules/ace/lib/ace/layer/font_metrics.js +++ b/node_modules/ace/lib/ace/layer/font_metrics.js @@ -172,7 +172,7 @@ var FontMetrics = exports.FontMetrics = function(parentEl, interval) { this.getCharacterWidth = function(ch) { var w = this.charSizes[ch]; if (w === undefined) { - w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width; + this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width; } return w; }; diff --git a/node_modules/ace/lib/ace/placeholder.js b/node_modules/ace/lib/ace/placeholder.js index c4c88b11..0e299594 100644 --- a/node_modules/ace/lib/ace/placeholder.js +++ b/node_modules/ace/lib/ace/placeholder.js @@ -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(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.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.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,12 +117,16 @@ 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); + }); }); }; @@ -133,7 +137,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); @@ -147,61 +151,64 @@ 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(range.start.row !== range.end.row) return; + if(range.start.row !== this.pos.row) return; + if (this.$updating) 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; - this.updateAnchors(delta); - - if (inMainRange) + 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.length += 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); + 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)); + } } - } 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)); + // 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(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); }; /** @@ -230,10 +237,14 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) * **/ this.detach = function() { - this.session.removeMarker(this.pos && this.pos.markerId); + this.session.removeMarker(this.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; }; @@ -245,8 +256,8 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) * **/ this.cancel = function() { - if (this.$undoStackDepth === -1) - return; + if(this.$undoStackDepth === -1) + throw Error("Canceling placeholders only supported with undo manager attached to session."); var undoManager = this.session.getUndoManager(); var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth; for (var i = 0; i < undosRequired; i++) { diff --git a/node_modules/architect-build/module-deps.js b/node_modules/architect-build/module-deps.js index daae178c..083429bd 100644 --- a/node_modules/architect-build/module-deps.js +++ b/node_modules/architect-build/module-deps.js @@ -346,11 +346,8 @@ function removeUseStrict(module) { } function removeLicenceComments(module) { - if (/\.(js|jsx|css|less)/.test(module.path)) { - module.source = module.source.replace(/(\n|;|^|,)(?:[ \t]*(?:\/\*(?:[^*]|[*](?![/]))*?\*\/|\/\/.*\n))+(\n?)/gm, function(match, $1, $2) { - return $1 == $2 ? $1 : $1 + $2; - }); - } + if (/\.(js|jsx|css|less)/.test(module.path)) + module.source = module.source.replace(/(?:(;)|\n|^)\s*\/\*[\d\D]*?\*\/|(\n|^)\s*\/\/.*/g, "$1"); } function removeLicenceCommentsKeepLines(module) { if (/\.(js|jsx|css|less)/.test(module.path)) { diff --git a/package.json b/package.json index 307aafb4..70534d31 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "c9" ], "c9plugins": { - "c9.ide.language": "#2b5184c931", + "c9.ide.language": "#a6ffafabce", "c9.ide.language.css": "#a649f2a710", "c9.ide.language.generic": "#77d43cfaf0", "c9.ide.language.html": "#0f4078c187", @@ -106,7 +106,7 @@ "c9.ide.run.build": "#0598fff697", "c9.ide.run.debug.xdebug": "#61dcbd0180", "c9.ide.save": "#4a4a60a004", - "c9.ide.scm": "#37a4ed0acf", + "c9.ide.scm": "#aabd0d181e", "c9.ide.terminal.monitor": "#b76f1c9f24", "c9.ide.test": "#26cd260224", "c9.ide.test.mocha": "#f6cc482886", diff --git a/plugins/c9.ide.tree/style.css b/plugins/c9.ide.tree/style.css index 7d23332f..7137f666 100644 --- a/plugins/c9.ide.tree/style.css +++ b/plugins/c9.ide.tree/style.css @@ -20,7 +20,7 @@ color : @selected-color; } -.filetree .tree-row.projectRoot:first-child { +.filetree .tree-row.projectRoot, .filetree .tree-row:first-child { margin-right: @tree-first-row-margin-right; } diff --git a/plugins/c9.ide.tree/tree.js b/plugins/c9.ide.tree/tree.js index 477b0540..788068a8 100644 --- a/plugins/c9.ide.tree/tree.js +++ b/plugins/c9.ide.tree/tree.js @@ -277,7 +277,6 @@ 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; From 80a98cf92d01ea9e7aa37a20194786669d145464 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Mon, 26 Oct 2015 15:38:37 +0000 Subject: [PATCH 7/8] use trusted redirect --- .../connect-architect/connect.redirect/redirect.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/node_modules/connect-architect/connect.redirect/redirect.js b/node_modules/connect-architect/connect.redirect/redirect.js index 010e98e8..a733ac71 100644 --- a/node_modules/connect-architect/connect.redirect/redirect.js +++ b/node_modules/connect-architect/connect.redirect/redirect.js @@ -1,11 +1,23 @@ "use strict"; +var url = require("url"); + module.exports = function(options, imports, register) { + var trustedHosts = options.trustedHosts || {}; + imports.connect.addResponseMethod("redirect", function(location) { this.writeHead(302, {Location: location}); this.end(""); }); + imports.connect.addResponseMethod("secureRedirect", function(location) { + var parsedLocation = url.parse(location); + if (!(location.host in trustedHosts)) + location = parsedLocation.path; + + this.writeHead(302, {Location: location}); + this.end(""); + }); imports.connect.addResponseMethod("returnTo", function(req, defaultReturn) { var url = defaultReturn || "/"; if (req.session && req.session.returnTo) { From 237f0d68ae3a2d13a216e5707d48a1be641be061 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Mon, 26 Oct 2015 15:52:51 +0000 Subject: [PATCH 8/8] resure redirects in nc plugin --- node_modules/connect-architect/connect.redirect/redirect.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/node_modules/connect-architect/connect.redirect/redirect.js b/node_modules/connect-architect/connect.redirect/redirect.js index a733ac71..e803c6b1 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 trustedHosts = options.trustedHosts || {}; + var trustedDomainsRe = options.trustedDomainsRe || {}; imports.connect.addResponseMethod("redirect", function(location) { this.writeHead(302, {Location: location}); @@ -12,7 +12,8 @@ module.exports = function(options, imports, register) { }); imports.connect.addResponseMethod("secureRedirect", function(location) { var parsedLocation = url.parse(location); - if (!(location.host in trustedHosts)) + + if (!trustedDomainsRe.test(parsedLocation.host)) location = parsedLocation.path; this.writeHead(302, {Location: location});