2014-07-08 23:14:55 +08:00
|
|
|
Meteor.methods
|
|
|
|
addSlideToCollection: (meetingId, presentationId, slideObject) ->
|
2014-07-09 01:15:30 +08:00
|
|
|
unless Meteor.Slides.findOne({meetingId: meetingId, presentationId: presentationId})?
|
2014-07-10 03:09:10 +08:00
|
|
|
entry =
|
2014-07-08 23:14:55 +08:00
|
|
|
meetingId: meetingId
|
|
|
|
presentationId: presentationId
|
2014-07-10 03:09:10 +08:00
|
|
|
slide:
|
2014-07-08 23:14:55 +08:00
|
|
|
height_ratio: slideObject.height_ratio
|
|
|
|
y_offset: slideObject.y_offset
|
|
|
|
num: slideObject.num
|
|
|
|
x_offset: slideObject.x_offset
|
|
|
|
current: slideObject.current
|
|
|
|
png_uri: slideObject.png_uri
|
|
|
|
txt_uri: slideObject.txt_uri
|
|
|
|
id: slideObject.id
|
|
|
|
width_ratio: slideObject.width_ratio
|
|
|
|
swf_uri: slideObject.swf_uri
|
|
|
|
thumb_uri: slideObject.thumb_uri
|
2014-07-10 03:09:10 +08:00
|
|
|
|
2014-07-08 23:14:55 +08:00
|
|
|
id = Meteor.Slides.insert(entry)
|
|
|
|
console.log "added slide id =[#{id}]:#{slideObject.id} in #{meetingId}. Now there are
|
|
|
|
#{Meteor.Slides.find({meetingId: meetingId}).count()} slides in the meeting"
|