Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Upgraded Bespoke.js to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed Dec 23, 2014
1 parent 6c6bf9e commit 133d7af
Show file tree
Hide file tree
Showing 17 changed files with 360 additions and 257 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,2 +1,4 @@
node_modules
bower_components
lib-instrumented
test/coverage
1 change: 1 addition & 0 deletions .jshintrc
@@ -1,5 +1,6 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
Expand Down
7 changes: 5 additions & 2 deletions .travis.yml
@@ -1,4 +1,7 @@
language: node_js

node_js:
- '0.8'
- '0.10'
- "0.10"

after_script:
- npm run coveralls
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
@@ -1,27 +1,27 @@
# Contributing

## Important notes
Please don't edit files in the `dist` subdirectory as they are generated via [Grunt](http://gruntjs.com/). You'll find source code in the `src` subdirectory!
Please don't edit files in the `dist` subdirectory as they are generated via [gulp](https://github.com/gulpjs/gulp). You'll find source code in the `lib` subdirectory!

### Code style
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.**

## Modifying the code
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.

Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started with Grunt guide](http://gruntjs.com/getting-started).
Test that gulp is installed globally by running `gulp --version` at the command-line. If gulp isn't installed globally, run `npm install -g gulp` to install the latest version.

1. Fork and clone the repo.
1. Run `npm install` to install all build dependencies (including Grunt).
1. Run `grunt` to grunt this project.
1. Run `npm install` to install all dependencies (including gulp).
1. Run `gulp` to build this project.

Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.
Assuming that you don't see any red, you're ready to go. Just be sure to run `gulp` after making any changes, to ensure that nothing is broken.

## Submitting pull requests

1. Create a new branch, please don't work in your `master` branch directly.
1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail.
1. Add failing tests for the change you want to make. Run `gulp` to see the tests fail.
1. Fix stuff.
1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done.
1. Run `gulp` to see if the tests pass. Repeat steps 2-4 until done.
1. Update the documentation to reflect any changes.
1. Push to your fork and submit a pull request.
80 changes: 0 additions & 80 deletions Gruntfile.js

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE
@@ -1,5 +1,5 @@
bespoke-logbook javascript library. Log bespoke.js events and state to the console.
Copyright (c) 2013 Joel Purra <http://joelpurra.com/>
bespoke-logbook javascript library. Log Bespoke.js events and state to the console
Copyright (c) 2013, 2014 Joel Purra <http://joelpurra.com/>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
46 changes: 22 additions & 24 deletions README.md
@@ -1,4 +1,4 @@
[![Build Status](https://secure.travis-ci.org/joelpurra/bespoke-logbook.png?branch=master)](https://travis-ci.org/joelpurra/bespoke-logbook)
[![Build Status](https://secure.travis-ci.org/joelpurra/bespoke-logbook.png?branch=master)](https://travis-ci.org/joelpurra/bespoke-logbook) [![Coverage Status](https://coveralls.io/repos/joelpurra/bespoke-logbook/badge.png)](https://coveralls.io/r/joelpurra/bespoke-logbook)

# [bespoke-logbook](https://github.com/joelpurra/bespoke-logbook)

Expand All @@ -19,14 +19,25 @@ Download the [production version][min] or the [development version][max], or use

## Usage

First, include `bespoke.js`, `bespoke-convenient.js` and `bespoke-logbook.js` in your page.
This plugin is shipped in a [UMD format](https://github.com/umdjs/umd), meaning that it is available as a CommonJS/AMD module or browser global.

Then, simply include the plugin when instantiating your presentation.
For example, when using CommonJS modules:

```js
bespoke.horizontal.from('article', {
logbook: true
});
var bespoke = require('bespoke'),
logbook = require('bespoke-logbook');

bespoke.from('#presentation', [
logbook()
]);
```

When using browser globals:

```js
bespoke.from('#presentation', [
bespoke.plugins.logbook()
]);
```

### Overriding event logging
Expand Down Expand Up @@ -96,27 +107,18 @@ bespoke.plugins.logbook.enable();
// logbook is back once again, with the ill behaviour
```


## Package managers

### Bower

```bash
$ bower install bespoke-logbook
```

### npm

```bash
$ npm install bespoke-logbook
```

The bespoke-logbook npm package is designed for use with [browserify](http://browserify.org/), e.g.
### Bower

```js
require('bespoke');
require('bespoke-convenient');
require('bespoke-logbook');
```bash
$ bower install bespoke-logbook
```


Expand All @@ -140,13 +142,9 @@ My best friend, [bespoke-convenient](https://github.com/joelpurra/bespoke-conven

## License

Copyright (c) 2013, [Joel Purra](http://joelpurra.com/) All rights reserved.
Copyright (c) 2013, 2014, [Joel Purra](http://joelpurra.com/) All rights reserved.

When using bespoke-logbook, comply to the [MIT license](http://joelpurra.mit-license.org/2013). Please see the LICENSE file for details, and the [MIT License on Wikipedia](http://en.wikipedia.org/wiki/MIT_License).
When using bespoke-logbook, comply to the [MIT license](http://joelpurra.mit-license.org/2013-2014). Please see the LICENSE file for details, and the [MIT License on Wikipedia](http://en.wikipedia.org/wiki/MIT_License).

[bespoke.js]: https://github.com/markdalgleish/bespoke.js
[default-events]: https://github.com/markdalgleish/bespoke.js#events


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/joelpurra/bespoke-logbook/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

10 changes: 7 additions & 3 deletions bower.json
@@ -1,8 +1,12 @@
{
"name": "bespoke-logbook",
"version": "1.0.1",
"version": "2.0.0-alpha.1",
"main": "./dist/bespoke-logbook.js",
"ignore": [
"**/.*"
],
"dependencies": {
"bespoke.js": "~0.3.1",
"bespoke-convenient": "~0.3.0"
"bespoke.js": "^1.0.0",
"bespoke-convenient": "^1.0.0"
}
}
36 changes: 21 additions & 15 deletions demo/demo.js
@@ -1,22 +1,28 @@
/*global document:true, bespoke:true */
/*global document:true, console:true, bespoke:true */

(function(document, bespoke) {
(function(bespoke) {
"use strict";

var deck = bespoke.horizontal.from("article", {
logbook: true
});
// Keep a reference to the deck for the fake plugin below.
var deck = bespoke.from("article", [
bespoke.plugins.keys(),
bespoke.plugins.touch(),
bespoke.plugins.classes(),
bespoke.plugins.logbook(),
]);

var fakePluginButton = document.getElementById("fake-plugin-button");
// Fake a plugin with a custom event.
(function() {
var fakePluginButton = document.getElementById("fake-plugin-button");

bespoke.plugins.logbook.override("my-custom-plugin-event", function() {
console.warn("Warning! You clicked the scary button!", arguments);
});

fakePluginButton.onclick = function() {
deck.fire("my-custom-plugin-event", {
something: "with extra data"
bespoke.plugins.logbook.override("my-custom-plugin-event", function() {
console.warn("Warning! You clicked the scary button!", arguments);
});
};

}(document, bespoke));
fakePluginButton.onclick = function() {
deck.fire("my-custom-plugin-event", {
something: "with extra data"
});
};
}());
}(bespoke));
37 changes: 20 additions & 17 deletions demo/index.html
@@ -1,13 +1,13 @@
<!doctype html>
<html>

<head>
<head>
<meta name="viewport" content="width=device-width" />
<title>bespoke-logbook demo</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
</head>

<body>
<body>

<h1>
<a href="https://github.com/joelpurra/bespoke-logbook" target="_blank">
Expand All @@ -16,39 +16,42 @@ <h1>
</h1>

<article>
<section>
<section>
<h2>Slide 1</h2>
<p>Open up your <a href="http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers" target="_blank">browser's javascript console</a>.</p>
</section>
<section>
</section>
<section>
<h2>Slide 2</h2>
<p>See how things pop up in the log window when you change slides?</p>
</section>
<section>
</section>
<section>
<h2>Slide 3</h2>
<p>It does that for all the default events....</p>
</section>
<section>
</section>
<section>
<h2>Slide 4</h2>
<p>...as well as for custom events, like this button representing a <a href="http://markdalgleish.com/projects/bespoke.js/">bespoke.js</a> plugin.</p>
<p>
<button type="button" id="fake-plugin-button">I'm a fake bespoke.js plugin</button>
</p>
</section>
<section>
</section>
<section>
<h2>Slide 5</h2>
<p>That's it, really. I was bored, and wanted to create a bespoke.js plugin. Enjoy!</p>
<p><a href="https://github.com/joelpurra/bespoke-logbook" target="_blank">https://github.com/joelpurra/bespoke-logbook</a>
</p>
<p><a href="http://joelpurra.com/" target="_blank">joelpurra.com</a>
</p>
</section>
</section>
</article>

<script src="../bower_components/bespoke.js/dist/bespoke.js"></script>
<script src="../bower_components/bespoke-convenient/dist/bespoke-convenient.js"></script>
<script src="../src/bespoke-logbook.js"></script>
<script src="../node_modules/bespoke/dist/bespoke.js"></script>
<script src="../node_modules/bespoke-keys/dist/bespoke-keys.js"></script>
<script src="../node_modules/bespoke-touch/dist/bespoke-touch.js"></script>
<script src="../node_modules/bespoke-classes/dist/bespoke-classes.js"></script>
<script src="../node_modules/bespoke-convenient/dist/bespoke-convenient.js"></script>
<script src="../dist/bespoke-logbook.js"></script>
<script src="demo.js"></script>
</body>
</body>

</html>

0 comments on commit 133d7af

Please sign in to comment.