Skip to content
Snippets Groups Projects
Commit 2496118a authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Upload working

parent 791a4227
No related merge requests found
......@@ -47,3 +47,5 @@ meteorhacks:kadira
yasaricli:slugify
jparker:gravatar
http
cfs:filesystem
cfs:standard-packages
......@@ -13,7 +13,23 @@ blaze@2.1.2
blaze-tools@1.0.3
boilerplate-generator@1.0.3
callback-hook@1.0.3
cfs:access-point@0.1.49
cfs:base-package@0.0.30
cfs:collection@0.5.5
cfs:collection-filters@0.2.4
cfs:data-man@0.0.6
cfs:file@0.1.17
cfs:filesystem@0.1.2
cfs:http-methods@0.0.29
cfs:http-publish@0.0.13
cfs:power-queue@0.9.11
cfs:reactive-list@0.0.9
cfs:reactive-property@0.0.4
cfs:standard-packages@0.5.9
cfs:storage-adapter@0.2.2
cfs:tempstore@0.1.5
cfs:upload-http@0.0.20
cfs:worker@0.1.4
check@1.0.5
chrismbeckett:toastr@2.1.0
coffeescript@1.0.6
......@@ -83,6 +99,7 @@ ordered-dict@1.0.3
percolate:migrations@0.7.5
percolatestudio:synced-cron@1.1.0
qnub:emojione@0.0.3
raix:eventemitter@0.1.2
raix:handlebar-helpers@0.2.4
random@1.0.3
reactive-dict@1.1.0
......
......@@ -11,3 +11,28 @@ Template.avatarPrompt.onCreated ->
Template.avatarPrompt.helpers
suggestions: ->
return Template.instance().suggestions.get()
Template.avatarPrompt.events
'click .select-service': (e) ->
username = Meteor.user().username
file = new FS.File(this.blob)
file.attachData this.blob, (error) ->
if error?
console.log error
else
file.name(username)
Images.insert file, (err, fileObj) ->
console.log arguments
'change .myFileInput': (event, template) ->
username = Meteor.user().username
FS.Utility.eachFile event, (blob) ->
file = new FS.File(blob)
file.attachData blob, (error) ->
if error?
console.log error
else
file.name(username)
Images.insert file, (err, fileObj) ->
console.log arguments
\ No newline at end of file
......@@ -3,7 +3,7 @@
<div class="avatar-suggestion-item">
<div style="background-image: url({{blob}});">
</div>
<button class="button primary">Use {{service}} avatar</button>
<button type="button" class="button primary select-service">Use {{service}} avatar</button>
</div>
{{/if}}
</template>
......@@ -13,7 +13,7 @@
<div class="avatar-suggestion-item">
<div style="background-image: url();">
</div>
<button class="button primary">Login with {{.}}</button>
<button type="button" class="button primary">Login with {{.}}</button>
</div>
{{/if}}
</template>
......@@ -48,6 +48,7 @@
{{else}}
{{_ "usernameRegistration.Loading_suggestion"}}
{{/if}}
<input type="file" class="myFileInput">
</div>
</div>
</div>
......
store = new FS.Store.FileSystem "images",
path: "~/uploads"
fileKeyMaker: (fileObj) ->
filename = fileObj.name()
filenameInStore = fileObj.name({store: 'images'})
return filenameInStore || filename
@Images = new FS.Collection "images",
stores: [store]
@Images.allow
insert: ->
return true
update: ->
return true
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment