Coder Social home page Coder Social logo

bespoke-convenient's Introduction

Build Status

bespoke-convenient

Convenient extension methods for building Bespoke.js plugins. This plugin is targeted towards plugin developers, not everyday bespoke users looking to make a nice presentation.

Download

Download the production version or the development version, or use a package manager.

Usage

First, include both bespoke.js and bespoke-convenient.js in your page.

Then, simply include the plugin when instantiating your presentation - and make sure to insert convenient: true before any other plugin that might use convenient.

bespoke.horizontal.from('article', {
  convenient: true
});

Since this is a plugin written for other bespoke plugin developers, have a look at the source files.

// bespoke.plugins.convenient.builder(pluginName)
// Convenient plugin level functions - create the variable cv in your plugin.
var cv = bespoke.plugins.convenient.builder("myplugin");

// cv.generateObject(message)
// An error object with a prefixed error message.
throw cv.generateErrorObject("Look, sometimes bad things happen, and there is nothing you can do about it, so why worry? -- Simba, The Lion King");

// cv.fire(deck, eventName, innerEvent, slide, customData)
// Fire an event on the deck, with plugin name etcetera filled in.
// innerEvent: either a DOM/browser event or a bespoke event
// slide: either the index of the affected slide, or the slide object itself
var success = cv.fire(deck, "myevent", e, 123, { someExtraPluginData: "data value", somePluginStatus: 999 });

// cv.copyArray(array)
// Mostly useful for function arguments
var args = cv.copyArray(arguments);

// cv.log([object], ...)
// Log a prefixed log message, by default to the developer console
cv.log("Something", "happened", 1974);

// deck.createEventData(eventNamespace, eventName, innerEvent, slide, eventData)
// Creates the event same object used by cv.fire(...).
var eventData = deck.createEventData();

Package managers

Bower

$ bower install bespoke-convenient

npm

$ npm install bespoke-convenient

The bespoke-convenient npm package is designed for use with browserify, e.g.

require('bespoke');
require('bespoke-convenient');

TODO

  • Move more shared functionality into this plugin.

Credits

Mark Dalgleish for bespoke.js and related tools. This plugin was built with generator-bespokeplugin.

AJ Batac, ajbatac on flickr, for his photo E-Mart Convenience Store (CC BY 2.0).

License

Copyright (c) 2013, Joel Purra All rights reserved.

When using bespoke-convenient, comply to the MIT license. Please see the LICENSE file for details, and the MIT License on Wikipedia.

Bitdeli Badge

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.