Update [public_html/js/lib/reset.js]

This commit is contained in:
xdrm-brackets 2016-10-05 10:06:51 +02:00
parent 0ffc6fb30c
commit e76be22f99
12 changed files with 138 additions and 38 deletions

View File

@ -1,5 +1,24 @@
body {
background-color: #ccc;
font-family: 'Open Sans';
}
/*# sourceMappingURL=data:application/json;base64,ewoJInZlcnNpb24iOiAzLAoJImZpbGUiOiAibGF5b3V0LmNzcyIsCgkic291cmNlcyI6IFsKCQkiLi4vbGF5b3V0LnNjc3MiCgldLAoJInNvdXJjZXNDb250ZW50IjogWwoJCSJib2R5e1xuXHRiYWNrZ3JvdW5kLWNvbG9yOiAjY2NjO1xufVxuIgoJXSwKCSJtYXBwaW5ncyI6ICJBQUFBLEFBQUEsSUFBSSxDQUFBO0VBQ0gsZ0JBQWdCLEVBQUUsSUFBSztDQUN2QiIsCgkibmFtZXMiOiBbXQp9 */
#image {
display: block;
position: relative;
width: calc( 300px - 2*2px);
height: calc( 300px - 2*2px);
margin: 20px;
border: 2px solid #000;
}
#log {
display: block;
position: relative;
width: calc( 300px - 2*2px - 2*10px);
margin: 10px 20px;
padding: 10px;
border: 2px solid #555;
}
/*# sourceMappingURL=data:application/json;base64,ewoJInZlcnNpb24iOiAzLAoJImZpbGUiOiAibGF5b3V0LmNzcyIsCgkic291cmNlcyI6IFsKCQkiLi4vbGF5b3V0LnNjc3MiCgldLAoJInNvdXJjZXNDb250ZW50IjogWwoJCSIkaW1hZ2Utc2l6ZTogMzAwcHg7XG5cblxuYm9keXtcblx0YmFja2dyb3VuZC1jb2xvcjogI2NjYztcblxuXHRmb250LWZhbWlseTogJ09wZW4gU2Fucyc7XG59XG5cblxuXG4jaW1hZ2V7XG5cdGRpc3BsYXk6IGJsb2NrO1xuXHRwb3NpdGlvbjogcmVsYXRpdmU7XG5cdFx0d2lkdGg6IGNhbGMoICN7JGltYWdlLXNpemV9IC0gMioycHggKTtcblx0XHRoZWlnaHQ6IGNhbGMoICN7JGltYWdlLXNpemV9IC0gMioycHggKTtcblxuXHRtYXJnaW46IDIwcHg7XG5cblx0Ym9yZGVyOiAycHggc29saWQgIzAwMDtcbn1cblxuXG4jbG9ne1xuXHRkaXNwbGF5OiBibG9jaztcblx0cG9zaXRpb246IHJlbGF0aXZlO1xuXHRcdHdpZHRoOiBjYWxjKCAjeyRpbWFnZS1zaXplfSAtIDIqMnB4IC0gMioxMHB4ICk7XG5cblx0bWFyZ2luOiAxMHB4IDIwcHg7XG5cdHBhZGRpbmc6IDEwcHg7XG5cblx0Ym9yZGVyOiAycHggc29saWQgIzU1NTtcblxufVxuIgoJXSwKCSJtYXBwaW5ncyI6ICJBQUdBLEFBQUEsSUFBSSxDQUFBO0VBQ0gsZ0JBQWdCLEVBQUUsSUFBSztFQUV2QixXQUFXLEVBQUUsV0FBWTtDQUN6Qjs7QUFJRCxBQUFBLE1BQU0sQ0FBQTtFQUNMLE9BQU8sRUFBRSxLQUFNO0VBQ2YsUUFBUSxFQUFFLFFBQVM7RUFDbEIsS0FBSyxFQUFFLG9CQUFJO0VBQ1gsTUFBTSxFQUFFLG9CQUFJO0VBRWIsTUFBTSxFQUFFLElBQUs7RUFFYixNQUFNLEVBQUUsY0FBZTtDQUN2Qjs7QUFHRCxBQUFBLElBQUksQ0FBQTtFQUNILE9BQU8sRUFBRSxLQUFNO0VBQ2YsUUFBUSxFQUFFLFFBQVM7RUFDbEIsS0FBSyxFQUFFLDZCQUFJO0VBRVosTUFBTSxFQUFFLFNBQVU7RUFDbEIsT0FBTyxFQUFFLElBQUs7RUFFZCxNQUFNLEVBQUUsY0FBZTtDQUV2QiIsCgkibmFtZXMiOiBbXQp9 */

