This commit is contained in:
Liang Ding 2014-12-05 15:08:44 +08:00
parent 28ea0769f6
commit d970a2e342
3 changed files with 25 additions and 3 deletions

View File

@ -391,7 +391,23 @@ func SearchText(w http.ResponseWriter, r *http.Request) {
return return
} }
sid := args["sid"].(string)
wSession := session.WideSessions.Get(sid)
if nil == wSession {
data["succ"] = false
return
}
// XXX: just one directory
dir := args["dir"].(string) dir := args["dir"].(string)
if "" == dir {
userWorkspace := conf.Wide.GetUserWorkspace(wSession.Username)
workspaces := filepath.SplitList(userWorkspace)
dir = workspaces[0]
}
extension := args["extension"].(string) extension := args["extension"].(string)
text := args["text"].(string) text := args["text"].(string)

View File

@ -382,7 +382,13 @@ var tree = {
}, },
"ok": function () { "ok": function () {
var request = newWideRequest(); var request = newWideRequest();
if (!wide.curNode) {
request.dir = "";
} else {
request.dir = wide.curNode.path; request.dir = wide.curNode.path;
}
request.text = $("#dialogSearchForm > input:eq(0)").val(); request.text = $("#dialogSearchForm > input:eq(0)").val();
request.extension = $("#dialogSearchForm > input:eq(1)").val(); request.extension = $("#dialogSearchForm > input:eq(1)").val();

View File

@ -130,11 +130,11 @@
<span>{{.i18n.find}}</span> <span>{{.i18n.find}}</span>
<div class="frame"> <div class="frame">
<ul> <ul>
<li onclick="alert('Dev In Progress')"> <li onclick="$('#dialogGoFilePrompt').dialog('open')">
<span>{{.i18n.goto_file}}</span> <span>{{.i18n.goto_file}}</span>
</li> </li>
<li class="hr"></li> <li class="hr"></li>
<li onclick="alert('Dev In Progress')"> <li onclick="$('#dialogSearchForm').dialog('open')">
<span>{{.i18n.find_in_files}}</span> <span>{{.i18n.find_in_files}}</span>
</li> </li>
<li class="hr"></li> <li class="hr"></li>