From 9a657e26768a3724e6edf9e5fbdd72a4e54da8f4 Mon Sep 17 00:00:00 2001 From: hakimel Date: Fri, 3 Aug 2012 21:49:29 -0400 Subject: [PATCH] ie8 support (closes #96) --- README.md | 1 + css/main.css | 15 +++++++++------ index.html | 4 ++++ js/reveal.js | 10 +++++++--- lib/js/data-markdown.js | 36 +++++++++++++++++++----------------- lib/js/html5shiv.js | 7 +++++++ 6 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 lib/js/html5shiv.js diff --git a/README.md b/README.md index 5544a1a6..47bfa2f5 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ You can change the appearance of the speaker notes by editing the file at `plugi - Added support for slides written using markdown - Added helped method ```Reveal.getQueryHash()``` - Added EOT font for IE support +- IE8 support #### 1.4 - Main ```#reveal container``` is now selected via a class instead of ID diff --git a/css/main.css b/css/main.css index f2544fa2..9239b69f 100644 --- a/css/main.css +++ b/css/main.css @@ -44,8 +44,8 @@ body { letter-spacing: -0.02em; color: #eee; - background: #1c1e20; - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiM1NTVhNWYiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjMWMxZTIwIiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogIDxyZWN0IHg9Ii01MCIgeT0iLTUwIiB3aWR0aD0iMTAxIiBoZWlnaHQ9IjEwMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiM1NTVhNWYiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjMWMxZTIwIiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogIDxyZWN0IHg9Ii01MCIgeT0iLTUwIiB3aWR0aD0iMTAxIiBoZWlnaHQ9IjEwMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); + background-color: #2b2b2b; background: -moz-radial-gradient(center, ellipse cover, rgba(85,90,95,1) 0%, rgba(28,30,32,1) 100%); background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(85,90,95,1)), color-stop(100%,rgba(28,30,32,1))); background: -webkit-radial-gradient(center, ellipse cover, rgba(85,90,95,1) 0%,rgba(28,30,32,1) 100%); @@ -908,14 +908,17 @@ body { } .no-transforms .slides section { + display: block!important; + opacity: 1!important; + position: relative!important; + height: auto; + min-height: auto; + margin-bottom: 100px; + -webkit-transform: none; -moz-transform: none; -ms-transform: none; transform: none; - - display: block!important; - opacity: 1!important; - position: relative!important; } diff --git a/index.html b/index.html index 8d9c8444..3b90c9d7 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,10 @@ + + diff --git a/js/reveal.js b/js/reveal.js index 6da654dd..c2f1a57c 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1,5 +1,5 @@ /*! - * reveal.js 1.5 r8 + * reveal.js 1.5 r9 * http://lab.hakim.se/reveal-js * MIT licensed * @@ -1028,10 +1028,14 @@ var Reveal = (function(){ // Forward event binding to the reveal DOM element addEventListener: function( type, listener, useCapture ) { - ( dom.wrapper || document.querySelector( '.reveal' ) ).addEventListener( type, listener, useCapture ); + if( 'addEventListener' in window ) { + ( dom.wrapper || document.querySelector( '.reveal' ) ).addEventListener( type, listener, useCapture ); + } }, removeEventListener: function( type, listener, useCapture ) { - ( dom.wrapper || document.querySelector( '.reveal' ) ).removeEventListener( type, listener, useCapture ); + if( 'addEventListener' in window ) { + ( dom.wrapper || document.querySelector( '.reveal' ) ).removeEventListener( type, listener, useCapture ); + } } }; diff --git a/lib/js/data-markdown.js b/lib/js/data-markdown.js index 89724753..b10592ae 100644 --- a/lib/js/data-markdown.js +++ b/lib/js/data-markdown.js @@ -2,24 +2,26 @@ // Modified by Hakim to handle markdown indented with tabs (function(){ - [].forEach.call( document.querySelectorAll('[data-markdown]'), function fn(elem){ - - // strip leading whitespace so it isn't evaluated as code - var text = elem.innerHTML; - - var leadingWs = text.match(/^\n?(\s*)/)[1].length, - leadingTabs = text.match(/^\n?(\t*)/)[1].length; + var slides = document.querySelectorAll('[data-markdown]'); - if( leadingTabs > 0 ) { - text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' ); + for( var i = 0, len = slides.length; i < len; i++ ) { + var elem = slides[i]; + + // strip leading whitespace so it isn't evaluated as code + var text = elem.innerHTML; + + var leadingWs = text.match(/^\n?(\s*)/)[1].length, + leadingTabs = text.match(/^\n?(\t*)/)[1].length; + + if( leadingTabs > 0 ) { + text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' ); + } + else if( leadingWs > 1 ) { + text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' ); + } + + // here, have sum HTML + elem.innerHTML = (new Showdown.converter()).makeHtml(text); } - else if( leadingWs > 1 ) { - text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' ); - } - - // here, have sum HTML - elem.innerHTML = (new Showdown.converter()).makeHtml(text); - - }); })(); \ No newline at end of file diff --git a/lib/js/html5shiv.js b/lib/js/html5shiv.js new file mode 100644 index 00000000..50649b9b --- /dev/null +++ b/lib/js/html5shiv.js @@ -0,0 +1,7 @@ +document.createElement('header'); +document.createElement('nav'); +document.createElement('section'); +document.createElement('article'); +document.createElement('aside'); +document.createElement('footer'); +document.createElement('hgroup'); \ No newline at end of file