usages
This commit is contained in:
parent
b63c661433
commit
90227fbe98
|
@ -15,9 +15,16 @@
|
|||
"Password": "admin",
|
||||
"Workspace": "{pwd}/data/user_workspaces/admin",
|
||||
"LatestSessionContent": {
|
||||
"FileTree": [],
|
||||
"Files": [],
|
||||
"CurrentFile": ""
|
||||
"FileTree": [
|
||||
"D:\\GoGoGo\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest",
|
||||
"D:\\GoGoGo\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\time",
|
||||
"D:\\GoGoGo\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\time\\pkg"
|
||||
],
|
||||
"Files": [
|
||||
"D:\\GoGoGo\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\time\\main.go",
|
||||
"D:\\GoGoGo\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\time\\pkg\\time.go"
|
||||
],
|
||||
"CurrentFile": "D:\\GoGoGo\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\time\\pkg\\time.go"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -266,11 +266,11 @@
|
|||
overflow: auto;
|
||||
}
|
||||
|
||||
.bottom-window-group .notification > table {
|
||||
.bottom-window-group table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.bottom-window-group .notification td {
|
||||
.bottom-window-group td {
|
||||
border-bottom: 1px solid #DDD;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
|
|
@ -255,13 +255,43 @@ var editors = {
|
|||
data: JSON.stringify(request),
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
// TODO: V
|
||||
if (!data.succ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $usages = $('.bottom-window-group .search'),
|
||||
usagesHTML = '<ul>';
|
||||
|
||||
for (var i = 0, ii = data.usages.length; i < ii; i++) {
|
||||
usagesHTML += '<li>' + data.usages[i].path
|
||||
+ '</li>';
|
||||
}
|
||||
usagesHTML += '</ul>';
|
||||
|
||||
if ($usages.find("ul").length === 0) {
|
||||
wide.usagesTab = new Tabs({
|
||||
id: ".bottom-window-group .search",
|
||||
removeAfter: function (id, prevId) {
|
||||
if ($usages.find("ul").length === 1) {
|
||||
$usages.find(".tabs").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$usages.find(".tabs-panel > div").append(usagesHTML);
|
||||
} else if ($usages.find("ul").length === 1) {
|
||||
$usages.find(".tabs").show();
|
||||
wide.usagesTab.add({
|
||||
id: "b",
|
||||
"title": 'Usages of ',
|
||||
"content": usagesHTML + 1
|
||||
});
|
||||
}
|
||||
|
||||
// focus
|
||||
wide.bottomWindowTab.setCurrent("search");
|
||||
windows.flowBottom();
|
||||
$(".bottom-window-group .search").focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var Tabs = function(obj) {
|
||||
obj._$tabsPanel = $(obj.id + " .tabs-panel");
|
||||
obj._$tabs = $(obj.id + " .tabs");
|
||||
obj._$tabsPanel = $(obj.id + " > .tabs-panel");
|
||||
obj._$tabs = $(obj.id + " > .tabs");
|
||||
|
||||
this.obj = obj;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ var wide = {
|
|||
curEditor: undefined,
|
||||
curProcessId: undefined, // 当前正在运行的进程 id(pid)
|
||||
bottomWindowTab: undefined,
|
||||
searchTab: undefined,
|
||||
_initDialog: function () {
|
||||
$("#dialogAlert").dialog({
|
||||
"height": 26,
|
||||
|
@ -216,7 +217,7 @@ var wide = {
|
|||
$(".side .tabs-panel").height(mainH - 20);
|
||||
|
||||
$(".bottom-window-group .output").height(bottomH - 27);
|
||||
$(".bottom-window-group .notification, .bottom-window-group .search").height(bottomH - 20);
|
||||
$(".bottom-window-group > .tabs-panel > div > div").height(bottomH - 20);
|
||||
},
|
||||
_initBottomWindowGroup: function () {
|
||||
this.bottomWindowTab = new Tabs({
|
||||
|
|
|
@ -78,7 +78,7 @@ var windows = {
|
|||
|
||||
var bottomH = $(".content").height();
|
||||
$(".bottom-window-group .output").height(bottomH - 27);
|
||||
$(".bottom-window-group .notification, .bottom-window-group .search").height(bottomH - 20);
|
||||
$(".bottom-window-group > .tabs-panel > div > div").height(bottomH - 20);
|
||||
|
||||
$it.addClass("bottom-window-group-max");
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ var windows = {
|
|||
var bottomH = $it.height();
|
||||
|
||||
$(".bottom-window-group .output").height(bottomH - 27);
|
||||
$(".bottom-window-group .notification, .bottom-window-group .search").height(bottomH - 20);
|
||||
$(".bottom-window-group > .tabs-panel > div > div").height(bottomH - 20);
|
||||
|
||||
$it.animate({
|
||||
"top": "70%"
|
||||
|
|
|
@ -153,7 +153,16 @@
|
|||
<div class="tabs-panel">
|
||||
<div data-index="output"><textarea class="output"></textarea></div>
|
||||
<div class="fn-none" data-index="search">
|
||||
<div class="search" tabindex="-1"></div>
|
||||
<div tabindex="-1" class="search">
|
||||
<div class="tabs fn-none">
|
||||
<div class="current" data-index="a">
|
||||
<span title="a">a</span><span class="ico-close font-ico"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabs-panel">
|
||||
<div data-index="a"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fn-none" data-index="notification">
|
||||
<div tabindex="-1" class="notification"><table cellpadding="0" cellspacing="0"></table></div>
|
||||
|
|
Loading…
Reference in New Issue