View File

@ -5,8 +5,8 @@
"../layout.scss"
],
"sourcesContent": [
"body{\n\tbackground-color: #ccc;\n}\n"
"$image-size: 300px;\n\n\nbody{\n\tbackground-color: #ccc;\n\n\tfont-family: 'Open Sans';\n}\n\n\n\n#image{\n\tdisplay: block;\n\tposition: relative;\n\t\twidth: calc( #{$image-size} - 2*2px );\n\t\theight: calc( #{$image-size} - 2*2px );\n\n\tmargin: 20px;\n\n\tborder: 2px solid #000;\n}\n\n\n#log{\n\tdisplay: block;\n\tposition: relative;\n\t\twidth: calc( #{$image-size} - 2*2px - 2*10px );\n\n\tmargin: 10px 20px;\n\tpadding: 10px;\n\n\tborder: 2px solid #555;\n\n}\n"
],
"mappings": "AAAA,AAAA,IAAI,CAAA;EACH,gBAAgB,EAAE,IAAK;CACvB",
"mappings": "AAGA,AAAA,IAAI,CAAA;EACH,gBAAgB,EAAE,IAAK;EAEvB,WAAW,EAAE,WAAY;CACzB;;AAID,AAAA,MAAM,CAAA;EACL,OAAO,EAAE,KAAM;EACf,QAAQ,EAAE,QAAS;EAClB,KAAK,EAAE,oBAAI;EACX,MAAM,EAAE,oBAAI;EAEb,MAAM,EAAE,IAAK;EAEb,MAAM,EAAE,cAAe;CACvB;;AAGD,AAAA,IAAI,CAAA;EACH,OAAO,EAAE,KAAM;EACf,QAAQ,EAAE,QAAS;EAClB,KAAK,EAAE,6BAAI;EAEZ,MAAM,EAAE,SAAU;EAClB,OAAO,EAAE,IAAK;EAEd,MAAM,EAAE,cAAe;CAEvB",
"names": []
}

View File

