Browse Source

Editor: Extract embedded style tag to linked stylesheet

jlewin 12 years ago
parent
commit
66319eba8c
4 changed files with 133 additions and 134 deletions
  1. 1 132
      editor/index.html
  2. 0 2
      editor/js/libs/ui.js
  3. 132 0
      editor/themes/default/style.css
  4. BIN
      editor/themes/default/trans.png

+ 1 - 132
editor/index.html

@@ -4,140 +4,9 @@
 		<title>three.js editor</title>
 		<title>three.js editor</title>
 		<meta charset="utf-8">
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<style>
-			* {
-				vertical-align: middle;
-			}
-
-			body {
-				font-family: Arial, sans-serif;
-				font-size: 14px;
-				margin: 0;
-				overflow: hidden;
-			}
-
-			hr {
-				border: 0px;
-				border-top: 1px solid #ccc;
-			}
-
-			button {
-				position: relative;
-			}
-
-			.Panel {
-
-				-moz-user-select: none;
-				-webkit-user-select: none;
-				-ms-user-select: none;
-
-				  /* No support for these yet */
-				-o-user-select: none;
-				user-select: none;
-			}
-
-			#menubar {
-				position: absolute;
-				background: url(trans.png);
-				padding: 0px;
-				margin: 0px;
-			}
-
-				#menubar .menu {
-					float: left;
-					width: 50px;
-					cursor: pointer;
-				}
-
-				#menubar .Panel {
-					color: #888;
-				}
-
-					#menubar .menu .options {
-						padding: 5px 0px;
-						background: url(trans.png);
-						width: 140px;
-					}
-
-						#menubar .menu .options hr {
-							border-color: #444;
-						}
-
-						#menubar .menu .options .option {
-							color: #666;
-							background-color: transparent;
-							padding: 5px 10px;
-							margin: 0px !important;
-						}
-
-							#menubar .menu .options .option:hover {
-								color: #fff;
-								background-color: #08f;
-							}
-
-
-			#sidebar {
-				position: absolute;
-				width: 300px;
-				background: url(trans.png);
-				overflow: auto;
-			}
-
-				#sidebar .Panel {
-					margin-bottom: 10px;
-				}
-
-				#sidebar > .Panel {
-					color: #888;
-					padding: 10px;
-					border-top: 1px solid #333;
-				}
-
-				#sidebar #outliner {
-					width: 100%;
-					height: 140px;
-					color: #444;
-					font-size: 12px;
-				}
-
-				#sidebar #outliner .type {
-					padding: 2px 4px;
-					font-size: 10px;
-					background: #eee;
-					color: #aaa;
-				}
-
-			#toolbar {
-				position: absolute;
-				background: url(trans.png);
-				color: #333;
-			}
-			
-				#toolbar .Panel {
-					padding: 4px;
-					color: #888;
-				}
-
-				#toolbar button {
-					margin-right: 6px;
-				}
-
-			.FancySelect {
-				background: #fff;
-				border: 1px solid #ccc;
-				padding: 0;
-				cursor: default;
-				overflow: auto;
-			}
-
-				.FancySelect .option {
-					padding: 4px;
-					white-space: nowrap;
-				}
-
-		</style>
 	</head>
 	</head>
 	<body>
 	<body>
+		<link href="themes/default/style.css" rel="stylesheet" />
 
 
 		<script src="../build/three.min.js"></script>
 		<script src="../build/three.min.js"></script>
 		<script src="../examples/js/libs/system.min.js"></script>
 		<script src="../examples/js/libs/system.min.js"></script>

+ 0 - 2
editor/js/libs/ui.js

@@ -23,8 +23,6 @@ UI.Element.prototype = {
 
 
 	addClass: function ( value ) {
 	addClass: function ( value ) {
 
 
-		debugger;
-
 		var classes = this.dom.className.split(/\s+/g);
 		var classes = this.dom.className.split(/\s+/g);
 
 
 		// Exit early and avoid dom update if already set
 		// Exit early and avoid dom update if already set

+ 132 - 0
editor/themes/default/style.css

@@ -0,0 +1,132 @@
+* {
+	vertical-align: middle;
+}
+
+body {
+	font-family: Arial, sans-serif;
+	font-size: 14px;
+	margin: 0;
+	overflow: hidden;
+}
+
+hr {
+	border: 0px;
+	border-top: 1px solid #ccc;
+}
+
+button {
+	position: relative;
+}
+
+.Panel {
+
+	-moz-user-select: none;
+	-webkit-user-select: none;
+	-ms-user-select: none;
+
+		/* No support for these yet */
+	-o-user-select: none;
+	user-select: none;
+}
+
+.FancySelect {
+	background: #fff;
+	border: 1px solid #ccc;
+	padding: 0;
+	cursor: default;
+	overflow: auto;
+}
+
+	.FancySelect .option {
+		padding: 4px;
+		white-space: nowrap;
+	}
+
+
+#menubar {
+	position: absolute;
+	background: url(trans.png);
+	padding: 0px;
+	margin: 0px;
+}
+
+	#menubar .menu {
+		float: left;
+		width: 50px;
+		cursor: pointer;
+	}
+
+	#menubar .Panel {
+		color: #888;
+	}
+
+		#menubar .menu .options {
+			padding: 5px 0px;
+			background: url(trans.png);
+			width: 140px;
+		}
+
+			#menubar .menu .options hr {
+				border-color: #444;
+			}
+
+			#menubar .menu .options .option {
+				color: #666;
+				background-color: transparent;
+				padding: 5px 10px;
+				margin: 0px !important;
+			}
+
+				#menubar .menu .options .option:hover {
+					color: #fff;
+					background-color: #08f;
+				}
+
+
+#sidebar {
+	position: absolute;
+	width: 300px;
+	background: url(trans.png);
+	overflow: auto;
+}
+
+	#sidebar .Panel {
+		margin-bottom: 10px;
+	}
+
+	#sidebar > .Panel {
+		color: #888;
+		padding: 10px;
+		border-top: 1px solid #333;
+	}
+
+	#sidebar #outliner {
+		width: 100%;
+		height: 140px;
+		color: #444;
+		font-size: 12px;
+	}
+
+	#sidebar #outliner .type {
+		padding: 2px 4px;
+		font-size: 10px;
+		background: #eee;
+		color: #aaa;
+	}
+
+#toolbar {
+	position: absolute;
+	background: url(trans.png);
+	color: #333;
+}
+			
+	#toolbar .Panel {
+		padding: 4px;
+		color: #888;
+	}
+
+	#toolbar button {
+		margin-right: 6px;
+	}
+
+

BIN
editor/themes/default/trans.png