@@ -100,37 +100,7 @@ const Utils = {
100100 }
101101 return "" ;
102102 } ) . join ( "<br>" ) ;
103- } ,
104- verifyUrls ( ) {
105- // Select all anchor elements with the 'check-url' class
106- const links = document . querySelectorAll ( '.check-url' ) ;
107- links . forEach ( link => {
108- const url = link . href ;
109- // Use a HEAD request to check if the URL is accessible
110- fetch ( url , { method : 'HEAD' } )
111- . then ( response => {
112- if ( ! response . ok ) {
113- // If the response isn't OK, show a warning icon with the status code
114- const warning = document . createElement ( 'span' ) ;
115- warning . innerHTML = '<i class="bi bi-exclamation-circle-fill"></i>' ;
116- warning . style . marginLeft = "5px" ;
117- warning . style . color = "var(--color-danger)" ;
118- warning . title = `URL returned status: ${ response . status } ` ;
119- link . insertAdjacentElement ( 'afterend' , warning ) ;
120- }
121- } )
122- . catch ( error => {
123- // If an error occurs (e.g., CORS issues), mark the URL as unverified
124- const warning = document . createElement ( 'span' ) ;
125- warning . innerHTML = '<i class="bi bi-question-circle-fill"></i>' ;
126- warning . style . marginLeft = "5px" ;
127- warning . style . color = "var(--color-accent)" ;
128- // Provide a fallback message to the user
129- warning . title = "URL could not be verified (possibly due to CORS restrictions or other errors)." ;
130- link . insertAdjacentElement ( 'afterend' , warning ) ;
131- } ) ;
132- } ) ;
133- } ,
103+ } ,
134104 getLocalized ( fieldObj , lang ) {
135105 if ( ! fieldObj ) return "" ;
136106 return fieldObj [ lang ] || fieldObj [ "en" ] || "" ;
0 commit comments