From f4d4a3dbcf0ef0e56ff120410ac3e8dee03bfa35 Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 22 Jun 2010 19:40:31 +0000 Subject: 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 --- themes/default/js/rating.js | 17 +++-------- themes/default/js/scripts.js | 72 ++++++++++++++++++-------------------------- 2 files changed, 34 insertions(+), 55 deletions(-) (limited to 'themes/default/js') 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