forked from MapComplete/MapComplete
Refactoring: make needed URLs explicit
This commit is contained in:
parent
7852829f1b
commit
4852888b41
51 changed files with 978 additions and 871 deletions
|
@ -11,11 +11,11 @@ import Wikimedia from "../Web/Wikimedia"
|
|||
*/
|
||||
export class WikimediaImageProvider extends ImageProvider {
|
||||
public static readonly singleton = new WikimediaImageProvider()
|
||||
public static readonly commonsPrefixes = [
|
||||
public static readonly apiUrls = [
|
||||
"https://commons.wikimedia.org/wiki/",
|
||||
"https://upload.wikimedia.org",
|
||||
"File:",
|
||||
]
|
||||
public static readonly commonsPrefixes = [...WikimediaImageProvider.apiUrls, "File:"]
|
||||
private readonly commons_key = "wikimedia_commons"
|
||||
public readonly defaultKeyPrefixes = [this.commons_key, "image"]
|
||||
|
||||
|
@ -66,6 +66,10 @@ export class WikimediaImageProvider extends ImageProvider {
|
|||
return value
|
||||
}
|
||||
|
||||
apiUrls(): string[] {
|
||||
return WikimediaImageProvider.apiUrls
|
||||
}
|
||||
|
||||
SourceIcon(backlink: string): BaseUIElement {
|
||||
const img = Svg.wikimedia_commons_white_svg().SetStyle("width:2em;height: 2em")
|
||||
if (backlink === undefined) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue