https://github.com/hacknlove/semantic-input-binary
https://github.com/hacknlove/semantic-input-binary
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hacknlove/semantic-input-binary
- Owner: hacknlove
- Created: 2017-06-07T15:43:24.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-18T18:17:50.000Z (over 8 years ago)
- Last Synced: 2025-01-08T20:51:06.770Z (over 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# semantic-input-image
## use:
### Template:
{{> inputImage name="foo" class="bar buz" default="/example.jpg"}}
where: `name`, `class` and `default` are optionals
* `name` sets the name of the `` wrapper
* `default` sets the default image src
### Events:
Template.yourtemplate.events({
'fileloaded input[name=foo]': function (event, instance, dataURL) {
// image has been loaded
// dataURL = "data:image/...;base64,iVBORw0KGgo..."
},
'cancel input[name=foo]': function (event, instance) {
// user has canceled (and data was set to default)
},
'cancel input[name=foo]': function (event, instance) {
// the file choosen is not an image (and data was set to default)
},
})
### Data:
$('input[name=foo]').data('dataURL') => default or "data:image/...;base64,iVBORw0KGgo..."