bespoke-loop
Advanced tools
Comparing version 0.1.2 to 1.0.0-beta
{ | ||
"name": "bespoke-loop", | ||
"version": "0.1.2", | ||
"main": "./dist/bespoke-loop.min.js", | ||
"version": "1.0.0-beta", | ||
"main": "./dist/bespoke-loop.js", | ||
"ignore": [ | ||
@@ -9,4 +9,4 @@ "**/.*" | ||
"dependencies": { | ||
"bespoke.js": ">=0.2.0" | ||
"bespoke.js": "^1.0.0" | ||
} | ||
} | ||
} |
# Contributing | ||
## Important notes | ||
Please don't edit files in the `dist` subdirectory as they are generated via grunt. 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! | ||
@@ -9,17 +9,12 @@ ### Code style | ||
### PhantomJS | ||
See the [Why does grunt complain that PhantomJS isn't installed?](https://github.com/gruntjs/grunt/blob/master/docs/faq.md#why-does-grunt-complain-that-phantomjs-isnt-installed) guide in the [Grunt FAQ](https://github.com/gruntjs/grunt/blob/master/docs/faq.md) for help with installing or troubleshooting PhantomJS. | ||
## Modifying the code | ||
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed. | ||
Test that grunt is installed globally by running `grunt --version` at the command-line. If grunt isn't installed globally, run `npm install -g grunt` to install the latest version. _You may need to run `sudo npm install -g grunt`._ | ||
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. | ||
_Note that in Windows, you may have to run `grunt.cmd` instead of `grunt`._ | ||
1. Fork and clone the repo. | ||
1. Run `npm install` to install all 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. | ||
@@ -29,6 +24,6 @@ ## 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. |
/*! | ||
* bespoke-loop v0.1.1 | ||
* bespoke-loop v1.0.0-beta | ||
* | ||
* Copyright 2013, Mark Dalgleish | ||
* Copyright 2014, Mark Dalgleish | ||
* This content is released under the MIT license | ||
@@ -9,18 +9,21 @@ * http://mit-license.org/markdalgleish | ||
(function(bespoke) { | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;"undefined"!=typeof window?o=window:"undefined"!=typeof global?o=global:"undefined"!=typeof self&&(o=self);var n=o;n=n.bespoke||(n.bespoke={}),n=n.plugins||(n.plugins={}),n.loop=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() { | ||
return function(deck) { | ||
deck.on('prev', function(e) { | ||
if (e.index === 0) { | ||
deck.slide(deck.slides.length - 1); | ||
} | ||
}); | ||
bespoke.plugins.loop = function(deck) { | ||
deck.on('prev', function(e) { | ||
if (e.index === 0) { | ||
deck.slide(deck.slides.length - 1); | ||
} | ||
}); | ||
deck.on('next', function(e) { | ||
if (e.index === deck.slides.length - 1) { | ||
deck.slide(0); | ||
} | ||
}); | ||
}; | ||
}; | ||
deck.on('next', function(e) { | ||
if (e.index === deck.slides.length - 1) { | ||
deck.slide(0); | ||
} | ||
}); | ||
}; | ||
}(bespoke)); | ||
},{}]},{},[1]) | ||
(1) | ||
}); |
@@ -1,2 +0,2 @@ | ||
/*! bespoke-loop v0.1.1 © 2013 Mark Dalgleish, Licensed MIT */ | ||
(function(e){e.plugins.loop=function(e){e.on("prev",function(t){t.index===0&&e.slide(e.slides.length-1)}),e.on("next",function(t){t.index===e.slides.length-1&&e.slide(0)})}})(bespoke); | ||
/*! bespoke-loop v1.0.0-beta © 2014 Mark Dalgleish, MIT License */ | ||
!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.loop=e()}}(function(){return function e(n,o,t){function i(f,u){if(!o[f]){if(!n[f]){var d="function"==typeof require&&require;if(!u&&d)return d(f,!0);if(r)return r(f,!0);throw new Error("Cannot find module '"+f+"'")}var l=o[f]={exports:{}};n[f][0].call(l.exports,function(e){var o=n[f][1][e];return i(o?o:e)},l,l.exports,e,n,o,t)}return o[f].exports}for(var r="function"==typeof require&&require,f=0;f<t.length;f++)i(t[f]);return i}({1:[function(e,n){n.exports=function(){return function(e){e.on("prev",function(n){0===n.index&&e.slide(e.slides.length-1)}),e.on("next",function(n){n.index===e.slides.length-1&&e.slide(0)})}}},{}]},{},[1])(1)}); |
{ | ||
"name": "bespoke-loop", | ||
"title": "bespoke-loop", | ||
"version": "0.1.2", | ||
"version": "1.0.0-beta", | ||
"description": "Looping Presentations for Bespoke.js", | ||
@@ -10,8 +9,9 @@ "author": { | ||
}, | ||
"main": "./dist/bespoke-loop.js", | ||
"main": "./lib/bespoke-loop.js", | ||
"engines": { | ||
"node": ">= 0.8.0" | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "grunt jasmine" | ||
"test": "gulp", | ||
"coveralls": "gulp coveralls" | ||
}, | ||
@@ -23,8 +23,29 @@ "repository": { | ||
"peerDependencies": { | ||
"bespoke": ">=0.3.0" | ||
"bespoke": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.3.17", | ||
"grunt-jasmine-runner": "~0.6.0", | ||
"temporary": "0.0.5" | ||
"bespoke": "^1.0.0", | ||
"browserify": "^4.1.5", | ||
"function-bind": "^0.1.0", | ||
"gulp": "^3.5.1", | ||
"gulp-clean": "^0.2.4", | ||
"gulp-coveralls": "^0.1.0", | ||
"gulp-header": "^1.0.2", | ||
"gulp-jshint": "^1.3.4", | ||
"gulp-karma": "0.0.2", | ||
"gulp-rename": "^1.2.0", | ||
"gulp-uglify": "^0.3.0", | ||
"istanbul": "^0.2.11", | ||
"jshint-stylish": "^0.1.5", | ||
"karma": "^0.10.9", | ||
"karma-browserify": "^0.2.1", | ||
"karma-coverage": "^0.1.5", | ||
"karma-jasmine": "^0.1.5", | ||
"karma-phantomjs-launcher": "^0.1.4", | ||
"karma-script-launcher": "^0.1.0", | ||
"lodash": "^2.4.1", | ||
"requirejs": "^2.1.10", | ||
"vinyl-buffer": "0.0.0", | ||
"vinyl-map": "^1.0.1", | ||
"vinyl-source-stream": "^0.1.1" | ||
}, | ||
@@ -38,4 +59,4 @@ "licenses": [ | ||
"keywords": [ | ||
"bespoke.js-plugin" | ||
"bespoke-plugin" | ||
] | ||
} |
@@ -1,12 +0,10 @@ | ||
[![Build Status](https://secure.travis-ci.org/markdalgleish/bespoke-loop.png)](http://travis-ci.org/markdalgleish/bespoke-loop) | ||
[![Build Status](https://secure.travis-ci.org/markdalgleish/bespoke-loop.png?branch=master)](https://travis-ci.org/markdalgleish/bespoke-loop) [![Coverage Status](https://coveralls.io/repos/markdalgleish/bespoke-loop/badge.png)](https://coveralls.io/r/markdalgleish/bespoke-loop) | ||
# bespoke-loop | ||
### Looping Presentations for [Bespoke.js](https://github.com/markdalgleish/bespoke.js) | ||
Looping Presentations for [Bespoke.js](https://github.com/markdalgleish/bespoke.js) | ||
Turn your Bespoke.js presentation into an infinite loop. | ||
## Download | ||
Download the [production version][min] or the [development version][max]. | ||
Download the [production version][min] or the [development version][max], or use a [package manager](#package-managers). | ||
@@ -16,30 +14,45 @@ [min]: https://raw.github.com/markdalgleish/bespoke-loop/master/dist/bespoke-loop.min.js | ||
### Bower | ||
## Usage | ||
Bespoke-loop can be installed from [Bower](http://twitter.github.com/bower/) using the following command: | ||
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. | ||
```bash | ||
$ bower install bespoke-loop | ||
``` | ||
For example, when using CommonJS modules: | ||
## Usage | ||
```js | ||
var bespoke = require('bespoke'), | ||
loop = require('bespoke-loop'); | ||
First, include both `bespoke.js` and `bespoke-loop.js` in your page. | ||
bespoke.from('article', [ | ||
loop() | ||
]); | ||
``` | ||
Then, simply include the plugin when using the `from(selector[, plugins])` method. | ||
When using browser globals: | ||
```js | ||
bespoke.horizontal.from(selector, { | ||
loop: true | ||
}); | ||
bespoke.from('article', [ | ||
bespoke.plugins.loop() | ||
]); | ||
``` | ||
## Questions? | ||
## Package managers | ||
Contact me on GitHub or Twitter: [@markdalgleish](http://twitter.com/markdalgleish) | ||
### npm | ||
```bash | ||
$ npm install bespoke-loop | ||
``` | ||
### Bower | ||
```bash | ||
$ bower install bespoke-loop | ||
``` | ||
## Credits | ||
This plugin was built with [generator-bespokeplugin](https://github.com/markdalgleish/generator-bespokeplugin). | ||
## License | ||
Copyright 2013, Mark Dalgleish | ||
This content is released under the MIT license | ||
http://markdalgleish.mit-license.org | ||
[MIT License](http://en.wikipedia.org/wiki/MIT_License) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
16
58
1
13487
24
200
3
4