From 28499dda93e7d3c6341fc7dbf5b5613aa6344964 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 10 Jan 2018 06:49:46 +0100 Subject: [PATCH] Added a visibility levels informations file --- assets/js/common/functionsSchema.js | 7 ++++ assets/js/components/posts/form.js | 9 ++-- .../js/components/posts/visibilityLevels.js | 42 +++++++++++++++++++ system/config/dev.config.php | 1 + 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 assets/js/components/posts/visibilityLevels.js diff --git a/assets/js/common/functionsSchema.js b/assets/js/common/functionsSchema.js index c22886a7..fc4e2399 100644 --- a/assets/js/common/functionsSchema.js +++ b/assets/js/common/functionsSchema.js @@ -651,6 +651,13 @@ var ComunicWeb = { */ posts: { + /** + * Visibility levels + */ + visibilityLevels: { + //TODO : implement + }, + /** * Posts communication interface */ diff --git a/assets/js/components/posts/form.js b/assets/js/components/posts/form.js index dbf28772..4a65327b 100644 --- a/assets/js/components/posts/form.js +++ b/assets/js/components/posts/form.js @@ -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({ diff --git a/assets/js/components/posts/visibilityLevels.js b/assets/js/components/posts/visibilityLevels.js new file mode 100644 index 00000000..b4b9d307 --- /dev/null +++ b/assets/js/components/posts/visibilityLevels.js @@ -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" + } + +} \ No newline at end of file diff --git a/system/config/dev.config.php b/system/config/dev.config.php index e7c377fe..514b72e6 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -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",