Изменения от Главреда ГитЖС | Changes of GitJS Glavred

This commit is contained in:
Главред | Glavred
2021-01-20 14:15:50 +03:00
parent c28cf1270a
commit 517b73e6cd
5 changed files with 32 additions and 35 deletions

2
0000
View File

@@ -1,5 +1,5 @@
Архивировать МАОН Архивировать МАОН
0.2.0 0.3.0
https://git.opengamestudio.org/kornerr/APXuBuPOBATb-MAOH https://git.opengamestudio.org/kornerr/APXuBuPOBATb-MAOH
/🏁.js /🏁.js

33
🏁.js
View File

@@ -9,7 +9,7 @@
// How to create a file in memory for user to download, but not through server? // How to create a file in memory for user to download, but not through server?
// https://stackoverflow.com/a/18197341 // https://stackoverflow.com/a/18197341
var ссыль = document.createElement("a"); 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"; var имя = "MAOH.zip";
ссыль.setAttribute("download", имя); ссыль.setAttribute("download", имя);
ссыль.style.display = "none"; ссыль.style.display = "none";
@@ -35,18 +35,22 @@
// // // // // // // //
СоздатьАрхивИзЗагруженныхМодулей = мир => СоздатьАрхив = мир =>
{ {
var архив = new JSZip(); var архив = new JSZip();
var корень = архив.folder("MAOH");
корень.file("gitjs", мир.индекс);
for (var н in мир.указателиМодулей) for (var н in мир.указателиМодулей)
{ {
var ук = мир.указателиМодулей[н]; var ук = мир.указателиМодулей[н];
//var ук64 = мир.база64ИзДвоичногоМассива(new Uint8Array(содержимое)); var м = мир.модули.модульПоУказателю(ук);
var директория = корень.folder(н);
var директория = архив.folder(ук); for (var файл in м.структура)
директория.file("hello", "yohello"); {
var содержимое = м.содержимое[файл];
директория.file(файл, содержимое);
}
} }
мир.архив = архив; мир.архив = архив;
}; };
@@ -54,6 +58,21 @@
// // // // // // // //
СоздатьИндексАрхива = мир =>
{
var индекс = "";
for (var н in мир.указателиМодулей)
{
var ук = мир.указателиМодулей[н];
индекс += `${н} ${ук}\n`;
}
мир.индекс = индекс;
};
// // // //
ЗагрузитьМодули = мир => ЗагрузитьМодули = мир =>
{ {
мир.модули.использовали.подписатьРаз(function() { мир.модули.использовали.подписатьРаз(function() {

View File

@@ -5,7 +5,8 @@
вывести указатели модулей вывести указатели модулей
загрузить модули загрузить модули
загрузили модули загрузили модули
создать архив из загруженных модулей создать индекс архива
создать архив
сгенерировать архив сгенерировать архив
сгенерировали архив сгенерировали архив
выдать архив на скачивание выдать архив на скачивание

26
📦
View File

@@ -1,27 +1,5 @@
# Список указателей на модули для загрузки во время пуска https://git.opengamestudio.org/BCE/jszip/raw/branch/master/0000
# 启动时要加载的模块指针列表 # Из Рисователя берём Base64JS, да, косо-криво, лучше поменять.
# 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/PuCOBATEJlb/PuCOBATEJlb/raw/branch/master/0000 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

View File

@@ -8,8 +8,7 @@ document.title = "🀄 Архивировать МАОН";
модуль.содержимое["/📦"] = ` модуль.содержимое["/📦"] = `
https://git.opengamestudio.org/BCE/jszip/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
`; `;