From d9c1b834c92a31f817c40a40ff40820e5657dd6f Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Fri, 12 Feb 2016 14:01:40 -0500 Subject: [PATCH 01/12] added usage and demo to readmy --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 674c798..6d709e1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # Angular URL-Encode Filter +## Demo + +[Plunkr](http://plnkr.co/edit/oPJZWt) + + ## Installation `$ bower install angular-url-encode --save` @@ -14,12 +19,22 @@ angular.module('myModule', ['bc.AngularUrlEncode']); ## Usage -__coming soon__ +As a filter in the DOM: +``` +{{ myPlainString | bcEncode }} +{{ encodedString | bcDecode }} +``` -## Demo +Using the `$filter` service in JS: -__coming soon__ +``` +// Encode +this.encodedString = $filter('bcEncode')(myPlainString); + +// Decode +this.decodedString = $filter('bcDecode')(encodedString); +``` - - - @@ -30,3 +45,10 @@ __coming soon__ * `npm run build` - produces production version of your library under the `dist` folder * `npm run dev` - produces development version of your library and runs a watcher + +- - - + + +[All idea and code contributions +welcome!](https://github.com/benjamincharity/angular-url-encode/issues) + From b1d8a511a9ef019045b37cd57d8fe8d6bf51c339 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Fri, 12 Feb 2016 14:02:32 -0500 Subject: [PATCH 02/12] more direct plunker link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d709e1..1f54ec5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Demo -[Plunkr](http://plnkr.co/edit/oPJZWt) +[Plunkr](http://plnkr.co/edit/oPJZWt?p=preview) ## Installation From 05703f823468cfaba05c4642eb543494ef34d564 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Fri, 12 Feb 2016 14:03:52 -0500 Subject: [PATCH 03/12] added description --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1f54ec5..ebcf4a2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Angular URL-Encode Filter +A simple Angular filter to encode or decode a string using `encodeURIComponent` and `decodeURI`. + ## Demo From 972974c087dff00c9b00976b7adbbfd47b8d475d Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Fri, 12 Feb 2016 14:04:45 -0500 Subject: [PATCH 04/12] tweak --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index ebcf4a2..9f9b489 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,7 @@ A simple Angular filter to encode or decode a string using `encodeURIComponent` and `decodeURI`. - -## Demo - -[Plunkr](http://plnkr.co/edit/oPJZWt?p=preview) +[Demo on Plunkr](http://plnkr.co/edit/oPJZWt?p=preview) ## Installation From 610f8b3dc046a9fbdbbe6220e7a87cf82cf4df97 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Fri, 12 Feb 2016 14:05:20 -0500 Subject: [PATCH 05/12] fixed spelling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f9b489..6e20deb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A simple Angular filter to encode or decode a string using `encodeURIComponent` and `decodeURI`. -[Demo on Plunkr](http://plnkr.co/edit/oPJZWt?p=preview) +[**Demo on Plunker**](http://plnkr.co/edit/oPJZWt?p=preview) ## Installation From d5d72a8c66f7eb60629efd816271d1563c0fbfa8 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Fri, 12 Feb 2016 23:06:11 -0500 Subject: [PATCH 06/12] Switched to the correct method --- README.md | 2 +- src/encode.filter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6e20deb..3eb77df 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Angular URL-Encode Filter -A simple Angular filter to encode or decode a string using `encodeURIComponent` and `decodeURI`. +A simple Angular filter to encode or decode a string using `encodeURI` and `decodeURI`. [**Demo on Plunker**](http://plnkr.co/edit/oPJZWt?p=preview) diff --git a/src/encode.filter.js b/src/encode.filter.js index 4a1cf08..242635c 100644 --- a/src/encode.filter.js +++ b/src/encode.filter.js @@ -13,7 +13,7 @@ export function EncodeFilter( * @return {String} output */ function encode(input) { - return $window.encodeURIComponent(input); + return $window.encodeURI(input); } } From 2ea39623747935cb498e59509713ba6980afa668 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Wed, 11 May 2016 22:51:27 -0400 Subject: [PATCH 07/12] added code of conduct --- CODE_OF_CONDUCT.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..685a7be --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,75 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ben@benjamincharity.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ + From b79e05c8ec6da4a3d7700ed618b8e9651edf0d1f Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Thu, 7 Jul 2016 10:40:51 -0400 Subject: [PATCH 08/12] Removed bower version closes #1 --- bower.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bower.json b/bower.json index cdeed58..731f85d 100644 --- a/bower.json +++ b/bower.json @@ -29,6 +29,5 @@ "node_modules", "package.json", "webpack.config.js" - ], - "version": "0.1.0" + ] } From b143366126b8d8fe45521d2c015274ca2c9a3874 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Tue, 16 Aug 2016 07:48:18 -0400 Subject: [PATCH 09/12] 0.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0d094e..b249ec5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-url-encode", - "version": "0.1.0", + "version": "0.1.1", "description": "A simple Angular filter to URL-encode a string.", "main": "dist/angular-url-encode.js", "scripts": { From 59ae93733871e3b66c4ed1adc0f49b18cdb23446 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Tue, 16 Aug 2016 07:49:44 -0400 Subject: [PATCH 10/12] bump version for release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b249ec5..8852272 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-url-encode", - "version": "0.1.1", + "version": "0.1.2", "description": "A simple Angular filter to URL-encode a string.", "main": "dist/angular-url-encode.js", "scripts": { From 9f56a7395e5b6790c37c79a4ce18705ab558b6fd Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Fri, 7 Oct 2016 18:59:02 -0400 Subject: [PATCH 11/12] :memo: update docs - match doc format - added npm and license badges - switched to CodePen demos - added TOC --- README.md | 74 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3eb77df..d877c35 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,85 @@ -# Angular URL-Encode Filter +# angular-url-encode -A simple Angular filter to encode or decode a string using `encodeURI` and `decodeURI`. +[![MIT License][license_image]][license_url] [![NPM version][npm_version_image]][npm_url] -[**Demo on Plunker**](http://plnkr.co/edit/oPJZWt?p=preview) +:arrows_counterclockwise: A simple Angular filter to URL-encode or decode a string using `encodeURI` +and `decodeURI`. + +> [**:tv: Demo**][demo] + +_[Comments and Pull Requests welcome!][issues]_ + +--- + +## Contents + +- [Installation](#installation) +- [Dependencies](#dependencies) +- [Usage](#usage) +- [Development](#development) + +## Dependencies + +- AngularJS (^1.4.0) ## Installation -`$ bower install angular-url-encode --save` +#### NPM -Add `bc.AngularUrlEncode` to your module's dependencies: +```bash +$ npm install angular-url-encode --S +``` +#### Bower + +```bash +$ bower install angular-url-encode --S ``` + +#### Manually + +Add the script and styles to your HTML: + +```html + +``` + +Add `bc.AngularUrlEncode` to your module's dependencies: + +```javascript angular.module('myModule', ['bc.AngularUrlEncode']); ``` ## Usage +#### HTML + As a filter in the DOM: -``` -{{ myPlainString | bcEncode }} -{{ encodedString | bcDecode }} +```html +

