Added a visibility levels informations file

This commit is contained in:
Pierre 2018-01-10 06:49:46 +01:00
parent 70232ade84
commit 28499dda93
4 changed files with 56 additions and 3 deletions

View File

@ -651,6 +651,13 @@ var ComunicWeb = {
*/
posts: {
/**
* Visibility levels
*/
visibilityLevels: {
//TODO : implement
},
/**
* Posts communication interface
*/

View File

@ -270,14 +270,17 @@ ComunicWeb.components.posts.form = {
});
//Private post
var privateInput = this._add_visiblity_choice(visibility_choices_contener, "private", "Private", "fa-user");
var privateLevel = ComunicWeb.components.posts.visibilityLevels.private;
var privateInput = this._add_visiblity_choice(visibility_choices_contener, "private", privateLevel.name, privateLevel.icon);
//Friends-visible post
var friendsInput = this._add_visiblity_choice(visibility_choices_contener, "friends", "Friends", "fa-users");
var friendsLevel = ComunicWeb.components.posts.visibilityLevels.friends;
var friendsInput = this._add_visiblity_choice(visibility_choices_contener, "friends", friendsLevel.name, friendsLevel.icon);
friendsInput.checked = true;
//Worldwide post
this._add_visiblity_choice(visibility_choices_contener, "public", "Public", "fa-globe");
var publicLevel = ComunicWeb.components.posts.visibilityLevels.public;
this._add_visiblity_choice(visibility_choices_contener, "public", publicLevel.name, publicLevel.icon);
//Add send button
var sendButton = createElem2({

View File

@ -0,0 +1,42 @@
/**
* Posts visibility levels
*
* @author Pierre HUBERT
*/
ComunicWeb.components.posts.visibilityLevels = {
/**
* Private
*/
private: {
//Icon
icon: "fa-user",
//Name
name: "Private"
},
/**
* Friends
*/
friends: {
//Icon
icon: "fa-users",
//Name
name: "Friends"
},
/**
* Public
*/
public: {
//Icon
icon: "fa-globe",
//Name
name: "Public"
}
}

View File

@ -219,6 +219,7 @@ class Dev {
"js/components/like/interface.js",
//Posts component
"js/components/posts/visibilityLevels.js",
"js/components/posts/interface.js",
"js/components/posts/ui.js",
"js/components/posts/form.js",