2
0
Эх сурвалжийг харах

Editor/App: Added edit button back.

Mr.doob 8 жил өмнө
parent
commit
99c9c862dc

+ 22 - 0
editor/js/libs/app/index.html

@@ -13,6 +13,19 @@
 				margin: 0px;
 				overflow: hidden;
 			}
+			#edit {
+				position: absolute;
+				bottom: 20px;
+				right: 20px;
+				padding: 8px;
+				text-decoration: none;
+				background-color: #fff;
+				color: #555;
+				opacity: 0.5;
+			}
+			#edit:hover {
+				opacity: 1;
+			}
 		</style>
 	</head>
 	<body ontouchstart="">
@@ -35,6 +48,15 @@
 					player.setSize( window.innerWidth, window.innerHeight );
 				} );
 
+				if ( location.search === '?edit' ) {
+					var button = document.createElement( 'a' );
+					button.id = 'edit';
+					button.href = 'https://threejs.org/editor/#file=' + location.href.split( '/' ).slice( 0, - 1 ).join( '/' ) + '/app.json';
+					button.target = '_blank';
+					button.textContent = 'EDIT';
+					document.body.appendChild( button );
+				}
+
 			} );
 
 		</script>