mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 12:55:26 +02:00
Added hotkeys cheatsheet.
Added some hotkeys (not mapped yet). Fixed logging search style.
This commit is contained in:
@@ -32,9 +32,5 @@ require.ensure([], function (require) {
|
||||
})
|
||||
}
|
||||
])
|
||||
.config(function (hotkeysProvider) {
|
||||
hotkeysProvider.includeCheatSheet = false
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
var ControlPanesHotkeys = require('./control-panes-hotkeys')
|
||||
|
||||
module.exports =
|
||||
function ControlPanesController($scope, $http, gettext, $routeParams,
|
||||
$timeout, $location, DeviceService, GroupService, ControlService,
|
||||
StorageService, FatalMessageService, hotkeys) {
|
||||
StorageService, FatalMessageService, hotkeys, $filter) {
|
||||
|
||||
var sharedTabs = [
|
||||
{
|
||||
@@ -181,20 +183,6 @@ module.exports =
|
||||
}, true)
|
||||
|
||||
|
||||
function switchDeviceCharset() {
|
||||
$scope.control.keyPress('switch_charset')
|
||||
console.log('Switching charset')
|
||||
}
|
||||
|
||||
hotkeys.add({
|
||||
combo: 'shift+space',
|
||||
description: 'Selects next IME in the device',
|
||||
allowIn: ['textarea'],
|
||||
callback: function (event) {
|
||||
event.preventDefault()
|
||||
switchDeviceCharset()
|
||||
}
|
||||
})
|
||||
|
||||
ControlPanesHotkeys($scope, hotkeys, $filter, gettext)
|
||||
|
||||
}
|
||||
|
||||
52
res/app/control-panes/control-panes-hotkeys.js
Normal file
52
res/app/control-panes/control-panes-hotkeys.js
Normal file
@@ -0,0 +1,52 @@
|
||||
module.exports = function ($scope, hotkeys, $filter, gettext) {
|
||||
|
||||
function hotkeyAdd(combo, desc, cb) {
|
||||
hotkeys.add({
|
||||
combo: combo,
|
||||
description: $filter('translate')(desc),
|
||||
allowIn: ['textarea'],
|
||||
callback: function (event) {
|
||||
event.preventDefault()
|
||||
cb()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var actions = {
|
||||
switchCharset: function () {
|
||||
$scope.control.keyPress('switch_charset')
|
||||
},
|
||||
rotateScreen: function () {
|
||||
// TODO: Add a proper rotate
|
||||
$scope.control.rotate(90)
|
||||
},
|
||||
focusUrlBar: function () {
|
||||
console.log('action')
|
||||
},
|
||||
takeScreenShot: function () {
|
||||
console.log('action')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
hotkeyAdd('shift+left', gettext('Previous device'), actions.takeScreenShot)
|
||||
hotkeyAdd('shift+right', gettext('Next device'), actions.takeScreenShot)
|
||||
hotkeyAdd('shift+D', gettext('Go to Device List'), actions.takeScreenShot)
|
||||
|
||||
hotkeyAdd('shift+SPACE', gettext('Selects next IME in the device'), actions.switchCharset)
|
||||
hotkeyAdd('shift+R', gettext('Rotate screen'), actions.rotateScreen)
|
||||
|
||||
hotkeyAdd('shift+L', gettext('Focus URL bar'), actions.focusUrlBar)
|
||||
hotkeyAdd('shift+S', gettext('Take screenshot'), actions.takeScreenShot)
|
||||
|
||||
hotkeyAdd('shift+M', gettext('Press Menu button'), actions.takeScreenShot)
|
||||
hotkeyAdd('shift+H', gettext('Press Home button'), actions.takeScreenShot)
|
||||
hotkeyAdd('shift+B', gettext('Press Back button'), actions.takeScreenShot)
|
||||
|
||||
hotkeyAdd('shift+I', gettext('Show/Hide device'), actions.takeScreenShot)
|
||||
|
||||
hotkeyAdd('shift+W', gettext('Toggle Web/Native'), actions.takeScreenShot)
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -44,17 +44,17 @@
|
||||
select(ng-model='filters.priority', ng-options='l.name for l in filters.levelNumbers')
|
||||
option(value='', disabled, selected) {{"Level"|translate}}
|
||||
td(width='10%')
|
||||
input(ng-model='filters.date', type='text', placeholder='{{"Time"|translate}}')
|
||||
input(ng-model='filters.date', type='text', placeholder='{{"Time"|translate}}').input-sm.form-control
|
||||
td(width='8%', ng-if='$root.platform == "native"')
|
||||
input(ng-model='filters.pid', type='text', placeholder='{{"PID"|translate}}')
|
||||
input(ng-model='filters.pid', type='text', placeholder='{{"PID"|translate}}').input-sm.form-control
|
||||
td(width='8%', ng-if='$root.platform == "native"')
|
||||
input(ng-model='filters.tid', type='text', placeholder='{{"TID"|translate}}')
|
||||
input(ng-model='filters.tid', type='text', placeholder='{{"TID"|translate}}').input-sm.form-control
|
||||
//td(width='14%', ng-if='$root.platform == "native"')
|
||||
input(ng-model='filters.app', type='text', placeholder='{{"App"|translate}}')
|
||||
input(ng-model='filters.app', type='text', placeholder='{{"App"|translate}}').input-sm.form-control
|
||||
td(width='14%', ng-if='$root.platform == "native"')
|
||||
input(ng-model='filters.tag', type='text', placeholder='{{"Tag"|translate}}')
|
||||
input(ng-model='filters.tag', type='text', placeholder='{{"Tag"|translate}}').input-sm.form-control
|
||||
td(width='40%')
|
||||
input(ng-model='filters.message', type='text', placeholder='{{"Text"|translate}}')
|
||||
input(ng-model='filters.message', type='text', placeholder='{{"Text"|translate}}').input-sm.form-control
|
||||
td(width='0')
|
||||
button(ng-click='clearTable()', ng-disabled='false', title='{{"Clear"|translate}}').btn.btn-xs.btn-danger-outline
|
||||
i.fa.fa-trash-o
|
||||
|
||||
Reference in New Issue
Block a user