From b8f16b50a7f24c7a1d77424477c7c1b5fd9d7f57 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 19 Feb 2020 20:19:08 +0100 Subject: [PATCH] simplified viewer + fixed characters escaping --- cookbook/templates/recipe_view.html | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/cookbook/templates/recipe_view.html b/cookbook/templates/recipe_view.html index f19baa22eb..ade2b1bd20 100644 --- a/cookbook/templates/recipe_view.html +++ b/cookbook/templates/recipe_view.html @@ -9,6 +9,19 @@ {% block extra_head %} + + + + + {% endblock %} {% block content %} @@ -196,15 +209,9 @@
{% trans 'External recipe' %}
var container = document.getElementById("viewerContainer"); - // (Optionally) enable hyperlinks within PDF files. - var pdfLinkService = new pdfjsViewer.PDFLinkService(); - - var pdfViewer = new pdfjsViewer.PDFViewer({ container: container, - linkService: pdfLinkService, }); - pdfLinkService.setViewer(pdfViewer); document.addEventListener("pagesinit", function () { // We can use pdfViewer now, e.g. let's change default scale. @@ -215,12 +222,12 @@
{% trans 'External recipe' %}
var loadingTask = pdfjsLib.getDocument({ data: base64Pdf }); + loadingTask.promise.then(function (pdfDocument) { // Document loaded, specifying document for the viewer and // the (optional) linkService. pdfViewer.setDocument(pdfDocument); - pdfLinkService.setDocument(pdfDocument, null); }); }