diff --git a/.meteor/packages b/.meteor/packages index 3600d7e3e689..48c6d434bf21 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -16,17 +16,14 @@ less meteor-platform reactive-var service-configuration - chrismbeckett:toastr francocatena:status jparker:gravatar -kevohagan:sweetalert konecty:autolinker konecty:change-case konecty:delayed-task konecty:mongo-counter konecty:multiple-instances-status -konecty:nrr konecty:user-presence mizzao:autocomplete mizzao:timesync @@ -56,6 +53,11 @@ tmeasday:errors todda00:friendly-slugs underscorestring:underscore.string yasaricli:slugify +konecty:nrr +kevohagan:sweetalert +raix:ui-dropped-event +cfs:standard-packages +cfs:gridfs meteorhacks:kadira meteorhacks:flow-router meteorhacks:flow-layout diff --git a/.meteor/versions b/.meteor/versions index 9dffca3ac835..505bd0158c71 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -14,7 +14,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:gridfs@0.0.33 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 @@ percolatestudio:synced-cron@1.1.0 qnub:emojione@0.0.3 raix:eventemitter@0.1.2 raix:handlebar-helpers@0.2.4 +raix:ui-dropped-event@0.0.7 random@1.0.3 reactive-dict@1.1.0 reactive-var@1.0.5 diff --git a/client/views/app/room.coffee b/client/views/app/room.coffee index 67dac3a628fd..2d8927be0a9a 100644 --- a/client/views/app/room.coffee +++ b/client/views/app/room.coffee @@ -522,6 +522,25 @@ Template.room.events 'click .stop-video': (event) -> webrtc.stop() + 'dragenter #dropzone': (e) -> + console.log 'DRAG ENTER' + + 'dragleave #dropzone': (e) -> + console.log 'DRAG OUT' + + 'dropped #dropzone': (e) -> + FS.Utility.eachFile e, (file) -> + newFile = new (FS.File)(file) + newFile.room = Session.get('openedRoom') + Files.insert newFile, (error, fileObj) -> + if error + toastr.error 'Upload failed... please try again. Error: ' + error + else + toastr.success 'Upload succeeded!' + `input = { value: 'File Uploaded: http://localhost:3000/cfs/files/Files/'+fileObj._id}` + ChatMessages.send(newFile.room, input) + + Template.room.onCreated -> console.log 'room.onCreated' if window.rocketDebug # this.scrollOnBottom = true diff --git a/client/views/app/room.html b/client/views/app/room.html index 830b3b92fc9a..2c0459da9568 100644 --- a/client/views/app/room.html +++ b/client/views/app/room.html @@ -1,4 +1,5 @@ diff --git a/lib/fileUpload.coffee b/lib/fileUpload.coffee new file mode 100644 index 000000000000..3d11be388ca3 --- /dev/null +++ b/lib/fileUpload.coffee @@ -0,0 +1,39 @@ +if Meteor.isServer + fileStore = new (FS.Store.GridFS)('files', {}) + `Files = new FS.Collection('Files', { + stores: [fileStore], + filter: { allow: { contentTypes: ['image/*'] } } +})` + +if Meteor.isClient + fileStore = new (FS.Store.GridFS)('files') + `Files = new FS.Collection('Files', { + stores: [fileStore], + filter: { + maxSize: 1048576, + allow: { contentTypes: ['image/*'] }, + onInvalid: function (message) { + toastr.error(message); + } + } +})` +# Allow rules +Files.allow + insert: -> + true + update: -> + false + download: -> + true + remove: -> + false + +Files.deny + insert: -> + false + update: -> + true + remove: -> + true + download: -> + false