June is a busy month, but I still found a little time to mess around with our favourite website's code. Most of the following is part of a Bigger Plan:

  • Editor cools are visible to everyone, including our guests. Editor cools by current editors can only be removed by the cooling editor themselves: the hackable loophole has been closed.
  • Message-forwards to usergroups are identified as such on their 'user' pages.
  • The New Logs Nodelet shows all logs, including the hidden ones.
  • The Zen Nodelet Collapser now tracks all collapsed nodelets in a single setting, instead of creating one for each nodelet. It therefore no longer requires all of the user's VARS to be packed into the javascript environment.
  • No longer are all of the user's settings packed into a global variable defined in a javascript file. Nor does javascript ever try to update all of them at once by AJAX. Goodbye userVars and USERVARS (yes, there were both). The global siteVars variable has also been abolished, along with isZen (which was used once). The small amount of information that scripts need to know where they are and what they should be doing about it is packed into a single javascript object called 'e2', defined in the html header. It is therefore no longer necessary to customise any javascript files so they know which page they are operating on.
  • The ?page_id=xxx has been removed from the url for the Javascript Compiler in the html head. This means that browsers can cache it, saving UMich bandwidth and users time. And OldMiner fixed up the 'Date' header so that they will in fact do so.
  • There is a security and sanity check on attempts to update users' settings by AJAX. Any VAR that needs to be updated by AJAX needs to be listed in ajaxVar along with a regular expression defining which values of it are legal.

These last few changes got the site's JavaScript into a tidy enough state that I felt comfortable about activating AJAX for everyone, which I duly did on this day, the first of July of the Year of our Grace 2010. Rather than adjust everyone's settings to get the Javascript Compiler to include the AJAX script in the accustomed fashion, I changed Javascript Compiler to include it or not on the basis of the existing 'noquickvote' setting. Quick voting/async voting was based on AJAX, too, so that made a lot of sense. A couple of other settings let the user choose the appearance of the voting buttons and get confirmation of votes if they want.

While I was at it, I included the Zen Nodelet Collapser script by default as well. It's the sort of thing you should have to switch off rather than switch on. Even if I don't like the transitions (which should also be the sort of thing you can switch off, for which reason they now are).

Finally, I put async voting out to pasture, since its job is now done by Everything2 Ajax.

Log in or register to write something here or to contact authors.