Skip to content

Commit

Permalink
TASK: Show a hint if an H5P element has been moved and cannot be disp…
Browse files Browse the repository at this point in the history
…layed anymore, prompting the user to reload.
  • Loading branch information
Bastian Heist committed May 31, 2019
1 parent c78ba17 commit 01c8f9e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ prototype(Neos.Neos:Page) {
head {
javascripts.h5p = Sandstorm.NeosH5P:H5PScriptsAndStyles
}
body {
javascripts.h5p = Neos.Fusion:Template {
templatePath = 'resource://Sandstorm.NeosH5P/Private/Templates/Frontend/H5PNotInitializedWarning.html'
}
}
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script>
document.querySelectorAll('.h5p-not-initialized-warning').forEach(i => i.remove());
</script>
7 changes: 7 additions & 0 deletions Resources/Private/Templates/Plugin/Content/Content.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
</div>
</f:case>
</f:switch>
<p class="h5p-not-initialized-warning">
<strong>This H5P content cannot be shown right now.</strong>
<f:if condition="{neos:rendering.inBackend}">
<br>
Did you just move this element? Reload the page to attempt to fix the problem.
</f:if>
</p>
</f:then>
<f:else>
<p><strong>No content chosen - please choose or create an H5P content element in the inspector.</strong></p>
Expand Down

0 comments on commit 01c8f9e

Please sign in to comment.