Permalink
Browse files

added initial web app stuff

  • Loading branch information...
1 parent 0581789 commit b73419ce5b56dd9a8223f990912b09cfafe5c3b0 @ryankohl committed Dec 20, 2011
View
@@ -0,0 +1,21 @@
+<html>
+ <head>
+ <title>NHL Data Demo</title>
+ <link rel="stylesheet" href="/css/index.css"/>
+ <script type="text/javascript" src="/js/jquery-1.7.1.min.js"></script>
+ <script type="text/javascript" src="/js/jquery-ui-1.8.16.custom.min.js"></script>
+ <script type="text/javascript" src="/js/index.js"></script>
+ </head>
+ <body>
+ <div id="top">
+ <h1 id="title">Hockey Overflow</h1>
+ </div>
+ <div id="content">
+ <div id="teamList">
+ <select id="teams">
+ </select>
+ </div>
+ <div id="teamInfo"/>
+ </div>
+ </body>
+</html>
View
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>NHL Data Demo</title>
+ </head>
+ <body>
+ <p>I am index</p>
+ </body>
+</html>
@@ -0,0 +1,15 @@
+#title {
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+}
+#content {
+ clear: both;
+}
+#teams {
+ float: left;
+}
+#teamInfo {
+ float: right;
+}
+
@@ -0,0 +1,14 @@
+#title {
+ margin-left: auto;
+ margin-right: auto;
+ font-size: 18px;
+}
+#content {
+ clear: both;
+}
+#teams {
+ float: left;
+}
+#teamInfo {
+ float: right;
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,41 @@
+var names;
+var teams;
+var reverseTeams= {};
+var teamList;
+var badges;
+var badgeTypes;
+
+$(document).ready(getData)
+function keys(x) {
+ return $.map(x, function(v,k) { return k });
+}
+function values(x) {
+ return $.map(x, function(v,k) { return v });
+}
+function getData() {
+ $.getJSON('/data', function(data) {
+ names= data.teamData['team-names'];
+ teams= keys(names);
+ $.each(teams, function(v,k) { reverseTeams[v]= k });
+ teamList= values(names).sort();
+ badges= data.badgeData;
+ badgeTypes= keys(badges);
+ renderData();
+// showBadgeData('http://www.nhl.com/team-25');
+ });
+}
+function renderData() {
+ $('#teams').empty();
+ $.each(teamList, function(i, v) {
+ $('#teams').append('<option value="'+reverseTeams[v]+'">'+v+'</option>');
+ })
+}
+function showBadgeData(teamID) {
+ var b= [];
+ $.each(badgeTypes, function(i,x) {
+// return $.grep(badges[x], function(v,k) { v.team == teamID });
+ return
+ });
+ b= $.grep(b, function(x,i) { x.team == teamID });
+ alert(b);
+}
@@ -0,0 +1,14 @@
+$.ready() {
+ getData();
+}
+
+function getData() {
+ $.getJSON('/data', function(data) {
+ getTeams();
+ renderData();
+ });
+}
+
+function renderData() {
+
+}

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,9 @@
+(ns nhl.server
+ (:use noir.core)
+ (:require [noir.server :as server]))
+
+(defpage "/" [] (slurp "html/index.html"))
+(defpage "/data" [] (slurp "files/results.json"))
+
+(defn -main [& m]
+ (server/start 8080))

0 comments on commit b73419c

Please sign in to comment.