From 91c7acfc0fa574c0f729102acfbb308f4ed639ed Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 22 Apr 2016 14:58:32 +0200 Subject: [PATCH] =?UTF-8?q?Optimisation=20de=20l'interface=20pour=20le=20l?= =?UTF-8?q?ocalStorage=20avec=20plusieurs=20'dataset'=20et=20la=20s=C3=A9r?= =?UTF-8?q?ialisation=20JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/lib/local-storage-interface-min.js | 4 +- js/lib/local-storage-interface.js | 49 ++++++-------------- phpunit/coverage/Database.php.html | 2 +- phpunit/coverage/ManagerError.php.html | 2 +- phpunit/coverage/ResourceDispatcher.php.html | 2 +- phpunit/coverage/autoloader.php.html | 6 +-- phpunit/coverage/index.html | 2 +- phpunit/coverage/sessionManager.php.html | 2 +- view/input.php | 2 +- view/js/input-min.js | 7 +-- view/js/input.js | 28 ++++++++--- 11 files changed, 50 insertions(+), 56 deletions(-) diff --git a/js/lib/local-storage-interface-min.js b/js/lib/local-storage-interface-min.js index 184abf6..cac0941 100644 --- a/js/lib/local-storage-interface-min.js +++ b/js/lib/local-storage-interface-min.js @@ -1,3 +1,3 @@ function localStorageInterface(){} -localStorageInterface.prototype={dataset:[],dataset_keys:[],set:function(a,b,d){var c=this.dataset.indexOf(a);if(-1==c)return!1;this.dataset_keys[c].push(b);localStorage.setItem(a,this.dataset_keys[c].join(","));localStorage.setItem(a+"_"+b,d);return!0},get:function(a,b){return-1==this.dataset.indexOf(a)?!1:localStorage.getItem(a+"_"+b)},setObject:function(a,b){if(-1==this.dataset.indexOf(a))return!1;for(var d in b)this.set(a,d,b[d]);return!0},getObject:function(a){var b=this.dataset.indexOf(a);if(-1== -b)return!1;for(var d={},c=0;cDead Code

- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Thu Apr 21 9:25:55 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Fri Apr 22 12:58:04 UTC 2016.

diff --git a/phpunit/coverage/ManagerError.php.html b/phpunit/coverage/ManagerError.php.html index f51b3f7..8ae392e 100755 --- a/phpunit/coverage/ManagerError.php.html +++ b/phpunit/coverage/ManagerError.php.html @@ -251,7 +251,7 @@ Dead Code

- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Thu Apr 21 9:25:55 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Fri Apr 22 12:58:04 UTC 2016.

diff --git a/phpunit/coverage/ResourceDispatcher.php.html b/phpunit/coverage/ResourceDispatcher.php.html index 6733667..dc72f99 100755 --- a/phpunit/coverage/ResourceDispatcher.php.html +++ b/phpunit/coverage/ResourceDispatcher.php.html @@ -517,7 +517,7 @@ Dead Code

- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Thu Apr 21 9:25:55 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Fri Apr 22 12:58:04 UTC 2016.

diff --git a/phpunit/coverage/autoloader.php.html b/phpunit/coverage/autoloader.php.html index 5b97a5c..971d09d 100755 --- a/phpunit/coverage/autoloader.php.html +++ b/phpunit/coverage/autoloader.php.html @@ -160,7 +160,7 @@
20
21
22
-
23
     +
23
24
    /* AUTOLOADER
25
    *
26
    * @className<String>                                     Nom de la classe appelee @@ -180,7 +180,7 @@
40
            require_once $path; // on inclue le fichier
41
42
    } -
43
     +
43
44
    // On definit l'autoloader comme autoloader (obvious)
45
    spl_autoload_register('autoloader', false, true);
46
@@ -214,7 +214,7 @@ Dead Code

- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Thu Apr 21 9:25:55 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Fri Apr 22 12:58:04 UTC 2016.

diff --git a/phpunit/coverage/index.html b/phpunit/coverage/index.html index 81f28f0..1fdcded 100755 --- a/phpunit/coverage/index.html +++ b/phpunit/coverage/index.html @@ -350,7 +350,7 @@ High: 90% to 100%

- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Thu Apr 21 9:25:55 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Fri Apr 22 12:58:04 UTC 2016.

diff --git a/phpunit/coverage/sessionManager.php.html b/phpunit/coverage/sessionManager.php.html index 7d1631a..a7a8975 100755 --- a/phpunit/coverage/sessionManager.php.html +++ b/phpunit/coverage/sessionManager.php.html @@ -315,7 +315,7 @@ Dead Code

- Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Thu Apr 21 9:25:55 UTC 2016. + Generated by PHP_CodeCoverage 2.1.7 using PHP 5.6.11-1ubuntu3.1 and PHPUnit 4.7.6 at Fri Apr 22 12:58:04 UTC 2016.

diff --git a/view/input.php b/view/input.php index a4744b1..0c49dfb 100755 --- a/view/input.php +++ b/view/input.php @@ -69,7 +69,7 @@ -

Ajouter un contact

+

Ajouter un contact

diff --git a/view/js/input-min.js b/view/js/input-min.js index 949c442..2aaecab 100644 --- a/view/js/input-min.js +++ b/view/js/input-min.js @@ -1,4 +1,5 @@ -function newContactHTMLBuilder(){var a=document.createElement("h4");a.dataset.icon="p";a.className="new-contact";a.innerHTML=" ";a.innerHTML+=" ";a.innerHTML+=" ";a.innerHTML+=" ";a.innerHTML+=""; -return a}var ficheRelationHTML="";function updateListener(a,b,c,d){a.removeEventListener(b,c);d.addEventListener(b,c);return d}var ic=new inputChecker,FormDeflaterP={tags:["input"],attr:["data-name"]},importCallLog=$('input#call_log-import[type="file"]'),contactDeflaters=[];function contactForms(){var a=$$("h4.new-contact");contactDeflaters=[];for(var b=0;b ";a+=" ";a+=" ";a+=" ";a+="";e.innerHTML=a;return e}var ficheRelationHTML="";function updateListener(a,b,c,d){a.removeEventListener(b,c);d.addEventListener(b,c);return d}var ic=new inputChecker,FormDeflaterP={tags:["input"],attr:["data-name"]},importCallLog=$('input#call_log-import[type="file"]'),contactDeflaters=[]; +function contactForms(){var a=$$("h4.new-contact");contactDeflaters=[];for(var b=0;b contient +// subject-data -> contient // contacts-data // fiches-relation @@ -22,16 +22,30 @@ /* [0] Gestion des constantes et fonctions =========================================================*/ /* (1) Contiendra le formulaire d'ajout de contact (numéro, pseudo, prénom, nom, submit) */ -function newContactHTMLBuilder(){ +function newContactHTMLBuilder(number, username, firstname, lastname){ var root = document.createElement('h4'); root.dataset.icon = 'p'; root.className = 'new-contact'; - root.innerHTML = " "; - root.innerHTML += " "; - root.innerHTML += " "; - root.innerHTML += " "; - root.innerHTML += ""; + var contentHTML = "