Skip to content

Commit

Permalink
docs(~): Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLoach committed May 5, 2015
1 parent db2d1ee commit cb29f0e
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 124 deletions.
19 changes: 4 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
# February 19, 2015
# https://github.com/bevry/base
language: node_js
# ensure npm is the latest version (ignore node versions that can't run it)
# ensure coffee-script is installed (needed for cake commands)
# ensure dev dependencies are installed (handled via npm install)
# ensure test dependencies are installed (handled via cake install)
#install: "npm install -g npm && npm install coffee-script && npm install && ./node_modules/.bin/cake install"
# ensure our application is compiled before we run our tests
#before_script: "./node_modules/.bin/cake compile"
#script: "npm test"

node_js:
- "0.10"
- "0.12"
- iojs

cache:
directories:
- node_modules

notifications:
irc:
- "irc.freenode.org#bevry-dev"
email:
recipients:
- travisci@bevry.me
email: false
24 changes: 12 additions & 12 deletions API.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
## Functions
<dl>
<dt><a href="#once">once([id])</a> </dt>
<dt><a href="#once">once([id])</a> </dt>
<dd><p>Filter elements that have yet to be processed by the given data ID.</p>
</dd>
<dt><a href="#removeOnce">removeOnce([id])</a> </dt>
<dt><a href="#removeOnce">removeOnce([id])</a> </dt>
<dd><p>Removes the once data from elements, based on the given ID.</p>
</dd>
<dt><a href="#findOnce">findOnce([id])</a> </dt>
<dt><a href="#findOnce">findOnce([id])</a> </dt>
<dd><p>Filters elements that have already been processed once.</p>
</dd>
</dl>
<a name="once"></a>
## once([id])
## once([id])
Filter elements that have yet to be processed by the given data ID.

**Scope**: global function
**Kind**: global function
**Returns**: jQuery collection of elements that have now run once by
the given ID.
**this**: jQuery
**this**: <code>jQuery</code>
**Access:** public
**See**

Expand Down Expand Up @@ -50,13 +50,13 @@ $('div.calendar').once().each(function() {
});
```
<a name="removeOnce"></a>
## removeOnce([id])
## removeOnce([id])
Removes the once data from elements, based on the given ID.

**Scope**: global function
**Kind**: global function
**Returns**: jQuery collection of elements that were acted upon to remove their
once data.
**this**: jQuery
**this**: <code>jQuery</code>
**Access:** public
**See**: once

Expand All @@ -76,12 +76,12 @@ $("div.calendar").removeOnce().each(function() {
});
```
<a name="findOnce"></a>
## findOnce([id])
## findOnce([id])
Filters elements that have already been processed once.

**Scope**: global function
**Kind**: global function
**Returns**: jQuery collection of elements that have been run once.
**this**: jQuery
**this**: <code>jQuery</code>
**Access:** public
**See**: once

Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## v2.0.x Unreleased
- Updated development dependencies
- Updated documentation

## v2.0.0 January 20th, 2015
- Fixed type checking of the `id` parameter of `.once()` as optional
Expand Down
7 changes: 0 additions & 7 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

<!-- LICENSEFILE/ -->

# License

