summaryrefslogtreecommitdiffstats
path: root/data/js/script.js
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-07-13 00:31:51 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-07-13 00:31:51 +0200
commit0d173835ee7f411cbfe39b8d0d3bb9dbd8a0acda (patch)
treea433f0c63ecf7f0e9c9d3d397e4ca1b142db50da /data/js/script.js
parent9c0ca4d33b6571c969ac5084da6006688bb2991a (diff)
Handle enter key in lexer dropdown's text input
Before it would simply redirect to "base_url/ID/?", now if you enter "foo" in the text box and don't select any value below you will go to "base_url/ID/foo". Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'data/js/script.js')
-rw-r--r--data/js/script.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/data/js/script.js b/data/js/script.js
index 3f145d1be..a7cf3aa54 100644
--- a/data/js/script.js
+++ b/data/js/script.js
@@ -32,6 +32,12 @@ function fixedEncodeURIComponent (str) {
}
});
+ $(document).on("keyup", "#language", function(event) {
+ if (event.keyCode == 13) {
+ window.location = window.paste_base + '/' + fixedEncodeURIComponent($(this).val());
+ }
+ });
+
$('#language-toggle').click(function() {
setTimeout(function() {
$('#language').focus();