Gestion de la saisie des contacts (interface only) + inputChecker pour numéro.

This commit is contained in:
xdrm-brackets 2016-04-21 11:26:21 +02:00
parent f9665a9488
commit a1b5f1c576
24 changed files with 131 additions and 44 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -109,7 +109,7 @@
}
}
/* (4) Titres des sous-sous-sections */
/* (4) Titres genre text message */
& h5:not(.no-line){
display: block;
@ -213,7 +213,7 @@
// Icone d'upload
&:before{
content: 'u ';
content: 'e ';
font-size: 1em;
font-family: 'icomoon';
@ -222,6 +222,29 @@
}
}
/* (7) Inputs de type text */
& input:not([type='file']){
display: inline;
width: auto;
margin: unset;
padding: 5px 10px;
margin-bottom: 5px;
margin-right: 15px;
border-radius: 0;
border: 1.5px solid #aaa;
font-size: .8em;
font-weight: normal;
}
/* (8) Gestion des espacements */
& [data-space]{
padding-top: 30px;
padding-bottom: 30px;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -112,7 +112,7 @@ formatChecker.prototype = {
/*HIDDEN*///var instance = new formatChecker(
/*HIDDEN*/// 'te2t 1 2 1/23', // la chaîne à vérifier
/*HIDDEN*/// 'aava i i i/ii', // le schéma à respecter (cf. règles par défaut)
/*HIDDEN*/// {'v': '[0-2]'} // règles spécifiques. Ici, 'v' correspond à un chiffre compris entre 0 et 2
/*HIDDEN*/// {'v': '[0-2]'} // règles spécifiques. Ici, 'v' correspond à un chiffre compris entre 0 et 2 (basic regex)
/*HIDDEN*///);
/* [2] On récupère le résultat de la vérification

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

@ -1,4 +1,4 @@
function $(a){var b=document.querySelectorAll("#"+a);a=document.querySelectorAll("."+a);return 0<b.length?b[0]:a[0]}Element.prototype.getData=function(a){return"undefined"==typeof this.dataset?!1:this.dataset.hasOwnProperty(a)?this.dataset[a]:!1};Element.prototype.addClass=function(a){var b=this.className.split(" ");-1<b.indexOf(a)||(b.push(a),this.className=b.join(" ").trim())};
Element.prototype.remClass=function(a){var b=this.className.split(" ");a=b.indexOf(a);-1!=a&&(b=b.slice(0,a).concat(b.slice(a+1)),this.className=b.join(" ").trim())};NodeList.prototype.indexOf=HTMLCollection.prototype.indexOf=function(a){for(var b=0;b<this.length;b++)if(this[b]==a)return b;return-1};Element.prototype.anim=function(a,b){var c=this;c.addClass(a);setTimeout(function(){c.remClass(a)},b)};var includes=[],includeTags=[];
function include(a,b,c){a="string"===typeof a?a:null;b="function"===typeof b?b:function(){console.log("[x] "+a+" loaded")};if(null==a)return!1;if("boolean"===typeof c&&c){b=includes.indexOf(a);if(-1==b)return!1;document.head.removeChild(includeTags[b]);includes.splice(b,1);includeTags.splice(b,1)}else{if(-1<includes.indexOf(a))return b(),!0;c=document.createElement("script");c.type="text/javascript";c.src=a;document.head.appendChild(c);includes.push(a);includeTags.push(c);c.onload=b}return!0}
var format_code=new formatChecker(null,"HH-HH-HH-HH",{H:"[0-9A-F]"});
var format_number=new formatChecker(null,"0i ii ii ii ii");

View File

@ -164,4 +164,5 @@ function include(jsResource, callback, action){ // action=true -> EXCLUSION, SIN
/* DEFINITION DES FORMATS UTILES POUR INPUT-CHECKER
*
*/
var format_code = new formatChecker(null, 'HH-HH-HH-HH', { 'H' : '[0-9A-F]'} )
// Numéro de téléphone
var format_number = new formatChecker(null, '0i ii ii ii ii' );

View File

@ -645,7 +645,7 @@
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Wed Apr 20 13:45:11 UTC 2016.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Thu Apr 21 9:25:55 UTC 2016.</small>
</p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer>

View File

@ -251,7 +251,7 @@
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Wed Apr 20 13:45:11 UTC 2016.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Thu Apr 21 9:25:55 UTC 2016.</small>
</p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer>

View File

@ -517,7 +517,7 @@
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Wed Apr 20 13:45:11 UTC 2016.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Thu Apr 21 9:25:55 UTC 2016.</small>
</p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer>

View File

@ -214,7 +214,7 @@
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Wed Apr 20 13:45:11 UTC 2016.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Thu Apr 21 9:25:55 UTC 2016.</small>
</p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer>

View File

@ -350,7 +350,7 @@
<span class="success"><strong>High</strong>: 90% to 100%</span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Wed Apr 20 13:45:11 UTC 2016.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Thu Apr 21 9:25:55 UTC 2016.</small>
</p>
</footer>
</div>

View File

@ -315,7 +315,7 @@
<span class="warning"><strong>Dead Code</strong></span>
</p>
<p>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Wed Apr 20 13:45:11 UTC 2016.</small>
<small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.7</a> using <a href="http://php.net/" target="_top">PHP 5.6.11-1ubuntu3.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.6</a> at Thu Apr 21 9:25:55 UTC 2016.</small>
</p>
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
</footer>

View File

@ -34,22 +34,28 @@
<section data-timeline>
<h3 data-n='1'>Importer un journal d'appel</h3>
<span data-space></span>
<h4 data-icon='u'>
<input class='no-line' type='file' value='test'>
<input class='no-line' type='file' id='call_log-import' value='test'>
<span class='no-line file-input'>Importer un journal d'appels</span>
</h4>
<span data-tag='OU'></span>
<h3 data-n='2'>Saisir manuellement des contacts</h3>
<h4 data-icon='p'>Saisir un contact</h4>
<h5 data-text="Bonjour à tous, c'est moi!"></h5>
<h4 data-icon='p'>Saisir un contact</h4>
<h4 data-icon='p'>Saisir un contact</h4>
<h4 data-icon='a'>Ajouter un contact</h4>
<span data-space></span>
<!-- <span data-tag='OU'></span> -->
<h3 data-n='1'>Saisir manuellement des contacts</h3>
<span data-space></span>
<h5 data-text="Renseigner au moins un des nominatifs pour chaque contact. (pseudo, prénom et/ou nom)"></h5>
<h4 data-icon='p' class='new-contact'>
<input type='text' class='no-line number' placeholder='Numéro de téléphone'>
<input type='text' class='no-line username' placeholder='Pseudo'>
<input type='text' class='no-line firstname' placeholder='Prénom'>
<input type='text' class='no-line lastname' placeholder='Nom'>
<input type='submit' class='primary no-line sub-number' value='Valider'>
</h4>
<h4 data-icon='+' class='add-contact'>Ajouter un contact</h4>
<p>hi</p>
<p>FULL CSS BIATCH !!</p>
<span data-tag='ET'></span>
<!-- <span data-tag='ET'></span> -->
<h3 data-n='3'>Saisir les informations sur les contacts</h3>
<span data-tag='FIN'></span>
</section>
</section>

View File

@ -1 +1 @@
var fileInput=document.querySelector("input[type=file]");fileInput.addEventListener("change",function(b){api.send({path:"upload/call_log",file:fileInput.files[0]},function(a){console.log(a)})},!1);
var ic=new inputChecker,fileInput=document.querySelector('input#call_log-import[type="file"]');fileInput.addEventListener("change",function(a){api.send({path:"upload/call_log",file:fileInput.files[0]},function(a){console.log(a)})},!1);var number=document.querySelector('input.number[type="text"]');ic.append(number,format_number,"06 06 06 06 06");number.addEventListener("keyup",function(a){ic.correct(number,!1)},!1);

View File

@ -1,6 +1,9 @@
var fileInput = document.querySelector('input[type=file]');
// Vérifiera les input
var ic = new inputChecker();
var fileInput = document.querySelector('input#call_log-import[type="file"]');
fileInput.addEventListener('change', function(e){
/* (1) On rédige la requête */
@ -15,3 +18,17 @@ fileInput.addEventListener('change', function(e){
});
}, false);
var number = document.querySelector('input.number[type="text"]');
ic.append(number, format_number, '06 06 06 06 06');
// format_number -> format pour les numéros de téléphones
number.addEventListener('keyup', function(e){
ic.correct(number, false);
}, false);