Fixed build issues.

This commit is contained in:
Pierre HUBERT 2019-01-10 14:59:12 +01:00
parent 069922b7da
commit 93df9d235d
6 changed files with 14 additions and 13 deletions

View File

@ -40,7 +40,7 @@ ComunicWeb.common.pageTitle = {
* Refresh document title * Refresh document title
*/ */
__refresh: function(){ __refresh: function(){
let title = ""; var title = "";
if(this._curr_notifications_number > 0) if(this._curr_notifications_number > 0)
title += "(" + this._curr_notifications_number + ") "; title += "(" + this._curr_notifications_number + ") ";

View File

@ -633,7 +633,7 @@ function removeJavascriptEventsFromHTML(html){
//Search for unexceptable references //Search for unexceptable references
while(html.match(/on[a-zA-Z ]+=/i) != null){ 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", "o<block></block>n")) html = html.replace(match, match.replace("on", "o<block></block>n"))
} }

View File

@ -123,7 +123,7 @@ ComunicWeb.components.emoji.picker = {
ComunicWeb.components.emoji.picker.addPicker(input); ComunicWeb.components.emoji.picker.addPicker(input);
let interval = setInterval(() => { var interval = setInterval(function(){
//Check if input has been detached //Check if input has been detached
if(!input.isConnected){ if(!input.isConnected){
@ -133,7 +133,7 @@ ComunicWeb.components.emoji.picker = {
//Securely send value to callback //Securely send value to callback
if(input.value.length > 0){ if(input.value.length > 0){
let value = input.value; var value = input.value;
input.value = ""; input.value = "";
callback(value); callback(value);
} }

View File

@ -24,18 +24,18 @@ ComunicWeb.components.notifications.service = {
init: function(target, auto_hide, target_conversations){ init: function(target, auto_hide, target_conversations){
//Initialize interval //Initialize interval
var interval = setInterval(() => { var interval = setInterval(function(){
//Auto-remove interval if the target has been removed //Auto-remove interval if the target has been removed
if(!target.isConnected){ if(!target.isConnected){
ComunicWeb.common.pageTitle.setNotificationsNumber(0); ComunicWeb.common.pageTitle.setNotificationsNumber(0);
this.last_notifs_number = -1; ComunicWeb.components.notifications.service.last_notifs_number = -1;
return clearInterval(interval); return clearInterval(interval);
} }
//Get the number of notifications from the API //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 //Continue in case of success
if(response.error) if(response.error)
@ -65,16 +65,17 @@ ComunicWeb.components.notifications.service = {
} }
//Sum notification number //Sum notification number
let total_number_notifs = response.notifications + response.conversations; var total_number_notifs = response.notifications + response.conversations;
//Update page title too //Update page title too
ComunicWeb.common.pageTitle.setNotificationsNumber(total_number_notifs); ComunicWeb.common.pageTitle.setNotificationsNumber(total_number_notifs);
//Play song if required //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(); ComunicWeb.components.notifications.song.play();
this.last_notifs_number = total_number_notifs; ComunicWeb.components.notifications.service.last_notifs_number = total_number_notifs;
}); });
}, 2000); }, 2000);

View File

@ -75,7 +75,7 @@ ComunicWeb.components.posts.form = {
}); });
//Enable emojies picker //Enable emojies picker
ComunicWeb.components.emoji.picker.addDetachedPicker(newPostMessageContener, (emojie) => { ComunicWeb.components.emoji.picker.addDetachedPicker(newPostMessageContener, function(emojie){
//Append new emojie to the instance //Append new emojie to the instance
sceditor.instance(inputMessageTextarea).insertText(emojie); sceditor.instance(inputMessageTextarea).insertText(emojie);

View File

@ -88,9 +88,9 @@ ComunicWeb.pages.groups.pages.main = {
var has_group = false; var has_group = false;
for (const i in list) { for (var i in list) {
if (list.hasOwnProperty(i)) { if (list.hasOwnProperty(i)) {
const group = list[i]; var group = list[i];
has_group = true; has_group = true;
ComunicWeb.pages.groups.pages.main._display_group(group, target); ComunicWeb.pages.groups.pages.main._display_group(group, target);
} }