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 --- .../DependencyInjection/WallabagCommentExtension.php | 3 --- .../CommentBundle/Resources/config/routing.yml | 0 .../CommentBundle/Resources/config/services.yml | 4 ---- .../views/themes/baggy/Entry/entry.html.twig | 20 ++++++++++++++++++++ .../views/themes/material/Entry/entry.html.twig | 3 --- 5 files changed, 20 insertions(+), 10 deletions(-) delete mode 100644 src/Wallabag/CommentBundle/Resources/config/routing.yml delete mode 100644 src/Wallabag/CommentBundle/Resources/config/services.yml (limited to 'src') diff --git a/src/Wallabag/CommentBundle/DependencyInjection/WallabagCommentExtension.php b/src/Wallabag/CommentBundle/DependencyInjection/WallabagCommentExtension.php index b58a17a0..2d0b64ad 100644 --- a/src/Wallabag/CommentBundle/DependencyInjection/WallabagCommentExtension.php +++ b/src/Wallabag/CommentBundle/DependencyInjection/WallabagCommentExtension.php @@ -16,8 +16,5 @@ class WallabagCommentExtension extends Extension { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); - - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.yml'); } } diff --git a/src/Wallabag/CommentBundle/Resources/config/routing.yml b/src/Wallabag/CommentBundle/Resources/config/routing.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/src/Wallabag/CommentBundle/Resources/config/services.yml b/src/Wallabag/CommentBundle/Resources/config/services.yml deleted file mode 100644 index 0e7972a4..00000000 --- a/src/Wallabag/CommentBundle/Resources/config/services.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: -# wallabag_comment.example: -# class: Wallabag\CommentBundle\Example -# arguments: ["@service_id", "plain_value", %parameter%] 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 %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index 8ea2d691..2a06484e 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig @@ -198,9 +198,6 @@ app .then(function () { app.annotations.load({entry: {{ entry.id }}}); }); - - - {% endblock %} -- cgit v1.2.3