mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-02-16 19:02:40 +00:00
Created conversations service file
This commit is contained in:
parent
7033e22dbe
commit
0b0f91275a
@ -19,4 +19,9 @@
|
|||||||
border-bottom-left-radius: 0px;
|
border-bottom-left-radius: 0px;
|
||||||
border-bottom-right-radius: 0px;
|
border-bottom-right-radius: 0px;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
|
|
||||||
|
padding-left: 6px;
|
||||||
|
padding-right: 6px;
|
||||||
|
padding-top: 3px;
|
||||||
|
padding-bottom: 3px;
|
||||||
}
|
}
|
@ -71,7 +71,7 @@ ComunicWeb.common.system = {
|
|||||||
*/
|
*/
|
||||||
var autoRefresh = setInterval((function(){
|
var autoRefresh = setInterval((function(){
|
||||||
ComunicWeb.user.userLogin.refreshLoginState();
|
ComunicWeb.user.userLogin.refreshLoginState();
|
||||||
}), 20000);
|
}), 25000);
|
||||||
ComunicWeb.common.cacheManager.registerInterval(autoRefresh);
|
ComunicWeb.common.cacheManager.registerInterval(autoRefresh);
|
||||||
|
|
||||||
//Success
|
//Success
|
||||||
|
@ -266,7 +266,7 @@ function createFormGroup(infos){
|
|||||||
function checkString(value){
|
function checkString(value){
|
||||||
|
|
||||||
//First, check string length
|
//First, check string length
|
||||||
if(value.length < 5)
|
if(value.length < 3)
|
||||||
return false; //Lenght invalid
|
return false; //Lenght invalid
|
||||||
|
|
||||||
//Success, the string seems to be valid
|
//Success, the string seems to be valid
|
||||||
|
@ -73,6 +73,9 @@ ComunicWeb.components.conversations.manager = {
|
|||||||
ComunicWeb.components.conversations.chatWindows.openConversation(openedConversations[i]);
|
ComunicWeb.components.conversations.chatWindows.openConversation(openedConversations[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Intializate conversation service
|
||||||
|
ComunicWeb.components.conversations.service.init();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +89,7 @@ ComunicWeb.components.conversations.manager = {
|
|||||||
//Create the button
|
//Create the button
|
||||||
var addButton = createElem("button", targetElem);
|
var addButton = createElem("button", targetElem);
|
||||||
addButton.className = "btn btn-primary open-conversation-button";
|
addButton.className = "btn btn-primary open-conversation-button";
|
||||||
addButton.innerHTML = "Open a conversation";
|
addButton.innerHTML = "Conversations";
|
||||||
|
|
||||||
|
|
||||||
//Make button lives
|
//Make button lives
|
||||||
|
@ -7,5 +7,39 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
ComunicWeb.components.conversations.service = {
|
ComunicWeb.components.conversations.service = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var {Integer} intervalID The ID of the current service interval
|
||||||
|
*/
|
||||||
|
__intervalID: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializate conversation service
|
||||||
|
*
|
||||||
|
* @return {Boolean} True for a success
|
||||||
|
*/
|
||||||
|
init: function(){
|
||||||
|
|
||||||
|
//Check if an interval already exists or not
|
||||||
|
if(this.__intervalID)
|
||||||
|
clearInterval(this.__intervalID); //Remove old interval
|
||||||
|
|
||||||
|
//Initializate interval
|
||||||
|
this.__intervalID = setInterval(function(){
|
||||||
|
ComunicWeb.components.conversations.service.call();
|
||||||
|
}, 1500);
|
||||||
|
ComunicWeb.common.cacheManager.registerInterval(this.__intervalID);
|
||||||
|
|
||||||
|
//Success
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call this service
|
||||||
|
*
|
||||||
|
* @return {Boolean} True for a success
|
||||||
|
*/
|
||||||
|
call: function(){
|
||||||
|
console.log("Conversation service called !");
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user