-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbugfixing_ui.js
39 lines (34 loc) · 959 Bytes
/
bugfixing_ui.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
27
28
29
30
31
32
33
34
35
36
37
38
39
/* global AceEditor*/
function bugFixingUI(options){
var self = {};
self.options = options;
self.getOption = function(option){
if (typeof self.options !== "undefined"){
if (option in self.options){
return self.options[option];
}
}
return null;
};
self.updateModified = function(){
//console.log("changeEvent fired");
//self.editor.ace.undo();
};
self.onKeyPress = function(){
};
self.setupEditor = function() {
self.editor = AceEditor();
self.editor.onChangeEvent(self.updateModified);
var readOnlyRegions = self.getOption("readOnlyRegions");
if (readOnlyRegions){
self.editor.setReadOnlyRegions(readOnlyRegions);
}
self.editor.setNoNewLines(true);
};
self.init = function(){
self.setupEditor();
};
self.onKeyPress = function(){
};
return self;
}