 
   $('.action-item').click (event) ->
     if range = getSelectionLineRange()
-      line = getSelectionLine(minute, range.fst, range.lst)
+      minute = getCurrentPageAsJSON()
+      line = extractLines(minute.content, range.fst, range.lst)
       setupAutoCompleteRepository('#repository', repos_list)
-      repos_list = getGithubTargetRepository(minute, repos_list)
+      repos_list = findKeywords(minute.content, repos_list)
       displayGithubRepository(repos_list)
       displaySelectionLineRange(chopIndent(line))
       displayTitle(removeTrailer(removeHeader(line.split("\n")[-1..][0])))

        repos.push (if full then r.full_name else r.name)
      callback(repos)

# Guess suitable repository candidates by
# scanning the content of MINUTE.
#
# Candidates are scanned from user's profile
# via GitHub API
#
getGithubTargetRepository = (minute, repos_list) ->
  regexp = array_to_regexp(repos_list, "g")
  repos = minute.content.match(regexp)
  repos_list = repos.filter((x, i, self) ->
    self.indexOf(x) == i
  )
  # alert (if repos then repos.join("\n") else "NO match")
  repos_list

setupAutoCompleteEmoji = (element) ->
  img_url = "https://raw.githubusercontent.com/Ranks/emojify.js/master/src/images/emoji"

                       <td>#{minute.title || ""}</td>\
                       <td>#{minute.dtstart || ""}</td>\
                       <td>#{minute.location || ""}</td>\
                       <td>#{minute.author?.name || ""}</td>\
                       <td><a href='/minutes/#{minute.id}'>Show</a></td>\
                       <td><a href='/minutes/#{minute.id}/edit'>Edit</a></td>\
                       <td><a href='/minutes/#{minute.id}' data-method='delete' rel='nofollow' data-confirm='Are you sure?'>Destroy</a></td>\
