Re: new script-template> widget

2020-05-14 Thread James Yong
Hi all, While extracting the scripts from html-template to script-template and testing the changes, I found the process to be cumbersome. So I made a change not to use script-template tag but add a multi-block attribute to html-template tag. When multi-block=true, inline scripts will be

Re: new script-template> widget

2020-05-11 Thread Jacques Le Roux
Hi James, Yes, it already exists. Unfortunately for years as it's a major change. https://issues.apache.org/jira/browse/OFBIZ-9976 It will be interesting to see if after your proposed effort much work remains for require.js. It could be then done... Jacques Le 11/05/2020 à 12:21, James Yong

Re: new script-template> widget

2020-05-11 Thread James Yong
Hi Jacques, I think having RequireJs for loading dependencies, can go in another JIRA issue. It requires us to change the way Javascript coding is done. Regards, James On 2020/05/10 12:58:49, Jacques Le Roux wrote: > Hi James, > > I  know it's not all of them as you already mentioned. But

Re: new script-template> widget

2020-05-10 Thread Jacques Le Roux
Hi James, I  know it's not all of them as you already mentioned. But could not some these of these scripts be handled by Require.js? Jacques Le 10/05/2020 à 14:32, James Yong a écrit : Hi Michael, There are CSP errors being logged in the browser console, due to the use of inline

Re: new script-template> widget

2020-05-10 Thread James Yong
Hi Michael, There are CSP errors being logged in the browser console, due to the use of inline javascripts. The proposed method allow us to: 1. convert the inline javascripts into external scripts for better CSP compliance. 2. use freemarker macros in the scripts. 3. place the extracted

Re: new script-template> widget

2020-05-10 Thread Michael Brohl
Hi James, can you explain the purpose of this? Why not just use a JavaScript file and a decorator? Thanks, Michael Brohl ecomify GmbH - www.ecomify.de Am 10.05.20 um 06:53 schrieb James Yong: Hi all, I have created a JIRA issue for this, i.e. OFBIZ-11686. Decided not to have a placement

Re: new script-template> widget

2020-05-09 Thread James Yong
Hi all, I have created a JIRA issue for this, i.e. OFBIZ-11686. Decided not to have a placement attribute because script will always be placed after body tag. Regards, James On 2020/05/07 11:48:32, James Yong wrote: > Hi all, > > Propose a new widget tag that adds an external script >