Skip to content

Commit

Permalink
Merge branch 'master' into reread-slide-size
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Sep 8, 2014
2 parents 1697145 + 50f36a1 commit 9b48e0b
Show file tree
Hide file tree
Showing 18 changed files with 353 additions and 295 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
bower_components
.grunt
_SpecRunner.html
lib-instrumented
test/coverage
37 changes: 18 additions & 19 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": true
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"immed": false,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"trailing": true,
"smarttabs": true,
"browser": true,
"node": true
}
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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.
85 changes: 0 additions & 85 deletions Gruntfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2013 Mark Dalgleish
Copyright 2014 Mark Dalgleish

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://secure.travis-ci.org/markdalgleish/bespoke-scale.png?branch=master)](https://travis-ci.org/markdalgleish/bespoke-scale)
[![Build Status](https://secure.travis-ci.org/markdalgleish/bespoke-scale.png?branch=master)](https://travis-ci.org/markdalgleish/bespoke-scale) [![Coverage Status](https://coveralls.io/repos/markdalgleish/bespoke-scale/badge.png)](https://coveralls.io/r/markdalgleish/bespoke-scale)

# bespoke-scale

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

## Usage

First, include both `bespoke.js` and `bespoke-scale.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.from('article', {
scale: true
});
var bespoke = require('bespoke'),
scale = require('bespoke-scale');

bespoke.from('article', [
scale()
]);
```

When using browser globals:

```js
bespoke.from('article', [
bespoke.plugins.scale()
]);
```

By default, bespoke-scale detects which method to use for resizing slides. In browsers that support it, CSS `zoom` is used. In all other browsers, each slide is wrapped with an element with a `bespoke-scale-parent` class, which is resized with CSS transforms. You will need to provide styles for this element, for example:
Expand All @@ -39,30 +50,23 @@ By default, bespoke-scale detects which method to use for resizing slides. In br
If you'd like to specify which scaling method to use, you can pass `'zoom'` or `'transform'` as an option, for example:

```js
bespoke.from('article', {
scale: 'zoom'
});
bespoke.from('article', [
scale('zoom')
]);
```

## Package managers

### Bower

```bash
$ bower install bespoke-scale
```

### npm

```bash
$ npm install bespoke-scale
```

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

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

## Credits
Expand Down
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "bespoke-scale",
"version": "0.2.0",
"version": "1.0.0",
"main": "./dist/bespoke-scale.js",
"dependencies": {
"bespoke.js": ">=0.3.0"
"bespoke.js": "^1.0.0"
}
}
11 changes: 6 additions & 5 deletions demo/demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bespoke.from('article', {
keys: true,
touch: true,
scale: true
});
bespoke.from('article', [
bespoke.plugins.classes(),
bespoke.plugins.keys(),
bespoke.plugins.touch(),
bespoke.plugins.scale()
]);
3 changes: 2 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
</article>

<script src="../node_modules/bespoke/dist/bespoke.js"></script>
<script src="../node_modules/bespoke-classes/dist/bespoke-classes.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="../src/bespoke-scale.js"></script>
<script src="../dist/bespoke-scale.js"></script>
<script src="demo.js"></script>
</body>
</html>
18 changes: 11 additions & 7 deletions dist/bespoke-scale.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*!
* bespoke-scale v0.2.0
* https://github.com/markdalgleish/bespoke-scale
* bespoke-scale v1.0.0
*
* Copyright 2013, Mark Dalgleish
* Copyright 2014, Mark Dalgleish
* This content is released under the MIT license
* http://mit-license.org/markdalgleish
*/

(function(bespoke) {

bespoke.plugins.scale = function(deck, options) {
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self);var o=n;o=o.bespoke||(o.bespoke={}),o=o.plugins||(o.plugins={}),o.scale=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
module.exports = function(options) {
return function(deck) {
var parent = deck.parent,
firstSlide = deck.slides[0],
slideHeight = firstSlide.offsetHeight,
Expand Down Expand Up @@ -51,4 +51,8 @@
scaleAll();
};

}(bespoke));
};

},{}]},{},[1])
(1)
});
4 changes: 2 additions & 2 deletions dist/bespoke-scale.min.js
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9b48e0b

Please sign in to comment.