An open API service indexing awesome lists of open source software.

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

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..."