@ -1,3 +1,34 @@
$image-size: 300px;
body{
background-color: #ccc;
font-family: 'Open Sans';
}
#image{
display: block;
position: relative;
width: calc( #{$image-size} - 2*2px );
height: calc( #{$image-size} - 2*2px );
margin: 20px;
border: 2px solid #000;
}
#log{
display: block;
position: relative;
width: calc( #{$image-size} - 2*2px - 2*10px );
margin: 10px 20px;
padding: 10px;
border: 2px solid #555;
}

View File

@ -1,3 +1,3 @@
body{background-color:#ccc}
body{background-color:#ccc;font-family:'Open Sans'}#image{display:block;position:relative;width:calc( 300px - 2*2px);height:calc( 300px - 2*2px);margin:20px;border:2px solid #000}#log{display:block;position:relative;width:calc( 300px - 2*2px - 2*10px);margin:10px 20px;padding:10px;border:2px solid #555}
/*# sourceMappingURL=data:application/json;base64,ewoJInZlcnNpb24iOiAzLAoJImZpbGUiOiAibGF5b3V0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BLENBQ0gsZ0JBQWdCLENBQUUsSUFBSyxDQUV2QixXQUFXLENBQUUsV0FBWSxDQUN6QixBQUlELEFBQUEsTUFBTSxBQUFBLENBQ0wsT0FBTyxDQUFFLEtBQU0sQ0FDZixRQUFRLENBQUUsUUFBUyxDQUNsQixLQUFLLENBQUUsb0JBQUksQ0FDWCxNQUFNLENBQUUsb0JBQUksQ0FFYixNQUFNLENBQUUsSUFBSyxDQUViLE1BQU0sQ0FBRSxjQUFlLENBQ3ZCLEFBR0QsQUFBQSxJQUFJLEFBQUEsQ0FDSCxPQUFPLENBQUUsS0FBTSxDQUNmLFFBQVEsQ0FBRSxRQUFTLENBQ2xCLEtBQUssQ0FBRSw2QkFBSSxDQUVaLE1BQU0sQ0FBRSxTQUFVLENBQ2xCLE9BQU8sQ0FBRSxJQUFLLENBRWQsTUFBTSxDQUFFLGNBQWUsQ0FFdkIiLAoJIm5hbWVzIjogW10KfQ== */

View File

@ -5,8 +5,8 @@
"../layout.scss"
],
"sourcesContent": [
"body{\n\tbackground-color: #ccc;\n}\n"
"$image-size: 300px;\n\n\nbody{\n\tbackground-color: #ccc;\n\n\tfont-family: 'Open Sans';\n}\n\n\n\n#image{\n\tdisplay: block;\n\tposition: relative;\n\t\twidth: calc( #{$image-size} - 2*2px );\n\t\theight: calc( #{$image-size} - 2*2px );\n\n\tmargin: 20px;\n\n\tborder: 2px solid #000;\n}\n\n\n#log{\n\tdisplay: block;\n\tposition: relative;\n\t\twidth: calc( #{$image-size} - 2*2px - 2*10px );\n\n\tmargin: 10px 20px;\n\tpadding: 10px;\n\n\tborder: 2px solid #555;\n\n}\n"
],
"mappings": "AAAA,AAAA,IAAI,AAAA,CACH,gBAAgB,CAAE,IAAK,CACvB",
"mappings": "AAGA,AAAA,IAAI,AAAA,CACH,gBAAgB,CAAE,IAAK,CAEvB,WAAW,CAAE,WAAY,CACzB,AAID,AAAA,MAAM,AAAA,CACL,OAAO,CAAE,KAAM,CACf,QAAQ,CAAE,QAAS,CAClB,KAAK,CAAE,oBAAI,CACX,MAAM,CAAE,oBAAI,CAEb,MAAM,CAAE,IAAK,CAEb,MAAM,CAAE,cAAe,CACvB,AAGD,AAAA,IAAI,AAAA,CACH,OAAO,CAAE,KAAM,CACf,QAAQ,CAAE,QAAS,CAClB,KAAK,CAAE,6BAAI,CAEZ,MAAM,CAAE,SAAU,CAClB,OAAO,CAAE,IAAK,CAEd,MAAM,CAAE,cAAe,CAEvB",
"names": []
}

View File

@ -15,12 +15,17 @@
<!-- Dépendences Javascript -->
<script type='text/javascript' src='./js/lib/min/reset.js' ></script> <!-- Corrections Javascript natif (ajouts) -->
<script type='text/javascript' src='./js/lib/min/ajax.js' ></script> <!-- Gestion des requetes ajax -->
<script type='text/javascript' src='./js/lib/image-loader.js' ></script> <!-- Gestion du chargement d'image -->
<script type='text/javascript' src='./js/lib/local.js' ></script> <!-- Lib locale -->
</head>
<body>
<img id='image'/>
<div id='log'>
<span>asds</span>
</div>
<!-- Dépendences Javascript après chargement des éléments -->
<script type='text/javascript' src='./js/action-script.js'></script>

View File

@ -0,0 +1,58 @@
/***************************************/
/* */
/* GESTIONNAIRE D'OPTIMISATION DES */
/* RESSOURCES ET DE */
/* NAVIGATION EN AJAX */
/* */
/* Développé par {xdrm} */
/* */
/* GITHUB github.com/xdrm-brackets/ */
/* */
/***************************************/
var AjaxManager = function(){};
AjaxManager.prototype = {
xhr: [], // tableau d'objets pour les requêtes ajax
/* =======================================================================
Cette fonction effectue une requête Ajax (compatible à partir de IE5)
PARAMETRES:
- pLink<string> le lien à charger
- pHandler<function> une fonction qui s'éxécutera avec la réponse de la requête passée en paramètre (voir exemples dessous pour pHandler)
- pMethod<string> type de méthode, vaut 'POST' ou 'GET' et vaut 'POST' par défaut ou s'il n'est pas renseigné
- pForm<FormData> formulaire de type FormData() contenant les données à envoyer (uniquement en POST), si pForm vaut GET les données doivent être passées dans l'URL
========================================================================== */
send: function(pLink, pHandler, pMethod, pForm){
// on efface les requêtes qui sont terminées et on push une nouvelle
for( var i = 0 ; i < this.xhr.length ; i++ ){
// if( this.xhr[i].readyState == 4 ) // si terminée
this.xhr = this.xhr.slice(0,i-1).concat(this.xhr.slice(i,this.xhr.length-1)); // suppression entrée
}
var index = this.xhr.push( (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHttpRequest') ) -1;
this.xhr[index].onreadystatechange = (function(){
if( this.xhr[index].readyState == 4 ){ // si la requête est terminée
if( [0,200].indexOf(this.xhr[index].status) > -1 ) // si fichier existe et reçu
pHandler(this.xhr[index].responseText);
else // si code d'erreur retourne null
pHandler();
}
}).bind(this);
// gestion de la méthode
var method = ( typeof pMethod == 'string' && /^POST|GET$/i.test(pMethod) ) ? pMethod.toUpperCase() : 'POST';
// gestion du formulaire si la méthode est POST
var form = ( method == 'POST' && typeof pForm == 'object' && pForm instanceof FormData ) ? pForm : null;
this.xhr[index].open( method, pLink, true );
this.xhr[index].send( form );
return this;
}
};

View File

@ -0,0 +1,8 @@
/* LOG UNE ACTION
*
* @message<String> Appends the message to the log history
*
*/
var log = function(message){
};

View File

@ -0,0 +1,3 @@
var AjaxManager=function(){};
AjaxManager.prototype={xhr:[],send:function(f,e,a,c){for(var d=0;d<this.xhr.length;d++)this.xhr=this.xhr.slice(0,d-1).concat(this.xhr.slice(d,this.xhr.length-1));var b=this.xhr.push(window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHttpRequest"))-1;this.xhr[b].onreadystatechange=function(){4==this.xhr[b].readyState&&(-1<[0,200].indexOf(this.xhr[b].status)?e(this.xhr[b].responseText):e())}.bind(this);a="string"==typeof a&&/^POST|GET$/i.test(a)?a.toUpperCase():"POST";c="POST"==
a&&"object"==typeof c&&c instanceof FormData?c:null;this.xhr[b].open(a,f,!0);this.xhr[b].send(c);return this}};

View File

@ -0,0 +1 @@
var log=function(a){};

View File

@ -1,2 +1,2 @@
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 format_code;try{format_code=new formatChecker(null,"HH-HH-HH-HH",{H:"[0-9A-F]"})}catch(a){console.warn(a)};
var $=function(a){return document.querySelector(a)},$$=function(a){return document.querySelectorAll(a)};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)};

View File

@ -1,18 +1,7 @@
/* SELECTEUR SIMPLIFIE
*
* @ifOrClass<String> L'id ou la classe de l'element cible
*
* @return element<Element> Retourne l'element de cet ID ou cette classe si trouve
* @return null Retourne null si rien n'est trouve
*
/* SELECTEUR CSS UNIQUE/MULTIPLE
*/
function $(idOrClass){
var byId = document.querySelectorAll('#'+idOrClass);
var byClass = document.querySelectorAll('.'+idOrClass);
if( byId.length > 0 ) return byId[0];
else return byClass[0];
}
var $ = function(selector){ return document.querySelector(selector ); };
var $$ = function(selector){ return document.querySelectorAll(selector); };
/* Retourne un data-* attribute d'un element (surcharge de l'ELEMENT natif)
@ -103,17 +92,3 @@ Element.prototype.anim = function(className, timeout){
setTimeout(function(){ pointer.remClass(className); }, timeout);
};
/* DEFINITION DES FORMATS UTILES POUR INPUT-CHECKER
*
*/
var format_code;
try{
format_code = new formatChecker(null, 'HH-HH-HH-HH', { 'H' : '[0-9A-F]'} );
}catch(e){
console.warn(e);
}