소스 검색

Remove "Save Editor to JSON" and "Open Editor from JSON"

Issue #37
Daniel 10 년 전
부모
커밋
1a4cfb022f
1개의 변경된 파일1개의 추가작업 그리고 57개의 파일을 삭제
  1. 1 57
      editor/js/Menubar.File.js

+ 1 - 57
editor/js/Menubar.File.js

@@ -32,62 +32,6 @@ Menubar.File = function ( editor ) {
 	} );
 	options.add( option );
 
-	// Open Editor-JSON
-
-	var editorJsonInput = document.createElement( 'input' );
-	editorJsonInput.type = 'file';
-	editorJsonInput.addEventListener( 'change', function ( event ) {
-
-		var reader = new FileReader();
-		reader.addEventListener( 'load', function ( event ) {
-
-			var contents = event.target.result;
-
-			var data;
-			try {
-
-				data = JSON.parse( contents );
-				editor.clear();
-				editor.fromJSON( data );
-
-			} catch ( error ) {
-
-				alert( error );
-				return;
-
-			}
-
-		}, false );
-		reader.readAsText( editorJsonInput.files[ 0 ] );
-
-	} );
-
-	var option = new UI.Panel();
-	option.setClass( 'option' );
-	option.setTextContent( 'Open Editor-JSON...' );
-	option.onClick( function () {
-
-		editorJsonInput.click();
-
-	} );
-	options.add( option );
-
-	// Save Editor-JSON
-
-	var option = new UI.Panel();
-	option.setClass( 'option' );
-	option.setTextContent( 'Save Editor-JSON...' );
-	option.onClick( function () {
-
-		var output = editor.toJSON();
-		output = JSON.stringify( output, null, '\t' );
-		output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
-
-		exportString( output, 'editor.json' );
-
-	} );
-	options.add( option );
-
 	//
 
 	options.add( new UI.HorizontalRule() );
@@ -358,4 +302,4 @@ Menubar.File = function ( editor ) {
 
 	return container;
 
-};
+};