1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 17:02:47 +00:00

Init text shared (#2908)

This commit is contained in:
C_Q
2019-02-01 18:44:10 +08:00
committed by Daniel Pan
parent 56613d95d4
commit 90324d3d87
10 changed files with 253 additions and 13 deletions

View File

@@ -666,4 +666,37 @@ export const Utils = {
return nodes;
},
chooseLanguage: function(suffix) {
let mode;
switch(suffix) {
case 'py':
mode = 'python';
break;
case 'js':
mode = 'javascript';
break;
case 'c':
mode = 'text/x-csrc';
break;
case 'cpp':
mode = 'text/x-c++src';
break;
case 'java':
mode = 'text/x-java';
break;
case 'cs':
mode = 'text/x-csharp';
break;
case 'mdf':
mode = 'text/x-sql';
break;
case 'html':
mode = 'htmlmixed';
break;
default:
mode = suffix;
}
return mode;
},
};