JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
make selection display clickable (when it's a word)
authorJason Woofenden <jason@jasonwoof.com>
Tue, 29 Oct 2013 19:25:54 +0000 (15:25 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Tue, 29 Oct 2013 19:25:54 +0000 (15:25 -0400)
main.coffee
style.less

index a03fa73..015ce7c 100644 (file)
@@ -245,8 +245,8 @@ update_selection_display = ->
        word = selected_word()
        $big_tip.removeClass('good')
        if word.length > 0
        word = selected_word()
        $big_tip.removeClass('good')
        if word.length > 0
-               $big_tip.html word
                if word.length < 3
                if word.length < 3
+                       $big_tip.html word
                        $little_tip.html "Click more tiles (3 minimum)"
                else
                        if is_word 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"
                                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.addClass('good')
                        else
+                               $big_tip.html word
                                $little_tip.html "\"#{word}\" is not in the word list."
        else
                $big_tip.html "← Click a word"
                                $little_tip.html "\"#{word}\" is not in the word list."
        else
                $big_tip.html "← Click a word"
index 80126ab..e975a82 100644 (file)
@@ -76,8 +76,9 @@ body {
                color: darken(@selected-color, 66%);
                text-align: center;
        }
                color: darken(@selected-color, 66%);
                text-align: center;
        }
-       #big_tip.good {
+       #big_tip.good a {
                color: darken(@selected-good-color, 66%);
                color: darken(@selected-good-color, 66%);
+               text-decoration: none;
        }
        #score_container {
                margin-top: 10px;
        }
        #score_container {
                margin-top: 10px;