1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 02:09:32 +02:00

Added translate to everything.

Added new version update modal.
This commit is contained in:
Gunther Brunner 2014-05-28 15:58:18 +09:00
parent 1e0a145490
commit 6b67d66a93
22 changed files with 157 additions and 89 deletions

View file

@ -1,24 +0,0 @@
.stf-fatal-message .dialog-header-error {
background-color: #d2322d;
}
.stf-fatal-message .dialog-header-wait {
background-color: #428bca;
}
.stf-fatal-message .dialog-header-notify {
background-color: #eeeeee;
}
.stf-fatal-message .dialog-header-confirm {
background-color: #333333;
}
.stf-fatal-message .dialog-header-error span,
.stf-fatal-message .dialog-header-error h4,
.stf-fatal-message .dialog-header-wait span,
.stf-fatal-message .dialog-header-wait h4,
.stf-fatal-message .dialog-header-confirm span,
.stf-fatal-message .dialog-header-confirm h4 {
color: #ffffff;
}

View file

@ -8,5 +8,5 @@ module.exports = angular.module('stf/common-ui', [
require('./ng-enter').name,
require('./tooltips').name,
//require('./tree').name,
require('./fatal-message').name
require('./modals').name
])

View file

@ -0,0 +1,4 @@
require('./modals.css')
module.exports = angular.module('stf.modals.common', [
])

View file

@ -0,0 +1,28 @@
.stf-modal {
}
.stf-modal .dialog-header-error {
background-color: #d2322d;
}
.stf-modal .dialog-header-wait {
background-color: #428bca;
}
.stf-modal .dialog-header-notify {
background-color: #eeeeee;
}
.stf-modal .dialog-header-confirm {
background-color: #333333;
}
.stf-modal .dialog-header-error span,
.stf-modal .dialog-header-error h4,
.stf-modal .dialog-header-wait span,
.stf-modal .dialog-header-wait h4,
.stf-modal .dialog-header-confirm span,
.stf-modal .dialog-header-confirm h4 {
color: #ffffff;
}

View file

@ -29,7 +29,6 @@ module.exports = function FatalMessageServiceFactory($modal, $location, $route)
})
modalInstance.result.then(function (selectedItem) {
console.log(selectedItem)
}, function () {
})

View file

@ -1,18 +1,18 @@
.stf-fatal-message
.stf-fatal-message.stf-modal
.modal-header.dialog-header-error
button(type='button', ng-click='cancel()').close ×
h4.modal-title.text-danger
i.fa.fa-warning
span Device was disconnected
.modal-body.text-danger Device is not in use anymore
span(translate) Device was disconnected
.modal-body.text-danger(translate) Device is not in use anymore
.modal-footer
button.btn.btn-primary(type='button', ng-click='ok()')
i.fa.fa-refresh
span Try to reconnect
span(translate) Try to reconnect
button.btn.btn-success(ng-click='second()')
i.fa.fa-sitemap
span Go to Device List
//button.btn.btn-warning(translate, ng-click='cancel()') Close
span(translate) Go to Device List
//button.btn.btn-warning(ng-click='cancel()') Close
//'<div class="modal-header dialog-header-error">
// <button type="button" class="close" ng-click="close()">&times;</button>

View file

@ -1,6 +1,4 @@
require('./fatal-message.css')
module.exports = angular.module('stf.fatal-message', [
require('stf/common-ui/modals/common').name
])
.factory('FatalMessageService', require('./fatal-message-service'))

View file

@ -0,0 +1,4 @@
module.exports = angular.module('stf.modals', [
require('./fatal-message').name,
require('./version-update').name
])

View file

@ -0,0 +1,4 @@
module.exports = angular.module('stf.version-update', [
require('stf/common-ui/modals/common').name
])
.factory('VersionUpdateService', require('./version-update-service'))

View file

@ -0,0 +1,27 @@
module.exports = function FatalMessageServiceFactory($modal, $location, socket) {
var service = {}
var ModalInstanceCtrl = function ($scope, $modalInstance, device) {
$scope.ok = function () {
$modalInstance.close(true)
$location.path('/')
}
$scope.cancel = function () {
$modalInstance.dismiss('cancel')
}
}
service.open = function () {
var modalInstance = $modal.open({
template: require('./version-update.jade'),
controller: ModalInstanceCtrl
})
modalInstance.result.then(function (selectedItem) {
}, function () {
})
}
return service
}

View file

