Make JS a bit simpler
[plack-app-gruntmaster.git] / js / 90-divine-format.js
index e44bf908b4a3395a36fd6e5e734803c54aca0da2..a842de1353c790ea649ba05cdfff7ce53f67a178 100644 (file)
@@ -1,4 +1,4 @@
-var ext_table = {
+const ext_table = {
        'c'   : 'C',
 
        'cc'  : 'CPP',
@@ -30,13 +30,11 @@ var ext_table = {
 }
 
 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));
This page took 0.010424 seconds and 4 git commands to generate.