kopia lustrzana https://github.com/c9/core
Merge remote-tracking branch 'origin/master' into vfs-fix-collab-code-reverting
commit
f615aabc9e
|
@ -113,7 +113,8 @@ module.exports = function(options) {
|
|||
debug: debug,
|
||||
installPath: options.installPath,
|
||||
dashboardUrl: options.dashboardUrl,
|
||||
accountUrl: options.accountUrl
|
||||
accountUrl: options.accountUrl,
|
||||
rejectUnauthorized: options.rejectUnauthorized
|
||||
},
|
||||
{
|
||||
packagePath: "plugins/c9.vfs.client/endpoint",
|
||||
|
@ -702,7 +703,6 @@ module.exports = function(options) {
|
|||
premium: options.project.premium,
|
||||
}
|
||||
},
|
||||
"plugins/c9.ide.abtesting/abtesting",
|
||||
{
|
||||
packagePath: "plugins/c9.ide.welcome/welcome",
|
||||
staticPrefix: staticPrefix + "/plugins/c9.ide.welcome",
|
||||
|
|
|
@ -148,7 +148,7 @@ var EditSession = function(text, mode) {
|
|||
this.$undoSelect = true;
|
||||
|
||||
this.$foldData = [];
|
||||
this.id = "session" + EditSession.$uid;
|
||||
this.id = "session" + (++EditSession.$uid);
|
||||
this.$foldData.toString = function() {
|
||||
return this.join("\n");
|
||||
};
|
||||
|
|
|
@ -1486,7 +1486,7 @@ var Editor = function(renderer, session) {
|
|||
var indentString = lang.stringRepeat(" ", count);
|
||||
} else {
|
||||
var count = column % size;
|
||||
while (line[range.start.column] == " " && count) {
|
||||
while (line[range.start.column - 1] == " " && count) {
|
||||
range.start.column--;
|
||||
count--;
|
||||
}
|
||||
|
|
|
@ -124,6 +124,12 @@ module.exports = {
|
|||
var range = editor.getSelectionRange();
|
||||
assert.position(range.start, 1, 7);
|
||||
assert.position(range.end, 2, 7);
|
||||
|
||||
session.setValue(" x");
|
||||
session.setOption("useSoftTabs", false);
|
||||
editor.selection.moveTo(0, 3);
|
||||
editor.indent();
|
||||
assert.equal("\tx", session.toString());
|
||||
},
|
||||
|
||||
"test: indent selected lines" : function() {
|
||||
|
|
|
@ -364,10 +364,11 @@ var TextInput = function(parentNode, host) {
|
|||
return;
|
||||
// console.log("onCompositionStart", inComposition)
|
||||
inComposition = {};
|
||||
inComposition.canUndo = host.session.$undoManager;
|
||||
host.onCompositionStart();
|
||||
setTimeout(onCompositionUpdate, 0);
|
||||
host.on("mousedown", onCompositionEnd);
|
||||
if (!host.selection.isEmpty()) {
|
||||
if (inComposition.canUndo && !host.selection.isEmpty()) {
|
||||
host.insert("");
|
||||
host.session.markUndoGroup();
|
||||
host.selection.clearSelection();
|
||||
|
@ -385,7 +386,8 @@ var TextInput = function(parentNode, host) {
|
|||
host.onCompositionUpdate(val);
|
||||
if (inComposition.lastValue)
|
||||
host.undo();
|
||||
inComposition.lastValue = val;
|
||||
if (inComposition.canUndo)
|
||||
inComposition.lastValue = val;
|
||||
if (inComposition.lastValue) {
|
||||
var r = host.selection.getRange();
|
||||
host.insert(inComposition.lastValue);
|
||||
|
|
|
@ -277,6 +277,8 @@ var CstyleBehaviour = function() {
|
|||
var pair;
|
||||
if (rightChar == quote) {
|
||||
pair = stringBefore !== stringAfter;
|
||||
if (pair && /string\.end/.test(rightToken.type))
|
||||
pair = false;
|
||||
} else {
|
||||
if (stringBefore && !stringAfter)
|
||||
return null; // wrap string with different quote
|
||||
|
|
|
@ -84,7 +84,7 @@ var ShHighlightRules = function() {
|
|||
token : ["text", "comment"],
|
||||
regex : /(^|\s)(#.*)$/
|
||||
}, {
|
||||
token : "string",
|
||||
token : "string.start",
|
||||
regex : '"',
|
||||
push : [{
|
||||
token : "constant.language.escape",
|
||||
|
@ -95,7 +95,7 @@ var ShHighlightRules = function() {
|
|||
token : "keyword.operator",
|
||||
regex : /`/ // TODO highlight `
|
||||
}, {
|
||||
token : "string",
|
||||
token : "string.end",
|
||||
regex : '"',
|
||||
next: "pop"
|
||||
}, {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = function isZuoraId(value){
|
||||
if (/^\d+$/.test(value))
|
||||
return false;
|
||||
|
||||
return /^[a-z0-9]{32}$/.test(value);
|
||||
};
|
|
@ -0,0 +1,42 @@
|
|||
"use strict";
|
||||
"use mocha";
|
||||
|
||||
require("c9/inline-mocha")(module);
|
||||
var assert = require("assert");
|
||||
var isZuoraId= require("c9/is-zuora-id");
|
||||
|
||||
describe("iz-zuora-id-test", function() {
|
||||
|
||||
it("returns false when account id undefined", function() {
|
||||
assert.equal(false, isZuoraId(undefined), "should return false when account id undefined");
|
||||
});
|
||||
|
||||
it("returns false when account id null", function() {
|
||||
assert.equal(false, isZuoraId(null), "should return false when account id null");
|
||||
});
|
||||
|
||||
it("returns false when account id is an empty string", function() {
|
||||
assert.equal(false, isZuoraId(""), "should return false when account id is an empty string");
|
||||
});
|
||||
|
||||
it("returns false when account id contains only digits", function() {
|
||||
var accountId = "12345700674455";
|
||||
assert.equal(false, isZuoraId(accountId), "should return false when account id contains only digits");
|
||||
});
|
||||
|
||||
it("returns false when account id contains only digits and has the correct length", function() {
|
||||
var accountId = "123456789101112131415161718192021";
|
||||
assert.equal(false, isZuoraId(accountId), "should return false when account id contains only digits and has the correct length");
|
||||
});
|
||||
|
||||
it("returns false when account id contains both digits and letters but does not have the correct length", function() {
|
||||
var accountId = "78654hjfgf764674h87634876g7h89h";
|
||||
assert.equal(false, isZuoraId(accountId), "should return false");
|
||||
});
|
||||
|
||||
it("returns true when account id has both letters and digits and correct length", function() {
|
||||
var accountId = "2c92a0f850a7a1b50150c672fa3a6ddd";
|
||||
|
||||
assert.equal(true, isZuoraId(accountId), "should return true when account id has both letters and digits and correct length");
|
||||
});
|
||||
});
|
|
@ -8,8 +8,8 @@
|
|||
"email": "fabian@c9.io"
|
||||
}],
|
||||
"dependencies": {
|
||||
"engine.io": "~1.5.1",
|
||||
"engine.io-client": "~1.5.1",
|
||||
"engine.io": "~1.6.9",
|
||||
"engine.io-client": "~1.6.9",
|
||||
"amd-loader": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
32
package.json
32
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "c9",
|
||||
"description": "New Cloud9 Client",
|
||||
"version": "3.1.2532",
|
||||
"version": "3.1.2639",
|
||||
"author": "Ajax.org B.V. <info@ajax.org>",
|
||||
"private": true,
|
||||
"main": "bin/c9",
|
||||
|
@ -17,8 +17,8 @@
|
|||
"debug": "~0.7.4",
|
||||
"ejs": "~1.0.0",
|
||||
"emmet": "git://github.com/cloud9ide/emmet-core.git#2ff6dc06ad",
|
||||
"engine.io": "1.5.3",
|
||||
"engine.io-client": "1.5.3",
|
||||
"engine.io": "1.6.9",
|
||||
"engine.io-client": "1.6.9",
|
||||
"jsonm": "1.0.6",
|
||||
"http-error": "~0.0.5",
|
||||
"less": "^2.4.0",
|
||||
|
@ -30,14 +30,14 @@
|
|||
"netutil": "~0.0.2",
|
||||
"optimist": "~0.6.0",
|
||||
"qs": "0.6.6",
|
||||
"rusha": "~0.7.2",
|
||||
"rusha": "^0.8.3",
|
||||
"send": "~0.1.4",
|
||||
"simple-mime": "~0.0.8",
|
||||
"tern": "git://github.com/cloud9ide/tern.git#39015d544d4c00c7899fea4c95c2e5bc2720e68e",
|
||||
"tern_from_ts": "git://github.com/cloud9ide/tern_from_ts.git#84d51dcb9b16b126a206789d4d4237cde2801fe4",
|
||||
"through": "2.2.0",
|
||||
"tmp": "~0.0.20",
|
||||
"uglify-js": "2.4.16",
|
||||
"uglify-js": "^2.6.2",
|
||||
"ws": "0.4.31",
|
||||
"read": "~1.0.5",
|
||||
"form-data": "~0.2.0",
|
||||
|
@ -58,7 +58,7 @@
|
|||
"c9"
|
||||
],
|
||||
"c9plugins": {
|
||||
"c9.ide.language": "#79bcb2fe06",
|
||||
"c9.ide.language": "#b8f73a9da1",
|
||||
"c9.ide.language.core": "#undefined",
|
||||
"c9.ide.language.css": "#be07d72209",
|
||||
"c9.ide.language.generic": "#3949510863",
|
||||
|
@ -68,15 +68,15 @@
|
|||
"c9.ide.language.javascript.immediate": "#c8b1e5767a",
|
||||
"c9.ide.language.javascript.eslint": "#4de5457db1",
|
||||
"c9.ide.language.javascript.tern": "#64ab01f271",
|
||||
"c9.ide.language.javascript.infer": "#18acb93a3a",
|
||||
"c9.ide.language.jsonalyzer": "#d8183d84b4",
|
||||
"c9.ide.language.javascript.infer": "#69fbc134d6",
|
||||
"c9.ide.language.jsonalyzer": "#2b1878b731",
|
||||
"c9.ide.language.codeintel": "#fc867feec4",
|
||||
"c9.ide.collab": "#4406800a74",
|
||||
"c9.ide.collab": "#799edb6836",
|
||||
"c9.ide.local": "#10eb45842a",
|
||||
"c9.ide.find": "#e33fbaed2f",
|
||||
"c9.ide.find.infiles": "#c0a13737ef",
|
||||
"c9.ide.find.infiles": "#bd34c29373",
|
||||
"c9.ide.find.replace": "#810ebf8bfb",
|
||||
"c9.ide.run.debug": "#3206c81cd4",
|
||||
"c9.ide.run.debug": "#317feee072",
|
||||
"c9.automate": "#47e2c429c9",
|
||||
"c9.ide.ace.emmet": "#6dc4585e02",
|
||||
"c9.ide.ace.gotoline": "#a8ff07c8f4",
|
||||
|
@ -93,11 +93,11 @@
|
|||
"c9.ide.format": "#5ec97fb083",
|
||||
"c9.ide.help.support": "#932fbb3743",
|
||||
"c9.ide.imgeditor": "#612e75ef4f",
|
||||
"c9.ide.immediate": "#0e0c18066c",
|
||||
"c9.ide.immediate": "#76c8e3213a",
|
||||
"c9.ide.installer": "#b2e4ba0a92",
|
||||
"c9.ide.language.python": "#aff0772c78",
|
||||
"c9.ide.language.python": "#15e7ff9a3f",
|
||||
"c9.ide.language.go": "#6ce1c7a7ef",
|
||||
"c9.ide.mount": "#6ddfd05db3",
|
||||
"c9.ide.mount": "#3001a633f2",
|
||||
"c9.ide.navigate": "#5d5707058c",
|
||||
"c9.ide.newresource": "#981a408a7b",
|
||||
"c9.ide.openfiles": "#2ae85a9e33",
|
||||
|
@ -105,11 +105,11 @@
|
|||
"c9.ide.preview.browser": "#897177be7f",
|
||||
"c9.ide.preview.markdown": "#c3174d86e0",
|
||||
"c9.ide.pubsub": "#99b7289040",
|
||||
"c9.ide.readonly": "#cfd951ec16",
|
||||
"c9.ide.readonly": "#7421caab61",
|
||||
"c9.ide.recentfiles": "#7c099abf40",
|
||||
"c9.ide.remote": "#301d2ab519",
|
||||
"c9.ide.processlist": "#2b12cd1bdd",
|
||||
"c9.ide.run": "#3f66921065",
|
||||
"c9.ide.run": "#d661a7b847",
|
||||
"c9.ide.run.build": "#0598fff697",
|
||||
"c9.ide.run.debug.xdebug": "#9956689819",
|
||||
"c9.ide.save": "#25a63f31e2",
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
<div id="wrapper">
|
||||
<h1><%=title%></h1>
|
||||
<h2><em><%=statusCode%> - <%=scope%></em> <%=error%></h2>
|
||||
<p style="margin-bottom:20px;width:540px">
|
||||
This error has been logged. We will
|
||||
investigate this further and will prevent this from happening in the
|
||||
future. If this error persists please don't hesitate to contact support.
|
||||
</p>
|
||||
<% if (statusCode != 403) { %>
|
||||
<p style="margin-bottom:20px;width:540px">
|
||||
This error has been logged. We will
|
||||
investigate this further and will prevent this from happening in the
|
||||
future. If this error persists please don't hesitate to contact support.
|
||||
</p>
|
||||
<% } %>
|
||||
|
||||
<% if (showStackTrace) { %>
|
||||
<div class="stacktrace">
|
||||
|
|
|
@ -51,21 +51,19 @@ define(function(require, exports, module) {
|
|||
function set(type, data, list) {
|
||||
if (notSupported(type))
|
||||
return;
|
||||
|
||||
type = convertType(type);
|
||||
|
||||
if (nativeObject) {
|
||||
nativeObject.setData(type, data);
|
||||
handleClipboardData(nativeObject, type, data);
|
||||
return true;
|
||||
}
|
||||
|
||||
var setData = function(e) {
|
||||
if (list) {
|
||||
list.forEach(function(type) {
|
||||
e.clipboardData.setData(type, data);
|
||||
handleClipboardData(e.clipboardData, type, data);
|
||||
});
|
||||
}
|
||||
e.clipboardData.setData(type, data);
|
||||
handleClipboardData(e.clipboardData, type, data);
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
@ -82,17 +80,15 @@ define(function(require, exports, module) {
|
|||
function get(type, full) {
|
||||
if (notSupported(type))
|
||||
return;
|
||||
|
||||
type = convertType(type);
|
||||
|
||||
if (!full && nativeObject)
|
||||
return nativeObject.getData(type);
|
||||
return handleClipboardData(nativeObject, type);
|
||||
|
||||
var data;
|
||||
var getData = function(e) {
|
||||
data = full
|
||||
? e.clipboardData
|
||||
: e.clipboardData.getData(type);
|
||||
: handleClipboardData(e.clipboardData, type);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
@ -120,8 +116,22 @@ define(function(require, exports, module) {
|
|||
return !/text($|\/)/.test(type);
|
||||
}
|
||||
|
||||
function convertType(type) {
|
||||
return document.all ? "Text" : type;
|
||||
function handleClipboardData(clipboardData, type, data, forceIEMime) {
|
||||
if (!clipboardData)
|
||||
return;
|
||||
// using "Text" doesn't work on old webkit but ie needs it
|
||||
var mime = forceIEMime ? "Text" : type;
|
||||
try {
|
||||
if (data) {
|
||||
// Safari 5 has clipboardData object, but does not handle setData()
|
||||
return clipboardData.setData(mime, data) !== false;
|
||||
} else {
|
||||
return clipboardData.getData(mime);
|
||||
}
|
||||
} catch(e) {
|
||||
if (!forceIEMime)
|
||||
return handleClipboardData(clipboardData, type, data, true);
|
||||
}
|
||||
}
|
||||
|
||||
function wrap(obj) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@import "plugins/c9.ide.layout.classic/themes/flat-light.less";
|
||||
|
||||
.bartools .c9-toolbarbutton-glossyOver{
|
||||
background: #E6E6E6;
|
||||
background: #303130;
|
||||
}
|
||||
|
||||
.bartools .c9-toolbarbutton-glossymenuDown{
|
||||
|
@ -221,4 +221,4 @@
|
|||
|
||||
@media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 1.25dppx) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -537,7 +537,7 @@ define(function(require, exports, module) {
|
|||
if (err) {
|
||||
var message = err.message;
|
||||
if (err.code == "EEXIST")
|
||||
message = "File " + path + " already exists.";
|
||||
message = "File " + newpath + " already exists.";
|
||||
return showError(message);
|
||||
}
|
||||
if (dirname(newpath) != dirname(path))
|
||||
|
|
|
@ -9,6 +9,7 @@ define(function(require, exports, module) {
|
|||
var Plugin = imports.Plugin;
|
||||
var c9 = imports.c9;
|
||||
var ext = imports.ext;
|
||||
var vfs = imports.vfs;
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
|
@ -61,6 +62,9 @@ define(function(require, exports, module) {
|
|||
}
|
||||
|
||||
if (!api) return callback(new Error("Client is offline"));
|
||||
|
||||
if (!vfs.isIdle())
|
||||
return vfs.connection.once("message", ping.bind(null, callback));
|
||||
|
||||
var start = Date.now();
|
||||
api.ping("serverTime", function(err, response) {
|
||||
|
|
|
@ -204,7 +204,7 @@ define(function(require, exports, module) {
|
|||
|
||||
function reconnectNow() {
|
||||
reconnect(function(_err) {
|
||||
connection.connect();
|
||||
connection && connection.connect();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -240,9 +240,10 @@ define(function(require, exports, module) {
|
|||
path: parsedSocket.path,
|
||||
host: parsedSocket.host,
|
||||
port: parsedSocket.port
|
||||
|| parsedSocket.protocol == "https:" ? "443" : null,
|
||||
|| (parsedSocket.protocol == "https:" ? "443" : null),
|
||||
secure: parsedSocket.protocol
|
||||
? parsedSocket.protocol == "https:" : true
|
||||
? parsedSocket.protocol == "https:" : true,
|
||||
rejectUnauthorized: options.rejectUnauthorized
|
||||
};
|
||||
callback();
|
||||
});
|
||||
|
@ -329,6 +330,13 @@ define(function(require, exports, module) {
|
|||
bufferedVfsCalls.push([method, path, options, callback]);
|
||||
}
|
||||
|
||||
function isIdle() {
|
||||
if (!connection || !consumer)
|
||||
return false;
|
||||
return !Object.keys(connection.unacked).length &&
|
||||
!Object.keys(consumer.callbacks || {}).length;
|
||||
}
|
||||
|
||||
/***** Lifecycle *****/
|
||||
|
||||
plugin.on("load", function(){
|
||||
|
@ -429,7 +437,9 @@ define(function(require, exports, module) {
|
|||
// Extending the API
|
||||
use: vfsCall.bind(null, "use"),
|
||||
extend: vfsCall.bind(null, "extend"),
|
||||
unextend: vfsCall.bind(null, "unextend")
|
||||
unextend: vfsCall.bind(null, "unextend"),
|
||||
|
||||
isIdle: isIdle,
|
||||
});
|
||||
|
||||
register(null, {
|
||||
|
|
Ładowanie…
Reference in New Issue