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

View file

@ -34,8 +34,6 @@ module.exports = function(options) {
io.set('log level', 1)
io.set('browser client', false)
app.use(express.compress())
app.use('/static/lib', express.static(pathutil.resource('lib')))
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'}
],
noParse: [
pathutil.resource('lib')
// pathutil.resource('lib')
]
},
plugins: [
@ -43,7 +43,7 @@ var webpackConfig = webpackMiddleware(webpack({
new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('.bower.json', ['main'])
)
//new webpack.optimize.UglifyJsPlugin()
//new webpack.optimize.UglifyJsPlugin({mangle: false})
]
}), {
noInfo: false,

View file

@ -7,11 +7,12 @@ module.exports = function DeviceScreenDirective($document, ScalingService) {
var loader = new Image()
, canvas = element.find('canvas')[0]
, finger = element.find('span')
, input = element.find('textarea')
, g = canvas.getContext('2d')
, displayWidth = 0
, displayHeight = 0
, scaler = ScalingService.coordinator(
device.display.width
device.display.width
, device.display.height
)
@ -85,6 +86,7 @@ module.exports = function DeviceScreenDirective($document, ScalingService) {
function downListener(e) {
e.preventDefault()
input[0].focus()
element.addClass('fingering')
sendTouch('touchDown', e)
element.bind('mousemove', moveListener)
@ -113,6 +115,24 @@ module.exports = function DeviceScreenDirective($document, ScalingService) {
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)
updateDisplaySize()
loadScreen()