mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 13:59:23 +00:00
Created submitCreateDiscussionForm method
This commit is contained in:
parent
fa345fd130
commit
6f44b27342
@ -501,6 +501,11 @@ var ComunicWeb = {
|
|||||||
windows:{
|
windows:{
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface between discussion UI and the API
|
||||||
|
*/
|
||||||
|
interface:{},
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
9
assets/js/components/discussions/interface.js
Normal file
9
assets/js/components/discussions/interface.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Interface between the graphical discussion system and the API
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
ComunicWeb.components.discussions.interface = {
|
||||||
|
|
||||||
|
}
|
@ -70,7 +70,7 @@ ComunicWeb.components.discussions.list = {
|
|||||||
|
|
||||||
//Choose users
|
//Choose users
|
||||||
//Create select user element
|
//Create select user element
|
||||||
var selectElement = createFormGroup({
|
var usersElement = createFormGroup({
|
||||||
target: createForm,
|
target: createForm,
|
||||||
label: "Users",
|
label: "Users",
|
||||||
multiple: true,
|
multiple: true,
|
||||||
@ -78,7 +78,7 @@ ComunicWeb.components.discussions.list = {
|
|||||||
type: "select2"});
|
type: "select2"});
|
||||||
|
|
||||||
//Initialize user selector
|
//Initialize user selector
|
||||||
ComunicWeb.components.userSelect.init(selectElement);
|
ComunicWeb.components.userSelect.init(usersElement);
|
||||||
|
|
||||||
|
|
||||||
//Discussion name
|
//Discussion name
|
||||||
@ -101,7 +101,36 @@ ComunicWeb.components.discussions.list = {
|
|||||||
createButton.style.width = "100%";
|
createButton.style.width = "100%";
|
||||||
createButton.innerHTML = "Create discussion";
|
createButton.innerHTML = "Create discussion";
|
||||||
|
|
||||||
|
//Generate a summary object about all the informations we have got
|
||||||
|
var infos = {
|
||||||
|
listBox: listBox,
|
||||||
|
userElement: usersElement,
|
||||||
|
discussionNameInput: discussionNameInput,
|
||||||
|
followDiscussionInput: followDiscussionInput,
|
||||||
|
};
|
||||||
|
|
||||||
|
//Make button lives
|
||||||
|
createButton.onclick = function(){
|
||||||
|
ComunicWeb.components.discussions.list.submitCreateDiscussionForm(infos);
|
||||||
|
};
|
||||||
|
|
||||||
//Success
|
//Success
|
||||||
return true;
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Submit a create a discussion form
|
||||||
|
*
|
||||||
|
* @param {Object} infos Data to pass to the function
|
||||||
|
* * @info {Object} listBox Informations about the listbox creating the discussion
|
||||||
|
* * @info {HTMLElement} userElement Pointer on userElement
|
||||||
|
* * @info {HTMLElement} discussionNameInput Pointer on the input of the form of the discussion
|
||||||
|
* * @info {HTMLElement} followDiscussionInput Pointer on the "follow discussion" checkbox
|
||||||
|
* @return {Boolean} True for a success
|
||||||
|
*/
|
||||||
|
submitCreateDiscussionForm: function(infos){
|
||||||
|
|
||||||
|
//First, get the list of users
|
||||||
|
console.log("hello from list.js");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user