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

Added back new screen directive.

This commit is contained in:
Gunther Brunner 2014-02-19 21:40:37 +09:00
parent 86a42639a1
commit a2a00736b6
4 changed files with 35 additions and 9 deletions

View file

@ -350,6 +350,8 @@ program
.option('-c, --connect-push <endpoint>' .option('-c, --connect-push <endpoint>'
, 'push endpoint' , 'push endpoint'
, cliutil.list) , cliutil.list)
.option('-d, --disable-watch'
, 'disable watching resources')
.action(function(options) { .action(function(options) {
if (!options.secret) { if (!options.secret) {
this.missingArgument('--secret') this.missingArgument('--secret')
@ -374,6 +376,7 @@ program
sub: options.connectSub sub: options.connectSub
, push: options.connectPush , push: options.connectPush
} }
, disableWatch: options.disableWatch
}) })
}) })
@ -445,9 +448,8 @@ program
, 'provider name (or os.hostname())' , 'provider name (or os.hostname())'
, String , String
, os.hostname()) , os.hostname())
.option('-dw, --disable-watch' .option('-d, --disable-watch'
, Boolean , 'disable watching resources')
, process.env.DISABLE_WATCH)
.action(function() { .action(function() {
var log = logger.createLogger('cli') var log = logger.createLogger('cli')
, options = cliutil.lastArg(arguments) , options = cliutil.lastArg(arguments)
@ -524,7 +526,13 @@ program
, '--auth-url', util.format('http://localhost:%d/', options.authPort) , '--auth-url', util.format('http://localhost:%d/', options.authPort)
, '--connect-sub', options.bindAppPub , '--connect-sub', options.bindAppPub
, '--connect-push', options.bindAppPull , '--connect-push', options.bindAppPull
]) ].concat(function() {
var extra = []
if (options.disableWatch) {
extra.push('--disable-watch')
}
return extra
}()))
.catch(function(err) { .catch(function(err) {
log.error('app died', err.stack) log.error('app died', err.stack)
}) })

View file

@ -34,8 +34,6 @@ module.exports = function(options) {
io.set('log level', 1) io.set('log level', 1)
io.set('browser client', false) io.set('browser client', false)
app.use(express.compress())
app.use('/static/lib', express.static(pathutil.resource('lib'))) app.use('/static/lib', express.static(pathutil.resource('lib')))
app.use('/static', express.static(pathutil.resource('app'))) app.use('/static', express.static(pathutil.resource('app')))

View file

@ -33,7 +33,7 @@ var webpackConfig = webpackMiddleware(webpack({
{ test: /oboe-browser\.js/, loader: 'imports?define=>false!exports?oboe'} { test: /oboe-browser\.js/, loader: 'imports?define=>false!exports?oboe'}
], ],
noParse: [ noParse: [
pathutil.resource('lib') // pathutil.resource('lib')
] ]
}, },
plugins: [ plugins: [
@ -43,7 +43,7 @@ var webpackConfig = webpackMiddleware(webpack({
new webpack.ResolverPlugin( new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('.bower.json', ['main']) new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('.bower.json', ['main'])
) )
//new webpack.optimize.UglifyJsPlugin() //new webpack.optimize.UglifyJsPlugin({mangle: false})
] ]
}), { }), {
noInfo: false, noInfo: false,

View file

@ -7,11 +7,12 @@ module.exports = function DeviceScreenDirective($document, ScalingService) {
var loader = new Image() var loader = new Image()
, canvas = element.find('canvas')[0] , canvas = element.find('canvas')[0]
, finger = element.find('span') , finger = element.find('span')
, input = element.find('textarea')
, g = canvas.getContext('2d') , g = canvas.getContext('2d')
, displayWidth = 0 , displayWidth = 0
, displayHeight = 0 , displayHeight = 0
, scaler = ScalingService.coordinator( , scaler = ScalingService.coordinator(
device.display.width device.display.width
, device.display.height , device.display.height
) )
@ -85,6 +86,7 @@ module.exports = function DeviceScreenDirective($document, ScalingService) {
function downListener(e) { function downListener(e) {
e.preventDefault() e.preventDefault()
input[0].focus()
element.addClass('fingering') element.addClass('fingering')
sendTouch('touchDown', e) sendTouch('touchDown', e)
element.bind('mousemove', moveListener) element.bind('mousemove', moveListener)
@ -113,6 +115,24 @@ module.exports = function DeviceScreenDirective($document, ScalingService) {
stop() stop()
}) })
input.bind('keydown', function (e) {
$scope.control.keyDown(e.keyCode)
})
input.bind('keyup', function (e) {
$scope.control.keyUp(e.keyCode)
})
input.bind('keypress', function (e) {
e.preventDefault() // no need to change value
$scope.control.type(String.fromCharCode(e.charCode))
})
input.bind('paste', function (e) {
e.preventDefault() // no need to change value
$scope.control.type(e.clipboardData.getData('text/plain'))
})
element.bind('mousedown', downListener) element.bind('mousedown', downListener)
updateDisplaySize() updateDisplaySize()
loadScreen() loadScreen()