diff --git a/assets/css/components/posts/form.css b/assets/css/components/posts/form.css index f8586008..bffee2b1 100644 --- a/assets/css/components/posts/form.css +++ b/assets/css/components/posts/form.css @@ -44,7 +44,9 @@ */ .post-form .post-image, .post-form .post-youtube, -.post-form .post-movie { +.post-form .post-movie, +.post-form .post-weblink +.post-form .post-pdf { display: none; } diff --git a/assets/js/components/posts/form.js b/assets/js/components/posts/form.js index e54a734e..d7d8509c 100644 --- a/assets/js/components/posts/form.js +++ b/assets/js/components/posts/form.js @@ -143,9 +143,36 @@ ComunicWeb.components.posts.form = { movieName.innerHTML = movie.name; }); } - //End : movie + //Add webpage input form + var linkChooseForm = createElem2({ + appendTo: boxBody, + type: "div", + class: "post-weblink" + }); + + var linkInput = createFormGroup({ + target: linkChooseForm, + label: "Page URL", + placeholder: "https://...", + type: "text" + }); + //End : webpage + + //Add PDF specific informations + var pdfUploadForm = createElem2({ + appendTo: boxBody, + type: "div", + class: "post-pdf" + }); + + var pdfFileInput = createElem2({ + appendTo: pdfUploadForm, + type: "input", + elemType: "file" + }); + //End : PDF //Create post type change handler var changesHandler = function(){ @@ -153,7 +180,8 @@ ComunicWeb.components.posts.form = { imgUploadForm.style.display = imageType.checked ? "block" : "none"; youtubeInputForm.style.display = youtubeType.checked ? "block" : "none"; movieInputForm.style.display = movieType.checked ? "block" : "none"; - + linkChooseForm.style.display = linkType.checked ? "block" : "none"; + pdfUploadForm.style.display = pdfType.checked ? "block" : "none"; }; //Apply changesHandler function to all the data types