Explorar o código

Minor adjustments in editor/docs markdowns
Added "var " before function expressions

Mario Schuettel %!s(int64=9) %!d(string=hai) anos
pai
achega
ec53b8e4f5

+ 2 - 2
editor/docs/Implementing additional commands for undo-redo.md

@@ -26,12 +26,12 @@ Every command needs a constructor. In the constructor
 
 ```javascript
 	
-DoSomethingCommand = function () {
+var DoSomethingCommand = function () {
 
 	Command.call( this ); // Required: Call default constructor
 
 	this.type = 'DoSomethingCommand';            // Required: has to match the object-name!
-	this.name = 'Set/Do/Update DoSomething'; // Required: description of the command, used in Sidebar.History
+	this.name = 'Set/Do/Update Something'; // Required: description of the command, used in Sidebar.History
 
 	// TODO: store all the relevant information needed to 
 	// restore the old and the new state

+ 3 - 3
editor/docs/Writing unit tests for undo-redo commands.md

@@ -26,9 +26,9 @@ Within the file, go to the `<!-- command object classes -->` and include the new
 ```html
 // <!-- command object classes -->
 //...
-<script src="../../editor/js/AddScriptCommand.js"></script>
-<script src="../../editor/js/DoSomethingCommand.js"></script>         // add this line
-<script src="../../editor/js/MoveObjectCommand.js"></script>
+<script src="../../editor/js/commands/AddScriptCommand.js"></script>
+<script src="../../editor/js/commands/DoSomethingCommand.js"></script>         // add this line
+<script src="../../editor/js/commands/MoveObjectCommand.js"></script>
 //...
 ```
 

+ 1 - 1
editor/js/Command.js

@@ -9,7 +9,7 @@
  * @constructor
  */
 
-Command = function ( editorRef ) {
+var Command = function ( editorRef ) {
 
 	this.id = - 1;
 	this.inMemory = false;

+ 1 - 1
editor/js/commands/AddObjectCommand.js

@@ -8,7 +8,7 @@
  * @constructor
  */
 
-AddObjectCommand = function ( object ) {
+var AddObjectCommand = function ( object ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/AddScriptCommand.js

@@ -9,7 +9,7 @@
  * @constructor
  */
 
-AddScriptCommand = function ( object, script ) {
+var AddScriptCommand = function ( object, script ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/MoveObjectCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-MoveObjectCommand = function ( object, newParent, newBefore ) {
+var MoveObjectCommand = function ( object, newParent, newBefore ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/MultiCmdsCommand.js

@@ -8,7 +8,7 @@
  * @constructor
  */
 
-MultiCmdsCommand = function ( cmdArray ) {
+var MultiCmdsCommand = function ( cmdArray ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/RemoveObjectCommand.js

@@ -8,7 +8,7 @@
  * @constructor
  */
 
-RemoveObjectCommand = function ( object ) {
+var RemoveObjectCommand = function ( object ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/RemoveScriptCommand.js

@@ -9,7 +9,7 @@
  * @constructor
  */
 
-RemoveScriptCommand = function ( object, script ) {
+var RemoveScriptCommand = function ( object, script ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetColorCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetColorCommand = function ( object, attributeName, newValue ) {
+var SetColorCommand = function ( object, attributeName, newValue ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetGeometryCommand.js

@@ -9,7 +9,7 @@
  * @constructor
  */
 
-SetGeometryCommand = function ( object, newGeometry ) {
+var SetGeometryCommand = function ( object, newGeometry ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetGeometryValueCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetGeometryValueCommand = function ( object, attributeName, newValue ) {
+var SetGeometryValueCommand = function ( object, attributeName, newValue ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetMaterialColorCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetMaterialColorCommand = function ( object, attributeName, newValue ) {
+var SetMaterialColorCommand = function ( object, attributeName, newValue ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetMaterialCommand.js

@@ -9,7 +9,7 @@
  * @constructor
  */
 
-SetMaterialCommand = function ( object, newMaterial ) {
+var SetMaterialCommand = function ( object, newMaterial ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetMaterialMapCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetMaterialMapCommand = function ( object, mapName, newMap ) {
+var SetMaterialMapCommand = function ( object, mapName, newMap ) {
 
 	Command.call( this );
 	this.type = 'SetMaterialMapCommand';

+ 1 - 1
editor/js/commands/SetMaterialValueCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetMaterialValueCommand = function ( object, attributeName, newValue ) {
+var SetMaterialValueCommand = function ( object, attributeName, newValue ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetPositionCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetPositionCommand = function ( object, newPosition, optionalOldPosition ) {
+var SetPositionCommand = function ( object, newPosition, optionalOldPosition ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetRotationCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetRotationCommand = function ( object, newRotation, optionalOldRotation ) {
+var SetRotationCommand = function ( object, newRotation, optionalOldRotation ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetScaleCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetScaleCommand = function ( object, newScale, optionalOldScale ) {
+var SetScaleCommand = function ( object, newScale, optionalOldScale ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetSceneCommand.js

@@ -8,7 +8,7 @@
  * @constructor
  */
 
-SetSceneCommand = function ( scene ) {
+var SetSceneCommand = function ( scene ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetScriptValueCommand.js

@@ -12,7 +12,7 @@
  * @constructor
  */
 
-SetScriptValueCommand = function ( object, script, attributeName, newValue, cursorPosition ) {
+var SetScriptValueCommand = function ( object, script, attributeName, newValue, cursorPosition ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetUuidCommand.js

@@ -9,7 +9,7 @@
  * @constructor
  */
 
-SetUuidCommand = function ( object, newUuid ) {
+var SetUuidCommand = function ( object, newUuid ) {
 
 	Command.call( this );
 

+ 1 - 1
editor/js/commands/SetValueCommand.js

@@ -10,7 +10,7 @@
  * @constructor
  */
 
-SetValueCommand = function ( object, attributeName, newValue ) {
+var SetValueCommand = function ( object, attributeName, newValue ) {
 
 	Command.call( this );