Permalink
Browse files

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

…vent in object
  • Loading branch information...
1 parent 9a3d97b commit 237b024023a321d046f5e5263c0c12b0070fa355 @remy committed Aug 23, 2010
Showing with 15 additions and 3 deletions.
  1. +4 −0 .htaccess
  2. +1 −1 css/html5demos.css
  3. +1 −1 demos/history.html
  4. +0 −1 includes/footer.php
  5. +9 −0 js/h5utils.js
View
@@ -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
@@ -254,4 +254,4 @@ body.view-source #view-source {
border: 1px solid #75784C;
background: #FF7;
color: #333521;
-}
+}
View
@@ -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,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
@@ -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) {

0 comments on commit 237b024

Please sign in to comment.