Last modified: 2010-05-15 15:33:33 UTC
When using the 'application/xhtml+xml' content type document.write() function do not work in 'skins/common/wikibits.js'. You should instead use the DOM. I use this to select the content type based on the browser's HTTP_ACCEPT: $wgMimeType = in_array('application/xhtml+xml', array_map('trim', explode(',', $_SERVER['HTTP_ACCEPT']))) ? 'application/xhtml+xml' : 'text/html'; I will include a patch, but I will not work on (at least not anytime soon) addButton() or addInfobox() as I currently do not understand them. I first noticed this bug concerning the DOM with showTocToggle(). The patch has had the showTocToggle() tested on Opera 7.54u2, Mozilla Firefox 1.0.2 and Internet Explorer 6. The 'special stylesheet links' has not been tested. In addition to this bug, Opera should use document.createElementNS() rather than document. createElement(). Internet Explorer does not support document.createElementNS, so a check should be performed before using it. This was first discovered in tabbedprefs(), which has also been included in the patch and tested.
Created attachment 553 [details] Proposed patch for bug 2186 Version 1 Patch by Damien Bezborodow. Further notes included in comments. Compare with the current file of 1.4.4 to see my changes.
Please make sure you're working from CVS HEAD, *not* the 1.4 release branch.
Created attachment 557 [details] Bug 2186 patch This has been updated to be relevent to the CVS head. There are still some instances of document.write() that need to be removed. The use of document.createElementNS() will solve issues in Opera, but they may not work in HTML. Furthermore this script will need testing. If the current version works on the CVS version, then this should too.
Created attachment 4978 [details] Updated patch Updated patch to remove the last of the document.write()'s in wikibits. These are all <link> CSS, so I made a new function called appendLinkedCss() to add new child DOM objects to the head. Just want some review, as Javascript isn't my strongest.
Shouldn't this just use importStylesheetURI() instead of creating a new function to do the same thing?
Fixed properly in r37320