@@ -21,7 +21,7 @@ const displaySIndicatorRoundel = (
21
21
const roundelElement =
22
22
document . getElementById ( overallRoundelElementId ) ??
23
23
( ( ) => {
24
- const newElem = document . createElement ( 'div ' ) ;
24
+ const newElem = document . createElement ( 'a ' ) ;
25
25
newElem . id = overallRoundelElementId ;
26
26
document . body . appendChild ( newElem ) ;
27
27
return newElem ;
@@ -45,6 +45,17 @@ const displaySIndicatorRoundel = (
45
45
roundelElement . style . width = '40px' ;
46
46
roundelElement . style . height = '40px' ;
47
47
48
+ roundelElement . style . cursor = 'pointer' ;
49
+ roundelElement . setAttribute (
50
+ 'href' ,
51
+ window . location . hostname === 'localhost'
52
+ ? 'http://localhost:4200/sIndicator'
53
+ : `https://syndication.${ window . location . hostname . replace (
54
+ / ^ ( m \. | w w w \. ) / i,
55
+ '' ,
56
+ ) } /sIndicator`,
57
+ ) ;
58
+
48
59
switch ( status ) {
49
60
case 'loading' :
50
61
roundelElement . title = 'Checking syndication status...' ;
@@ -66,15 +77,6 @@ const displaySIndicatorRoundel = (
66
77
'There was an error checking syndication status. Click to check your CAPI key...' ;
67
78
roundelElement . style . backgroundColor = 'yellow' ;
68
79
roundelElement . textContent = '⚠️' ;
69
- roundelElement . style . cursor = 'pointer' ;
70
- roundelElement . addEventListener (
71
- 'click' ,
72
- ( ) =>
73
- ( window . location . href =
74
- window . location . hostname === 'localhost'
75
- ? 'http://localhost:4200/sIndicator'
76
- : `https://syndication.${ window . location . hostname } /sIndicator` ) ,
77
- ) ;
78
80
break ;
79
81
}
80
82
} ;
0 commit comments