From 7720cca5325eae71595e6355d6599448c30377fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 23 Feb 2016 11:32:48 +0100 Subject: Add annotator in baggy theme + Documentation about annotations --- .../views/themes/baggy/Entry/entry.html.twig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig index 94f4ba7d..988cbd29 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig @@ -107,5 +107,25 @@ retrievePercent({{ entry.id }}); }); }); + + 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 }}}); + }); + {% endblock %} -- cgit v1.2.3