Permalink
Browse files

Merge remote-tracking branch 'emackey/master'

  • Loading branch information...
2 parents ea3c525 + 3b1ef79 commit a489e51705fb4e82da324a29583122853930fc60 @mrdoob committed Jan 11, 2012
Showing with 31 additions and 12 deletions.
  1. +4 −4 server/assets/gallery.html
  2. +8 −2 server/assets/js/helpers.js
  3. +19 −6 static/index.html
View
8 server/assets/gallery.html
@@ -11,7 +11,7 @@
margin: 3em 4em;
color: #888;
}
- a:not(h1){
+ a{
color: #aaa;
text-decoration: none;
border-bottom: 1px solid #444;
@@ -21,9 +21,9 @@
border-bottom: 1px solid #009DE9;
}
- h1, h2{
+ h1, h1 a, h2{
color: #009DE9;
- font: 28px Tahoma, Arial, Helvetica, sans-serif;;
+ font: 28px Tahoma, Arial, Helvetica, sans-serif;
font-weight: normal;
margin-bottom: 7px;
}
@@ -73,7 +73,7 @@
<body>
<div id="header">
-<a href="http://glsl.heroku.com/"><h1>GLSL Sandbox</h1></a>
+<h1><a href="http://glsl.heroku.com/">GLSL Sandbox</a></h1>
<a href="/e">Create new effect!</a> &nbsp;&nbsp;/&nbsp;
<a href="https://github.com/mrdoob/glsl-sandbox">github</a> &nbsp;&nbsp;/&nbsp;
gallery by <a href="http://twitter.com/thevaw">@thevaw</a> and <a href="http://twitter.com/feiss">@feiss</a> &nbsp;/&nbsp; editor by <a href="http://twitter.com/mrdoob">@mrdoob</a>, <a href="http://twitter.com/mrkishi">@mrkishi</a>, <a href="http://twitter.com/p01">@p01</a>, <a href="http://twitter.com/alteredq">@alteredq</a>, <a href="http://twitter.com/kusmabite">@kusmabite</a> and <a href="http://twitter.com/emackey">@emackey</a>
View
10 server/assets/js/helpers.js
@@ -11,8 +11,14 @@ function initialize_compressor(){
function initialize_helper() {
window.onhashchange = function() { load_url_code(); };
- if ( !localStorage.getItem('glslsandbox_user') )
- localStorage.setItem('glslsandbox_user', generate_user_id());
+ if (typeof localStorage !== 'undefined') {
+ if ( !localStorage.getItem('glslsandbox_user') ) {
+ localStorage.setItem('glslsandbox_user', generate_user_id());
+ }
+ } else {
+ // This fallback shouldn't be used by any browsers that are able to commit code.
+ localStorage = { getItem: function(x) { return 'invalid_user'; } };
+ }
}
function generate_user_id() {
View
25 static/index.html
@@ -125,19 +125,27 @@
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.oRequestAnimationFrame ||
- window.msRequestAnimationFrame ||
- function ( callback, element ) {
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function ( callback, element ) {
- window.setTimeout( callback, 1000 / 60 );
+ window.setTimeout( callback, 1000 / 60 );
- };
+ };
} )();
}
+ // Get older browsers safely through init code, so users can read the
+ // message about how to download newer browsers.
+ if (!Date.now) {
+ Date.now = function() {
+ return +new Date();
+ };
+ }
+
// Greetings to Iq/RGBA! ;)
var quality = 2, quality_levels = [ 0.5, 1, 2, 4, 8 ];
@@ -151,6 +159,11 @@
function init() {
+ if (!document.addEventListener) {
+ document.location = 'http://get.webgl.org/';
+ return;
+ }
+
var effect = document.createElement( 'div' );
document.body.appendChild( effect );

0 comments on commit a489e51

Please sign in to comment.