diff --git a/.htaccess b/.htaccess index 3407952..1db4c62 100644 --- a/.htaccess +++ b/.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 diff --git a/css/html5demos.css b/css/html5demos.css index f516e47..f7ed155 100644 --- a/css/html5demos.css +++ b/css/html5demos.css @@ -254,4 +254,4 @@ body.view-source #view-source { border: 1px solid #75784C; background: #FF7; color: #333521; -} \ No newline at end of file +} diff --git a/demos/history.html b/demos/history.html index 1911a6b..306d08d 100644 --- a/demos/history.html +++ b/demos/history.html @@ -60,7 +60,7 @@ function reportData(data) { }); } -if (typeof history.pushState === 'undefined' || !('onpopstate' in window)) { +if (typeof history.pushState === 'undefined' || !isEventSupported('popstate')) { state.className = 'fail'; } else { state.className = 'success'; diff --git a/includes/footer.php b/includes/footer.php index 84214b3..bf466bc 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -1,4 +1,3 @@ - Fork me on GitHub diff --git a/js/h5utils.js b/js/h5utils.js index c1d20a6..b78a781 100644 --- a/js/h5utils.js +++ b/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) {