The Unified Republic of Stars:Skin


					

					
A screen shot of the Erudite MW skin on a virgin install

The skin for the Unified Republic of Stars was based off of an excellent WordPress theme called The Erudite by Matt Wiebe. It's clean and easy to read on.

In an effort to make my MediaWiki Look & Feel similar to my WordPress installation, I re-skinned it using The Erudite as the base. It's really pretty simple but also pretty neat.

You can download it here if you're interested in taking a look.

If I had to give it a version number, I'd say it's 0.9.0 right now. It functions correctly with about 90% of MediaWiki functions and is really pretty usable. I also removed most of the custom functions I used for the URS in favor of returning it to the usual way MW drives a site. It's not fully internationalized right now but that's something that can be gotten to later.

Hope everyone likes it.

Contents

JavaScript

Based on feedback received, it seems people are interested in the JavaScript function this site has that shows the five latest articles added to the wiki. If that's all you want, then here's the jQuery to make it happen. Ensure that's included as one of your JavaScript libraries.

You should be able to alter the DOM reference "newestPages" to suit where ever you want it placed. Also, if you want more than five items to be returned, changed the "rclimit" value in the query string. You can have values between 1 and "max" (500) unless it's a registered bot making the request, which this is not.

NOTE: With 1.18, they've made changes that may not have some of the global variables used here. Believe me, it's a pain in the ass but I'm looking for a workaround.


jQuery(window).load(function($) {
  $.getJSON(wgScriptPath 
          + '/api.php?action=query&format=json&list=recentchanges&rctype=new&rclimit=5&rcnamespace=0&rcshow=!redirect', function(data) {
        var container = $('#newestPages');
        container.empty();

        var results = data['query']['recentchanges'];
        var resultlen = results.length;
        for (i = 0; i < resultlen; i++) {
                var result = results[i];
                var timestamp = result['timestamp'];
                var title = result["title"];
                var encodedTitle = encodeURI(title);
                var year = timestamp.substring(2,4);
                var month = timestamp.substring(5,7);
                var day = timestamp.substring(8,10);
                var path = wgArticlePath.replace('\$1', encodedTitle);

                var formatdate = month + "." + day + "." + year;
                container.append('<li>' + formatdate + ' - <a href="' + wgServer + path + '">' + title + '</a></li>');
        }
  });
}); 

Is this the most concise JavaScript ever written? No. But it's not meant to be. What it is is JS written to minimize property calls and define as many "constants" as possible. It may not look pretty but it's faster than JS that refers to deep variables, even with the modern JS engines. I could probably take it a step further and do one "append" call with all the data but, since it's supposed to build only five items, the performance is negligible. However, based on experience, if you plan on doing more than ten, think about appending to one variable and then appending to the DOM only once. In that case, especially if it's more than ten, it will make a considerable difference.

Support

WARNING: If using version 1.18, several of the functions this skin uses were unexpectedly deprecated. Upgrade to 1.18.1 and the patch should be make the skin work, though it hasn't been tested.

If you go ahead and use The Erudite for MW, please note that this is an independent project from its original WordPress theme. Please don't contact Matt Wiebe for support. The Erudite for MW is, for all intents and purposes, a separate codebase.

If you're having problems using it and would like support, please either use the contact form on this site or log-in and use the discussion page associated with this one to log your question or problem.

I don't promise the quickest turnaround time but I'd like this to be useful for people and will continually update the package.


Installation

You can install The Erudite MW by dropping the archive into your skins directory and decompressing it using the following command: tar -xzf mw-erudite.tar.gz

This will put everything in the proper place and the option for The Erudite will appear as an option.

To set the tagline, create a page at: MediaWiki:Tagline and put whatever you'd like in there to have it appear under the site name.

Otherwise, that's basically it. Most other standard configuration parameters (such as what appears in the top menu) should be controlled via the normal method.


Changes

  • 0.9.3 - Mar 7, 2011
    • Fixed the Newest Wiki Pages widget to work with different script paths.
  • 0.9.2 - Jan 24, 2011
    • Added Open Graph meta data to the header.
  • 0.9.1 - Jan 19, 2011
    • Updated to add more wiki controls (protect, move, delete, etc) onto right nav.
    • Added talk notification to appear under the current toolbar.
  • 0.9.0 - Early Jan, can't remember...
    • Initial release from work done modifying the skin for this site.