kopia lustrzana https://github.com/c9/core
Merge remote-tracking branch 'origin/master' into improve-odev
commit
b717095b85
|
@ -47,8 +47,6 @@ node_modules/kaefer/node_modules/
|
|||
!node_modules/treehugger
|
||||
!node_modules/logicblox
|
||||
!node_modules/connect-architect
|
||||
!node_modules/pty.js
|
||||
node_modules/pty.js/.npmignore
|
||||
!node_modules/ui
|
||||
!node_modules/react-bootstrap
|
||||
!node_modules/oldclient
|
||||
|
|
|
@ -65,9 +65,14 @@ function logToFile(message){
|
|||
|
||||
module.exports = function setup(fsOptions) {
|
||||
var pty;
|
||||
if (fsOptions.nodePath) {
|
||||
process.env.NODE_PATH = fsOptions.nodePath;
|
||||
require("module")._initPaths();
|
||||
}
|
||||
if (!fsOptions.nopty) {
|
||||
// on darwin trying to load binary for a wrong version crashes the process
|
||||
[process.env.HOME + "/.c9/node_modules/pty.js", "pty.js", "pty.nw.js"].some(function(p) {
|
||||
[(fsOptions.nodePath || process.env.HOME + "/.c9/node_modules") + "/pty.js",
|
||||
"pty.js", "pty.nw.js"].some(function(p) {
|
||||
try {
|
||||
pty = require(p);
|
||||
return true;
|
||||
|
|
10
package.json
10
package.json
|
@ -56,7 +56,7 @@
|
|||
"c9"
|
||||
],
|
||||
"c9plugins": {
|
||||
"c9.ide.language": "#77f75c7635",
|
||||
"c9.ide.language": "#fa45dc5260",
|
||||
"c9.ide.language.css": "#ef8a28943e",
|
||||
"c9.ide.language.generic": "#32986699ac",
|
||||
"c9.ide.language.html": "#bbe81afed1",
|
||||
|
@ -67,7 +67,7 @@
|
|||
"c9.ide.language.javascript.tern": "#2b0bb024da",
|
||||
"c9.ide.language.javascript.infer": "#cfec494a3c",
|
||||
"c9.ide.language.jsonalyzer": "#ba3e0d298c",
|
||||
"c9.ide.collab": "#532e8d7b5d",
|
||||
"c9.ide.collab": "#f38dcd432e",
|
||||
"c9.ide.local": "#a9703b630c",
|
||||
"c9.ide.find": "#6cc6d3379d",
|
||||
"c9.ide.find.infiles": "#72582de3cd",
|
||||
|
@ -91,7 +91,7 @@
|
|||
"c9.ide.imgeditor": "#ed89162aa7",
|
||||
"c9.ide.immediate": "#6845a93705",
|
||||
"c9.ide.installer": "#c36540bd61",
|
||||
"c9.ide.mount": "#3e90feee2e",
|
||||
"c9.ide.mount": "#a099f105f0",
|
||||
"c9.ide.navigate": "#f358997d93",
|
||||
"c9.ide.newresource": "#f1f0624768",
|
||||
"c9.ide.openfiles": "#28a4f5af16",
|
||||
|
@ -103,10 +103,10 @@
|
|||
"c9.ide.recentfiles": "#7c099abf40",
|
||||
"c9.ide.remote": "#301d2ab519",
|
||||
"c9.ide.processlist": "#bc11818bb5",
|
||||
"c9.ide.run": "#9d632b19c0",
|
||||
"c9.ide.run": "#567ad01865",
|
||||
"c9.ide.run.build": "#ad45874c88",
|
||||
"c9.ide.run.debug.xdebug": "#3b1520f83d",
|
||||
"c9.ide.save": "#a03709ef3f",
|
||||
"c9.ide.save": "#58b8616a88",
|
||||
"c9.ide.terminal.monitor": "#b0b4d03280",
|
||||
"c9.ide.theme.flat": "#b1d65fa9bb",
|
||||
"c9.ide.threewaymerge": "#229382aa0b",
|
||||
|
|
|
@ -217,8 +217,17 @@ define(function(require, module, exports) {
|
|||
.addNavigation(caption, index, heading.navHtml, plugin);
|
||||
|
||||
subHeadings[caption] = { navHtml: htmlNode, index: index };
|
||||
htmlNode.$caption = caption;
|
||||
|
||||
htmlNode.addEventListener("mousedown", function(){
|
||||
htmlNode.addEventListener("mousedown", scrollTo.bind(null, caption));
|
||||
}
|
||||
|
||||
return subHeadings[caption];
|
||||
}
|
||||
|
||||
function scrollTo(caption) {
|
||||
if (!form.headings[caption])
|
||||
return;
|
||||
apf.tween.single(container.$int, {
|
||||
type: "scrollTop",
|
||||
steps: 10,
|
||||
|
@ -226,10 +235,6 @@ define(function(require, module, exports) {
|
|||
from: container.$int.scrollTop,
|
||||
to: form.headings[caption].container.$ext.offsetTop
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
return subHeadings[caption];
|
||||
}
|
||||
|
||||
/***** LifeCycle *****/
|
||||
|
@ -321,6 +326,10 @@ define(function(require, module, exports) {
|
|||
* @param {Boolean} options.form Specifies whether to create a form for this panel.
|
||||
*/
|
||||
plugin.freezePublicAPI({
|
||||
/**
|
||||
* @ignore.
|
||||
*/
|
||||
get section() { return lastA && lastA.$caption; },
|
||||
/**
|
||||
* The APF UI element that is presenting the pane in the UI.
|
||||
* This property is here for internal reasons only. *Do not
|
||||
|
@ -394,6 +403,10 @@ define(function(require, module, exports) {
|
|||
*/
|
||||
show: show,
|
||||
|
||||
/**
|
||||
* Scrolls to a subheading.
|
||||
*/
|
||||
scrollTo: scrollTo,
|
||||
/**
|
||||
* Hides the panel.
|
||||
*/
|
||||
|
|
|
@ -64,13 +64,14 @@ define(function(require, exports, module) {
|
|||
bindKey: { mac: "Command-,", win: "Ctrl-," },
|
||||
exec: function (editor, args) {
|
||||
var tab = tabs.focussedTab;
|
||||
if (tab && tab.editor.type == "preferences" && !args.panel) {
|
||||
var toggle = args.toggle || args.source == "click";
|
||||
if (tab && tab.editor.type == "preferences" && toggle) {
|
||||
tab.close();
|
||||
return;
|
||||
}
|
||||
if (focusOpenPrefs()) {
|
||||
if (args.panel)
|
||||
activate(args.panel);
|
||||
activate(args.panel, args.section);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -80,7 +81,7 @@ define(function(require, exports, module) {
|
|||
active: true
|
||||
}, function(){
|
||||
if (args.panel)
|
||||
activate(args.panel);
|
||||
activate(args.panel, args.section);
|
||||
});
|
||||
}
|
||||
}, handle);
|
||||
|
@ -139,7 +140,6 @@ define(function(require, exports, module) {
|
|||
// Create UI elements
|
||||
parent = e.tab.appendChild(new ui.hsplitbox({
|
||||
"class" : "bar-preferences",
|
||||
//"skinset" : "prefs",
|
||||
"anchors" : "0 0 0 0",
|
||||
}));
|
||||
parent.appendChild(navigation);
|
||||
|
@ -181,17 +181,31 @@ define(function(require, exports, module) {
|
|||
return htmlNode;
|
||||
}
|
||||
|
||||
function activate(panel) {
|
||||
function activate(panel, section) {
|
||||
if (!drawn) {
|
||||
if (!activePanel)
|
||||
handle.once("draw", function(){ activate(activePanel); });
|
||||
activePanel = panel;
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof panel == "string") {
|
||||
var panels = navigation && navigation.$ext && navigation.$ext.children;
|
||||
if (panels) {
|
||||
for (var i = 0; i < panels.length; i++) {
|
||||
if (panels[i].name == panel) {
|
||||
panel = panels[i].hostPlugin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!panel || !panel.show)
|
||||
return console.error("Couldn't find preference panel", panel);
|
||||
if (activePanel && activePanel != panel)
|
||||
activePanel.hide();
|
||||
panel.show(!activePanel);
|
||||
if (section)
|
||||
panel.scrollTo(section);
|
||||
activePanel = panel;
|
||||
}
|
||||
|
||||
|
@ -322,18 +336,10 @@ define(function(require, exports, module) {
|
|||
|
||||
plugin.on("getState", function(e) {
|
||||
e.state.activePanel = activePanel && activePanel.name;
|
||||
e.state.section = activePanel && activePanel.section;
|
||||
});
|
||||
plugin.on("setState", function(e) {
|
||||
var name = e.state.activePanel;
|
||||
if (activePanel && activePanel.name == name)
|
||||
return;
|
||||
var panels = navigation && navigation.$ext && navigation.$ext.children;
|
||||
if (panels) {
|
||||
for (var i = 0; i < panels.length; i++) {
|
||||
if (panels[i].name == name)
|
||||
return activate(panels[i].hostPlugin);
|
||||
}
|
||||
}
|
||||
activate(e.state.activePanel, e.state.section);
|
||||
});
|
||||
|
||||
/***** Lifecycle *****/
|
||||
|
|
|
@ -102,6 +102,9 @@ define(function(require, exports, module) {
|
|||
|
||||
save.on("beforeSave", function(e) {
|
||||
e.document.meta.$savingValue = e.save;
|
||||
if (e.tab.classList.contains("conflict")) {
|
||||
showChangeDialog(e.tab);
|
||||
}
|
||||
}, plugin);
|
||||
|
||||
save.on("afterSave", function(e) {
|
||||
|
@ -229,8 +232,12 @@ define(function(require, exports, module) {
|
|||
if (!tabManager.findTab(path)) // drat! tab is gone
|
||||
return;
|
||||
|
||||
// Show dialog
|
||||
showChangeDialog();
|
||||
// Show dialogs for changed tabs
|
||||
for (var changedPath in changedPaths) {
|
||||
tab = changedPaths[changedPath].tab;
|
||||
data = changedPaths[changedPath].data;
|
||||
showChangeDialog(tab, data);
|
||||
}
|
||||
}
|
||||
|
||||
function checkByStatOrContents() {
|
||||
|
@ -367,9 +374,7 @@ define(function(require, exports, module) {
|
|||
else {
|
||||
changedPaths[path].tab.document.undoManager.bookmark(-2);
|
||||
changedPaths[path].resolve();
|
||||
showChangeDialog();
|
||||
}
|
||||
|
||||
checkEmptyQueue();
|
||||
}
|
||||
|
||||
|
@ -382,7 +387,6 @@ define(function(require, exports, module) {
|
|||
else {
|
||||
getLatestValue(path, function(err, path, data) {
|
||||
updateChangedPath(err, path, data);
|
||||
showChangeDialog();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -408,7 +412,6 @@ define(function(require, exports, module) {
|
|||
|
||||
getLatestValue(path, function(err, path, data) {
|
||||
mergeChangedPath(err, path, data);
|
||||
showChangeDialog();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue