clean-up
This commit is contained in:
parent
aa66642712
commit
b2fc40bf71
|
@ -1,9 +1,7 @@
|
||||||
var DOM={WRAPPER:$("body > #WRAPPER"),HEADER:$("body > #WRAPPER > #HEADER"),MENUSIDE:$("body > #WRAPPER > #MENU-SIDE"),CONTAINER:$("body > #WRAPPER > #CONTAINER")},pageManager;api=new APIClass("/api/");Notification=new NotificationClass($("#notification-container"));Notification.defaultTimeout=4E3;
|
(function(){function f(a){var d=$("#MENU-SIDE > span[data-link="+c.page+'] + div.sub > span[data-sublink="'+c.vars[0]+'"]'),b=null,b=a instanceof Element?a:null,b="string"==typeof a?$("#MENU-SIDE > span[data-link="+c.page+'] + div.sub > span[data-sublink="'+a+'"]'):b,b=null==b?$("#MENU-SIDE > span[data-link="+c.page+"] + div.sub > span[data-sublink]"):b;if(null==b)return!1;null!=d&&d.remClass("active");d=$$("#CONTAINER > section[data-sublink].active");for(a=0;a<d.length;a++)d[a].remClass("active");
|
||||||
Notification.errorCodes={"-1":"Erreur de r\u00e9seau, veuillez recharger la page et r\u00e9essayer",0:"Erreur interne",1:"Erreur interne",2:"Erreur interne",3:"Le fichier est introuvable",4:"Erreur interne",5:"Erreur interne",6:"Erreur interne",7:"Erreur interne",8:"Erreur interne",9:"Certaines donn\u00e9es sont manquantes",10:"Erreur interne",11:"Erreur interne",12:"Erreur interne",13:"Erreur interne",14:"Erreur interne",15:"Erreur interne",16:"Vous n'avez pas la permission d'effectuer cette action",
|
if(null!=b)for(b.addClass("active"),d=$$('#CONTAINER > section[data-sublink="'+b.getData("sublink")+'"]'),a=0;a<d.length;a++)d[a].addClass("active");if(!b.getData("sublink"))return!1;a=c.vars[0]!=b.getData("sublink");c.vars[0]=b.getData("sublink");a&&c.updateURL()}function g(a){var d=$('#WRAPPER > #MENU-SIDE > span[data-link="'+c.page+'"]'),b=null,b=a instanceof Element?a:null,b="string"==typeof a?$('#WRAPPER > #MENU-SIDE > span[data-link="'+a+'"]'):b,b=null==b?$('#WRAPPER > #MENU-SIDE > span[data-link="'+
|
||||||
17:"Le t\u00e9l\u00e9chargement a \u00e9chou\u00e9",18:"Le fichier est invalide (format incorrect)"};lsi.setStorage(sessionStorage);
|
c.pagelist[0]+'"]'):b;if(null==b)return!1;null!=d&&d.remClass("active");null!=b&&b.addClass("active");b.getData("link")&&(e.HEADER.addClass("loading"),c.setPage(b.getData("link")),c.activeXHR.addEventListener("loadend",function(){1<=c.vars.length&&null!=$('#CONTAINER > section[data-sublink="'+c.vars[0]+'"]')?f(c.vars[0]):f(null);var a=$("#MENU-SIDE > span[data-link="+c.page+"] + div.sub");null!=a&&a.addEventListener("click",function(a){for(a=a.target;a!=document.body&&!a.getData("sublink");)a=a.parentNode;
|
||||||
function navSubMenu(a){var c=$("#MENU-SIDE > span[data-link="+pageManager.page+'] + div.sub > span[data-sublink="'+pageManager.vars[0]+'"]'),b=null,b=a instanceof Element?a:null,b="string"==typeof a?$("#MENU-SIDE > span[data-link="+pageManager.page+'] + div.sub > span[data-sublink="'+a+'"]'):b,b=null==b?$("#MENU-SIDE > span[data-link="+pageManager.page+"] + div.sub > span[data-sublink]"):b;if(null==b)return!1;null!=c&&c.remClass("active");c=$$("#CONTAINER > section[data-sublink].active");for(a=0;a<
|
a.getData("sublink")&&f(a)},!1);e.HEADER.remClass("loading")},!1))}var e={WRAPPER:$("body > #WRAPPER"),HEADER:$("body > #WRAPPER > #HEADER"),MENUSIDE:$("body > #WRAPPER > #MENU-SIDE"),CONTAINER:$("body > #WRAPPER > #CONTAINER")},c;api=new APIClass("/api/");Notification=new NotificationClass($("#notification-container"));Notification.defaultTimeout=4E3;Notification.errorCodes={"-1":"Erreur de r\u00e9seau, veuillez recharger la page et r\u00e9essayer",0:"Erreur interne",1:"Erreur interne",2:"Erreur interne",
|
||||||
c.length;a++)c[a].remClass("active");if(null!=b)for(b.addClass("active"),c=$$('#CONTAINER > section[data-sublink="'+b.getData("sublink")+'"]'),a=0;a<c.length;a++)c[a].addClass("active");if(!b.getData("sublink"))return!1;a=pageManager.vars[0]!=b.getData("sublink");pageManager.vars[0]=b.getData("sublink");a&&pageManager.updateURL()}
|
3:"Le fichier est introuvable",4:"Erreur interne",5:"Erreur interne",6:"Erreur interne",7:"Erreur interne",8:"Erreur interne",9:"Certaines donn\u00e9es sont manquantes",10:"Erreur interne",11:"Erreur interne",12:"Erreur interne",13:"Erreur interne",14:"Erreur interne",15:"Erreur interne",16:"Vous n'avez pas la permission d'effectuer cette action",17:"Le t\u00e9l\u00e9chargement a \u00e9chou\u00e9",18:"Le fichier est invalide (format incorrect)"};lsi.setStorage(sessionStorage);e.MENUSIDE.addEventListener("click",
|
||||||
function navMenu(a){var c=$('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.page+'"]'),b=null,b=a instanceof Element?a:null,b="string"==typeof a?$('#WRAPPER > #MENU-SIDE > span[data-link="'+a+'"]'):b,b=null==b?$('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.pagelist[0]+'"]'):b;if(null==b)return!1;null!=c&&c.remClass("active");null!=b&&b.addClass("active");b.getData("link")&&(DOM.HEADER.addClass("loading"),pageManager.setPage(b.getData("link")),pageManager.activeXHR.addEventListener("loadend",
|
function(a){for(a=a.target;a!=document.body&&!a.getData("link");)a=a.parentNode;a.getData("link")&&g(a.getData("link"))},!1);var k=document.getElementById("user-data"),l=document.getElementById("login-close"),h=document.getElementById("LOGIN");k.addEventListener("click",function(a){h.className="active"},!1);l.addEventListener("click",function(a){h.className=""},!1);api.send({path:"download/menu"},function(a){if(0==a.ModuleError){pagelist=[];for(var d=0;d<a.menu.length;d++)pagelist.push(a.menu[d].attributes["data-link"]);
|
||||||
function(){1<=pageManager.vars.length&&null!=$('#CONTAINER > section[data-sublink="'+pageManager.vars[0]+'"]')?navSubMenu(pageManager.vars[0]):navSubMenu(null);var a=$("#MENU-SIDE > span[data-link="+pageManager.page+"] + div.sub");null!=a&&a.addEventListener("click",function(a){for(a=a.target;a!=document.body&&!a.getData("sublink");)a=a.parentNode;a.getData("sublink")&&navSubMenu(a)},!1);DOM.HEADER.remClass("loading")},!1))}
|
c=new pageManagerClass;c.setPage(null,"/view",e.CONTAINER,pagelist,null);g(c.page)}})})();
|
||||||
DOM.MENUSIDE.addEventListener("click",function(a){for(a=a.target;a!=document.body&&!a.getData("link");)a=a.parentNode;a.getData("link")&&navMenu(a.getData("link"))},!1);function reload(){navMenu(pageManager.page)}var LOGIN={show:document.getElementById("user-data"),hide:document.getElementById("login-close"),page:document.getElementById("LOGIN")};LOGIN.show.addEventListener("click",function(a){LOGIN.page.className="active"},!1);
|
|
||||||
LOGIN.hide.addEventListener("click",function(a){LOGIN.page.className=""},!1);api.send({path:"download/menu"},function(a){if(0==a.ModuleError){pagelist=[];for(var c=0;c<a.menu.length;c++)pagelist.push(a.menu[c].attributes["data-link"]);pageManager=new pageManagerClass;pageManager.setPage(null,"/view",DOM.CONTAINER,pagelist,null);navMenu(pageManager.page)}});
|
|
||||||
|
|
|
@ -1,24 +1,26 @@
|
||||||
/* [0] Initialisation des variables en local
|
(function(){
|
||||||
=========================================================*/
|
|
||||||
var DOM = {
|
/* [0] Initialisation des variables en local
|
||||||
|
=========================================================*/
|
||||||
|
var DOM = {
|
||||||
WRAPPER: $('body > #WRAPPER'),
|
WRAPPER: $('body > #WRAPPER'),
|
||||||
HEADER: $('body > #WRAPPER > #HEADER'),
|
HEADER: $('body > #WRAPPER > #HEADER'),
|
||||||
MENUSIDE: $('body > #WRAPPER > #MENU-SIDE'),
|
MENUSIDE: $('body > #WRAPPER > #MENU-SIDE'),
|
||||||
CONTAINER: $('body > #WRAPPER > #CONTAINER')
|
CONTAINER: $('body > #WRAPPER > #CONTAINER')
|
||||||
};
|
};
|
||||||
var pageManager;
|
var pageManager;
|
||||||
|
|
||||||
|
|
||||||
// On cree une instance de l'api
|
// On cree une instance de l'api
|
||||||
api = new APIClass('/api/');
|
api = new APIClass('/api/');
|
||||||
|
|
||||||
// On crée une instance du gestionnaire des notifications
|
// On crée une instance du gestionnaire des notifications
|
||||||
Notification = new NotificationClass( $('#notification-container') );
|
Notification = new NotificationClass( $('#notification-container') );
|
||||||
// Temps d'une notification : ~4s
|
// Temps d'une notification : ~4s
|
||||||
Notification.defaultTimeout = 4000;
|
Notification.defaultTimeout = 4000;
|
||||||
|
|
||||||
// Définition des codes d'erreurs
|
// Définition des codes d'erreurs
|
||||||
Notification.errorCodes = {
|
Notification.errorCodes = {
|
||||||
'-1': 'Erreur de réseau, veuillez recharger la page et réessayer',
|
'-1': 'Erreur de réseau, veuillez recharger la page et réessayer',
|
||||||
0: 'Erreur interne',
|
0: 'Erreur interne',
|
||||||
1: 'Erreur interne',
|
1: 'Erreur interne',
|
||||||
|
@ -39,18 +41,18 @@ Notification.errorCodes = {
|
||||||
16: 'Vous n\'avez pas la permission d\'effectuer cette action',
|
16: 'Vous n\'avez pas la permission d\'effectuer cette action',
|
||||||
17: 'Le téléchargement a échoué',
|
17: 'Le téléchargement a échoué',
|
||||||
18: 'Le fichier est invalide (format incorrect)'
|
18: 'Le fichier est invalide (format incorrect)'
|
||||||
};
|
};
|
||||||
|
|
||||||
// On définit qu'on veut utiliser le 'sessionStorage'
|
// On définit qu'on veut utiliser le 'sessionStorage'
|
||||||
lsi.setStorage(sessionStorage);
|
lsi.setStorage(sessionStorage);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* [1] Toggle du sub-menu-side <-> navigation
|
/* [1] Toggle du sub-menu-side <-> navigation
|
||||||
===========================================*/
|
===========================================*/
|
||||||
function navSubMenu(subsection){
|
function navSubMenu(subsection){
|
||||||
/* [1] Format du param
|
/* [1] Format du param
|
||||||
------------------------------------------------*/
|
------------------------------------------------*/
|
||||||
// Contient l'element courant
|
// Contient l'element courant
|
||||||
|
@ -110,12 +112,12 @@ function navSubMenu(subsection){
|
||||||
// navMenu(pageManager.page);
|
// navMenu(pageManager.page);
|
||||||
pageManager.updateURL();
|
pageManager.updateURL();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* [4 Toggle du side-menu <-> navigation
|
/* [4 Toggle du side-menu <-> navigation
|
||||||
===========================================*/
|
===========================================*/
|
||||||
function navMenu(section){
|
function navMenu(section){
|
||||||
|
|
||||||
/* [1] Format du param
|
/* [1] Format du param
|
||||||
------------------------------------------------*/
|
------------------------------------------------*/
|
||||||
|
@ -186,7 +188,7 @@ function navMenu(section){
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,9 +207,9 @@ function navMenu(section){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* [5] Gestion de la navigation (physique)
|
/* [5] Gestion de la navigation (physique)
|
||||||
===========================================*/
|
===========================================*/
|
||||||
DOM.MENUSIDE.addEventListener('click', function(e){
|
DOM.MENUSIDE.addEventListener('click', function(e){
|
||||||
var target = e.target;
|
var target = e.target;
|
||||||
|
|
||||||
// On remonte dans les parents au bon niveau
|
// On remonte dans les parents au bon niveau
|
||||||
|
@ -217,34 +219,34 @@ DOM.MENUSIDE.addEventListener('click', function(e){
|
||||||
// Si on a trouve l'element, on l'utilise pour la page
|
// Si on a trouve l'element, on l'utilise pour la page
|
||||||
if( target.getData('link') )
|
if( target.getData('link') )
|
||||||
navMenu(target.getData('link'));
|
navMenu(target.getData('link'));
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* [6] Gestion du rechargement de page
|
/* [6] Gestion du rechargement de page
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
function reload(){ navMenu( pageManager.page ); }
|
function reload(){ navMenu( pageManager.page ); }
|
||||||
|
|
||||||
/* [7] Gestion du toggle de la page de login
|
/* [7] Gestion du toggle de la page de login
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
var LOGIN = {
|
var LOGIN = {
|
||||||
show: document.getElementById('user-data'),
|
show: document.getElementById('user-data'),
|
||||||
hide: document.getElementById('login-close'),
|
hide: document.getElementById('login-close'),
|
||||||
page: document.getElementById('LOGIN')
|
page: document.getElementById('LOGIN')
|
||||||
};
|
};
|
||||||
|
|
||||||
/* (1) Gestion de l'affichage de la page de login */
|
/* (1) Gestion de l'affichage de la page de login */
|
||||||
LOGIN.show.addEventListener('click', function(e){ LOGIN.page.className = 'active'; }, false);
|
LOGIN.show.addEventListener('click', function(e){ LOGIN.page.className = 'active'; }, false);
|
||||||
|
|
||||||
/* (2) Gestion de la fermeture de la page de login */
|
/* (2) Gestion de la fermeture de la page de login */
|
||||||
LOGIN.hide.addEventListener('click', function(e){ LOGIN.page.className = ''; }, false);
|
LOGIN.hide.addEventListener('click', function(e){ LOGIN.page.className = ''; }, false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* [7] On recupere la liste des pages et on lance pageManager
|
/* [7] On recupere la liste des pages et on lance pageManager
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
api.send({path:'download/menu'}, function(response){
|
api.send({path:'download/menu'}, function(response){
|
||||||
|
|
||||||
// si erreur
|
// si erreur
|
||||||
if( response.ModuleError != 0 )
|
if( response.ModuleError != 0 )
|
||||||
|
@ -263,4 +265,6 @@ api.send({path:'download/menu'}, function(response){
|
||||||
|
|
||||||
/* (2) On charge la premiere page */
|
/* (2) On charge la premiere page */
|
||||||
navMenu(pageManager.page);
|
navMenu(pageManager.page);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function inputPhoneSubject(a,c,b){this.tmp_id=a;this.subject_id=c;this.store_button=b}inputPhoneSubject.prototype={store_button:this.store_button,tmp_id:this.tmp_id,subject_id:this.subject_id,handler:null};inputPhoneSubject.prototype.check=function(){return 0<this.subject_id.value.length&&!isNaN(this.subject_id.value)};inputPhoneSubject.prototype.fieldsToStorage=function(){console.log("SUBJECT: FIELDS TO STORAGE");if(!this.check())return!1;lsi.set("p_subject",0,{tmp_id:this.tmp_id.value,subject_id:this.subject_id.value})};
|
function inputPhoneSubject(a,b,c){this.tmp_id=a;this.subject_id=b;this.store_button=c}inputPhoneSubject.prototype={store_button:this.store_button,tmp_id:this.tmp_id,subject_id:this.subject_id,handler:null};inputPhoneSubject.prototype.check=function(){return 0<this.subject_id.value.length&&!isNaN(this.subject_id.value)};
|
||||||
inputPhoneSubject.prototype.storageToFields=function(){console.log("SUBJECT: STORAGE TO FIELDS");var a=lsi.get("p_subject",0);null==a&&(a={tmp_id:"",subject_id:""});this.tmp_id.value=a.tmp_id;this.subject_id.value=a.subject_id};
|
inputPhoneSubject.prototype.fieldsToStorage=function(){console.log("SUBJECT: FIELDS TO STORAGE");if(!this.check())return!1;var a={tmp_id:this.tmp_id.value,subject_id:this.subject_id.value};console.log(1,this.tmp_id);console.log(2,this.subject_id);lsi.set("p_subject",0,a)};inputPhoneSubject.prototype.storageToFields=function(){console.log("SUBJECT: STORAGE TO FIELDS");var a=lsi.get("p_subject",0),a=a||{tmp_id:"",subject_id:""};this.tmp_id.value=a.tmp_id;this.subject_id.value=a.subject_id};
|
||||||
inputPhoneSubject.prototype.attach=function(a){function c(a){b.fieldsToStorage();b.handler(!0);b.storageToFields()}console.log("SUBJECT: ATTACH");lsi.createDataset("p_subject");lsi.createDataset("p_friends");this.handler=a;var b=this;this.store_button.addEventListener("click",c,!1);this.subject_id.addEventListener("blur",c,!1);this.storageToFields()};
|
inputPhoneSubject.prototype.attach=function(a){console.log("SUBJECT: ATTACH");lsi.createDataset("p_subject");lsi.createDataset("p_friends");this.handler=a;var b=this;this.store_button.addEventListener("click",function(a){b.fieldsToStorage();b.handler(!0);b.storageToFields()},!1);this.storageToFields()};
|
||||||
|
|
|
@ -19,7 +19,7 @@ inputPhoneSubject.prototype = {
|
||||||
/* [2] Vérification d'un formulaire
|
/* [2] Vérification d'un formulaire
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
inputPhoneSubject.prototype.check = function(){
|
inputPhoneSubject.prototype.check = function(){
|
||||||
/* (1) Le numéro n'est pas vide */
|
/* (1) Le numéro n'est pas vide (et c'est un numéro) */
|
||||||
return this.subject_id.value.length > 0 && !isNaN(this.subject_id.value);
|
return this.subject_id.value.length > 0 && !isNaN(this.subject_id.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,6 +36,8 @@ inputPhoneSubject.prototype.fieldsToStorage = function(){
|
||||||
tmp_id: this.tmp_id.value,
|
tmp_id: this.tmp_id.value,
|
||||||
subject_id: this.subject_id.value
|
subject_id: this.subject_id.value
|
||||||
};
|
};
|
||||||
|
console.log(1, this.tmp_id);
|
||||||
|
console.log(2, this.subject_id);
|
||||||
|
|
||||||
// {3} On enregistre les données dans le 'localStorage' //
|
// {3} On enregistre les données dans le 'localStorage' //
|
||||||
lsi.set('p_subject', 0, obj);
|
lsi.set('p_subject', 0, obj);
|
||||||
|
@ -55,8 +57,7 @@ inputPhoneSubject.prototype.storageToFields = function(){
|
||||||
// {1} On récupère les informations du sujet //
|
// {1} On récupère les informations du sujet //
|
||||||
var subjectData = lsi.get('p_subject', 0);
|
var subjectData = lsi.get('p_subject', 0);
|
||||||
|
|
||||||
if( subjectData == null )
|
subjectData = subjectData || { tmp_id: '', subject_id: '' };
|
||||||
subjectData = { tmp_id: '', subject_id: '' };
|
|
||||||
|
|
||||||
// {2} On restore les valeurs //
|
// {2} On restore les valeurs //
|
||||||
this.tmp_id.value = subjectData.tmp_id;
|
this.tmp_id.value = subjectData.tmp_id;
|
||||||
|
@ -78,14 +79,18 @@ inputPhoneSubject.prototype.attach = function(handler){
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
var ptr = this;
|
var ptr = this;
|
||||||
// Handler de mise à jour quand les champs sont bons
|
// Handler de mise à jour quand les champs sont bons
|
||||||
function fts(e){ ptr.fieldsToStorage(); ptr.handler(true); ptr.storageToFields(); }
|
function fts(e){
|
||||||
|
ptr.fieldsToStorage();
|
||||||
|
ptr.handler(true);
|
||||||
|
ptr.storageToFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (2) On attache l'évènement sur le bouton d'enregistrement */
|
/* (2) On attache l'évènement sur le bouton d'enregistrement */
|
||||||
this.store_button.addEventListener('click', fts, false);
|
this.store_button.addEventListener('click', fts, false);
|
||||||
|
|
||||||
/* (3) On attache un évènement de 'blur' sur chaque '<input type="text">' */
|
/* (3) On attache un évènement de 'blur' sur chaque '<input type="text">' */
|
||||||
this.subject_id.addEventListener('blur', fts, false);
|
// this.subject_id.addEventListener('blur', fts, false);
|
||||||
|
|
||||||
/* (4) On charge le sujet depuis la mémoire ('localStorage') */
|
/* (4) On charge le sujet depuis la mémoire ('localStorage') */
|
||||||
this.storageToFields();
|
this.storageToFields();
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 128 128" id="Layer_1" version="1.1" viewBox="0 0 128 128" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><circle cx="64" cy="64" fill="#4B5F83" id="circle" r="64"/><g id="icon"><path d="M64,99h35c0-16-10.4-29-24.6-33.4C80.1,62,84,55.7,84,48.5c0-11-9-20-20-20" fill="#E6E6E6" id="right"/><path d="M64,28.5c-11,0-20,9-20,20c0,7.2,3.9,13.6,9.6,17.1C39.4,70,29,83,29,99h35" fill="#FFFFFF" id="left"/></g></svg>
|
After Width: | Height: | Size: 612 B |
|
@ -1,38 +1,21 @@
|
||||||
var sField=$("#search-field"),sSubmit=$("#search-subject"),sList=$('section[data-sublink="survey"] ul[data-list]');
|
(function(){function r(b){var c=b instanceof Element,a=c&&"INPUT"==b.tagName&&"submit"==b.type,d=c&&"SPAN"==b.tagName&&("p_nav-mini"==b.parentNode.id||"p_nav-fiche"==b.parentNode.id),c=c&&"SPAN"==b.tagName&&"p_nav-contact"==b.parentNode.id;if(!a&&!d&&!c&&!0!==b)return!1;console.log("> dynamic update");e.fieldsToStorage();f.fieldsToStorage();g.fieldsToStorage();h.fieldsToStorage();f.sync();e.sync();!0===b?api.send({path:"subject/getFriends",subject_id:n.subject_id.value},function(a){if(0!=a.ModuleError)return!1;
|
||||||
sSubmit.addEventListener("click",function(a){api.send({path:"subject/search",name:sField.value},function(b){if(0!=b.ModuleError)return Notification.error("Erreur","La recherche a \u00e9chou\u00e9."),!1;console.log(b);var a="",f;for(f in b.results)a+="<li data-element data-id='"+f+"'>",a+="<div data-user><span>SUJET</span></div>",a+="<div> <span><input type='text' readonly style='text-align: center' onclick='this.select()' class='flag' value='"+f+"'></span> </div>",a+="<div> <span data-prefix='Nom'>"+
|
lsi["import"]("p_friends",a.subjects);e.storageToFields();f.storageToFields();h.storageToFields();g.storageToFields()}):(e.storageToFields(),f.storageToFields(),h.storageToFields(),(a||c)&&g.storageToFields())}function t(b){var c=b instanceof Element,a=c&&"INPUT"==b.tagName&&"submit"==b.type,d=c&&"SPAN"==b.tagName&&("f_nav-mini"==b.parentNode.id||"f_nav-fiche"==b.parentNode.id),c=c&&"SPAN"==b.tagName&&"f_nav-contact"==b.parentNode.id;if(!a&&!d&&!c&&!0!==b)return!1;console.log("> dynamic update");
|
||||||
b.results[f].name+"</span> </div>",a+="<div> <span data-prefix='Cr\u00e9ation'>"+b.results[f].creation+"</span> </div>",a+="<div> <span><input type='checkbox' id='s_"+f+"' "+(null!=b.results[f].phone?"checked":"")+" disabled><label for='s_"+f+"'>Cellulaire</label>",a+="</span> </div>",a+="<div> <span><input type='checkbox' id='s_"+f+"' "+(null!=b.results[f].facebook?"checked":"")+" disabled><label for='s_"+f+"'>Facebook</label>",a+="</span> </div>",a+="</li>";sList.innerHTML=a})},!1);
|
k.fieldsToStorage();l.fieldsToStorage();m.fieldsToStorage();p.fieldsToStorage();l.sync();k.sync();!0===b?api.send({path:"subject/getFriends",subject_id:q.subject_id.value},function(a){if(0!=a.ModuleError)return!1;lsi["import"]("f_friends",a.subjects);k.storageToFields();l.storageToFields();p.storageToFields();m.storageToFields()}):(k.storageToFields(),l.storageToFields(),p.storageToFields(),(a||c)&&m.storageToFields())}var u=$("#search-field"),w=$("#search-subject"),x=$('section[data-sublink="survey"] ul[data-list]'),
|
||||||
var pSubjectManager,pContactManager,pMiniManager,pFicheManager,pMatriceManager;
|
v=function(b){api.send({path:"subject/search",name:u.value},function(b){if(0!=b.ModuleError)return Notification.error("Erreur","La recherche a \u00e9chou\u00e9."),!1;console.log(b);var a="",d;for(d in b.results)a+="<li data-element data-id='"+d+"'>",a+="<div data-user><span>SUJET</span></div>",a+="<div> <span><input type='text' readonly style='text-align: center' onclick='this.select()' class='flag' value='"+d+"'></span> </div>",a+="<div> <span data-prefix='Nom'>"+b.results[d].name+"</span> </div>",
|
||||||
function pDynamicUpdate(a){var b=a instanceof Element,g=b&&"INPUT"==a.tagName&&"submit"==a.type,f=b&&"SPAN"==a.tagName&&("p_nav-mini"==a.parentNode.id||"p_nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"p_nav-contact"==a.parentNode.id;if(!g&&!f&&!b&&!0!==a)return!1;console.log("> dynamic update");pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();pContactManager.fieldsToStorage();pMatriceManager.fieldsToStorage();pFicheManager.sync();pMiniManager.sync();!0===a?api.send({path:"subject/getFriends",
|
a+="<div> <span data-prefix='Cr\u00e9ation'>"+b.results[d].creation+"</span> </div>",a+="<div> <span><input type='checkbox' id='s_"+d+"' "+(null!=b.results[d].phone?"checked":"")+" disabled><label for='s_"+d+"'>Cellulaire</label>",a+="</span> </div>",a+="<div> <span><input type='checkbox' id='s_"+d+"' "+(null!=b.results[d].facebook?"checked":"")+" disabled><label for='s_"+d+"'>Facebook</label>",a+="</span> </div>",a+="</li>";x.innerHTML=a})};w.addEventListener("click",v,!1);u.addEventListener("keypress",
|
||||||
subject_id:pSubjectManager.subject_id.value},function(a){if(0!=a.ModuleError)return!1;lsi["import"]("p_friends",a.subjects);pMiniManager.storageToFields();pFicheManager.storageToFields();pMatriceManager.storageToFields();pContactManager.storageToFields()}):(pMiniManager.storageToFields(),pFicheManager.storageToFields(),pMatriceManager.storageToFields(),(g||b)&&pContactManager.storageToFields())}var fSubjectManager,fContactManager,fMiniManager,fFicheManager,fMatriceManager;
|
function(b){13===b.keyCode&&v(b)},!1);var n,g,e,f,h,q,m,k,l,p;include("/js/includes/input-phone-subject-min.js",function(){include("/js/includes/input-phone-contact.js",function(){include("/js/includes/input-phone-mini.js",function(){include("/js/includes/input-phone-fiche.js",function(){include("/js/includes/input-phone-matrice-min.js",function(){n=new inputPhoneSubject($('[data-sublink="phone"] article.subject-panel [data-name="tmp_id"]'),$('[data-sublink="phone"] article.subject-panel [data-name="subject_id"]'),
|
||||||
function fDynamicUpdate(a){var b=a instanceof Element,g=b&&"INPUT"==a.tagName&&"submit"==a.type,f=b&&"SPAN"==a.tagName&&("f_nav-mini"==a.parentNode.id||"f_nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"f_nav-contact"==a.parentNode.id;if(!g&&!f&&!b&&!0!==a)return!1;console.log("> dynamic update");fMiniManager.fieldsToStorage();fFicheManager.fieldsToStorage();fContactManager.fieldsToStorage();fMatriceManager.fieldsToStorage();fFicheManager.sync();fMiniManager.sync();!0===a?api.send({path:"subject/getFriends",
|
$('[data-sublink="phone"] article.subject-panel [data-name="submit"]'));n.attach(r);g=new inputPhoneContact($('[data-sublink="phone"] article.contact-panel'),$('[data-sublink="phone"] #p_nav-contact'));g.attach(r);e=new inputPhoneMini($('[data-sublink="phone"] article.mini-relation-panel'),$('[data-sublink="phone"] #p_nav-mini'));e.attach(r);f=new inputPhoneFiche($('[data-sublink="phone"] article.relation-panel'),$('[data-sublink="phone"] #p_nav-fiche'));f.attach(r);h=new inputPhoneMatrice($('[data-sublink="phone"] article.matrice-panel'));
|
||||||
subject_id:fSubjectManager.subject_id.value},function(a){if(0!=a.ModuleError)return!1;lsi["import"]("f_friends",a.subjects);fMiniManager.storageToFields();fFicheManager.storageToFields();fMatriceManager.storageToFields();fContactManager.storageToFields()}):(fMiniManager.storageToFields(),fFicheManager.storageToFields(),fMatriceManager.storageToFields(),(g||b)&&fContactManager.storageToFields())}
|
h.attach(r);var b=new ShortcutManager,c=!1;b.append("s+n+a+k+e",function(){c||(c=!0,h.snake())});b.listen();$('[data-sublink="phone"] #p_clear-all').addEventListener("click",function(a){lsi.clear("p_subject");lsi.clear("p_contacts");lsi.clear("p_mini-fiches");lsi.clear("p_fiches");lsi.clear("p_matrice");lsi.clear("p_friends");n.storageToFields();g.storageToFields();e.storageToFields();f.storageToFields();h.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},
|
||||||
include("/js/includes/input-phone-subject-min.js",function(){include("/js/includes/input-phone-contact.js",function(){include("/js/includes/input-phone-mini.js",function(){include("/js/includes/input-phone-fiche.js",function(){include("/js/includes/input-phone-matrice-min.js",function(){pSubjectManager=new inputPhoneSubject($('[data-sublink="phone"] article.subject-panel [data-name="tmp_id"]'),$('[data-sublink="phone"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="phone"] article.subject-panel [data-name="submit"]'));
|
!1);$('[data-sublink="phone"] #p_export-all').addEventListener("click",function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");a={subject:lsi["export"]("p_subject")[0],contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};var b=$('[data-sublink="phone"] #p_download-target');b.download="local-phone-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a));
|
||||||
pSubjectManager.attach(pDynamicUpdate);pContactManager=new inputPhoneContact($('[data-sublink="phone"] article.contact-panel'),$('[data-sublink="phone"] #p_nav-contact'));pContactManager.attach(pDynamicUpdate);pMiniManager=new inputPhoneMini($('[data-sublink="phone"] article.mini-relation-panel'),$('[data-sublink="phone"] #p_nav-mini'));pMiniManager.attach(pDynamicUpdate);pFicheManager=new inputPhoneFiche($('[data-sublink="phone"] article.relation-panel'),$('[data-sublink="phone"] #p_nav-fiche'));
|
b.click()},!1);$('[data-sublink="phone"] #p_import-all').addEventListener("click",function(a){$('[data-sublink="phone"] #p_local-upload').click()},!1);$('[data-sublink="phone"] #p_local-upload').addEventListener("click",function(a){a.target.value=null},!1);$('[data-sublink="phone"] #p_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="phone"] #p_local-upload').files[0]};api.send(a,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("Erreur",
|
||||||
pFicheManager.attach(pDynamicUpdate);pMatriceManager=new inputPhoneMatrice($('[data-sublink="phone"] article.matrice-panel'));pMatriceManager.attach(pDynamicUpdate);var a=new ShortcutManager,b=!1;a.append("s+n+a+k+e",function(){b||(b=!0,pMatriceManager.snake())});a.listen();$('[data-sublink="phone"] input#p_call_log-import[type="file"]').addEventListener("click",function(a){a.target.value=null},!1);$('[data-sublink="phone"] #p_clear-all').addEventListener("click",function(a){lsi.clear("p_subject");
|
a.ModuleError),!1;lsi.set("p_subject",0,a.local_data.subject);lsi["import"]("p_contacts",a.local_data.contacts);lsi["import"]("p_mini-fiches",a.local_data.mini);lsi["import"]("p_fiches",a.local_data.fiches);lsi.set("p_matrice",0,a.local_data.matrice);n.storageToFields();g.storageToFields();h.storageToFields();r(!0)})},!1);$('[data-sublink="phone"] #p_submit-all').addEventListener("click",function(a){console.log("> GATHERING ALL DATA");n.fieldsToStorage();g.fieldsToStorage();e.fieldsToStorage();f.fieldsToStorage();
|
||||||
lsi.clear("p_contacts");lsi.clear("p_mini-fiches");lsi.clear("p_fiches");lsi.clear("p_matrice");lsi.clear("p_friends");pSubjectManager.storageToFields();pContactManager.storageToFields();pMiniManager.storageToFields();pFicheManager.storageToFields();pMatriceManager.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},!1);$('[data-sublink="phone"] #p_export-all').addEventListener("click",function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");
|
if(!n.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("p_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("p_fiches");for(c in a)if(!a[c].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(c)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),
|
||||||
a={subject:lsi["export"]("p_subject")[0],contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};var b=$('[data-sublink="phone"] #p_download-target');b.download="local-phone-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a));b.click()},!1);$('[data-sublink="phone"] #p_import-all').addEventListener("click",function(a){$('[data-sublink="phone"] #p_local-upload').click()},!1);
|
!1;c={path:"input/phone",subject:lsi["export"]("p_subject")[0],contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK","L'identifiant du sujet est <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1)})})})})});include("/js/includes/input-facebook-subject-min.js",
|
||||||
$('[data-sublink="phone"] #p_local-upload').addEventListener("click",function(a){a.target.value=null},!1);$('[data-sublink="phone"] #p_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="phone"] #p_local-upload').files[0]};api.send(a,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("Erreur",a.ModuleError),!1;lsi.set("p_subject",0,a.local_data.subject);lsi["import"]("p_contacts",a.local_data.contacts);lsi["import"]("p_mini-fiches",
|
function(){include("/js/includes/input-facebook-contact.js",function(){include("/js/includes/input-facebook-mini.js",function(){include("/js/includes/input-facebook-fiche.js",function(){include("/js/includes/input-facebook-matrice-min.js",function(){q=new inputFacebookSubject($('[data-sublink="facebook"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="facebook"] article.subject-panel [data-name="submit"]'));q.attach(t);m=new inputFacebookContact($('[data-sublink="facebook"] article.contact-panel'),
|
||||||
a.local_data.mini);lsi["import"]("p_fiches",a.local_data.fiches);lsi.set("p_matrice",0,a.local_data.matrice);pSubjectManager.storageToFields();pContactManager.storageToFields();pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1);$('[data-sublink="phone"] #p_submit-all').addEventListener("click",function(a){console.log("> GATHERING ALL DATA");pSubjectManager.fieldsToStorage();pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention",
|
$('[data-sublink="facebook"] #f_nav-contact'));m.attach(t);k=new inputFacebookMini($('[data-sublink="facebook"] article.mini-relation-panel'),$('[data-sublink="facebook"] #f_nav-mini'));k.attach(t);l=new inputFacebookFiche($('[data-sublink="facebook"] article.relation-panel'),$('[data-sublink="facebook"] #f_nav-fiche'));l.attach(t);p=new inputFacebookMatrice($('[data-sublink="facebook"] article.matrice-panel'));p.attach(t);$('[data-sublink="facebook"] #f_clear-all').addEventListener("click",function(b){lsi.clear("f_subject");
|
||||||
"Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("p_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("p_fiches");for(c in a)if(!a[c].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(c)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;c={path:"input/phone",subject:lsi["export"]("p_subject")[0],
|
lsi.clear("f_contacts");lsi.clear("f_mini-fiches");lsi.clear("f_fiches");lsi.clear("f_matrice");lsi.clear("f_friends");q.storageToFields();m.storageToFields();k.storageToFields();l.storageToFields();p.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},!1);$('[data-sublink="facebook"] #f_export-all').addEventListener("click",function(b){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");b={subject:lsi["export"]("f_subject")[0],
|
||||||
contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK","L'identifiant du sujet est <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1)})})})})});
|
contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};var c=$('[data-sublink="facebook"] #f_download-target');c.download="local-facebook-data.json";c.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(b));c.click()},!1);$('[data-sublink="facebook"] #f_import-all').addEventListener("click",function(b){$('[data-sublink="facebook"] #f_local-upload').click()},!1);$('[data-sublink="facebook"] #f_local-upload').addEventListener("click",
|
||||||
include("/js/includes/input-facebook-subject-min.js",function(){include("/js/includes/input-facebook-contact.js",function(){include("/js/includes/input-facebook-mini.js",function(){include("/js/includes/input-facebook-fiche.js",function(){include("/js/includes/input-facebook-matrice-min.js",function(){fSubjectManager=new inputFacebookSubject($('[data-sublink="facebook"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="facebook"] article.subject-panel [data-name="submit"]'));fSubjectManager.attach(fDynamicUpdate);
|
function(b){b.target.value=null},!1);$('[data-sublink="facebook"] #f_local-upload').addEventListener("change",function(b){b={path:"upload/local_data",file:$('[data-sublink="facebook"] #f_local-upload').files[0]};api.send(b,function(b){console.log(b);if(0!=b.ModuleError)return Notification.error("Erreur",b.ModuleError),!1;lsi.set("f_subject",0,b.local_data.subject);lsi["import"]("f_contacts",b.local_data.contacts);lsi["import"]("f_mini-fiches",b.local_data.mini);lsi["import"]("f_fiches",b.local_data.fiches);
|
||||||
fContactManager=new inputFacebookContact($('[data-sublink="facebook"] article.contact-panel'),$('[data-sublink="facebook"] #f_nav-contact'));fContactManager.attach(fDynamicUpdate);fMiniManager=new inputFacebookMini($('[data-sublink="facebook"] article.mini-relation-panel'),$('[data-sublink="facebook"] #f_nav-mini'));fMiniManager.attach(fDynamicUpdate);fFicheManager=new inputFacebookFiche($('[data-sublink="facebook"] article.relation-panel'),$('[data-sublink="facebook"] #f_nav-fiche'));fFicheManager.attach(fDynamicUpdate);
|
lsi.set("f_matrice",0,b.local_data.matrice);q.storageToFields();m.storageToFields();p.storageToFields();t(!0)})},!1);$('[data-sublink="facebook"] #f_submit-all').addEventListener("click",function(b){console.log("> GATHERING ALL DATA");q.fieldsToStorage();m.fieldsToStorage();k.fieldsToStorage();l.fieldsToStorage();if(!q.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;b=lsi["export"]("f_mini-fiches");var c=0,a;for(a in b)if(!isNaN(a)&&(c++,!b[a].valid))return Notification.warning("Attention",
|
||||||
fMatriceManager=new inputFacebookMatrice($('[data-sublink="facebook"] article.matrice-panel'));fMatriceManager.attach(fDynamicUpdate);$('[data-sublink="facebook"] #f_clear-all').addEventListener("click",function(a){lsi.clear("f_subject");lsi.clear("f_contacts");lsi.clear("f_mini-fiches");lsi.clear("f_fiches");lsi.clear("f_matrice");lsi.clear("f_friends");fSubjectManager.storageToFields();fContactManager.storageToFields();fMiniManager.storageToFields();fFicheManager.storageToFields();fMatriceManager.storageToFields();
|
"La <i>fiche rapide</i> <b>"+c+"</b> est incompl\u00e8te et/ou incorrecte"),!1;b=lsi["export"]("f_fiches");for(a in b)if(!b[a].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(a)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a={path:"input/facebook",subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};api.send(a,function(a){console.log(a);
|
||||||
Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},!1);$('[data-sublink="facebook"] #f_export-all').addEventListener("click",function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");a={subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};var b=$('[data-sublink="facebook"] #f_download-target');b.download=
|
if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;console.log(a)},!1)},!1)})})})})})})();
|
||||||
"local-facebook-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a));b.click()},!1);$('[data-sublink="facebook"] #f_import-all').addEventListener("click",function(a){$('[data-sublink="facebook"] #f_local-upload').click()},!1);$('[data-sublink="facebook"] #f_local-upload').addEventListener("click",function(a){a.target.value=null},!1);$('[data-sublink="facebook"] #f_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="facebook"] #f_local-upload').files[0]};
|
|
||||||
api.send(a,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("Erreur",a.ModuleError),!1;lsi.set("f_subject",0,a.local_data.subject);lsi["import"]("f_contacts",a.local_data.contacts);lsi["import"]("f_mini-fiches",a.local_data.mini);lsi["import"]("f_fiches",a.local_data.fiches);lsi.set("f_matrice",0,a.local_data.matrice);fSubjectManager.storageToFields();fContactManager.storageToFields();fMatriceManager.storageToFields();fDynamicUpdate(!0)})},!1);$('[data-sublink="facebook"] #f_submit-all').addEventListener("click",
|
|
||||||
function(a){console.log("> GATHERING ALL DATA");fSubjectManager.fieldsToStorage();fContactManager.fieldsToStorage();fMiniManager.fieldsToStorage();fFicheManager.fieldsToStorage();if(!fSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("f_mini-fiches");var b=0,g;for(g in a)if(!isNaN(g)&&(b++,!a[g].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),
|
|
||||||
!1;a=lsi["export"]("f_fiches");for(g in a)if(!a[g].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(g)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;g={path:"input/facebook",subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};api.send(g,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),
|
|
||||||
!1;console.log(a)},!1)},!1)})})})})});
|
|
||||||
function testRoutinePhone(a){var b=lsi["export"]("p_contacts"),g=lsi["export"]("p_mini-fiches"),f=lsi["export"]("p_fiches"),c=0;if(null!=a&&a)for(var e in g)isNaN(e)||(a="",null!=b[e]&&(a=b[e].username),g=$('#p_nav-mini [data-n="'+e+'"]'),g.click(),$("#unknown_min_p_"+e).checked=0==a.length,0==a.length?($("#sexeI_mini_p_"+e).checked=!0,$('input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="age"]').value=c%19,$('input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="studies"]').value=0,
|
|
||||||
$("#reltype9_mini_p_"+e).checked=!0):(a=["H","F"][Math.floor(c%2)],$("#sexe"+a+"_mini_p_"+e).checked=!0,$('input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="age"]').value=c%19,$('input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="studies"]').value=1+c%6,a=c%10,9==a?($("#reltype10_mini_p_"+e).checked=!0,$('input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_mini_p_"+e).checked=!0,c++));for(var d in f)isNaN(d)||(g=$('#p_nav-fiche [data-n="'+
|
|
||||||
d+'"]'),g.click(),a=["H","F","I"][Math.floor(c%3)],$("#sexe"+a+"_p_"+d).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="age"]').value=c%19,b="10 21 22 23 31 32 36 41 46 47 48 51 54 55 56 61 66 69 71 72 73 74 75 76 81 82".split(" "),b=b[c%b.length],$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="job"]').value=b,b=(c%12).toString(),1==b.length&&(b="0"+b),$('article.fiche-relation > input[data-name="uid"][value="'+
|
|
||||||
d+'"] ~ h5 select[data-name="studies"]').value=b,a=c%9,8==a?($("#reltype10_p_"+d).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_p_"+d).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="city"]').value=(10+c).toString(),$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="cp"]').value=(1E4+c).toString(),$('article.fiche-relation > input[data-name="uid"][value="'+
|
|
||||||
d+'"] ~ h5 input[data-name="quartier"]').value=c,$("#loc"+["A","B","C","D"][Math.floor(c%4)]+"_p_"+d).checked=!0,b=$$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="duration"]'),b[0].value=c.toString(),b[1].value=1+c.toString(),b=c%14,$("article.fiche-relation #contexte"+b+"_p_"+d).checked=!0,f=$$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="contextSpecial"]'),11==b&&(f[0].value="internet"),12==b&&(f[1].value="association"),
|
|
||||||
13==b&&(f[2].value="autre"),c++)}
|
|
||||||
function testRoutineFacebook(a){var b=lsi["export"]("f_contacts"),g=lsi["export"]("f_mini-fiches"),f=lsi["export"]("f_fiches"),c=0;if(null!=a&&a)for(var e in g)isNaN(e)||(a="",null!=b[e]&&(a=b[e].username),g=$('#f_nav-mini [data-n="'+e+'"]'),g.click(),$("#unknown_min_f_"+e).checked=0==a.length,0==a.length?($("#sexeI_mini_f_"+e).checked=!0,$('input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="age"]').value=c%19,$('input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="studies"]').value=0,
|
|
||||||
$("#reltype9_mini_f_"+e).checked=!0):(a=["H","F"][Math.floor(c%2)],$("#sexe"+a+"_mini_f_"+e).checked=!0,$('input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="age"]').value=c%19,$('input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="studies"]').value=1+c%6,a=c%10,9==a?($("#reltype10_mini_f_"+e).checked=!0,$('input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_mini_f_"+e).checked=!0,c++));for(var d in f)isNaN(d)||(g=$('#f_nav-fiche [data-n="'+
|
|
||||||
d+'"]'),g.click(),a=["H","F","I"][Math.floor(c%3)],$("#sexe"+a+"_f_"+d).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="age"]').value=c%19,b="10 21 22 23 31 32 36 41 46 47 48 51 54 55 56 61 66 69 71 72 73 74 75 76 81 82".split(" "),b=b[c%b.length],$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="job"]').value=b,b=(c%12).toString(),1==b.length&&
|
|
||||||
(b="0"+b),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="studies"]').value=b,a=c%9,8==a?($("#reltype10_f_"+d).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_f_"+d).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="city"]').value=
|
|
||||||
(10+c).toString(),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="cp"]').value=(1E4+c).toString(),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="quartier"]').value=c,$("#loc"+["A","B","C","D"][Math.floor(c%4)]+"_f_"+d).checked=!0,b=$$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="duration"]'),
|
|
||||||
b[0].value=c.toString(),b[1].value=1+c.toString(),b=c%14,$('section[data-sublink="facebook"] article.fiche-relation #contexte'+b+"_f_"+d).checked=!0,f=$$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="contextSpecial"]'),11==b&&(f[0].value="internet"),12==b&&(f[1].value="association"),13==b&&(f[2].value="autre"),c++)};
|
|
||||||
|
|
137
view/js/input.js
137
view/js/input.js
|
@ -1,11 +1,14 @@
|
||||||
/*=========================================================*/
|
(function(){
|
||||||
/*=========== Gestion de la recherche de sujet ============*/
|
|
||||||
/*=========================================================*/
|
|
||||||
var sField = $('#search-field');
|
|
||||||
var sSubmit = $('#search-subject');
|
|
||||||
var sList = $('section[data-sublink="survey"] ul[data-list]');
|
|
||||||
|
|
||||||
sSubmit.addEventListener('click', function(e){
|
|
||||||
|
/*=========================================================*/
|
||||||
|
/*=========== Gestion de la recherche de sujet ============*/
|
||||||
|
/*=========================================================*/
|
||||||
|
var sField = $('#search-field');
|
||||||
|
var sSubmit = $('#search-subject');
|
||||||
|
var sList = $('section[data-sublink="survey"] ul[data-list]');
|
||||||
|
|
||||||
|
var tmpSubjectSearchListener = function(e){
|
||||||
|
|
||||||
/* (1) On construit la requête */
|
/* (1) On construit la requête */
|
||||||
var request = {
|
var request = {
|
||||||
|
@ -53,7 +56,13 @@ sSubmit.addEventListener('click', function(e){
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}, false);
|
};
|
||||||
|
|
||||||
|
sSubmit.addEventListener('click', tmpSubjectSearchListener, false);
|
||||||
|
sField.addEventListener('keypress', function(e){
|
||||||
|
if( e.keyCode === 13 )
|
||||||
|
tmpSubjectSearchListener(e);
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,18 +73,18 @@ sSubmit.addEventListener('click', function(e){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* [1] Initialisation des utilitaires et variables PHONE
|
/* [1] Initialisation des utilitaires et variables PHONE
|
||||||
=========================================================*
|
=========================================================*
|
||||||
/* (1) Initialisation des managers */
|
/* (1) Initialisation des managers */
|
||||||
var pSubjectManager;
|
var pSubjectManager;
|
||||||
var pContactManager;
|
var pContactManager;
|
||||||
var pMiniManager;
|
var pMiniManager;
|
||||||
var pFicheManager;
|
var pFicheManager;
|
||||||
var pMatriceManager;
|
var pMatriceManager;
|
||||||
|
|
||||||
|
|
||||||
/* (2) Fonctions utiles */
|
/* (2) Fonctions utiles */
|
||||||
function pDynamicUpdate(target){
|
function pDynamicUpdate(target){
|
||||||
|
|
||||||
|
|
||||||
/* (0) Vérification de la cohérence de la @target
|
/* (0) Vérification de la cohérence de la @target
|
||||||
|
@ -115,6 +124,7 @@ function pDynamicUpdate(target){
|
||||||
|
|
||||||
/* (7) On récupère tous les amis du sujet */
|
/* (7) On récupère tous les amis du sujet */
|
||||||
if( target === true ){
|
if( target === true ){
|
||||||
|
|
||||||
api.send({ path: 'subject/getFriends', subject_id: pSubjectManager.subject_id.value }, function(response){
|
api.send({ path: 'subject/getFriends', subject_id: pSubjectManager.subject_id.value }, function(response){
|
||||||
// Si erreur, on quitte
|
// Si erreur, on quitte
|
||||||
if( response.ModuleError != 0 )
|
if( response.ModuleError != 0 )
|
||||||
|
@ -135,33 +145,34 @@ function pDynamicUpdate(target){
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
/* (8) On affiche le tout */
|
/* (8) On affiche le tout */
|
||||||
pMiniManager.storageToFields();
|
pMiniManager.storageToFields();
|
||||||
pFicheManager.storageToFields();
|
pFicheManager.storageToFields();
|
||||||
pMatriceManager.storageToFields();
|
pMatriceManager.storageToFields();
|
||||||
|
|
||||||
/* (8) On met à jour les contacts si on les a modifié on si on navigue dans les contacts */
|
/* (8) On met à jour les contacts si on les a modifié on si on navigue dans les contacts */
|
||||||
if( isSaveButton || isNavContact )
|
( isSaveButton || isNavContact ) && pContactManager.storageToFields();
|
||||||
pContactManager.storageToFields();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* [2] Initialisation des utilitaires et variables FACEBEOOK
|
/* [2] Initialisation des utilitaires et variables FACEBEOOK
|
||||||
=========================================================*
|
=========================================================*
|
||||||
/* (1) Initialisation des managers */
|
/* (1) Initialisation des managers */
|
||||||
var fSubjectManager;
|
var fSubjectManager;
|
||||||
var fContactManager;
|
var fContactManager;
|
||||||
var fMiniManager;
|
var fMiniManager;
|
||||||
var fFicheManager;
|
var fFicheManager;
|
||||||
var fMatriceManager;
|
var fMatriceManager;
|
||||||
|
|
||||||
|
|
||||||
/* (2) Fonctions utiles */
|
/* (2) Fonctions utiles */
|
||||||
function fDynamicUpdate(target){
|
function fDynamicUpdate(target){
|
||||||
|
|
||||||
|
|
||||||
/* (0) Vérification de la cohérence de la @target
|
/* (0) Vérification de la cohérence de la @target
|
||||||
|
@ -200,6 +211,7 @@ function fDynamicUpdate(target){
|
||||||
|
|
||||||
/* (7) On récupère tous les amis du sujet */
|
/* (7) On récupère tous les amis du sujet */
|
||||||
if( target === true ){
|
if( target === true ){
|
||||||
|
|
||||||
api.send({ path: 'subject/getFriends', subject_id: fSubjectManager.subject_id.value }, function(response){
|
api.send({ path: 'subject/getFriends', subject_id: fSubjectManager.subject_id.value }, function(response){
|
||||||
// Si erreur, on quitte
|
// Si erreur, on quitte
|
||||||
if( response.ModuleError != 0 )
|
if( response.ModuleError != 0 )
|
||||||
|
@ -220,6 +232,7 @@ function fDynamicUpdate(target){
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
/* (8) On affiche le tout */
|
/* (8) On affiche le tout */
|
||||||
fMiniManager.storageToFields();
|
fMiniManager.storageToFields();
|
||||||
fFicheManager.storageToFields();
|
fFicheManager.storageToFields();
|
||||||
|
@ -230,7 +243,7 @@ function fDynamicUpdate(target){
|
||||||
fContactManager.storageToFields();
|
fContactManager.storageToFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,17 +252,17 @@ function fDynamicUpdate(target){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*=========================================================*/
|
/*=========================================================*/
|
||||||
/*========== Gestion du formulaire téléphonique ===========*/
|
/*========== Gestion du formulaire téléphonique ===========*/
|
||||||
/*=========================================================*/
|
/*=========================================================*/
|
||||||
include('/js/includes/input-phone-subject-min.js', function(){
|
include('/js/includes/input-phone-subject-min.js', function(){
|
||||||
//TODO: Remettre version min
|
//TODO: Remettre version min
|
||||||
include('/js/includes/input-phone-contact.js', function(){
|
include('/js/includes/input-phone-contact.js', function(){
|
||||||
//TODO: Remettre version min
|
//TODO: Remettre version min
|
||||||
include('/js/includes/input-phone-mini.js', function(){
|
include('/js/includes/input-phone-mini.js', function(){
|
||||||
//TODO: Remettre version min
|
//TODO: Remettre version min
|
||||||
include('/js/includes/input-phone-fiche.js', function(){
|
include('/js/includes/input-phone-fiche.js', function(){
|
||||||
include('/js/includes/input-phone-matrice-min.js', function(){
|
include('/js/includes/input-phone-matrice-min.js', function(){
|
||||||
|
|
||||||
|
|
||||||
/* (1) Gestion du formulaire du sujet
|
/* (1) Gestion du formulaire du sujet
|
||||||
|
@ -640,7 +653,7 @@ include('/js/includes/input-phone-matrice-min.js', function(){
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
}); }); }); }); });
|
}); }); }); }); });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -656,17 +669,17 @@ include('/js/includes/input-phone-matrice-min.js', function(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*=========================================================*/
|
/*=========================================================*/
|
||||||
/*=========== Gestion du formulaire facebook ==============*/
|
/*=========== Gestion du formulaire facebook ==============*/
|
||||||
/*=========================================================*/
|
/*=========================================================*/
|
||||||
include('/js/includes/input-facebook-subject-min.js', function(){
|
include('/js/includes/input-facebook-subject-min.js', function(){
|
||||||
//TODO: Remettre version min
|
//TODO: Remettre version min
|
||||||
include('/js/includes/input-facebook-contact.js', function(){
|
include('/js/includes/input-facebook-contact.js', function(){
|
||||||
//TODO: Remettre version min
|
//TODO: Remettre version min
|
||||||
include('/js/includes/input-facebook-mini.js', function(){
|
include('/js/includes/input-facebook-mini.js', function(){
|
||||||
//TODO: Remettre version min
|
//TODO: Remettre version min
|
||||||
include('/js/includes/input-facebook-fiche.js', function(){
|
include('/js/includes/input-facebook-fiche.js', function(){
|
||||||
include('/js/includes/input-facebook-matrice-min.js', function(){
|
include('/js/includes/input-facebook-matrice-min.js', function(){
|
||||||
|
|
||||||
|
|
||||||
/* (1) Gestion du formulaire du sujet
|
/* (1) Gestion du formulaire du sujet
|
||||||
|
@ -906,7 +919,7 @@ include('/js/includes/input-facebook-matrice-min.js', function(){
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
}); }); }); }); });
|
}); }); }); }); });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -941,10 +954,10 @@ include('/js/includes/input-facebook-matrice-min.js', function(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*=========================================================*/
|
/*=========================================================*/
|
||||||
/*============= Routine de test CELLULAIRE ================*/
|
/*============= Routine de test CELLULAIRE ================*/
|
||||||
/*=========================================================*/
|
/*=========================================================*/
|
||||||
function testRoutinePhone(doMini){
|
function testRoutinePhone(doMini){
|
||||||
|
|
||||||
/* [0] Récupération des données
|
/* [0] Récupération des données
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
|
@ -1114,17 +1127,17 @@ function testRoutinePhone(doMini){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*=========================================================*/
|
/*=========================================================*/
|
||||||
/*============== Routine de test FACEBOOK =================*/
|
/*============== Routine de test FACEBOOK =================*/
|
||||||
/*=========================================================*/
|
/*=========================================================*/
|
||||||
function testRoutineFacebook(doMini){
|
function testRoutineFacebook(doMini){
|
||||||
|
|
||||||
/* [0] Récupération des données
|
/* [0] Récupération des données
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
|
@ -1294,4 +1307,8 @@ function testRoutineFacebook(doMini){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
Loading…
Reference in New Issue