Add Rust, Julia, Brainfuck, PHP, OCaml and D
[gruntmaster-page.git] / js / 90-divine-format.js
index ab5a5f29fae79797592f7aae43fcef65d9e96e95..f8bd6a9bc47ce25e3a312bf1912c58434b246d0f 100644 (file)
@@ -1,6 +1,10 @@
-var ext_table = {
+const ext_table = {
+       'bf'  : 'BRAINFUCK',
+
        'c'   : 'C',
 
+       'd'   : 'D',
+
        'cc'  : 'CPP',
        'cpp' : 'CPP',
        'cxx' : 'CPP',
@@ -20,21 +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];
 }
 
 $(() => $('#prog').on('change', divine_format));
This page took 0.010051 seconds and 4 git commands to generate.