JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
make selection display clickable (when it's a word)
[hexbog.git] / main.coffee
index a03fa73..015ce7c 100644 (file)
@@ -245,8 +245,8 @@ update_selection_display = ->
        word = selected_word()
        $big_tip.removeClass('good')
        if word.length > 0
-               $big_tip.html word
                if word.length < 3
+                       $big_tip.html word
                        $little_tip.html "Click more tiles (3 minimum)"
                else
                        if is_word word
@@ -255,8 +255,10 @@ update_selection_display = ->
                                else
                                        last = ''
                                $little_tip.html "Click the #{last}\"#{word.substr(word.length - 1)}\" for #{score_for word} points"
+                               $big_tip.html "<a href=\"http://en.wiktionary.org/wiki/#{word}\" target=\"_blank\" title=\"click for definition\">#{word}</a>"
                                $big_tip.addClass('good')
                        else
+                               $big_tip.html word
                                $little_tip.html "\"#{word}\" is not in the word list."
        else
                $big_tip.html "← Click a word"