| 108 | } |
| 109 | |
| 110 | export function videoStrategyErrorElement(hasMissingPermissions: boolean) { |
| 111 | const errorDiv = document.createElement('div'); |
| 112 | errorDiv.className = 'player-error'; |
| 113 | errorDiv.style.cssText = ` |
| 114 | display: block; |
| 115 | padding: 5px; |
| 116 | padding-top: 15px; |
| 117 | outline: 1px solid #e13f7b; |
| 118 | `; |
| 119 | |
| 120 | const linkContainer = document.createElement('div'); |
| 121 | linkContainer.style.cssText = ` |
| 122 | display: flex; |
| 123 | justify-content: space-evenly; |
| 124 | `; |
| 125 | |
| 126 | const defaultSpan = document.createElement('p'); |
| 127 | defaultSpan.className = 'player-error-default'; |
| 128 | defaultSpan.textContent = api.storage.lang('syncPage_flash_player_error'); |
| 129 | errorDiv.appendChild(defaultSpan); |
| 130 | |
| 131 | if (hasMissingPermissions) { |
| 132 | const missingPermissionsSpan = document.createElement('span'); |
| 133 | missingPermissionsSpan.className = 'player-error-missing-permissions'; |
| 134 | missingPermissionsSpan.style.cssText = ` |
| 135 | padding-top: 10px; |
| 136 | `; |
| 137 | missingPermissionsSpan.textContent = api.storage.lang( |
| 138 | 'settings_custom_domains_missing_permissions_header', |
| 139 | ); |
| 140 | errorDiv.appendChild(missingPermissionsSpan); |
| 141 | |
| 142 | const addLink = document.createElement('a'); |
| 143 | addLink.className = 'player-error-missing-permissions'; |
| 144 | addLink.href = 'https://malsync.moe/pwa/#/settings/customDomains'; |
| 145 | addLink.style.cssText = ` |
| 146 | margin: 10px; |
| 147 | border-bottom: 2px solid #e13f7b; |
| 148 | `; |
| 149 | addLink.textContent = api.storage.lang('Add'); |
| 150 | linkContainer.appendChild(addLink); |
| 151 | } |
| 152 | |
| 153 | const helpLink = document.createElement('a'); |
| 154 | helpLink.href = 'https://discord.com/invite/cTH4yaw'; |
| 155 | helpLink.style.cssText = ` |
| 156 | display: block; |
| 157 | margin: 10px; |
| 158 | `; |
| 159 | helpLink.textContent = 'Help'; |
| 160 | |
| 161 | linkContainer.appendChild(helpLink); |
| 162 | |
| 163 | errorDiv.appendChild(linkContainer); |
| 164 | |
| 165 | return errorDiv; |
| 166 | } |