This repository was archived by the owner on Jun 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 "heroProxyOn" : {
2323 "message" : " ON"
2424 },
25+ "heroProxyLogin" : {
26+ "message" : " Login"
27+ },
28+ "heroProxyConnecting" : {
29+ "message" : " Connecting"
30+ },
2531
2632 "injectedModalHeading" : {
2733 "message" : " Firefox Private Network"
Original file line number Diff line number Diff line change @@ -73,11 +73,16 @@ export class View {
7373 settingsElement . toggleAttribute ( "hidden" , ! shouldShow ) ;
7474 }
7575
76- static setState ( state , stateButtonText ) {
76+ static setState ( state , stateButtonSettings = { } ) {
7777 let stateElement = document . getElementById ( "state" ) ;
7878 stateElement . setAttribute ( "data-state" , state ) ;
7979 let stateButtonElement = document . getElementById ( "stateButton" ) ;
80- stateButtonElement . textContent = stateButtonText || "" ;
80+ stateButtonElement . textContent = stateButtonSettings . text || "" ;
81+ if ( stateButtonSettings . label ) {
82+ stateButtonElement . setAttribute ( "aria-label" , stateButtonSettings . label ) ;
83+ } else {
84+ stateButtonElement . removeAttribute ( "aria-label" ) ;
85+ }
8186 }
8287
8388 // To be overwritten with a string for the header
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {View} from "../view.js";
33// This is the first view to be shown.
44class ViewConnecting extends View {
55 show ( ) {
6- View . setState ( "connecting" ) ;
6+ View . setState ( "connecting" , { label : this . getTranslation ( "heroProxyConnecting" ) } ) ;
77 View . showToggleButton ( true ) ;
88
99 return escapedTemplate `
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import {View} from "../view.js";
22
33class ViewError extends View {
44 show ( data ) {
5- View . setState ( "disabled" , this . getTranslation ( "heroProxyOff" ) ) ;
5+ View . setState ( "disabled" , { text : this . getTranslation ( "heroProxyOff" ) } ) ;
66 return escapedTemplate `
77 <p>
88 ${ this . getTranslation ( data ) }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import {View} from "../view.js";
22
33class ViewExemptTab extends View {
44 show ( proxyState ) {
5- View . setState ( "disabled" , this . getTranslation ( "heroProxyOff" ) ) ;
5+ View . setState ( "disabled" , { text : this . getTranslation ( "heroProxyOff" ) } ) ;
66 View . showToggleButton ( false ) ;
77
88 return escapedTemplate `
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {View} from "../view.js";
33// This is the first view to be shown.
44class ViewLoading extends View {
55 show ( ) {
6- View . setState ( "connecting" ) ;
6+ View . setState ( "connecting" , { label : this . getTranslation ( "heroProxyConnecting" ) } ) ;
77 return escapedTemplate `
88 <p>
99 ${ this . getTranslation ( "viewLoading" ) }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {View} from "../view.js";
33// Login view.
44class ViewLogin extends View {
55 show ( proxyState ) {
6- View . setState ( "login" ) ;
6+ View . setState ( "login" , { label : this . getTranslation ( "heroProxyLogin" ) } ) ;
77
88 let text ;
99 if ( proxyState === PROXY_STATE_UNAUTHENTICATED ) {
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ class ViewMain extends View {
3636 this . proxyEnabled = data . proxyState === PROXY_STATE_ACTIVE ;
3737
3838 if ( this . proxyEnabled ) {
39- View . setState ( "enabled" , this . getTranslation ( "heroProxyOn" ) ) ;
39+ View . setState ( "enabled" , { text : this . getTranslation ( "heroProxyOn" ) } ) ;
4040 } else {
41- View . setState ( "disabled" , this . getTranslation ( "heroProxyOff" ) ) ;
41+ View . setState ( "disabled" , { text : this . getTranslation ( "heroProxyOff" ) } ) ;
4242 }
4343 }
4444
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import {View} from "../view.js";
22
33class ViewOffline extends View {
44 show ( ) {
5- View . setState ( "disabled" , this . getTranslation ( "heroProxyOff" ) ) ;
5+ View . setState ( "disabled" , { text : this . getTranslation ( "heroProxyOff" ) } ) ;
66 View . hideToggleButton ( ) ;
77
88 return escapedTemplate `<p>
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import {View} from "../view.js";
22
33class ViewOtherInUse extends View {
44 show ( ) {
5- View . setState ( "disabled" , this . getTranslation ( "heroProxyOff" ) ) ;
5+ View . setState ( "disabled" , { text : this . getTranslation ( "heroProxyOff" ) } ) ;
66 View . hideToggleButton ( ) ;
77
88 return escapedTemplate `
You can’t perform that action at this time.
0 commit comments