-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7412cd6
Showing
25 changed files
with
11,699 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"modules": false, | ||
"targets": { | ||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"] | ||
} | ||
} | ||
], | ||
"stage-2" | ||
], | ||
"env": { | ||
"test": { | ||
"plugins": ["transform-es2015-modules-commonjs"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
sourceType: 'module' | ||
}, | ||
extends: 'standard', // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style | ||
plugins: [ | ||
'jest' | ||
], | ||
rules: { // add your custom rules here | ||
'arrow-parens': 0, // allow paren-less arrow functions | ||
'generator-star-spacing': 0, // allow async-await | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, // allow debugger during development | ||
indent: [2, 2] | ||
}, | ||
env: { | ||
browser: true, | ||
'jest/globals': true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
.DS_Store | ||
.idea | ||
docs/html | ||
test/coverage | ||
examples/examples.js | ||
.coveralls.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
docs | ||
examples | ||
test | ||
.babelrc | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.travis.yml | ||
jest.config.js | ||
webpack.config.js | ||
package-lock.json | ||
yarn.lock | ||
_config.yml | ||
.npmignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
node_js: | ||
- '8' | ||
before_script: | ||
- npm prune | ||
script: | ||
- npm run test | ||
- npm run coveralls | ||
branches: | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 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 perret.luca@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
## Contributing | ||
|
||
First off, thank you for considering contributing to gaspard-collection. It's people | ||
like you that make gaspard-collection such a great tool. | ||
|
||
### 1. Where do I go from here? | ||
|
||
If you've noticed a bug or have a question [search the issue tracker](https://github.com/lucaperret/gaspard-collection/issues?q=something) | ||
to see if someone else in the community has already created a ticket. | ||
If not, go ahead and [make one](https://github.com/lucaperret/gaspard-collection/issues/new)! | ||
|
||
### 2. Fork & create a branch | ||
|
||
If this is something you think you can fix, then | ||
[fork gaspard-collection](https://help.github.com/articles/fork-a-repo) | ||
and create a branch with a descriptive name. | ||
|
||
A good branch name would be (where issue #325 is the ticket you're working on): | ||
|
||
```sh | ||
git checkout -b 325-add-dom-utiliy | ||
``` | ||
|
||
### 3. Get the test suite running | ||
|
||
Install the development dependencies: | ||
|
||
```sh | ||
yarn install | ||
``` | ||
|
||
Now you should be able to run the entire suite using: | ||
|
||
```sh | ||
yarn test:watch | ||
``` | ||
|
||
### 4. Did you find a bug? | ||
|
||
* **Ensure the bug was not already reported** by [searching all | ||
issues](https://github.com/lucaperret/gaspard-collection/issues?q=). | ||
|
||
* If you're unable to find an open issue addressing the problem, [open a new | ||
one](https://github.com/lucaperret/gaspard-collection/issues/new). Be sure to | ||
include a **title and clear description**, as much relevant information as | ||
possible, and a **code sample** or an **executable test case** demonstrating | ||
the expected behavior that is not occurring. | ||
|
||
### 5. Implement your fix or feature | ||
|
||
At this point, you're ready to make your changes! Feel free to ask for help; | ||
everyone is a beginner at first :smile_cat: | ||
|
||
### 6. View your changes in a web application | ||
|
||
Gaspard-collection is meant to be used by humans, not cucumbers. So make sure to take | ||
a look at your changes in a browser. | ||
|
||
To boot up a test NodeJS app: | ||
|
||
```sh | ||
yarn dev | ||
``` | ||
|
||
You should now be able to open <http://localhost:8080> in your browser. | ||
Open your browser Dev console and edit the **examples/index.js** to see with your feature/bugfix working. | ||
|
||
### 7. Make a Pull Request | ||
|
||
At this point, you should switch back to your master branch and make sure it's | ||
up to date with gaspard-collection's master branch: | ||
|
||
```sh | ||
git remote add upstream git@github.com:lucaperret/gaspard-collection.git | ||
git checkout master | ||
git pull upstream master | ||
``` | ||
|
||
Then update your feature branch from your local copy of master, and push it! | ||
|
||
```sh | ||
git checkout 325-add-dom-utiliy | ||
git rebase master | ||
git push --set-upstream origin 325-add-dom-utiliy | ||
``` | ||
|
||
Finally, go to GitHub and | ||
[make a Pull Request](https://help.github.com/articles/creating-a-pull-request) | ||
:D | ||
|
||
Travis CI will run our test suite. We care | ||
about quality, so your PR won't be merged until all tests pass. | ||
|
||
### 8. Keeping your Pull Request updated | ||
|
||
If a maintainer asks you to "rebase" your PR, they're saying that a lot of code | ||
has changed, and that you need to update your branch so it's easier to merge. | ||
|
||
To learn more about rebasing in Git, there are a lot of | ||
[good](http://git-scm.com/book/en/Git-Branching-Rebasing) | ||
[resources](https://help.github.com/articles/interactive-rebase), | ||
but here's the suggested workflow: | ||
|
||
```sh | ||
git checkout 325-add-dom-utiliy | ||
git pull --rebase upstream master | ||
git push --force-with-lease 325-add-dom-utiliy | ||
``` | ||
|
||
### 9. Merging a PR (maintainers only) | ||
|
||
A PR can only be merged into master by a maintainer if: | ||
|
||
* It is passing CI. | ||
* It has no requested changes. | ||
* It is up to date with current master. | ||
|
||
Any maintainer is allowed to merge a PR if all of these conditions are | ||
met. | ||
|
||
### 10. Shipping a release (maintainers only) | ||
|
||
Maintainers need to do the following to push out a release: | ||
|
||
* Make sure all pull requests are in and the master is up to date | ||
* git push (semantic-release will do the tag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Luca | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Gaspard-collection | ||
|
||
> Manipulate collection of DOM elements | ||
[![Gaspard-collection size](https://badges.herokuapp.com/size/npm/gaspard-collection/dist/gaspard-collection.umd.js?gzip=true)](https://www.npmjs.com/package/gaspard-collection) | ||
[![Build Status](https://travis-ci.org/lucaperret/gaspard-collection.svg?branch=master)](https://travis-ci.org/lucaperret/gaspard-collection) | ||
[![Coverage Status](https://coveralls.io/repos/github/lucaperret/gaspard-collection/badge.svg?branch=master)](https://coveralls.io/github/lucaperret/gaspard-collection?branch=master) | ||
|
||
[![npm version](https://badge.fury.io/js/gaspard-collection.svg)](https://badge.fury.io/js/gaspard-collection) | ||
[![devDependency Status](https://david-dm.org/lucaperret/gaspard-collection/dev-status.svg)](https://david-dm.org/lucaperret/gaspard-collection.svg#info=devDependencies) | ||
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) | ||
|
||
:fire: Use gaspard's [Collection](https://github.com/lucaperret/gaspard-collection/blob/master/docs/API.md#srccollectionjs) to queries elements and perform actions on each :fire: | ||
|
||
|
||
## Getting started | ||
|
||
### Installing | ||
|
||
npm | yarn | bower | jsDelivr | ||
------------ | ------------- | ------------- | ------------- | ||
npm install gaspard-collection | yarn add gaspard-collection | bower install gaspard-collection | [gaspard-collection.umd.js](https://cdn.jsdelivr.net/npm/gaspard-collection@latest/dist/gaspard-collection.umd.js) | ||
|
||
### Usage | ||
|
||
Include gaspard-collection on your project | ||
```javascript | ||
// Via ES2015 import statement | ||
import GaspardCollection from 'gaspard-collection' | ||
|
||
// or via Commonjs | ||
const GaspardCollection = require('gaspard-collection') | ||
``` | ||
|
||
```javascript | ||
const collection = new GaspardCollection('div.highlight') | ||
collection | ||
.css('background-color', 'green') | ||
.find('p:first-child') // returns a new gaspard collection | ||
.addClass('introduction') | ||
.fadeIn(400) | ||
.elements // Array of matched elements | ||
.forEach(element => { | ||
console.log('div.highlight first paragraph', element) | ||
}) | ||
``` | ||
|
||
Or use gaspard-collection within a `<script>` | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/gaspard@latest/dist/gaspard.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/gaspard-collection@latest/dist/gaspard-collection.umd.js"></script> | ||
<script> | ||
const collection = new GaspardCollection('div.highlight') | ||
collection | ||
.css('background-color', 'green') | ||
</script> | ||
``` | ||
|
||
|
||
### API documentation | ||
|
||
- [![Latest Documentation](https://doxdox.org/images/badge-flat.svg)](https://doxdox.org/lucaperret/gaspard-collection) | ||
|
||
- [Markdown](https://github.com/lucaperret/gaspard-collection/blob/master/docs/API.md) | ||
|
||
|
||
## Contribute | ||
|
||
|
||
- Fork the repository | ||
- Clone it locally and install dependencies with npm (or yarn) | ||
```shell | ||
npm install | ||
``` | ||
- Create a new branch | ||
- Develop your feature/fix with tests running | ||
```shell | ||
npm run test:watch | ||
``` | ||
- Commit, Push your branch and make a pull request on gaspard repository | ||
|
||
|
||
## Licensing | ||
|
||
MIT License Copyright (c) 2017 Luca Perret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theme: jekyll-theme-cayman |
Oops, something went wrong.