From fe68477d8b60bc9303dd2bcd542915ac05e3fac6 Mon Sep 17 00:00:00 2001 From: Joakim Reinert Date: Sat, 18 Apr 2015 23:55:22 +0200 Subject: Refactor lexer input setup --- data/js/script.js | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'data/js/script.js') diff --git a/data/js/script.js b/data/js/script.js index 91df1b786..242456971 100644 --- a/data/js/script.js +++ b/data/js/script.js @@ -1,22 +1,5 @@ -function fixedEncodeURIComponent (str) { - return encodeURIComponent(str).replace(/[!'()]/g, escape).replace(/\*/g, "%2A"); -} - (function($) { $(function() { - var lexer_source = []; - for (var key in window.lexers) { - lexer_source.push({ label: window.lexers[key], value: key }); - } - - $('[id^=language-]').autocomplete({ - source: lexer_source, - select: function(event, ui) { - event.preventDefault(); - window.location = $(event.target).data("base-url") + '/' + fixedEncodeURIComponent(ui.item.value); - } - }); - $('a.tabwidth-toggle').on('click', function (event) { setTimeout(function () { $(event.target).siblings('.dropdown-menu').find('input').trigger('focus'); @@ -52,19 +35,6 @@ function fixedEncodeURIComponent (str) { event.stopImmediatePropagation(); }); - $(document).on("keyup", "[id^=language-]", function(event) { - if (event.keyCode == 13) { - event.preventDefault(); - window.location = $(event.target).data("base-url") + '/' + fixedEncodeURIComponent($(this).val()); - } - }); - - $('[id^=language-toggle-]').click(function(event) { - setTimeout(function() { - $(event.target).parent().find('[id^=language-]').focus(); - }, 0); - }); - $('[rel="tooltip"]').tooltip({ placement: 'bottom', container: 'body', -- cgit v1.2.3-24-g4f1b