Suppression du numéro de téléphone dans 'lightdb'

This commit is contained in:
xdrm-brackets 2016-05-18 13:56:02 +02:00
parent 97f8bcab68
commit 48224a7d7a
35 changed files with 113 additions and 113 deletions

View File

@ -87,15 +87,15 @@
// }
// $req = new ModuleRequest('download/phone', array('subjects'=>array(1)));
// $req->download();
$req = new ModuleRequest('download/phone', array('subjects'=>array(1, 273)));
var_dump( $req->download() );
/* [4] Analyse des performances de `lightdb`
=========================================================*/
$start = microtime(true);
$db = new lightdb('test1', __ROOT__.'/tmp/');
// $start = microtime(true);
// $db = new lightdb('test1', __ROOT__.'/tmp/');
/* (0) Création des objets à insérer */
// $object_10 = array();
@ -207,9 +207,9 @@
//
// $stop = microtime(true);
// var_dump('1000 lines deleted in '.($stop-$start).' sec.');
//
// $db->close();
$db->close();
var_dump('total execution time : '.(microtime(true)-$start).' sec');
// var_dump('total execution time : '.(microtime(true)-$start).' sec');
?>

2
js/lib/notif-min.js vendored
View File

@ -1,5 +1,5 @@
var NotificationClass=function(a){this.container=a};NotificationClass.prototype={container:this.container,stack:[],types:["warning","info","success","error"],defaultTimeout:2E3,errorCodes:{}};NotificationClass.prototype.pushStack=function(a,c,b){if(!(a instanceof Array&&b instanceof Array&&c instanceof Element))return null;var e=-1,d;for(d in a)if(-1<b.indexOf(a[d])){e=d;break}if(-1==e)return a.push(c)-1;a[e]=c;return e};
NotificationClass.prototype.hide=function(a){if(isNaN(a))return!1;a=parseInt(a);null!=this.stack[a]&&this.stack[a].element instanceof Element&&this.container.removeChild(this.stack[a].element);this.stack[a]=null};
NotificationClass.prototype.hide=function(a){if(isNaN(a))return!1;a=parseInt(a);this.stack[a].element instanceof Element&&this.container.removeChild(this.stack[a].element);this.stack[a]=null};
NotificationClass.prototype.show=function(a,c,b,e){a=-1<this.types.indexOf(a)?a:this.types[0];c="string"==typeof c?c:"";b="string"==typeof b.toString()?b:"...";null!=this.errorCodes[b]&&(b=this.errorCodes[b]);e="number"==typeof e?e:this.defaultTimeout;var d={element:document.createElement("div"),type:a,title:c,message:b,timeout:null};d.element.className="notification-element";d.element.setAttribute("data-"+a,"");d.element.innerHTML="<p><strong>"+c+":</strong> "+b+"<p>";this.container.appendChild(d.element);
var f=this.pushStack(this.stack,d,[null]);d.element.id=f;var g=this;d.element.className="notification-element notification-visible";setTimeout(function(){d.element.className="notification-element"},500+e);d.timeout=setTimeout(function(){g.hide(f)},500+e+500);d.element.addEventListener("click",function(a){g.hide(f)},!1);return d.element};NotificationClass.prototype.warning=function(a,c,b){return this.show("warning",a,c,b)};
NotificationClass.prototype.info=function(a,c,b){return this.show("info",a,c,b)};NotificationClass.prototype.success=function(a,c,b){return this.show("success",a,c,b)};NotificationClass.prototype.error=function(a,c,b){return this.show("error",a,c,b)};

View File

@ -2,7 +2,7 @@
/* [0] CONSTRUCTEUR
=========================================================*/
var NotificationClass = function(container){
this.container = container;
this.container = container;
};
@ -10,16 +10,16 @@ var NotificationClass = function(container){
/* [1] PROTOTYPE ET ATTRIBUTS
=========================================================*/
NotificationClass.prototype = {
container: this.container, // Parent de la page à notifier
stack: [], // Contiendra les données de toutes les notifications actives
types: [ // Définition des différents types
'warning',
'info',
'success',
'error'
],
defaultTimeout: 2000, // Temps d'apparition par défaut
errorCodes: {} // codes d'erreurs sous la forme {codeErreur1: texteErreur1, codeErreur2: texteErreur2, ...}
container: this.container, // Parent de la page à notifier
stack: [], // Contiendra les données de toutes les notifications actives
types: [ // Définition des différents types
'warning',
'info',
'success',
'error'
],
defaultTimeout: 2000, // Temps d'apparition par défaut
errorCodes: {} // codes d'erreurs sous la forme {codeErreur1: texteErreur1, codeErreur2: texteErreur2, ...}
};
@ -33,37 +33,37 @@ NotificationClass.prototype = {
*
*/
NotificationClass.prototype.pushStack = function(stack, element, emptyValues){
/* (0) Vérification des INPUT
---------------------------------------------------------*/
/* (1) Vérification de @stack */
if( !(stack instanceof Array) )
return null;
/* (2) Vérification de @emptyValues */
if( !(emptyValues instanceof Array) )
return null;
/* (3) Vérification de element */
if( !(element instanceof Element) )
return null;
/* (0) Vérification des INPUT
---------------------------------------------------------*/
/* (1) Vérification de @stack */
if( !(stack instanceof Array) )
return null;
/* (2) Vérification de @emptyValues */
if( !(emptyValues instanceof Array) )
return null;
/* (3) Vérification de element */
if( !(element instanceof Element) )
return null;
/* (1) On cherche la première valeur vide dans @stack
---------------------------------------------------------*/
var index = -1;
for( var i in stack )
if( emptyValues.indexOf(stack[i]) > -1 ){
index = i;
break;
}
/* (1) On cherche la première valeur vide dans @stack
---------------------------------------------------------*/
var index = -1;
for( var i in stack )
if( emptyValues.indexOf(stack[i]) > -1 ){
index = i;
break;
}
/* (2) Insertion et résultat
---------------------------------------------------------*/
/* (1) Si on a rien trouvé, on fait un push normal */
if( index == -1 )
return stack.push(element) - 1;
/* (2) Insertion et résultat
---------------------------------------------------------*/
/* (1) Si on a rien trouvé, on fait un push normal */
if( index == -1 )
return stack.push(element) - 1;
/* (2) Si on a trouvé, on enregistre @element et on renvoie @index */
stack[index] = element;
return index;
/* (2) Si on a trouvé, on enregistre @element et on renvoie @index */
stack[index] = element;
return index;
};
@ -77,19 +77,19 @@ NotificationClass.prototype.pushStack = function(stack, element, emptyValues){
*
*/
NotificationClass.prototype.hide = function(id){
/* (0) Vérification de @id */
if( isNaN(id) )
return false;
/* (0) Vérification de @id */
if( isNaN(id) )
return false;
id = parseInt(id);
id = parseInt(id);
/* (1) Suppression de l'élément */
if( this.stack[id] != null && this.stack[id].element instanceof Element )
this.container.removeChild( this.stack[id].element );
/* (1) Suppression de l'élément */
if( this.stack[id].element instanceof Element )
this.container.removeChild( this.stack[id].element );
/* (2) On supprime la notification de la pile */
this.stack[id] = null;
/* (2) On supprime la notification de la pile */
this.stack[id] = null;
};
@ -104,74 +104,74 @@ NotificationClass.prototype.hide = function(id){
*
*/
NotificationClass.prototype.show = function(type, title, message, timeout){
/* (0) Vérification des INPUT
---------------------------------------------------------*/
/* (1) Vérification de @type */
type = this.types.indexOf(type) > -1 ? type : this.types[0];
/* (0) Vérification des INPUT
---------------------------------------------------------*/
/* (1) Vérification de @type */
type = this.types.indexOf(type) > -1 ? type : this.types[0];
/* (2) Vérification de @title */
title = typeof title == 'string' ? title : '';
/* (2) Vérification de @title */
title = typeof title == 'string' ? title : '';
/* (3) Vérification de @message */
message = typeof message.toString() == 'string' ? message : '...';
/* (3) Vérification de @message */
message = typeof message.toString() == 'string' ? message : '...';
// On cherche s'il y a une occurence dans le dictionnaire
if( this.errorCodes[message] != null )
message = this.errorCodes[message];
// On cherche s'il y a une occurence dans le dictionnaire
if( this.errorCodes[message] != null )
message = this.errorCodes[message];
/* (4) Vérification de @timeout */
timeout = typeof timeout == 'number' ? timeout : this.defaultTimeout;
/* (4) Vérification de @timeout */
timeout = typeof timeout == 'number' ? timeout : this.defaultTimeout;
/* (1) Construction de l'élément
---------------------------------------------------------*/
/* (1) Création du set de données */
var stackItem = {
element: document.createElement('div'),
type: type,
title: title,
message: message,
timeout: null
};
/* (1) Construction de l'élément
---------------------------------------------------------*/
/* (1) Création du set de données */
var stackItem = {
element: document.createElement('div'),
type: type,
title: title,
message: message,
timeout: null
};
/* (2) Construction de l'élément */
stackItem.element.className = 'notification-element';
stackItem.element.setAttribute('data-'+type, '');
stackItem.element.innerHTML = '<p><strong>'+title+':</strong> '+message+'<p>';
/* (2) Construction de l'élément */
stackItem.element.className = 'notification-element';
stackItem.element.setAttribute('data-'+type, '');
stackItem.element.innerHTML = '<p><strong>'+title+':</strong> '+message+'<p>';
/* (2) Ajout à la pile et au DOM
---------------------------------------------------------*/
this.container.appendChild(stackItem.element);
var id = this.pushStack( this.stack, stackItem, [null] );
stackItem.element.id = id;
/* (2) Ajout à la pile et au DOM
---------------------------------------------------------*/
this.container.appendChild(stackItem.element);
var id = this.pushStack( this.stack, stackItem, [null] );
stackItem.element.id = id;
/* (3) Gestion du temps d'apparition
---------------------------------------------------------*/
var ptr = this;
/* (3) Gestion du temps d'apparition
---------------------------------------------------------*/
var ptr = this;
// {1} fadeIn START //
stackItem.element.className = 'notification-element notification-visible';
// {1} fadeIn START //
stackItem.element.className = 'notification-element notification-visible';
// {2} fadeOut START //
setTimeout(function(){
stackItem.element.className = 'notification-element';
}, 500+timeout);
// {2} fadeOut START //
setTimeout(function(){
stackItem.element.className = 'notification-element';
}, 500+timeout);
// {3} fadeOut STOP + animation STOP //
stackItem.timeout = setTimeout(function(){
ptr.hide(id);
}, 500+timeout+500);
// {3} fadeOut STOP + animation STOP //
stackItem.timeout = setTimeout(function(){
ptr.hide(id);
}, 500+timeout+500);
/* (4) Gestion du clic qui ferme la notification
---------------------------------------------------------*/
stackItem.element.addEventListener('click', function(e){
ptr.hide(id);
}, false);
/* (4) Gestion du clic qui ferme la notification
---------------------------------------------------------*/
stackItem.element.addEventListener('click', function(e){
ptr.hide(id);
}, false);
/* (5) On retourne l'élément
---------------------------------------------------------*/
return stackItem.element;
/* (5) On retourne l'élément
---------------------------------------------------------*/
return stackItem.element;
};

View File

@ -123,7 +123,6 @@
=========================================================*/
$file['subject'] = array(
'id' => $offset + $subject_id,
'number' => $subject['number'],
'name' => self::readableName($subject['username'], $subject['firstname'], $subject['lastname'])
);
@ -142,7 +141,6 @@
// On remplit les données qui iront dans le fichier pour ce contact
array_push($file['contacts'], array(
'id' => $offset + $miniData['uid'],
'number' => $contact['number'],
'name' => self::readableName($contact['username'], $contact['firstname'], $contact['lastname']),
'sexe' => $miniData['sexe'],
'age' => $miniData['age'],
@ -166,7 +164,6 @@
// On remplit les données qui iront dans le fichier pour ce contact
array_push($file['contacts'], array(
'id' => $offset + $ficheData['uid'],
'number' => $contact['number'],
'name' => self::readableName($contact['username'], $contact['firstname'], $contact['lastname']),
'sexe' => $ficheData['sexe'],
'age' => $ficheData['age'],

0
src/dynamic/profile/sample.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

0
src/dynamic/profile/sample.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 430 KiB

After

Width:  |  Height:  |  Size: 430 KiB

0
src/static/container/active.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
src/static/container/back.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

0
src/static/container/bottom_arrow.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
src/static/container/checked.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
src/static/container/close.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

0
src/static/container/dot.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
src/static/container/hole.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
src/static/container/phone_number.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

0
src/static/container/switch-both.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

0
src/static/container/switch-left.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
src/static/container/token.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

0
src/static/container/user.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

0
src/static/credits/cnrs.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

0
src/static/credits/sms.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

0
src/static/credits/sms.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

0
src/static/credits/univ_midi.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
src/static/credits/ut2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

0
src/static/header/expand.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

0
src/static/header/nopic.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
src/static/iconv2.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 241 KiB

After

Width:  |  Height:  |  Size: 241 KiB

0
src/static/menu-side/charts.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

0
src/static/menu-side/circle.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
src/static/menu-side/home.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

0
src/static/menu-side/input.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
src/static/menu-side/sub-active.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
src/static/menu-side/sub.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

3
src/upload/phone_storage/db/data Normal file → Executable file

File diff suppressed because one or more lines are too long

2
src/upload/phone_storage/db/index Normal file → Executable file
View File

@ -1 +1 @@
{"1":{"line":0,"hash":"95ad3f4b33bdef63dae17b5cafee1e39c6233314"},"69":{"line":1,"hash":"3d2eb540fa5b2c5e020f759a7627f899875df978"}}
{"1":{"line":0,"hash":"95ad3f4b33bdef63dae17b5cafee1e39c6233314"},"69":{"line":1,"hash":"3d2eb540fa5b2c5e020f759a7627f899875df978"},"137":{"line":2,"hash":"a8529e83f05688e89e1318b443a036e97386105d"},"205":{"line":3,"hash":"0a296a89a05509be912fefda7fdcc2692a244208"},"273":{"line":4,"hash":"1b9c3317ae25f49f6cfdee6aa34fcbc381c3a7a7"}}

View File

@ -1 +1 @@
136
340