This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ======================================================================== | |
* DOM-based Routing | |
* Based on http://goo.gl/EUTi53 by Paul Irish | |
* ======================================================================== */ | |
(function () { | |
var SITE = { | |
'common': { | |
init: function () { | |
console.log('common'); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Detecte et affiche hauteur et largueur du périphérique. | |
* | |
* UTILISATION | |
* <body onresize="getScreenSize()"> | |
* <p id="screenSize"></p> | |
* // ... | |
* </body> | |
* | |
* @returns {undefined} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Permet de récupérer l'url racine du site | |
* @returns {getBaseURL.baseURL} | |
*/ | |
function getBaseURL() { | |
var url = location.href; | |
var baseURL = url.substring(0, url.indexOf('/', 14)); | |
if (baseURL.indexOf('http://localhost') !== -1) { | |
var pathname = location.pathname; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Formater les grands nombres pour les rendre lisibles | |
* | |
* @param {int|float} nbr Nombre a formater | |
* @returns {formatageGrandNombre.nombre|String} Le nombre formaté | |
*/ | |
function formatageGrandNombre(nbr) { | |
var retour = '', i, j = 0; | |
for (var i = nbr.length - 1; i >= 0; i--) { | |
if (j !== 0 && j % 3 === 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retourne et affiche le nombre d'exécution d'une fonction en une seconde | |
* Zone d'affichage : <div id="affichage"></div> | |
* | |
* @param {function} code a tester | |
* @returns {undefined} | |
*/ | |
function compteExec(fonction) { | |
var tps = 0, start = new Date().getTime(), i = 0; | |
while (tps <= 1000) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table> | |
<thead> | |
<tr> | |
<th>Payment</th> | |
<th>Issue Date</th> | |
<th>Amount</th> | |
<th>Period</th> | |
</tr> | |
</thead> | |
<tbody> |