Browse Source

Editor: Saving status.

Mr.doob 10 years ago
parent
commit
eb7da5e218
6 changed files with 47 additions and 4 deletions
  1. 6 2
      editor/css/dark.css
  2. 6 2
      editor/css/light.css
  3. 5 0
      editor/index.html
  4. 3 0
      editor/js/Editor.js
  5. 25 0
      editor/js/Menubar.Status.js
  6. 2 0
      editor/js/Menubar.js

+ 6 - 2
editor/css/dark.css

@@ -56,6 +56,12 @@ input.Number {
 		cursor: pointer;
 		cursor: pointer;
 	}
 	}
 
 
+	#menubar .menu.right {
+		float: right;
+		width: 100px;
+		text-align: right;
+	}
+
 		#menubar .menu .title {
 		#menubar .menu .title {
 			color: #888;
 			color: #888;
 			margin: 0px;
 			margin: 0px;
@@ -156,5 +162,3 @@ input.Number {
 	#toolbar button {
 	#toolbar button {
 		margin-right: 6px;
 		margin-right: 6px;
 	}
 	}
-
-

+ 6 - 2
editor/css/light.css

@@ -57,6 +57,12 @@ input.Number {
 		cursor: pointer;
 		cursor: pointer;
 	}
 	}
 
 
+	#menubar .menu.right {
+		float: right;
+		width: 100px;
+		text-align: right;
+	}
+
 		#menubar .menu .title {
 		#menubar .menu .title {
 			color: #888;
 			color: #888;
 			margin: 0px;
 			margin: 0px;
@@ -150,5 +156,3 @@ input.Number {
 	#toolbar button {
 	#toolbar button {
 		margin-right: 6px;
 		margin-right: 6px;
 	}
 	}
-
-

+ 5 - 0
editor/index.html

@@ -55,6 +55,7 @@
 		<script src="js/Menubar.Play.js"></script>
 		<script src="js/Menubar.Play.js"></script>
 		<script src="js/Menubar.View.js"></script>
 		<script src="js/Menubar.View.js"></script>
 		<script src="js/Menubar.Help.js"></script>
 		<script src="js/Menubar.Help.js"></script>
+		<script src="js/Menubar.Status.js"></script>
 		<script src="js/Sidebar.js"></script>
 		<script src="js/Sidebar.js"></script>
 		<script src="js/Sidebar.Renderer.js"></script>
 		<script src="js/Sidebar.Renderer.js"></script>
 		<script src="js/Sidebar.Scene.js"></script>
 		<script src="js/Sidebar.Scene.js"></script>
@@ -144,10 +145,14 @@
 
 
 					clearTimeout( timeout );
 					clearTimeout( timeout );
 
 
+					editor.signals.savingStarted.dispatch();
+
 					timeout = setTimeout( function () {
 					timeout = setTimeout( function () {
 
 
 						editor.storage.set( editor.scene.toJSON() );
 						editor.storage.set( editor.scene.toJSON() );
 
 
+						editor.signals.savingFinished.dispatch();
+
 					}, 1000 );
 					}, 1000 );
 
 
 				};
 				};

+ 3 - 0
editor/js/Editor.js

@@ -18,6 +18,9 @@ var Editor = function () {
 
 
 		// notifications
 		// notifications
 
 
+		savingStarted: new SIGNALS.Signal(),
+		savingFinished: new SIGNALS.Signal(),
+
 		themeChanged: new SIGNALS.Signal(),
 		themeChanged: new SIGNALS.Signal(),
 
 
 		transformModeChanged: new SIGNALS.Signal(),
 		transformModeChanged: new SIGNALS.Signal(),

+ 25 - 0
editor/js/Menubar.Status.js

@@ -0,0 +1,25 @@
+Menubar.Status = function ( editor ) {
+
+	var container = new UI.Panel();
+	container.setClass( 'menu right' );
+
+	var title = new UI.Panel();
+	title.setClass( 'title' );
+	title.setTextContent( '' );
+	container.add( title );
+
+	editor.signals.savingStarted.add( function () {
+
+		title.setTextContent( '...' );
+
+	} );
+
+	editor.signals.savingFinished.add( function () {
+
+		title.setTextContent( '' );
+
+	} );
+
+	return container;
+
+};

+ 2 - 0
editor/js/Menubar.js

@@ -9,6 +9,8 @@ var Menubar = function ( editor ) {
 	container.add( new Menubar.View( editor ) );
 	container.add( new Menubar.View( editor ) );
 	container.add( new Menubar.Help( editor ) );
 	container.add( new Menubar.Help( editor ) );
 
 
+	container.add( new Menubar.Status( editor ) );
+
 	return container;
 	return container;
 
 
 };
 };