mirror of
https://github.com/Erreur32/html5demos.git
synced 2024-09-30 09:41:29 +02:00
152 lines
3.0 KiB
HTML
152 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
<title>HTML5 Demo: Web Database</title>
|
|
<style>
|
|
body {
|
|
font: normal 16px/20px Helvetica, sans-serif;
|
|
background: rgb(237, 237, 236);
|
|
margin: 0;
|
|
margin-top: 40px;
|
|
padding: 0;
|
|
}
|
|
|
|
section, header, footer {
|
|
display: block;
|
|
}
|
|
|
|
#wrapper {
|
|
width: 600px;
|
|
margin: 0 auto;
|
|
background: #fff url(images/shade.jpg) repeat-x center bottom;
|
|
-moz-border-radius: 10px;
|
|
-webkit-border-radius: 10px;
|
|
border-top: 1px solid #fff;
|
|
padding-bottom: 76px;
|
|
}
|
|
|
|
h1 {
|
|
padding-top: 10px;
|
|
}
|
|
|
|
h2 {
|
|
font-size: 100%;
|
|
font-style: italic;
|
|
}
|
|
|
|
#wrapper > * > * {
|
|
margin: 20px;
|
|
}
|
|
|
|
input {
|
|
font-size: 16px;
|
|
padding: 3px;
|
|
margin-left: 5px;
|
|
}
|
|
|
|
footer > * {
|
|
color: #999;
|
|
}
|
|
|
|
article div {
|
|
margin: 10px 0;
|
|
}
|
|
|
|
#status {
|
|
padding: 5px;
|
|
color: #fff;
|
|
background: #ccc;
|
|
}
|
|
|
|
#status.error {
|
|
background: #c00;
|
|
}
|
|
|
|
#status.ok {
|
|
background: #0c0;
|
|
}
|
|
|
|
label {
|
|
float: left;
|
|
display: block;
|
|
width: 125px;
|
|
line-height: 32px;
|
|
}
|
|
|
|
#tweets {
|
|
max-height: 300px;
|
|
overflow: auto;
|
|
border: 3px solid #ccc;
|
|
}
|
|
|
|
#tweets ul {
|
|
margin: 0;
|
|
/* list-style: none;*/
|
|
padding: 5px;
|
|
}
|
|
|
|
#tweets li {
|
|
padding-bottom: 5px;
|
|
padding-top: 5px;
|
|
border-top: 1px solid #ccc;
|
|
}
|
|
|
|
#tweets li:first-child {
|
|
border-top: 0;
|
|
}
|
|
</style>
|
|
<script src="h5utils.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="wrapper">
|
|
<article>
|
|
<section>
|
|
<header>
|
|
<h1>Web Database</h1>
|
|
</header>
|
|
<p>We're using the Web Database API to store <a href="http://twitter.com/rem">my tweets</a>, so there's no Twitter API hit on load.</p>
|
|
<p>In addition, I'm using the <code>since_id</code> when we make new requests, so I shouldn't be doubling up on tweets.</p>
|
|
<p>Status: <span id="status" class="ok">ready</span></p>
|
|
</section>
|
|
<section id="tweets">
|
|
<ol>
|
|
<li>None loaded up yet :-(</li>
|
|
</ol>
|
|
</section>
|
|
<div>
|
|
<input type="button" id="clear" value="Reset database" />
|
|
<input type="button" id="timeline" value="Timeline" />
|
|
<input type="button" id="mentions" value="Mentions" />
|
|
</div>
|
|
</article>
|
|
<footer><a href="/">HTML5 demo</a></footer>
|
|
</div>
|
|
<script src="tweets.js"></script>
|
|
<script>
|
|
// all contained in http://html5demos.com/tweets.js
|
|
html5demoTweets.init();
|
|
|
|
addEvent(document.getElementById('clear'), 'click', function () {
|
|
html5demoTweets.reset();
|
|
});
|
|
|
|
addEvent(document.getElementById('timeline'), 'click', function () {
|
|
html5demoTweets.timeline();
|
|
});
|
|
|
|
addEvent(document.getElementById('mentions'), 'click', function () {
|
|
html5demoTweets.mentions();
|
|
});
|
|
</script>
|
|
<script>
|
|
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
|
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
|
</script>
|
|
<script>
|
|
try {
|
|
var pageTracker = _gat._getTracker("UA-1656750-18");
|
|
pageTracker._trackPageview();
|
|
} catch(err) {}</script>
|
|
</body>
|
|
</html> |