Q:

Play Framework 1: tag to include javascript file only once

In Play Framework 1, is there a tag which includes javascript file only once in the generated page?
Example:
I want following code:
#{press.script 'my.script.js'}
#{press.script 'my.script.js'}

to inject my.script.js declaration into resulting page only once, so that Play generates the following:
<script src="/path/to/my.script.js"></script>

Please note that press module should be of version >= 1.0.22.
So far, anything but not what's needed was found:

#{press.script 'my.script.js'} simply throws exception when specified twice with same js file
version 1.0.11 of press module added ignoreDuplicates tag property which, as per documentation, should do what's needed, but in next version it was mysteriously removed ...
version 1.0.12 of press module added possibility to add press.allowDuplicates to configuration, but in next version it was again mysteriously removed ...
#{press.single-script 'my.script.js'} simply compresses js file and adds <script> twice to generated file

Please advise

A:

I don't think there is. I have solved a similar problem like this.
Let's say I have one template, main.html. All other templates extend this one. Main.html includes scripts.html. Based on the current URL, the Controller renders form.html which extends main.html. In form.html I have a widget which needs my.script.js. To make sure it's only included on this page (which needs the script) I've set the following variable:
#{set useMyScript: true /}

In scripts.html, I will check this variable and render this script only if needed:
#{if useMyScript}
    #{press.script 'my.script.js'}
#{/if}

So, this is not exactly your case, but I am pretty sure you can set useMyScript to true multiple times with this solution and include the Javascript only once. 
I hope this helps!

