[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-15 Thread thiemowmde
thiemowmde added a comment.


  I might oversimplify this, but exposing the API endpoint should be possible 
like that:
  
  name=In SpecialMathWikibase.php
$settings = WikibaseClient::getDefaultInstance()->getSettings();
$url = $settings->getSetting( 'repoUrl' );
$scriptPath = $settings->getSetting( 'repoScriptPath' );
$this->getOutput()->addJsConfigVars( 'repoApiUrl', $url . $scriptPath . 
'/api.php' );
  
  name=In ext.math.wikibase.js
var repoApiUrl = mw.config.get( 'repoApiUrl' );
  
  For the language, the code currently uses `mw.config.get( 'wgContentLanguage' 
)`. I think this is fine. It's what I would do as well.

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Physikerwelt, thiemowmde
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, MaxSem, 
thiemowmde, Tgr, cscott, Niedzielski, Esanders, Physikerwelt, Andreg-p, 
Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, Gq86, GoranSMilovanovic, 
Maosef, QZanden, LawExplorer, Debenben, _jensen, rosalieper, xSavitar, 
Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, Pkra, Gryllida, 
Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-14 Thread Physikerwelt
Physikerwelt added a comment.


  @thiemowmde ok. I only need two variables language and action API url 
endpoint. The hard part will be to get these values the rest I did for another 
project already https://www.npmjs.com/package/codemirror-wikidata However, it 
somehow feels like reinventing the wheel again. I will use the OOUI completion 
as recommended here T85394 .

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Physikerwelt
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, MaxSem, 
thiemowmde, Tgr, cscott, Niedzielski, Esanders, Physikerwelt, Andreg-p, 
Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, Gq86, GoranSMilovanovic, 
Maosef, QZanden, LawExplorer, Debenben, _jensen, rosalieper, xSavitar, 
Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, Pkra, Gryllida, 
Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-14 Thread thiemowmde
thiemowmde added a comment.


  @Physikerwelt, sorry for not responding earlier. My advice is: don't use 
jquery.wikibase.entityselector. Write your own code, ideally based on OOUI, not 
jQuery. Seriously. It's your code then, and it does exactly what you want, 
which isn't that much. The existing entityselector code appears complicated, 
but it really doesn't do much. All it essentially does is querying the 
wbsearchentities API. There is a bit of caching on top, and a lot of 
configuration you probably don't need.
  
  The probably only configuration you need is the address of the API, because 
you want to query the Wikidata server from e.g. the English Wikipedia. On wikis 
with WikibaseRepo enabled this is exposed to JavaScript as part of the `wbRepo` 
configuration, see \Wikibase\Lib\Modules\RepoAccessModule. You might need to 
expose this configuration yourself on your special page (but only on the 
special page). This can be done directly in the special page's class using e.g. 
\ResourceLoader::makeConfigSetScript().

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Physikerwelt, thiemowmde
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, MaxSem, 
thiemowmde, Tgr, cscott, Niedzielski, Esanders, Physikerwelt, Andreg-p, 
Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, Gq86, GoranSMilovanovic, 
Maosef, QZanden, LawExplorer, Debenben, _jensen, rosalieper, xSavitar, 
Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, Pkra, Gryllida, 
Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-14 Thread Physikerwelt
Physikerwelt added a comment.


  I am still confused. Are there no other situations where one needs to select 
a Wikidata item in Wikipedia? For instance, if one wants to connect a page with 
its Wikibase item. At one time there was an "add links" button that you could 
click and then a js popup came. Now it redirects to wikibase on beta 
https://en.wikipedia.beta.wmflabs.org/wiki/Selenium_Echo_link_test_0.9941241391257276_0.9941241391257276
  
  However, besides there must be uses of that.

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Physikerwelt
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, MaxSem, 
thiemowmde, Tgr, cscott, Niedzielski, Esanders, Physikerwelt, Andreg-p, 
Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, Gq86, GoranSMilovanovic, 
Maosef, QZanden, LawExplorer, Debenben, _jensen, rosalieper, xSavitar, 
Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, Pkra, Gryllida, 
Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-14 Thread Lucas_Werkmeister_WMDE
Lucas_Werkmeister_WMDE added a comment.


  No, please don’t load WikibaseRepo on Client wikis. Client and Repo are 
separate extensions for a reason.

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Physikerwelt, Lucas_Werkmeister_WMDE
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, MaxSem, 
thiemowmde, Tgr, cscott, Niedzielski, Esanders, Physikerwelt, Andreg-p, 
Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, Gq86, GoranSMilovanovic, 
Maosef, QZanden, LawExplorer, Debenben, _jensen, rosalieper, xSavitar, 
Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, Pkra, Gryllida, 
Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-10 Thread Physikerwelt
Physikerwelt claimed this task.

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Physikerwelt
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, 
Framawiki, MaxSem, thiemowmde, Tgr, cscott, Niedzielski, Esanders, 
Physikerwelt, Andreg-p, Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, 
Gq86, GoranSMilovanovic, Maosef, QZanden, LawExplorer, Debenben, _jensen, 
rosalieper, xSavitar, Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, 
Pkra, Gryllida, Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-10 Thread Physikerwelt
Physikerwelt added a comment.


  @thiemowmde The code is only executed when a user visits the special page. 
Maybe loading the WikibaseRepo code entirely would make sense since 
communication with the wikibase repo is required to figure out which entries 
exist. If the module would be factored out that would be (as I understand) a 
major change in the Wikibase software architecture. I think the cost for that 
would not warrent the effort.

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Physikerwelt
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, 
Framawiki, MaxSem, thiemowmde, Tgr, cscott, Niedzielski, Esanders, 
Physikerwelt, Andreg-p, Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, 
Gq86, GoranSMilovanovic, Maosef, QZanden, LawExplorer, Debenben, _jensen, 
rosalieper, xSavitar, Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, 
Pkra, Gryllida, Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-10 Thread thiemowmde
thiemowmde added a comment.


  As far as I understand the issue is that whatever method you choose to load a 
module, it only works when the module is //known//, i.e. it is registered in 
the extension registration. The `jquery.wikibase.entityselector` module is part 
of WikibaseView. I had a closer look, and the official way to load it is 
currently via `wfLoadExtension( 'extension-repo.json" )`, i.e. it is loaded 
together with the WikibaseRepo extension registration. Is WikibaseRepo loaded 
every time the Math code that needs the module runs? According to 
https://en.wikipedia.org/wiki/Special:Version it is not – and probably 
shouldn't.
  
  One possibly way forward is to move the module from WikibaseRepo to 
WikibaseClient. I'm not sure how hard this is, because everything it depends on 
would need to move as well.
  
  Another way forward might be to extract the module into an entirely separate 
codebase with it's own extension registration.

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: thiemowmde
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, 
Framawiki, MaxSem, thiemowmde, Tgr, cscott, Niedzielski, Esanders, 
Physikerwelt, Andreg-p, Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, 
Gq86, GoranSMilovanovic, Maosef, QZanden, LawExplorer, Debenben, _jensen, 
rosalieper, xSavitar, Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, 
Pkra, Gryllida, Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] T229939: Use wikidata entity selector in OOUI input field

2020-09-10 Thread Physikerwelt
Physikerwelt added a comment.


  @thiemowmde do you have by chance any idea how we can make progress here? I 
simply don't know what to do next.

TASK DETAIL
  https://phabricator.wikimedia.org/T229939

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Physikerwelt
Cc: Liuxinyu970226, Ladsgroup, Lucas_Werkmeister_WMDE, hoo, Aklapper, 
Framawiki, MaxSem, thiemowmde, Tgr, cscott, Niedzielski, Esanders, 
Physikerwelt, Andreg-p, Akuckartz, darthmon_wmde, Nandana, Hagarshilo, Lahi, 
Gq86, GoranSMilovanovic, Maosef, QZanden, LawExplorer, Debenben, _jensen, 
rosalieper, xSavitar, Scott_WUaS, Izno, ferdbold, Wikidata-bugs, aude, fredw, 
Pkra, Gryllida, Ricordisamoa, scfc, Jdforrester-WMF, Mbch331, Jay8g
___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs