From 4c8938029db648d58b0e1e65e5fba70a8ff1d1ee Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sun, 11 Nov 2012 19:54:26 -0500 Subject: [PATCH 1/2] note about #226 in readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2d22fb4..6c07a33 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,8 @@ Reveal.addEventListener( 'ready', function( event ) { An 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes. +Some libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback. + ```javascript Reveal.addEventListener( 'slidechanged', function( event ) { // event.previousSlide, event.currentSlide, event.indexh, event.indexv From 5354b788691f6c466325937794764e14abb421f9 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 12 Nov 2012 16:47:40 +0100 Subject: [PATCH 2/2] Fix callback calling when using from a parent directory Authors might want to use a shared reveal.js installation for all their presentations such as: $ ls -1 -F 20120105-how-to-use-git.html 20121101-wikimedia-scaling.html reveal.js/ $ In this case, the plugin callbacks will not be called at all. When using head.js, the callback is marked as depending upon the loading of a Javscript filename. The regex used to find out the filename is applied to the full path which in the above case would be something like: reveal.js/plugin/highlight/highlight.js The regex will thus give out 'reveal.js' as a file depency instead of the expected 'highlight.js' The fix is quiet easy: simply make sure that we are looking for a file that actually ends with '.js' instead of simply containing '.js' by adding a $. --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 1c4f235..be1292d 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -232,7 +232,7 @@ var Reveal = (function(){ // Extension may contain callback functions if( typeof s.callback === 'function' ) { - head.ready( s.src.match( /([\w\d_\-]*)\.?js|[^\\\/]*$/i )[0], s.callback ); + head.ready( s.src.match( /([\w\d_\-]*)\.?js$|[^\\\/]*$/i )[0], s.callback ); } } }