Hi all,
for my latest toy [1] I would really like to get the item IDs (Qxxx) for the items in the dropdown box when editing a claim that points to an item.
I can get the item IDs for the search dropdown via the link hrefs, but didn't find anything similar in the "role='menuitem'" <li>s for the edit box.
Is there a global data structure with the ID list I could access? Are the IDs attached to DOM nodes via jQuery data()? A hook I can add my function to? Or something else I could use?
Alternatively, could you add an attribute (e.g. "itemid='Qxxx'") to the <li> nodes? Shouldn't be too hard, as it couldn't really break anything AFAICT. Could be really handy.
Thanks, Magnus
There is a global data structure in "wikibase.fetchedEntities", though, this one does not contain all entities ever displayed in the drop-down but only those actually selected at some point. Adding some data-attribute to the li-elements would indeed be a good idea I guess.
Cheers, Daniel
2013/9/9 Magnus Manske magnusmanske@googlemail.com:
Hi all,
for my latest toy [1] I would really like to get the item IDs (Qxxx) for the items in the dropdown box when editing a claim that points to an item.
I can get the item IDs for the search dropdown via the link hrefs, but didn't find anything similar in the "role='menuitem'" <li>s for the edit box.
Is there a global data structure with the ID list I could access? Are the IDs attached to DOM nodes via jQuery data()? A hook I can add my function to? Or something else I could use?
Alternatively, could you add an attribute (e.g. "itemid='Qxxx'") to the <li> nodes? Shouldn't be too hard, as it couldn't really break anything AFAICT. Could be really handy.
Thanks, Magnus
[1] http://magnusmanske.de/wordpress/?p=64
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
So how is this currently done? Just via callback on click()? (/me too lazy to read the source)
Also, if adding a data attribute to the <li>s is the only way to get that information, could that be part of the next rollout please? Should take only a minute for someone who knows the source.
Thanks, Magnus
On Mon, Sep 9, 2013 at 2:58 PM, Daniel Werner daniel.werner@wikimedia.dewrote:
There is a global data structure in "wikibase.fetchedEntities", though, this one does not contain all entities ever displayed in the drop-down but only those actually selected at some point. Adding some data-attribute to the li-elements would indeed be a good idea I guess.
Cheers, Daniel
2013/9/9 Magnus Manske magnusmanske@googlemail.com:
Hi all,
for my latest toy [1] I would really like to get the item IDs (Qxxx) for
the
items in the dropdown box when editing a claim that points to an item.
I can get the item IDs for the search dropdown via the link hrefs, but didn't find anything similar in the "role='menuitem'" <li>s for the edit box.
Is there a global data structure with the ID list I could access? Are the IDs attached to DOM nodes via jQuery data()? A hook I can add my function to? Or something else I could use?
Alternatively, could you add an attribute (e.g. "itemid='Qxxx'") to the
<li> > nodes? Shouldn't be too hard, as it couldn't really break anything AFAICT. > Could be really handy. > > Thanks, > Magnus > > > [1] http://magnusmanske.de/wordpress/?p=64 > > > _______________________________________________ > Wikidata-tech mailing list > Wikidata-tech@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikidata-tech >
-- Daniel Werner Software Engineer
Wikimedia Deutschland e.V. | Obentrautstr. 72 | 10963 Berlin Tel. (030) 219 158 26-0
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V. Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für Körperschaften I Berlin, Steuernummer 27/681/51985.
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
So how is this currently done? Just via callback on click()?
I guess you are referring to the "wikibase.fetchedEntities" being updated when the user selects an entity there?
Not via click, there is a more dedicated event called "entityselectorselect". That one is being caught in "jQuery.valueview.experts.wikibase.EntityIdInput" where we store some basic info about the selected item in our global local store. See "/Wikibase/lib/resources/jquery.valueview.experts.wikibase/experts.wikibase.EntityIdInput.js" for details and all the TODOs we have around that bit of code there.
Also, if adding a data attribute to the <li>s is the only way to get that information, could that be part of the next rollout please? Should take only a minute for someone who knows the source.
I will bring it up tomorrow and suggest adding it to our current sprint.
2013/9/9 Magnus Manske magnusmanske@googlemail.com:
So how is this currently done? Just via callback on click()? (/me too lazy to read the source)
Also, if adding a data attribute to the <li>s is the only way to get that information, could that be part of the next rollout please? Should take only a minute for someone who knows the source.
Thanks, Magnus
On Mon, Sep 9, 2013 at 2:58 PM, Daniel Werner daniel.werner@wikimedia.de wrote:
There is a global data structure in "wikibase.fetchedEntities", though, this one does not contain all entities ever displayed in the drop-down but only those actually selected at some point. Adding some data-attribute to the li-elements would indeed be a good idea I guess.
Cheers, Daniel
2013/9/9 Magnus Manske magnusmanske@googlemail.com:
Hi all,
for my latest toy [1] I would really like to get the item IDs (Qxxx) for the items in the dropdown box when editing a claim that points to an item.
I can get the item IDs for the search dropdown via the link hrefs, but didn't find anything similar in the "role='menuitem'" <li>s for the edit box.
Is there a global data structure with the ID list I could access? Are the IDs attached to DOM nodes via jQuery data()? A hook I can add my function to? Or something else I could use?
Alternatively, could you add an attribute (e.g. "itemid='Qxxx'") to the
<li> nodes? Shouldn't be too hard, as it couldn't really break anything AFAICT. Could be really handy.
Thanks, Magnus
[1] http://magnusmanske.de/wordpress/?p=64
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
-- Daniel Werner Software Engineer
Wikimedia Deutschland e.V. | Obentrautstr. 72 | 10963 Berlin Tel. (030) 219 158 26-0
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V. Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für Körperschaften I Berlin, Steuernummer 27/681/51985.
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
-- undefined
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
Ah, never mind, thanks to your tips I believe I figured it out! Live now, enjoy!
Thanks, Magnus
On Mon, Sep 9, 2013 at 4:13 PM, Daniel Werner daniel.werner@wikimedia.dewrote:
So how is this currently done? Just via callback on click()?
I guess you are referring to the "wikibase.fetchedEntities" being updated when the user selects an entity there?
Not via click, there is a more dedicated event called "entityselectorselect". That one is being caught in "jQuery.valueview.experts.wikibase.EntityIdInput" where we store some basic info about the selected item in our global local store. See
"/Wikibase/lib/resources/jquery.valueview.experts.wikibase/experts.wikibase.EntityIdInput.js" for details and all the TODOs we have around that bit of code there.
Also, if adding a data attribute to the <li>s is the only way to get
that information, could that be part of the next rollout please? Should take only a minute for someone who knows the source.
I will bring it up tomorrow and suggest adding it to our current sprint.
2013/9/9 Magnus Manske magnusmanske@googlemail.com:
So how is this currently done? Just via callback on click()? (/me too
lazy
to read the source)
Also, if adding a data attribute to the <li>s is the only way to get that information, could that be part of the next rollout please? Should take
only
a minute for someone who knows the source.
Thanks, Magnus
On Mon, Sep 9, 2013 at 2:58 PM, Daniel Werner <
daniel.werner@wikimedia.de>
wrote:
There is a global data structure in "wikibase.fetchedEntities", though, this one does not contain all entities ever displayed in the drop-down but only those actually selected at some point. Adding some data-attribute to the li-elements would indeed be a good idea I guess.
Cheers, Daniel
2013/9/9 Magnus Manske magnusmanske@googlemail.com:
Hi all,
for my latest toy [1] I would really like to get the item IDs (Qxxx)
for
the items in the dropdown box when editing a claim that points to an item.
I can get the item IDs for the search dropdown via the link hrefs, but didn't find anything similar in the "role='menuitem'" <li>s for the
edit
box.
Is there a global data structure with the ID list I could access? Are the IDs attached to DOM nodes via jQuery data()? A hook I can add my function to? Or something else I could use?
Alternatively, could you add an attribute (e.g. "itemid='Qxxx'") to
the
<li> nodes? Shouldn't be too hard, as it couldn't really break anything AFAICT. Could be really handy.
Thanks, Magnus
[1] http://magnusmanske.de/wordpress/?p=64
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
-- Daniel Werner Software Engineer
Wikimedia Deutschland e.V. | Obentrautstr. 72 | 10963 Berlin Tel. (030) 219 158 26-0
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V. Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für Körperschaften I Berlin, Steuernummer 27/681/51985.
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
-- undefined
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
-- Daniel Werner Software Engineer
Wikimedia Deutschland e.V. | Obentrautstr. 72 | 10963 Berlin Tel. (030) 219 158 26-0
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V. Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für Körperschaften I Berlin, Steuernummer 27/681/51985.
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
wikidata-tech@lists.wikimedia.org