Merge pull request +6757 from c9/fix/collab

fix +5962 Cloned tab goes out of sync
pull/51/merge
Ruben Daniels 2015-03-27 13:17:56 -07:00
commit 619ef87c5d
3 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -11,7 +11,7 @@ define(function(require, exports, module) {
function main(options, imports, register) {
var c9 = imports.c9;
var Plugin = imports.Plugin;
var _ = require("lodash");
var normalize = require("path").normalize;
var plugin = new Plugin("Ajax.org", main.consumes);
@ -270,7 +270,7 @@ define(function(require, exports, module) {
var reHome = new RegExp("^" + plugin.escapeRegExp(c9.home || "/home/ubuntu"));
plugin.normalizePath = function(path){
if (!path || path.charAt(0) == "~") return path;
return (path.replace(/^[\/]+/, "/")).replace(reHome, "~");
return normalize(path.replace(reHome, "~"));
};
/**

Wyświetl plik

@ -64,7 +64,7 @@ define(function(require, exports, module) {
throw new Error("Missing callback for " + name);
if (!/^[!~/]/.test(path)) {
var e = new Error("Invalid path passed to fs");
var e = new Error("Invalid path passed to fs " + name);
e.data = { name: name, path: path };
setTimeout(function() { throw e });
return args[args.length - 1](e);

Wyświetl plik

@ -1004,6 +1004,11 @@ define(function(require, module, exports) {
&& t.document.title === options.title));
})[0]);
// prevent opening of same tab twice in non cloned mode
// TODO move cloning into ace?
if (!tab)
tab = findTab(path);
// Clone Tab
if (((options.document || 0).meta || 0).cloned) {
if (!tab) {