Browse Source

backwards compatibility, reveal.js 4.0 can now register ~3.9 plugins

Hakim El Hattab 5 years ago
parent
commit
faaa791019
5 changed files with 7 additions and 0 deletions
  1. 0 0
      dist/reveal.es5.js
  2. 0 0
      dist/reveal.es5.js.map
  3. 0 0
      dist/reveal.js
  4. 0 0
      dist/reveal.js.map
  5. 7 0
      js/controllers/plugins.js

File diff suppressed because it is too large
+ 0 - 0
dist/reveal.es5.js


File diff suppressed because it is too large
+ 0 - 0
dist/reveal.es5.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/reveal.js


File diff suppressed because it is too large
+ 0 - 0
dist/reveal.js.map


+ 7 - 0
js/controllers/plugins.js

@@ -177,6 +177,13 @@ export default class Plugins {
 	 */
 	registerPlugin( plugin ) {
 
+		// Backwards compatibility to make reveal.js ~3.9.0
+		// plugins work with reveal.js 4.0.0
+		if( arguments.length === 2 && typeof arguments[0] === 'string' ) {
+			plugin = arguments[1];
+			plugin.id = arguments[0];
+		}
+
 		let id = plugin.id;
 
 		if( typeof id !== 'string' ) {

Some files were not shown because too many files changed in this diff