提交 ff1fc11c 编写于 作者: M Mr.doob

Editor: Code clean up.

上级 87e441a8
......@@ -26,7 +26,7 @@ Every command needs a constructor. In the constructor
```javascript
var DoSomethingCommand = function ( editor ) {
function DoSomethingCommand( editor ) {
Command.call( this, editor ); // Required: Call default constructor
......@@ -36,7 +36,7 @@ var DoSomethingCommand = function ( editor ) {
// TODO: store all the relevant information needed to
// restore the old and the new state
};
}
```
And as part of the prototype you need to implement four functions
......
......@@ -9,7 +9,7 @@
* @constructor
*/
var Command = function ( editor ) {
function Command( editor ) {
this.id = - 1;
this.inMemory = false;
......@@ -18,7 +18,7 @@ var Command = function ( editor ) {
this.name = '';
this.editor = editor;
};
}
Command.prototype.toJSON = function () {
......
......@@ -2,7 +2,7 @@
* @author mrdoob / http://mrdoob.com/
*/
var Config = function () {
function Config() {
var name = 'threejs-editor';
......@@ -78,6 +78,6 @@ var Config = function () {
};
};
}
export { Config };
......@@ -10,7 +10,7 @@ import { History as _History } from './History.js';
import { Strings } from './Strings.js';
import { Storage as _Storage } from './Storage.js';
var Editor = function () {
function Editor() {
this.DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 0.01, 1000 );
this.DEFAULT_CAMERA.name = 'Camera';
......@@ -117,7 +117,7 @@ var Editor = function () {
this.addCamera( this.camera );
};
}
Editor.prototype = {
......
......@@ -7,7 +7,7 @@
import * as THREE from '../../build/three.module.js';
var EditorControls = function ( object, domElement ) {
function EditorControls( object, domElement ) {
// API
......@@ -309,7 +309,7 @@ var EditorControls = function ( object, domElement ) {
domElement.addEventListener( 'touchstart', touchStart, false );
domElement.addEventListener( 'touchmove', touchMove, false );
};
}
EditorControls.prototype = Object.create( THREE.EventDispatcher.prototype );
EditorControls.prototype.constructor = EditorControls;
......
......@@ -5,7 +5,7 @@
import * as Commands from './commands/Commands.js';
var History = function ( editor ) {
function History( editor ) {
this.editor = editor;
this.undos = [];
......@@ -32,7 +32,7 @@ var History = function ( editor ) {
} );
};
}
History.prototype = {
......
......@@ -28,7 +28,7 @@ import { LoaderUtils } from './LoaderUtils.js';
import { JSZip } from '../../examples/jsm/libs/jszip.module.min.js';
var Loader = function ( editor ) {
function Loader( editor ) {
var scope = this;
......@@ -717,6 +717,6 @@ var Loader = function ( editor ) {
}
};
}
export { Loader };
......@@ -8,7 +8,7 @@ import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
import { AddObjectCommand } from './commands/AddObjectCommand.js';
var MenubarAdd = function ( editor ) {
function MenubarAdd( editor ) {
var strings = editor.strings;
......@@ -475,6 +475,6 @@ var MenubarAdd = function ( editor ) {
return container;
};
}
export { MenubarAdd };
......@@ -9,7 +9,7 @@ import { RemoveObjectCommand } from './commands/RemoveObjectCommand.js';
import { MultiCmdsCommand } from './commands/MultiCmdsCommand.js';
import { SetMaterialValueCommand } from './commands/SetMaterialValueCommand.js';
var MenubarEdit = function ( editor ) {
function MenubarEdit( editor ) {
var strings = editor.strings;
......@@ -272,6 +272,6 @@ var MenubarEdit = function ( editor ) {
return container;
};
}
export { MenubarEdit };
......@@ -6,7 +6,7 @@ import * as THREE from '../../build/three.module.js';
import { UIPanel, UIRow } from './libs/ui.js';
var MenubarExamples = function ( editor ) {
function MenubarExamples( editor ) {
var strings = editor.strings;
......@@ -65,6 +65,6 @@ var MenubarExamples = function ( editor ) {
return container;
};
}
export { MenubarExamples };
......@@ -15,7 +15,7 @@ import { JSZip } from '../../examples/jsm/libs/jszip.module.min.js';
import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
var MenubarFile = function ( editor ) {
function MenubarFile( editor ) {
function parseNumber( key, value ) {
......@@ -482,6 +482,6 @@ var MenubarFile = function ( editor ) {
return container;
};
}
export { MenubarFile };
......@@ -4,7 +4,7 @@
import { UIPanel, UIRow } from './libs/ui.js';
var MenubarHelp = function ( editor ) {
function MenubarHelp( editor ) {
var strings = editor.strings;
......@@ -58,6 +58,6 @@ var MenubarHelp = function ( editor ) {
return container;
};
}
export { MenubarHelp };
......@@ -4,7 +4,7 @@
import { UIPanel } from './libs/ui.js';
var MenubarPlay = function ( editor ) {
function MenubarPlay( editor ) {
var signals = editor.signals;
var strings = editor.strings;
......@@ -38,6 +38,6 @@ var MenubarPlay = function ( editor ) {
return container;
};
}
export { MenubarPlay };
......@@ -7,7 +7,7 @@ import * as THREE from '../../build/three.module.js';
import { UIPanel, UIText } from './libs/ui.js';
import { UIBoolean } from './libs/ui.three.js';
var MenubarStatus = function ( editor ) {
function MenubarStatus( editor ) {
var strings = editor.strings;
......@@ -50,6 +50,6 @@ var MenubarStatus = function ( editor ) {
return container;
};
}
export { MenubarStatus };
......@@ -4,7 +4,7 @@
import { UIPanel, UIRow } from './libs/ui.js';
var MenubarView = function ( editor ) {
function MenubarView( editor ) {
var container = new UIPanel();
container.setClass( 'menu' );
......@@ -32,6 +32,6 @@ var MenubarView = function ( editor ) {
return container;
};
}
export { MenubarView };
......@@ -12,7 +12,7 @@ import { MenubarHelp } from './Menubar.Help.js';
import { MenubarPlay } from './Menubar.Play.js';
import { MenubarStatus } from './Menubar.Status.js';
var Menubar = function ( editor ) {
function Menubar( editor ) {
var container = new UIPanel();
container.setId( 'menubar' );
......@@ -28,6 +28,6 @@ var Menubar = function ( editor ) {
return container;
};
}
export { Menubar };
......@@ -7,7 +7,7 @@ import { UIElement, UIPanel, UIText } from './libs/ui.js';
import { SetScriptValueCommand } from './commands/SetScriptValueCommand.js';
import { SetMaterialValueCommand } from './commands/SetMaterialValueCommand.js';
var Script = function ( editor ) {
function Script( editor ) {
var signals = editor.signals;
......@@ -461,6 +461,6 @@ var Script = function ( editor ) {
return container;
};
}
export { Script };
......@@ -4,7 +4,7 @@
import { UIPanel, UIDiv, UIBreak, UISelect, UIButton, UIText } from './libs/ui.js';
var SidebarAnimation = function ( editor ) {
function SidebarAnimation( editor ) {
var signals = editor.signals;
var mixer = editor.mixer;
......@@ -83,6 +83,6 @@ var SidebarAnimation = function ( editor ) {
return container;
};
}
export { SidebarAnimation };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UINumber, UIInteger } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryBoxGeometry = function ( editor, object ) {
function SidebarGeometryBoxGeometry( editor, object ) {
var strings = editor.strings;
......@@ -94,6 +94,6 @@ var SidebarGeometryBoxGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryBoxGeometry };
......@@ -4,7 +4,7 @@
import { UIRow, UIText, UISpan, UIBreak } from './libs/ui.js';
var SidebarGeometryBufferGeometry = function ( editor ) {
function SidebarGeometryBufferGeometry( editor ) {
var strings = editor.strings;
......@@ -65,6 +65,6 @@ var SidebarGeometryBufferGeometry = function ( editor ) {
return container;
};
}
export { SidebarGeometryBufferGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryCircleGeometry = function ( editor, object ) {
function SidebarGeometryCircleGeometry( editor, object ) {
var strings = editor.strings;
......@@ -72,6 +72,6 @@ var SidebarGeometryCircleGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryCircleGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UICheckbox, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryCylinderGeometry = function ( editor, object ) {
function SidebarGeometryCylinderGeometry( editor, object ) {
var strings = editor.strings;
......@@ -94,6 +94,6 @@ var SidebarGeometryCylinderGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryCylinderGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryDodecahedronGeometry = function ( editor, object ) {
function SidebarGeometryDodecahedronGeometry( editor, object ) {
var strings = editor.strings;
......@@ -50,6 +50,6 @@ var SidebarGeometryDodecahedronGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryDodecahedronGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UICheckbox, UIButton, UINumber } from './libs
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryExtrudeGeometry = function ( editor, object ) {
function SidebarGeometryExtrudeGeometry( editor, object ) {
var strings = editor.strings;
......@@ -144,6 +144,6 @@ var SidebarGeometryExtrudeGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryExtrudeGeometry };
......@@ -4,7 +4,7 @@
import { UIRow, UIText } from './libs/ui.js';
var SidebarGeometryGeometry = function ( editor ) {
function SidebarGeometryGeometry( editor ) {
var strings = editor.strings;
......@@ -61,6 +61,6 @@ var SidebarGeometryGeometry = function ( editor ) {
return container;
};
}
export { SidebarGeometryGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryIcosahedronGeometry = function ( editor, object ) {
function SidebarGeometryIcosahedronGeometry( editor, object ) {
var strings = editor.strings;
......@@ -54,6 +54,6 @@ var SidebarGeometryIcosahedronGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryIcosahedronGeometry };
......@@ -9,7 +9,7 @@ import { UIPoints2 } from './libs/ui.three.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryLatheGeometry = function ( editor, object ) {
function SidebarGeometryLatheGeometry( editor, object ) {
var strings = editor.strings;
......@@ -71,6 +71,6 @@ var SidebarGeometryLatheGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryLatheGeometry };
......@@ -4,7 +4,7 @@
import { UIRow, UIButton } from './libs/ui.js';
var SidebarGeometryModifiers = function ( editor, object ) {
function SidebarGeometryModifiers( editor, object ) {
var signals = editor.signals;
......@@ -39,6 +39,6 @@ var SidebarGeometryModifiers = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryModifiers };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryOctahedronGeometry = function ( editor, object ) {
function SidebarGeometryOctahedronGeometry( editor, object ) {
var strings = editor.strings;
......@@ -55,6 +55,6 @@ var SidebarGeometryOctahedronGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryOctahedronGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryPlaneGeometry = function ( editor, object ) {
function SidebarGeometryPlaneGeometry( editor, object ) {
var strings = editor.strings;
......@@ -73,6 +73,6 @@ var SidebarGeometryPlaneGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryPlaneGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryRingGeometry = function ( editor, object ) {
function SidebarGeometryRingGeometry( editor, object ) {
var strings = editor.strings;
......@@ -94,6 +94,6 @@ var SidebarGeometryRingGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryRingGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UIButton } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryShapeGeometry = function ( editor, object ) {
function SidebarGeometryShapeGeometry( editor, object ) {
var strings = editor.strings;
......@@ -54,6 +54,6 @@ var SidebarGeometryShapeGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryShapeGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometrySphereGeometry = function ( editor, object ) {
function SidebarGeometrySphereGeometry( editor, object ) {
var strings = editor.strings;
......@@ -106,6 +106,6 @@ var SidebarGeometrySphereGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometrySphereGeometry };
......@@ -6,7 +6,7 @@ import { UIRow, UIText, UIInteger, UICheckbox, UINumber } from './libs/ui.js';
import { TeapotBufferGeometry } from '../../examples/jsm/geometries/TeapotBufferGeometry.js';
var SidebarGeometryTeapotBufferGeometry = function ( signals, object ) {
function SidebarGeometryTeapotBufferGeometry( signals, object ) {
var container = new UIRow();
......@@ -104,6 +104,6 @@ var SidebarGeometryTeapotBufferGeometry = function ( signals, object ) {
return container;
};
}
export { SidebarGeometryTeapotBufferGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryTetrahedronGeometry = function ( editor, object ) {
function SidebarGeometryTetrahedronGeometry( editor, object ) {
var strings = editor.strings;
......@@ -55,6 +55,6 @@ var SidebarGeometryTetrahedronGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryTetrahedronGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryTorusGeometry = function ( editor, object ) {
function SidebarGeometryTorusGeometry( editor, object ) {
var strings = editor.strings;
......@@ -84,6 +84,6 @@ var SidebarGeometryTorusGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryTorusGeometry };
......@@ -8,7 +8,7 @@ import { UIRow, UIText, UIInteger, UINumber } from './libs/ui.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryTorusKnotGeometry = function ( editor, object ) {
function SidebarGeometryTorusKnotGeometry( editor, object ) {
var strings = editor.strings;
......@@ -95,6 +95,6 @@ var SidebarGeometryTorusKnotGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryTorusKnotGeometry };
......@@ -9,7 +9,7 @@ import { UIPoints3 } from './libs/ui.three.js';
import { SetGeometryCommand } from './commands/SetGeometryCommand.js';
var SidebarGeometryTubeGeometry = function ( editor, object ) {
function SidebarGeometryTubeGeometry( editor, object ) {
var strings = editor.strings;
......@@ -104,6 +104,6 @@ var SidebarGeometryTubeGeometry = function ( editor, object ) {
return container;
};
}
export { SidebarGeometryTubeGeometry };
......@@ -52,7 +52,7 @@ var geometryUIClasses = {
'TubeBufferGeometry': SidebarGeometryTubeGeometry
};
var SidebarGeometry = function ( editor ) {
function SidebarGeometry( editor ) {
var strings = editor.strings;
......@@ -285,6 +285,6 @@ var SidebarGeometry = function ( editor ) {
return container;
};
}
export { SidebarGeometry };
......@@ -6,7 +6,7 @@
import { UIPanel, UIBreak, UIText } from './libs/ui.js';
import { UIBoolean, UIOutliner } from './libs/ui.three.js';
var SidebarHistory = function ( editor ) {
function SidebarHistory( editor ) {
var strings = editor.strings;
......@@ -132,6 +132,6 @@ var SidebarHistory = function ( editor ) {
return container;
};
}
export { SidebarHistory };
......@@ -31,7 +31,7 @@ var materialClasses = {
'SpriteMaterial': THREE.SpriteMaterial
};
var SidebarMaterial = function ( editor ) {
function SidebarMaterial( editor ) {
var strings = editor.strings;
......@@ -1651,6 +1651,6 @@ var SidebarMaterial = function ( editor ) {
return container;
};
}
export { SidebarMaterial };
......@@ -14,7 +14,7 @@ import { SetRotationCommand } from './commands/SetRotationCommand.js';
import { SetScaleCommand } from './commands/SetScaleCommand.js';
import { SetColorCommand } from './commands/SetColorCommand.js';
var SidebarObject = function ( editor ) {
function SidebarObject( editor ) {
var strings = editor.strings;
......@@ -868,6 +868,6 @@ var SidebarObject = function ( editor ) {
return container;
};
}
export { SidebarObject };
......@@ -9,7 +9,7 @@ import { UIBoolean } from './libs/ui.three.js';
import { SetMaterialCommand } from './commands/SetMaterialCommand.js';
var SidebarProject = function ( editor ) {
function SidebarProject( editor ) {
var config = editor.config;
var signals = editor.signals;
......@@ -326,6 +326,6 @@ var SidebarProject = function ( editor ) {
return container;
};
}
export { SidebarProject };
......@@ -8,7 +8,7 @@ import { SidebarObject } from './Sidebar.Object.js';
import { SidebarGeometry } from './Sidebar.Geometry.js';
import { SidebarMaterial } from './Sidebar.Material.js';
var SidebarProperties = function ( editor ) {
function SidebarProperties( editor ) {
var strings = editor.strings;
......@@ -22,6 +22,6 @@ var SidebarProperties = function ( editor ) {
return container;
};
}
export { SidebarProperties };
......@@ -5,7 +5,7 @@
import { UIPanel, UIBreak, UIRow, UIColor, UISelect, UIText, UINumber } from './libs/ui.js';
import { UIOutliner, UITexture, UICubeTexture } from './libs/ui.three.js';
var SidebarScene = function ( editor ) {
function SidebarScene( editor ) {
var signals = editor.signals;
var strings = editor.strings;
......@@ -427,6 +427,6 @@ var SidebarScene = function ( editor ) {
return container;
};
}
export { SidebarScene };
......@@ -8,7 +8,7 @@ import { AddScriptCommand } from './commands/AddScriptCommand.js';
import { SetScriptValueCommand } from './commands/SetScriptValueCommand.js';
import { RemoveScriptCommand } from './commands/RemoveScriptCommand.js';
var SidebarScript = function ( editor ) {
function SidebarScript( editor ) {
var strings = editor.strings;
......@@ -130,6 +130,6 @@ var SidebarScript = function ( editor ) {
return container;
};
}
export { SidebarScript };
......@@ -6,7 +6,7 @@ import { UIDiv, UIBreak, UIText, UIRow, UIInput } from './libs/ui.js';
import { RemoveObjectCommand } from './commands/RemoveObjectCommand.js';
var SidebarSettingsShortcuts = function ( editor ) {
function SidebarSettingsShortcuts( editor ) {
var strings = editor.strings;
......@@ -170,6 +170,6 @@ var SidebarSettingsShortcuts = function ( editor ) {
return container;
};
}
export { SidebarSettingsShortcuts };
......@@ -6,7 +6,7 @@ import { UIDiv, UIBreak, UIText } from './libs/ui.js';
import { UIBoolean } from './libs/ui.three.js';
var SidebarSettingsViewport = function ( editor ) {
function SidebarSettingsViewport( editor ) {
var signals = editor.signals;
var strings = editor.strings;
......@@ -37,6 +37,6 @@ var SidebarSettingsViewport = function ( editor ) {
return container;
};
}
export { SidebarSettingsViewport };
......@@ -7,7 +7,7 @@ import { UIPanel, UIRow, UISelect, UIText, UIInteger } from './libs/ui.js';
import { SidebarSettingsViewport } from './Sidebar.Settings.Viewport.js';
import { SidebarSettingsShortcuts } from './Sidebar.Settings.Shortcuts.js';
var SidebarSettings = function ( editor ) {
function SidebarSettings( editor ) {
var config = editor.config;
var strings = editor.strings;
......@@ -73,6 +73,6 @@ var SidebarSettings = function ( editor ) {
return container;
};
}
export { SidebarSettings };
......@@ -12,7 +12,7 @@ import { SidebarProject } from './Sidebar.Project.js';
import { SidebarHistory } from './Sidebar.History.js';
import { SidebarSettings } from './Sidebar.Settings.js';
var Sidebar = function ( editor ) {
function Sidebar( editor ) {
var strings = editor.strings;
......@@ -40,6 +40,6 @@ var Sidebar = function ( editor ) {
return container;
};
}
export { Sidebar };
......@@ -2,7 +2,7 @@
* @author mrdoob / http://mrdoob.com/
*/
var Storage = function () {
function Storage() {
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
......@@ -95,6 +95,6 @@ var Storage = function () {
};
};
}
export { Storage };
......@@ -2,7 +2,7 @@
* @author mrdoob / http://mrdoob.com/
*/
var Strings = function ( config ) {
function Strings( config ) {
var language = config.getKey( 'language' );
......@@ -938,6 +938,6 @@ var Strings = function ( config ) {
};
};
}
export { Strings };
......@@ -4,7 +4,7 @@
import { UIPanel, UIButton, UICheckbox } from './libs/ui.js';
var Toolbar = function ( editor ) {
function Toolbar( editor ) {
var signals = editor.signals;
var strings = editor.strings;
......@@ -83,6 +83,6 @@ var Toolbar = function ( editor ) {
return container;
};
}
export { Toolbar };
......@@ -4,7 +4,7 @@
import { UISelect } from './libs/ui.js';
var ViewportCamera = function ( editor ) {
function ViewportCamera( editor ) {
var signals = editor.signals;
......@@ -47,6 +47,6 @@ var ViewportCamera = function ( editor ) {
return cameraSelect;
};
}
export { ViewportCamera };
......@@ -4,7 +4,7 @@
import { UIPanel, UIBreak, UIText } from './libs/ui.js';
var ViewportInfo = function ( editor ) {
function ViewportInfo( editor ) {
var signals = editor.signals;
var strings = editor.strings;
......@@ -98,6 +98,6 @@ var ViewportInfo = function ( editor ) {
return container;
};
}
export { ViewportInfo };
......@@ -17,7 +17,7 @@ import { SetPositionCommand } from './commands/SetPositionCommand.js';
import { SetRotationCommand } from './commands/SetRotationCommand.js';
import { SetScaleCommand } from './commands/SetScaleCommand.js';
var Viewport = function ( editor ) {
function Viewport( editor ) {
var signals = editor.signals;
......@@ -696,6 +696,6 @@ var Viewport = function ( editor ) {
return container;
};
}
export { Viewport };
......@@ -11,7 +11,7 @@ import * as THREE from '../../../build/three.module.js';
* @param object THREE.Object3D
* @constructor
*/
var AddObjectCommand = function ( editor, object ) {
function AddObjectCommand( editor, object ) {
Command.call( this, editor );
......@@ -24,7 +24,7 @@ var AddObjectCommand = function ( editor, object ) {
}
};
}
AddObjectCommand.prototype = {
......
......@@ -11,7 +11,7 @@ import { Command } from '../Command.js';
* @param script javascript object
* @constructor
*/
var AddScriptCommand = function ( editor, object, script ) {
function AddScriptCommand( editor, object, script ) {
Command.call( this, editor );
......@@ -21,7 +21,7 @@ var AddScriptCommand = function ( editor, object, script ) {
this.object = object;
this.script = script;
};
}
AddScriptCommand.prototype = {
......
......@@ -12,7 +12,7 @@ import { Command } from '../Command.js';
* @param newBefore THREE.Object3D
* @constructor
*/
var MoveObjectCommand = function ( editor, object, newParent, newBefore ) {
function MoveObjectCommand( editor, object, newParent, newBefore ) {
Command.call( this, editor );
......@@ -42,7 +42,7 @@ var MoveObjectCommand = function ( editor, object, newParent, newBefore ) {
this.newBefore = newBefore;
};
}
MoveObjectCommand.prototype = {
......
......@@ -10,7 +10,7 @@ import { Command } from '../Command.js';
* @param cmdArray array containing command objects
* @constructor
*/
var MultiCmdsCommand = function ( editor, cmdArray ) {
function MultiCmdsCommand( editor, cmdArray ) {
Command.call( this, editor );
......@@ -19,7 +19,7 @@ var MultiCmdsCommand = function ( editor, cmdArray ) {
this.cmdArray = ( cmdArray !== undefined ) ? cmdArray : [];
};
}
MultiCmdsCommand.prototype = {
......
......@@ -12,7 +12,7 @@ import * as THREE from '../../../build/three.module.js';
* @param object THREE.Object3D
* @constructor
*/
var RemoveObjectCommand = function ( editor, object ) {
function RemoveObjectCommand( editor, object ) {
Command.call( this, editor );
......@@ -27,7 +27,7 @@ var RemoveObjectCommand = function ( editor, object ) {
}
};
}
RemoveObjectCommand.prototype = {
......
......@@ -11,7 +11,7 @@ import { Command } from '../Command.js';
* @param script javascript object
* @constructor
*/
var RemoveScriptCommand = function ( editor, object, script ) {
function RemoveScriptCommand( editor, object, script ) {
Command.call( this, editor );
......@@ -26,7 +26,7 @@ var RemoveScriptCommand = function ( editor, object, script ) {
}
};
}
RemoveScriptCommand.prototype = {
......
......@@ -12,7 +12,7 @@ import { Command } from '../Command.js';
* @param newValue integer representing a hex color value
* @constructor
*/
var SetColorCommand = function ( editor, object, attributeName, newValue ) {
function SetColorCommand( editor, object, attributeName, newValue ) {
Command.call( this, editor );
......@@ -25,7 +25,7 @@ var SetColorCommand = function ( editor, object, attributeName, newValue ) {
this.oldValue = ( object !== undefined ) ? this.object[ this.attributeName ].getHex() : undefined;
this.newValue = newValue;
};
}
SetColorCommand.prototype = {
......
......@@ -14,7 +14,7 @@ import * as THREE from '../../../build/three.module.js';
* @constructor
*/
var SetGeometryCommand = function ( editor, object, newGeometry ) {
function SetGeometryCommand( editor, object, newGeometry ) {
Command.call( this, editor );
......@@ -26,7 +26,7 @@ var SetGeometryCommand = function ( editor, object, newGeometry ) {
this.oldGeometry = ( object !== undefined ) ? object.geometry : undefined;
this.newGeometry = newGeometry;
};
}
SetGeometryCommand.prototype = {
......
......@@ -12,7 +12,7 @@ import { Command } from '../Command.js';
* @param newValue number, string, boolean or object
* @constructor
*/
var SetGeometryValueCommand = function ( editor, object, attributeName, newValue ) {
function SetGeometryValueCommand( editor, object, attributeName, newValue ) {
Command.call( this, editor );
......@@ -24,7 +24,7 @@ var SetGeometryValueCommand = function ( editor, object, attributeName, newValue
this.oldValue = ( object !== undefined ) ? object.geometry[ attributeName ] : undefined;
this.newValue = newValue;
};
}
SetGeometryValueCommand.prototype = {
......
......@@ -12,7 +12,7 @@ import { Command } from '../Command.js';
* @param newValue integer representing a hex color value
* @constructor
*/
var SetMaterialColorCommand = function ( editor, object, attributeName, newValue, materialSlot ) {
function SetMaterialColorCommand( editor, object, attributeName, newValue, materialSlot ) {
Command.call( this, editor );
......@@ -28,7 +28,7 @@ var SetMaterialColorCommand = function ( editor, object, attributeName, newValue
this.attributeName = attributeName;
};
}
SetMaterialColorCommand.prototype = {
......
......@@ -13,7 +13,7 @@ import * as THREE from '../../../build/three.module.js';
* @param newMaterial THREE.Material
* @constructor
*/
var SetMaterialCommand = function ( editor, object, newMaterial, materialSlot ) {
function SetMaterialCommand( editor, object, newMaterial, materialSlot ) {
Command.call( this, editor );
......@@ -26,7 +26,7 @@ var SetMaterialCommand = function ( editor, object, newMaterial, materialSlot )
this.oldMaterial = this.editor.getObjectMaterial( object, materialSlot );
this.newMaterial = newMaterial;
};
}
SetMaterialCommand.prototype = {
......
......@@ -14,7 +14,7 @@ import * as THREE from '../../../build/three.module.js';
* @param newMap THREE.Texture
* @constructor
*/
var SetMaterialMapCommand = function ( editor, object, mapName, newMap, materialSlot ) {
function SetMaterialMapCommand( editor, object, mapName, newMap, materialSlot ) {
Command.call( this, editor );
......@@ -29,7 +29,7 @@ var SetMaterialMapCommand = function ( editor, object, mapName, newMap, material
this.mapName = mapName;
};
}
SetMaterialMapCommand.prototype = {
......
......@@ -12,7 +12,7 @@ import { Command } from '../Command.js';
* @param newValue number, string, boolean or object
* @constructor
*/
var SetMaterialValueCommand = function ( editor, object, attributeName, newValue, materialSlot ) {
function SetMaterialValueCommand( editor, object, attributeName, newValue, materialSlot ) {
Command.call( this, editor );
......@@ -28,7 +28,7 @@ var SetMaterialValueCommand = function ( editor, object, attributeName, newValue
this.attributeName = attributeName;
};
}
SetMaterialValueCommand.prototype = {
......
......@@ -5,7 +5,7 @@
import { Command } from '../Command.js';
var SetMaterialVectorCommand = function ( editor, object, attributeName, newValue, materialSlot ) {
function SetMaterialVectorCommand( editor, object, attributeName, newValue, materialSlot ) {
Command.call( this, editor );
......@@ -21,7 +21,7 @@ var SetMaterialVectorCommand = function ( editor, object, attributeName, newValu
this.attributeName = attributeName;
};
}
SetMaterialVectorCommand.prototype = {
......
......@@ -14,7 +14,7 @@ import * as THREE from '../../../build/three.module.js';
* @param optionalOldPosition THREE.Vector3
* @constructor
*/
var SetPositionCommand = function ( editor, object, newPosition, optionalOldPosition ) {
function SetPositionCommand( editor, object, newPosition, optionalOldPosition ) {
Command.call( this, editor );
......@@ -37,7 +37,8 @@ var SetPositionCommand = function ( editor, object, newPosition, optionalOldPosi
}
};
}
SetPositionCommand.prototype = {
execute: function () {
......
......@@ -14,7 +14,7 @@ import * as THREE from '../../../build/three.module.js';
* @param optionalOldRotation THREE.Euler
* @constructor
*/
var SetRotationCommand = function ( editor, object, newRotation, optionalOldRotation ) {
function SetRotationCommand( editor, object, newRotation, optionalOldRotation ) {
Command.call( this, editor );
......@@ -37,7 +37,7 @@ var SetRotationCommand = function ( editor, object, newRotation, optionalOldRota
}
};
}
SetRotationCommand.prototype = {
......
......@@ -14,7 +14,7 @@ import * as THREE from '../../../build/three.module.js';
* @param optionalOldScale THREE.Vector3
* @constructor
*/
var SetScaleCommand = function ( editor, object, newScale, optionalOldScale ) {
function SetScaleCommand( editor, object, newScale, optionalOldScale ) {
Command.call( this, editor );
......@@ -37,7 +37,7 @@ var SetScaleCommand = function ( editor, object, newScale, optionalOldScale ) {
}
};
}
SetScaleCommand.prototype = {
......
......@@ -13,7 +13,7 @@ import { AddObjectCommand } from './AddObjectCommand.js';
* @param scene containing children to import
* @constructor
*/
var SetSceneCommand = function ( editor, scene ) {
function SetSceneCommand( editor, scene ) {
Command.call( this, editor );
......@@ -37,7 +37,7 @@ var SetSceneCommand = function ( editor, scene ) {
}
};
}
SetSceneCommand.prototype = {
......
......@@ -13,7 +13,7 @@ import { Command } from '../Command.js';
* @param newValue string, object
* @constructor
*/
var SetScriptValueCommand = function ( editor, object, script, attributeName, newValue ) {
function SetScriptValueCommand( editor, object, script, attributeName, newValue ) {
Command.call( this, editor );
......@@ -28,7 +28,7 @@ var SetScriptValueCommand = function ( editor, object, script, attributeName, ne
this.oldValue = ( script !== undefined ) ? script[ this.attributeName ] : undefined;
this.newValue = newValue;
};
}
SetScriptValueCommand.prototype = {
......
......@@ -11,7 +11,7 @@ import { Command } from '../Command.js';
* @param newUuid string
* @constructor
*/
var SetUuidCommand = function ( editor, object, newUuid ) {
function SetUuidCommand( editor, object, newUuid ) {
Command.call( this, editor );
......@@ -23,7 +23,7 @@ var SetUuidCommand = function ( editor, object, newUuid ) {
this.oldUuid = ( object !== undefined ) ? object.uuid : undefined;
this.newUuid = newUuid;
};
}
SetUuidCommand.prototype = {
......
......@@ -12,7 +12,7 @@ import { Command } from '../Command.js';
* @param newValue number, string, boolean or object
* @constructor
*/
var SetValueCommand = function ( editor, object, attributeName, newValue ) {
function SetValueCommand( editor, object, attributeName, newValue ) {
Command.call( this, editor );
......@@ -25,7 +25,7 @@ var SetValueCommand = function ( editor, object, attributeName, newValue ) {
this.oldValue = ( object !== undefined ) ? object[ attributeName ] : undefined;
this.newValue = newValue;
};
}
SetValueCommand.prototype = {
......
......@@ -2,11 +2,11 @@
* @author mrdoob / http://mrdoob.com/
*/
var UIElement = function ( dom ) {
function UIElement( dom ) {
this.dom = dom;
};
}
UIElement.prototype = {
......@@ -172,7 +172,7 @@ events.forEach( function ( event ) {
// UISpan
var UISpan = function () {
function UISpan() {
UIElement.call( this );
......@@ -180,14 +180,14 @@ var UISpan = function () {
return this;
};
}
UISpan.prototype = Object.create( UIElement.prototype );
UISpan.prototype.constructor = UISpan;
// UIDiv
var UIDiv = function () {
function UIDiv() {
UIElement.call( this );
......@@ -195,14 +195,14 @@ var UIDiv = function () {
return this;
};
}
UIDiv.prototype = Object.create( UIElement.prototype );
UIDiv.prototype.constructor = UIDiv;
// UIRow
var UIRow = function () {
function UIRow() {
UIElement.call( this );
......@@ -213,14 +213,14 @@ var UIRow = function () {
return this;
};
}
UIRow.prototype = Object.create( UIElement.prototype );
UIRow.prototype.constructor = UIRow;
// UIPanel
var UIPanel = function () {
function UIPanel() {
UIElement.call( this );
......@@ -231,14 +231,14 @@ var UIPanel = function () {
return this;
};
}
UIPanel.prototype = Object.create( UIElement.prototype );
UIPanel.prototype.constructor = UIPanel;
// UIText
var UIText = function ( text ) {
function UIText( text ) {
UIElement.call( this );
......@@ -253,7 +253,7 @@ var UIText = function ( text ) {
return this;
};
}
UIText.prototype = Object.create( UIElement.prototype );
UIText.prototype.constructor = UIText;
......@@ -279,7 +279,7 @@ UIText.prototype.setValue = function ( value ) {
// UIInput
var UIInput = function ( text ) {
function UIInput( text ) {
UIElement.call( this );
......@@ -299,7 +299,7 @@ var UIInput = function ( text ) {
return this;
};
}
UIInput.prototype = Object.create( UIElement.prototype );
UIInput.prototype.constructor = UIInput;
......@@ -321,7 +321,7 @@ UIInput.prototype.setValue = function ( value ) {
// UITextArea
var UITextArea = function () {
function UITextArea() {
UIElement.call( this );
......@@ -352,7 +352,7 @@ var UITextArea = function () {
return this;
};
}
UITextArea.prototype = Object.create( UIElement.prototype );
UITextArea.prototype.constructor = UITextArea;
......@@ -374,7 +374,7 @@ UITextArea.prototype.setValue = function ( value ) {
// UISelect
var UISelect = function () {
function UISelect() {
UIElement.call( this );
......@@ -386,7 +386,7 @@ var UISelect = function () {
return this;
};
}
UISelect.prototype = Object.create( UIElement.prototype );
UISelect.prototype.constructor = UISelect;
......@@ -446,7 +446,7 @@ UISelect.prototype.setValue = function ( value ) {
// UICheckbox
var UICheckbox = function ( boolean ) {
function UICheckbox( boolean ) {
UIElement.call( this );
......@@ -459,7 +459,7 @@ var UICheckbox = function ( boolean ) {
return this;
};
}
UICheckbox.prototype = Object.create( UIElement.prototype );
UICheckbox.prototype.constructor = UICheckbox;
......@@ -485,7 +485,7 @@ UICheckbox.prototype.setValue = function ( value ) {
// UIColor
var UIColor = function () {
function UIColor() {
UIElement.call( this );
......@@ -508,7 +508,7 @@ var UIColor = function () {
return this;
};
}
UIColor.prototype = Object.create( UIElement.prototype );
UIColor.prototype.constructor = UIColor;
......@@ -544,7 +544,7 @@ UIColor.prototype.setHexValue = function ( hex ) {
// UINumber
var UINumber = function ( number ) {
function UINumber( number ) {
UIElement.call( this );
......@@ -735,7 +735,7 @@ var UINumber = function ( number ) {
return this;
};
}
UINumber.prototype = Object.create( UIElement.prototype );
UINumber.prototype.constructor = UINumber;
......@@ -809,7 +809,7 @@ UINumber.prototype.setUnit = function ( unit ) {
// UIInteger
var UIInteger = function ( number ) {
function UIInteger( number ) {
UIElement.call( this );
......@@ -947,7 +947,7 @@ var UIInteger = function ( number ) {
return this;
};
}
UIInteger.prototype = Object.create( UIElement.prototype );
UIInteger.prototype.constructor = UIInteger;
......@@ -1001,7 +1001,7 @@ UIInteger.prototype.setRange = function ( min, max ) {
// UIBreak
var UIBreak = function () {
function UIBreak() {
UIElement.call( this );
......@@ -1012,7 +1012,7 @@ var UIBreak = function () {
return this;
};
}
UIBreak.prototype = Object.create( UIElement.prototype );
UIBreak.prototype.constructor = UIBreak;
......@@ -1020,7 +1020,7 @@ UIBreak.prototype.constructor = UIBreak;
// UIHorizontalRule
var UIHorizontalRule = function () {
function UIHorizontalRule() {
UIElement.call( this );
......@@ -1031,7 +1031,7 @@ var UIHorizontalRule = function () {
return this;
};
}
UIHorizontalRule.prototype = Object.create( UIElement.prototype );
UIHorizontalRule.prototype.constructor = UIHorizontalRule;
......@@ -1039,7 +1039,7 @@ UIHorizontalRule.prototype.constructor = UIHorizontalRule;
// UIButton
var UIButton = function ( value ) {
function UIButton( value ) {
UIElement.call( this );
......@@ -1051,7 +1051,7 @@ var UIButton = function ( value ) {
return this;
};
}
UIButton.prototype = Object.create( UIElement.prototype );
UIButton.prototype.constructor = UIButton;
......@@ -1067,7 +1067,7 @@ UIButton.prototype.setLabel = function ( value ) {
// UITabbedPanel
var UITabbedPanel = function ( ) {
function UITabbedPanel( ) {
UIElement.call( this );
......@@ -1093,7 +1093,7 @@ var UITabbedPanel = function ( ) {
return this;
};
}
UITabbedPanel.prototype = Object.create( UIElement.prototype );
UITabbedPanel.prototype.constructor = UITabbedPanel;
......@@ -1202,7 +1202,7 @@ UITabbedPanel.Tab.prototype = Object.create( UIText.prototype );
UITabbedPanel.Tab.prototype.constructor = UITabbedPanel.Tab;
// UIListbox
var UIListbox = function ( ) {
function UIListbox( ) {
UIElement.call( this );
......@@ -1218,7 +1218,7 @@ var UIListbox = function ( ) {
return this;
};
}
UIListbox.prototype = Object.create( UIElement.prototype );
UIListbox.prototype.constructor = UIListbox;
......
......@@ -14,7 +14,7 @@ import { MoveObjectCommand } from '../commands/MoveObjectCommand.js';
* @author mrdoob / http://mrdoob.com/
*/
var UITexture = function ( mapping ) {
function UITexture( mapping ) {
UIElement.call( this );
......@@ -141,7 +141,7 @@ var UITexture = function ( mapping ) {
return this;
};
}
UITexture.prototype = Object.create( UIElement.prototype );
UITexture.prototype.constructor = UITexture;
......@@ -225,7 +225,7 @@ UITexture.prototype.onChange = function ( callback ) {
// UICubeTexture
var UICubeTexture = function () {
function UICubeTexture() {
UIElement.call( this );
......@@ -295,7 +295,7 @@ var UICubeTexture = function () {
}
};
}
UICubeTexture.prototype = Object.create( UIElement.prototype );
UICubeTexture.prototype.constructor = UICubeTexture;
......@@ -366,7 +366,7 @@ UICubeTexture.prototype.onChange = function ( callback ) {
// UIOutliner
var UIOutliner = function ( editor ) {
function UIOutliner( editor ) {
UIElement.call( this );
......@@ -419,7 +419,7 @@ var UIOutliner = function ( editor ) {
return this;
};
}
UIOutliner.prototype = Object.create( UIElement.prototype );
UIOutliner.prototype.constructor = UIOutliner;
......@@ -652,7 +652,7 @@ UIOutliner.prototype.setValue = function ( value ) {
};
var UIPoints = function ( onAddClicked ) {
function UIPoints( onAddClicked ) {
UIElement.call( this );
......@@ -683,7 +683,7 @@ var UIPoints = function ( onAddClicked ) {
this.onChangeCallback = null;
return this;
};
}
UIPoints.prototype = Object.create( UIElement.prototype );
UIPoints.prototype.constructor = UIPoints;
......@@ -727,13 +727,13 @@ UIPoints.prototype.deletePointRow = function ( idx, dontUpdate ) {
};
var UIPoints2 = function () {
function UIPoints2() {
UIPoints.call( this, UIPoints2.addRow.bind( this ) );
return this;
};
}
UIPoints2.prototype = Object.create( UIPoints.prototype );
UIPoints2.prototype.constructor = UIPoints2;
......@@ -817,13 +817,13 @@ UIPoints2.prototype.createPointRow = function ( x, y ) {
};
var UIPoints3 = function () {
function UIPoints3() {
UIPoints.call( this, UIPoints3.addRow.bind( this ) );
return this;
};
}
UIPoints3.prototype = Object.create( UIPoints.prototype );
UIPoints3.prototype.constructor = UIPoints3;
......@@ -908,7 +908,7 @@ UIPoints3.prototype.createPointRow = function ( x, y, z ) {
};
var UIBoolean = function ( boolean, text ) {
function UIBoolean( boolean, text ) {
UISpan.call( this );
......@@ -920,7 +920,7 @@ var UIBoolean = function ( boolean, text ) {
this.add( this.checkbox );
this.add( this.text );
};
}
UIBoolean.prototype = Object.create( UISpan.prototype );
UIBoolean.prototype.constructor = UIBoolean;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册