https://github.com/sabamotto/jquery-egen
jQuery plugin for generating element by query
https://github.com/sabamotto/jquery-egen
dom jquery-plugin querystring
Last synced: 4 months ago
JSON representation
jQuery plugin for generating element by query
- Host: GitHub
- URL: https://github.com/sabamotto/jquery-egen
- Owner: sabamotto
- License: mit
- Created: 2015-03-10T18:43:18.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-12-02T17:14:22.000Z (over 9 years ago)
- Last Synced: 2026-01-24T04:19:02.059Z (5 months ago)
- Topics: dom, jquery-plugin, querystring
- Language: CoffeeScript
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
# jQuery-eGen
A simple jQuery plugin for generating element by a query string.
jQuery-eGen is inspired by [Slim](https://github.com/slim-template/slim).
- Website: http://sabamotto.github.io/jquery-egen/
- Downloads: https://github.com/sabamotto/jquery-egen/releases/
- Examples: http://sabamotto.github.io/jquery-egen/examples.html
## Installation
Include eGen script after the jQuery library.
```html
```
Or, include it in your script package.
## Usage
Create simple div element:
```javascript
div = $.egen();
```
```html
```
Create element with id or classes:
```javascript
icon = $.egen('i.fa.fa-spinner.fa-spin#waitIcon');
```
```html
```
Create paragraph element with alignment, and append to body:
```javascript
$('body').egen('p', { align: 'center' }, 'welcome to eGen!');
```
```html
welcome to eGen!
```
Create nested element:
```javascript
warnText = $.egen('p.warn b i', { align: 'center' }, 'Bold and Italic');
```
```html
Bold and Italic
```
see also [examples](https://github.com/sabamotto/jquery-egen/tree/master/examples).
## Build
To build eGen by yourself, first of make sure you have Node.js, Grunt and JRE installed.
1. Clone eGen repository
```
git clone https://github.com/sabamotto/jquery-egen.git
cd jquery-egen
```
2. Install Node.js dependencies
```
npm install
```
3. Run `grunt` to generate a script in folder `dist`.
```
grunt
```
## License
Copyright (c) 2015 SabaMotto
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.
## Author
[@sabamotto](https://twitter.com/sabamotto)