Gestion du chargement d'image [public_html/js/lib/image-loader.js]

This commit is contained in:
xdrm-brackets 2016-10-05 10:47:05 +02:00
parent b6b0c0644a
commit 6fcebb6d87
15 changed files with 55 additions and 18 deletions

View File

@ -1,6 +1,7 @@
body {
background-color: #ccc;
font-family: 'Open Sans';
font-size: 15px;
}
#image {
@ -21,4 +22,8 @@ body {
border: 2px solid #555;
}
/*# sourceMappingURL=data:application/json;base64,ewoJInZlcnNpb24iOiAzLAoJImZpbGUiOiAibGF5b3V0LmNzcyIsCgkic291cmNlcyI6IFsKCQkiLi4vbGF5b3V0LnNjc3MiCgldLAoJInNvdXJjZXNDb250ZW50IjogWwoJCSIkaW1hZ2Utc2l6ZTogMzAwcHg7XG5cblxuYm9keXtcblx0YmFja2dyb3VuZC1jb2xvcjogI2NjYztcblxuXHRmb250LWZhbWlseTogJ09wZW4gU2Fucyc7XG59XG5cblxuXG4jaW1hZ2V7XG5cdGRpc3BsYXk6IGJsb2NrO1xuXHRwb3NpdGlvbjogcmVsYXRpdmU7XG5cdFx0d2lkdGg6IGNhbGMoICN7JGltYWdlLXNpemV9IC0gMioycHggKTtcblx0XHRoZWlnaHQ6IGNhbGMoICN7JGltYWdlLXNpemV9IC0gMioycHggKTtcblxuXHRtYXJnaW46IDIwcHg7XG5cblx0Ym9yZGVyOiAycHggc29saWQgIzAwMDtcbn1cblxuXG4jbG9ne1xuXHRkaXNwbGF5OiBibG9jaztcblx0cG9zaXRpb246IHJlbGF0aXZlO1xuXHRcdHdpZHRoOiBjYWxjKCAjeyRpbWFnZS1zaXplfSAtIDIqMnB4IC0gMioxMHB4ICk7XG5cblx0bWFyZ2luOiAxMHB4IDIwcHg7XG5cdHBhZGRpbmc6IDEwcHg7XG5cblx0Ym9yZGVyOiAycHggc29saWQgIzU1NTtcblxufVxuIgoJXSwKCSJtYXBwaW5ncyI6ICJBQUdBLEFBQUEsSUFBSSxDQUFBO0VBQ0gsZ0JBQWdCLEVBQUUsSUFBSztFQUV2QixXQUFXLEV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XHRwb3NpdGlvbjogcmVsYXRpdmU7XG5cdFx0d2lkdGg6IGNhbGMoICN7JGltYWdlLXNpemV9IC0gMioycHggLSAyKjEwcHggKTtcblxuXHRtYXJnaW46IDEwcHggMjBweDtcblx0cGFkZGluZzogMTBweDtcblxuXHRib3JkZXI6IDJweCBzb2xpZCAjNTU1O1xuXG5cdHNwYW57XG5cdFx0ZGlzcGxheTogYmxvY2s7XG5cdH1cblxufVxuIgoJXSwKCSJtYXBwaW5ncyI6ICJBQUdBLEFBQUEsSUFBSSxDQUFBO0VBQ0gsZ0JBQWdCLEVBQUUsSUFBSztFQUV2QixXQUFXLEVBQUUsV0FBWTtFQUN6QixTQUFTLEVBQUUsSUFBSztDQUNoQjs7QUFJRCxBQUFBLE1BQU0sQ0FBQTtFQUNMLE9BQU8sRUFBRSxLQUFNO0VBQ2YsUUFBUSxFQUFFLFFBQVM7RUFDbEIsS0FBSyxFQUFFLG9CQUFJO0VBQ1gsTUFBTSxFQUFFLG9CQUFJO0VBRWIsTUFBTSxFQUFFLElBQUs7RUFFYixNQUFNLEVBQUUsY0FBZTtDQUN2Qjs7QUFHRCxBQUFBLElBQUksQ0FBQTtFQUNILE9BQU8sRUFBRSxLQUFNO0VBQ2YsUUFBUSxFQUFFLFFBQVM7RUFDbEIsS0FBSyxFQUFFLDZCQUFJO0VBRVosTUFBTSxFQUFFLFNBQVU7RUFDbEIsT0FBTyxFQUFFLElBQUs7RUFFZCxNQUFNLEVBQUUsY0FBZTtDQU12Qjs7QUFkRCxBQVVDLElBVkcsQ0FVSCxJQUFJLENBQUE7RUFDSCxPQUFPLEVBQUUsS0FBTTtDQUNmIiwKCSJuYW1lcyI6IFtdCn0= */

View File

@ -5,8 +5,8 @@
"../layout.scss"
],
"sourcesContent": [
"$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"
"$image-size: 300px;\n\n\nbody{\n\tbackground-color: #ccc;\n\n\tfont-family: 'Open Sans';\n\tfont-size: 15px;\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\tspan{\n\t\tdisplay: block;\n\t}\n\n}\n"
],
"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",
"mappings": "AAGA,AAAA,IAAI,CAAA;EACH,gBAAgB,EAAE,IAAK;EAEvB,WAAW,EAAE,WAAY;EACzB,SAAS,EAAE,IAAK;CAChB;;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;CAMvB;;AAdD,AAUC,IAVG,CAUH,IAAI,CAAA;EACH,OAAO,EAAE,KAAM;CACf",
"names": []
}

View File

