]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Move annotatorjs to the bottom of the body
authorThomas Citharel <tcit@tcit.fr>
Wed, 24 Feb 2016 00:13:30 +0000 (01:13 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Fri, 26 Feb 2016 17:14:27 +0000 (18:14 +0100)
So that the "article" tag is loaded before

src/Wallabag/CommentBundle/DependencyInjection/WallabagCommentExtension.php
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig

index 2d0b64ad179b94be3b8cfda53a0cb5689d35907b..6b05fa0015b3fbee9e0553b97f59119b9f898e5e 100644 (file)
@@ -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
 {
index 2a06484e02dcc4b509c364c38663b45f184b83e6..c2bbd845f339b1227177428c0e7c2330994b0136 100644 (file)
@@ -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 %}