summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Loach <robloach@gmail.com>2015-01-21 01:18:39 -0500
committerRob Loach <robloach@gmail.com>2015-01-21 01:18:39 -0500
commit0e3f6b9a5f71576fca0b539a8098813660021c4c (patch)
tree2cf9f70910508d75acb2cf2115ede41f7e89d773
parent02f1b7acc699c8f310b2d9f35ed2044467745308 (diff)
downloadjquery-once-0e3f6b9a5f71576fca0b539a8098813660021c4c.zip
jquery-once-0e3f6b9a5f71576fca0b539a8098813660021c4c.tar.gz
jquery-once-0e3f6b9a5f71576fca0b539a8098813660021c4c.tar.bz2
Update to jQuery Once 2.0.02.0.0
-rw-r--r--API.md74
-rw-r--r--HISTORY.md55
-rw-r--r--README.md19
-rw-r--r--bower.json16
-rw-r--r--component.json2
-rw-r--r--jquery.once.js2
-rw-r--r--jquery.once.min.js2
-rw-r--r--once.jquery.json2
-rw-r--r--package.json21
9 files changed, 84 insertions, 109 deletions
diff --git a/API.md b/API.md
index e1a586c..1bc62b5 100644
--- a/API.md
+++ b/API.md
@@ -1,22 +1,31 @@
-#Index
-
-**Functions**
-
-* [once([id])](#once)
-* [removeOnce([id])](#removeOnce)
-* [findOnce([id])](#findOnce)
-
+##Globals
+<dl>
+<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>
+<dd><p>Removes the once data from elements, based on the given ID.</p>
+</dd>
+<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.
-**Params**
-
-- \[id="once"\] `string` - The data ID used to determine whether the given elements have already
- been processed or not. Defaults to `"once"`.
+| Param | Type | Description |
+| ----- | ---- | ----------- |
+| \[id=<code>&quot;once&quot;</code>\] | <code>string</code> | The data ID used to determine whether the given elements have already been processed or not. Defaults to `"once"`. |
-**Returns**: - jQuery collection of elements that have now run once by
+**Returns**: jQuery collection of elements that have now run once by
the given ID.
+**Access:** public
+**See**
+
+- removeOnce
+- findOnce
+
**Example**
``` javascript
// The following will change the color of each paragraph to red, just once
@@ -37,20 +46,21 @@ $('div.calendar').once().each(function() {
// Since there is no once ID provided here, the key will be "once".
});
```
-
<a name="removeOnce"></a>
-#removeOnce([id])
+##removeOnce([id])
Removes the once data from elements, based on the given ID.
-**Params**
+| Param | Type | Description |
+| ----- | ---- | ----------- |
+| \[id=<code>&quot;once&quot;</code>\] | <code>string</code> | A string representing the name of the data ID which should be used when filtering the elements. This only filters elements that have already been processed by the once function. The ID should be the same ID that was originally passed to the once() function. Defaults to `"once"`. |
-- \[id="once"\] `string` - A string representing the name of the data ID which should be used when
- filtering the elements. This only filters elements that have already been
- processed by the once function. The ID should be the same ID that was
- originally passed to the once() function. Defaults to `"once"`.
-
-**Returns**: - jQuery collection of elements that were acted upon to remove their
+**Returns**: jQuery collection of elements that were acted upon to remove their
once data.
+**Access:** public
+**See**
+
+- once
+
**Example**
``` javascript
// Remove once data with the "changecolor" ID. The result set is the
@@ -62,19 +72,20 @@ $("div.calendar").removeOnce().each(function() {
// Remove the calendar behavior.
});
```
-
<a name="findOnce"></a>
-#findOnce([id])
+##findOnce([id])
Filters elements that have already been processed once.
-**Params**
+| Param | Type | Description |
+| ----- | ---- | ----------- |
+| \[id=<code>&quot;once&quot;</code>\] | <code>string</code> | A string representing the name of the data id which should be used when filtering the elements. This only filters elements that have already been processed by the once function. The id should be the same id that was originally passed to the once() function. Defaults to "once". |
+
+**Returns**: jQuery collection of elements that have been run once.
+**Access:** public
+**See**
-- \[id="once"\] `string` - A string representing the name of the data id which should be used when
- filtering the elements. This only filters elements that have already
- been processed by the once function. The id should be the same id that
- was originally passed to the once() function. Defaults to "once".
+- once
-**Returns**: - jQuery collection of elements that have been run once.
**Example**
``` javascript
// Find all elements that have been changecolor'ed once.
@@ -88,4 +99,3 @@ $('p').findOnce().each(function() {
// a "once" action.
});
```
-
diff --git a/HISTORY.md b/HISTORY.md
index 372469b..be0f25a 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,57 +1,20 @@
# History
-## v2.0.0-beta.3 January 4, 2014
-- Added [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown) to
- automatically build API documentation
-- Added type checking of the id argument across all jQuery Once functions
+## v2.0.0 January 20th, 2014
+- Fixed type checking of the `id` parameter of `.once()` as optional
- From [@theodoreb](http://github.com/theodoreb)
+- Added performance improvement through [`.data()`](http://api.jquery.com/data/)
+use rather than class attributes
+- Added `findOnce()` function to allow filtering once'd elements
- Fixed inline code documentation
- From [@yched](http://github.com/yched)
-
-## v2.0.0-beta.2 December 31, 2014
-- Update documentation
-- Switched to [Mocha](http://mochajs.org) for automated testing
-
-## v2.0.0-beta.1 October 16, 2014
-- Less dependency on Grunt
-- Faster tests from using local copies of dependencies
-- Update documentation
-
-## v2.0.0-alpha.9 October 16, 2014
-- `id` parameter of `.once()` now a required parameter
- - From [@theodoreb](http://github.com/theodoreb)
-
-## v2.0.0-alpha.8 October 9, 2014
-- Update documentation
-- Fix whitespace
-- Switch from JSHint to ESLint
-
-## v2.0.0-alpha.7 October 8, 2014
+- Added automated testing through [Mocha](http://mochajs.org)
+- Added [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown) to
+automatically build API documentation
+- Switched to [ESLint](http://eslint.org) for code linting
- Removed unneeded cache variable
-
-## v2.0.0-alpha.6 October 5, 2014
- Removed function callback in order to promote jQuery chaining standards
-## v2.0.0-alpha.5 October 5, 2014
-- Added findOnce() to allow filtering once'd elements
-- Added inline JavaScript code documentation
-
-## v2.0.0-alpha.4 October 4, 2014
-- Updated documentation
-
-## v2.0.0-alpha.3 October 1, 2014
-- Updated version dependency on Projectz
-- Updated documentation
-
-## v2.0.0-alpha.2 September 27, 2014
-- Updated documentation
-
-## v2.0.0-alpha.1 September 26, 2014
-- Updated tests
-- Updated documentation
-- Added Travis build status
-- Fix to use data attributes rather than a class attribute
-
## v1.2.6 August 31, 2013
- Fixed Bower
- Updated documentation
diff --git a/README.md b/README.md
index 98d10cc..dccefc1 100644
--- a/README.md
+++ b/README.md
@@ -8,11 +8,12 @@
<!-- BADGES/ -->
-[![Build Status](http://img.shields.io/travis-ci/RobLoach/jquery-once.png?branch=master)](http://travis-ci.org/RobLoach/jquery-once "Check this project's build status on TravisCI")
-[![NPM version](http://badge.fury.io/js/jquery-once.png)](https://npmjs.org/package/jquery-once "View this project on NPM")
-[![Dependency Status](https://david-dm.org/RobLoach/jquery-once.png?theme=shields.io)](https://david-dm.org/RobLoach/jquery-once)
-[![Development Dependency Status](https://david-dm.org/RobLoach/jquery-once/dev-status.png?theme=shields.io)](https://david-dm.org/RobLoach/jquery-once#info=devDependencies)<br/>
-[![Gittip donate button](http://img.shields.io/gittip/robloach.png)](https://www.gittip.com/robloach/ "Donate weekly to this project using Gittip")
+[![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 -->
@@ -39,7 +40,7 @@ be used to ensure that a function is only applied once to an element.
### [Browserify](http://browserify.org/)
- Use: `require('jquery-once')`
- Install: `npm install --save jquery-once`
-- CDN URL: `//wzrd.in/bundle/jquery-once@2.0.0-beta.3`
+- CDN URL: `//wzrd.in/bundle/jquery-once@2.0.0`
### [Ender](http://ender.jit.su/)
- Use: `require('jquery-once')`
@@ -85,8 +86,8 @@ Build `jquery.once.min.js` with:
Tag and publish the new versions to [npm](http://npmjs.com) with [Semantic
Versioning](http://semver.org/):
- git tag 2.0.0-alpha.3
- git push origin 2.0.0-alpha.3
+ git tag 2.0.0
+ git push origin 2.0.0
npm publish
@@ -126,7 +127,7 @@ These amazing people are maintaining this project:
No sponsors yet! Will you be the first?
-[![Gittip donate button](http://img.shields.io/gittip/robloach.png)](https://www.gittip.com/robloach/ "Donate weekly to this project using Gittip")
+
### Contributors
diff --git a/bower.json b/bower.json
index a738008..f6de67f 100644
--- a/bower.json
+++ b/bower.json
@@ -2,7 +2,7 @@
"name": "jquery-once",
"homepage": "http://github.com/robloach/jquery-once",
"description": "jQuery Once",
- "version": "2.0.0-beta.3",
+ "version": "2.0.0",
"main": "jquery.once.js",
"ignore": [
"*.json",
@@ -19,12 +19,12 @@
"jquery": "*"
},
"devDependencies": {
- "eslint": "~0.11.0-alpha.0",
- "jsdoc-to-markdown": "^0.5.9",
- "jsdom": "^2.0.0",
- "mocha": "*",
- "mocha-jsdom": "^0.2.0",
- "projectz": "~0.3.15",
- "uglify-js": "~2.4.15"
+ "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"
}
} \ No newline at end of file
diff --git a/component.json b/component.json
index 03d9219..84a0352 100644
--- a/component.json
+++ b/component.json
@@ -4,7 +4,7 @@
"homepage": "http://github.com/robloach/jquery-once",
"description": "Act on jQuery elements only once.",
"license": "GPL-2.0",
- "version": "2.0.0-beta.3",
+ "version": "2.0.0",
"keywords": [
"jquery",
"jquery-plugin"
diff --git a/jquery.once.js b/jquery.once.js
index c4091f6..63e141e 100644
--- a/jquery.once.js
+++ b/jquery.once.js
@@ -1,5 +1,5 @@
/*!
- * jQuery Once v2.0.0-beta.3 - http://github.com/robloach/jquery-once
+ * jQuery Once v2.0.0 - http://github.com/robloach/jquery-once
* @license MIT, GPL-2.0
* http://opensource.org/licenses/MIT
* http://opensource.org/licenses/GPL-2.0
diff --git a/jquery.once.min.js b/jquery.once.min.js
index 71f745b..c9df0fc 100644
--- a/jquery.once.min.js
+++ b/jquery.once.min.js
@@ -1,5 +1,5 @@
/*!
- * jQuery Once v2.0.0-beta.3 - http://github.com/robloach/jquery-once
+ * jQuery Once v2.0.0 - http://github.com/robloach/jquery-once
* @license MIT, GPL-2.0
* http://opensource.org/licenses/MIT
* http://opensource.org/licenses/GPL-2.0
diff --git a/once.jquery.json b/once.jquery.json
index 246afbe..08bcd72 100644
--- a/once.jquery.json
+++ b/once.jquery.json
@@ -6,7 +6,7 @@
"jquery",
"once"
],
- "version": "2.0.0-beta.3",
+ "version": "2.0.0",
"author": {
"name": "Rob Loach",
"url": "http://robloach.net"
diff --git a/package.json b/package.json
index cc36358..3814706 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "jquery-once",
"title": "jQuery Once",
"description": "Act on jQuery elements only once.",
- "version": "2.0.0-beta.3",
+ "version": "2.0.0",
"keywords": [
"jquery",
"jquery-plugin"
@@ -12,7 +12,7 @@
"npm": true,
"david": true,
"daviddev": true,
- "gittip": "robloach"
+ "npmdownloads": true
},
"repo": "RobLoach/jquery-once",
"homepage": "https://github.com/RobLoach/jquery-once",
@@ -50,19 +50,20 @@
"jquery": "*"
},
"devDependencies": {
- "eslint": "~0.11.0-alpha.0",
- "jsdoc-to-markdown": "^0.5.9",
- "jsdom": "^2.0.0",
- "mocha": "*",
- "mocha-jsdom": "^0.2.0",
- "projectz": "~0.3.15",
- "uglify-js": "~2.4.15"
+ "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"
},
"scripts": {
"pretest": "./node_modules/.bin/eslint jquery.once.js test/test.js",
"test": "./node_modules/.bin/mocha",
"projectz": "./node_modules/.bin/projectz compile",
"docs": "./node_modules/.bin/jsdoc2md jquery.once.js > API.md",
- "build": "./node_modules/.bin/uglifyjs jquery.once.js -o jquery.once.min.js --comments --source-map jquery.once.min.js.map --mangle"
+ "build": "./node_modules/.bin/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"
}
} \ No newline at end of file