Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"description": "Status message when adding or removing a self-hosted instance fails unexpectedly"
},
"optionsReviewUrlPlaceholder": {
"message": "review.example.com (review server URL)",
"message": "https://review.example.com",
"description": "Placeholder for the review server URL input of a Gerrit instance"
},
"optionsInvalidReviewUrl": {
Expand Down
2 changes: 1 addition & 1 deletion _locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"description": "Message affiché quand l'ajout ou la suppression d'une instance auto-hébergée échoue de façon inattendue"
},
"optionsReviewUrlPlaceholder": {
"message": "review.exemple.com (URL du serveur de revue)",
"message": "https://review.exemple.com",
"description": "Texte indicatif du champ d'URL du serveur de revue d'une instance Gerrit"
},
"optionsInvalidReviewUrl": {
Expand Down
10 changes: 8 additions & 2 deletions options/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ body { background: var(--bg); color: var(--fg); }
border-top: 1px solid var(--border); padding-top: 0.75rem;
}
.options__subtitle { margin: 0; }
.options__add { display: flex; gap: 0.5rem; align-items: center; }
.options__add .options__input { flex: 1; }
.options__add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.options__add .options__input { flex: 1; min-width: 8rem; }
/* the gerrit fields take a whole row of their own: on the shared row they
would be squeezed narrower than their placeholders */
.options__add-gerrit { display: flex; gap: 0.5rem; flex: 1 1 100%; }
/* this display beats the browser's [hidden] rule (author styles win over the
user-agent ones), so restore it for the non-gerrit types */
.options__add-gerrit[hidden] { display: none; }
.options__remove, .options__add-btn {
align-self: flex-start;
padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: 4px;
Expand Down
11 changes: 7 additions & 4 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ <h4 class="options__subtitle" i18n=1>__MSG_optionsSelfHostedTitle__</h4>
<select id="instance-type" class="options__input"></select>
<input id="instance-hostname" class="options__input" type="text"
autocomplete="off" spellcheck="false">
<!-- gerrit-only fields: the mirror's software and the review server -->
<select id="instance-mirror-type" class="options__input" hidden></select>
<input id="instance-review-url" class="options__input" type="text"
autocomplete="off" spellcheck="false" hidden>
<!-- gerrit-only fields (the mirror's software and the review
server); their own full-width row, so both stay readable -->
<div id="gerrit-fields" class="options__add-gerrit" hidden>
<select id="instance-mirror-type" class="options__input"></select>
<input id="instance-review-url" class="options__input" type="text"
autocomplete="off" spellcheck="false">
</div>
<button type="button" id="add-instance" class="options__add-btn"
i18n=1>__MSG_optionsAddInstance__</button>
</div>
Expand Down
4 changes: 1 addition & 3 deletions options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,7 @@ document.getElementById("instance-review-url").placeholder =
// the mirror-type and review-URL fields only apply to the gerrit type
const typeSelect = document.getElementById("instance-type")
function syncGerritFields() {
const gerrit = typeSelect.value === "gerrit"
document.getElementById("instance-mirror-type").hidden = !gerrit
document.getElementById("instance-review-url").hidden = !gerrit
document.getElementById("gerrit-fields").hidden = typeSelect.value !== "gerrit"
}
typeSelect.addEventListener("change", syncGerritFields)
syncGerritFields()
Expand Down