Suppression du numéro de téléphone dans 'lightdb'
14
automate.php
|
@ -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');
|
||||
|
||||
?>
|
||||
|
|
|
@ -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)};
|
||||
|
|
200
js/lib/notif.js
|
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -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'],
|
||||
|
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 430 KiB After Width: | Height: | Size: 430 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 241 KiB After Width: | Height: | Size: 241 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
@ -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"}}
|
|
@ -1 +1 @@
|
|||
136
|
||||
340
|