Skip to content

Commit 5ab13c1

Browse files
committed
Remove templating dependency
1 parent b9dc5bf commit 5ab13c1

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Awards:
6262
Demo application:
6363
========
6464
- [Live](https://files.veliov.com)
65-
- [Source](https://github.com/VeliovGroup/Meteor-Files/tree/master/demo)
65+
- [Source](https://github.com/VeliovGroup/Meteor-Files-Demos/tree/master/demo)
6666
- [Compiled Demo App](https://github.com/VeliovGroup/Meteor-Files-Demo)
6767
- [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/VeliovGroup/Meteor-Files-Demo)
6868

@@ -79,7 +79,7 @@ The `cfs` is a well known package, but it's huge monster which combines everythi
7979
- Support for `HTTP`, [RTC/DC](https://github.com/VeliovGroup/Meteor-Files/tree/webrtc-data-channel) and `DDP` transports for upload, [read about difference](https://github.com/VeliovGroup/Meteor-Files/wiki/About-Upload-Transports)
8080
- You need store to *[GridFS](https://github.com/VeliovGroup/Meteor-Files/wiki/GridFS-Integration)*, *[AWS S3](https://github.com/VeliovGroup/Meteor-Files/wiki/AWS-S3-Integration)*, *[Google Storage](https://github.com/VeliovGroup/Meteor-Files/wiki/Google-Cloud-Storage-Integration)* or *[DropBox](https://github.com/VeliovGroup/Meteor-Files/wiki/DropBox-Integration)*? (*[Use 3rd-party storage](https://github.com/VeliovGroup/Meteor-Files/wiki/Third-party-storage)*) - *Add it yourself*
8181
- You need to check file mime-type, size or extension? (*[`onBeforeUpload`](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor)*) - *Add it yourself*
82-
- You need to [resize images](https://github.com/VeliovGroup/Meteor-Files/blob/master/demo/server/image-processing.coffee) after upload? (*[`onAfterUpload`](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor)*, *[file's subversions](https://github.com/VeliovGroup/Meteor-Files/wiki/Create-and-Manage-Subversions)*) - *Add it yourself*
82+
- You need to [resize images](https://github.com/VeliovGroup/Meteor-Files-Demos/blob/master/demo/server/image-processing.coffee) after upload? (*[`onAfterUpload`](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor)*, *[file's subversions](https://github.com/VeliovGroup/Meteor-Files/wiki/Create-and-Manage-Subversions)*) - *Add it yourself*
8383

8484
Easy-peasy kids, *yeah*?
8585

@@ -217,7 +217,7 @@ Images.insert({
217217
});
218218
```
219219

220-
For more expressive example see [Upload demo app](https://github.com/VeliovGroup/Meteor-Files/tree/master/demo-simplest-upload)
220+
For more expressive example see [Upload demo app](https://github.com/VeliovGroup/Meteor-Files-Demos/tree/master/demo-simplest-upload)
221221

222222

223223
#### Stream files
@@ -279,7 +279,7 @@ Template.file.helpers({
279279
});
280280
```
281281

282-
For more expressive example see [Streaming demo app](https://github.com/VeliovGroup/Meteor-Files/tree/master/demo-simplest-streaming)
282+
For more expressive example see [Streaming demo app](https://github.com/VeliovGroup/Meteor-Files-Demos/tree/master/demo-simplest-streaming)
283283

284284

285285
#### Download button
@@ -321,7 +321,7 @@ Template.file.helpers({
321321
}
322322
});
323323
```
324-
For more expressive example see [Download demo](https://github.com/VeliovGroup/Meteor-Files/tree/master/demo-simplest-download-button)
324+
For more expressive example see [Download demo](https://github.com/VeliovGroup/Meteor-Files-Demos/tree/master/demo-simplest-download-button)
325325

326326

327327
Supporters:

files.coffee

+11-8
Original file line numberDiff line numberDiff line change
@@ -2371,7 +2371,7 @@ formatFleURL = (fileRef, version = 'original') ->
23712371
else
23722372
return root + "#{fileRef._downloadRoute}/#{fileRef._collectionName}/#{fileRef._id}/#{version}/#{fileRef._id}#{ext}"
23732373

2374-
if Meteor.isClient and Template?
2374+
if Meteor.isClient
23752375
###
23762376
@locus Client
23772377
@TemplateHelper
@@ -2382,13 +2382,16 @@ if Meteor.isClient and Template?
23822382
@example {{fileURL fileRef}}
23832383
@returns {String}
23842384
###
2385-
Template.registerHelper 'fileURL', (fileRef, version) ->
2386-
return undefined if not fileRef or not _.isObject fileRef
2387-
version = if not version or not _.isString(version) then 'original' else version
2388-
if fileRef._id
2389-
return formatFleURL fileRef, version
2390-
else
2391-
return ''
2385+
Meteor.startup ->
2386+
if Template?
2387+
Template.registerHelper 'fileURL', (fileRef, version) ->
2388+
return undefined if not fileRef or not _.isObject fileRef
2389+
version = if not version or not _.isString(version) then 'original' else version
2390+
if fileRef._id
2391+
return formatFleURL fileRef, version
2392+
else
2393+
return ''
2394+
return
23922395

23932396
###
23942397
Export the FilesCollection class

package.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'ostrio:files',
3-
version: '1.7.4',
3+
version: '1.7.5',
44
summary: 'Upload files via DDP, HTTP and WebRTC/DC. To server FS, AWS, GridFS, DropBox or Google Drive.',
55
git: 'https://github.com/VeliovGroup/Meteor-Files',
66
documentation: 'README.md'
@@ -9,7 +9,6 @@ Package.describe({
99
Package.onUse(function(api) {
1010
api.versionsFrom('1.4');
1111
api.use('webapp', 'server');
12-
api.use('templating', 'client', {weak: true});
1312
api.use(['reactive-var', 'tracker', 'http'], 'client');
1413
api.use(['mongo','underscore', 'check', 'random', 'coffeescript', 'ecmascript', 'ostrio:cookies@2.0.5'], ['client', 'server']);
1514
api.addFiles('event-emitter.jsx', 'client');

0 commit comments

Comments
 (0)