worked on slides collection
This commit is contained in:
parent
168eb4e715
commit
abddc57c6f
@ -0,0 +1,23 @@
|
||||
Meteor.methods
|
||||
addSlideToCollection: (meetingId, presentationId, slideObject) ->
|
||||
unless Meteor.Slides.findOne({meetingId: meetingId, "slide.id": "slideObject.id"})?
|
||||
entry = {
|
||||
meetingId: meetingId
|
||||
presentationId: presentationId
|
||||
slide: {
|
||||
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
|
||||
}
|
||||
}
|
||||
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"
|
@ -132,11 +132,21 @@ class Meteor.RedisPubSub
|
||||
# this way can keep the Meetings collection up to date
|
||||
@invokeGetAllMeetingsRequest()
|
||||
|
||||
if message.header?.name is "presentation_shared_message"
|
||||
presentationId = message.payload?.presentation?.id
|
||||
for slide in message.payload?.presentation?.pages
|
||||
Meteor.call("addSlideToCollection", meetingId, presentationId, slide)
|
||||
|
||||
if message.header?.name is "get_presentation_info_reply" and message.payload?.requester_id is "nodeJSapp"
|
||||
# to do: grab the whiteboard shapes using the whiteboard_id we have here
|
||||
|
||||
for presentation in message.payload?.presentations
|
||||
for page in presentation.pages
|
||||
#add the slide to the collection
|
||||
presentationId = message.payload?.presentation?.id
|
||||
Meteor.call("addSlideToCollection", meetingId, presentationId, page)
|
||||
|
||||
#request for shapes
|
||||
whiteboardId = "#{presentation.id}/#{page.num}" # d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1404411622872/1
|
||||
console.log "the whiteboard_id here is:" + whiteboardId
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user