Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

JavaScript

From Wikven
More actions

Wikven bundles the wiki's own JavaScript into the static export at build time, so site scripts and gadgets run without a live server or load.php.

MediaWiki:Common.js

Site-wide JavaScript lives in MediaWiki:Common.js, just like on a regular wiki. Create a MediaWiki:Common.js file in your source directory and it runs on every page. A .js page carries its own content model, so it needs no .wikitext marker. The skin's MediaWiki:Vector.js (and so on) works the same way.

Gadgets

To use gadgets, enable the bundled Gadgets extension in .wikven.yaml:

extensions:
  - Gadgets

List your gadgets in MediaWiki:Gadgets-definition.wikitext, and put each gadget's code in MediaWiki:Gadget-<name>.js:

* MyGadget[ResourceLoader|default]|MyGadget.js

Only gadgets marked default are loaded: a static site has no logged-in readers to turn other gadgets on. A gadget's own CSS (in the same module) is included, but standalone styles-only gadgets are not yet covered.

These docs ship one such gadget, PersistTabber, which remembers whether you pick the Docker or the binary tab in the install steps. Every other tabber on the page switches to the tab you picked, and the choice is still there when you move to another page.

← Skins
Retrieved from "JavaScript.html"