AAVL#32196: Of het mogelijk is om 3 ipv 5 sterren te kunnen geven.
svn path=/Website/trunk/; revision=25386
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
<!--#include file="../Shared/plaatsselector.inc" -->
|
||||
<!--#include file="../Shared/kostenplaatsselector.inc" -->
|
||||
<!-- #include file="../Shared/json2.js" -->
|
||||
<!-- #include file="../Shared/rater.inc" -->
|
||||
|
||||
<!-- #include file="bes_flexkenmerk.inc" -->
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
*/ %>
|
||||
<!-- #include file="../Shared/common.inc" -->
|
||||
<!-- #include file="../Shared/iface.inc" -->
|
||||
<!-- #include file="../Shared/json2.js" -->
|
||||
<!-- #include file="../Shared/rater.inc" -->
|
||||
<!-- #include file="./fac_like.inc" -->
|
||||
<%
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<!-- #include file="../Shared/persoonselector.inc" -->
|
||||
<!-- #include file="../Shared/plaatsselector.inc" -->
|
||||
<!-- #include file="../Shared/kostenplaatsselector.inc" -->
|
||||
<!-- #include file="../Shared/json2.js" -->
|
||||
<!-- #include file="../Shared/rater.inc" -->
|
||||
<!-- #include file="mld.inc" -->
|
||||
<!-- #include file="mld_flexkenmerk.inc" -->
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<!-- #include file="../Shared/plaatsselector.inc" -->
|
||||
<!-- #include file="../Shared/persoonselector.inc" -->
|
||||
<!-- #include file="../Shared/kostenplaatsselector.inc" -->
|
||||
<!-- #include file="../Shared/json2.js" -->
|
||||
<!-- #include file="../Shared/rater.inc" -->
|
||||
|
||||
<%
|
||||
|
||||
@@ -16,24 +16,33 @@ FCLTHeader.Requires({ plugins: ["jQuery"],
|
||||
|
||||
function _initRater()
|
||||
{
|
||||
var ratingParams = rating.getRatingParams();
|
||||
%>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".rater").raty({
|
||||
score: function() {
|
||||
return (parseInt($(this).attr('data-score')))/2;
|
||||
},
|
||||
readOnly: function() {
|
||||
return $(this).attr('readonly');
|
||||
},
|
||||
showHalf : true,
|
||||
half : true,
|
||||
path: '../localscripts/raty/img/',
|
||||
width: 120,
|
||||
number: <%=rating.numberOfStars()%>,
|
||||
hints: [L('lcl_faclike_statisf1'), L('lcl_faclike_statisf2'), L('lcl_faclike_statisf3'), L('lcl_faclike_statisf4'), L('lcl_faclike_statisf5')]
|
||||
});
|
||||
});
|
||||
function getScore(rating)
|
||||
{
|
||||
var score = 0;
|
||||
if (<%=S("fac_like_bad")%> > 0 && rating >= <%=S("fac_like_bad")%>) score++;
|
||||
if (<%=S("fac_like_poor")%> > 0 && rating >= <%=S("fac_like_poor")%>) score++;
|
||||
if (<%=S("fac_like_normal")%> > 0 && rating >= <%=S("fac_like_normal")%>) score++;
|
||||
if (<%=S("fac_like_good")%> > 0 && rating >= <%=S("fac_like_good")%>) score++;
|
||||
if (<%=S("fac_like_excellent")%> > 0 && rating >= <%=S("fac_like_excellent")%>) score++;
|
||||
|
||||
return score;
|
||||
}
|
||||
|
||||
$(document).ready(function ()
|
||||
{
|
||||
$(".rater").raty({score: function() { return getScore((parseInt($(this).attr('data-score')))); },
|
||||
readOnly: function() { return $(this).attr('readonly'); },
|
||||
showHalf : true,
|
||||
half : true,
|
||||
path: '../localscripts/raty/img/',
|
||||
width: 120,
|
||||
number: <%=ratingParams.nrOfSstars%>,
|
||||
hints: <%=JSON.stringify(ratingParams.hints)%>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<%
|
||||
}
|
||||
@@ -44,7 +53,7 @@ function rater(rating, params)
|
||||
if (!rating && params.shownone)
|
||||
return "";
|
||||
|
||||
likesymbol = "<span class='rater' data-score='"+rating+ "'" +(params.readonly?" readonly='1'":"")+"></span>";
|
||||
likesymbol = "<span class='rater' data-score='" + rating + "'" + (params.readonly? " readonly='1'" : "") + "></span>";
|
||||
return likesymbol;
|
||||
}
|
||||
|
||||
@@ -52,21 +61,37 @@ var rating = {
|
||||
// Gives the (1 out of 5) image that belongs to a given rating
|
||||
// If no rating is given (null), then depening on params.shownone
|
||||
// either null or the none-picture is given
|
||||
numberOfStars: function ()
|
||||
getRatingParams: function ()
|
||||
{
|
||||
var nrOfSstars = 0;
|
||||
var hints = [];
|
||||
if (S("fac_like_bad") > 0)
|
||||
{
|
||||
nrOfSstars++;
|
||||
hints.push(L('lcl_faclike_statisf1'));
|
||||
}
|
||||
if (S("fac_like_poor") > 0)
|
||||
{
|
||||
nrOfSstars++;
|
||||
hints.push(L('lcl_faclike_statisf2'));
|
||||
}
|
||||
if (S("fac_like_normal") > 0)
|
||||
{
|
||||
nrOfSstars++;
|
||||
hints.push(L('lcl_faclike_statisf3'));
|
||||
}
|
||||
if (S("fac_like_good") > 0)
|
||||
{
|
||||
nrOfSstars++;
|
||||
hints.push(L('lcl_faclike_statisf4'));
|
||||
}
|
||||
if (S("fac_like_excellent") > 0)
|
||||
{
|
||||
nrOfSstars++;
|
||||
hints.push(L('lcl_faclike_statisf5'));
|
||||
}
|
||||
|
||||
return nrOfSstars;
|
||||
return {nrOfSstars: nrOfSstars, hints: hints};
|
||||
},
|
||||
|
||||
satisfactionsymbol: function (rating, params)
|
||||
|
||||
Reference in New Issue
Block a user