This commit is contained in:
Van 2014-11-14 15:03:30 +08:00
parent 6a5d86fea9
commit da10a8e395
6 changed files with 41 additions and 8 deletions

View File

@ -96,4 +96,19 @@
.dialog-main input { .dialog-main input {
width: 100%; width: 100%;
margin: 2px auto; margin: 2px auto;
}
#dialogGoFilePrompt > ul {
height: 260px;
overflow: auto;
margin-top: 5px;
}
#dialogGoFilePrompt li {
}
#dialogGoFilePrompt li.selected,
#dialogGoFilePrompt li:hover {
} }

View File

@ -45,6 +45,7 @@
border-width: 0; border-width: 0;
color: #fff; color: #fff;
height: 18px; height: 18px;
opacity: 1;
} }
.ztree li a:hover { .ztree li a:hover {

View File

@ -761,9 +761,6 @@ var editors = {
cm.setSelection(CodeMirror.Pos(from.line + 1, from.ch), cm.setSelection(CodeMirror.Pos(from.line + 1, from.ch),
CodeMirror.Pos(to.line + 1, to.ch)); CodeMirror.Pos(to.line + 1, to.ch));
},
"Shift-Alt-O": function () {
$("#dialogGoFilePrompt").dialog("open");
} }
} }
}); });

View File

@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
var hotkeys = { var hotkeys = {
defaultKeyMap: { defaultKeyMap: {
@ -79,6 +79,13 @@ var hotkeys = {
shiftKey: false, shiftKey: false,
which: 81 which: 81
}, },
// Shift+Alt+O 跳转到文件
goFile: {
ctrlKey: false,
altKey: true,
shiftKey: true,
which: 79
},
// F6 构建并运行 // F6 构建并运行
buildRun: { buildRun: {
ctrlKey: false, ctrlKey: false,
@ -267,7 +274,7 @@ var hotkeys = {
return; return;
} }
if (event.ctrlKey === hotKeys.goSearch.ctrlKey if (event.ctrlKey === hotKeys.goSearch.ctrlKey
&& event.which === hotKeys.goSearch.which) { // Ctrl+5 焦点切换到搜索窗口 && event.which === hotKeys.goSearch.which) { // Ctrl+5 焦点切换到搜索窗口
bottomGroup.tabs.setCurrent("search"); bottomGroup.tabs.setCurrent("search");
@ -361,7 +368,14 @@ var hotkeys = {
return; return;
} }
});
if (event.ctrlKey === hotKeys.goFile.ctrlKey
&& event.altKey === hotKeys.goFile.altKey
&& event.shiftKey === hotKeys.goFile.shiftKey
&& event.which === hotKeys.goFile.which) { // Shift+Alt+O 跳转到文件
$("#dialogGoFilePrompt").dialog("open");
}
});
}, },
init: function () { init: function () {
this._bindFileTree(); this._bindFileTree();

View File

@ -308,8 +308,13 @@ var wide = {
if (!data.succ) { if (!data.succ) {
return; return;
} }
console.log(data); var goFileHTML = '';
for (var i = 0, max = data.founds.length; i < max; i++) {
goFileHTML += '<li>' + data.founds[i].path + '</li>';
}
$("#dialogGoFilePrompt > ul").html(goFileHTML);
} }
}); });
} }

View File

@ -246,6 +246,7 @@
</div> </div>
<div id="dialogGoFilePrompt" class="dialog-prompt fn-none"> <div id="dialogGoFilePrompt" class="dialog-prompt fn-none">
<input/> <input/>
<ul></ul>
</div> </div>
<div id="dialogSearchForm" class="dialog-form fn-none"> <div id="dialogSearchForm" class="dialog-form fn-none">
<input placeholder="{{.i18n.keyword}}" /> <input placeholder="{{.i18n.keyword}}" />