diff options
author | rvelices <rv-github@modusoptimus.com> | 2010-11-30 20:42:03 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2010-11-30 20:42:03 +0000 |
commit | 208a5acddcfebc131af01855edbf7f6cdc903bf7 (patch) | |
tree | d499ce28e88832a3e3f3285463f86427d60c9047 /themes/default/template | |
parent | bad80308ea2a987f34b44dca1912010f78f3341a (diff) |
bug 2043: some Javascript errors in default theme (also makes the rating.js script async)
git-svn-id: http://piwigo.org/svn/trunk@7957 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default/template')
-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 6ea497112..00e548609 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> |