2015-02-25 05:29:32 +08:00
|
|
|
# redraw the whiteboard to adapt to the resized window
|
2015-03-31 07:03:41 +08:00
|
|
|
@redrawWhiteboard = (callback) ->
|
2015-01-07 01:42:37 +08:00
|
|
|
adjustedDimensions = scaleSlide(getInSession('slideOriginalWidth'), getInSession('slideOriginalHeight'))
|
|
|
|
wpm = whiteboardPaperModel
|
|
|
|
wpm.scale(adjustedDimensions.width, adjustedDimensions.height)
|
2015-03-31 07:03:41 +08:00
|
|
|
if callback
|
|
|
|
callback()
|
2015-03-28 08:59:56 +08:00
|
|
|
|
2015-05-08 02:14:47 +08:00
|
|
|
Template.whiteboard.helpers
|
|
|
|
presentationProgress: ->
|
|
|
|
currentPresentation = Meteor.Presentations.findOne({'presentation.current':true})
|
|
|
|
currentSlideNum = Meteor.Slides.findOne({'presentationId': currentPresentation?.presentation.id, 'slide.current':true})?.slide.num
|
|
|
|
totalSlideNum = Meteor.Slides.find({'presentationId': currentPresentation?.presentation.id})?.count()
|
2015-05-26 06:30:57 +08:00
|
|
|
if currentSlideNum isnt undefined
|
|
|
|
return "#{currentSlideNum}/#{totalSlideNum}"
|
|
|
|
else
|
|
|
|
return ''
|
2015-07-21 09:23:42 +08:00
|
|
|
isPollStarted: ->
|
2015-07-29 04:25:04 +08:00
|
|
|
if BBB.isPollGoing(getInSession('userId'))
|
2015-07-21 09:23:42 +08:00
|
|
|
return true
|
|
|
|
else
|
2015-07-29 04:25:04 +08:00
|
|
|
return false
|
|
|
|
|
2015-03-28 08:59:56 +08:00
|
|
|
Template.whiteboard.events
|
2015-06-04 05:49:26 +08:00
|
|
|
'click .whiteboardFullscreenButton': (event, template) ->
|
2015-06-03 05:44:06 +08:00
|
|
|
enterWhiteboardFullscreen()
|
2015-06-04 05:49:26 +08:00
|
|
|
|
|
|
|
'click .exitFullscreenButton': (event, template) ->
|
|
|
|
if document.exitFullscreen
|
|
|
|
document.exitFullscreen()
|
|
|
|
else if document.mozCancelFullScreen
|
|
|
|
document.mozCancelFullScreen()
|
|
|
|
else if document.webkitExitFullscreen
|
|
|
|
document.webkitExitFullscreen()
|
2015-06-11 02:45:11 +08:00
|
|
|
|
|
|
|
'click .raiseHand': (event) ->
|
|
|
|
BBB.raiseHand(BBB.getMeetingId(), getInSession('userId'), getInSession('userId'), getInSession('authToken'))
|
|
|
|
|
|
|
|
'click .lowerHand': (event) ->
|
|
|
|
BBB.lowerHand(BBB.getMeetingId(), getInSession('userId'), getInSession('userId'), getInSession('authToken'))
|
2015-07-21 09:23:42 +08:00
|
|
|
|
2015-09-09 07:57:39 +08:00
|
|
|
Template.presenterBottomControllers.events
|
|
|
|
'click .previousSlide':(event) ->
|
|
|
|
console.log "previous"
|
|
|
|
BBB.goToPreviousPage()
|
|
|
|
|
|
|
|
'click .nextSlide':(event) ->
|
|
|
|
console.log "next"
|
|
|
|
BBB.goToNextPage()
|
|
|
|
|
|
|
|
'click .switchSlideButton': (event) ->
|
|
|
|
$('.tooltip').hide()
|
|
|
|
|
|
|
|
Template.polling.events
|
2015-07-31 08:08:12 +08:00
|
|
|
'click .pollButtons': (event) ->
|
|
|
|
_key = @.label
|
|
|
|
_id = @.answer
|
|
|
|
BBB.sendPollResponseMessage(_key, _id)
|
|
|
|
|
2015-09-09 07:57:39 +08:00
|
|
|
Template.polling.rendered = ->
|
|
|
|
redrawWhiteboard()
|
|
|
|
|
|
|
|
Template.polling.destroyed = ->
|
|
|
|
setTimeout(redrawWhiteboard, 0)
|
|
|
|
|
|
|
|
Template.presenterBottomControllers.rendered = ->
|
|
|
|
redrawWhiteboard()
|
|
|
|
|
|
|
|
Template.presenterBottomControllers.destroyed = ->
|
|
|
|
setTimeout(redrawWhiteboard, 0)
|
|
|
|
|
2015-07-23 05:15:20 +08:00
|
|
|
Template.whiteboard.rendered = ->
|
|
|
|
$('#whiteboard').resizable
|
|
|
|
handles: 'e'
|
|
|
|
minWidth: 150
|
2015-07-23 05:25:46 +08:00
|
|
|
resize: () ->
|
|
|
|
adjustChatInputHeight()
|
2015-07-23 05:15:20 +08:00
|
|
|
start: () ->
|
2015-07-23 06:32:10 +08:00
|
|
|
if $('#chat').width() / $('#panels').width() > 0.2 # chat shrinking can't make it smaller than one fifth of the whiteboard-chat area
|
|
|
|
$('#whiteboard').resizable('option', 'maxWidth', $('#panels').width() - 200) # gives the chat enough space (200px)
|
|
|
|
else
|
|
|
|
$('#whiteboard').resizable('option', 'maxWidth', $('#whiteboard').width())
|
2015-07-23 05:15:20 +08:00
|
|
|
stop: () ->
|
|
|
|
$('#whiteboard').css('width', 100 * $('#whiteboard').width() / $('#panels').width() + '%') # transforms width to %
|
|
|
|
$('#whiteboard').resizable('option', 'maxWidth', null)
|