Permalink
Browse files

Merge pull request #2 from skyscreamer/master

various selector fixes
  • Loading branch information...
2 parents b3d24dd + 5ac52b9 commit b8d732f07b13ad98d387032ed682139a4613caf0 @sduskis committed Jun 3, 2012
@@ -17,13 +17,16 @@ h1 {
}
#container { width: 800px; }
-#header { }
+#header_title { border-bottom: 2px solid #66f; }
+#header_title h1 { margin-bottom: 0px; }
#top_bar { padding: 5px; height: 40px; }
#url_bar { padding: 4px; background-color: #ffffff; float: left; width: 694px; border: 1px solid #666666; }
#json_path {}
#generated_selector { color: #66f; }
#load_time_bar { float: left; width: 75px; margin: 5px 0 0 5px; text-align: right; }
+#load_time_bar.errTime { background-color: #f00; color: #fff; padding: 2px; }
+#load_time_bar.warnTime { background-color: #ffa500; color: #fff; padding: 2px; }
#selector_canvas { padding: 5px; height: 400px; }
#selector_builder_wrapper { background-color: #ffffff; float: left; width: 245px; height:400px; overflow: auto; }
@@ -55,7 +55,17 @@
success: function(data) {
$('#data_preview').html(JSON.stringify(data, null, ' '));
var end = new Date().getTime();
- $('#load_time').html(end - start);
+ var totalTime = end - start;
+ $('#load_time').html(totalTime);
+ if (totalTime >= 1000) {
+ $('#load_time_bar').removeClass("warnTime").addClass("errTime");
+ }
+ else if (totalTime >= 500) {
+ $('#load_time_bar').removeClass("errTime").addClass("warnTime");
+ }
+ else {
+ $('#load_time_bar').removeClass("warnTime errTime");
+ }
}
});
}
@@ -146,10 +156,11 @@
<body>
<div id="container">
<div id="header">
- <h1>Yoga Selector Builder</h1>
- <p>Click on elements on the left-hand side below to add or remove them from the selector.
- The selector will be built in the address bar and can be copied into your client application.
- View the resulting output on the right.</p>
+ <div id="header_title"><h1>Yoga Selector Builder</h1></div>
+ <p>Click on elements on the left-hand side below to add or remove them from the selector
+ in the address bar.
+ View the resulting output in the preview pane on the right.
+ Default fields are italicized and cannot be added to the selector.</p>
</div>
<div id="top_bar">
<div id="url_bar"><span id="json_path"></span><span id="generated_selector"></span></div>

0 comments on commit b8d732f

Please sign in to comment.