diff options
author | rvelices <rv-github@modusoptimus.com> | 2010-06-22 19:40:31 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2010-06-22 19:40:31 +0000 |
commit | f4d4a3dbcf0ef0e56ff120410ac3e8dee03bfa35 (patch) | |
tree | 458479168fcc237318ca5259e8290a5ca3e959b9 /themes/default/js/rating.js | |
parent | 88fb5407803f1b3cd7a432900828faae5a25f7fb (diff) |
merge r6575-6576 from branch 2.1
-removed use of fix-khtml.css (I tried Safari and it does not need it)
- better javascript funcs + shorter notation
git-svn-id: http://piwigo.org/svn/trunk@6577 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default/js/rating.js')
-rw-r--r-- | themes/default/js/rating.js | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/themes/default/js/rating.js b/themes/default/js/rating.js index 9b8370e93..0e3006ec2 100644 --- a/themes/default/js/rating.js +++ b/themes/default/js/rating.js @@ -35,16 +35,9 @@ function makeNiceRatingForm(options) if (i>0 && rateButton.previousSibling.nodeType == 3 /*TEXT_NODE*/) rateButton.parentNode.removeChild(rateButton.previousSibling); - if(window.addEventListener){ // Mozilla, Netscape, Firefox - rateButton.addEventListener("click", updateRating, false ); - rateButton.addEventListener("mouseout", resetRatingStarDisplay, false ); - rateButton.addEventListener("mouseover", updateRatingStarDisplayEvt, false ); - } - else if(window.attachEvent) { // IE - rateButton.attachEvent("onclick", updateRating); - rateButton.attachEvent("onmouseout", resetRatingStarDisplay); - rateButton.attachEvent("onmouseover", updateRatingStarDisplayEvt); - } + pwgAddEventListener(rateButton, "click", updateRating); + pwgAddEventListener(rateButton, "mouseout", resetRatingStarDisplay); + pwgAddEventListener(rateButton, "mouseover", updateRatingStarDisplayEvt); } resetRatingStarDisplay(); } @@ -88,8 +81,8 @@ function updateRating(e) if (gRatingOptions.ratingSummaryElement) { var t = gRatingOptions.ratingSummaryText; - var args =[result.average, result.count, result.stdev], idx = 0, rexp = new RegExp( /%\.?\d*[sdf]/ ); - _xxx = t.match( rexp ); + var args =[result.average, result.count], idx = 0, rexp = new RegExp( /%\.?\d*[sdf]/ ); + //_xxx = t.match( rexp ); while (idx<args.length) t=t.replace(rexp, args[idx++]); gRatingOptions.ratingSummaryElement.innerHTML = t; } |