From 93df9d235da013b0c8d4f6620f79ea51fb8a5257 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 10 Jan 2019 14:59:12 +0100 Subject: [PATCH] Fixed build issues. --- assets/js/common/pageTitle.js | 2 +- assets/js/common/utils.js | 2 +- assets/js/components/emoji/picker.js | 4 ++-- assets/js/components/notifications/service.js | 13 +++++++------ assets/js/components/posts/form.js | 2 +- assets/js/pages/groups/pages/main.js | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/assets/js/common/pageTitle.js b/assets/js/common/pageTitle.js index 29d14280..26cd156a 100644 --- a/assets/js/common/pageTitle.js +++ b/assets/js/common/pageTitle.js @@ -40,7 +40,7 @@ ComunicWeb.common.pageTitle = { * Refresh document title */ __refresh: function(){ - let title = ""; + var title = ""; if(this._curr_notifications_number > 0) title += "(" + this._curr_notifications_number + ") "; diff --git a/assets/js/common/utils.js b/assets/js/common/utils.js index cd6d578d..c29150d4 100644 --- a/assets/js/common/utils.js +++ b/assets/js/common/utils.js @@ -633,7 +633,7 @@ function removeJavascriptEventsFromHTML(html){ //Search for unexceptable references while(html.match(/on[a-zA-Z ]+=/i) != null){ - let match = html.match(/on[a-zA-Z ]+=/i)[0]; + var match = html.match(/on[a-zA-Z ]+=/i)[0]; html = html.replace(match, match.replace("on", "on")) } diff --git a/assets/js/components/emoji/picker.js b/assets/js/components/emoji/picker.js index 9185f522..2b10f219 100644 --- a/assets/js/components/emoji/picker.js +++ b/assets/js/components/emoji/picker.js @@ -123,7 +123,7 @@ ComunicWeb.components.emoji.picker = { ComunicWeb.components.emoji.picker.addPicker(input); - let interval = setInterval(() => { + var interval = setInterval(function(){ //Check if input has been detached if(!input.isConnected){ @@ -133,7 +133,7 @@ ComunicWeb.components.emoji.picker = { //Securely send value to callback if(input.value.length > 0){ - let value = input.value; + var value = input.value; input.value = ""; callback(value); } diff --git a/assets/js/components/notifications/service.js b/assets/js/components/notifications/service.js index d046f2bd..8f8e46f3 100644 --- a/assets/js/components/notifications/service.js +++ b/assets/js/components/notifications/service.js @@ -24,18 +24,18 @@ ComunicWeb.components.notifications.service = { init: function(target, auto_hide, target_conversations){ //Initialize interval - var interval = setInterval(() => { + var interval = setInterval(function(){ //Auto-remove interval if the target has been removed if(!target.isConnected){ ComunicWeb.common.pageTitle.setNotificationsNumber(0); - this.last_notifs_number = -1; + ComunicWeb.components.notifications.service.last_notifs_number = -1; return clearInterval(interval); } //Get the number of notifications from the API - ComunicWeb.components.notifications.interface.getAllUnread(response => { + ComunicWeb.components.notifications.interface.getAllUnread(function(response){ //Continue in case of success if(response.error) @@ -65,16 +65,17 @@ ComunicWeb.components.notifications.service = { } //Sum notification number - let total_number_notifs = response.notifications + response.conversations; + var total_number_notifs = response.notifications + response.conversations; //Update page title too ComunicWeb.common.pageTitle.setNotificationsNumber(total_number_notifs); //Play song if required - if(this.last_notifs_number != -1 && total_number_notifs > this.last_notifs_number) + if(ComunicWeb.components.notifications.service.last_notifs_number != -1 + && total_number_notifs > ComunicWeb.components.notifications.service.last_notifs_number) ComunicWeb.components.notifications.song.play(); - this.last_notifs_number = total_number_notifs; + ComunicWeb.components.notifications.service.last_notifs_number = total_number_notifs; }); }, 2000); diff --git a/assets/js/components/posts/form.js b/assets/js/components/posts/form.js index 26b10a9b..39741e37 100644 --- a/assets/js/components/posts/form.js +++ b/assets/js/components/posts/form.js @@ -75,7 +75,7 @@ ComunicWeb.components.posts.form = { }); //Enable emojies picker - ComunicWeb.components.emoji.picker.addDetachedPicker(newPostMessageContener, (emojie) => { + ComunicWeb.components.emoji.picker.addDetachedPicker(newPostMessageContener, function(emojie){ //Append new emojie to the instance sceditor.instance(inputMessageTextarea).insertText(emojie); diff --git a/assets/js/pages/groups/pages/main.js b/assets/js/pages/groups/pages/main.js index 936e93b2..ac137ae6 100644 --- a/assets/js/pages/groups/pages/main.js +++ b/assets/js/pages/groups/pages/main.js @@ -88,9 +88,9 @@ ComunicWeb.pages.groups.pages.main = { var has_group = false; - for (const i in list) { + for (var i in list) { if (list.hasOwnProperty(i)) { - const group = list[i]; + var group = list[i]; has_group = true; ComunicWeb.pages.groups.pages.main._display_group(group, target); }