Ctrl + C 清空output

This commit is contained in:
Van 2014-11-06 15:04:33 +08:00
parent 34ef9a2494
commit d2ada7dae0
5 changed files with 45 additions and 14 deletions

View File

@ -4,6 +4,10 @@ var bottomGroup = {
init: function () { init: function () {
this._initTabs(); this._initTabs();
this._initFrame(); this._initFrame();
$('.bottom-window-group .output').click(function () {
$(this).focus();
});
}, },
_initFrame: function () { _initFrame: function () {
$(".bottom-window-group .output").mousedown(function (event) { $(".bottom-window-group .output").mousedown(function (event) {
@ -26,11 +30,11 @@ var bottomGroup = {
return false; return false;
}); });
}, },
clear: function () { clear: function (id) {
$('.bottom-window-group .output > div').text(''); $('.bottom-window-group .' + id + ' > div').text('');
}, },
clearOutput: function () { resetOutput: function () {
$('.bottom-window-group .output > div').text(''); this.clear('output');
bottomGroup.tabs.setCurrent("output"); bottomGroup.tabs.setCurrent("output");
windows.flowBottom(); windows.flowBottom();
}, },

View File

@ -35,6 +35,13 @@ var hotkeys = {
shiftKey: false, shiftKey: false,
which: 54 which: 54
}, },
// Ctrl+C 清空窗口内容
clearWindow: {
ctrlKey: true,
altKey: false,
shiftKey: false,
which: 67
},
// Ctrl+D 窗口组切换 // Ctrl+D 窗口组切换
changeEditor: { changeEditor: {
ctrlKey: true, ctrlKey: true,
@ -64,6 +71,18 @@ var hotkeys = {
which: 117 which: 117
} }
}, },
_bindOutput: function () {
$(".bottom-window-group .output").keydown(function (event) {
event.preventDefault();
var hotKeys = hotkeys.defaultKeyMap;
if (event.ctrlKey === hotKeys.clearWindow.ctrlKey
&& event.which === hotKeys.clearWindow.which) { // Ctrl+F 搜索
bottomGroup.clear('output');
return;
}
});
},
_bindFileTree: function () { _bindFileTree: function () {
$("#files").keydown(function (event) { $("#files").keydown(function (event) {
event.preventDefault(); event.preventDefault();
@ -188,9 +207,7 @@ var hotkeys = {
} }
}); });
}, },
init: function () { _bindDocument: function () {
this._bindFileTree();
var hotKeys = this.defaultKeyMap; var hotKeys = this.defaultKeyMap;
$(document).keydown(function (event) { $(document).keydown(function (event) {
if (event.ctrlKey === hotKeys.goEditor.ctrlKey if (event.ctrlKey === hotKeys.goEditor.ctrlKey
@ -234,6 +251,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");
@ -328,5 +346,10 @@ var hotkeys = {
return; return;
} }
}); });
},
init: function () {
this._bindFileTree();
this._bindOutput();
this._bindDocument();
} }
}; };

View File

@ -87,6 +87,10 @@ var tree = {
$("#dialogRemoveConfirm").dialog("open"); $("#dialogRemoveConfirm").dialog("open");
}, },
init: function () { init: function () {
$("#file").click(function () {
$(this).focus();
});
var request = newWideRequest(); var request = newWideRequest();
$.ajax({ $.ajax({

View File

@ -585,7 +585,7 @@ var wide = {
data: JSON.stringify(request), data: JSON.stringify(request),
dataType: "json", dataType: "json",
beforeSend: function (data) { beforeSend: function (data) {
bottomGroup.clearOutput(); bottomGroup.resetOutput();
}, },
success: function (data) { success: function (data) {
} }
@ -620,7 +620,7 @@ var wide = {
data: JSON.stringify(request), data: JSON.stringify(request),
dataType: "json", dataType: "json",
beforeSend: function (data) { beforeSend: function (data) {
bottomGroup.clearOutput(); bottomGroup.resetOutput();
}, },
success: function (data) { success: function (data) {
$(".toolbars .ico-buildrun").addClass("ico-stop") $(".toolbars .ico-buildrun").addClass("ico-stop")
@ -650,7 +650,7 @@ var wide = {
data: JSON.stringify(request), data: JSON.stringify(request),
dataType: "json", dataType: "json",
beforeSend: function (data) { beforeSend: function (data) {
bottomGroup.clearOutput(); bottomGroup.resetOutput();
}, },
success: function (data) { success: function (data) {
} }
@ -677,7 +677,7 @@ var wide = {
data: JSON.stringify(request), data: JSON.stringify(request),
dataType: "json", dataType: "json",
beforeSend: function (data) { beforeSend: function (data) {
bottomGroup.clearOutput(); bottomGroup.resetOutput();
}, },
success: function (data) { success: function (data) {
} }
@ -704,7 +704,7 @@ var wide = {
data: JSON.stringify(request), data: JSON.stringify(request),
dataType: "json", dataType: "json",
beforeSend: function (data) { beforeSend: function (data) {
bottomGroup.clearOutput(); bottomGroup.resetOutput();
}, },
success: function (data) { success: function (data) {
} }

View File

@ -175,7 +175,7 @@
<span title="{{.i18n.min}}" class="font-ico ico-min"></span> <span title="{{.i18n.min}}" class="font-ico ico-min"></span>
<div class="frame"> <div class="frame">
<ul> <ul>
<li onclick="bottomGroup.clear()" title="{{.i18n.clear}}"> <li onclick="bottomGroup.clear('output')" title="{{.i18n.clear}}">
<span>{{.i18n.clear}}</span> <span>{{.i18n.clear}}</span>
</li> </li>
</ul> </ul>