classList polyfill included for ie9
authorHakim El Hattab <hakim.elhattab@gmail.com>
Sat, 24 Mar 2012 16:48:16 +0000 (12:48 -0400)
committerHakim El Hattab <hakim.elhattab@gmail.com>
Sat, 24 Mar 2012 16:48:16 +0000 (12:48 -0400)
README.md
index.html
lib/classList.js [new file with mode: 0644]

index 93bb6a690d9a742be5897cd822801e39df59623f..647d07c4d3a67375c067834aa1a8e7fe209b0263 100644 (file)
--- a/README.md
+++ b/README.md
@@ -64,6 +64,8 @@ Reveal.initialize({
 - Config option for disabling updates to URL, defaults to true
 - Anchors with image children no longer rotate in 3D on hover
 - Support for mouse wheel navigation ([naugtur](https://github.com/naugtur))
+- Delayed updates to URL hash to work around a bug in Chrome
+- Included a classList polyfill for IE9
 
 #### 1.1
 
index 1518eb956224bbab89b46f5a09be13a5f2b56425..9db7802ee333b465d00f2cc2f08404a5b290404f 100644 (file)
                </div>
                
                <script src="js/reveal.js"></script>
+
+               <!-- Optional libraries for code syntax highlighting and classList support in IE9 -->
                <script src="lib/highlight.js"></script>
+               <script src="lib/classList.js"></script>
+
                <script>
                        // Parse the query string into a key/value object
                        var query = {};
diff --git a/lib/classList.js b/lib/classList.js
new file mode 100644 (file)
index 0000000..1bb626d
--- /dev/null
@@ -0,0 +1,3 @@
+// classList polyfill from https://github.com/remy/polyfills/blob/master/classList.js
+(function(){function c(a){this._element=a;if(a.className!=this.classCache){this._classCache=a.className;var a=this._classCache.split(" "),b;for(b=0;b<a.length;b++)e.call(this,a[b])}}if(!("undefined"===typeof Element||Element.prototype.hasOwnProperty("classList"))){var d=[].indexOf,f=[].slice,e=[].push,g=[].splice,h=[].join;c.prototype={add:function(a){e.call(this,a);this._element.className=f.call(this,0).join(" ")},contains:function(a){return-1!==d.call(this,a)},item:function(a){return this[a]||null},
+remove:function(a){a=d.call(this,a);g.call(this,a,1);this._element.className=f.call(this,0).join(" ")},toString:function(){return h.call(this," ")},toggle:function(a){-1===d.call(this,a)?this.add(a):this.remove(a)}};window.DOMTokenList=c;Element.prototype.__defineGetter__("classList",function(){return new c(this)})}})();
\ No newline at end of file