Skip to content
Browse files

tweaked some things for usability

  • Loading branch information...
1 parent 6f716dc commit f1f7c19a2967a9bb01d3c48329d4ba8b9c575811 Will Riley committed
Showing with 28 additions and 13 deletions.
  1. +11 −3 qp/static/dojotoolkit/qp/_base.js
  2. +5 −3 qp/static/index.html
  3. +12 −7 qp/static/main.css
View
14 qp/static/dojotoolkit/qp/_base.js
@@ -9,12 +9,20 @@ dojo.require("dijit.form.TextBox");
var qp = {
answerPrefill: "Enter your answer here...",
textClear: function(){
- if(dijit.byId('answerEntry').getValue() == this.answerPrefill){
- dijit.byId('answerEntry').setValue('');
+ var a = dijit.byId('answerEntry')
+ if(a.getValue() == this.answerPrefill){
+ a.setValue('');
}
},
+ textFill: function(){
+ var a = dijit.byId('answerEntry');
+ if(a.getValue() == ""){
+ a.setValue(this.answerPrefill);
+ }
+ },
textStart: function(){
dijit.byId('answerEntry').setValue(this.answerPrefill);
- dojo.connect(dijit.byId('answerEntry'), 'onFocus', qp.textClear);
+ dojo.connect(dijit.byId('answerEntry'), 'onFocus', qp, "textClear");
+ dojo.connect(dijit.byId('answerEntry'), 'onBlur', qp, "textFill");
}
}
View
8 qp/static/index.html
@@ -24,11 +24,13 @@
<h2>Question</h2>
<div dojoType="dojoc.sandbox.rounded.Rounded" id="question" bgImg="/dojotoolkit/dojoc/sandbox/rounded/resources/RoundedBg.png">
Isn't it ironic that the Bible presents Jesus and his disciples as Palestinian terroists?
- </div>
- <a href="javascript:alert('Yahoo Answers(tm)');">Where did this question come from?</a><br /><br />
- <input id="answerEntry" dojoType="dijit.form.TextBox"/><br /><br />
+ </div> <input id="answerEntry" dojoType="dijit.form.TextBox"/><br /><br />
<div id="submitAnswerButton" dojoType="dijit.form.Button">Submit</div><br />
<div id="getAnotherQuestionButton" dojoType="dijit.form.Button">This is a lame question</div>
+ <div class="origin">
+ <a href="javascript:alert('Yahoo Answers(tm)');">Where did this question come from?</a>
+ </div>
+
</div>
</div>
</body>
View
19 qp/static/main.css
@@ -17,28 +17,33 @@ body, html{
}
#topBoxTitle {
float: left;
- font-size: 50px;
+ font-size: 24pt;
}
#topBoxWTF {
float: right;
+ margin-top: 10px;
}
#mainContent {
text-align: center;
}
#question {
- padding: 50px;
- margin-left: 34%;
- margin-right: 35%;
+ padding: 30px;
+ margin-left: auto;
+ margin-right: auto;
width: 25%;
font-size: 18px;
}
#answerEntry {
font-size: 20px;
padding: 5px;
- color: grey;
height: 25px;
width: 20%;
}
-#answerEntry:focus {
- color: black;
+
+div.origin {
+ margin: 2em;
+}
+
+div.origin a {
+ color: #6767ff;
}

0 comments on commit f1f7c19

Please sign in to comment.
Something went wrong with that request. Please try again.