X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-divine-format.js;h=f8bd6a9bc47ce25e3a312bf1912c58434b246d0f;hb=7baee29b2642aabb77a24745dc8be86440c30a4f;hp=e44bf908b4a3395a36fd6e5e734803c54aca0da2;hpb=502d9da0a5843c9ecef1a6226f98ed3d5a233dbc;p=gruntmaster-page.git diff --git a/js/90-divine-format.js b/js/90-divine-format.js index e44bf90..f8bd6a9 100644 --- a/js/90-divine-format.js +++ b/js/90-divine-format.js @@ -1,6 +1,10 @@ -var ext_table = { +const ext_table = { + 'bf' : 'BRAINFUCK', + 'c' : 'C', + 'd' : 'D', + 'cc' : 'CPP', 'cpp' : 'CPP', 'cxx' : 'CPP', @@ -20,23 +24,29 @@ var ext_table = { 'java': 'JAVA', + 'jl' : 'JULIA', + + 'ml' : 'OCAML', + 'pas' : 'PASCAL', 'pl' : 'PERL', + 'php' : 'PHP', + 'py' : 'PYTHON', - 'rb' : 'RUBY' + 'rb' : 'RUBY', + + 'rs' : 'RUST' } function divine_format() { - var filename = $('#prog')[0].value; - var ext = /\.([^.]*)$/.exec(filename)[1]; + const filename = q('#prog').value; + const ext = /\.([^.]*)$/.exec(filename)[1]; if(ext_table[ext]) - $('#prog_format')[0].value = ext_table[ext]; + q('#prog_format').value = ext_table[ext]; } -$(function() { - $('#prog').on('change', divine_format); -}); +$(() => $('#prog').on('change', divine_format));