diff --git a/Logic/ImageSearcher.ts b/Logic/ImageSearcher.ts index cd6be2e..6ab99e5 100644 --- a/Logic/ImageSearcher.ts +++ b/Logic/ImageSearcher.ts @@ -38,15 +38,35 @@ export class ImageSearcher extends UIEventSource { const self = this; this._wdItem.addCallback(() => { - // Load the wikidata item, then detect usage on 'commons' - let wikidataId = self._wdItem.data; - // @ts-ignore - if (wikidataId.startsWith("Q")) { - wikidataId = wikidataId.substr(1); + // Load the wikidata item, then detect usage on 'commons' + let allWikidataId = self._wdItem.data.split(";"); + for (let wikidataId of allWikidataId) { + // @ts-ignore + if (wikidataId.startsWith("Q")) { + wikidataId = wikidataId.substr(1); + } + Wikimedia.GetWikiData(parseInt(wikidataId), (wd: Wikidata) => { + self.AddImage(wd.image); + Wikimedia.GetCategoryFiles(wd.commonsWiki, (images: ImagesInCategory) => { + for (const image of images.images) { + // @ts-ignore + if (image.startsWith("File:")) { + self.AddImage(image); + } + } + }) + }) } - Wikimedia.GetWikiData(parseInt(wikidataId), (wd: Wikidata) => { - self.AddImage(wd.image); - Wikimedia.GetCategoryFiles(wd.commonsWiki, (images: ImagesInCategory) => { + } + ); + + + this._commons.addCallback(() => { + const allCommons: string[] = self._commons.data.split(";"); + for (const commons of allCommons) { + // @ts-ignore + if (commons.startsWith("Category:")) { + Wikimedia.GetCategoryFiles(commons, (images: ImagesInCategory) => { for (const image of images.images) { // @ts-ignore if (image.startsWith("File:")) { @@ -54,26 +74,10 @@ export class ImageSearcher extends UIEventSource { } } }) - }) - } - ); - - - this._commons.addCallback(() => { - const commons: string = self._commons.data; - // @ts-ignore - if (commons.startsWith("Category:")) { - Wikimedia.GetCategoryFiles(commons, (images: ImagesInCategory) => { - for (const image of images.images) { - // @ts-ignore - if (image.startsWith("File:")) { - self.AddImage(image); - } + } else { // @ts-ignore + if (commons.startsWith("File:")) { + self.AddImage(commons); } - }) - } else { // @ts-ignore - if (commons.startsWith("File:")) { - self.AddImage(commons); } } }); diff --git a/README.md b/README.md index 5db80cc..82abb10 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,15 @@ A typical user journey would be: 0. Oh, this is a cool map of _my specific interest_! There is a lot of data already... - * The user might discover the explanation about OSM in the dedicated tab page - * The user might discover the other themes in the other tab - * The user might share the map and/or embed it + * The user might discover the explanation about OSM in the second tab + * The user might share the map and/or embed it in the third tab + * The user might discover the other themes in the last tab -1. The user clicks that big tempting button 'login' in order to answer questions. The user makes an account - a big step. +1. The user clicks that big tempting button 'login' in order to answer questions - there's enough of these login buttons... The user creates an account. -2. The user answers a question! Hooray! - When at least one question is answered (aka: having one changeset on OSM), adding a new point is unlocked +2. The user answers a question! Hooray! The user transformed into a __contributor__ now. + + * When at least one question is answered (aka: having one changeset on OSM), adding a new point is unlocked 3. The user adds a new POI somewhere diff --git a/State.ts b/State.ts index ca974bb..8b3de1f 100644 --- a/State.ts +++ b/State.ts @@ -24,7 +24,7 @@ export class State { // The singleton of the global state public static state: State; - public static vNumber = "0.0.6b"; + public static vNumber = "0.0.6c"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = { diff --git a/assets/themes/artwork/artwork.json b/assets/themes/artwork/artwork.json index 743b4d4..ff5f2e6 100644 --- a/assets/themes/artwork/artwork.json +++ b/assets/themes/artwork/artwork.json @@ -58,10 +58,6 @@ "tagRenderings": [ { "mappings": [ - { - "if": "a=b", - "then": "xyz" - }, { "if": "artwork_type=architecture", "then": {