less copy protection, more size visualization
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

236 lines
6.2 KiB

  1. const attributionData = {
  2. sources: [
  3. {
  4. prefix: "./media/buildings/",
  5. files: [
  6. { name: "house.svg", source: null },
  7. { name: "mailbox.svg", source: null },
  8. { name: "mobile-home.svg", source: null },
  9. ],
  10. authors: [
  11. "chemicalcrux"
  12. ]
  13. },
  14. {
  15. prefix: "./media/buildings/skyscrapers/",
  16. files: [
  17. { name: "wide.svg", source: null },
  18. { name: "medium.svg", source: null },
  19. { name: "slender.svg", source: null },
  20. { name: "narrow.svg", source: null },
  21. ],
  22. authors: [
  23. "chemicalcrux"
  24. ]
  25. },
  26. {
  27. prefix: "./media/characters/abysgar/",
  28. files: [
  29. { name: "front.svg", source: "https://www.furaffinity.net/view/32424108/"}
  30. ],
  31. authors: [
  32. "clown-grin",
  33. "labratkuma"
  34. ],
  35. owners: [
  36. ]
  37. },
  38. {
  39. prefix: "./media/characters/adake/",
  40. files: [
  41. { name: "front-1.svg", source: "https://www.furaffinity.net/view/26253324/"},
  42. { name: "front-2.svg", source: "https://www.furaffinity.net/view/26253324/"},
  43. { name: "back.svg", source: "https://www.furaffinity.net/view/26253324/"},
  44. { name: "kneel.svg", source: "https://www.furaffinity.net/view/26253324/"},
  45. ],
  46. authors: [
  47. "oselotti"
  48. ],
  49. owners: [
  50. "Dialuca01"
  51. ]
  52. },
  53. {
  54. prefix: "./media/characters/aigey/",
  55. files: [
  56. { name: "side.svg", source: "https://www.furaffinity.net/view/12006265/"}
  57. ],
  58. authors: [
  59. "just-a-little-mixed-up"
  60. ],
  61. owners: [
  62. ]
  63. },
  64. {
  65. prefix: "./media/characters/akari/",
  66. files: [
  67. { name: "front.svg", source: "https://www.furaffinity.net/view/21329356/"}
  68. ],
  69. authors: [
  70. "spyropurple"
  71. ],
  72. owners: [
  73. ]
  74. },
  75. {
  76. prefix: "./media/characters/andy/",
  77. files: [
  78. { name: "front.svg", source: null}
  79. ],
  80. authors: [
  81. "cardboardhead"
  82. ],
  83. owners: [
  84. ]
  85. },
  86. {
  87. prefix: "./media/characters/tiberius/",
  88. files: [
  89. { name: "front.svg", source: "https://www.furaffinity.net/view/34977812/"},
  90. { name: "back.svg", source: "https://www.furaffinity.net/view/34977812/"}
  91. ],
  92. authors: [
  93. "Rebonica"
  94. ],
  95. owners: [
  96. "movler"
  97. ]
  98. },
  99. {
  100. prefix: "./media/characters/",
  101. files: [
  102. { name: "", source: ""}
  103. ],
  104. authors: [
  105. ]
  106. },
  107. {
  108. prefix: "./media/characters/",
  109. files: [
  110. { name: "", source: ""}
  111. ],
  112. authors: [
  113. ]
  114. }
  115. ],
  116. people: {
  117. "cardboardhead": {
  118. name: "cardboardhead",
  119. url: "https://twitter.com/cardboardhead"
  120. },
  121. "chemicalcrux": {
  122. name: "chemicalcrux",
  123. url: "https://www.furaffinity.net/user/chemicalcrux"
  124. },
  125. "clown-grin": {
  126. name: "clown-grin",
  127. url: "https://www.furaffinity.net/user/clown-grin"
  128. },
  129. "Dialuca01": {
  130. name: "Dialuca",
  131. url: "https://www.furaffinity.net/user/dialuca01"
  132. },
  133. "just-a-little-mixed-up": {
  134. name: "just-a-little-mixed-up",
  135. url: "https://www.furaffinity.net/user/just-a-little-mixed-up"
  136. },
  137. "labratkuma": {
  138. name: "labratkuma",
  139. url: "https://www.furaffinity.net/user/labratkuma"
  140. },
  141. "movler": {
  142. name: "Movler",
  143. url: "https://www.furaffinity.net/user/movler/"
  144. },
  145. "oselotti": {
  146. name: "Oselotti",
  147. url: "https://www.furaffinity.net/user/oselotti"
  148. },
  149. "Rebonica": {
  150. name: "Rebonica",
  151. url: "https://www.furaffinity.net/user/rebonica"
  152. },
  153. "spyropurple": {
  154. name: "spyropurple",
  155. url: "https://www.furaffinity.net/user/spyropurple/"
  156. }
  157. }
  158. }
  159. const attribution = {};
  160. function prepareAttribution() {
  161. attribution["files"] = {};
  162. attributionData.sources.forEach(citation => {
  163. citation.files.forEach(file => {
  164. attribution.files[citation.prefix + file.name] = {
  165. authors: citation.authors,
  166. owners: citation.owners,
  167. source: file.source
  168. }
  169. })
  170. });
  171. }
  172. function authorsOf(file) {
  173. if (attribution.files[file])
  174. return attribution.files[file].authors;
  175. else
  176. return undefined;
  177. }
  178. function authorsOfFull(file) {
  179. if (attribution.files[file]) {
  180. const result = [];
  181. attribution.files[file].authors.forEach(author => {
  182. result.push(attributionData.people[author]);
  183. });
  184. return result;
  185. }
  186. else
  187. return undefined;
  188. }
  189. function ownersOf(file) {
  190. if (attribution.files[file])
  191. return attribution.files[file].owners;
  192. else
  193. return undefined;
  194. }
  195. function ownersOfFull(file) {
  196. if (attribution.files[file]) {
  197. if (attribution.files[file].owners !== undefined) {
  198. const result = [];
  199. attribution.files[file].owners.forEach(owner => {
  200. result.push(attributionData.people[owner]);
  201. });
  202. return result;
  203. } else {
  204. return [];
  205. }
  206. }
  207. else
  208. return undefined;
  209. }
  210. function sourceOf(file) {
  211. if (attribution.files[file])
  212. return attribution.files[file].source;
  213. else
  214. return undefined;
  215. }
  216. prepareAttribution();