]> iEval git - gruntmaster-page.git/blob - js/90-divine-format.js
Merge branch 'master' into newmc
[gruntmaster-page.git] / js / 90-divine-format.js
1 var ext_table = {
2 'c' : 'C',
3
4 'cc' : 'CPP',
5 'cpp' : 'CPP',
6 'cxx' : 'CPP',
7 'C' : 'CPP',
8
9 'go' : 'GOLANG',
10
11 'gs' : 'GOLFSCRIPT',
12
13 'hs' : 'HASKELL',
14 'lhs' : 'HASKELL',
15
16 'lisp': 'SBCL',
17 'lsp' : 'SBCL',
18 'cl' : 'SBCL',
19 'l' : 'SBCL',
20
21 'java': 'JAVA',
22
23 'pas' : 'PASCAL',
24
25 'pl' : 'PERL',
26
27 'py' : 'PYTHON',
28
29 'rb' : 'RUBY'
30 }
31
32 function divine_format() {
33 var filename = $('#prog')[0].value;
34 var ext = /\.([^.]*)$/.exec(filename)[1];
35
36 if(ext_table[ext])
37 $('#prog_format')[0].value = ext_table[ext];
38 }
39
40 $(() => $('#prog').on('change', divine_format));
This page took 0.040613 seconds and 4 git commands to generate.