Added PDF support

This commit is contained in:
Pierre 2018-01-03 10:53:33 +01:00
parent 6f3bfaff1e
commit 2fc57b40ab
2 changed files with 36 additions and 0 deletions

View File

@ -20,3 +20,7 @@
max-width: 100%; max-width: 100%;
height: 300px; height: 300px;
} }
.post .post-pdf {
text-align: center;
}

View File

@ -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 { else {
//Log error //Log error
ComunicWeb.debug.logMessage("Not implemented kind of post: " + infos.kind); ComunicWeb.debug.logMessage("Not implemented kind of post: " + infos.kind);