Thursday, September 27, 2007

Script Trading

Spent some time over on Wikinews yesterday and today, and I saw something very interesting: They have a feature where you can load a per-page javascript or css file. That means for every page there is an option to load scripts and stylesheets specific to that page only. You don't need to add bloat to MediaWiki:Common.js in order to enable features on only one or two specific pages. Wikinews hosts these files in the MediaWiki: namespace, so they are only editable by admins by default.

I've borrowed the idea, and have started a small-scale test of the script on Wikibooks. Naturally, i've changed a few details, and discussed some uses with other Wikibookians:
  1. CSS pages are loaded in per-book, not per-page. This way book authors and editors can make large changes to the appearance of a particular book by making edits to a single file (and without having to rely on volumes of specialized formatting templates).
  2. Per-book CSS files might be located in the main namespace, in the book itself. These pages wont be protected by default which means that vandals will be able to mess with them, but regular authors and editors will be able to play with them more as well. This is an idea that some other users have suggested, and is worth testing.
  3. There isn't going to be any per-book JS loaded globally, but i'm testing a way for users to do it individually. That is I can load per-book javascripts, but I can't force other users to do the same.
In return, some Wikinewsies have adapted our google analytics idea for that project. Users can opt-in to the program by installing the script into their account, and can then receive the reports by email.

No comments:

Post a Comment