Fixed #100: allow multiple values in a single wikidata and wikimedia_commons tag
This commit is contained in:
parent
02d55dde66
commit
b4f95e5408
4 changed files with 39 additions and 38 deletions
|
@ -39,7 +39,8 @@ export class ImageSearcher extends UIEventSource<string[]> {
|
||||||
const self = this;
|
const self = this;
|
||||||
this._wdItem.addCallback(() => {
|
this._wdItem.addCallback(() => {
|
||||||
// Load the wikidata item, then detect usage on 'commons'
|
// Load the wikidata item, then detect usage on 'commons'
|
||||||
let wikidataId = self._wdItem.data;
|
let allWikidataId = self._wdItem.data.split(";");
|
||||||
|
for (let wikidataId of allWikidataId) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (wikidataId.startsWith("Q")) {
|
if (wikidataId.startsWith("Q")) {
|
||||||
wikidataId = wikidataId.substr(1);
|
wikidataId = wikidataId.substr(1);
|
||||||
|
@ -56,11 +57,13 @@ export class ImageSearcher extends UIEventSource<string[]> {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
this._commons.addCallback(() => {
|
this._commons.addCallback(() => {
|
||||||
const commons: string = self._commons.data;
|
const allCommons: string[] = self._commons.data.split(";");
|
||||||
|
for (const commons of allCommons) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (commons.startsWith("Category:")) {
|
if (commons.startsWith("Category:")) {
|
||||||
Wikimedia.GetCategoryFiles(commons, (images: ImagesInCategory) => {
|
Wikimedia.GetCategoryFiles(commons, (images: ImagesInCategory) => {
|
||||||
|
@ -76,6 +79,7 @@ export class ImageSearcher extends UIEventSource<string[]> {
|
||||||
self.AddImage(commons);
|
self.AddImage(commons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
13
README.md
13
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...
|
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 explanation about OSM in the second tab
|
||||||
* The user might discover the other themes in the other tab
|
* The user might share the map and/or embed it in the third tab
|
||||||
* The user might share the map and/or embed it
|
* 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!
|
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
|
|
||||||
|
* 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
|
3. The user adds a new POI somewhere
|
||||||
|
|
||||||
|
|
2
State.ts
2
State.ts
|
@ -24,7 +24,7 @@ export class State {
|
||||||
// The singleton of the global state
|
// The singleton of the global state
|
||||||
public static state: 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
|
// The user journey states thresholds when a new feature gets unlocked
|
||||||
public static userJourney = {
|
public static userJourney = {
|
||||||
|
|
|
@ -58,10 +58,6 @@
|
||||||
"tagRenderings": [
|
"tagRenderings": [
|
||||||
{
|
{
|
||||||
"mappings": [
|
"mappings": [
|
||||||
{
|
|
||||||
"if": "a=b",
|
|
||||||
"then": "xyz"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"if": "artwork_type=architecture",
|
"if": "artwork_type=architecture",
|
||||||
"then": {
|
"then": {
|
||||||
|
|
Loading…
Reference in a new issue