diff --git a/0000 b/0000 index d0fb51e..93d9c44 100644 --- a/0000 +++ b/0000 @@ -1,5 +1,5 @@ Архивировать МАОН -0.2.0 +0.3.0 https://git.opengamestudio.org/kornerr/APXuBuPOBATb-MAOH /🏁.js diff --git a/🏁.js b/🏁.js index 11de248..fdae294 100644 --- a/🏁.js +++ b/🏁.js @@ -9,7 +9,7 @@ // How to create a file in memory for user to download, but not through server? // https://stackoverflow.com/a/18197341 var ссыль = document.createElement("a"); - ссыль.setAttribute("href", "data:text/html;charset=utf-8;base64," + мир.содержимоеАрхива); + ссыль.setAttribute("href", "data:application/zip;charset=utf-8;base64," + мир.содержимоеАрхива); var имя = "MAOH.zip"; ссыль.setAttribute("download", имя); ссыль.style.display = "none"; @@ -35,18 +35,22 @@ // // // // -СоздатьАрхивИзЗагруженныхМодулей = мир => +СоздатьАрхив = мир => { var архив = new JSZip(); + var корень = архив.folder("MAOH"); + корень.file("gitjs", мир.индекс); for (var н in мир.указателиМодулей) { var ук = мир.указателиМодулей[н]; - //var ук64 = мир.база64ИзДвоичногоМассива(new Uint8Array(содержимое)); - - var директория = архив.folder(ук); - директория.file("hello", "yohello"); + var м = мир.модули.модульПоУказателю(ук); + var директория = корень.folder(н); + for (var файл in м.структура) + { + var содержимое = м.содержимое[файл]; + директория.file(файл, содержимое); + } } - мир.архив = архив; }; @@ -54,6 +58,21 @@ // // // // +СоздатьИндексАрхива = мир => +{ + var индекс = ""; + for (var н in мир.указателиМодулей) + { + var ук = мир.указателиМодулей[н]; + индекс += `${н} ${ук}\n`; + } + мир.индекс = индекс; +}; + + +// // // // + + ЗагрузитьМодули = мир => { мир.модули.использовали.подписатьРаз(function() { diff --git a/🏁.череда b/🏁.череда index 6654e4a..1fa060b 100644 --- a/🏁.череда +++ b/🏁.череда @@ -5,7 +5,8 @@ вывести указатели модулей загрузить модули загрузили модули - создать архив из загруженных модулей + создать индекс архива + создать архив сгенерировать архив сгенерировали архив выдать архив на скачивание \ No newline at end of file diff --git a/📦 b/📦 index 2f5c5fd..98abb64 100644 --- a/📦 +++ b/📦 @@ -1,27 +1,5 @@ -# Список указателей на модули для загрузки во время пуска -# 启动时要加载的模块指针列表 -# List of module pointers to load at startup - -https://bitbucket.org/gitjs/jquery/raw/3.5.1/0000 -https://bitbucket.org/gitjs/uikit/raw/3.2.0/0000 -https://git.opengamestudio.org/mahjong/mahjong-raskladka-layout/raw/branch/master/0000 -https://git.opengamestudio.org/mahjong/povtorniy-repeating-ui/raw/branch/master/0000 +https://git.opengamestudio.org/BCE/jszip/raw/branch/master/0000 +# Из Рисователя берём Base64JS, да, косо-криво, лучше поменять. https://git.opengamestudio.org/PuCOBATEJlb/PuCOBATEJlb/raw/branch/master/0000 -https://git.opengamestudio.org/PuCOBATEJlb/PECYPCbl/raw/branch/master/0000 - -https://git.opengamestudio.org/MAOH/MEXMA/raw/branch/master/0000 -https://git.opengamestudio.org/MAOH/CEHMA/raw/branch/master/0000 -https://git.opengamestudio.org/MAOH/MOPMA/raw/branch/master/0000 -https://git.opengamestudio.org/MAOH/PEEMA/raw/branch/master/0000 -https://git.opengamestudio.org/MAOH/OTMA/raw/branch/master/0000 -https://git.opengamestudio.org/MAOH/CYMA/raw/branch/master/0000 - -https://git.opengamestudio.org/MAOH/TEMA_M1K/raw/branch/master/0000 -https://git.opengamestudio.org/MAOH/PACK_M1/raw/branch/master/0000 - -# Убрать после отладки -https://git.opengamestudio.org/MAOH/TEMA_OT/raw/branch/master/0000 -https://git.opengamestudio.org/MAOH/PACK_OT/raw/branch/master/0000 - diff --git a/🗄️.js b/🗄️.js index ad5cd73..9b35323 100644 --- a/🗄️.js +++ b/🗄️.js @@ -8,8 +8,7 @@ document.title = "🀄 Архивировать МАОН"; модуль.содержимое["/📦"] = ` https://git.opengamestudio.org/BCE/jszip/raw/branch/master/0000 -# Из Рисователя берём Base64JS, да, косо-криво, лучше поменять. -https://git.opengamestudio.org/PuCOBATEJlb/PuCOBATEJlb/raw/branch/master/0000 + `;