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
PFE#640 - initial commit #641
Conversation
I'm making progress. I have found it how to add a resource inside |
Custom theme example is working fine when custom theme stylesheet is put resources directory of the webapp. |
- added markdown support - added controller support for database interaction
- cleanup
- cleanup
There are two issues, I don't know how to solve them and need your help.
EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'nonce-MGI1ODZiOTgtNDgyZi00ZTI4LTlmZDYtYTNmMzhjMzhmZjc5'" |
core/src/main/java/org/primefaces/extensions/component/keynote/Keynote.java
Outdated
Show resolved
Hide resolved
core/src/main/resources/META-INF/resources/primefaces-extensions/keynote/widget.js
Outdated
Show resolved
Hide resolved
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
What is your issue here?
Where are you getting this? Somewhere in your code? |
Somewhere in their code i wondering if they are doing |
For vertical slides, it is needed to generate sections like this; <section><!-- Horizontal slide tag -->
<section>Vertical Slide 1</section><!-- Vertical slide tag -->
<section>Vertical Slide 2</section><!-- Vertical slide tag -->
</section> with
Not in PFE showcase since CSP is not activated, but in my app that CSP is enabled. |
You probably need to create a renderer for a |
@melloware There are two js files which are reveal.js and markdown.js (a plugin). There is no |
If you can get me the exact error and it should point to a line of code you can click on so it will help use figure out where exactly the eval call is. That would be great. |
Yes that Function call is not allowed according to CSP. That is similar to
|
I think you will have to report it to the Reveal.js team on their github. |
Looks like your real CSP issue is here: jaredpalmer/tsdx#954 And core issue: facebook/regenerator#378 |
Reported hakimel/reveal.js#3091 |
core/src/main/java/org/primefaces/extensions/component/keynote/KeynoteRenderer.java
Outdated
Show resolved
Hide resolved
Great job! Thanks! |
@aripddev Is this ready for a final review? |
@jepsar Except for CSP, there is one issue which I couldn't find the solution. The remain issue is to change theme, not custom but ready one. |
@jepsar I am looking at the thematization of I suggest to render the ready themes by changing the original style files and giving different class names for each, as in |
@aripddev in Lines 210 to 216 in 4cba61a
You could do that with CSS resource and inject it into the DOM in the widget. |
@jepsar Removed 160 if (!"none".equals(keynote.getTheme())) {
161 wb.attr("utilsScript",
162 context.getApplication()
163 .getResourceHandler()
164 .createResource("keynote/theme/" + keynote.getTheme() + ".css", "primefaces-extensions")
165 .getRequestPath());
166 } It throws java.lang.NullPointerException
at org.primefaces.extensions.component.keynote.KeynoteRenderer.encodeScript(KeynoteRenderer.java:165) To see what happens I just changed it to pf.cw("ExtKeynote", "widget_j_id_x", {
id: "j_id_x",
width: 480,
height: 350,
theme: "night",
utilsScript: "\/showcase\-ext\/javax.faces.resource\/inputphone\/utils.js.jsf?ln=primefaces\-extensions\x26v=11.0.0\-SNAPSHOT\x26e=11.0.0\-SNAPSHOT"
}); |
@aripddev I'll have a closer look at it this evening. First guess is that the resources are not included in the JAR. Can you double check the POM please? |
Thanks @jepsar . BTW all themes provided by reveal.js are inside keynote directory. |
See jepsar@37f9675 |
- removed custom theme - corrected resources paths of css files in theme directory
transitionSpeed, | ||
backgroundTransition, | ||
theme, | ||
library, |
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.
@melloware what do you think of this way of offering themes to be loaded?
IMO we should just offer / support the bundled themes. And if you want something custom, simply create custom styles in a custom style sheet.
@melloware @aripddev What is the status here? Are we waiting for hakimel/reveal.js#3091? |
I don't think we should wait for that CSP fix to merge this. If everything else is in good shape @aripddev ? |
@jepsar , @melloware It is ok for me. Once CSP issue fixes we can update it. Thanks. |
Keynote component with basic features without theming. I am unable to implement theming.
I think below code in pom.xml is merging all theme files into one. Since each theme is available as a separate stylesheet, it doesn't work. I can get theme name but I don't know how to load relevant css file.