Difference between revisions of "MediaWiki:Architecture of SAR service"
Line 26: | Line 26: | ||
[[MediaWiki:Common.js]] is currently used to: | [[MediaWiki:Common.js]] is currently used to: | ||
* enable hyperlinking to specific pages, with specific JS or CSS loaded as well; | * enable hyperlinking to specific pages, with specific JS or CSS loaded as well; | ||
− | * load ( | + | * load [[MediaWiki:Gadget-EasyQuery.js]] (it is [https://www.wikidata.org/wiki/MediaWiki:Gadget-EasyQuery.js normally a prepackaged gadget on Wikidata] which helps navigate the items, but had to be slightly adapted to here); |
− | * load the | + | * load the [[MediaWiki:Access.js]] script, which in turn relies on the templates described above; |
− | * load Abel | + | * load the [[User:Abel/common.js]] script, which enables sitewide experimentation and circumvention of access control rules. |
Revision as of 11:50, 18 April 2019
Items & properties
Items and properties are core to wikibase. They operate like a very flexible database. The SAR service relies on some information being properly entered. See Deliveroo (Q102) for an example.
Templates
Templates are a MediaWiki system that allow filling text modularly. There is extensive documentation on the MediaWiki docs.
Templates admit all kinds of parameters, and are extremely flexible in what you can template. For instance, you can template away which template to use!
Note that templates can be used from within gadgets or user scripts (see below) as well as regular pages.
This is what we use to build access requests, relying on three templates principally:
- Template:Access to compose the text of an access request;
- Template:Mailto to create a Mailto link;
- Template:MailtoAccess to combine the two.
Gadgets, user scripts and CSS
MediaWiki has many extension systems. There is a way to add javascript code or CSS upon page load, and to configure for this to happen independently for each user or site-wide. See MediaWiki's documentation.
- common.js is site-wide javascript, called during any page load and defined on PersonalData.IO at MediaWiki:Common.js
- gadgets are site-wide javascript, which can be pre-packaged and configured by the admin to be opt-in or opt-out, with users able to change the choice in their preferences page. Currently, wiki.personaldata.io does not have that part of the system enabled.
- user-scripts are custom javascript, set up by each user separately. Yours is at Special:MyPage/common.js, but is currently inactive as one additional option needs to be activated on wiki.personaldata.io.
MediaWiki:Common.js is currently used to:
- enable hyperlinking to specific pages, with specific JS or CSS loaded as well;
- load MediaWiki:Gadget-EasyQuery.js (it is normally a prepackaged gadget on Wikidata which helps navigate the items, but had to be slightly adapted to here);
- load the MediaWiki:Access.js script, which in turn relies on the templates described above;
- load the User:Abel/common.js script, which enables sitewide experimentation and circumvention of access control rules.