Last modified: 2013-04-07 21:39:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48988, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46988 - WikidataClient should provide repository url and path and interwiki id for gadgets and userscripts
WikidataClient should provide repository url and path and interwiki id for ga...
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
WikidataClient (Other open bugs)
unspecified
All All
: Unprioritized major (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-07 14:26 UTC by Cacycle
Modified: 2013-04-07 21:39 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Cacycle 2013-04-07 14:26:29 UTC
Gadgets and userscripts that interact with wikibase (wikidata) references in articles need the repository url and path and the interwiki id of the current wiki on the repository.

An example is the editor gadget wikEd that linkifies {{#property:}} variables in wiki text, allowing to open the referenced page in the repository by ctrl-clicking. 

On Wikipedia, it is relatively easy to guess interwiki id and repo and it is often possible to get the repo path from the interlanguage edit link. However, these workarounds fail on non-Wikipedia wikis that use other repos.

Therefore, gadgets and userscripts need wg-like variables for this. If these already exist, please document this crucial information.
Comment 1 Marius Hoch 2013-04-07 14:29:08 UTC
The wikibase.client.currentSite module should hold all the information you need (it sets mw.config.get( 'wbCurrentSite' ) )
Comment 2 Marius Hoch 2013-04-07 14:30:30 UTC
I forgot to mention the wikibase.repoAccess module for wbRepoUrl, wbRepoScriptPath and wbRepoArticlePath.
Comment 3 Cacycle 2013-04-07 20:49:17 UTC
mw.config.get('wbCurrentSite') gives null when editing a Wikipedia page. Same for the other vars.
Comment 4 Marius Hoch 2013-04-07 21:39:31 UTC
You need to load the modules I mentioned via mw.loader (see https://www.mediawiki.org/wiki/ResourceLoader/Default_modules)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links