[ 
https://issues.apache.org/jira/browse/SLING-428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars Trieloff updated SLING-428:
--------------------------------

    Attachment: SLING-428.patch

This patch implements the load() and print() methods in the global scope. 
load() will use the ResourceResolver to resolve a script and evaluate it, 
print() will log an info statement using the default logger.

This patch has been tested with the Dojo Javascript library, proving that even 
massive libraries are supported.

> [Javascript] allow Server-side inclusion of Javascript files
> ------------------------------------------------------------
>
>                 Key: SLING-428
>                 URL: https://issues.apache.org/jira/browse/SLING-428
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: Lars Trieloff
>         Attachments: SLING-428.patch
>
>
> For the sake of modularizing server-side Javascript libraries, it is 
> advisable to have an inclusion mechanism. Javascript does not have an 
> standardized way of handling inclusions, so I propose to use the conventions 
> established by the Rhino Javascript Shell 
> (http://www.mozilla.org/rhino/shell.html) which is introducing a load() 
> function in the global scope, loading and evaluating a Javascript file in the 
> current scope.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to