@@ -27,58 +27,61 @@ const TestCode = new function() {
27
27
styleActiveLine : true ,
28
28
matchBrackets : true ,
29
29
indentUnit : 4 ,
30
+ indentWithTabs : false ,
31
+ extraKeys : {
32
+ Tab : TestCommon . Utils . convertTabToSpaces
33
+ } ,
30
34
} ) ;
31
35
codeEditor = this . codeEditor ;
32
36
CodeMirror . commands . autocomplete = function ( cm ) {
33
-
34
- CodeMirror . simpleHint ( cm , CodeMirror . pythonHint ) ;
35
- }
36
- codeEditor . on ( "keyup" , function ( cm , event ) {
37
- if ( ! cm . state . completionActive && /*Enables keyboard navigation in autocomplete list*/
38
- ( event . keyCode > 64 && event . keyCode < 220 ) || ( event . keyCode == 190 ) ) { // only when a letter key is pressed
39
- codeEditor . execCommand ( "autocomplete" )
40
- }
41
- } ) ;
37
+ CodeMirror . simpleHint ( cm , CodeMirror . pythonHint ) ;
38
+ }
39
+ codeEditor . on ( "keyup" , function ( cm , event ) {
40
+ if ( ! cm . state . completionActive && /*Enables keyboard navigation in autocomplete list*/
41
+ ( event . keyCode > 64 && event . keyCode < 220 ) || ( event . keyCode == 190 ) ) { // only when a letter key is pressed
42
+ codeEditor . execCommand ( "autocomplete" )
43
+ }
44
+ } ) ;
42
45
43
- if ( Global . user . projectWeight < Main . PermissionWeightsEnum . standard ) {
46
+ if ( Global . user . projectWeight < Main . PermissionWeightsEnum . standard ) {
44
47
this . codeEditor . setOption ( 'readOnly' , 'nocursor' )
45
48
}
46
49
// set unsaved changes watcher
47
50
this . watchForUnsavedChanges ( ) ;
48
51
}
52
+
49
53
this . getGolemActions = function ( ) {
50
54
xhr . get ( '/api/golem/actions' , {
51
55
project : this . file . project
52
56
} , golemAction => {
53
57
golemAction . forEach ( function ( action ) {
54
- TestCode . golemActions . push ( action . name )
55
- } )
58
+ TestCode . golemActions . push ( action . name )
59
+ } )
56
60
} )
57
61
58
62
}
59
63
this . getAllProjectPages = function ( ) {
60
64
xhr . get ( '/api/project/pages' , {
61
65
project : this . file . project
62
66
} , pages => {
63
- pages . forEach ( function ( page ) {
64
- TestCode . getPageContents ( page )
65
- } ) ;
67
+ pages . forEach ( function ( page ) {
68
+ TestCode . getPageContents ( page )
69
+ } ) ;
66
70
} )
67
71
}
68
72
this . getPageContents = function ( pageName ) {
69
73
xhr . get ( '/api/page/components' , {
70
74
project : this . file . project ,
71
75
page : pageName
72
76
} , result => {
73
- if ( result . error == 'page does not exist' ) {
77
+ if ( result . error == 'page does not exist' ) {
74
78
// mark page as not existent
75
79
$ ( `input[value='${ pageName } ']` ) . addClass ( 'not-exist' ) ;
76
- }
77
- else {
80
+ } else {
78
81
let elemets = result . components . elements
79
82
elemets . forEach ( function ( pagefull ) {
80
83
TestCode . importedPages . push ( pagefull . full_name )
81
- } )
84
+ } )
82
85
}
83
86
} )
84
87
}
0 commit comments