diff --git a/res/app/control-panes/control-panes-controller.js b/res/app/control-panes/control-panes-controller.js index 0257dc99..5dfdb4cb 100644 --- a/res/app/control-panes/control-panes-controller.js +++ b/res/app/control-panes/control-panes-controller.js @@ -37,7 +37,7 @@ module.exports = function ControlPanesCtrl($scope, gettext) { { title: gettext('Dashboard'), icon: 'fa-dashboard fa-fw', - templateUrl: 'settings/notifications/notifications.jade', + templateUrl: 'control-panes/dashboard/dashboard.jade', filters: ['native', 'web'] } ].concat(angular.copy(sharedTabs)) diff --git a/res/app/control-panes/dashboard/browser/browser-controller.js b/res/app/control-panes/dashboard/browser/browser-controller.js new file mode 100644 index 00000000..16d986c9 --- /dev/null +++ b/res/app/control-panes/dashboard/browser/browser-controller.js @@ -0,0 +1,3 @@ +module.exports = function BrowserCtrl($scope) { + +} diff --git a/res/app/control-panes/dashboard/browser/browser-spec.js b/res/app/control-panes/dashboard/browser/browser-spec.js new file mode 100644 index 00000000..20e2a098 --- /dev/null +++ b/res/app/control-panes/dashboard/browser/browser-spec.js @@ -0,0 +1,17 @@ +describe('BrowserCtrl', function () { + + beforeEach(module('stf.browser')); + + var scope, ctrl; + + beforeEach(inject(function ($rootScope, $controller) { + scope = $rootScope.$new(); + ctrl = $controller('BrowserCtrl', {$scope: scope}); + })); + + it('should ...', inject(function () { + expect(1).toEqual(1); + + })); + +}); \ No newline at end of file diff --git a/res/app/control-panes/dashboard/browser/browser.css b/res/app/control-panes/dashboard/browser/browser.css new file mode 100644 index 00000000..792eefe0 --- /dev/null +++ b/res/app/control-panes/dashboard/browser/browser.css @@ -0,0 +1,3 @@ +.stf-browser { + +} \ No newline at end of file diff --git a/res/app/control-panes/dashboard/browser/browser.jade b/res/app/control-panes/dashboard/browser/browser.jade new file mode 100644 index 00000000..b9216c9d --- /dev/null +++ b/res/app/control-panes/dashboard/browser/browser.jade @@ -0,0 +1,21 @@ +.widget-container.fluid-height + .heading + i.fa.fa-gear + span(translate) Browser + button.btn.btn-xs.btn-danger-outline.pull-right(ng-click='clearSettings()', title='{{"Reset all browser settings"|translate}}') + i.fa.fa-trash-o + span(translate) Reset + button.btn.btn-xs.btn-primary-outline.pull-right(ng-click='relaunch()', title='{{"Relaunch the browser"|translate}}') + i.fa.fa-refresh + span(translate) Relaunch + .widget-content.padded + .btn-group + button.btn.btn-default-outline.dropdown-toggle + //img(ng-src='/img/platforms/{{$root.browser}}.png').browser-icon + //| {{$root.browser | browserName}} + span.caret + ul.dropdown-menu + li(ng-repeat='b in browsers') + a(ng-click='selectBrowser(b)').pointer + //img(ng-src='/img/platforms/{{b}}.png').browser-icon.pointer + //| {{ b | browserName }} \ No newline at end of file diff --git a/res/app/control-panes/dashboard/browser/index.js b/res/app/control-panes/dashboard/browser/index.js new file mode 100644 index 00000000..02ce566b --- /dev/null +++ b/res/app/control-panes/dashboard/browser/index.js @@ -0,0 +1,11 @@ +require('./browser.css') + +module.exports = angular.module('stf.browser', [ + +]) + .run(["$templateCache", function ($templateCache) { + $templateCache.put('control-panes/dashboard/browser/browser.jade', + require('./browser.jade') + ) + }]) + .controller('BrowserCtrl', require('./browser-controller')) diff --git a/res/app/control-panes/dashboard/dashboard-controller.js b/res/app/control-panes/dashboard/dashboard-controller.js new file mode 100644 index 00000000..4b366432 --- /dev/null +++ b/res/app/control-panes/dashboard/dashboard-controller.js @@ -0,0 +1,3 @@ +module.exports = function DashboardCtrl($scope) { + +} diff --git a/res/app/control-panes/dashboard/dashboard-spec.js b/res/app/control-panes/dashboard/dashboard-spec.js new file mode 100644 index 00000000..1f46e46c --- /dev/null +++ b/res/app/control-panes/dashboard/dashboard-spec.js @@ -0,0 +1,17 @@ +describe('DashboardCtrl', function () { + + beforeEach(module('stf.dashboard')); + + var scope, ctrl; + + beforeEach(inject(function ($rootScope, $controller) { + scope = $rootScope.$new(); + ctrl = $controller('DashboardCtrl', {$scope: scope}); + })); + + it('should ...', inject(function () { + expect(1).toEqual(1); + + })); + +}); \ No newline at end of file diff --git a/res/app/control-panes/dashboard/dashboard.jade b/res/app/control-panes/dashboard/dashboard.jade new file mode 100644 index 00000000..d49b4c4f --- /dev/null +++ b/res/app/control-panes/dashboard/dashboard.jade @@ -0,0 +1,9 @@ +.row + .col-md-6 + div(ng-include='"control-panes/dashboard/navigation/navigation.jade"') + .col-md-6(ng-if='$root.platform == "web"') + div(ng-include='"control-panes/dashboard/browser/browser.jade"') + .col-md-6 + div(ng-include='"control-panes/dashboard/input/input.jade"') + .col-md-6(ng-if='$root.platform == "native"') + div(ng-include='"control-panes/dashboard/shell/shell.jade"') diff --git a/res/app/control-panes/dashboard/index.js b/res/app/control-panes/dashboard/index.js new file mode 100644 index 00000000..1407fd01 --- /dev/null +++ b/res/app/control-panes/dashboard/index.js @@ -0,0 +1,13 @@ +module.exports = angular.module('stf.dashboard', [ + require('./navigation/index').name, + require('./browser/index').name, + require('./input/index').name, + require('./shell/index').name +]) + .run(["$templateCache", function ($templateCache) { + $templateCache.put( + 'control-panes/dashboard/dashboard.jade' + , require('./dashboard.jade') + ) + }]) + .controller('DashboardCtrl', require('./dashboard-controller')) diff --git a/res/app/control-panes/dashboard/input/index.js b/res/app/control-panes/dashboard/input/index.js new file mode 100644 index 00000000..96ddc890 --- /dev/null +++ b/res/app/control-panes/dashboard/input/index.js @@ -0,0 +1,11 @@ +require('./input.css') + +module.exports = angular.module('stf.input', [ + +]) + .run(["$templateCache", function ($templateCache) { + $templateCache.put('control-panes/dashboard/input/input.jade', + require('./input.jade') + ) + }]) + .controller('InputCtrl', require('./input-controller')) diff --git a/res/app/control-panes/dashboard/input/input-controller.js b/res/app/control-panes/dashboard/input/input-controller.js new file mode 100644 index 00000000..606e83de --- /dev/null +++ b/res/app/control-panes/dashboard/input/input-controller.js @@ -0,0 +1,3 @@ +module.exports = function InputCtrl($scope) { + +} diff --git a/res/app/control-panes/dashboard/input/input-spec.js b/res/app/control-panes/dashboard/input/input-spec.js new file mode 100644 index 00000000..c134c22e --- /dev/null +++ b/res/app/control-panes/dashboard/input/input-spec.js @@ -0,0 +1,17 @@ +describe('InputCtrl', function () { + + beforeEach(module('stf.input')); + + var scope, ctrl; + + beforeEach(inject(function ($rootScope, $controller) { + scope = $rootScope.$new(); + ctrl = $controller('InputCtrl', {$scope: scope}); + })); + + it('should ...', inject(function () { + expect(1).toEqual(1); + + })); + +}); \ No newline at end of file diff --git a/res/app/control-panes/dashboard/input/input.css b/res/app/control-panes/dashboard/input/input.css new file mode 100644 index 00000000..9d95a16d --- /dev/null +++ b/res/app/control-panes/dashboard/input/input.css @@ -0,0 +1,3 @@ +.stf-input { + +} \ No newline at end of file diff --git a/res/app/control-panes/dashboard/input/input.jade b/res/app/control-panes/dashboard/input/input.jade new file mode 100644 index 00000000..3f2c891c --- /dev/null +++ b/res/app/control-panes/dashboard/input/input.jade @@ -0,0 +1,17 @@ +.widget-container.fluid-height + .heading + i.fa.fa-gear + span(translate) Keyboard Input + button(title='{{"Switch Charset"|translate}}', ng-click='press("KEYCODE_SWITCH_CHARSET")').btn.btn-sm.btn-primary-outline.pull-right + span(translate) Aa + button(tooltip='{{"Power Button"|translate}}', ng-click='press("KEYCODE_POWER")').btn.btn-sm.btn-danger-outline.pull-right + i.fa.fa-power-off + + .widget-content.padded + .input-group.form-inline + textarea.form-control(rows='1', ng-model='textType', ng-keydown='textTypeKeydown($event)' + ng-focus='$parent.textTypeIsFocused = true', ng-blur='$parent.textTypeIsFocused = false', + title='{{"Types text. Only ASCII characters are supported."|translate}}') + span.input-group-btn + button(title='{{"Type text"|translate', type='button', ng-click='type(textType)', ng-disabled='!textType').btn.btn-primary-outline + i.fa.fa-keyboard-o diff --git a/res/app/control-panes/dashboard/navigation/index.js b/res/app/control-panes/dashboard/navigation/index.js new file mode 100644 index 00000000..d611c9ae --- /dev/null +++ b/res/app/control-panes/dashboard/navigation/index.js @@ -0,0 +1,11 @@ +require('./navigation.css') + +module.exports = angular.module('stf.navigation', [ + +]) + .run(["$templateCache", function ($templateCache) { + $templateCache.put('control-panes/dashboard/navigation/navigation.jade', + require('./navigation.jade') + ) + }]) + .controller('NavigationCtrl', require('./navigation-controller')) diff --git a/res/app/control-panes/dashboard/navigation/navigation-controller.js b/res/app/control-panes/dashboard/navigation/navigation-controller.js new file mode 100644 index 00000000..314b6dd0 --- /dev/null +++ b/res/app/control-panes/dashboard/navigation/navigation-controller.js @@ -0,0 +1,3 @@ +module.exports = function NavigationCtrl($scope) { + +} diff --git a/res/app/control-panes/dashboard/navigation/navigation-spec.js b/res/app/control-panes/dashboard/navigation/navigation-spec.js new file mode 100644 index 00000000..f605368f --- /dev/null +++ b/res/app/control-panes/dashboard/navigation/navigation-spec.js @@ -0,0 +1,17 @@ +describe('NavigationCtrl', function () { + + beforeEach(module('stf.navigation')); + + var scope, ctrl; + + beforeEach(inject(function ($rootScope, $controller) { + scope = $rootScope.$new(); + ctrl = $controller('NavigationCtrl', {$scope: scope}); + })); + + it('should ...', inject(function () { + expect(1).toEqual(1); + + })); + +}); \ No newline at end of file diff --git a/res/app/control-panes/dashboard/navigation/navigation.css b/res/app/control-panes/dashboard/navigation/navigation.css new file mode 100644 index 00000000..7cd7779d --- /dev/null +++ b/res/app/control-panes/dashboard/navigation/navigation.css @@ -0,0 +1,3 @@ +.stf-navigation { + +} \ No newline at end of file diff --git a/res/app/control-panes/dashboard/navigation/navigation.jade b/res/app/control-panes/dashboard/navigation/navigation.jade new file mode 100644 index 00000000..5500f77c --- /dev/null +++ b/res/app/control-panes/dashboard/navigation/navigation.jade @@ -0,0 +1,23 @@ +.widget-container.fluid-height.stf-navigation + .heading + i.fa.fa-globe + span(translate) Navigation + span(ng-controller='NavigationCtrl') + i.fa.fa-refresh.pull-right(ng-click='refresh()', title='{{"Reload"|translate}}', ng-if='$root.browser == "webview"') + i.fa.fa-step-forward.pull-right(ng-click='forward()', title='{{"Go Forward"|translate}}', ng-if='$root.browser == "webview"') + i.fa.fa-step-backward.pull-right(ng-click='back()', title='{{"Go Back"|translate}}', ng-if='$root.browser == "webview"') + .widget-content.padded + form + .input-group + input(type='text', placeholder='http://...', autocomplete='off', ng-model='textURL', + typeahead='url for url in urlHistory | filter:$viewValue').form-control + .input-group-btn + button(ng-click='openURL()', ng-disabled='!textURL').btn.btn-primary-outline(translate) Open + button(type='button', ng-disabled='!hasHistory()').btn.btn-primary-outline.dropdown-toggle + span.caret + ul.dropdown-menu + li(ng-repeat='url in urlHistory') + a(ng-click='insertURL(url)').btn-link {{url}} + li.divider + li + a(ng-click='clearHistory()', type='button').btn-link(translate) Clear diff --git a/res/app/control-panes/dashboard/shell/index.js b/res/app/control-panes/dashboard/shell/index.js new file mode 100644 index 00000000..4d29fdbd --- /dev/null +++ b/res/app/control-panes/dashboard/shell/index.js @@ -0,0 +1,11 @@ +require('./shell.css') + +module.exports = angular.module('stf.shell', [ + +]) + .run(["$templateCache", function ($templateCache) { + $templateCache.put('control-panes/dashboard/shell/shell.jade', + require('./shell.jade') + ) + }]) + .controller('ShellCtrl', require('./shell-controller')) diff --git a/res/app/control-panes/shell/shell-controller.js b/res/app/control-panes/dashboard/shell/shell-controller.js similarity index 73% rename from res/app/control-panes/shell/shell-controller.js rename to res/app/control-panes/dashboard/shell/shell-controller.js index 05a1d9fb..f29406de 100644 --- a/res/app/control-panes/shell/shell-controller.js +++ b/res/app/control-panes/dashboard/shell/shell-controller.js @@ -1,8 +1,8 @@ -module.exports = function ShellCtrl($scope) { +module.exports = function ShellCtrl($scope, $rootScope) { $scope.results = [] $scope.run = function(command) { - var cmd = $scope.control.shell(command) + var cmd = $rootScope.control.shell(command) return cmd.promise .progressed(function(results) { $scope.results = results diff --git a/res/app/control-panes/shell/shell-spec.js b/res/app/control-panes/dashboard/shell/shell-spec.js similarity index 100% rename from res/app/control-panes/shell/shell-spec.js rename to res/app/control-panes/dashboard/shell/shell-spec.js diff --git a/res/app/control-panes/shell/shell.css b/res/app/control-panes/dashboard/shell/shell.css similarity index 100% rename from res/app/control-panes/shell/shell.css rename to res/app/control-panes/dashboard/shell/shell.css diff --git a/res/app/control-panes/dashboard/shell/shell.jade b/res/app/control-panes/dashboard/shell/shell.jade new file mode 100644 index 00000000..91f0885c --- /dev/null +++ b/res/app/control-panes/dashboard/shell/shell.jade @@ -0,0 +1,15 @@ +.widget-container.fluid-height.stf-shell(ng-controller='ShellCtrl') + .heading + i.fa.fa-terminal + span(translate) Shell + .widget-content.padded + a(href='https://github.com/jackpal/Android-Terminal-Emulator/wiki/Android-Shell-Command-Reference', target='_href') Reference + .input-group.form-inline + input(type=text, ng-model='command').form-control + span.input-group-btn + button.btn.btn-primary-outline(ng-click='run(command)') + i.fa.fa-play + table + tr(ng-repeat='result in results track by result.device.serial') + td {{ result.device.serial }} + td {{ result.data }} \ No newline at end of file diff --git a/res/app/control-panes/index.js b/res/app/control-panes/index.js index 8dad3a01..44251b54 100644 --- a/res/app/control-panes/index.js +++ b/res/app/control-panes/index.js @@ -4,7 +4,8 @@ require('fa-borderlayout/build-0.3.1/stf-style.css') module.exports = angular.module('control-panes', [ - require('stf/common-ui/nice-tabs').name + require('stf/common-ui/nice-tabs').name, + require('./dashboard').name ]) .config(['$routeProvider', function ($routeProvider) { $routeProvider.when('/control-panes', { diff --git a/res/app/control-panes/shell/index.js b/res/app/control-panes/shell/index.js deleted file mode 100644 index a0ad276f..00000000 --- a/res/app/control-panes/shell/index.js +++ /dev/null @@ -1,6 +0,0 @@ -require('./shell.css') - -module.exports = angular.module('stf.shell', [ - -]) - .controller('ShellCtrl', require('./shell-controller')) diff --git a/res/app/control-panes/shell/shell.jade b/res/app/control-panes/shell/shell.jade deleted file mode 100644 index a3c60f3f..00000000 --- a/res/app/control-panes/shell/shell.jade +++ /dev/null @@ -1,12 +0,0 @@ -.widget-container.fluid-height.stf-shell - .heading - i.fa - span(translate) Shell - .widget-content.padded - div - input(type=text, ng-model='command') - button(ng-click='run(command)') run - table - tr(ng-repeat='result in results track by result.device.serial') - td {{ result.device.serial }} - td {{ result.data }} \ No newline at end of file