jshint fixes for CocoonJS.App and continuing work on the new ScaleManager.

This commit is contained in:
photonstorm 2014-08-31 10:16:53 +01:00
parent 3e1eb10673
commit 4d0cae0e2d
4 changed files with 14 additions and 8 deletions

View file

@ -1,5 +1,6 @@
{
"globals" : { "Phaser": false, "PIXI": false, "p2": false },
"globals" : { "Phaser": false, "PIXI": false, "p2": false, "CocoonJS": false },
// Ignore Environment Globals
"browser" : true, // Standard browser globals e.g. `window`, `document`.

View file

@ -281,7 +281,7 @@ Phaser.ScaleManager.SHOW_ALL = 2;
* @constant
* @type {number}
*/
// Phaser.ScaleManager.FULL_CANVAS = 3;
Phaser.ScaleManager.RESIZE_CANVAS = 3;
Phaser.ScaleManager.prototype = {

View file

@ -299,11 +299,12 @@ Phaser.Stage.prototype.checkVisibility = function () {
var _this = this;
if(this.game.device.cocoonJSApp)
if (this.game.device.cocoonJSApp)
{
CocoonJS.App.onSuspended.addEventListener(function () {
Phaser.Stage.prototype.visibilityChange.call(_this, {type: "pause"});
});
CocoonJS.App.onActivated.addEventListener(function () {
Phaser.Stage.prototype.visibilityChange.call(_this, {type: "resume"});
});

View file

@ -650,16 +650,18 @@ Phaser.Device.prototype = {
this.cordova = true;
}
if(typeof process !== "undefined" && typeof require !== "undefined")
if (typeof process !== "undefined" && typeof require !== "undefined")
{
this.node = true;
}
if(this.node)
if (this.node)
{
try {
this.nodeWebkit = (typeof require('nw.gui') !== "undefined");
} catch(error) {
}
catch(error)
{
this.nodeWebkit = false;
}
}
@ -669,11 +671,13 @@ Phaser.Device.prototype = {
this.cocoonJS = true;
}
if(this.cocoonJS)
if (this.cocoonJS)
{
try {
this.cocoonJSApp = (typeof CocoonJS !== "undefined");
} catch(error) {
}
catch(error)
{
this.cocoonJSApp = false;
}
}