Refactor website with new design & structure

This commit is contained in:
Andrew Miner
2016-04-03 19:30:15 -07:00
parent ec7e8c883d
commit d69585facd
406 changed files with 7411 additions and 37859 deletions
@@ -0,0 +1,34 @@
#
# Crafting Guide - video_controller.coffee
#
# Copyright © 2014-2016 by Redwood Labs
# All rights reserved.
#
BaseController = require '../../base_controller'
########################################################################################################################
module.exports = class VideoController extends BaseController
constructor: (options={})->
if not options.model? then throw new Error 'options.model is required'
options.templateName = 'common/video'
super options
# BaseController Overrides #####################################################################
onDidRender: ->
@$iframe = @$('iframe')
@$caption = @$('.caption p')
super
refresh: ->
@$caption.html @model.name
@$iframe.attr 'src', @_createYouTubeUrl()
super
# Private ######################################################################################
_createYouTubeUrl: ->
return "http://www.youtube.com/embed/#{@model.youTubeId}?modestbranding=1&autohide=1&showinfo=0"