Copyright &copy; Rob Loach (http://github.com/RobLoach)
Expand All @@ -14,7 +11,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
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.

<!-- /LICENSEFILE -->


101 changes: 29 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@

<!-- TITLE/ -->

# jQuery Once

<!-- /TITLE -->


<!-- BADGES/ -->

[![Build Status](https://img.shields.io/travis/RobLoach/jquery-once/master.svg)](http://travis-ci.org/RobLoach/jquery-once "Check this project's build status on TravisCI")
[![NPM version](https://img.shields.io/npm/v/jquery-once.svg)](https://npmjs.org/package/jquery-once "View this project on NPM")
[![NPM downloads](https://img.shields.io/npm/dm/jquery-once.svg)](https://npmjs.org/package/jquery-once "View this project on NPM")
[![Dependency Status](https://img.shields.io/david/RobLoach/jquery-once.svg)](https://david-dm.org/RobLoach/jquery-once)
[![Dev Dependency Status](https://img.shields.io/david/dev/RobLoach/jquery-once.svg)](https://david-dm.org/RobLoach/jquery-once#info=devDependencies)<br/>


<!-- /BADGES -->


<!-- DESCRIPTION/ -->

Act on jQuery elements only once.

<!-- /DESCRIPTION -->
[![Dev Dependency Status](https://img.shields.io/david/dev/RobLoach/jquery-once.svg)](https://david-dm.org/RobLoach/jquery-once#info=devDependencies)

Act on [jQuery](http://jquery.com) elements only once.

Filters out all elements that had the same filter applied on them before. It can
be used to ensure that a function is only applied once to an element.


<!-- INSTALL/ -->

## Install

### [NPM](http://npmjs.org/)
Expand All @@ -54,12 +34,30 @@ be used to ensure that a function is only applied once to an element.
- Use: `require('jquery-once')`
- Install: `bower install jquery-once`

<!-- /INSTALL -->


## Usage

[See the API documentation for details on how to use jQuery Once.](https://github.com/RobLoach/jquery-once/blob/master/API.md#readme)
``` javascript
// The following will change the color of each paragraph to red, just once
// for the "changecolor" key.
$('p').once('changecolor').css('color', 'red');

// .once() will return a set of elements that yet to have the once ID
// associated with them. You can return to the original collection set by
// using .end().
$('p')
.once("changecolorblue")
.css("color", "blue")
.end()
.css("color", "red");

// To execute a function on the once set, you can use jQuery's each().
$('div.calendar').once().each(function() {
// Since there is no once ID provided here, the key will be "once".
});
```

[See the API documentation for more information on how to use jQuery Once.](https://github.com/RobLoach/jquery-once/blob/master/API.md#readme)


## Development
Expand All @@ -73,16 +71,14 @@ JSDom](https://github.com/rstacruz/mocha-jsdom):

npm test

Update project documentation with [Projectz](https://github.com/bevry/projectz)
and [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown):

npm run projectz
npm run docs

Build `jquery.once.min.js` with:

npm run build

Update API documentation with [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown):

npm run docs

Tag and publish the new versions to [npm](http://npmjs.com) with [Semantic
Versioning](http://semver.org/):

Expand All @@ -91,54 +87,15 @@ Versioning](http://semver.org/):
npm publish


<!-- HISTORY/ -->

## History
[Discover the change history by heading on over to the `HISTORY.md` file.](https://github.com/RobLoach/jquery-once/blob/master/HISTORY.md#files)

<!-- /HISTORY -->
[Discover the change history by heading on over to the `HISTORY.md` file.](HISTORY.md)


<!-- LICENSE/ -->

## License

Licensed under:

- [GPL-2.0](http://opensource.org/licenses/gpl-2.0.php)
- the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://opensource.org/licenses/MIT)

Copyright &copy; Rob Loach (http://github.com/RobLoach)

<!-- /LICENSE -->


<!-- BACKERS/ -->

## Backers

### Maintainers

These amazing people are maintaining this project:

- Rob Loach (https://github.com/RobLoach)

### Sponsors

No sponsors yet! Will you be the first?



### Contributors

These amazing people have contributed code to this project:

- [JohnAlbin](https://github.com/JohnAlbin)[view contributions](https://github.com/RobLoach/jquery-once/commits?author=JohnAlbin)
- [Rob Loach](https://github.com/RobLoach) <robloach@gmail.com>[view contributions](https://github.com/RobLoach/jquery-once/commits?author=RobLoach)
- [theodoreb](https://github.com/theodoreb)[view contributions](https://github.com/RobLoach/jquery-once/commits?author=theodoreb)

[Become a contributor!](https://github.com/RobLoach/jquery-once/blob/master/CONTRIBUTING.md#files)

<!-- /BACKERS -->


Copyright &copy; [Rob Loach](http://github.com/RobLoach)
9 changes: 0 additions & 9 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,5 @@
],
"dependencies": {
"jquery": "*"
},
"devDependencies": {
"eslint": "~0.12.0",
"jsdoc-to-markdown": "~0.6.2",
"jsdom": "~3.0.1",
"mocha": "~2.1.0",
"mocha-jsdom": "~0.2.0",
"projectz": "~0.3.17",
"uglify-js": "~2.4.16"
}
}
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"daviddev": true,
"npmdownloads": true
},
"repo": "RobLoach/jquery-once",
"homepage": "https://github.com/RobLoach/jquery-once",
"author": "Rob Loach (http://github.com/RobLoach)",
"maintainers": [
Expand Down Expand Up @@ -50,18 +49,16 @@
"jquery": "*"
},
"devDependencies": {
"eslint": "^0.17.1",
"jsdoc-to-markdown": "^0.6.4",
"jsdom": "^4.0.4",
"mocha": "~2.2.1",
"mocha-jsdom": "^0.2.1",
"projectz": "^0.5.0",
"uglify-js": "~2.4.16"
"eslint": "^0.20.0",
"jsdoc-to-markdown": "^1.0.3",
"jsdom": "~3.1.2",
"mocha": "~2.2.4",
"mocha-jsdom": "~0.3.0",
"uglify-js": "~2.4.21"
},
"scripts": {
"pretest": "eslint jquery.once.js test/test.js",
"test": "mocha",
"projectz": "projectz compile",
"docs": "jsdoc2md jquery.once.js > API.md",
"build": "uglifyjs jquery.once.js -o jquery.once.min.js --comments --source-map jquery.once.min.js.map --mangle",
"package": "npm install && npm run test && npm run projectz && npm run docs && npm run build"
Expand Down

0 comments on commit cb29f0e

Please sign in to comment.