diff --git a/bower.json b/bower.json index 94ef886e..2d35b020 100644 --- a/bower.json +++ b/bower.json @@ -32,7 +32,8 @@ "underscore.string": "~2.3.3", "angular-isotope": "~0.1.14", "angular-deckgrid": "~0.4.4", - "venturocket-angular-slider": "~0.3.2" + "venturocket-angular-slider": "~0.3.2", + "font-awesome-bower": "~4.1.0" }, "private": true, "resolutions": { diff --git a/res/app/components/stf/text-history/index.js b/res/app/components/stf/text-history/index.js new file mode 100644 index 00000000..7349613d --- /dev/null +++ b/res/app/components/stf/text-history/index.js @@ -0,0 +1,4 @@ +module.exports = angular.module('stf.text-history', [ + +]) + .directive('textHistory', require('./text-history-directive')) diff --git a/res/app/components/stf/text-history/text-history-directive.js b/res/app/components/stf/text-history/text-history-directive.js new file mode 100644 index 00000000..c4b38bdf --- /dev/null +++ b/res/app/components/stf/text-history/text-history-directive.js @@ -0,0 +1,12 @@ +//input.form-control(type='text', placeholder='', ng-model='selectedAction', +// typeahead='action for action in activityActions') + +module.exports = function textHistoryDirective() { + return { + restrict: 'A', + template: '' + link: function (scope, element, attrs) { + + } + } +} diff --git a/res/app/components/stf/text-history/text-history-spec.js b/res/app/components/stf/text-history/text-history-spec.js new file mode 100644 index 00000000..6658b654 --- /dev/null +++ b/res/app/components/stf/text-history/text-history-spec.js @@ -0,0 +1,23 @@ +describe('textHistory', function () { + + beforeEach(module('stf.text-history')); + + var scope, compile; + + beforeEach(inject(function ($rootScope, $compile) { + scope = $rootScope.$new(); + compile = $compile; + })); + + it('should ...', function () { + + /* + To test your directive, you need to create some html that would use your directive, + send that through compile() then compare the results. + + var element = compile('
hi
')(scope); + expect(element.text()).toBe('hello, world'); + */ + + }); +}); \ No newline at end of file diff --git a/res/app/control-panes/dashboard/apps/apps-controller.js b/res/app/control-panes/dashboard/apps/apps-controller.js index 0bb3c6a0..1929cc9a 100644 --- a/res/app/control-panes/dashboard/apps/apps-controller.js +++ b/res/app/control-panes/dashboard/apps/apps-controller.js @@ -1,31 +1,64 @@ +// See https://github.com/android/platform_packages_apps_settings/blob/master/AndroidManifest.xml + module.exports = function ShellCtrl($scope, gettext) { - // TODO: implement multiple devices -// $scope.results = [] $scope.result = null - $scope.referenceUrl = 'https://github.com/jackpal/Android-Terminal-Emulator/wiki/Android-Shell-Command-Reference' - - $scope.run = function(command) { - if (command === 'clear') { - $scope.clear() - return - } - - $scope.command = '' - + var run = function (command) { + // Force run activity + command += ' --activity-clear-top' return $scope.control.shell(command) - .progressed(function(result) { - $scope.result = result - $scope.data = result.data.join('') - $scope.$digest() - }) - .then(function(result) { - $scope.result = result - $scope.data = result.data.join('') - $scope.$digest() + .then(function (result) { + console.log(result) }) } + function openSetting(activity) { + run('am start -a android.intent.action.MAIN -n com.android.settings/.Settings\$' + activity) + } + + $scope.openSettings = function () { + run('am start -a android.intent.action.MAIN -n com.android.settings/.Settings') + } + + $scope.openWiFiSettings = function () { + //openSetting('WifiSettingsActivity') + run('am start -a android.settings.WIFI_SETTINGS') + } + + $scope.openLocaleSettings = function () { + openSetting('LocalePickerActivity') + } + + $scope.openIMESettings = function () { + openSetting('KeyboardLayoutPickerActivity') + } + + $scope.openDisplaySettings = function () { + openSetting('DisplaySettingsActivity') + } + + $scope.openDeviceInfo = function () { + openSetting('DeviceInfoSettingsActivity') + } + + $scope.openManageApps = function () { + //openSetting('ManageApplicationsActivity') + run('am start -a android.settings.APPLICATION_SETTINGS') + } + + $scope.openRunningApps = function () { + openSetting('RunningServicesActivity') + } + + $scope.openDeveloperSettings = function () { + openSetting('DevelopmentSettingsActivity') + } + + + //'am start -n com.android.settings/.Settings\$PowerUsageSummaryActivity' + //'am start -a android.intent.action.POWER_USAGE_SUMMARY' + + $scope.clear = function () { $scope.command = '' $scope.data = '' diff --git a/res/app/control-panes/dashboard/apps/apps.jade b/res/app/control-panes/dashboard/apps/apps.jade index 9877c284..55c0074a 100644 --- a/res/app/control-panes/dashboard/apps/apps.jade +++ b/res/app/control-panes/dashboard/apps/apps.jade @@ -5,7 +5,24 @@ div.pull-right button.btn.btn-sm.btn-primary-outline(ng-click='control.openStore()', tooltip='{{"App Store" | translate}}', tooltip-placement="bottom") - i.fa.fa-android.fa-1x + i.fa.fa-shopping-cart + + button.btn.btn-sm.btn-primary-outline(ng-click='openSettings()', + tooltip='{{"Settings" | translate}}', tooltip-placement="bottom") + i.fa.fa-gear + + button.btn.btn-sm.btn-primary-outline(ng-click='openWiFiSettings()', + tooltip='{{"WiFi Settings" | translate}}', tooltip-placement="bottom") + i.fa.fa-signal + + button.btn.btn-sm.btn-primary-outline(ng-click='openManageApps()', + tooltip='{{"Manage Apps" | translate}}', tooltip-placement="bottom") + i.fa.fa-list + + button.btn.btn-sm.btn-primary-outline(ng-click='openDeveloperSettings()', + tooltip='{{"Developer Settings" | translate}}', tooltip-placement="bottom") + i.fa.fa-bug + .widget-content.padded diff --git a/res/app/control-panes/dashboard/shell/shell.css b/res/app/control-panes/dashboard/shell/shell.css index 54799fc9..fb375450 100644 --- a/res/app/control-panes/dashboard/shell/shell.css +++ b/res/app/control-panes/dashboard/shell/shell.css @@ -6,4 +6,9 @@ .stf-shell .shell-results-empty { font-style: italic; -} \ No newline at end of file +} + +.stf-shell .shell-input { + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + font-size: 12px; +} diff --git a/res/app/control-panes/dashboard/shell/shell.jade b/res/app/control-panes/dashboard/shell/shell.jade index adf5a6b7..f69c20c5 100644 --- a/res/app/control-panes/dashboard/shell/shell.jade +++ b/res/app/control-panes/dashboard/shell/shell.jade @@ -9,9 +9,10 @@ .widget-content.padded .input-group.form-inline - input(type=text, ng-model='command', ng-enter='run(command)').form-control + input(type=text, ng-model='command', ng-enter='run(command)').form-control.shell-input span.input-group-btn - button.btn.btn-primary-outline(ng-click='run(command)', ng-disabled='!command', tooltip-html-unsafe='{{"Run Command"|translate}}

Enter') + // , tooltip='{{"Run Command"|translate}}' + button.btn.btn-primary-outline(ng-click='run(command)', ng-disabled='!command') i.fa.fa-play pre.shell-results(ng-show='data') {{data}} pre.shell-results(ng-show='result.settled && !data').shell-results-empty No output @@ -20,4 +21,4 @@ // 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 + td {{ result.data }} diff --git a/res/app/control-panes/dashboard/upload/upload.jade b/res/app/control-panes/dashboard/upload/upload.jade index 1b9cc953..b24f862a 100644 --- a/res/app/control-panes/dashboard/upload/upload.jade +++ b/res/app/control-panes/dashboard/upload/upload.jade @@ -1,12 +1,12 @@ .widget-container.fluid-height.stf-upload(ng-controller='UploadCtrl') .heading i.fa.fa-upload - span(translate) Upload + span(translate) App Upload clear-button(ng-click='clear()', ng-disabled='!installation && !upload').btn-xs label.checkbox-inline.pull-right input(type='checkbox', ng-model='launchEnabled') span Launch - label.checkbox-inline.pull-right + //label.checkbox-inline.pull-right input(type='checkbox', ng-model='installEnabled') span(translate) Install