Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -450,6 +450,11 @@ HTML = """
|
|
| 450 |
}
|
| 451 |
|
| 452 |
.floating-home .icon {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 453 |
font-size: 22px;
|
| 454 |
color: var(--primary-color);
|
| 455 |
transition: var(--transition);
|
|
@@ -879,11 +884,11 @@ HTML = """
|
|
| 879 |
|
| 880 |
<section id="home" class="fade-in">
|
| 881 |
<div class="upload-container">
|
| 882 |
-
<button class="upload">
|
| 883 |
<i class="fas fa-images"></i> ์ด๋ฏธ์ง ์ถ๊ฐ
|
| 884 |
<input id="imgInput" type="file" accept="image/*" multiple hidden>
|
| 885 |
</button>
|
| 886 |
-
<button class="upload">
|
| 887 |
<i class="fas fa-file-pdf"></i> PDF ์ถ๊ฐ
|
| 888 |
<input id="pdfInput" type="file" accept="application/pdf" hidden>
|
| 889 |
</button>
|
|
@@ -941,6 +946,33 @@ HTML = """
|
|
| 941 |
/* โโ ์ ํธ โโ */
|
| 942 |
function $id(id){return document.getElementById(id)}
|
| 943 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 944 |
function addCard(i, thumb, title, isCached = false) {
|
| 945 |
const d = document.createElement('div');
|
| 946 |
d.className = 'card fade-in';
|
|
@@ -1612,8 +1644,8 @@ HTML = """
|
|
| 1612 |
|
| 1613 |
// ํ์ด์ง ๋ก๋ ์ ์๋ฒ PDF ๋ก๋
|
| 1614 |
window.addEventListener('DOMContentLoaded', () => {
|
| 1615 |
-
//
|
| 1616 |
-
|
| 1617 |
|
| 1618 |
loadServerPDFs();
|
| 1619 |
|
|
|
|
| 450 |
}
|
| 451 |
|
| 452 |
.floating-home .icon {
|
| 453 |
+
display: flex;
|
| 454 |
+
justify-content: center;
|
| 455 |
+
align-items: center;
|
| 456 |
+
width: 100%;
|
| 457 |
+
height: 100%;
|
| 458 |
font-size: 22px;
|
| 459 |
color: var(--primary-color);
|
| 460 |
transition: var(--transition);
|
|
|
|
| 884 |
|
| 885 |
<section id="home" class="fade-in">
|
| 886 |
<div class="upload-container">
|
| 887 |
+
<button class="upload" id="imageUploadBtn">
|
| 888 |
<i class="fas fa-images"></i> ์ด๋ฏธ์ง ์ถ๊ฐ
|
| 889 |
<input id="imgInput" type="file" accept="image/*" multiple hidden>
|
| 890 |
</button>
|
| 891 |
+
<button class="upload" id="pdfUploadBtn">
|
| 892 |
<i class="fas fa-file-pdf"></i> PDF ์ถ๊ฐ
|
| 893 |
<input id="pdfInput" type="file" accept="application/pdf" hidden>
|
| 894 |
</button>
|
|
|
|
| 946 |
/* โโ ์ ํธ โโ */
|
| 947 |
function $id(id){return document.getElementById(id)}
|
| 948 |
|
| 949 |
+
// ์ง์ ์ด๋ฒคํธ ๋ฆฌ์ค๋ ์ค์ (๋ ํ์คํ ๋ฐฉ๋ฒ)
|
| 950 |
+
function setupDirectEvents() {
|
| 951 |
+
// ์ด๋ฏธ์ง ์
๋ก๋ ๋ฒํผ
|
| 952 |
+
const imageBtn = $id('imageUploadBtn');
|
| 953 |
+
const imageInput = $id('imgInput');
|
| 954 |
+
if (imageBtn && imageInput) {
|
| 955 |
+
console.log('์ด๋ฏธ์ง ์
๋ก๋ ๋ฒํผ ์ด๋ฒคํธ ์ค์ ');
|
| 956 |
+
imageBtn.onclick = function(e) {
|
| 957 |
+
e.preventDefault();
|
| 958 |
+
e.stopPropagation();
|
| 959 |
+
imageInput.click();
|
| 960 |
+
};
|
| 961 |
+
}
|
| 962 |
+
|
| 963 |
+
// PDF ์
๋ก๋ ๋ฒํผ
|
| 964 |
+
const pdfBtn = $id('pdfUploadBtn');
|
| 965 |
+
const pdfInput = $id('pdfInput');
|
| 966 |
+
if (pdfBtn && pdfInput) {
|
| 967 |
+
console.log('PDF ์
๋ก๋ ๋ฒํผ ์ด๋ฒคํธ ์ค์ ');
|
| 968 |
+
pdfBtn.onclick = function(e) {
|
| 969 |
+
e.preventDefault();
|
| 970 |
+
e.stopPropagation();
|
| 971 |
+
pdfInput.click();
|
| 972 |
+
};
|
| 973 |
+
}
|
| 974 |
+
}
|
| 975 |
+
|
| 976 |
function addCard(i, thumb, title, isCached = false) {
|
| 977 |
const d = document.createElement('div');
|
| 978 |
d.className = 'card fade-in';
|
|
|
|
| 1644 |
|
| 1645 |
// ํ์ด์ง ๋ก๋ ์ ์๋ฒ PDF ๋ก๋
|
| 1646 |
window.addEventListener('DOMContentLoaded', () => {
|
| 1647 |
+
// ์ง์ ์ด๋ฒคํธ ๋ฆฌ์ค๋ ์ค์ (๋ ํ์คํ ๋ฐฉ๋ฒ)
|
| 1648 |
+
setupDirectEvents();
|
| 1649 |
|
| 1650 |
loadServerPDFs();
|
| 1651 |
|