https://github.com/dvberkel/snippits
A jquery plugin that allows snippets to be loaded into textarea.
https://github.com/dvberkel/snippits
Last synced: 2 months ago
JSON representation
A jquery plugin that allows snippets to be loaded into textarea.
- Host: GitHub
- URL: https://github.com/dvberkel/snippits
- Owner: dvberkel
- Created: 2013-06-23T09:52:59.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-06-23T10:24:06.000Z (almost 12 years ago)
- Last Synced: 2025-03-07T23:51:39.127Z (3 months ago)
- Size: 117 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
snippits
========> A jquery plugin that load snippits into textarea's
Usage
-----Install snippits with [bower][] with the following command
```shell
bower install snippits
```This will install `jquery.snippits.js` into the `components/snippits`
directory. You can include it into you html page with the following
snippit.```html
```
Afterwards it is possible to load snippits into textarea by first
selecting them with [jQuery][] and then calling `snippits()` on the
result set.### Example
With the following html
```html
```
The following loads the `example.js` snippit from the `snippits` directory into the
above textarea```javascript
$("textarea.code").snippits({
suffix: 'snippit',
directory: 'snippits',
onFinish: function(){ /* do nothing */ }
});
```
### OptionsThe following options can be passed to the `snippits` call.
#### suffix
*default*: `snippit`
Controls the suffix to the data attribute that will be used to load a
snippit.#### directory
*default*: `snippits`
Specifies what directory to load the snippits from.
#### onFinish
*default*: `function(){ /* do nothing */ }`
A callback for when the snippits loading is finished.
[bower]: http://bower.io
[jQuery]: http://jquery.com/