const attributionData = { sources: [ { prefix: "./media/buildings/", files: [ { name: "house.svg", source: null }, { name: "mailbox.svg", source: null }, { name: "mobile-home.svg", source: null }, ], authors: [ "chemicalcrux" ] }, { prefix: "./media/buildings/skyscrapers/", files: [ { name: "wide.svg", source: null }, { name: "medium.svg", source: null }, { name: "slender.svg", source: null }, { name: "narrow.svg", source: null }, ], authors: [ "chemicalcrux" ] }, { prefix: "./media/characters/abysgar/", files: [ { name: "front.svg", source: "https://www.furaffinity.net/view/32424108/"} ], authors: [ "clown-grin", "labratkuma" ], owners: [ ] }, { prefix: "./media/characters/adake/", files: [ { name: "front-1.svg", source: "https://www.furaffinity.net/view/26253324/"}, { name: "front-2.svg", source: "https://www.furaffinity.net/view/26253324/"}, { name: "back.svg", source: "https://www.furaffinity.net/view/26253324/"}, { name: "kneel.svg", source: "https://www.furaffinity.net/view/26253324/"}, ], authors: [ "oselotti" ], owners: [ "Dialuca01" ] }, { prefix: "./media/characters/aigey/", files: [ { name: "side.svg", source: "https://www.furaffinity.net/view/12006265/"} ], authors: [ "just-a-little-mixed-up" ], owners: [ ] }, { prefix: "./media/characters/akari/", files: [ { name: "front.svg", source: "https://www.furaffinity.net/view/21329356/"} ], authors: [ "spyropurple" ], owners: [ ] }, { prefix: "./media/characters/andy/", files: [ { name: "front.svg", source: null} ], authors: [ "cardboardhead" ], owners: [ ] }, { prefix: "./media/characters/angelpatamon/", files: [ { name: "front.svg", source: "http://www.furaffinity.net/view/26475369/"} ], authors: [ "mallowchu" ] }, { prefix: "./media/characters/cibus/", files: [ { name: "side.svg", source: "https://www.furaffinity.net/view/15534343/"} ], authors: [ "jaydom" ], owners: [ "movler" ] }, { prefix: "./media/characters/nibbles/", files: [ { name: "front.svg", source: "https://www.furaffinity.net/view/22964778/"}, { name: "side.svg", source: "https://www.furaffinity.net/view/22964778/"}, ], authors: [ "dragga" ], owners: [ "movler" ] }, { prefix: "./media/characters/rikky/", files: [ { name: "side.svg", source: null} ], authors: [ "ethan64" ], owners: [ "quake-yote" ] }, { prefix: "./media/characters/surgo/", files: [ { name: "front.svg", source: "https://www.furaffinity.net/view/33348481/"}, { name: "back.svg", source: "https://www.furaffinity.net/view/33348481/"}, { name: "laying.svg", source: "https://www.furaffinity.net/view/33348481/"}, ], authors: [ "gaiawolfess", "malakhael" ], owners: [ "movler" ] }, { prefix: "./media/characters/tiberius/", files: [ { name: "front.svg", source: "https://www.furaffinity.net/view/34977812/"}, { name: "back.svg", source: "https://www.furaffinity.net/view/34977812/"} ], authors: [ "Rebonica" ], owners: [ "movler" ] }, { prefix: "./media/characters/", files: [ { name: "", source: ""} ], authors: [ ] } ], people: { "cardboardhead": { name: "cardboardhead", url: "https://twitter.com/cardboardhead" }, "chemicalcrux": { name: "chemicalcrux", url: "https://www.furaffinity.net/user/chemicalcrux" }, "clown-grin": { name: "clown-grin", url: "https://www.furaffinity.net/user/clown-grin" }, "Dialuca01": { name: "Dialuca", url: "https://www.furaffinity.net/user/dialuca01" }, "dragga": { name: "Dragga", url: "https://www.furaffinity.net/user/dragga" }, "ethan64": { name: "Ethan64", url: "https://www.furaffinity.net/user/ethan64/" }, "gaiawolfess": { name: "Gaiawolfess", url: "https://www.furaffinity.net/user/gaiawolfess" }, "jaydom": { name: "Jaydom", url: "https://www.furaffinity.net/user/jaydom" }, "just-a-little-mixed-up": { name: "just-a-little-mixed-up", url: "https://www.furaffinity.net/user/just-a-little-mixed-up" }, "labratkuma": { name: "labratkuma", url: "https://www.furaffinity.net/user/labratkuma" }, "malakhael": { name: "Malakhael", url: "https://www.furaffinity.net/user/malakhael" }, "mallowchu": { name: "Mallowchu", url: "https://www.furaffinity.net/user/mallowchu" }, "movler": { name: "Movler", url: "https://www.furaffinity.net/user/movler/" }, "oselotti": { name: "Oselotti", url: "https://www.furaffinity.net/user/oselotti" }, "quake-yote": { name: "Quake Yote", url: "https://www.furaffinity.net/user/rokossovskiy" }, "Rebonica": { name: "Rebonica", url: "https://www.furaffinity.net/user/rebonica" }, "spyropurple": { name: "spyropurple", url: "https://www.furaffinity.net/user/spyropurple/" } } } const attribution = {}; function prepareAttribution() { attribution["files"] = {}; attributionData.sources.forEach(citation => { citation.files.forEach(file => { attribution.files[citation.prefix + file.name] = { authors: citation.authors, owners: citation.owners, source: file.source } }) }); } function authorsOf(file) { if (attribution.files[file]) return attribution.files[file].authors; else return undefined; } function authorsOfFull(file) { if (attribution.files[file]) { const result = []; attribution.files[file].authors.forEach(author => { result.push(attributionData.people[author]); }); return result; } else return undefined; } function ownersOf(file) { if (attribution.files[file]) return attribution.files[file].owners; else return undefined; } function ownersOfFull(file) { if (attribution.files[file]) { if (attribution.files[file].owners !== undefined) { const result = []; attribution.files[file].owners.forEach(owner => { result.push(attributionData.people[owner]); }); return result; } else { return []; } } else return undefined; } function sourceOf(file) { if (attribution.files[file]) return attribution.files[file].source; else return undefined; } prepareAttribution();