commit:6ad50ddbe5fd0f2177fc5c9826153433739092da
author:Chip Black
committer:Chip Black
date:Sat Nov 10 16:04:39 2018 -0600
parents:444d96e78330e26617ee486ce001c1ed7b15d369
Rename Editor to CellEditor
diff --git a/index.html b/index.html
line changes: +2/-2
index 5ad75fe..dac9af3
--- a/index.html
+++ b/index.html
@@ -22,7 +22,7 @@
   </div>
 </div>
 
-<div id="editor-container">
+<div id="cell-editor-container">
   <div class="box hflex">
     <div class="vflex flex-auto">
       <h1>Cell Editor</h1>
@@ -31,7 +31,7 @@
       <h2>Description</h2>
       <textarea name="description" class="flex-auto"></textarea>
       <div class="hflex">
-        <button id="editor-close">Close</button>
+        <button id="cell-editor-close">Close</button>
       </div>
     </div>
     <div class="events">

diff --git a/src/celleditor.ts b/src/celleditor.ts
line changes: +4/-4
index a53152a..51a1bc4
--- a/src/celleditor.ts
+++ b/src/celleditor.ts
@@ -2,9 +2,9 @@ import { Cell } from './cell';
 import { GameEvent, GameEventType } from './event';
 import FragmentManager from './fragmentmanager';
 
-export type EditorCallback = (cell: Cell) => void;
+export type CellEditorCallback = (cell: Cell) => void;
 
-export default class Editor {
+export default class CellEditor {
     container: HTMLDivElement
     titleRef: HTMLInputElement
     descriptionRef: HTMLTextAreaElement
@@ -14,7 +14,7 @@ export default class Editor {
     onClose: (cell: Cell) => void
 
     constructor() {
-        this.container = <HTMLDivElement>document.getElementById('editor-container');
+        this.container = <HTMLDivElement>document.getElementById('cell-editor-container');
         this.container.addEventListener('keydown', function(e: KeyboardEvent) {
             e.cancelBubble = true;
         });
@@ -26,7 +26,7 @@ export default class Editor {
         addEventButton.addEventListener('click', this.addEventHandler.bind(this));
         this.events = []
 
-        const closeButton = document.getElementById('editor-close');
+        const closeButton = document.getElementById('cell-editor-close');
         closeButton.addEventListener('click', this.closeHandler.bind(this));
     }
 

diff --git a/src/gamestate.ts b/src/gamestate.ts
line changes: +3/-3
index f890fad..7b8d16e
--- a/src/gamestate.ts
+++ b/src/gamestate.ts
@@ -1,5 +1,5 @@
 import GameMap from './map';
-import Editor, { EditorCallback } from './editor';
+import CellEditor, { CellEditorCallback } from './celleditor';
 import MapView from './mapview';
 import TextView from './textview';
 import Actions from './actions';
@@ -29,7 +29,7 @@ class GameState {
     agents: Map<ID, GameAgent>; 
 
     textView: TextView;
-    editor: Editor;
+    cellEditor: CellEditor;
     mapView: MapView;
     actions: Actions;
     editMode: boolean = true;
@@ -43,7 +43,7 @@ class GameState {
         document.body.classList.toggle('edit-mode', this.editMode);
 
         this.textView = new TextView();
-        this.editor = new Editor();
+        this.cellEditor = new CellEditor();
         this.mapView = new MapView();
         this.mapView.updateAll();
         this.actions = new Actions();

diff --git a/src/map.ts b/src/map.ts
line changes: +2/-3
index 5d5412c..aa23439
--- a/src/map.ts
+++ b/src/map.ts
@@ -1,4 +1,3 @@
-import Editor from './editor';
 import gs from './gamestate';
 import { ID, generateID } from './id';
 import { GameObject, GameObjectType } from './object';
@@ -102,10 +101,10 @@ export default class GameMap extends Storable {
     }
 
     editDescription() {
-        gs.editor.onClose = (cell: Cell) => {
+        gs.cellEditor.onClose = (cell: Cell) => {
             gs.enterCell();
         };
-        gs.editor.open(this.getCurrentCell());
+        gs.cellEditor.open(this.getCurrentCell());
     }
 
     store() {

diff --git a/structure.css b/structure.css
line changes: +5/-5
index 3a6b872..2ca2403
--- a/structure.css
+++ b/structure.css
@@ -79,7 +79,7 @@ body {
 	padding: 16px;
 }
 
-#editor-container {
+#cell-editor-container {
 	display: none;
 	position: fixed;
 	left: 0;
@@ -88,7 +88,7 @@ body {
 	height: 100vh;
 }
 
-#editor-container .box {
+#cell-editor-container .box {
 	width: 800px;
 	height: 600px;
 	margin-top: calc(50vh - 300px);
@@ -98,15 +98,15 @@ body {
 	background-color: black;
 }
 
-#editor-container.visible {
+#cell-editor-container.visible {
 	display: initial;
 }
 
-#editor-container textarea[name="description"] {
+#cell-editor-container textarea[name="description"] {
 	height: 80px;
 }
 
-#editor-container .events {
+#cell-editor-container .events {
 	margin-left: 16px;
 	overflow-y: auto;
 	width: 320px;