mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-23 08:06:33 +00:00
Move annotatorjs to the bottom of the body
So that the "article" tag is loaded before
This commit is contained in:
parent
7720cca532
commit
2b6e65a5e3
2 changed files with 23 additions and 24 deletions
|
@ -3,9 +3,7 @@
|
|||
namespace Wallabag\CommentBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use Symfony\Component\DependencyInjection\Loader;
|
||||
|
||||
class WallabagCommentExtension extends Extension
|
||||
{
|
||||
|
|
|
@ -178,28 +178,6 @@ main {
|
|||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var app = new annotator.App();
|
||||
app.include(annotator.ui.main, {
|
||||
element: document.querySelector('article')
|
||||
});
|
||||
app.include(annotator.storage.http, {
|
||||
prefix: '',
|
||||
urls: {
|
||||
create: '{{ path('annotations_post_annotation', { 'entry': entry.id }) }}',
|
||||
update: '{{ path('annotations_put_annotation', { 'comment': 'idComment' }) }}',
|
||||
destroy: '{{ path('annotations_delete_annotation', { 'comment': 'idComment' }) }}',
|
||||
search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}'
|
||||
}
|
||||
});
|
||||
app
|
||||
.start()
|
||||
.then(function () {
|
||||
app.annotations.load({entry: {{ entry.id }}});
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
@ -230,6 +208,29 @@ app
|
|||
{{ entry.content | raw }}
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var app = new annotator.App();
|
||||
app.include(annotator.ui.main, {
|
||||
element: document.querySelector('article')
|
||||
});
|
||||
app.include(annotator.storage.http, {
|
||||
prefix: '',
|
||||
urls: {
|
||||
create: '{{ path('annotations_post_annotation', { 'entry': entry.id }) }}',
|
||||
update: '{{ path('annotations_put_annotation', { 'comment': 'idComment' }) }}',
|
||||
destroy: '{{ path('annotations_delete_annotation', { 'comment': 'idComment' }) }}',
|
||||
search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}'
|
||||
}
|
||||
});
|
||||
app
|
||||
.start()
|
||||
.then(function () {
|
||||
app.annotations.load({entry: {{ entry.id }}});
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
|
|
Loading…
Reference in a new issue