This commit is contained in:
parent
8d0ae1d7d1
commit
3de0437227
|
@ -49,7 +49,9 @@ func GetOutline(w http.ResponseWriter, r *http.Request) {
|
||||||
fset := token.NewFileSet()
|
fset := token.NewFileSet()
|
||||||
f, err := parser.ParseFile(fset, "", code, 0)
|
f, err := parser.ParseFile(fset, "", code, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
data["succ"] = false
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//ast.Print(fset, f)
|
//ast.Print(fset, f)
|
||||||
|
|
|
@ -161,5 +161,6 @@
|
||||||
"change_avatar": "Avatar modify go",
|
"change_avatar": "Avatar modify go",
|
||||||
"open": "Open",
|
"open": "Open",
|
||||||
"pricing": "Pricing",
|
"pricing": "Pricing",
|
||||||
"search_no_match": "No matching files were found."
|
"search_no_match": "No matching files were found.",
|
||||||
|
"outline": "Outline"
|
||||||
}
|
}
|
|
@ -161,5 +161,6 @@
|
||||||
"change_avatar": "アバターの変更は行く",
|
"change_avatar": "アバターの変更は行く",
|
||||||
"open": "オープン",
|
"open": "オープン",
|
||||||
"pricing": "价格",
|
"pricing": "价格",
|
||||||
"search_no_match": "一致するファイルが見つかりませんでした。"
|
"search_no_match": "一致するファイルが見つかりませんでした。",
|
||||||
|
"outline": "アウトライン"
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,5 +161,6 @@
|
||||||
"change_avatar": "头像修改请到",
|
"change_avatar": "头像修改请到",
|
||||||
"open": "打开",
|
"open": "打开",
|
||||||
"pricing": "价格",
|
"pricing": "价格",
|
||||||
"search_no_match": "没有发现匹配的文件。"
|
"search_no_match": "没有发现匹配的文件。",
|
||||||
|
"outline": "大纲"
|
||||||
}
|
}
|
|
@ -161,5 +161,6 @@
|
||||||
"change_avatar": "頭像修改請到",
|
"change_avatar": "頭像修改請到",
|
||||||
"open": "打開",
|
"open": "打開",
|
||||||
"pricing": "價格",
|
"pricing": "價格",
|
||||||
"search_no_match": "沒有發現匹配的文件。"
|
"search_no_match": "沒有發現匹配的文件。",
|
||||||
|
"outline": "大綱"
|
||||||
}
|
}
|
|
@ -646,7 +646,7 @@ var editors = {
|
||||||
+ data[i].line + '" data-ch="' + data[i].ch + '"> (' + data[i].line + ':'
|
+ data[i].line + '" data-ch="' + data[i].ch + '"> (' + data[i].line + ':'
|
||||||
+ data[i].ch + ')</i></span></li>';
|
+ data[i].ch + ')</i></span></li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.length === 0) {
|
if (data.length === 0) {
|
||||||
searcHTML += '<li>' + config.label.search_no_match + '</li>';
|
searcHTML += '<li>' + config.label.search_no_match + '</li>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,12 +51,17 @@ var hotkeys = {
|
||||||
$("#files").focus();
|
$("#files").focus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Ctrl-2
|
||||||
goOutline: {
|
goOutline: {
|
||||||
ctrlKey: true,
|
ctrlKey: true,
|
||||||
altKey: false,
|
altKey: false,
|
||||||
shiftKey: false,
|
shiftKey: false,
|
||||||
which: 50,
|
which: 50,
|
||||||
fun: function () {
|
fun: function () {
|
||||||
|
if (!wide.curEditor) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var request = newWideRequest();
|
var request = newWideRequest();
|
||||||
request.code = wide.curEditor.getValue();
|
request.code = wide.curEditor.getValue();
|
||||||
|
|
||||||
|
|
|
@ -512,7 +512,6 @@ var wide = {
|
||||||
request.file = path;
|
request.file = path;
|
||||||
request.code = editor.getValue();
|
request.code = editor.getValue();
|
||||||
request.nextCmd = ""; // build only, no following operation
|
request.nextCmd = ""; // build only, no following operation
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: config.context + '/build',
|
url: config.context + '/build',
|
||||||
|
@ -524,6 +523,24 @@ var wide = {
|
||||||
success: function (data) {
|
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));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -462,6 +462,23 @@
|
||||||
<div class="tabs"></div>
|
<div class="tabs"></div>
|
||||||
<div class="tabs-panel"></div>
|
<div class="tabs-panel"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
TODO: https://github.com/b3log/wide/issues/199
|
||||||
|
<div style="height: 70%;position: absolute;right: 0;background-color: #FFF;width: 20%;">
|
||||||
|
<span title="{{.i18n.min}}" class="font-ico ico-min"></span>
|
||||||
|
<div class="tabs">
|
||||||
|
<div class="current">
|
||||||
|
<span title="{{.i18n.outline}}">{{.i18n.outline}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tabs-panel">
|
||||||
|
<div id="outline">
|
||||||
|
this is outline
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
<div class="bottom-window-group">
|
<div class="bottom-window-group">
|
||||||
<span title="{{.i18n.min}}" class="font-ico ico-min"></span>
|
<span title="{{.i18n.min}}" class="font-ico ico-min"></span>
|
||||||
|
|
Loading…
Reference in New Issue