         ]
         @completeTime = kdock.api_complete_time
 
-getMaterialImage = (idx) ->
-  path = join(ROOT, 'assets', 'img', 'material', "0#{idx}.png")
-  <img src={path} className="material-icon" />
-
-constructionIcon = join(ROOT, 'assets', 'img', 'operation', 'build.png')
-
 KdockPanel = React.createClass
   canNotify: false
   getInitialState: ->
     docks: [1..5].map () -> new KDockInfo
   handleResponse: (e) ->
-    {method, path, body, postBody} = e.detail
-    {$ships} = window
+    {path, body, postBody} = e.detail
     {docks} = @state
     switch path
       when '/kcsapi/api_start2'

    @completeTime = -1
  update: (kdock) ->
    switch kdock.api_state
      when -1
        @setLocked()
      when 0
        @empty()
      when 2, 3
        @name = window.$ships[kdock.api_created_ship_id].api_name
        @material =  [

    window.addEventListener 'game.response', @handleResponse
  componentWillUnmount: ->
    window.removeEventListener 'game.response', @handleResponse
  getMaterialImage: (idx) ->
    path = join(ROOT, 'assets', 'img', 'material', "0#{idx}.png")
    <img src={path} className="material-icon" />
  constructionIcon: join(ROOT, 'assets', 'img', 'operation', 'build.png')
  notify: ->
    return if not @canNotify
    completedShips = @state.docks.slice(1).filter(
      (dock) -> 0 <= dock.completeTime < new Date().getTime() + 1000).map(
      (dock) -> i18n.resources.__ dock.name).join(', ')
    notify "#{completedShips} #{__ 'built'}",
      type: __ "Construction"
      icon: @constructionIcon
  render: ->
    <div>
    {
