Изменения от Главреда ГитЖС | 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
/🏁.js

33
🏁.js
View File

@@ -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() {

View File

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

26
📦
View File

@@ -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

View File

@@ -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
`;