diff --git a/res/app/app.js b/res/app/app.js index 5afb9d65..951986d0 100644 --- a/res/app/app.js +++ b/res/app/app.js @@ -32,9 +32,5 @@ require.ensure([], function (require) { }) } ]) - .config(function (hotkeysProvider) { - hotkeysProvider.includeCheatSheet = false - }) - }) diff --git a/res/app/control-panes/control-panes-controller.js b/res/app/control-panes/control-panes-controller.js index 0666a410..b8a238ee 100644 --- a/res/app/control-panes/control-panes-controller.js +++ b/res/app/control-panes/control-panes-controller.js @@ -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) } diff --git a/res/app/control-panes/control-panes-hotkeys.js b/res/app/control-panes/control-panes-hotkeys.js new file mode 100644 index 00000000..7cc2cb98 --- /dev/null +++ b/res/app/control-panes/control-panes-hotkeys.js @@ -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) + + + +} diff --git a/res/app/control-panes/logs/logs.jade b/res/app/control-panes/logs/logs.jade index 0eb4bb8d..1991b13c 100644 --- a/res/app/control-panes/logs/logs.jade +++ b/res/app/control-panes/logs/logs.jade @@ -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