]> iEval git - gruntmaster-page.git/blame - js/90-divine-format.js
Remove smap attributes
[gruntmaster-page.git] / js / 90-divine-format.js
CommitLineData
cb84f123
MG
1(function(){
2 'use strict';
3
4 function divine_format() {
5 var filename = $('#prog').val();
6 var ext = /\.([^.]*)$/.exec(filename)[1];
7 var format;
8
9 switch(ext) {
10 case 'c':
11 format = 'C';
12 break;
13 case 'cc':
14 case 'cpp':
15 case 'cxx':
16 case 'C':
17 format = 'CPP';
18 break;
19 case 'go':
20 format = 'GOLANG';
21 break;
22 case 'hs':
23 case 'lhs':
24 format = 'HASKELL';
25 break;
e6d1bcd4
MG
26 case 'lisp':
27 case 'lsp':
28 case 'cl':
29 case 'l':
30 format = 'SBCL';
31 break;
cb84f123
MG
32 case 'java':
33 format = 'JAVA';
34 break;
35 case 'pas':
36 format = 'PASCAL';
37 break;
38 case 'pl':
39 format = 'PERL';
40 break;
41 case 'py':
42 format = 'PYTHON';
43 break;
137c1af1
MG
44 case 'rb':
45 format = 'RUBY';
46 break;
cb84f123
MG
47 }
48
49 if(format)
50 $('#prog_format').val(format);
51 }
52
53 $( document ).ready(function() {
54 $('#prog').on('change', divine_format);
55 });
56})();
This page took 0.038832 seconds and 4 git commands to generate.