Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Pointed to assets

  • Loading branch information...
commit ec00afdfa818f1a6c98594d367ed5661d8cf1d5d 1 parent 34a472d
@rauchg rauchg authored
Showing with 7 additions and 76 deletions.
  1. +2 −8 index.jade
  2. +3 −40 layout.jade
  3. +2 −28 stats.jade
View
10 index.jade
@@ -1,11 +1,5 @@
-script(src="/socket.io/socket.io.js")
-script
- window.onload = function () {
- io.connect('/main')
- .on('total', function (total) {
- document.getElementById('count').innerHTML = total;
- })
- }
+link(href="/css/index.css", rel="stylesheet")
+script(src="/js/index.js")
p Welcome to the LearnBoost redirection service!
p <b id="count">#{count}</b> urls generated so far!
View
43 layout.jade
@@ -2,6 +2,9 @@ doctype 5
html
head
title Shorty
+ script(src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js")
+ script(src="/socket.io/socket.io.js")
+ script(src="/js/animation.js")
:stylus
body
padding 20px 100px
@@ -14,46 +17,6 @@ html
padding-right 30px
h2
color #444
- .creation-stats, .visited-stats
- width 460px
- height 500px
- float left
- margin-right 20px
- padding-right 20px
- overflow auto
- h3
- color #3B88D8
- margin-top 0
- .creation-stats
- border-right 1px solid #ccc
- .stat
- padding 5px 10px 7px
- background #fafafa
- overflow hidden
- div
- font-size 11px
- display inline-block
- a
- color #444
- text-decoration none
- &:hover
- text-decoration underline
- .type
- font-weight bold
- text-transform uppercase
- width 100px
- .date
- color #999
- width 80px
- .short
- width 40px
- .url
- width 220px
- overflow hidden
- height 15px
- line-height 15px
- &:nth-child(odd)
- background #eee
body
h1: span Shorty
#wrap!= body
View
30 stats.jade
@@ -1,32 +1,6 @@
-
-script(src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js")
-script(src="/socket.io/socket.io.js")
+link(href="/css/stats.css", rel="stylesheet")
script(src="/js/date.js")
-script
- window.onload = function () {
- function created (short, long, d, manual) {
- var p = $('.creation-stats .stats');
- var t = template('url created', { short: short, url: long, date: d }).prependTo(p);
- }
- function visited (short, long, d, manual) {
- var p = $('.visited-stats .stats');
- var t = template('url visited', { short: short, url: long, date: d }).prependTo(p);
- }
-
- io.connect('/stats')
- .on('url created', created)
- .on('url visited', visited)
-
- for (var i = 0, l = transactions.length; i < l; i++) {
- var t = transactions[i];
- if ('url created' == t.type) {
- created(t.short, t.parsed, t.date);
- } else {
- visited(t.short, t.parsed, t.date);
- }
- }
- }
-script
+script(src="/js/stats.js")
h2 Real-time stats
Please sign in to comment.
Something went wrong with that request. Please try again.