diff options
author | rvelices <rv-github@modusoptimus.com> | 2010-11-30 20:42:35 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2010-11-30 20:42:35 +0000 |
commit | c7f1e1d8ad564090c21136d13b122cf7f8a4a270 (patch) | |
tree | 913592002708e7561078b04c41f396917636e238 /themes/default/template/picture.tpl | |
parent | 31ab88f829a3643833bac1707925f5d6a8ff312c (diff) |
bug 2043: merge from trunk to branch 2.1
some Javascript errors in default theme (also makes the rating.js script async)
git-svn-id: http://piwigo.org/svn/branches/2.1@7958 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | themes/default/template/picture.tpl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index 70eeb0fb8..9a4b547cd 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -208,11 +208,15 @@ y.callService( <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> {/if} {/foreach} - <script type="text/javascript" src="{$ROOT_URL}themes/default/js/rating.js"></script> <script type="text/javascript"> - makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id}, - updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"), - ratingSummaryText: "{'%.2f (rated %d times)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} ); + var _pwgRatingAutoQueue = _pwgRatingAutoQueue || []; + _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id}, + updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"), + ratingSummaryText: "{'%.2f (rated %d times)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} ); + (function () {ldelim} + var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '{$ROOT_URL}themes/default/js/rating.js'; + var s0 = document.getElementsByTagName('script')[0]; s0.parentNode.insertBefore(s, s0); + })(); </script> </div> </form> |