forked from jfro/butteredurls
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better stats & misc changes from mattwiebe
Closes #9
- Loading branch information
Showing
34 changed files
with
431 additions
and
80 deletions.
There are no files selected for viewing
Empty file.
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
Empty file.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,144 @@ | |||
body { | |||
font: 16px/1.4 'Helvetica Neue', Arial, Helvetica, sans-serif; | |||
margin: 32px 24px; | |||
padding: 0; | |||
color: #333; | |||
background-color: #eee; | |||
} | |||
#wrap { | |||
text-align:center; | |||
} | |||
#stats #wrap { | |||
margin:0 auto; | |||
min-width:600px; | |||
max-width:800px; | |||
text-align:left; | |||
} | |||
p { | |||
margin:1em 0; | |||
} | |||
a,button { | |||
display: inline-block; | |||
border: none; | |||
font-family: inherit; | |||
font-weight: inherit; | |||
font-size: 10px; | |||
line-height: 16px; | |||
height: 16px; | |||
padding: 0 8px; | |||
-webkit-border-radius: 8px; | |||
-moz-border-radius: 8px; | |||
border-radius: 8px; | |||
cursor: pointer; | |||
text-align: left; | |||
text-decoration: none; | |||
text-transform: uppercase; | |||
letter-spacing: 1px; | |||
vertical-align: middle; | |||
color: #fff; | |||
background-color: #333; | |||
} | |||
input { | |||
font-family: inherit; | |||
font-size: inherit; | |||
-webkit-border-radius: 2px; | |||
-moz-border-radius: 2px; | |||
border-radius: 2px; | |||
border: none; | |||
padding: 4px; | |||
} | |||
#add span { | |||
display: block; | |||
margin: 16px 0 0; | |||
font-size: 9px; | |||
color: #999; | |||
} | |||
span code { | |||
font-size: 10px; | |||
} | |||
#stats #wrap > p:first-child a { | |||
margin-right:9px; | |||
} | |||
#stats #wrap > p:first-child { | |||
margin:1em 0 2em; | |||
} | |||
#tables { | |||
margin:3px 0 0; | |||
} | |||
table { | |||
-moz-border-radius:5px; | |||
-webkit-border-radius:5px; | |||
border-radius:5px; | |||
border:1px solid #444; | |||
font-size:14px; | |||
width:100%; | |||
} | |||
th:first-child { | |||
-moz-border-radius:3px 0 0 0; | |||
-webkit-border-top-left-radius:3px; | |||
border-radius:3px 0 0 0; | |||
} | |||
th:last-child { | |||
-moz-border-radius:0 3px 0 0; | |||
-webkit-border-top-right-radius:3px; | |||
border-radius:0 3px 0 0; | |||
} | |||
|
|||
th,td { | |||
padding:3px 9px; | |||
vertical-align:top; | |||
} | |||
td span { | |||
opacity:.6; | |||
} | |||
tr:hover td span { | |||
opacity:.9; | |||
} | |||
th { | |||
text-align:left; | |||
text-transform:uppercase; | |||
letter-spacing:1px; | |||
background-color:#444; | |||
color:#fff; | |||
font-weight:normal; | |||
padding-bottom:6px; | |||
} | |||
|
|||
tr:nth-child(2n+2) { | |||
background-color:#ddd; | |||
} | |||
|
|||
tr:hover { | |||
background-color:#ccc; | |||
color:#000; | |||
} | |||
td:last-child { | |||
text-align:right; | |||
} | |||
h2 { | |||
font-size:21px; | |||
line-height:1; | |||
margin-top:2em; | |||
} | |||
.clicky h2 { | |||
display:inline-block; | |||
margin:0 .5em .5em 0; | |||
cursor:pointer; | |||
} | |||
h2.active { | |||
border-bottom:3px solid #444; | |||
position:relative; | |||
} | |||
h2.active:after { | |||
content:" "; | |||
display:block; | |||
border:5px solid transparent; | |||
border-top-color:#444; | |||
position:absolute; | |||
bottom:-13px; | |||
left:45%; | |||
} | |||
|
|||
|
|||
|
|||
|
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,68 @@ | |||
jQuery(document).ready(function($) { | |||
|
|||
var activeClass = "active", | |||
transition = 00; | |||
|
|||
function init() { | |||
var div = $("<div id='tables'></div>"); | |||
div.appendTo("#wrap"); | |||
|
|||
$("h2").each(function(index) { | |||
var self = $(this), | |||
table = self.next("table"), | |||
id = table.attr("id"); | |||
|
|||
self.attr('data-target', id).click(showTable);; | |||
table.attr({id: id}).hide().appendTo(div); | |||
}); | |||
|
|||
$(document).keydown(function(e){ | |||
if ( e.keyCode == 37 || e.keyCode == 39) { | |||
var active = $("h2." + activeClass), | |||
left = (e.keyCode == 37), | |||
dir = ( left ) ? 'prev' : 'next', | |||
end = ( left ) ? 'last' : 'first', | |||
target = active[dir]("h2"); | |||
if ( ! target.size() ) { | |||
target = $("h2:" + end); | |||
} | |||
target.click(); | |||
return false; | |||
} | |||
}); | |||
|
|||
$("body").addClass("clicky"); | |||
|
|||
$(window).bind( 'hashchange', goToHash).trigger('hashchange'); | |||
} | |||
if ( $("body").attr("id") === "stats" ) { | |||
init(); | |||
} | |||
|
|||
function goToHash() { | |||
var hash = location.hash, | |||
table = $(hash), | |||
id = hash.replace('#', ''), | |||
h2 = $("h2[data-target="+id+"]"); | |||
|
|||
// if nothing, default to clicking on first h2 | |||
if ( ! table.size() ) { | |||
$("h2:first").click(); | |||
return false; | |||
} | |||
|
|||
$("#tables table").hide(); | |||
table.fadeIn(transition); | |||
|
|||
$("h2").removeClass(activeClass); | |||
h2.addClass(activeClass); | |||
} | |||
|
|||
function showTable(event) { | |||
var self = $(this), | |||
hash = "#" + self.attr("data-target"); | |||
$.bbq.pushState(hash); | |||
} | |||
|
|||
|
|||
}); |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
<?php | |||
$offset = 60 * 60 * 24 * 30; // 30 days of caching | |||
$expiry = gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; | |||
|
|||
header( 'Content-Type: text/javascript' ); | |||
header( 'Cache-Control: public, must-revalidate' ); | |||
header( 'Expires: ' . $expiry ); | |||
header( 'Content-Encoding: gzip' ); | |||
|
|||
ob_start('ob_gzhandler'); | |||
include( 'jquery-1.5.min.js' ); | |||
include( 'jquery-bbq.min.js' ); | |||
ob_end_flush(); |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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
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
Empty file.
Empty file.
Oops, something went wrong.