-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a third optional argument to ADD_JS_FILE to add script tag attributes (defer, async, etc) #576
Add a third optional argument to ADD_JS_FILE to add script tag attributes (defer, async, etc) #576
Conversation
reference of attribute value pairs. These attributes will be added to the script tag that is added to the page. This is added in a corresponding pull request to webwork2. The usage of this argument is documented in the POD for the method. It usage is also demonstrated in the paserGraphTool.pl macro (see below). Defer loading of the jsxgraphcore.js and graphtool.min.js javascript files.
4597ba4
to
f5600d8
Compare
external argument from working.
This looks like this is mainly for |
Actually the graph tool macro doesn't really need it. It can use it though. I just used that as an example. The point of this pull request is really about future proofing by adding versatility. |
Reading through the docs and code, it seems that
Is there anything using the 3rd argument. If not and just future-proofing, I feel safe to pull in. |
The only thing to test is that problems using the macros that use the ADD_JS_FILE method still work. Those are graph tool problems and Geogebra applet problems mainly at this point. |
The graphTool problems work fine. Looks like the geogebra problems that I found are java applets. Are we still supporting those? I found some CUNY geogebra problems and those look good. |
I think we can merge unless we want another set of eyes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not have time to test, but it looks good and @pstaab reported testing.
Add a third optional argument to ADD_JS_FILE to add script tag attributes (defer, async, etc)
Add a third optional argument to ADD_JS_FILE. This argument is a hash reference of attribute value pairs. These attributes will be added to the script tag that is added to the page. The code for adding these attributes to the html that is output is added in a corresponding pull request to webwork2 (see openwebwork/webwork2#1374).
The usage of this argument is documented in the POD for the method. Its usage is also demonstrated in the paserGraphTool.pl macro.
Also, fix a bug that prevented the optional second argument of ADD_CSS_FILE from working.