From 28cbccbecd81c1a3ad75837211ec983b7c1fcb69 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 1 Jan 2006 01:05:21 +0000 Subject: [PATCH] * (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) --- RELEASE-NOTES | 5 +++++ includes/Licenses.php | 1 + includes/SpecialUpload.php | 5 ++++- skins/common/upload.js | 23 +++++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 skins/common/upload.js diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b311c5dac9..45066c3236 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -382,6 +382,11 @@ fully support the editing toolbar, but was found to be too confusing. 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 === diff --git a/includes/Licenses.php b/includes/Licenses.php index 4294e2f489..5a5df29bb8 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -101,6 +101,7 @@ class Licenses { array( 'value' => '', 'disabled' => 'disabled', + 'style' => 'color: GrayText', // for MSIE ), $depth ); diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 9f8b63f120..0f738e5107 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -609,10 +609,13 @@ class UploadForm { " ); if ( $licenseshtml != '' ) { + global $wgStylePath; $wgOut->addHTML( " - $nolicense $licenseshtml diff --git a/skins/common/upload.js b/skins/common/upload.js new file mode 100644 index 0000000000..160fbf27a2 --- /dev/null +++ b/skins/common/upload.js @@ -0,0 +1,23 @@ +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