mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-27 03:08:51 +00:00
Work progress on post create form
This commit is contained in:
parent
0d40644f6e
commit
85c452fd92
@ -4,6 +4,9 @@
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
/**
|
||||
* Message text form
|
||||
*/
|
||||
.post-form .new-message {
|
||||
width: 100%;
|
||||
min-height: 100px;
|
||||
@ -14,6 +17,10 @@
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Message type chooser
|
||||
*/
|
||||
.post-form .post-types {
|
||||
text-align: center;
|
||||
}
|
||||
@ -31,6 +38,20 @@
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Post-types specific
|
||||
*/
|
||||
.post-form .post-image,
|
||||
.post-form .post-youtube,
|
||||
.post-form .post-movie {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Visibility choice
|
||||
*/
|
||||
.post-form .post-visiblity-contener {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
|
@ -75,7 +75,62 @@ ComunicWeb.components.posts.form = {
|
||||
var surveyType = this._add_post_type(postTypesContener, "survey", "<i class='fa fa-pie-chart'></i> <span class='hidden-xs'>Survey</span>");
|
||||
|
||||
|
||||
//Add visibility levels
|
||||
//Add image upload form
|
||||
var imgUploadForm = createElem2({
|
||||
appendTo: boxBody,
|
||||
type: "div",
|
||||
class: "post-image"
|
||||
});
|
||||
|
||||
var imgFileInput = createElem2({
|
||||
appendTo: imgUploadForm,
|
||||
type: "input",
|
||||
elemType: "file"
|
||||
});
|
||||
|
||||
|
||||
//Add Youtube input form
|
||||
var youtubeInputForm = createElem2({
|
||||
appendTo: boxBody,
|
||||
type: "div",
|
||||
class: "post-youtube",
|
||||
});
|
||||
|
||||
var youtubeLinkInput = createFormGroup({
|
||||
target: youtubeInputForm,
|
||||
label: "Youtube video link",
|
||||
placeholder: "https://youtube.com/watch?v=",
|
||||
type: "text"
|
||||
})
|
||||
|
||||
//Add movie input form
|
||||
var movieInputForm = createElem2({
|
||||
appendTo: boxBody,
|
||||
type: "div",
|
||||
class: "post-movie",
|
||||
innerHTML: "<p>Not implemented yet.</p>"
|
||||
});
|
||||
|
||||
//Create post type change handler
|
||||
var changesHandler = function(){
|
||||
|
||||
imgUploadForm.style.display = imageType.checked ? "block" : "none";
|
||||
youtubeInputForm.style.display = youtubeType.checked ? "block" : "none";
|
||||
movieInputForm.style.display = movieType.checked ? "block" : "none";
|
||||
|
||||
};
|
||||
|
||||
//Apply changesHandler function to all the data types
|
||||
textType.onclick = changesHandler;
|
||||
imageType.onclick = changesHandler;
|
||||
youtubeType.onclick = changesHandler;
|
||||
movieType.onclick = changesHandler;
|
||||
linkType.onclick = changesHandler;
|
||||
pdfType.onclick = changesHandler;
|
||||
countdownType.onclick = changesHandler;
|
||||
surveyType.onclick = changesHandler;
|
||||
|
||||
//Right contener
|
||||
var rightDiv = createElem2({
|
||||
appendTo: boxBody,
|
||||
type: "div",
|
||||
|
Loading…
Reference in New Issue
Block a user