Skip to content

Commit

Permalink
[FIX] Ui changes requested by @Jaifroid
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabhg71 committed Oct 19, 2023
1 parent 1714cbb commit 7fb9251
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion www/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}

#zimSelectDropdown {
width: 100%;
width: 60%;
font-size: large;
height: 2em;
}
Expand Down
7 changes: 5 additions & 2 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,12 @@ <h2 data-i18n="configure-title">Configuration</h2>
<p><span data-i18n="configure-selectordisplay">Drag and drop a new ZIM file, or</span>
<a href="#" id="selectorsDisplayLink" data-i18n="configure-selectordisplay-link">display file selectors</a>.</p>
</div>
<div id="openLocalFiles" style="display: none;">
<div id="openLocalFiles" style="display: none; display: flex;flex-direction: row;">
<div style="display: flex;flex-direction: row;">
<p id="numberOfFilesDisplay">0</p>
<span>&nbsp;archives found in selected location:</span>
</div>
<select id="zimSelectDropdown" style="display: none;">
<option value="" disabled selected>Select a file...</option>
</select>
<p data-i18n="configure-select-instructions" id="selectInstructions">Please select or drag and drop a .zim file (or all the .zimaa, .zimab etc in
case of a split ZIM file):</p>
Expand Down
3 changes: 2 additions & 1 deletion www/js/lib/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import cache from './cache.js';
*/
async function updateZimDropdownOptions (fileSystemHandler, selectedFile) {
const select = document.getElementById('zimSelectDropdown')
let options = '<option value="" disabled selected>Select a file...</option>'
let options = ''

fileSystemHandler.files.forEach(fileName => {
if (fileName.endsWith('.zim') || fileName.endsWith('.zimaa')) options += `<option value="${fileName}">${fileName}</option>`
});
select.innerHTML = options

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
DOM text
is reinterpreted as HTML without escaping meta-characters.
DOM text
is reinterpreted as HTML without escaping meta-characters.
DOM text
is reinterpreted as HTML without escaping meta-characters.
document.getElementById('zimSelectDropdown').value = selectedFile
document.getElementById('numberOfFilesDisplay').innerText = fileSystemHandler.files.length
}

/**
Expand Down

0 comments on commit 7fb9251

Please sign in to comment.