@ -0,0 +1,11 @@
describe('VersionUpdateService', function() {
beforeEach(module('stf.version-update'));
it('should ...', inject(function(FatalMessageService) {
//expect(FatalMessageService.doSomething()).toEqual('something');
}));
})

View file

@ -0,0 +1,11 @@
.stf-fatal-message.stf-modal
.modal-header.dialog-header-notify
button(type='button', ng-click='cancel()').close &times;
h4.modal-title.text-danger
i.fa.fa-exclamation-circle.fa-fw
span(translate) Version Update
.modal-body(translate) A new version of STF is available
.modal-footer
button.btn.btn-primary(type='button', ng-click='ok()')
i.fa.fa-refresh
span(translate) Reload

View file

@ -1,2 +1,4 @@
module.exports = angular.module('stf/socket', [])
module.exports = angular.module('stf/socket', [
require('stf/common-ui/modals/version-update').name
])
.factory('socket', require('./socket-service'))

View file

@ -1,6 +1,6 @@
var io = require('socket.io')
module.exports = function SocketFactory($rootScope) {
module.exports = function SocketFactory($rootScope, VersionUpdateService) {
var socket = io.connect(null, {
reconnect: false
})
@ -26,6 +26,10 @@ module.exports = function SocketFactory($rootScope) {
}
}
socket.on('outdated', function () {
VersionUpdateService.open()
})
socket.on('socket.ip', function(ip) {
$rootScope.$apply(function() {
socket.ip = ip

View file

@ -6,49 +6,49 @@
div
h6(translate) Special Keys
div.special-keys-buttons
button(title='Power', ng-click='press("power")').btn.btn-danger
button(tooltip='{{ "Power" | translate }}', ng-click='press("power")').btn.btn-danger
i.fa.fa-power-off
button(title='Camera', ng-click='press("camera")').btn.btn-primary
button(tooltip='{{ "Camera" | translate }}', ng-click='press("camera")').btn.btn-primary
i.fa.fa-camera
button(title='Switch Charset', ng-click='press("switch_charset")').btn.btn-primary.btn-info
button(tooltip='{{ "Switch Charset" | translate }}', ng-click='press("switch_charset")').btn.btn-primary.btn-info
i.fa Aa
button(title='Search', ng-click='press("search")').btn.btn-primary
button(tooltip='{{ "Search" | translate }}', ng-click='press("search")').btn.btn-primary
i.fa.fa-search
h6(translate) Volume
.btn-group
button(title='Mute', ng-click='press("mute")').btn.btn-primary.btn-xs
button(tooltip='{{ "Mute" | translate }}', ng-click='press("mute")').btn.btn-primary.btn-xs
i.fa.fa-volume-off
button(title='Volume Down', ng-click='press("volume_down")').btn.btn-primary.btn-xs
button(tooltip='{{ "Volume Down" | translate }}', ng-click='press("volume_down")').btn.btn-primary.btn-xs
i.fa.fa-volume-down
button(title='Volume Up', ng-click='press("volume_up")').btn.btn-primary.btn-xs
button(tooltip='{{ "Volume Up" | translate }}', ng-click='press("volume_up")').btn.btn-primary.btn-xs
i.fa.fa-volume-up
h6(translate) Media
.btn-group
button(title='Rewind', ng-click='press("media_rewind")').btn.btn-primary.btn-xs
button(tooltip='{{ "Rewind" | translate }}', ng-click='press("media_rewind")').btn.btn-primary.btn-xs
i.fa.fa-fast-backward
button(title='Previous', ng-click='press("media_previous")').btn.btn-primary.btn-xs
button(tooltip='{{ "Previous" | translate }}', ng-click='press("media_previous")').btn.btn-primary.btn-xs
i.fa.fa-step-backward
button(title='Play/Pause', ng-click='press("media_play_pause")').btn.btn-primary.btn-xs
button(tooltip='{{ "Play/Pause" | translate }}', ng-click='press("media_play_pause")').btn.btn-primary.btn-xs
i.fa.fa-youtube-play
button(title='Stop', ng-click='press("media_stop")').btn.btn-primary.btn-xs
button(tooltip='{{ "Stop" | translate }}', ng-click='press("media_stop")').btn.btn-primary.btn-xs
i.fa.fa-stop
button(title='Next', ng-click='press("media_next")').btn.btn-primary.btn-xs
button(tooltip='{{ "Next" | translate }}', ng-click='press("media_next")').btn.btn-primary.btn-xs
i.fa.fa-step-forward
button(title='Fast Forward', ng-click='press("media_fast_forward")').btn.btn-primary.btn-xs
button(tooltip='{{ "Fast Forward" | translate }}', ng-click='press("media_fast_forward")').btn.btn-primary.btn-xs
i.fa.fa-fast-forward
//h6 Physical Media
//.btn-group
button(title='Play', ng-click='press("KEYCODE_MEDIA_PLAY")').btn.btn-primary.btn-xs
button(tooltip='{{ "Play" | translate }}', ng-click='press("KEYCODE_MEDIA_PLAY")').btn.btn-primary.btn-xs
i.fa.fa-play
button(title='Pause', ng-click='press("KEYCODE_MEDIA_PAUSE")').btn.btn-primary.btn-xs
button(tooltip='{{ "Pause" | translate }}', ng-click='press("KEYCODE_MEDIA_PAUSE")').btn.btn-primary.btn-xs
i.fa.fa-pause
button(title='Close', ng-click='press("KEYCODE_MEDIA_CLOSE")').btn.btn-primary.btn-xs
button(tooltip='{{ "Close" | translate }}', ng-click='press("KEYCODE_MEDIA_CLOSE")').btn.btn-primary.btn-xs
i.fa.fa-sign-out
button(title='Eject', ng-click='press("KEYCODE_MEDIA_EJECT")').btn.btn-primary.btn-xs
button(tooltip='{{ "Eject" | translate }}', ng-click='press("KEYCODE_MEDIA_EJECT")').btn.btn-primary.btn-xs
i.fa.fa-eject
button(title='Record', ng-click='press("KEYCODE_MEDIA_RECORD")').btn.btn-primary.btn-xs
button(tooltip='{{ "Record" | translate }}', ng-click='press("KEYCODE_MEDIA_RECORD")').btn.btn-primary.btn-xs
i.fa.fa-circle
//h6(translate) Other Keys
//div.special-other-keys-buttons
@ -84,7 +84,7 @@
i.fa かな
button(ng-click='press("KEYCODE_ASSIST")').btn.btn-default.btn-xs
i.fa Assist
//button(title='Switch Charset', ng-click='press(80)').btn.btn-primary
//button(tooltip='{{ "Switch Charset" | translate }}', ng-click='press(80)').btn.btn-primary
i.fa TST
//button(ng-click='press("KEYCODE_CLEAR")').btn.btn-primary.btn-sm
i.fa Clear
@ -93,22 +93,22 @@
tr
td
td
button(title='D-pad Up', ng-click='press("dpad_up")').btn.btn-info.btn-xs
button(tooltip='{{ "D-pad Up" | translate }}', ng-click='press("dpad_up")').btn.btn-info.btn-xs
i.fa.fa-chevron-up
td
tr
td
button(title='D-pad Left', ng-click='press("dpad_left")').btn.btn-info.btn-xs
button(tooltip='{{ "D-pad Left" | translate }}', ng-click='press("dpad_left")').btn.btn-info.btn-xs
i.fa.fa-chevron-left
td
button(title='D-pad Center', ng-click='press("dpad_center")').btn.btn-info.btn-xs
button(tooltip='{{ "D-pad Center" | translate }}', ng-click='press("dpad_center")').btn.btn-info.btn-xs
i.fa.fa-circle-o
td
button(title='D-pad Right', ng-click='press("dpad_right")').btn.btn-info.btn-xs
button(tooltip='{{ "D-pad Right" | translate }}', ng-click='press("dpad_right")').btn.btn-info.btn-xs
i.fa.fa-chevron-right
tr
td
td
button(title='D-pad Down', ng-click='press("dpad_down")').btn.btn-info.btn-xs
button(tooltip='{{ "D-pad Down" | translate }}', ng-click='press("dpad_down")').btn.btn-info.btn-xs
i.fa.fa-chevron-down
td

View file

@ -3,7 +3,7 @@
i.fa.fa-globe
span(translate) Navigation
span
button.btn.btn-xs.btn-danger-outline.pull-right(ng-click='clearSettings()', title='{{"Reset all browser settings"|translate}}')
button.btn.btn-xs.btn-danger-outline.pull-right(ng-click='clearSettings()', tooltip='{{ "Reset all browser settings" | translate }}')
i.fa.fa-trash-o
span(translate) Reset
//.button-spacer.pull-right

View file

@ -3,27 +3,27 @@ div(ng-controller='ActivitiesCtrl')
table.table.table-condensed
tbody
tr
td Package
td(translate) Package
td
input.form-control(type='text', placeholder='', ng-model='selectedPackageName',
typeahead='packageName for packageName in packageNames')
tr
td Activity
td(translate) Activity
td
input.form-control(type='text', placeholder='', ng-model='selectedActivityName',
typeahead='activityName for activityName in activityNames')
tr
td Action
td(translate) Action
td
input.form-control(type='text', placeholder='', ng-model='selectedAction',
typeahead='action for action in activityActions')
tr
td Category
td(translate) Category
td
input.form-control(type='text', placeholder='', ng-model='selectedCategory',
typeahead='category for category in activityCategories')
tr
td Data
td(translate) Data
td
input.form-control(type='text', placeholder='', ng-model='selectedData',
typeahead='data for data in activityData', id='selectedData')

View file

@ -9,7 +9,7 @@ angular-packery='{draggable: true, draggableHandle: ".heading i"}')
.pull-right
button(ng-click='control.identify()').btn.btn-xs.btn-primary-outline
i.fa.fa-info
span Find Device
span(translate) Find Device
.widget-content.padded-small
table.table.table-condensed.table-hover.table-infocard
tbody
@ -29,21 +29,21 @@ angular-packery='{draggable: true, draggableHandle: ".heading i"}')
td(translate) Health
td {{device.battery.health | batteryHealth}}
tr
td Power Source
td(translate) Power Source
td {{device.battery.source | batterySource}}
tr
td Status
td(translate) Status
td {{device.battery.status | batteryStatus}}
tr
td Level
td(translate) Level
td
progressbar(value='device.battery.level', animate='false', max='device.battery.scale', type='success')
span {{ device.battery.level / device.battery.scale * 100 }}%
tr
td Temperature
td(translate) Temperature
td {{device.battery.temp}} °C
tr
td Voltage
td(translate) Voltage
td {{device.battery.voltage}} v
.col-md-4-x.packery-item
@ -61,25 +61,25 @@ angular-packery='{draggable: true, draggableHandle: ".heading i"}')
td(translate) FPS
td {{device.display.fps}}
tr
td Width
td(translate) Width
td {{device.display.width}} px
tr
td Height
td(translate) Height
td {{device.display.height}} px
tr
td ID
td(translate) ID
td {{device.display.id}}
tr
td Orientation
td(translate) Orientation
td {{device.display.orientation}}°
tr
td Encrypted
td(translate) Encrypted
td {{device.display.secure | humanizedBool}}
tr
td X DPI
td(translate) X DPI
td {{device.display.xdpi}}
tr
td Y DPI
td(translate) Y DPI
td {{device.display.ydpi}}
.col-md-4-x.packery-item
@ -100,13 +100,13 @@ angular-packery='{draggable: true, draggableHandle: ".heading i"}')
td(translate) Using Fallback
td {{device.network.failover | humanizedBool}}
tr
td Roaming
td(translate) Roaming
td {{device.network.roaming | humanizedBool}}
tr
td Type
td(translate) Type
td {{device.network.type | networkType}}
tr
td Sub Type
td(translate) Sub Type
td {{device.network.subtype | networkSubType}}
.col-md-4-x.packery-item

View file

@ -4,7 +4,7 @@
title='{{"Take Screenshot"|translate}}')
i.fa.fa-camera
span(translate) Screenshot
button.btn.btn-sm.btn-info-outline(ng-click='takePageShot()',
//button.btn.btn-sm.btn-info-outline(ng-click='takePageShot()',
title='{{"Take Pageshot (Needs WebView running)"|translate}}',
ng-if='$root.platform == "web" && $root.browser == "webview"')
i.fa.fa-camera-retro(translate)

View file

@ -1,5 +1,5 @@
module.exports = function MenuCtrl($scope, $rootScope, SettingsService) {
$rootScope.platform = 'web'
$rootScope.platform = 'native'
SettingsService.bind($rootScope, {
key: 'platform',
storeName: 'Platform'

View file

@ -16,10 +16,10 @@ html
.pane-top(pane).fill-height
.pane-top-bar(pane, pane-anchor='north', pane-size='44px', pane-min='44px', pane-max='44px', pane-handle='')
div(ng-include='"menu.jade"')
socket-state
div(growl)
.pane-center(pane, pane-anchor='center').fill-height
socket-state
div(growl)
div(ng-view).fill-height
script(src='/static/build/bundle.js')