Created
May 2, 2012 02:09
-
-
Save trevmex/2573060 to your computer and use it in GitHub Desktop.
An HTML page to give you a jumping off point for NOT goofing off.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Do something productive!</title> | |
<style> | |
label { | |
display: block; | |
margin-bottom: 0.5em; | |
} | |
</style> | |
</head> | |
<body onload="OrgTrevreport.doIt();"> | |
<h1>Do something productive!</h1> | |
<p> | |
I see you are trying to goof off. Nice try, but you know there are so | |
many cool things you could be doing right now instead of goofing off. | |
</p> | |
<form id="github" action="github_submit" method="get" accept-charset="utf-8"> | |
<fieldset> | |
<legend> | |
Do you have a <a href="https://www.github.com/">GitHub</a> account? | |
</legend> | |
<label> What is it? | |
<input type="text" name="github_id" value="" id="github_id"/> | |
</label> | |
<input type="submit" value="Go hack on something"/> | |
</fieldset> | |
</form> | |
<form id="koans" action="koans_submit" method="get" accept-charset="utf-8"> | |
<fieldset> | |
<legend> | |
Want to learn a new programming language? | |
</legend> | |
<label> | |
<input type="radio" name="language" value="http://koans.heroku.com/" checked="checked" /> | |
<a href="http://www.ruby-lang.org/">Ruby</a> | |
</label> | |
<label> | |
<input type="radio" name="language" value="http://www.scalakoans.org/" /> | |
<a href="http://www.scala-lang.org/">Scala</a> | |
</label> | |
<label> | |
<input type="radio" name="language" value="https://bitbucket.org/gregmalcolm/python_koans/wiki/Home" /> | |
<a href="http://www.python.org/">Python</a> | |
</label> | |
<label> | |
<input type="radio" name="language" value="https://github.com/functional-koans/clojure-koans" /> | |
<a href="http://clojure.org/">Clojure</a> | |
</label> | |
<label> | |
<input type="radio" name="language" value="https://github.com/liammclennan/JavaScript-Koans" /> | |
<a href="https://developer.mozilla.org/en/JavaScript">JavaScript</a> | |
</label> | |
<label> | |
<input type="radio" name="language" value="http://www.tryerlang.org/" /> | |
<a href="http://www.erlang.org/">Erlang</a> | |
</label> | |
<input type="submit" value="Go learn something new"/> | |
</fieldset> | |
</form> | |
</body> | |
<script> | |
if (typeof OrgTrevreport === "undefined" || !OrgTrevreport) { | |
var OrgTrevreport = {}; | |
} | |
OrgTrevreport.doIt = function () { | |
"use strict"; | |
function githubLocation() { | |
var value = document.getElementById("github_id").value; | |
return ["https://www.github.com", value].join("/"); | |
} | |
function koansLocation() { | |
var elements, i, len; | |
elements = document.getElementsByName("language"); | |
for (i = 0, len = elements.length; i < len; i += 1) { | |
if (elements[i].checked === true) { | |
return elements[i].value; | |
} | |
} | |
return "localhost"; | |
} | |
function submit(event) { | |
var form_id, location; | |
form_id = event.target.id; | |
if (form_id === "github") { | |
location = githubLocation(); | |
} else if (form_id === "koans") { | |
location = koansLocation(); | |
} | |
window.location = location; | |
event.preventDefault(); | |
} | |
window.onsubmit = submit; | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment