diff --git a/assets/css/pages/settings/sections/notifications.css b/assets/css/pages/settings/sections/notifications.css new file mode 100644 index 00000000..57049ed5 --- /dev/null +++ b/assets/css/pages/settings/sections/notifications.css @@ -0,0 +1,5 @@ +/** + * Notifications settings + * + * @author Pierre Hubert + */ diff --git a/assets/js/pages/settings/navigationPane.js b/assets/js/pages/settings/navigationPane.js index b7aa77d9..c95db4dc 100644 --- a/assets/js/pages/settings/navigationPane.js +++ b/assets/js/pages/settings/navigationPane.js @@ -92,6 +92,20 @@ ComunicWeb.pages.settings.navigationPane = { openPage("settings/emojies"); }; + // Custom emojies + const sectionNotifications = createElem2({ + appendTo: elemList, + type: "li", + }); + var sectionNotificationsLink = createElem2({ + appendTo: sectionNotifications, + type: "a", + innerHTML: " Notifications" + }); + sectionNotificationsLink.onclick = function(){ + openPage("settings/notifications"); + }; + //Account security var sectionSecurity = createElem2({ appendTo: elemList, diff --git a/assets/js/pages/settings/sections/notifications.js b/assets/js/pages/settings/sections/notifications.js new file mode 100644 index 00000000..05487456 --- /dev/null +++ b/assets/js/pages/settings/sections/notifications.js @@ -0,0 +1,22 @@ +/** + * Notifications settings + * + * @author Pierre Hubert + */ + +class NotificationsSettings { + static async Open(args, target) { + // Load template + const tpl = await Page.loadHTMLTemplate("pages/settings/notifications/NotificationsSection.html"); + const el = document.createElement("div") + el.innerHTML = tpl; + target.appendChild(el); + + el.querySelectorAll("input[type='checkbox']").forEach(e => { + $(e).iCheck({ + checkboxClass: 'icheckbox_flat-blue', + radioClass: 'iradio_flat-blue' + }); + }); + } +} \ No newline at end of file diff --git a/assets/js/pages/settings/sectionsList.js b/assets/js/pages/settings/sectionsList.js index 504b36c7..71f119fa 100644 --- a/assets/js/pages/settings/sectionsList.js +++ b/assets/js/pages/settings/sectionsList.js @@ -30,6 +30,14 @@ ComunicWeb.pages.settings.sectionsList = { handler: "EmojiesSection.Open" }, + /** + * Notifications + */ + notifications: { + title: "Notifications", + handler: "NotificationsSettings.Open" + }, + /** * Security settings */ diff --git a/assets/templates/pages/settings/notifications/NotificationsSection.html b/assets/templates/pages/settings/notifications/NotificationsSection.html new file mode 100644 index 00000000..7d86d8fb --- /dev/null +++ b/assets/templates/pages/settings/notifications/NotificationsSection.html @@ -0,0 +1,48 @@ + + + +
tr("Note: These parameters applies only for the mobile version of the application!")
+ +