{{ myPlainString | bcEncode }}

+

{{ encodedString | bcDecode }}

``` -Using the `$filter` service in JS: +#### JavaScript -``` +Using the `$filter` service: + +```javascript // Encode -this.encodedString = $filter('bcEncode')(myPlainString); +this.encodedString = $filter('bcEncode')(this.myPlainString); // Decode -this.decodedString = $filter('bcDecode')(encodedString); +this.decodedString = $filter('bcDecode')(this.encodedString); ``` - - - -### Development Scripts +## Development * `npm run build` - produces production version of your library under the `dist` folder * `npm run dev` - produces development version of your library and runs a watcher @@ -48,6 +88,10 @@ this.decodedString = $filter('bcDecode')(encodedString); - - - -[All idea and code contributions -welcome!](https://github.com/benjamincharity/angular-url-encode/issues) +[demo]: http://codepen.io/benjamincharity/pen/wzyNqQ?editors=1000 +[issues]: https://github.com/benjamincharity/angular-url-encode/issues +[license_image]: http://img.shields.io/badge/license-MIT-blue.svg +[license_url]: LICENSE +[npm_url]: https://npmjs.org/package/angular-url-encode +[npm_version_image]: http://img.shields.io/npm/v/angular-url-encode.svg From b721ab07d9260d1fdd7c195bd531fdaa46e78f78 Mon Sep 17 00:00:00 2001 From: Benjamin Charity Date: Fri, 7 Oct 2016 19:00:11 -0400 Subject: [PATCH 12/12] 1.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8852272..cf92c8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-url-encode", - "version": "0.1.2", + "version": "1.0.0", "description": "A simple Angular filter to URL-encode a string.", "main": "dist/angular-url-encode.js", "scripts": {