Finished creating and testing the style switcher
Posted by mholmes on 04 Jun 2007 in Activity log
These were the steps:
- Created a content document called
style.xml
, with three links, one for each style (the page is here). Actually, they were originally links, but for various reasons (mainly oddities in the behaviour of Safari and Konqueror with anchor tags which have nohref
attribute), I ended up making them<span>
tags with anonclick
event. - Created a pipeline just for that page, for testing purposes, and implemented the branching structure for that pipeline.
- Created a couple of JavaScript functions in the
utilities.js
file. One just sets a cookie (adapted from this page). The other does this:function SwitchStyle(NewStyle){ SetCookie('PageStyle', NewStyle, 365, '/', '', ''); window.location.reload(); }
- Set the
onclick
event in the<span>
tags on the page to call theSwitchStyle
function. - Tested the page on Firefox, IE6, IE7, Opera, Safari, WebKit and Konqueror, and tweaked until it worked the same on all the files.
- Worked through all of the relevant matchers in the stylesheet, adding branching blocks as appropriate, and testing as I went.
Everything seems to be working well. IE's lousy CSS support makes all three themes less attractive on that browser, but that's life.
Now I need to get the text on the style-switching page translated, before I can add it to the site menu.
This entry was posted by Martin and filed under Activity log.