Issue #331 : Gruntfile : host as variable

This commit is contained in:
Alexander Holland 2015-11-11 14:05:28 +01:00 committed by jdescottes
parent 6311049210
commit 8ec47506bf
2 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,5 @@
module.exports = function(grunt) { module.exports = function(grunt) {
var ip = 'localhost';
var dateFormat = require('dateformat'); var dateFormat = require('dateformat');
var now = new Date(); var now = new Date();
var version = '-' + dateFormat(now, "yyyy-mm-dd-hh-MM"); var version = '-' + dateFormat(now, "yyyy-mm-dd-hh-MM");
@ -34,7 +35,7 @@ module.exports = function(grunt) {
filesSrc : tests, filesSrc : tests,
options : { options : {
args : { args : {
baseUrl : 'http://localhost:' + '<%= express.test.options.port %>/', baseUrl : 'http://' + ip + ':' + '<%= express.test.options.port %>/',
mode : '?debug', mode : '?debug',
delay : conf.delay delay : conf.delay
}, },
@ -58,7 +59,7 @@ module.exports = function(grunt) {
return { return {
options: { options: {
port: port, port: port,
hostname : host || 'localhost', hostname : host || ip,
bases: bases bases: bases
} }
}; };
@ -111,10 +112,10 @@ module.exports = function(grunt) {
}, },
open : { open : {
regular : { regular : {
path : 'http://localhost:9001/' path : 'http://' + ip + ':9001/'
}, },
debug : { debug : {
path : 'http://localhost:9901/?debug' path : 'http://' + ip + ':9901/?debug'
} }
}, },

View File

@ -142,8 +142,7 @@
$.publish(Events.MOUSE_EVENT, [event, this]); $.publish(Events.MOUSE_EVENT, [event, this]);
var frame = this.piskelController.getCurrentFrame(); var frame = this.piskelController.getCurrentFrame();
var coords = this.getSpriteCoordinates(event.clientX, event.clientY); var coords = this.getSpriteCoordinates(event.clientX, event.clientY);
if (typeof event.changedTouches != 'undefined' && if (event.changedTouches && event.changedTouches[0]) {
typeof event.changedTouches[0] != 'undefined') {
coords = this.getSpriteCoordinates(event.changedTouches[0].clientX, event.changedTouches[0].clientY); coords = this.getSpriteCoordinates(event.changedTouches[0].clientX, event.changedTouches[0].clientY);
} }
@ -170,8 +169,7 @@
ns.DrawingController.prototype.onMousemove_ = function (event) { ns.DrawingController.prototype.onMousemove_ = function (event) {
this._clientX = event.clientX; this._clientX = event.clientX;
this._clientY = event.clientY; this._clientY = event.clientY;
if (typeof event.changedTouches != 'undefined' && if (event.changedTouches && event.changedTouches[0]) {
typeof event.changedTouches[0] != 'undefined') {
this._clientX = event.changedTouches[0].clientX; this._clientX = event.changedTouches[0].clientX;
this._clientY = event.changedTouches[0].clientY; this._clientY = event.changedTouches[0].clientY;
} }
@ -263,8 +261,7 @@
ns.DrawingController.prototype.onMouseup_ = function (event) { ns.DrawingController.prototype.onMouseup_ = function (event) {
var frame = this.piskelController.getCurrentFrame(); var frame = this.piskelController.getCurrentFrame();
var coords = this.getSpriteCoordinates(event.clientX, event.clientY); var coords = this.getSpriteCoordinates(event.clientX, event.clientY);
if (typeof event.changedTouches != 'undefined' && if (event.changedTouches && event.changedTouches[0]) {
typeof event.changedTouches[0] != 'undefined') {
coords = this.getSpriteCoordinates(event.changedTouches[0].clientX, event.changedTouches[0].clientY); coords = this.getSpriteCoordinates(event.changedTouches[0].clientX, event.changedTouches[0].clientY);
} }
if (this.isClicked) { if (this.isClicked) {