@@ -71,11 +71,13 @@ body {
71
71
set param = "NoFolders"
72
72
kill settings.Mappings
73
73
74
- while ( $Get(%request.Data("MappingsExt",i)) '= "" ){
75
- if ($Get(%request.Data(param,i)) = "NoFolders"){
76
- set settings.Mappings($Get(%request.Data("MappingsExt",i)), $Get(%request.Data("MappingsCov",i)), $Get(%request.Data(param,i))) = 1
77
- }
78
- set settings.Mappings($Get(%request.Data("MappingsExt",i)), $Get(%request.Data("MappingsCov",i))) = $Get(%request.Data("MappingsPath",i))
74
+ while ( $Data(%request.Data("MappingsExt",i)) ){
75
+ if ($get(%request.Data("MappingsExt",i)) '= "") {
76
+ if ($Get(%request.Data(param,i)) = "NoFolders"){
77
+ set settings.Mappings($Get(%request.Data("MappingsExt",i)), $Get(%request.Data("MappingsCov",i)), $Get(%request.Data(param,i))) = 1
78
+ }
79
+ set settings.Mappings($Get(%request.Data("MappingsExt",i)), $Get(%request.Data("MappingsCov",i))) = $Get(%request.Data("MappingsPath",i))
80
+ }
79
81
set i = i+1
80
82
}
81
83
do settings.%Save()
@@ -260,7 +262,43 @@ body {
260
262
</svg>
261
263
</button>
262
264
</div>
265
+ <script language="cache" method="MakeMappingRow" arguments="extKey,covKey,mapPath,noFolders,checked,activated,tooltipTitle,idx,isTemplate">
266
+ &html<<div class="voca col-sm-7" #($select(isTemplate:"hidden",1:""))#>
267
+ <div class = "input-group mb-1">
268
+ <input type="text" class="form-control required" id="MappingsExt" name="MappingsExt" value="#(extKey)#" placeholder="Extension" #($select(isTemplate:"",1:"required"))#>
269
+ <input type="text" class="form-control required" id="MappingsCov" name="MappingsCov" value="#(covKey)#" placeholder="Coverage" #($select(isTemplate:"",1:"required"))#>
270
+ <input type="text" class="form-control required" id="MappingsPath" name="MappingsPath" value="#(mapPath)#" placeholder="Relative path" #($select(isTemplate:"",1:"required"))#>
271
+ <input type="text" class="form-control" id="NoFolders" name="NoFolders" value="#(noFolders)#" placeholder="To folder, or not to folder, that is the question." readonly>
272
+ <div class="custom-control custom-switch" data-delay='{"show":"1000", "hide":"100"}' data-toggle="tooltip" data-placement="top" title="#(tooltipTitle)#">
273
+ <input type="checkbox" class="#("custom-control-input"_activated)#" id="#("noFoldersSwitch"_idx)#" #(checked)#>
274
+ <label class="custom-control-label" for="#("noFoldersSwitch"_idx)#">>
275
+
276
+ if (checked '= ""){
277
+ &html<<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#007bff" class="bi bi-folder-fill" viewBox="0 0 16 16">
278
+ <path d="M9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.825a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3zm-8.322.12C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139z"/>
279
+ </svg>>
280
+ } else{
281
+ &html<<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-folder-x" viewBox="0 0 16 16">
282
+ <path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H14.54l.265-2.91A1 1 0 0 0 13.81 4H2.19a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91H9v1H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zm6.339-1.577A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z"/>
283
+ <path d="M11.854 10.146a.5.5 0 0 0-.707.708L12.293 12l-1.146 1.146a.5.5 0 0 0 .707.708L13 12.707l1.146 1.147a.5.5 0 0 0 .708-.708L13.707 12l1.147-1.146a.5.5 0 0 0-.707-.708L13 11.293l-1.146-1.147z"/>
284
+ </svg>>
285
+ }
286
+
287
+ &html<</label>
288
+ </div>
289
+ <div class="input-group-append">
290
+ <button type="button" class="btn btn-remove" >
291
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#dc3545" class="bi bi-dash-circle-fill" viewBox="0 0 16 16">
292
+ <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7z"></path>
293
+ </svg>
294
+ </button>
295
+ </div>
296
+ </div>
297
+ </div>>
298
+ </script>
263
299
<script language="cache" runat=server>
300
+ // make a hidden template row
301
+ do ..MakeMappingRow("","","","","checked"," active","","",1)
264
302
set extKey = ""
265
303
set idx = 1
266
304
for {
@@ -293,40 +331,7 @@ body {
293
331
set noFolders = """"""
294
332
set tooltipTitle = """Switch off to store files in a flat directory structure."""
295
333
}
296
-
297
- &html<<div class="voca col-sm-7">
298
- <div class = "input-group mb-1">
299
- <input type="text" class="form-control" id="MappingsExt" name="MappingsExt" value=#(extKey)# placeholder="Extension" required>
300
- <input type="text" class="form-control" id="MappingsCov" name="MappingsCov" value=#(covKey)# placeholder="Coverage" required>
301
- <input type="text" class="form-control" id="MappingsPath" name="MappingsPath" value=#(mapPath)# placeholder="Relative path" required>
302
- <input type="text" class="form-control" id="NoFolders" name="NoFolders" value=#(noFolders)# placeholder="To folder, or not to folder, that is the question." readonly>
303
- <div class="custom-control custom-switch" data-delay='{"show":"1000", "hide":"100"}' data-toggle="tooltip" data-placement="top" title=#(tooltipTitle)#>
304
- <input type="checkbox" class="#("custom-control-input"_activated)#" id=#("noFoldersSwitch"_idx)# #(checked)#>
305
- <label class="custom-control-label" for=#("noFoldersSwitch"_idx)#>>
306
-
307
- if (checked '= ""){
308
- &html<<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#007bff" class="bi bi-folder-fill" viewBox="0 0 16 16">
309
- <path d="M9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.825a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3zm-8.322.12C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139z"/>
310
- </svg>>
311
- } else{
312
- &html<<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-folder-x" viewBox="0 0 16 16">
313
- <path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H14.54l.265-2.91A1 1 0 0 0 13.81 4H2.19a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91H9v1H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zm6.339-1.577A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z"/>
314
- <path d="M11.854 10.146a.5.5 0 0 0-.707.708L12.293 12l-1.146 1.146a.5.5 0 0 0 .707.708L13 12.707l1.146 1.147a.5.5 0 0 0 .708-.708L13.707 12l1.147-1.146a.5.5 0 0 0-.707-.708L13 11.293l-1.146-1.147z"/>
315
- </svg>>
316
- }
317
-
318
- &html<</label>
319
- </div>
320
- <div class="input-group-append">
321
- <button type="button" class="btn btn-remove" >
322
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#dc3545" class="bi bi-dash-circle-fill" viewBox="0 0 16 16">
323
- <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1h-7z"></path>
324
- </svg>
325
- </button>
326
- </div>
327
- </div>
328
- </div>>
329
-
334
+ do ..MakeMappingRow(extKey,covKey,mapPath,noFolders,checked,activated,tooltipTitle,idx,0)
330
335
set idx = idx + 1
331
336
}
332
337
}
@@ -460,6 +465,8 @@ $(function()
460
465
$(newEntry.children().children(".custom-control").children()[1]).attr("for", newID)
461
466
newEntry.children().children(".custom-control").children()[0].id = newID
462
467
newEntry.find('input').val('');
468
+ newEntry.attr('hidden',false);
469
+ newEntry.children().children(".required").attr("required","required");
463
470
464
471
newEntry.appendTo(controlForm);
465
472
$(("#"+newID)).click(toggleNoFolders);
0 commit comments