Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The latest bespoke have errors wtih bespoke-fx demo #5

Open
developerworks opened this issue Aug 24, 2014 · 2 comments
Open

The latest bespoke have errors wtih bespoke-fx demo #5

developerworks opened this issue Aug 24, 2014 · 2 comments

Comments

@developerworks
Copy link

Uncaught TypeError: Cannot set property 'keys' of undefined bespoke-keys.js:9
2014-08-24 16:08:45.340
Uncaught TypeError: Cannot set property 'loop' of undefined bespoke-loop.js:11
2014-08-24 16:08:45.342
Uncaught TypeError: Cannot set property 'fx' of undefined bespoke-fx.js:769
2014-08-24 16:08:45.343
Uncaught TypeError: undefined is not a function 
@developerworks developerworks changed the title The latest bespoke have errors wtih bespoke-fx the chrome browser console. The latest bespoke have errors wtih bespoke-fx demo Aug 24, 2014
@ebow
Copy link
Owner

ebow commented Aug 27, 2014

I haven't looked at this project in quite a while. When I get some time I'll have a look. Thanks for reporting the error. Do let me know if you figure anything out.

Thanks

@razor-x
Copy link

razor-x commented Feb 23, 2016

Looks like this only uses globals to hook into bespoke, e.g.,

(function(bespoke, BespokeFx) {
  bespoke.plugins.fx = function(deck, options) {
     ...
  };

}(bespoke, BespokeFx));

But bespoke now officially uses modules, e.g., from the README:

Plugins are simply functions that are called when presentations are created. They are passed a deck instance which allows you to interact with the deck's state, bind events and modify its elements.

To be consistent with the suite of official Bespoke.js plugins, it is highly recommended that you implement your plugin as a function that takes configuration and returns a plugin function.

// Creating the plugin
var myPlugin = function() {
  return function() {
    deck.on('activate', function(e) {
      console.log('Activated slide ' + (e.index + 1) + ' of ' + deck.slides.length);
    });
  }
};

The plugin can now be provided in the plugins array when using the from(selector[, plugins]) method.

// Using the plugin
bespoke.from('#presentation', [
  myPlugin()
]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants