From 2fc57b40ab49acc8203a5caa66fd61a38bf08239 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 3 Jan 2018 10:53:33 +0100 Subject: [PATCH] Added PDF support --- assets/css/components/posts/ui.css | 4 ++++ assets/js/components/posts/ui.js | 32 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/assets/css/components/posts/ui.css b/assets/css/components/posts/ui.css index cc0b0ad3..a6694613 100644 --- a/assets/css/components/posts/ui.css +++ b/assets/css/components/posts/ui.css @@ -19,4 +19,8 @@ .post .post-video { max-width: 100%; height: 300px; +} + +.post .post-pdf { + text-align: center; } \ No newline at end of file diff --git a/assets/js/components/posts/ui.js b/assets/js/components/posts/ui.js index 2ca5a7a0..56e90ac3 100644 --- a/assets/js/components/posts/ui.js +++ b/assets/js/components/posts/ui.js @@ -124,6 +124,38 @@ ComunicWeb.components.posts.ui = { } + //In case of PDF + else if(infos.kind == "pdf"){ + + //Create PDF button + var buttonContainer = createElem2({ + appendTo: postRoot, + type: "div", + class: "post-pdf", + }); + + var button = createElem2({ + appendTo: buttonContainer, + type: "a", + class: "btn btn-app", + href: infos.file_path_url, + }); + button.target = "_blank"; + + createElem2({ + appendTo: button, + type: "i", + class: "fa fa-file-pdf-o" + }); + + createElem2({ + appendTo: button, + type: "span", + innerHTML: "PDF" + }); + + } + else { //Log error ComunicWeb.debug.logMessage("Not implemented kind of post: " + infos.kind);