From 78f2ce657c9e04182cee8ad0db23b5f92dabc2c6 Mon Sep 17 00:00:00 2001 From: Bartek Szopka Date: Sun, 11 Mar 2012 09:10:36 +0000 Subject: [PATCH 1/2] "fallback mode fix" --- js/impress.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/js/impress.js b/js/impress.js index 53b6b73..5896167 100644 --- a/js/impress.js +++ b/js/impress.js @@ -124,7 +124,6 @@ if (!impressSupported) { // we can't be sure that `classList` is supported body.className += " impress-not-supported "; - return; } else { body.classList.remove("impress-not-supported"); body.classList.add("impress-supported"); @@ -144,7 +143,11 @@ }; var impress = window.impress = function ( rootId ) { - + + if (!impressSupported) { + return null; + } + rootId = rootId || "impress"; // if already initialized just return the API @@ -399,6 +402,9 @@ }); }; + + impress.supported = impressSupported; + })(document, window); // EVENTS @@ -408,6 +414,11 @@ var impress = window.impress; + // if impress is not supported don't add any handlers + if (!impress.supported) { + return; + } + // throttling function calls, by Remy Sharp // http://remysharp.com/2010/07/21/throttling-function-calls/ var throttle = function (fn, delay) { From b59a4bf4d7cca990f913a18d4aedaf8b3598577e Mon Sep 17 00:00:00 2001 From: Bartek Szopka Date: Sun, 11 Mar 2012 09:15:35 +0000 Subject: [PATCH 2/2] "bugfix release 0.4.1" --- README.md | 10 ++++++++++ js/impress.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f848dd..2345597 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,16 @@ It's an (un)fortunate coincidence that a Open/LibreOffice presentation tool is c VERSION HISTORY ----------------- +### 0.4.1 ([browse](http://github.com/bartaz/impress.js/tree/0.4.1), [zip](http://github.com/bartaz/impress.js/zipball/0.4.1), [tar](http://github.com/bartaz/impress.js/tarball/0.4.1)) + +#### BUGFIX RELEASE + +Changes is version 0.4 introduced a bug causing JavaScript errors being thrown all over the place in fallback mode. +This release fixes this issue. + +It also adds a flag `impress.supported` that can be used in JavaScript to check if impress.js is supported in the browser. + + ### 0.4 ([browse](http://github.com/bartaz/impress.js/tree/0.4), [zip](http://github.com/bartaz/impress.js/zipball/0.4), [tar](http://github.com/bartaz/impress.js/tarball/0.4)) #### CHANGELOG diff --git a/js/impress.js b/js/impress.js index 5896167..e10c201 100644 --- a/js/impress.js +++ b/js/impress.js @@ -11,7 +11,7 @@ * * ------------------------------------------------ * author: Bartek Szopka - * version: 0.4 + * version: 0.4.1 * url: http://bartaz.github.com/impress.js/ * source: http://github.com/bartaz/impress.js/ */