@@ -16,7 +16,7 @@ export class GitCloneForm extends Widget {
1616 /**
1717 * Returns the input value.
1818 */
19- getValue ( ) : { url : string ; versioning : boolean } {
19+ getValue ( ) : { url : string ; versioning : boolean ; submodules : boolean } {
2020 return {
2121 url : encodeURIComponent (
2222 (
@@ -25,7 +25,12 @@ export class GitCloneForm extends Widget {
2525 ) ,
2626 versioning : Boolean (
2727 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
2934 )
3035 )
3136 } ;
@@ -38,33 +43,48 @@ export class GitCloneForm extends Widget {
3843 const inputLink = document . createElement ( 'input' ) ;
3944 const linkText = document . createElement ( 'span' ) ;
4045 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' ) ;
4350
4451 node . className = 'jp-CredentialsBox' ;
4552 inputWrapper . className = 'jp-RedirectForm' ;
4653 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' ;
4958 inputLink . id = 'input-link' ;
5059
5160 linkText . textContent = trans . __ (
5261 'Enter the URI of the remote Git repository'
5362 ) ;
5463 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 . __ (
5774 'If checked, the remote repository default branch will be downloaded instead of cloned'
5875 ) ;
59- checkbox . setAttribute ( 'type' , 'checkbox' ) ;
76+ download . setAttribute ( 'type' , 'checkbox' ) ;
6077
6178 inputLinkLabel . appendChild ( linkText ) ;
6279 inputLinkLabel . appendChild ( inputLink ) ;
6380
6481 inputWrapper . append ( inputLinkLabel ) ;
6582
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 ) ;
6888
6989 node . appendChild ( inputWrapper ) ;
7090 node . appendChild ( checkboxWrapper ) ;
0 commit comments