mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 12:09:21 +00:00
Fixed build issues.
This commit is contained in:
parent
069922b7da
commit
93df9d235d
@ -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 + ") ";
|
||||
|
@ -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", "o<block></block>n"))
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user