1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/sources/app/widgets/Presence/presence.js

47 lines
1.1 KiB
JavaScript
Raw Normal View History

function postStart() {
if(localStorage.postStart == 1) {
// We disable the notifications for a couple of seconds
Notification.inhibit(10);
Presence_ajaxSet();
//Presence_ajaxConfigGet();
Presence_ajaxServerCapsGet();
Presence_ajaxBookmarksGet();
Presence_ajaxUserRefresh();
Presence_ajaxFeedRefresh();
//Menu_ajaxRefresh();
localStorage.postStart = 0;
}
}
var Presence = {
refresh : function() {
var textarea = document.querySelector('form[name=presence] textarea');
if(textarea != null) {
movim_textarea_autoheight(textarea);
textarea.onkeydown = function(event) {
movim_textarea_autoheight(this);
};
}
var presences = document.querySelectorAll('#dialog form ul li');
var i = 0;
while(i < presences.length)
{
presences[i].onclick = function(e) {
this.querySelector('label').click();
}
i++;
}
}
}
MovimWebsocket.attach(function()
{
Presence.refresh();
postStart();
});