bigbluebutton-Github/labs/meteor-client/collections/shapes.coffee

27 lines
1.0 KiB
CoffeeScript
Raw Normal View History

2014-07-08 03:08:24 +08:00
Meteor.methods
addShapeToCollection: (meetingId, whiteboardId, shapeObject) ->
2014-07-08 04:17:09 +08:00
unless Meteor.Shapes.findOne({whiteboardId:whiteboardId, meetingId: meetingId, "shape.wb_id": "shapeObject.wb_id"})?
entry = {
meetingId: meetingId
whiteboardId: whiteboardId
2014-07-08 03:08:24 +08:00
shape: {
2014-07-08 04:17:09 +08:00
wb_id: shapeObject.wb_id
shape_type: shapeObject.shape_type
status: shapeObject.status
id: shapeObject.id
shape: {
type: shapeObject.shape.type
status: shapeObject.shape.status
points: shapeObject.shape.points
whiteboardId: shapeObject.shape.whiteboardId
id: shapeObject.shape.id
square: shapeObject.shape.square
transparency: shapeObject.shape.transparency
thickness: shapeObject.shape.thickness
color: shapeObject.shape.color
}
2014-07-08 03:08:24 +08:00
}
}
2014-07-08 04:17:09 +08:00
id = Meteor.Shapes.insert(entry)
console.log "added shape id =[#{id}]:#{shapeObject.id} in #{meetingId}"