outline
This commit is contained in:
parent
6d0b928b0e
commit
d3d5edb16d
|
@ -46,6 +46,10 @@
|
|||
height: 100%;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
.side-right .tabs-panel > div {
|
||||
overflow: auto;
|
||||
}
|
||||
/* end side right */
|
||||
|
||||
/* start tree */
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
.side-right {
|
||||
background-color: #303130;
|
||||
border-left: 1px solid #000;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.footer {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
.side-right {
|
||||
background-color: #FFF;
|
||||
border-right: 1px solid #919191;
|
||||
border-left: 1px solid #919191;
|
||||
}
|
||||
|
||||
.footer {
|
||||
|
|
|
@ -61,19 +61,6 @@ var hotkeys = {
|
|||
}
|
||||
|
||||
$("#outline").focus();
|
||||
|
||||
// var request = newWideRequest();
|
||||
// request.code = wide.curEditor.getValue();
|
||||
//
|
||||
// $.ajax({
|
||||
// type: 'POST',
|
||||
// url: config.context + '/outline',
|
||||
// data: JSON.stringify(request),
|
||||
// dataType: "json",
|
||||
// success: function (data) {
|
||||
// console.log(data);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
},
|
||||
// Ctrl-4
|
||||
|
|
|
@ -330,6 +330,7 @@ var tree = {
|
|||
wide.curEditor.scrollTo(0, cursorCoords.top);
|
||||
wide.curEditor.focus();
|
||||
|
||||
wide.refreshOutline();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -361,6 +362,8 @@ var tree = {
|
|||
tempCursor = CodeMirror.Pos(0, 0);
|
||||
}
|
||||
editors.newEditor(data, tempCursor);
|
||||
|
||||
wide.refreshOutline();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,6 +18,40 @@ var wide = {
|
|||
curNode: undefined,
|
||||
curEditor: undefined,
|
||||
curProcessId: undefined, // curent running process id (pid)
|
||||
refreshOutline: function () {
|
||||
if (wide.curEditor.doc.getMode().name !== "go") {
|
||||
$("#outline").html('');
|
||||
return false;
|
||||
}
|
||||
|
||||
var request = newWideRequest();
|
||||
request.code = wide.curEditor.getValue();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: config.context + '/outline',
|
||||
data: JSON.stringify(request),
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (!data.succ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var outlineHTML = '<ul>',
|
||||
decls = ['funcDecls', 'interfaceDecls', 'structDecls',
|
||||
'constDecls', 'varDecls'];
|
||||
|
||||
for (var i = 0, max = decls.length; i < max; i++) {
|
||||
var key = decls[i];
|
||||
for (var j = 0, maxj = data[key].length; j < maxj; j++) {
|
||||
var name = data[key][j].Name;
|
||||
outlineHTML += '<li>' + name + '</li>';
|
||||
}
|
||||
}
|
||||
$("#outline").html(outlineHTML + '</ul>');
|
||||
}
|
||||
});
|
||||
},
|
||||
_initDialog: function () {
|
||||
$(".dialog-prompt > input").keyup(function (event) {
|
||||
var $okBtn = $(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)");
|
||||
|
@ -321,6 +355,12 @@ var wide = {
|
|||
} else {
|
||||
$(".bottom-window-group > .tabs-panel > div > div").height(bottomH - $bottomGroup.children(".tabs").height());
|
||||
}
|
||||
|
||||
if ($(".side-right").hasClass("side-right-max")) {
|
||||
$(".side-right > .tabs-panel > div").height(mainH - $bottomGroup.children(".tabs").height());
|
||||
} else {
|
||||
$(".side-right > .tabs-panel > div").height($('.side-right').height() - $bottomGroup.children(".tabs").height());
|
||||
}
|
||||
},
|
||||
_initWS: function () {
|
||||
var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId);
|
||||
|
@ -525,24 +565,9 @@ var wide = {
|
|||
success: function (data) {
|
||||
}
|
||||
});
|
||||
|
||||
// refresh outline
|
||||
var request = newWideRequest();
|
||||
request.code = wide.curEditor.getValue();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: config.context + '/outline',
|
||||
data: JSON.stringify(request),
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (!data.succ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#outline").html(JSON.stringify(data));
|
||||
}
|
||||
});
|
||||
// refresh outline
|
||||
wide.randerOutline();
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -149,6 +149,7 @@ var windows = {
|
|||
windows.restoreSideRight();
|
||||
} else {
|
||||
$it.addClass("side-right-max");
|
||||
$(".side-right > .tabs-panel > div").height($(".content").height() - $it.children(".tabs").height());
|
||||
}
|
||||
},
|
||||
restoreBottom: function () {
|
||||
|
@ -212,8 +213,9 @@ var windows = {
|
|||
}
|
||||
|
||||
$(".footer .ico-restore:eq(2)").hide();
|
||||
$(".side-right > .tabs-panel > div").height($('.side-right').height()
|
||||
- $(this).children(".tabs").height());
|
||||
}).removeClass("side-right-max");
|
||||
;
|
||||
},
|
||||
minBottom: function () {
|
||||
$(".edit-panel, .side-right").css("height", "100%");
|
||||
|
|
Loading…
Reference in New Issue