|
136 | 136 |
|
137 | 137 | <Row>
|
138 | 138 | <Label>{browser.i18n.getMessage("addYourFavoriteInstances") || "Add your favorite instances"}</Label>
|
| 139 | + <button |
| 140 | + on:click={() => { |
| 141 | + if (_options[selectedFrontend]) { |
| 142 | + _options[selectedFrontend] = [] |
| 143 | + options.set(_options) |
| 144 | + } |
| 145 | + }} |
| 146 | + class="add" |
| 147 | + title="Remove All Instances" |
| 148 | + > |
| 149 | + <CloseIcon style="color: var(--active);" /> |
| 150 | + </button> |
139 | 151 | </Row>
|
140 | 152 | <div dir="ltr">
|
141 | 153 | <Row>
|
142 | 154 | <Input
|
143 | 155 | bind:value={addInstanceValue}
|
144 | 156 | type="url"
|
145 | 157 | placeholder="https://instance.com"
|
146 |
| - aria-label="Add instance input" |
| 158 | + title="Add instance input" |
147 | 159 | on:keydown={e => e.key === "Enter" && addInstance()}
|
148 | 160 | />
|
149 |
| - <button on:click={addInstance} class="add" aria-label="Add the instance"> |
| 161 | + <button on:click={addInstance} class="add" title="Add the instance"> |
150 | 162 | <AddIcon />
|
151 | 163 | </button>
|
152 | 164 | </Row>
|
|
164 | 176 | </span>
|
165 | 177 | <button
|
166 | 178 | class="add"
|
167 |
| - aria-label="Remove Instance" |
| 179 | + title="Remove Instance" |
168 | 180 | on:click={() => {
|
169 | 181 | const index = _options[selectedFrontend].indexOf(instance)
|
170 | 182 | if (index > -1) {
|
|
184 | 196 | {#each Object.entries(_config.networks) as [networkName, network]}
|
185 | 197 | {#if redirects[selectedFrontend] && redirects[selectedFrontend][networkName] && redirects[selectedFrontend][networkName].length > 0}
|
186 | 198 | <Row></Row>
|
187 |
| - <Row><Label>{network.name}</Label></Row> |
| 199 | + <Row> |
| 200 | + <Label>{network.name}</Label> |
| 201 | + <button |
| 202 | + on:click={() => { |
| 203 | + if (_options[selectedFrontend]) { |
| 204 | + for (const instance of redirects[selectedFrontend][networkName]) { |
| 205 | + if (!_options[selectedFrontend].includes(instance)) _options[selectedFrontend].push(instance) |
| 206 | + } |
| 207 | + options.set(_options) |
| 208 | + } |
| 209 | + }} |
| 210 | + class="add" |
| 211 | + title="Add All Instances" |
| 212 | + > |
| 213 | + <AddIcon style="color: var(--active);" /> |
| 214 | + </button> |
| 215 | + </Row> |
188 | 216 | <hr />
|
189 | 217 | {#each redirects[selectedFrontend][networkName] as instance}
|
190 | 218 | <Row>
|
|
210 | 238 | {#if !_options[selectedFrontend].includes(instance)}
|
211 | 239 | <button
|
212 | 240 | class="add"
|
213 |
| - aria-label="Add instance" |
| 241 | + title="Add instance" |
214 | 242 | on:click={() => {
|
215 | 243 | if (_options[selectedFrontend]) {
|
216 | 244 | _options[selectedFrontend].push(instance)
|
|
223 | 251 | {:else}
|
224 | 252 | <button
|
225 | 253 | class="add"
|
226 |
| - aria-label="Remove Instance" |
| 254 | + title="Remove Instance" |
227 | 255 | on:click={() => {
|
228 | 256 | const index = _options[selectedFrontend].indexOf(instance)
|
229 | 257 | if (index > -1) {
|
|
0 commit comments