https://github.com/hacknlove/meteor-semantic-input-image
semantic button, for meteor, that loads an image from the filesystem and launch some events
https://github.com/hacknlove/meteor-semantic-input-image
Last synced: 6 months ago
JSON representation
semantic button, for meteor, that loads an image from the filesystem and launch some events
- Host: GitHub
- URL: https://github.com/hacknlove/meteor-semantic-input-image
- Owner: hacknlove
- Created: 2016-08-18T09:03:44.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-19T10:28:01.000Z (almost 9 years ago)
- Last Synced: 2025-02-26T07:34:19.591Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 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..."