@@ -16,7 +16,7 @@ export class GitCloneForm extends Widget {
16
16
/**
17
17
* Returns the input value.
18
18
*/
19
- getValue ( ) : { url : string ; versioning : boolean } {
19
+ getValue ( ) : { url : string ; versioning : boolean ; submodules : boolean } {
20
20
return {
21
21
url : encodeURIComponent (
22
22
(
@@ -25,7 +25,12 @@ export class GitCloneForm extends Widget {
25
25
) ,
26
26
versioning : Boolean (
27
27
encodeURIComponent (
28
- ( this . node . querySelector ( '#checkbox' ) as HTMLInputElement ) . checked
28
+ ( this . node . querySelector ( '#download' ) as HTMLInputElement ) . checked
29
+ )
30
+ ) ,
31
+ submodules : Boolean (
32
+ encodeURIComponent (
33
+ ( this . node . querySelector ( '#submodules' ) as HTMLInputElement ) . checked
29
34
)
30
35
)
31
36
} ;
@@ -38,33 +43,48 @@ export class GitCloneForm extends Widget {
38
43
const inputLink = document . createElement ( 'input' ) ;
39
44
const linkText = document . createElement ( 'span' ) ;
40
45
const checkboxWrapper = document . createElement ( 'div' ) ;
41
- const checkboxLabel = document . createElement ( 'label' ) ;
42
- const checkbox = document . createElement ( 'input' ) ;
46
+ const subModulesLabel = document . createElement ( 'label' ) ;
47
+ const subModules = document . createElement ( 'input' ) ;
48
+ const downloadLabel = document . createElement ( 'label' ) ;
49
+ const download = document . createElement ( 'input' ) ;
43
50
44
51
node . className = 'jp-CredentialsBox' ;
45
52
inputWrapper . className = 'jp-RedirectForm' ;
46
53
checkboxWrapper . className = 'jp-CredentialsBox-wrapper' ;
47
- checkboxLabel . className = 'jp-CredentialsBox-label-checkbox' ;
48
- checkbox . id = 'checkbox' ;
54
+ subModulesLabel . className = 'jp-CredentialsBox-label-checkbox' ;
55
+ downloadLabel . className = 'jp-CredentialsBox-label-checkbox' ;
56
+ subModules . id = 'submodules' ;
57
+ download . id = 'download' ;
49
58
inputLink . id = 'input-link' ;
50
59
51
60
linkText . textContent = trans . __ (
52
61
'Enter the URI of the remote Git repository'
53
62
) ;
54
63
inputLink . placeholder = 'https://host.com/org/repo.git' ;
55
- checkboxLabel . textContent = trans . __ ( 'Download the repository' ) ;
56
- checkboxLabel . title = trans . __ (
64
+
65
+ subModulesLabel . textContent = trans . __ ( 'Include submodules' ) ;
66
+ subModulesLabel . title = trans . __ (
67
+ 'If checked, the remote submodules in the repository will be cloned recursively'
68
+ ) ;
69
+ subModules . setAttribute ( 'type' , 'checkbox' ) ;
70
+ subModules . setAttribute ( 'checked' , 'checked' ) ;
71
+
72
+ downloadLabel . textContent = trans . __ ( 'Download the repository' ) ;
73
+ downloadLabel . title = trans . __ (
57
74
'If checked, the remote repository default branch will be downloaded instead of cloned'
58
75
) ;
59
- checkbox . setAttribute ( 'type' , 'checkbox' ) ;
76
+ download . setAttribute ( 'type' , 'checkbox' ) ;
60
77
61
78
inputLinkLabel . appendChild ( linkText ) ;
62
79
inputLinkLabel . appendChild ( inputLink ) ;
63
80
64
81
inputWrapper . append ( inputLinkLabel ) ;
65
82
66
- checkboxLabel . prepend ( checkbox ) ;
67
- checkboxWrapper . appendChild ( checkboxLabel ) ;
83
+ subModulesLabel . prepend ( subModules ) ;
84
+ checkboxWrapper . appendChild ( subModulesLabel ) ;
85
+
86
+ downloadLabel . prepend ( download ) ;
87
+ checkboxWrapper . appendChild ( downloadLabel ) ;
68
88
69
89
node . appendChild ( inputWrapper ) ;
70
90
node . appendChild ( checkboxWrapper ) ;
0 commit comments