Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing history support test for Firefox, since it doesn't support one…

…vent in object
  • Loading branch information...
commit 237b024023a321d046f5e5263c0c12b0070fa355 1 parent 9a3d97b
@remy authored
View
4 .htaccess
@@ -9,6 +9,10 @@ RewriteCond %{HTTP_HOST} ^www\.html5demo\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^html5demo\.com$ [NC]
RewriteRule ^(.*)$ http://html5demos.com/$1 [R=301,L]
+# RewriteCond %{HTTP_REFERER} ^$ [OR]
+# RewriteCond %{HTTP_REFERER} !^http://(www\.|offline\.)?html5demos.com/.*$
+# RewriteRule \.(gif|jpg|swf|flv|png|ogv|mp4|webm|js)$ [R=404,L]
+
# if the file or directory does exist
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
View
2  css/html5demos.css
@@ -254,4 +254,4 @@ body.view-source #view-source {
border: 1px solid #75784C;
background: #FF7;
color: #333521;
-}
View
2  demos/history.html
@@ -60,7 +60,7 @@
});
}
-if (typeof history.pushState === 'undefined' || !('onpopstate' in window)) {
+if (typeof history.pushState === 'undefined' || !isEventSupported('popstate')) {
state.className = 'fail';
} else {
state.className = 'success';
View
1  includes/footer.php
@@ -1,4 +1,3 @@
-
<footer><a href="/">HTML5 demos</a>/<a id="built" href="http://twitter.com/rem">@rem built this</a>/<a href="#view-source">view source</a></footer>
</section>
<a href="http://github.com/remy/html5demos"><img style="position: absolute; top: 0; left: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png" alt="Fork me on GitHub" /></a>
View
9 js/h5utils.js
@@ -1,6 +1,15 @@
// For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/
/*@cc_on'abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video'.replace(/\w+/g,function(n){document.createElement(n)})@*/
+function isEventSupported(event, element) {
+ element = element || window;
+ var ok = 'on'+event in element;
+ if (ok) return ok;
+ element.setAttribute('on' + event, '');
+ ok = typeof(element['on'+event] == "function");
+ element.removeAttribute('on' + event);
+ return ok;
+}
var addEvent = (function () {
if (document.addEventListener) {
Please sign in to comment.
Something went wrong with that request. Please try again.