diff --git a/.versions b/.versions index 2a2342b3..16c3b3d7 100644 --- a/.versions +++ b/.versions @@ -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 diff --git a/README.md b/README.md index 931fac57..9e62609c 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ All PRs is always welcome on [`dev` branch](https://github.com/VeliovGroup/Meteo Awards: ======== - + Demo application: diff --git a/files.coffee b/files.coffee index ee1fbdc0..79004777 100755 --- a/files.coffee +++ b/files.coffee @@ -566,6 +566,9 @@ class FilesCollection return if Accounts? + Meteor.startup -> + setTokenCookie() + return Accounts.onLogin -> setTokenCookie() return @@ -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 @@ -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 @@ -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 diff --git a/package.js b/package.js index a4daf213..39cd6c91 100755 --- a/package.js +++ b/package.js @@ -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'