disable 3d links in ie, reorder script loading in index for readability (closes #95)
authorhakimel <hakim.elhattab@gmail.com>
Sat, 4 Aug 2012 02:41:31 +0000 (22:41 -0400)
committerhakimel <hakim.elhattab@gmail.com>
Sat, 4 Aug 2012 02:41:31 +0000 (22:41 -0400)
README.md
index.html
js/reveal.js

index 439bf04ab67136e00d2dad893e8b5dabb3ef06d1..0e6da25ce688fc9304adb58e42eb5ad93c42a615 100644 (file)
--- a/README.md
+++ b/README.md
@@ -204,6 +204,7 @@ You can change the appearance of the speaker notes by editing the file at `plugi
 - Added EOT font for IE support
 - IE8 support
 - Fixed bug where hovering 3D links in Chrome caused them to disappear
+- Disable 3D links in IE and more accurate CSS feature detection
 
 #### 1.4
 - Main ```#reveal container``` is now selected via a class instead of ID
index 3b90c9d764b8b8e3eb5f2c14f64f642ddd931be6..2899a10203ad2a10eb8ae3e06dea8b9fb2f8385a 100644 (file)
@@ -278,12 +278,42 @@ function linkify( selector ) {
                <script src="lib/js/head.min.js"></script>
 
                <script>
+                       head.ready( function() {
+
+                               // Fires when a slide with data-state=customevent is activated
+                               Reveal.addEventListener( 'customevent', function() {
+                                       console.log( '"customevent" has fired' );
+                               } );
+
+                               // Fires each time a new slide is activated
+                               Reveal.addEventListener( 'slidechanged', function( event ) {
+                                       // event.previousSlide, event.currentSlide, event.indexh, event.indexv
+                               } );
+
+                               // Full list of configuration options available here:
+                               // https://github.com/hakimel/reveal.js#configuration
+                               Reveal.initialize({
+                                       controls: true,
+                                       progress: true,
+                                       history: true,
+                                       
+                                       theme: Reveal.getQueryHash().theme || 'default', // default/neon/beige
+                                       transition: Reveal.getQueryHash().transition || 'default' // default/cube/page/concave/linear(2d)
+                               });
+
+                               // Load highlight.js for syntax highlighting of code samples
+                               head.js( 'lib/js/highlight.js', function() { 
+                                       hljs.initHighlightingOnLoad(); 
+                               } );
+
+                       } );
+
                        // Scripts that should be loaded before initializing
                        var scripts = [];
 
                        // If the browser doesn't support classList, load a polyfill
                        if( !document.body.classList ) {
-                               scripts.push( 'lib/js/classList.js' );
+                               head.js( 'lib/js/classList.js' );
                        }
 
                        // Load markdown parser if there are slides defined using markdown
@@ -302,35 +332,8 @@ function linkify( selector ) {
                        scripts.push( 'js/reveal.js' );
 
                        // Load the scripts and, when completed, initialize reveal.js
-                       head.js.apply( null, scripts.concat([function() {
-
-                               // Fires when a slide with data-state=customevent is activated
-                               Reveal.addEventListener( 'customevent', function() {
-                                       console.log( '"customevent" has fired' );
-                               } );
-
-                               // Fires each time a new slide is activated
-                               Reveal.addEventListener( 'slidechanged', function( event ) {
-                                       // event.previousSlide, event.currentSlide, event.indexh, event.indexv
-                               } );
-
-                               // Full list of configuration options available here:
-                               // https://github.com/hakimel/reveal.js#configuration
-                               Reveal.initialize({
-                                       controls: true,
-                                       progress: true,
-                                       history: true,
-                                       
-                                       theme: Reveal.getQueryHash().theme || 'default', // default/neon/beige
-                                       transition: Reveal.getQueryHash().transition || 'default' // default/cube/page/concave/linear(2d)
-                               });
-
-                       }]));
+                       head.js.apply( null, scripts );
                        
-                       // Load highlight.js for syntax highlighting of code samples
-                       head.js( 'lib/js/highlight.js', function() { 
-                               hljs.initHighlightingOnLoad(); 
-                       } );
                </script>
 
        </body>
index 482b8e3164dcacc4def81396d3e6ab92028640b5..23629c3034db6a80d6b63f8d05ba5322970f0f67 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * reveal.js 1.5 r10
+ * reveal.js 1.5 r11
  * http://lab.hakim.se/reveal-js
  * MIT licensed
  * 
@@ -63,17 +63,17 @@ var Reveal = (function(){
                dom = {},
 
                // Detect support for CSS 3D transforms
-               supports3DTransforms =  document.body.style['WebkitPerspective'] !== undefined || 
-                                       document.body.style['MozPerspective'] !== undefined ||
-                                       document.body.style['msPerspective'] !== undefined ||
-                                       document.body.style['OPerspective'] !== undefined ||
-                                       document.body.style['perspective'] !== undefined,
+               supports3DTransforms =  'WebkitPerspective' in document.body.style ||
+                                       'MozPerspective' in document.body.style ||
+                                       'msPerspective' in document.body.style ||
+                                       'OPerspective' in document.body.style ||
+                                       'perspective' in document.body.style,
         
-        supports2DTransforms =  document.body.style['WebkitTransform'] !== undefined || 
-                                       document.body.style['MozTransform'] !== undefined ||
-                                       document.body.style['msTransform'] !== undefined ||
-                                       document.body.style['OTransform'] !== undefined ||
-                                       document.body.style['transform'] !== undefined,
+        supports2DTransforms =  'WebkitTransform' in document.body.style ||
+                                       'MozTransform' in document.body.style ||
+                                       'msTransform' in document.body.style ||
+                                       'OTransform' in document.body.style ||
+                                       'transform' in document.body.style,
 
         // Detect support for elem.classList
         supportsClassList = !!document.body.classList;
@@ -444,7 +444,7 @@ var Reveal = (function(){
         * Wrap all links in 3D goodness.
         */
        function linkify() {
-        if( supports3DTransforms ) {
+               if( supports3DTransforms && !( 'msPerspective' in document.body.style ) ) {
                var nodes = document.querySelectorAll( '.reveal .slides section a:not(.image)' );
 
                for( var i = 0, len = nodes.length; i < len; i++ ) {