Skip to content

Commit

Permalink
Merge pull request #368 from VeliovGroup/dev
Browse files Browse the repository at this point in the history
v1.7.12
  • Loading branch information
dr-dimitru authored Mar 1, 2017
2 parents 25c7123 + 3002eeb commit c51c186
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 47 deletions.
78 changes: 39 additions & 39 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
allow-deny@1.0.5
babel-compiler@6.9.0
babel-runtime@0.1.10
base64@1.0.9
binary-heap@1.0.9
babel-compiler@6.14.1
babel-runtime@1.0.1
base64@1.0.10
binary-heap@1.0.10
blaze@2.1.8
blaze-tools@1.0.9
boilerplate-generator@1.0.9
caching-compiler@1.1.6
callback-hook@1.0.9
check@1.2.3
coffeescript@1.2.3
boilerplate-generator@1.0.11
caching-compiler@1.1.9
callback-hook@1.0.10
check@1.2.4
coffeescript@1.11.1_3
ddp@1.2.5
ddp-client@1.2.9
ddp-common@1.2.6
ddp-server@1.2.10
ddp-client@1.3.3
ddp-common@1.2.8
ddp-server@1.3.13
deps@1.0.12
diff-sequence@1.0.6
ecmascript@0.5.7
ecmascript-runtime@0.3.12
ejson@1.0.12
geojson-utils@1.0.9
diff-sequence@1.0.7
ecmascript@0.6.3
ecmascript-runtime@0.3.15
ejson@1.0.13
geojson-utils@1.0.10
html-tools@1.0.10
htmljs@1.0.10
http@1.2.8
id-map@1.0.8
jquery@1.11.9
logging@1.1.14
meteor@1.2.16
minimongo@1.0.17
modules@0.7.5
modules-runtime@0.7.5
mongo@1.1.10
mongo-id@1.0.5
npm-mongo@1.5.45
observe-sequence@1.0.12
ordered-dict@1.0.8
http@1.2.11
id-map@1.0.9
jquery@1.11.10
logging@1.1.17
meteor@1.6.1
minimongo@1.0.20
modules@0.7.9
modules-runtime@0.7.9
mongo@1.1.15
mongo-id@1.0.6
npm-mongo@2.2.16_1
observe-sequence@1.0.15
ordered-dict@1.0.9
ostrio:cookies@2.1.3
ostrio:files@1.7.11
promise@0.8.3
ostrio:files@1.7.12
promise@0.8.8
random@1.0.10
reactive-var@1.0.10
retry@1.0.8
routepolicy@1.0.11
reactive-var@1.0.11
retry@1.0.9
routepolicy@1.0.12
spacebars@1.0.12
spacebars-compiler@1.0.12
tracker@1.1.0
tracker@1.1.2
ui@1.0.11
underscore@1.0.9
url@1.0.10
webapp@1.3.10
underscore@1.0.10
url@1.1.0
webapp@1.3.13
webapp-hashing@1.0.9
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ All PRs is always welcome on [`dev` branch](https://github.com/VeliovGroup/Meteo

Awards:
========
<a href="https://themeteorchef.com/blog/giant-cotton-apron-awards-show"><img src="https://s3.amazonaws.com/tmc-post-content/gcaa-2016-winner-badge.svg"></a>
<a href="https://themeteorchef.com/blog/giant-cotton-apron-awards-show"><img src="https://raw.githubusercontent.com/VeliovGroup/Meteor-Files-Demos/master/GCAA.png"></a>


Demo application:
Expand Down
27 changes: 21 additions & 6 deletions files.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ class FilesCollection
return

if Accounts?
Meteor.startup ->
setTokenCookie()
return
Accounts.onLogin ->
setTokenCookie()
return
Expand Down Expand Up @@ -1090,6 +1093,7 @@ class FilesCollection
self = @
result.type = @_getMimeType opts.file
result.public = @public
@_updateFileTypes result

@collection.insert _.clone(result), (error, _id) ->
if error
Expand Down Expand Up @@ -1216,6 +1220,22 @@ class FilesCollection
else
return { ext: '', extension: '', extensionWithDot: '' }

###
@locus Anywhere
@memberOf FilesCollection
@name _updateFileTypes
@param {Object} data - File data
@summary Internal method. Classify file based on 'type' field
###
_updateFileTypes: (data) ->
data.isVideo = /^video\//i.test data.type
data.isAudio = /^audio\//i.test data.type
data.isImage = /^image\//i.test data.type
data.isText = /^text\//i.test data.type
data.isJSON = /^application\/json$/i.test data.type
data.isPDF = /^application\/(x-)?pdf$/i.test data.type
return

###
@locus Anywhere
@memberOf FilesCollection
Expand All @@ -1239,14 +1259,9 @@ class FilesCollection
size: data.size
type: data.type
extension: data.extension
isVideo: /^video\//i.test data.type
isAudio: /^audio\//i.test data.type
isImage: /^image\//i.test data.type
isText: /^text\//i.test data.type
isJSON: /application\/json/i.test data.type
isPDF: /application\/pdf|application\/x-pdf/i.test data.type
_downloadRoute: data._downloadRoute or @downloadRoute
_collectionName: data._collectionName or @collectionName
@_updateFileTypes ds
ds._storagePath = data._storagePath or @storagePath(_.extend(data, ds))
return ds

Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'ostrio:files',
version: '1.7.11',
version: '1.7.12',
summary: 'Upload files via DDP, HTTP and WebRTC/DC. To server FS, AWS, GridFS, DropBox or Google Drive.',
git: 'https://github.com/VeliovGroup/Meteor-Files',
documentation: 'README.md'
Expand Down

0 comments on commit c51c186

Please sign in to comment.