kopia lustrzana https://github.com/c9/core
Merge pull request +6126 from c9/fix/log-workspace-loading
Fix/log workspace loadingpull/9/merge
commit
24ac3fa3b3
|
@ -88,7 +88,7 @@
|
||||||
"c9.ide.preview": "#3c4dded23f",
|
"c9.ide.preview": "#3c4dded23f",
|
||||||
"c9.ide.preview.browser": "#be197b0464",
|
"c9.ide.preview.browser": "#be197b0464",
|
||||||
"c9.ide.preview.markdown": "#bf952685f6",
|
"c9.ide.preview.markdown": "#bf952685f6",
|
||||||
"c9.ide.pubsub": "#e6526a20f7",
|
"c9.ide.pubsub": "#7dd0a37571",
|
||||||
"c9.ide.readonly": "#f6f07bbe42",
|
"c9.ide.readonly": "#f6f07bbe42",
|
||||||
"c9.ide.recentfiles": "#7c099abf40",
|
"c9.ide.recentfiles": "#7c099abf40",
|
||||||
"c9.ide.remote": "#37773d905b",
|
"c9.ide.remote": "#37773d905b",
|
||||||
|
|
|
@ -37,7 +37,7 @@ define(function(require, module, exports) {
|
||||||
if (!skipProps[prop])
|
if (!skipProps[prop])
|
||||||
plugin[prop] = options[prop];
|
plugin[prop] = options[prop];
|
||||||
}
|
}
|
||||||
var totalLoadTime;
|
var totalLoadTime, startLoadTime;
|
||||||
|
|
||||||
function load() {
|
function load() {
|
||||||
if (loaded) return false;
|
if (loaded) return false;
|
||||||
|
@ -279,6 +279,11 @@ define(function(require, module, exports) {
|
||||||
*/
|
*/
|
||||||
get totalLoadTime(){ return totalLoadTime; },
|
get totalLoadTime(){ return totalLoadTime; },
|
||||||
set totalLoadTime(v){ totalLoadTime = v; },
|
set totalLoadTime(v){ totalLoadTime = v; },
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
get startLoadTime(){ return startLoadTime; },
|
||||||
|
set startLoadTime(v){ startLoadTime = v; },
|
||||||
|
|
||||||
_events: [
|
_events: [
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,7 +26,7 @@ define(function(require, module, exports) {
|
||||||
var meta = {};
|
var meta = {};
|
||||||
var hasValue = options && (typeof options.value === "string");
|
var hasValue = options && (typeof options.value === "string");
|
||||||
|
|
||||||
var tab, lastState, title, tooltip, editor, recentValue;
|
var tab, lastState, title, tooltip, editor, recentValue, ready;
|
||||||
|
|
||||||
plugin.on("newListener", function(type, listener) {
|
plugin.on("newListener", function(type, listener) {
|
||||||
if (type == "state.set" && lastState) {
|
if (type == "state.set" && lastState) {
|
||||||
|
@ -332,6 +332,16 @@ define(function(require, module, exports) {
|
||||||
editor = v;
|
editor = v;
|
||||||
emit("setEditor", {editor: v});
|
emit("setEditor", {editor: v});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Whether the document is fully loaded
|
||||||
|
* @property {Boolean} ready
|
||||||
|
*/
|
||||||
|
get ready(){ return ready; },
|
||||||
|
set ready(v) {
|
||||||
|
if (ready) throw new Error("Permission Denied");
|
||||||
|
ready = true;
|
||||||
|
emit.sticky("ready");
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* The tooltip displayed when hovering over the tab button
|
* The tooltip displayed when hovering over the tab button
|
||||||
* @property {String} tooltip
|
* @property {String} tooltip
|
||||||
|
|
|
@ -1113,6 +1113,7 @@ define(function(require, module, exports) {
|
||||||
if (!doc.meta.timestamp)
|
if (!doc.meta.timestamp)
|
||||||
doc.meta.timestamp = Date.now() - settings.timeOffset;
|
doc.meta.timestamp = Date.now() - settings.timeOffset;
|
||||||
|
|
||||||
|
doc.ready = true;
|
||||||
emit("open", { tab: tab, options: options });
|
emit("open", { tab: tab, options: options });
|
||||||
callback && callback(null, tab);
|
callback && callback(null, tab);
|
||||||
}
|
}
|
||||||
|
@ -1123,7 +1124,7 @@ define(function(require, module, exports) {
|
||||||
|
|
||||||
// Hooks for plugins that want to override value and state loading
|
// Hooks for plugins that want to override value and state loading
|
||||||
var event = {
|
var event = {
|
||||||
options: options,
|
options: options,
|
||||||
tab: tab,
|
tab: tab,
|
||||||
loadFromDisk: loadFromDisk,
|
loadFromDisk: loadFromDisk,
|
||||||
setLoading: setLoading,
|
setLoading: setLoading,
|
||||||
|
@ -1161,7 +1162,10 @@ define(function(require, module, exports) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
done(null, null);
|
// done has to be called asynchronously
|
||||||
|
setTimeout(function() {
|
||||||
|
done(null, null);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return tab;
|
return tab;
|
||||||
|
|
|
@ -247,20 +247,22 @@ require(["lib/architect/architect", "lib/chai/chai"],
|
||||||
|
|
||||||
it('should rename a directory - change tab path', function(done) {
|
it('should rename a directory - change tab path', function(done) {
|
||||||
var vpath = "/dir/stuff.json";
|
var vpath = "/dir/stuff.json";
|
||||||
tabs.openFile(vpath, function(err, tab) {
|
fs.rmdir("/dir2", { recursive: true }, function(){
|
||||||
expect(tab.path).to.equal(vpath);
|
tabs.openFile(vpath, function(err, tab) {
|
||||||
expect(tab.title).to.equal("stuff.json");
|
expect(tab.path).to.equal(vpath);
|
||||||
|
|
||||||
fs.rename("/dir", "/dir2", function(err) {
|
|
||||||
if (err)
|
|
||||||
throw err;
|
|
||||||
expect(tab.path).to.equal("/dir2/stuff.json");
|
|
||||||
expect(tab.title).to.equal("stuff.json");
|
expect(tab.title).to.equal("stuff.json");
|
||||||
tab.unload();
|
|
||||||
fs.rename("/dir2", "/dir", function (err) {
|
fs.rename("/dir", "/dir2", function(err) {
|
||||||
if (err)
|
if (err)
|
||||||
throw err;
|
throw err;
|
||||||
done();
|
expect(tab.path).to.equal("/dir2/stuff.json");
|
||||||
|
expect(tab.title).to.equal("stuff.json");
|
||||||
|
tab.unload();
|
||||||
|
fs.rename("/dir2", "/dir", function (err) {
|
||||||
|
if (err)
|
||||||
|
throw err;
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Ładowanie…
Reference in New Issue