mirror of https://github.com/torappinfo/uweb
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
560 B
JavaScript
25 lines
560 B
JavaScript
var editor;
|
|
onload=function(){
|
|
function getMode(filename){
|
|
var ext = filename.split('.').pop();
|
|
var prefix = "ace/mode/";
|
|
if(!ext) return prefix + "text";
|
|
|
|
switch (ext) {
|
|
case "js":
|
|
return prefix + "javascript";
|
|
}
|
|
return prefix + ext;
|
|
}
|
|
|
|
editor = ace.edit("editor");
|
|
editor.setTheme("ace/theme/clouds");
|
|
editor.setShowPrintMargin(false);
|
|
editor.setOptions({
|
|
enableBasicAutocompletion: true,
|
|
enableSnippets: true,
|
|
enableLiveAutocompletion: true
|
|
});
|
|
editor.session.setMode(getMode(location.href));
|
|
}
|