|
|
Line 1: |
Line 1: |
− | <html>
| |
− | <script src="http://stuk.github.io/jszip/dist/jszip.js"></script>
| |
− | <script src="http://stuk.github.io/jszip/vendor/FileSaver.js"></script>
| |
− | <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
| |
− | <script>
| |
− | var _create_zip_format = function(src, id) {
| |
− | // create zip file from src
| |
− | // and insert content
| |
− |
| |
− | var xhttp = new XMLHttpRequest();
| |
− | xhttp.onreadystatechange = function() {
| |
− | if (this.readyState == 4) {
| |
− | if(this.status == 200){
| |
− | response = JSON.parse(this.responseText);
| |
| | | |
− |
| |
− |
| |
− | var weights_name = Object.keys(response);
| |
− |
| |
− |
| |
− | for(var i=0; i<weights_name.length; i++) {
| |
− | var ref_to_link = response[weights_name[i]].filename;
| |
− | response[weights_name[i]].shape;
| |
− | console.log(ref_to_link);
| |
− | /*
| |
− | var oReq = new XMLHttpRequest();
| |
− | oReq.open("GET", ref_to_link , true);
| |
− | oReq.responseType = "arraybuffer";
| |
− |
| |
− | oReq.onload = function(oEvent) {
| |
− | console.log(oEvent);
| |
− | var arraybuffer = oReq.reponse;
| |
− | if(arrayBuffer) {
| |
− | console.log(arraybuffer);
| |
− | /*zip.file(weigths_name[i], arraybuffer); */
| |
− | }
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− |
| |
− | }
| |
− |
| |
− |
| |
− |
| |
− | }
| |
− | }
| |
− | xhttp.open("GET", src, true);
| |
− | xhttp.send();
| |
− | }
| |
− |
| |
− |
| |
− |
| |
− | _create_zip_format('https://2017.igem.org/Team:Heidelberg/manifest_json?action=raw', 'id');
| |
− | </script>
| |
− | </html>
| |