Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static/examples/addIssue/addIssue.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>Добавление страницы комикса</h1>

<p>Идентификатор комикса: <input type="text" name="serialId" value="13379"></p>

<p>Изображдение: <input name="image" type="file" data-limit="2097152"></p>
<p>Изображдение: <input name="image" type="file" data-limit="2097152" class="imgs"></p>

<button type="submit">Загрузить</button>

Expand Down
7 changes: 7 additions & 0 deletions static/examples/addIssue/addIssue.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

form.addEventListener('submit', async (evt) => {
evt.preventDefault();
const input = document.querySelector('.imgs');
const file = input.files;

let list = new DataTransfer();
list.items.add(file[0]);
input.files = list.files;
console.log(evt.target);
const response = await window.acomicsLegacyClient.sendFormAndParseHtml(evt.target);
console.log(response);
});
Expand Down
1 change: 1 addition & 0 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ <h2>Примеры:</h2>
<ul>
<li><a href="/examples/editCategories/editCategories.html">Изменение категорий комикса</a></li>
<li><a href="/examples/addIssue/addIssue.html">Добавление страницы комикса</a></li>
<li><a href="/upload_module/template.html">Модуль добавления нескольких страниц</a></li>
</ul>

</body>
Expand Down
4 changes: 3 additions & 1 deletion static/js/devServerUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
const response = await window.acomicsLegacyClient.sendFormAndParseHtml(form);
const errorSection = response.querySelector('div#error');
if (errorSection === null) {
console.log("awwgfawgaw");
const username = form.username.value;
initAuthPanel(username);
await initAuthPanel(username);
} else {
console.log("llwalflawfl")
console.log(errorSection);
alert('Ошибка авторизации. См. детали в консоли.');
}
Expand Down
2 changes: 2 additions & 0 deletions static/js/legacyClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
const proxifyPath = (path) => isDevServer() ? PROXY_PREFIX + path : path;

const fetchAndParseHtml = async (path, init) => {
console.log(proxifyPath(path), init)
const response = await fetch(proxifyPath(path), init);
console.log(proxifyPath(path), init, response)
const responseText = await response.text();
return domParser.parseFromString(responseText, 'text/html');
};
Expand Down
1 change: 0 additions & 1 deletion static/template/template.css

This file was deleted.

5 changes: 0 additions & 5 deletions static/template/template.js

This file was deleted.

1 change: 1 addition & 0 deletions static/upload_module/hystmodal.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions static/upload_module/hystmodal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading