namespace are changed
* Removed $wgUseCategoryMagic option, categories are now enabled unconditionally
* (bug 4359) red [[user:#id]] links generated in [[special:Log]]
+* (bug 3318) UI workarounds for disabled items in license selector
+ MSIE/Win: items now grayed out, JS will revert to 'non selected' if clicked
+ Safari: JS will revert to 'non selected' if clicked (but not gray)
+ MSIE/Mac: indented items now visible (JS hack)
+
=== Caveats ===
<tr>" );
if ( $licenseshtml != '' ) {
+ global $wgStylePath;
$wgOut->addHTML( "
<td align='right'><label for='wpLicense'>$license:</label></td>
<td align='left'>
- <select name='wpLicense' id='wpLicense' tabindex='4'>
+ <script type='text/javascript' src=\"$wgStylePath/common/upload.js\"></script>
+ <select name='wpLicense' id='wpLicense' tabindex='4'
+ onchange='licenseSelectorCheck()'
<option value=''>$nolicense</option>
$licenseshtml
</select>
--- /dev/null
+function licenseSelectorCheck() {
+ var selector = document.getElementById("wpLicense");
+ if (selector.selectedIndex > 0 &&
+ selector.options[selector.selectedIndex].value == "" ) {
+ // Browser is broken, doesn't respect disabled attribute on <option>
+ selector.selectedIndex = 0;
+ }
+}
+
+function licenseSelectorFixup() {
+ // for MSIE/Mac; non-breaking spaces cause the <option> not to render
+ // but, for some reason, setting the text to itself works
+ var selector = document.getElementById("wpLicense");
+ var ua = navigator.userAgent;
+ var isMacIe = (ua.indexOf("MSIE") != -1) && (ua.indexOf("Mac") != -1);
+ if (isMacIe) {
+ for (var i = 0; i < selector.options.length; i++) {
+ selector.options[i].text = selector.options[i].text;
+ }
+ }
+}
+
+addOnloadHook(licenseSelectorFixup);