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

This commit is contained in:
Главред | Glavred
2021-01-19 16:13:28 +03:00
parent 478dbfac0e
commit c28cf1270a
9 changed files with 208 additions and 231 deletions

130
🏁.js Normal file
View File

@@ -0,0 +1,130 @@
// // // //
ВыдатьАрхивНаСкачивание = мир =>
{
// 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," + мир.содержимоеАрхива);
var имя = "MAOH.zip";
ссыль.setAttribute("download", имя);
ссыль.style.display = "none";
document.body.appendChild(ссыль);
ссыль.click();
document.body.removeChild(ссыль);
};
// // // //
СгенерироватьАрхив = мир =>
{
мир.архив.generateAsync({type: "base64"}).then(function(content) {
мир.содержимоеАрхива = content;
console.debug("мир.содержимоеАрхива", мир.содержимоеАрхива);
мир.уведомить("сгенерировали архив");
});
};
// // // //
СоздатьАрхивИзЗагруженныхМодулей = мир =>
{
var архив = new JSZip();
for (var н in мир.указателиМодулей)
{
var ук = мир.указателиМодулей[н];
//var ук64 = мир.база64ИзДвоичногоМассива(new Uint8Array(содержимое));
var директория = архив.folder(ук);
директория.file("hello", "yohello");
}
мир.архив = архив;
};
// // // //
ЗагрузитьМодули = мир =>
{
мир.модули.использовали.подписатьРаз(function() {
мир.уведомить("загрузили модули");
});
мир.модули.использовать(мир.указателиМодулей);
};
// // // //
ВывестиУказателиМодулей = мир =>
{
console.debug("указатели модулей:", мир.указателиМодулей);
};
// // // //
РазобратьСписокМодулей = мир =>
{
var указатели = [];
var строки = мир.списокМодулей.split(/\n/);
for (var номер in строки)
{
var строка = строки[номер].trim();
if (!строка.startsWith("#") && строка.length)
{
указатели.push(строка);
}
}
мир.указателиМодулей = указатели;
};
// // // //
ЗадатьСписокМодулей = мир =>
{
мир.списокМодулей = `
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/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
`;
};
// // // //
СкрытьКрутилку = мир =>
{
document.getElementById("крутилка").style.display = "none";
};