add a visual cue which shows the rating definition currently selected, it changes when a different rating is selected
This commit is contained in:
committed by
Chris Morgan
parent
166d6fdf41
commit
4bf0bb6a27
@@ -217,7 +217,7 @@ function make_bugzilla_version_list($sVarname, $sSelectedValue)
|
|||||||
// returns a string containing the html for the maintainer rating list
|
// returns a string containing the html for the maintainer rating list
|
||||||
function make_maintainer_rating_list($varname, $cvalue)
|
function make_maintainer_rating_list($varname, $cvalue)
|
||||||
{
|
{
|
||||||
$sTxt = "<select name='$varname'>\n";
|
$sTxt = "<select id='ratingSelect' onchange='showHint(this)' name='$varname'>\n";
|
||||||
$sTxt .= "<option value=\"\">Choose ...</option>\n";
|
$sTxt .= "<option value=\"\">Choose ...</option>\n";
|
||||||
$aRating = array("Platinum", "Gold", "Silver", "Bronze", "Garbage");
|
$aRating = array("Platinum", "Gold", "Silver", "Bronze", "Garbage");
|
||||||
$iMax = count($aRating);
|
$iMax = count($aRating);
|
||||||
@@ -229,7 +229,7 @@ function make_maintainer_rating_list($varname, $cvalue)
|
|||||||
else
|
else
|
||||||
$sTxt .= "<option class=$aRating[$i] value=$aRating[$i]>$aRating[$i]\n";
|
$sTxt .= "<option class=$aRating[$i] value=$aRating[$i]>$aRating[$i]\n";
|
||||||
}
|
}
|
||||||
$sTxt .= "</select>\n";
|
$sTxt .= "</select> <span id='hint'></span> \n";
|
||||||
|
|
||||||
return $sTxt;
|
return $sTxt;
|
||||||
}
|
}
|
||||||
|
|||||||
29
scripts.js
29
scripts.js
@@ -67,3 +67,32 @@ function showComment(commentid)
|
|||||||
elem.show();
|
elem.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* provide a hint to the user about the selected rating */
|
||||||
|
var ratingdesc=[
|
||||||
|
"",
|
||||||
|
" Works flawlessly out of the box - no problems ",
|
||||||
|
" Works flawlessly with DLL overrides, third party software or other settings ",
|
||||||
|
" Works excellently for normal use;works fine in singleplayer but not multi ",
|
||||||
|
" Works but has issues for normal use ",
|
||||||
|
" Does not run or cannot be installed with Wine "
|
||||||
|
];
|
||||||
|
var ratingstyle =[
|
||||||
|
"",
|
||||||
|
"platinum",
|
||||||
|
"gold",
|
||||||
|
"silver",
|
||||||
|
"bronze",
|
||||||
|
"garbage"
|
||||||
|
];
|
||||||
|
function showHint(o){
|
||||||
|
if(o)
|
||||||
|
{
|
||||||
|
$('hint').innerHTML=ratingdesc[o.selectedIndex];
|
||||||
|
$w($('hint').className).map( function(x){ $('hint').removeClassName(x); })
|
||||||
|
$('hint').addClassName(ratingstyle[o.selectedIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* executed when document is ready */
|
||||||
|
document.observe("dom:loaded", function() {
|
||||||
|
showHint($('ratingSelect'));
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user