Skip to content

Commit

Permalink
XWIKI-21778: Admin section: make the Extension section pass webstanda…
Browse files Browse the repository at this point in the history
…rd tests (#2812)

* Replaced inline styling with a use of the meter element

Note: the meter style options are not standard HTML yet, so multiple style need to be used for webkit based browsers and Firefox. Changes have been tested manually with Firefox 121 and Chrome 120
* Added the webstandard test for the extension section.
* Added comments
  • Loading branch information
Sereza7 authored Feb 29, 2024
1 parent ba4473a commit 8e682c4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
<div class="rating-header $cssclass">$ratinglabel</div>
<div class="rating-stars">
<ul class="star-rating ${cssclass}-star #if($locked) locked #end">
<li class="current-rating" style="width:${width}%;"></li>
<li class="current-rating">
<meter class="average-rating" min="0" max="5" value="$rating"/>
</li>
#set($cls = ["one-star", "two-stars", "three-stars", "four-stars", "five-stars"])
#foreach($r in [1..5])
#set($i = $r - 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
display: inline;
}

.star-rating a,
.star-rating .current-rating {
.star-rating a {
position: absolute;
top: 0;
left: 0;
Expand Down Expand Up @@ -66,7 +65,7 @@
z-index: 2;
}

.star-rating .current-rating {
.star-rating .average-rating {
z-index: 1;
background-position: left center;
}
Expand Down Expand Up @@ -115,4 +114,35 @@ ul.locked a {
margin-right: 5px;
float: right;
position: relative;
}

.star-rating .current-rating {
display: block;
height: 100%;
}

.average-rating {
position: relative;
color: transparent;
display: block;
height: 100%;
width: 100%;
/* Remove default background for Firefox */
background: none;
}

/* Remove default background for Chrome & Safari */
.average-rating::-webkit-meter-bar {
background: none;
border: none;
}

/* Add the stars for Chrome & Safari */
.average-rating::-webkit-meter-optimum-value {
background: url("star.gif") left repeat-x;
}

/* Add the stars for Firefox */
.average-rating:-moz-meter-optimum::-moz-meter-bar {
background: url("star.gif") left repeat-x;
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,7 @@
/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&amp;section=Invitation
/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&amp;section=Authentication
<!-- Extensions -->
<!-- /xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&amp;section=XWiki.Extensions
TODO https://jira.xwiki.org/browse/XWIKI-21778 -->
/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&amp;section=XWiki.Extensions
/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&amp;section=XWiki.ExtensionHistory
/xwiki/bin/admin/XWiki/XWikiPreferences?editor=globaladmin&amp;section=XWiki.ExtensionUpdater
<!-- Look and feel -->
Expand Down

0 comments on commit 8e682c4

Please sign in to comment.