 { Tutorial }          = require 'zootorial'
 translate             = require 't7e'
 ChannelCycler         = require 'channel-cycler'
+$ = window.jQuery
 
 KEYS =
   space:  32

  loadFrames: =>
    @destroyFrames()
    subject_info = @classification.subject.location
    for i in [0...@numFrames]
      frame_id = "frame-id-#{i}"
      frameImage =
        @markingSurfaceList[i].addShape 'image',

      @frameSlider.attr 'disabled', false
      @cycleButton.removeClass 'active'
    else
      promisedImgs = (loadImage src for src in @classification.subject.location.standard)
      $.when(promisedImgs...).then (imgs...) =>
        if @cycling
          sources = imgs.map (img) -> img.src
          @cc = new ChannelCycler(sources)
          @subjectContainer.append(@cc.canvas)
          @cc.start()
          @cycleButton.addClass 'active'
          @cc.period = 600
          @playButton.attr 'disabled', true
          @frameSlider.attr 'disabled', true
    @cycling = !@cycling

  rerenderMarks: ->
