diff --git a/lib/cli.js b/lib/cli.js index 5b96b6ec..483523bf 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -350,6 +350,8 @@ program .option('-c, --connect-push ' , '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) }) diff --git a/lib/roles/app.js b/lib/roles/app.js index 3d197518..912a9624 100644 --- a/lib/roles/app.js +++ b/lib/roles/app.js @@ -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'))) diff --git a/lib/roles/webpack-config.js b/lib/roles/webpack-config.js index 0448fc06..a23635be 100644 --- a/lib/roles/webpack-config.js +++ b/lib/roles/webpack-config.js @@ -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, diff --git a/res/app/components/stf/screen/screen-directive.js b/res/app/components/stf/screen/screen-directive.js index 94902bb3..824ccdf5 100644 --- a/res/app/components/stf/screen/screen-directive.js +++ b/res/app/components/stf/screen/screen-directive.js @@ -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()