diff --git a/app/Bootstrap/HttpServer.js b/app/Bootstrap/HttpServer.js index ff4a8b8..1c30e77 100755 --- a/app/Bootstrap/HttpServer.js +++ b/app/Bootstrap/HttpServer.js @@ -7,6 +7,8 @@ define([ function (http, nodeStatic, Api, fs) { + "use strict"; + function HttpServer (options, coordinator) { options.port = options.port || 1234; options.caching = typeof options.caching != 'undefined' ? options.caching : 3600; diff --git a/app/Bootstrap/Socket.js b/app/Bootstrap/Socket.js index 460ac73..392af34 100755 --- a/app/Bootstrap/Socket.js +++ b/app/Bootstrap/Socket.js @@ -4,6 +4,8 @@ define([ function (io) { + "use strict"; + function Socket (server, options, coordinator) { options.logLevel = typeof options.logLevel != 'undefined' ? options.logLevel diff --git a/app/Game/Channel/Collision/Detector.js b/app/Game/Channel/Collision/Detector.js index 8576da9..4d81552 100755 --- a/app/Game/Channel/Collision/Detector.js +++ b/app/Game/Channel/Collision/Detector.js @@ -4,6 +4,8 @@ define([ function (Parent) { + "use strict"; + function Detector () { Parent.call(this); } diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index eb7e013..66a6b74 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -14,6 +14,8 @@ define([ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RagDoll) { + "use strict"; + function GameController (options) { this.animationTimeout = null; diff --git a/app/Game/Channel/GameObjects/Doll.js b/app/Game/Channel/GameObjects/Doll.js index ed5022b..ea5fa0f 100755 --- a/app/Game/Channel/GameObjects/Doll.js +++ b/app/Game/Channel/GameObjects/Doll.js @@ -6,6 +6,8 @@ define([ ], function (Parent, Item, Box2D, Nc) { + + "use strict"; function Doll(physicsEngine, uid, player) { Parent.call(this, physicsEngine, uid, player); @@ -15,10 +17,12 @@ function (Parent, Item, Box2D, Nc) { Doll.prototype.findCloseItem = function(x, y) { + var self = this; + function findItem(array) { for (var i = 0; i < array.length; i++) { var item = array[i]; - if(item.isGrabbingAllowed(this.player)) { + if(item.isGrabbingAllowed(self.player)) { return item; } } diff --git a/app/Game/Channel/GameObjects/Item.js b/app/Game/Channel/GameObjects/Item.js index dcf28ef..0102d49 100755 --- a/app/Game/Channel/GameObjects/Item.js +++ b/app/Game/Channel/GameObjects/Item.js @@ -3,6 +3,8 @@ define([ ], function (Parent) { + + "use strict"; function Item(physicsEngine, uid, options) { Parent.call(this, physicsEngine, uid, options); diff --git a/app/Game/Channel/GameObjects/Items/RagDoll.js b/app/Game/Channel/GameObjects/Items/RagDoll.js index 938e229..9576a73 100644 --- a/app/Game/Channel/GameObjects/Items/RagDoll.js +++ b/app/Game/Channel/GameObjects/Items/RagDoll.js @@ -5,6 +5,8 @@ define([ ], function (Parent, Settings, Nc) { + + "use strict"; function RagDoll(physicsEngine, uid, options) { this.scheduledForDestruction = false; diff --git a/app/Game/Channel/GameObjects/Items/Rube.js b/app/Game/Channel/GameObjects/Items/Rube.js index f663984..455467b 100644 --- a/app/Game/Channel/GameObjects/Items/Rube.js +++ b/app/Game/Channel/GameObjects/Items/Rube.js @@ -4,6 +4,8 @@ define([ function (Parent) { + "use strict"; + return Parent; }); \ No newline at end of file diff --git a/app/Game/Channel/GameObjects/SpectatorDoll.js b/app/Game/Channel/GameObjects/SpectatorDoll.js index b89f262..058fca7 100644 --- a/app/Game/Channel/GameObjects/SpectatorDoll.js +++ b/app/Game/Channel/GameObjects/SpectatorDoll.js @@ -4,6 +4,8 @@ define([ function (Parent) { + "use strict"; + return Parent; }); \ No newline at end of file diff --git a/app/Game/Channel/Loader/Level.js b/app/Game/Channel/Loader/Level.js index 7b2c972..855fea3 100755 --- a/app/Game/Channel/Loader/Level.js +++ b/app/Game/Channel/Loader/Level.js @@ -6,6 +6,8 @@ define([ function (Parent, Settings, FileSystem) { + "use strict"; + function Level (uid, engine, gameObjects) { Parent.call(this, uid, engine, gameObjects); } diff --git a/app/Game/Channel/Loader/TiledLevel.js b/app/Game/Channel/Loader/TiledLevel.js index e23fbd3..ad96bfd 100644 --- a/app/Game/Channel/Loader/TiledLevel.js +++ b/app/Game/Channel/Loader/TiledLevel.js @@ -4,6 +4,8 @@ define([ function (Parent) { + "use strict"; + return Parent; }); \ No newline at end of file diff --git a/app/Game/Channel/PipeToServer.js b/app/Game/Channel/PipeToServer.js index 2c007e5..43044f1 100755 --- a/app/Game/Channel/PipeToServer.js +++ b/app/Game/Channel/PipeToServer.js @@ -5,6 +5,8 @@ define([ function (Nc, Channel) { + "use strict"; + function PipeToServer (process) { var self = this; diff --git a/app/Game/Channel/Player.js b/app/Game/Channel/Player.js index 00f806a..7fc60b1 100755 --- a/app/Game/Channel/Player.js +++ b/app/Game/Channel/Player.js @@ -4,6 +4,8 @@ define([ ], function (Parent, Nc) { + + "use strict"; function Player(id, physicsEngine, user) { Parent.call(this, id, physicsEngine, user); diff --git a/app/Game/Client/AudioPlayer.js b/app/Game/Client/AudioPlayer.js index a43866e..9925ab0 100644 --- a/app/Game/Client/AudioPlayer.js +++ b/app/Game/Client/AudioPlayer.js @@ -2,6 +2,8 @@ define([ ], function () { + + "use strict"; function AudioPlayer(path) { this.audio = new Audio(path); diff --git a/app/Game/Client/Collision/Detector.js b/app/Game/Client/Collision/Detector.js index 20e16a4..ab540f2 100755 --- a/app/Game/Client/Collision/Detector.js +++ b/app/Game/Client/Collision/Detector.js @@ -4,6 +4,8 @@ define([ function (Parent) { + "use strict"; + function Detector () { Parent.call(this); } diff --git a/app/Game/Client/Control/Input/GamepadInput.js b/app/Game/Client/Control/Input/GamepadInput.js index 9ddef91..24ddad5 100644 --- a/app/Game/Client/Control/Input/GamepadInput.js +++ b/app/Game/Client/Control/Input/GamepadInput.js @@ -5,6 +5,8 @@ define([ ], function (Parent, Settings, Nc) { + + "use strict"; function GamepadInput(playerController) { this.playerController = playerController; diff --git a/app/Game/Client/Control/Input/MouseInput.js b/app/Game/Client/Control/Input/MouseInput.js index ee66551..b069f52 100755 --- a/app/Game/Client/Control/Input/MouseInput.js +++ b/app/Game/Client/Control/Input/MouseInput.js @@ -6,6 +6,8 @@ define([ ], function (Parent, DomController, Settings, Nc) { + + "use strict"; function MouseInput() { Parent.call(this); diff --git a/app/Game/Client/Control/Input/XyInput.js b/app/Game/Client/Control/Input/XyInput.js index 47864d4..fc46cc1 100755 --- a/app/Game/Client/Control/Input/XyInput.js +++ b/app/Game/Client/Control/Input/XyInput.js @@ -3,6 +3,8 @@ define([ ], function (Nc) { + + "use strict"; function XyInput() { this.x = null; diff --git a/app/Game/Client/Control/KeyboardInput.js b/app/Game/Client/Control/KeyboardInput.js index 665d1aa..6c66ede 100755 --- a/app/Game/Client/Control/KeyboardInput.js +++ b/app/Game/Client/Control/KeyboardInput.js @@ -4,6 +4,8 @@ define([ function (Key) { + "use strict"; + function KeyboardInput (playerController) { this._registry = {}; diff --git a/app/Game/Client/Control/PlayerController.js b/app/Game/Client/Control/PlayerController.js index fbe1ca5..e7c7390 100755 --- a/app/Game/Client/Control/PlayerController.js +++ b/app/Game/Client/Control/PlayerController.js @@ -8,6 +8,8 @@ define([ function (Parent, KeyboardInput, MouseInput, Nc, GamepadInput) { + "use strict"; + function PlayerController (me) { Parent.call(this, me); diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index d219c32..163fa7a 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -17,6 +17,8 @@ define([ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, requestAnimFrame, Settings, GameObject, Doll, DomController, ProtocolHelper, Me, AudioPlayer) { + "use strict"; + if (!window.cancelAnimationFrame) { window.cancelAnimationFrame = function(id) { clearTimeout(id); diff --git a/app/Game/Client/GameObjects/Doll.js b/app/Game/Client/GameObjects/Doll.js index 26c24ce..4d374b5 100755 --- a/app/Game/Client/GameObjects/Doll.js +++ b/app/Game/Client/GameObjects/Doll.js @@ -8,6 +8,8 @@ define([ ], function (Parent, Settings, Nc, Exception, ColorConverter, Layer) { + + "use strict"; function Doll(physicsEngine, uid, player) { this.layerId = Layer.ID.SPAWN; diff --git a/app/Game/Client/GameObjects/GameObject.js b/app/Game/Client/GameObjects/GameObject.js index 577830d..d20405e 100755 --- a/app/Game/Client/GameObjects/GameObject.js +++ b/app/Game/Client/GameObjects/GameObject.js @@ -5,6 +5,8 @@ define([ ], function (Parent, Exception, Nc) { + + "use strict"; function GameObject(physicsEngine, uid) { Parent.call(this, physicsEngine, uid); diff --git a/app/Game/Client/GameObjects/Item.js b/app/Game/Client/GameObjects/Item.js index e96a1b6..f49fb8a 100755 --- a/app/Game/Client/GameObjects/Item.js +++ b/app/Game/Client/GameObjects/Item.js @@ -6,6 +6,8 @@ define([ ], function (Parent, Settings, Nc, Layer) { + + "use strict"; function Item(physicsEngine, uid, options) { this.layerId = Layer.ID.ITEM; diff --git a/app/Game/Client/GameObjects/Items/RagDoll.js b/app/Game/Client/GameObjects/Items/RagDoll.js index d24b04c..c5bf84a 100644 --- a/app/Game/Client/GameObjects/Items/RagDoll.js +++ b/app/Game/Client/GameObjects/Items/RagDoll.js @@ -7,6 +7,8 @@ define([ ], function (Parent, CoreItem, Settings, Nc, Layer) { + + "use strict"; function RagDoll(physicsEngine, uid, options) { this.layerId = Layer.ID.SPAWN; diff --git a/app/Game/Client/GameObjects/Items/Rube.js b/app/Game/Client/GameObjects/Items/Rube.js index e029668..4aa825b 100644 --- a/app/Game/Client/GameObjects/Items/Rube.js +++ b/app/Game/Client/GameObjects/Items/Rube.js @@ -3,6 +3,8 @@ define([ ], function (Parent) { + + "use strict"; function Rube(physicsEngine, uid, options) { Parent.call(this, physicsEngine, uid, options); diff --git a/app/Game/Client/GameObjects/SpectatorDoll.js b/app/Game/Client/GameObjects/SpectatorDoll.js index faf141a..4d1fbb1 100644 --- a/app/Game/Client/GameObjects/SpectatorDoll.js +++ b/app/Game/Client/GameObjects/SpectatorDoll.js @@ -3,6 +3,8 @@ define([ ], function (Parent) { + + "use strict"; function SpectatorDoll(physicsEngine, uid) { Parent.call(this, physicsEngine, uid); diff --git a/app/Game/Client/GameObjects/Tile.js b/app/Game/Client/GameObjects/Tile.js index 90f3d40..a92d455 100755 --- a/app/Game/Client/GameObjects/Tile.js +++ b/app/Game/Client/GameObjects/Tile.js @@ -6,6 +6,8 @@ define([ ], function (Parent, Settings, Nc, Layer) { + + "use strict"; function Tile(physicsEngine, uid, options) { this.layerId = Layer.ID.TILE; diff --git a/app/Game/Client/Loader/Level.js b/app/Game/Client/Loader/Level.js index 09ea586..2a09bc9 100755 --- a/app/Game/Client/Loader/Level.js +++ b/app/Game/Client/Loader/Level.js @@ -8,6 +8,8 @@ define([ function (Parent, Settings, Nc, PIXI, AbstractLayer) { + "use strict"; + function Level (uid, engine, gameObjects) { Parent.call(this, uid, engine, gameObjects); } diff --git a/app/Game/Client/Loader/TiledLevel.js b/app/Game/Client/Loader/TiledLevel.js index e442d43..0f7cd1d 100644 --- a/app/Game/Client/Loader/TiledLevel.js +++ b/app/Game/Client/Loader/TiledLevel.js @@ -5,6 +5,8 @@ define([ ], function (Parent, Settings, Nc) { + + "use strict"; function TiledLevel(uid, engine, gameObjects) { this.layerId = "background"; diff --git a/app/Game/Client/Me.js b/app/Game/Client/Me.js index 5ee6e55..e5b86cd 100644 --- a/app/Game/Client/Me.js +++ b/app/Game/Client/Me.js @@ -5,6 +5,8 @@ define([ ], function (Parent, Settings, Nc) { + + "use strict"; function Me(id, physicsEngine, user) { Parent.call(this, id, physicsEngine, user); diff --git a/app/Game/Client/Networker.js b/app/Game/Client/Networker.js index 304e9f2..f3ea014 100755 --- a/app/Game/Client/Networker.js +++ b/app/Game/Client/Networker.js @@ -9,6 +9,8 @@ define([ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) { + "use strict"; + function Networker (socketLink, channelName, nickname) { this.channelName = channelName; this.nickname = nickname; diff --git a/app/Game/Client/Physics/Engine.js b/app/Game/Client/Physics/Engine.js index b368571..bcf587d 100755 --- a/app/Game/Client/Physics/Engine.js +++ b/app/Game/Client/Physics/Engine.js @@ -8,6 +8,8 @@ define([ function (Parent, Settings, DomController, Box2D, Nc) { + "use strict"; + function Engine () { Parent.call(this); diff --git a/app/Game/Client/Player.js b/app/Game/Client/Player.js index b92a2ba..c14989c 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -5,6 +5,8 @@ define([ ], function (Parent, Nc, Settings) { + + "use strict"; function Player(id, physicsEngine, user) { Parent.call(this, id, physicsEngine, user); diff --git a/app/Game/Client/View/Abstract/Layer.js b/app/Game/Client/View/Abstract/Layer.js index 3c31ec8..225c8ba 100644 --- a/app/Game/Client/View/Abstract/Layer.js +++ b/app/Game/Client/View/Abstract/Layer.js @@ -4,6 +4,8 @@ define([ function (Abstract) { + "use strict"; + function Layer(name, parallaxSpeed) { this.name = name; this.parallaxSpeed = parallaxSpeed; diff --git a/app/Game/Client/View/Abstract/View.js b/app/Game/Client/View/Abstract/View.js index 7f63f3d..10fc885 100755 --- a/app/Game/Client/View/Abstract/View.js +++ b/app/Game/Client/View/Abstract/View.js @@ -7,6 +7,8 @@ define([ ], function (Abstract, DomController, Settings, Exception, Nc) { + + "use strict"; function AbstractView () { this.me = null; diff --git a/app/Game/Client/View/DomController.js b/app/Game/Client/View/DomController.js index 2a9cd9c..3a95f0a 100755 --- a/app/Game/Client/View/DomController.js +++ b/app/Game/Client/View/DomController.js @@ -7,6 +7,8 @@ define([ function (Settings, Nc, Stats, Screenfull) { + "use strict"; + function DomController() { this.canvas = document.getElementById("canvas"); this.debugCanvas = null; diff --git a/app/Game/Client/View/LayerManager.js b/app/Game/Client/View/LayerManager.js index 7aeaad7..e41f9d2 100644 --- a/app/Game/Client/View/LayerManager.js +++ b/app/Game/Client/View/LayerManager.js @@ -5,6 +5,8 @@ define([ ], function (Nc, Exception, Layer) { + + "use strict"; function LayerManager(container, me) { this.layers = []; diff --git a/app/Game/Client/View/Mesh.js b/app/Game/Client/View/Mesh.js index a7c813e..d261e36 100644 --- a/app/Game/Client/View/Mesh.js +++ b/app/Game/Client/View/Mesh.js @@ -7,6 +7,8 @@ define([ function (Settings, Nc, Stats, Screenfull) { + "use strict"; + function Mesh() { } diff --git a/app/Game/Client/View/Pixi/ColorRangeReplaceFilter.js b/app/Game/Client/View/Pixi/ColorRangeReplaceFilter.js index faf69bf..70045ea 100644 --- a/app/Game/Client/View/Pixi/ColorRangeReplaceFilter.js +++ b/app/Game/Client/View/Pixi/ColorRangeReplaceFilter.js @@ -4,6 +4,8 @@ define([ function (PIXI) { + "use strict"; + var Parent = PIXI.AbstractFilter; function ColorRangeReplaceFilter() { diff --git a/app/Game/Client/View/Pixi/GameStats.js b/app/Game/Client/View/Pixi/GameStats.js index fc7e697..68ca430 100644 --- a/app/Game/Client/View/Pixi/GameStats.js +++ b/app/Game/Client/View/Pixi/GameStats.js @@ -6,6 +6,8 @@ define([ ], function (PIXI, Nc, Settings, ColorConverter) { + + "use strict"; function GameStats(container) { diff --git a/app/Game/Client/View/Pixi/Layer.js b/app/Game/Client/View/Pixi/Layer.js index f642bf1..f9a996d 100644 --- a/app/Game/Client/View/Pixi/Layer.js +++ b/app/Game/Client/View/Pixi/Layer.js @@ -7,6 +7,8 @@ define([ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) { + "use strict"; + var AVAILABLE_MESH_FILTERS = { "blur": PIXI.BlurFilter, "desaturate": PIXI.GrayFilter, diff --git a/app/Game/Client/View/Pixi/Layers/Ghost.js b/app/Game/Client/View/Pixi/Layers/Ghost.js index 1555a72..9659ef9 100644 --- a/app/Game/Client/View/Pixi/Layers/Ghost.js +++ b/app/Game/Client/View/Pixi/Layers/Ghost.js @@ -6,6 +6,8 @@ define([ ], function (Parent, PIXI, Nc, Settings) { + + "use strict"; function Ghost() { Parent.call(this, "ghost", 0); diff --git a/app/Game/Client/View/Pixi/View.js b/app/Game/Client/View/Pixi/View.js index c180339..4daa5fc 100755 --- a/app/Game/Client/View/Pixi/View.js +++ b/app/Game/Client/View/Pixi/View.js @@ -12,6 +12,8 @@ define([ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, LayerManager, Ghost) { + "use strict"; + function PixiView () { Parent.call(this); diff --git a/app/Game/Client/View/Three/View.js b/app/Game/Client/View/Three/View.js index a73fa3c..3255a28 100755 --- a/app/Game/Client/View/Three/View.js +++ b/app/Game/Client/View/Three/View.js @@ -6,6 +6,8 @@ define([ ], function (Parent, DomController, Three, Settings) { + + "use strict"; function ThreeView () { Parent.call(this); diff --git a/app/Game/Client/View/ViewManager.js b/app/Game/Client/View/ViewManager.js index 0172030..f116d8e 100755 --- a/app/Game/Client/View/ViewManager.js +++ b/app/Game/Client/View/ViewManager.js @@ -8,6 +8,8 @@ define([ ], function (Settings, Exception, AbstractView, PixiView, Nc) { + + "use strict"; var ViewManager = {}; diff --git a/app/Game/Core/Collision/Detector.js b/app/Game/Core/Collision/Detector.js index e4994f5..3849541 100755 --- a/app/Game/Core/Collision/Detector.js +++ b/app/Game/Core/Collision/Detector.js @@ -4,6 +4,8 @@ define([ function (Box2D) { + "use strict"; + function Detector () { this.listener = new Box2D.Dynamics.b2ContactListener(); this.listener.BeginContact = this.beginContact.bind(this); diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index e84747b..f09479b 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -8,6 +8,8 @@ define([ function (PhysicsEngine, TiledLevel, Player, Nc, Doll) { + "use strict"; + function GameController (options) { this.options = options; diff --git a/app/Game/Core/GameObjects/Doll.js b/app/Game/Core/GameObjects/Doll.js index 5863019..86bc318 100755 --- a/app/Game/Core/GameObjects/Doll.js +++ b/app/Game/Core/GameObjects/Doll.js @@ -9,6 +9,8 @@ define([ function (Parent, Box2D, Settings, CollisionDetector, Item, Nc) { + "use strict"; + function Doll (physicsEngine, uid, player) { this.characterName = "Chuck"; diff --git a/app/Game/Core/GameObjects/GameObject.js b/app/Game/Core/GameObjects/GameObject.js index 20553a1..d0c26bf 100755 --- a/app/Game/Core/GameObjects/GameObject.js +++ b/app/Game/Core/GameObjects/GameObject.js @@ -4,6 +4,8 @@ define([ ], function (Box2D, Exception) { + + "use strict"; function GameObject(physicsEngine, uid) { this.uid = uid; diff --git a/app/Game/Core/GameObjects/Item.js b/app/Game/Core/GameObjects/Item.js index f517a69..5f8fafd 100644 --- a/app/Game/Core/GameObjects/Item.js +++ b/app/Game/Core/GameObjects/Item.js @@ -8,6 +8,8 @@ define([ ], function (Parent, Box2D, Options, Settings, Exception, Nc) { + + "use strict"; function Item(physicsEngine, uid, options) { diff --git a/app/Game/Core/GameObjects/Items/RagDoll.js b/app/Game/Core/GameObjects/Items/RagDoll.js index ea7ca36..be7bfec 100644 --- a/app/Game/Core/GameObjects/Items/RagDoll.js +++ b/app/Game/Core/GameObjects/Items/RagDoll.js @@ -6,6 +6,8 @@ define([ ], function (Parent, Box2D, Settings, Nc) { + + "use strict"; function RagDoll(physicsEngine, uid, options) { diff --git a/app/Game/Core/GameObjects/Items/RagDoll2.js b/app/Game/Core/GameObjects/Items/RagDoll2.js index 8ebedff..75fd89e 100644 --- a/app/Game/Core/GameObjects/Items/RagDoll2.js +++ b/app/Game/Core/GameObjects/Items/RagDoll2.js @@ -5,6 +5,8 @@ define([ ], function (Parent, Box2D, Settings) { + + "use strict"; function RagDoll(physicsEngine, uid, options) { Parent.call(this, physicsEngine, uid, options); diff --git a/app/Game/Core/GameObjects/Items/Rube.js b/app/Game/Core/GameObjects/Items/Rube.js index c5c66c5..2a5c179 100644 --- a/app/Game/Core/GameObjects/Items/Rube.js +++ b/app/Game/Core/GameObjects/Items/Rube.js @@ -7,6 +7,8 @@ define([ function (Parent, RubeLoader, Box2D, Settings ) { + "use strict"; + // Fixme - make this loadable var __ragdollJson; diff --git a/app/Game/Core/GameObjects/Items/Skateboard.js b/app/Game/Core/GameObjects/Items/Skateboard.js index 67fc387..cf1837e 100755 --- a/app/Game/Core/GameObjects/Items/Skateboard.js +++ b/app/Game/Core/GameObjects/Items/Skateboard.js @@ -5,6 +5,8 @@ define([ ], function (Parent, Box2D, Settings) { + + "use strict"; function Skateboard(physicsEngine, uid, options) { diff --git a/app/Game/Core/GameObjects/SpectatorDoll.js b/app/Game/Core/GameObjects/SpectatorDoll.js index f86bba6..a6afbf3 100644 --- a/app/Game/Core/GameObjects/SpectatorDoll.js +++ b/app/Game/Core/GameObjects/SpectatorDoll.js @@ -4,6 +4,8 @@ define([ ], function (Parent, Box2D) { + + "use strict"; function SpectatorDoll(physicsEngine, uid, player) { Parent.call(this, physicsEngine, uid); diff --git a/app/Game/Core/GameObjects/Tile.js b/app/Game/Core/GameObjects/Tile.js index 2f483db..45d67eb 100755 --- a/app/Game/Core/GameObjects/Tile.js +++ b/app/Game/Core/GameObjects/Tile.js @@ -7,6 +7,8 @@ define([ ], function (Parent, Box2D, Settings, Exception, Nc) { + + "use strict"; function Tile(physicsEngine, uid, options) { this.options = options; diff --git a/app/Game/Core/Physics/Engine.js b/app/Game/Core/Physics/Engine.js index 8eeb92c..c47efc3 100755 --- a/app/Game/Core/Physics/Engine.js +++ b/app/Game/Core/Physics/Engine.js @@ -7,6 +7,8 @@ define([ function (Settings, Box2D, CollisionDetector, Nc) { + "use strict"; + function Engine () { this.world = new Box2D.Dynamics.b2World( new Box2D.Common.Math.b2Vec2(0, Settings.BOX2D_GRAVITY), diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index 9543c02..bc63272 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -7,9 +7,10 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll" ], - function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { + "use strict"; + function Player (id, physicsEngine, user) { this.stats = { health: 100, diff --git a/app/Lib/Utilities/Abstract.js b/app/Lib/Utilities/Abstract.js index 36c5780..c68e8ae 100644 --- a/app/Lib/Utilities/Abstract.js +++ b/app/Lib/Utilities/Abstract.js @@ -3,6 +3,8 @@ define([ ], function (Exception) { + + "use strict"; function Abstract() { } diff --git a/app/Lib/Utilities/ColorConverter.js b/app/Lib/Utilities/ColorConverter.js index ee83384..0c9d5d1 100644 --- a/app/Lib/Utilities/ColorConverter.js +++ b/app/Lib/Utilities/ColorConverter.js @@ -3,6 +3,8 @@ define([ ], function (CryptoJS) { + + "use strict"; function ColorConverter() { this.sin = 0; diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index 126faf7..5a5dbc0 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -4,6 +4,8 @@ define([ function (Exception) { + "use strict"; + function populate(obj, path) { path = path || "Nc.ns"; for(var key in obj) { diff --git a/app/Lib/Utilities/Options.js b/app/Lib/Utilities/Options.js index 7b26b28..1616f77 100644 --- a/app/Lib/Utilities/Options.js +++ b/app/Lib/Utilities/Options.js @@ -3,6 +3,8 @@ define([ ], function (Exception) { + + "use strict"; function Options() { diff --git a/app/Lib/Utilities/Protocol/Helper.js b/app/Lib/Utilities/Protocol/Helper.js index e27af52..523a423 100755 --- a/app/Lib/Utilities/Protocol/Helper.js +++ b/app/Lib/Utilities/Protocol/Helper.js @@ -5,6 +5,8 @@ define([ function (Parser, Exception) { + "use strict"; + var Helper = {} Helper.encodeCommand = function (command, options) { diff --git a/app/Lib/Utilities/Protocol/Parser.js b/app/Lib/Utilities/Protocol/Parser.js index 1a47eb8..1cd09cc 100755 --- a/app/Lib/Utilities/Protocol/Parser.js +++ b/app/Lib/Utilities/Protocol/Parser.js @@ -3,6 +3,8 @@ define([ function () { + "use strict"; + var Parser = {}; Parser.encode = function (message) { diff --git a/app/Lib/Utilities/RequestAnimFrame.js b/app/Lib/Utilities/RequestAnimFrame.js index 2c849c4..a606a7f 100755 --- a/app/Lib/Utilities/RequestAnimFrame.js +++ b/app/Lib/Utilities/RequestAnimFrame.js @@ -4,6 +4,8 @@ define([ function (Settings) { + "use strict"; + var requestAnimFrame = (function () { var _setTimeout = function ( callback ) { diff --git a/app/Lib/Utilities/Validate.js b/app/Lib/Utilities/Validate.js index 4e2eb1a..6f6a3cf 100644 --- a/app/Lib/Utilities/Validate.js +++ b/app/Lib/Utilities/Validate.js @@ -2,6 +2,8 @@ define([ ], function () { + + "use strict"; function validate(object, description) { diff --git a/app/Menu/Menu.js b/app/Menu/Menu.js index f4954bb..df7037f 100644 --- a/app/Menu/Menu.js +++ b/app/Menu/Menu.js @@ -5,6 +5,8 @@ define([ function (ColorConverter, Exception) { + "use strict"; + var instance = null function Menu() { diff --git a/app/Server/Api.js b/app/Server/Api.js index cc30919..666bb09 100644 --- a/app/Server/Api.js +++ b/app/Server/Api.js @@ -9,6 +9,8 @@ define([ function (Nc, ProtocolHelper, validate, Options, Settings, FileSystem) { + "use strict"; + function Api(coordinator) { this.coordinator = coordinator; this.isError = false; diff --git a/app/Server/Coordinator.js b/app/Server/Coordinator.js index 407b539..6262d35 100644 --- a/app/Server/Coordinator.js +++ b/app/Server/Coordinator.js @@ -8,6 +8,8 @@ define([ function (User, Channel, PipeToChannel, Nc, Settings) { + "use strict"; + function Coordinator() { this.channelPipes = {}; diff --git a/app/Server/PipeToChannel.js b/app/Server/PipeToChannel.js index 94bc11b..289d8db 100755 --- a/app/Server/PipeToChannel.js +++ b/app/Server/PipeToChannel.js @@ -5,6 +5,8 @@ define([ function (Nc, childProcess) { + "use strict"; + var fork = childProcess.fork; function PipeToChannel (options) { diff --git a/app/Server/User.js b/app/Server/User.js index 3f3b47f..a2e412f 100644 --- a/app/Server/User.js +++ b/app/Server/User.js @@ -6,6 +6,8 @@ define([ function (Parent, ProtocolHelper, Nc) { + "use strict"; + function User (socketLink, coordinator) { Parent.call(this, socketLink.id, {}); diff --git a/channel.js b/channel.js index 3294623..c68ebbb 100755 --- a/channel.js +++ b/channel.js @@ -1,4 +1,6 @@ -GLOBALS = { context: "Channel" }; +"use strict"; + +var GLOBALS = { context: "Channel" }; var requirejs = require('requirejs'); requirejs.config({ diff --git a/client.js b/client.js index 5134ebd..b9c212f 100755 --- a/client.js +++ b/client.js @@ -1,4 +1,6 @@ -GLOBALS = { context: "Client" }; +"use strict"; + +var GLOBALS = { context: "Client" }; requirejs.config({ baseUrl: 'app', diff --git a/server.js b/server.js index 9d829aa..90a2ad2 100755 --- a/server.js +++ b/server.js @@ -1,4 +1,6 @@ -GLOBALS = { context: "Channel" }; +"use strict"; + +var GLOBALS = { context: "Channel" }; var requirejs = require('requirejs'); var inspector; diff --git a/snippets/sublime/js-define-child.sublime-snippet b/snippets/sublime/js-define-child.sublime-snippet index 9d74c6e..27857d4 100644 --- a/snippets/sublime/js-define-child.sublime-snippet +++ b/snippets/sublime/js-define-child.sublime-snippet @@ -6,6 +6,8 @@ define([ function (Parent) { + "use strict"; + return Parent; }); diff --git a/snippets/sublime/js-define-extend.sublime-snippet b/snippets/sublime/js-define-extend.sublime-snippet index 711e7ce..0d2290d 100755 --- a/snippets/sublime/js-define-extend.sublime-snippet +++ b/snippets/sublime/js-define-extend.sublime-snippet @@ -5,6 +5,8 @@ define([ ], function (Parent) { + + "use strict"; function ${1:Module}() { Parent.call(this); diff --git a/snippets/sublime/js-define.sublime-snippet b/snippets/sublime/js-define.sublime-snippet index 390cb91..9080b96 100755 --- a/snippets/sublime/js-define.sublime-snippet +++ b/snippets/sublime/js-define.sublime-snippet @@ -4,8 +4,11 @@ define([ ], function () { + + "use strict"; function ${1:Module}() { + } ${1:Module}.prototype.${2:name} = function(${3:arguments}) {