-
Notifications
You must be signed in to change notification settings - Fork 52
/
index.js
26 lines (26 loc) · 1.09 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var get_source = function(main_dir, dir, file){
var disclaimer = "";
if(file != "Facade")
var url = "Model/design_patterns/" + main_dir + "/" + dir + "/" + file + ".js";
else var url = "Model/design_patterns/"+file + ".js";
$.ajax({
url: url,
dataType: "script",
success: function(data){
var editor = ace.edit("editor_"+file);
editor.setTheme("ace/theme/chrome");
editor.getSession().setMode("ace/mode/javascript");
editor.getSession().setUseWrapMode(true);
editor.setReadOnly(true);
editor.setValue(disclaimer+data,-1);
},
error: function(data){
var editor = ace.edit("editor_"+file);
editor.setTheme("ace/theme/chrome");
editor.getSession().setMode("ace/mode/javascript");
editor.getSession().setUseWrapMode(true);
//editor.setReadOnly(true);
editor.setValue(disclaimer+"//Not yet",-1);
}
});
}