Slide 1
+Slide 2
+Slide 3
+Slide 4
+Slide 5
+diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e717f5e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a088b6f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +bower_components diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..fa51fc3 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,21 @@ +{ + "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 +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b9207e5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - '0.8' + - '0.10' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1fe6214 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +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! + +### 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). + +1. Fork and clone the repo. +1. Run `npm install` to install all build dependencies (including Grunt). +1. Run `grunt` to grunt 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. + +## 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. Fix stuff. +1. Run `grunt` 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. diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..6e250af --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,85 @@ +// Generated on 2013-11-11 using generator-bespokeplugin v0.1.3 + +module.exports = function(grunt) { + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + meta: { + banner: '/*!\n' + + ' * <%= pkg.title || pkg.name %> v<%= pkg.version %>\n' + + ' * <%= pkg.homepage %>\n' + + ' *\n' + + ' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %>\n' + + ' * This content is released under the' + + ' <%= _.pluck(pkg.licenses, "type").join(", ") %> license<%= pkg.licenses.length === 1 ? "" : "s" %>\n' + + '' + + ' */\n\n', + microbanner: '/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> ' + + '© <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>, ' + + 'Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n' + }, + clean: { + files: ['dist'] + }, + concat: { + options: { + banner: '<%= meta.banner %>', + stripBanners: true + }, + dist: { + src: ['src/<%= pkg.name %>.js'], + dest: 'dist/<%= pkg.name %>.js' + } + }, + uglify: { + options: { + banner: '<%= meta.microbanner %>' + }, + dist: { + src: ['<%= concat.dist.dest %>'], + dest: 'dist/<%= pkg.name %>.min.js' + } + }, + jasmine: { + src: ['src/**/*.js'], + options: { + vendor: ['node_modules/bespoke/dist/bespoke.js'], + specs: 'spec/*Spec.js', + helpers: 'spec/*Helper.js' + } + }, + jshint: { + src: [ + 'Gruntfile.js', + 'src/**/*.js', + 'spec/**/*.js', + 'demo/**/*.js' + ], + options: { + jshintrc: '.jshintrc' + } + }, + micro: { + src: '<%= uglify.dist.dest %>', + options: { + limit: 1024, + gzip: true + } + }, + watch: { + files: '<%= jshint.src %>', + tasks: ['default'] + } + }); + + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-jasmine'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-micro'); + + grunt.registerTask('default', ['clean', 'jasmine', 'concat', 'uglify', 'micro']); + +}; diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c3c53cc --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright 2013 Joel Purra + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8bc7919 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +[![Build Status](https://secure.travis-ci.org/joelpurra/bespoke-active.png?branch=master)](https://travis-ci.org/joelpurra/bespoke-active) + +# bespoke-active + +Keep track of the active slide in [Bespoke.js](http://markdalgleish.com/projects/bespoke.js) + +## Download + +Download the [production version][min] or the [development version][max], or use a [package manager](#package-managers). + +[min]: https://raw.github.com/joelpurra/bespoke-active/master/dist/bespoke-active.min.js +[max]: https://raw.github.com/joelpurra/bespoke-active/master/dist/bespoke-active.js + +## Usage + +First, include both `bespoke.js` and `bespoke-active.js` in your page. + +Then, simply include the plugin when instantiating your presentation. + +```js +bespoke.horizontal.from('article', { + active: true +}); +``` + +## Package managers + +### Bower + +```bash +$ bower install bespoke-active +``` + +### npm + +```bash +$ npm install bespoke-active +``` + +The bespoke-active npm package is designed for use with [browserify](http://browserify.org/), e.g. + +```js +require('bespoke'); +require('bespoke-active'); +``` + +## Credits + +This plugin was built with [generator-bespokeplugin](https://github.com/markdalgleish/generator-bespokeplugin). + +## License + +[MIT License](http://en.wikipedia.org/wiki/MIT_License) diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..1c25529 --- /dev/null +++ b/bower.json @@ -0,0 +1,7 @@ +{ + "name": "bespoke-active", + "version": "0.0.0", + "dependencies": { + "bespoke.js": ">=0.3.0" + } +} \ No newline at end of file diff --git a/demo/demo.js b/demo/demo.js new file mode 100644 index 0000000..d271ed5 --- /dev/null +++ b/demo/demo.js @@ -0,0 +1,3 @@ +bespoke.horizontal.from('article', { + active: true +}); diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..858946a --- /dev/null +++ b/demo/index.html @@ -0,0 +1,34 @@ + + +
+ +Slide 1
+Slide 2
+Slide 3
+Slide 4
+Slide 5
+