@ -5,6 +5,7 @@ body{
background-color: #ccc;
font-family: 'Open Sans';
font-size: 15px;
}
@ -31,4 +32,8 @@ body{
border: 2px solid #555;
span{
display: block;
}
}

View File

@ -1,3 +1,3 @@
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}
body{background-color:#ccc;font-family:'Open Sans';font-size:15px}#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}#log span{display:block}
/*# sourceMappingURL=data:application/json;base64,ewoJInZlcnNpb24iOiAzLAoJImZpbGUiOiAibGF5b3V0LmNzcyIsCgkic291cmNlcyI6IFsKCQkiLi4vbGF5b3V0LnNjc3MiCgldLAoJInNvdXJjZXNDb250ZW50IjogWwoJCSIkaW1hZ2Utc2l6ZTogMzAwcHg7XG5cblxuYm9keXtcblx0YmFja2dyb3VuZC1jb2xvcjogI2NjYztcblxuXHRmb250LWZhbWlseTogJ09wZW4gU2Fucyc7XG59XG5cblxuXG4jaW1hZ2V7XG5cdGRpc3BsYXk6IGJsb2NrO1xuXHRwb3NpdGlvbjogcmVs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0sQ0FBRSxjQUFlLENBQ3ZCLEFBR0QsQUFBQSxJQUFJLEFBQUEsQ0FDSCxPQUFPLENBQUUsS0FBTSxDQUNmLFFBQVEsQ0FBRSxRQUFTLENBQ2xCLEtBQUssQ0FBRSw2QkFBSSxDQUVaLE1BQU0sQ0FBRSxTQUFVLENBQ2xCLE9BQU8sQ0FBRSxJQUFLLENBRWQsTUFBTSxDQUFFLGNBQWUsQ0FNdkIsQUFkRCxBQVVDLElBVkcsQ0FVSCxJQUFJLEFBQUEsQ0FDSCxPQUFPLENBQUUsS0FBTSxDQUNmIiwKCSJuYW1lcyI6IFtdCn0= */

View File

@ -5,8 +5,8 @@
"../layout.scss"
],
"sourcesContent": [
"$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"
"$image-size: 300px;\n\n\nbody{\n\tbackground-color: #ccc;\n\n\tfont-family: 'Open Sans';\n\tfont-size: 15px;\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\tspan{\n\t\tdisplay: block;\n\t}\n\n}\n"
],
"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",
"mappings": "AAGA,AAAA,IAAI,AAAA,CACH,gBAAgB,CAAE,IAAK,CAEvB,WAAW,CAAE,WAAY,CACzB,SAAS,CAAE,IAAK,CAChB,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,CAMvB,AAdD,AAUC,IAVG,CAUH,IAAI,AAAA,CACH,OAAO,CAAE,KAAM,CACf",
"names": []
}

View File

@ -14,8 +14,8 @@
<!-- 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/reset.js' ></script> <!-- Corrections Javascript natif (ajouts) -->
<script type='text/javascript' src='./js/lib/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 -->
@ -23,9 +23,8 @@
<body>
<img id='image'/>
<div id='log'>
<span>asds</span>
</div>
<div id='log'></div>
<!-- Dépendences Javascript après chargement des éléments -->
<script type='text/javascript' src='./js/action-script.js'></script>

View File

@ -1,3 +1,3 @@
var DOM = {
body: document.body
body: $('body')
};

View File

@ -56,3 +56,5 @@ AjaxManager.prototype = {
};
var AJAX = new AjaxManager();

View File

@ -0,0 +1,20 @@
/* CONSTRUCTEUR
*/
var ImageLoader = function(imageElement){
/* [0] Initialisation + paramètres
=========================================================*/
this.wrapper = (imageElement instanceof HTMLImageElement) ? imageElement : null;
if( !this.wrapper )
throw new Error('Param 1 expected to be an HTMLImageElement (<img>), but '+imageElement.constructor.name+' received');
/* [1] Chargement du tree d'images
=========================================================*/
this.treeLoaded = false;
AJAX.send('./pictures/index.php', (function(response){
this.treeLoaded = true;
console.log( JSON.parse(response) );
}).bind(this), 'GET');
};

View File

@ -3,6 +3,11 @@
* @message<String> Appends the message to the log history
*
*/
var logs = [];
var log = function(message){
var index = logs.push( document.createElement('span') ) - 1;
logs[index].innerHTML = message;
$('body > div#log').appendChild( logs[index] );
};

View File

@ -1,3 +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}};
a&&"object"==typeof c&&c instanceof FormData?c:null;this.xhr[b].open(a,f,!0);this.xhr[b].send(c);return this}};var AJAX=new AjaxManager;

View File

@ -0,0 +1 @@
var ImageLoader=function(a){this.wrapper=a instanceof HTMLImageElement?a:null;if(!this.wrapper)throw Error("Param 1 expected to be an HTMLImageElement (<img>), but "+a.constructor.name+" received");this.treeLoaded=!1;AJAX.send("./pictures/index.php",function(a){this.treeLoaded=!0;console.log(JSON.parse(a))}.bind(this),"GET")};

View File

@ -1 +1 @@
var log=function(a){};
var logs=[],log=function(b){var a=logs.push(document.createElement("span"))-1;logs[a].innerHTML=b;$("body > div#log").appendChild(logs[a])};

View File

@ -1 +1 @@
var DOM={body:document.body};
var DOM={body:$("body")};

View File

@ -38,7 +38,7 @@
$fetched[$fname] = getImages($element);
// {2} If not picture -> unset //
else if( !preg_match($checker, $fname) )
else if( preg_match("/\.(jpg|jpeg|png)$/", $fname) )
$fetched[] = $fname;
}