u
This commit is contained in:
1 parent
3464bc7907
commit
3620369d47
9 files changed
+1270
-635
No files matched your search
@@ -20,24 +20,29 @@ var G3FileIcons = {
|
||||
more: `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M17 12h.01M12 12h.01M7 12h.01"/></g></svg>
|
||||
`,
|
||||
|
||||
|
||||
},
|
||||
file: {
|
||||
default: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 16 16"><!-- Icon from Fluent UI System Color Icons by Microsoft Corporation - https://github.com/microsoft/fluentui-system-icons/blob/main/LICENSE --><g fill="none"><path fill="url(#SVGsXCcfeOf)" d="M8.004 1L9.5 4.5L13 6l-.008 7.5a1.5 1.5 0 0 1-1.5 1.5H4.5A1.5 1.5 0 0 1 3 13.5v-11A1.5 1.5 0 0 1 4.5 1z"/><path fill="url(#SVGUVHt30XG)" fill-opacity=".5" d="M8.004 1L9.5 4.5L13 6l-.008 7.5a1.5 1.5 0 0 1-1.5 1.5H4.5A1.5 1.5 0 0 1 3 13.5v-11A1.5 1.5 0 0 1 4.5 1z"/><path fill="url(#SVG176kqd6n)" d="M8 4.5V1l5 5H9.5A1.5 1.5 0 0 1 8 4.5"/><defs><linearGradient id="SVGsXCcfeOf" x1="9.994" x2="11.264" y1="1" y2="12.781" gradientUnits="userSpaceOnUse"><stop stop-color="#6CE0FF"/><stop offset="1" stop-color="#4894FE"/></linearGradient><linearGradient id="SVG176kqd6n" x1="10.492" x2="9.242" y1="3.083" y2="5.167" gradientUnits="userSpaceOnUse"><stop stop-color="#9FF0F9"/><stop offset="1" stop-color="#B3E0FF"/></linearGradient><radialGradient id="SVGUVHt30XG" cx="0" cy="0" r="1" gradientTransform="rotate(130.372 6.372 3.818)scale(8.35524 4.87457)" gradientUnits="userSpaceOnUse"><stop offset=".362" stop-color="#4A43CB"/><stop offset="1" stop-color="#4A43CB" stop-opacity="0"/></radialGradient></defs></g></svg>',
|
||||
audio:`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Ultimate color icons by Streamline - https://creativecommons.org/licenses/by/4.0/ --><g fill="none"><path fill="#66e1ff" d="M21.087 6.71v15.334a.956.956 0 0 1-.957.956H3.87a.957.957 0 0 1-.957-.956V1.957A.957.957 0 0 1 3.87 1h11.507q.467 0 .927.086v3.74a.957.957 0 0 0 .957.957H21q.086.46.086.927"/><path fill="#c2f3ff" d="M16.64 5.553L2.912 19.289V1.957A.957.957 0 0 1 3.87 1h11.507q.467 0 .927.086v3.74a1 1 0 0 0 .335.727"/><path fill="#fff" d="M21.001 5.783h-3.74a.957.957 0 0 1-.956-.957v-3.74A5.67 5.67 0 0 1 21 5.783"/><path stroke="#191919" stroke-linecap="round" stroke-linejoin="round" d="M21.087 6.71v15.334a.956.956 0 0 1-.957.956H3.87a.957.957 0 0 1-.957-.956V1.957A.957.957 0 0 1 3.87 1h11.507q.467 0 .927.086v3.74a.957.957 0 0 0 .957.957H21q.086.46.086.927"/><path stroke="#191919" stroke-linecap="round" stroke-linejoin="round" d="M21.001 5.783h-3.74a.957.957 0 0 1-.956-.957v-3.74A5.67 5.67 0 0 1 21 5.783M5.783 18.217v-5.739l1.434 2.87l1.435-2.87v5.74m4.783-4.305A1.435 1.435 0 0 1 12 15.348h-1.435v-2.87H12a1.435 1.435 0 0 1 1.435 1.435m-2.87 4.304v-2.87m4.783-1.721a1.066 1.066 0 0 1 .956-1.148h.724a1.33 1.33 0 0 1 1.19 1.435a1.33 1.33 0 0 1-1.194 1.435a1.33 1.33 0 0 1 1.193 1.435a1.33 1.33 0 0 1-1.189 1.434h-.724a1.066 1.066 0 0 1-.956-1.147"/></g></svg>`,
|
||||
video:`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="#e75749" d="M4.5 2.375A2.56 2.56 0 0 1 5.861 2h20.366a2.545 2.545 0 0 1 2.423 1.951a3.4 3.4 0 0 1 .072.862v11.176h-1.573a2 2 0 0 0-.22.022a5 5 0 0 0-.581-.011c-.3.007-.61-.014-.914.014a2.3 2.3 0 0 0-.4-.02h-4.739c-.2 0-.392.008-.587-.01l.1-.065l-6.353-3.813v3.889c-2.213-.005-4.427 0-6.64 0a2 2 0 0 0-.251.021c-.212-.032-.427-.016-.642-.016c-.284.006-.57-.015-.853.015a2 2 0 0 0-.253-.022H3.275c.006-3.635 0-7.27 0-10.9a4.8 4.8 0 0 1 .071-1.131A2.54 2.54 0 0 1 4.5 2.375m.54 2.188a.64.64 0 0 0-.489.606v1.316a.64.64 0 0 0 .627.6h1.309a.64.64 0 0 0 .6-.608c.005-.426 0-.853 0-1.279a.64.64 0 0 0-.329-.575a.7.7 0 0 0-.358-.078H5.264a1 1 0 0 0-.224.018m20.341 0a.64.64 0 0 0-.474.607v1.306a.64.64 0 0 0 .6.608c.436.005.872 0 1.308 0a.64.64 0 0 0 .627-.606c.006-.438 0-.876 0-1.314a.64.64 0 0 0-.594-.621c-.348-.009-.7 0-1.045 0a2 2 0 0 0-.422.024ZM5.042 8.38a.64.64 0 0 0-.452.4a1.1 1.1 0 0 0-.041.386v1.135a.637.637 0 0 0 .6.6c.4.008.795 0 1.192 0a.8.8 0 0 0 .395-.065a.64.64 0 0 0 .36-.574V8.983a.64.64 0 0 0-.6-.624c-.338-.008-.677 0-1.016 0a2.4 2.4 0 0 0-.438.021m20.338 0a.64.64 0 0 0-.433.4a1.1 1.1 0 0 0-.041.387v1.131a.64.64 0 0 0 .608.607c.406.006.812 0 1.218 0a.74.74 0 0 0 .38-.078a.64.64 0 0 0 .335-.558V8.985a.637.637 0 0 0-.593-.622c-.349-.009-.7 0-1.047 0a2 2 0 0 0-.428.022ZM5.041 12.2a.64.64 0 0 0-.491.608c0 .438-.005.877 0 1.315a.64.64 0 0 0 .627.6h1.3a.64.64 0 0 0 .608-.607v-1.307a.64.64 0 0 0-.605-.626c-.348-.007-.7 0-1.045 0a2 2 0 0 0-.394.017m20.335.006a.64.64 0 0 0-.43.394a1.1 1.1 0 0 0-.041.386v1.131a.64.64 0 0 0 .607.608c.435.005.87 0 1.306 0a.64.64 0 0 0 .628-.605c.006-.438 0-.876 0-1.313a.637.637 0 0 0-.592-.622c-.349-.01-.7 0-1.046 0a2 2 0 0 0-.431.015Z"/><path fill="#fff" d="M13.458 12.1q3.176 1.908 6.353 3.813l-.1.065q-3.127 1.872-6.251 3.748V15.99q-.003-1.941-.002-3.89"/><path fill="#c0392b" d="M3.275 15.988h1.541a2 2 0 0 1 .253.022a.65.65 0 0 0-.409.273a.9.9 0 0 0-.111.518v1.045a.686.686 0 0 0 .685.689h1.192a.68.68 0 0 0 .657-.569c.008-.447 0-.9 0-1.343a.63.63 0 0 0-.521-.613a2 2 0 0 1 .251-.021h6.64v3.736q3.127-1.871 6.251-3.748c.2.018.391.007.587.01h4.741a2.3 2.3 0 0 1 .4.02a.64.64 0 0 0-.475.385a1 1 0 0 0-.045.407v1.014a.677.677 0 0 0 .691.719h1.16a.684.684 0 0 0 .686-.658v-.984a1.07 1.07 0 0 0-.1-.589a.64.64 0 0 0-.42-.292a2 2 0 0 1 .22-.022h1.573c.011 1.721 0 3.443 0 5.165v6.293a2.57 2.57 0 0 1-.612 1.651a2.54 2.54 0 0 1-1.563.868a8 8 0 0 1-.981.033H6.724a9 9 0 0 1-1.368-.048a2.56 2.56 0 0 1-2-1.846a2.8 2.8 0 0 1-.09-.746V16.891c.007-.3-.002-.602.009-.903m1.795 3.843a.6.6 0 0 0-.386.234a.76.76 0 0 0-.134.464v1.162a.685.685 0 0 0 .686.658h1.283a.687.687 0 0 0 .568-.716v-1.191a.62.62 0 0 0-.2-.458a.7.7 0 0 0-.487-.17H5.264a1 1 0 0 0-.194.017m20.366 0a.62.62 0 0 0-.522.58v1.222a.676.676 0 0 0 .69.718c.428 0 .857.005 1.285 0a.7.7 0 0 0 .562-.684v-1.013a.9.9 0 0 0-.123-.568a.66.66 0 0 0-.532-.267h-.954a2.3 2.3 0 0 0-.406.011ZM5.071 23.648a.6.6 0 0 0-.4.249a.77.77 0 0 0-.124.448v1.132a.7.7 0 0 0 .6.688h1.376a.687.687 0 0 0 .567-.717v-1.189a.62.62 0 0 0-.2-.459a.7.7 0 0 0-.484-.17H5.265a1 1 0 0 0-.194.018m20.362 0a.62.62 0 0 0-.492.427a1 1 0 0 0-.029.33V25.6a.68.68 0 0 0 .656.567h1.193a.69.69 0 0 0 .686-.719v-1.164a.66.66 0 0 0-.286-.545a1.46 1.46 0 0 0-.787-.11c-.312.01-.629-.02-.94.018Z"/></svg>`,
|
||||
txt:`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 48 48"><!-- Icon from IconPark by ByteDance - https://github.com/bytedance/IconPark/blob/master/LICENSE --><g fill="none" stroke="#000" stroke-linecap="round" stroke-width="4"><path stroke-linejoin="round" d="M10 38V44H38V38"/><path stroke-linejoin="round" d="M38 20V14L30 4H10V20"/><path stroke-linejoin="round" d="M28 4V14H38"/><path d="M16 12H20"/><rect width="40" height="18" x="4" y="20" stroke-linejoin="round" rx="2"/><path stroke-linejoin="round" d="M21 25L27 33"/><path stroke-linejoin="round" d="M27 25L21 33"/><path stroke-linejoin="round" d="M13 25V33"/><path stroke-linejoin="round" d="M10 25H13H16"/><path stroke-linejoin="round" d="M35 25V33"/><path stroke-linejoin="round" d="M32 25H35H38"/></g></svg>`,
|
||||
pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><path fill="#909090" d="m24.1 2.072l5.564 5.8v22.056H8.879V30h20.856V7.945z"/><path fill="#f4f4f4" d="M24.031 2H8.808v27.928h20.856V7.873z"/><path fill="#7a7b7c" d="M8.655 3.5h-6.39v6.827h20.1V3.5z"/><path fill="#dd2025" d="M22.472 10.211H2.395V3.379h20.077z"/><path fill="#464648" d="M9.052 4.534H7.745v4.8h1.028V7.715L9 7.728a2 2 0 0 0 .647-.117a1.4 1.4 0 0 0 .493-.291a1.2 1.2 0 0 0 .335-.454a2.1 2.1 0 0 0 .105-.908a2.2 2.2 0 0 0-.114-.644a1.17 1.17 0 0 0-.687-.65a2 2 0 0 0-.409-.104a2 2 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.193a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.94.94 0 0 1-.524.114m3.671-2.306c-.111 0-.219.008-.295.011L12 4.538h-.78v4.8h.918a2.7 2.7 0 0 0 1.028-.175a1.7 1.7 0 0 0 .68-.491a1.9 1.9 0 0 0 .373-.749a3.7 3.7 0 0 0 .114-.949a4.4 4.4 0 0 0-.087-1.127a1.8 1.8 0 0 0-.4-.733a1.6 1.6 0 0 0-.535-.4a2.4 2.4 0 0 0-.549-.178a1.3 1.3 0 0 0-.228-.017m-.182 3.937h-.1V5.392h.013a1.06 1.06 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a3 3 0 0 1-.033.513a1.8 1.8 0 0 1-.169.5a1.1 1.1 0 0 1-.363.36a.67.67 0 0 1-.416.106m5.08-3.915H15v4.8h1.028V7.434h1.3v-.892h-1.3V5.43h1.4v-.892"/><path fill="#dd2025" d="M21.781 20.255s3.188-.578 3.188.511s-1.975.646-3.188-.511m-2.357.083a7.5 7.5 0 0 0-1.473.489l.4-.9c.4-.9.815-2.127.815-2.127a14 14 0 0 0 1.658 2.252a13 13 0 0 0-1.4.288Zm-1.262-6.5c0-.949.307-1.208.546-1.208s.508.115.517.939a10.8 10.8 0 0 1-.517 2.434a4.4 4.4 0 0 1-.547-2.162Zm-4.649 10.516c-.978-.585 2.051-2.386 2.6-2.444c-.003.001-1.576 3.056-2.6 2.444M25.9 20.895c-.01-.1-.1-1.207-2.07-1.16a14 14 0 0 0-2.453.173a12.5 12.5 0 0 1-2.012-2.655a11.8 11.8 0 0 0 .623-3.1c-.029-1.2-.316-1.888-1.236-1.878s-1.054.815-.933 2.013a9.3 9.3 0 0 0 .665 2.338s-.425 1.323-.987 2.639s-.946 2.006-.946 2.006a9.6 9.6 0 0 0-2.725 1.4c-.824.767-1.159 1.356-.725 1.945c.374.508 1.683.623 2.853-.91a23 23 0 0 0 1.7-2.492s1.784-.489 2.339-.623s1.226-.24 1.226-.24s1.629 1.639 3.2 1.581s1.495-.939 1.485-1.035"/><path fill="#909090" d="M23.954 2.077V7.95h5.633z"/><path fill="#f4f4f4" d="M24.031 2v5.873h5.633z"/><path fill="#fff" d="M8.975 4.457H7.668v4.8H8.7V7.639l.228.013a2 2 0 0 0 .647-.117a1.4 1.4 0 0 0 .493-.291a1.2 1.2 0 0 0 .332-.454a2.1 2.1 0 0 0 .105-.908a2.2 2.2 0 0 0-.114-.644a1.17 1.17 0 0 0-.687-.65a2 2 0 0 0-.411-.105a2 2 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.194a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.94.94 0 0 1-.524.114m3.67-2.306c-.111 0-.219.008-.295.011l-.235.006h-.78v4.8h.918a2.7 2.7 0 0 0 1.028-.175a1.7 1.7 0 0 0 .68-.491a1.9 1.9 0 0 0 .373-.749a3.7 3.7 0 0 0 .114-.949a4.4 4.4 0 0 0-.087-1.127a1.8 1.8 0 0 0-.4-.733a1.6 1.6 0 0 0-.535-.4a2.4 2.4 0 0 0-.549-.178a1.3 1.3 0 0 0-.228-.017m-.182 3.937h-.1V5.315h.013a1.06 1.06 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a3 3 0 0 1-.033.513a1.8 1.8 0 0 1-.169.5a1.1 1.1 0 0 1-.363.36a.67.67 0 0 1-.416.106m5.077-3.915h-2.43v4.8h1.028V7.357h1.3v-.892h-1.3V5.353h1.4v-.892"/></svg>`,
|
||||
docs:`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><defs><linearGradient id="SVGSuUii0pt" x1="4.494" x2="13.832" y1="-2092.086" y2="-2075.914" gradientTransform="translate(0 2100)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#18884f"/><stop offset=".5" stop-color="#117e43"/><stop offset="1" stop-color="#0b6631"/></linearGradient></defs><path fill="#185c37" d="M19.581 15.35L8.512 13.4v14.409A1.19 1.19 0 0 0 9.705 29h19.1A1.19 1.19 0 0 0 30 27.809V22.5Z"/><path fill="#21a366" d="M19.581 3H9.705a1.19 1.19 0 0 0-1.193 1.191V9.5L19.581 16l5.861 1.95L30 16V9.5Z"/><path fill="#107c41" d="M8.512 9.5h11.069V16H8.512Z"/><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2" opacity=".1"/><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191" opacity=".2"/><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191" opacity=".2"/><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191" opacity=".2"/><path fill="url(#SVGSuUii0pt)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.19 1.19 0 0 1 2 21.959V10.041A1.19 1.19 0 0 1 3.194 8.85"/><path fill="#fff" d="m5.7 19.873l2.511-3.884l-2.3-3.862h1.847L9.013 14.6c.116.234.2.408.238.524h.017q.123-.281.26-.546l1.342-2.447h1.7l-2.359 3.84l2.419 3.905h-1.809l-1.45-2.711A2.4 2.4 0 0 1 9.2 16.8h-.024a1.7 1.7 0 0 1-.168.351l-1.493 2.722Z"/><path fill="#33c481" d="M28.806 3h-9.225v6.5H30V4.191A1.19 1.19 0 0 0 28.806 3"/><path fill="#107c41" d="M19.581 16H30v6.5H19.581Z"/></svg>`,
|
||||
zip:`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 14 14"><!-- Icon from Flex color icons by Streamline - https://creativecommons.org/licenses/by/4.0/ --><g fill="none"><path fill="#d7e0ff" d="M6.331 1.688a.99.99 0 0 0-.883-.648a27 27 0 0 0-3.456.033a1.004 1.004 0 0 0-.92.893C.735 4.903.623 7.85.975 10.793c.119.998.937 1.724 1.915 1.83c2.762.301 5.485.294 8.247-.007a2.09 2.09 0 0 0 1.845-1.823c.218-1.82.276-3.684.14-5.971a1.906 1.906 0 0 0-1.745-1.788c-1.344-.112-2.279-.118-3.931-.153a1 1 0 0 1-.915-.652z"/><path stroke="#4147d5" stroke-linecap="round" stroke-linejoin="round" d="M6.331 1.688a.99.99 0 0 0-.883-.648a27 27 0 0 0-3.456.033a1.004 1.004 0 0 0-.92.893C.735 4.903.623 7.85.975 10.793c.119.998.937 1.724 1.915 1.83c2.762.301 5.485.294 8.247-.007a2.09 2.09 0 0 0 1.845-1.823c.218-1.82.276-3.684.14-5.971a1.906 1.906 0 0 0-1.745-1.788c-1.344-.112-2.279-.118-3.931-.153a1 1 0 0 1-.915-.652zM8 5.981h2.5m-2.5 3h2.5M9.248 2.934V8.98"/></g></svg>`,
|
||||
audio: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Ultimate color icons by Streamline - https://creativecommons.org/licenses/by/4.0/ --><g fill="none"><path fill="#66e1ff" d="M21.087 6.71v15.334a.956.956 0 0 1-.957.956H3.87a.957.957 0 0 1-.957-.956V1.957A.957.957 0 0 1 3.87 1h11.507q.467 0 .927.086v3.74a.957.957 0 0 0 .957.957H21q.086.46.086.927"/><path fill="#c2f3ff" d="M16.64 5.553L2.912 19.289V1.957A.957.957 0 0 1 3.87 1h11.507q.467 0 .927.086v3.74a1 1 0 0 0 .335.727"/><path fill="#fff" d="M21.001 5.783h-3.74a.957.957 0 0 1-.956-.957v-3.74A5.67 5.67 0 0 1 21 5.783"/><path stroke="#191919" stroke-linecap="round" stroke-linejoin="round" d="M21.087 6.71v15.334a.956.956 0 0 1-.957.956H3.87a.957.957 0 0 1-.957-.956V1.957A.957.957 0 0 1 3.87 1h11.507q.467 0 .927.086v3.74a.957.957 0 0 0 .957.957H21q.086.46.086.927"/><path stroke="#191919" stroke-linecap="round" stroke-linejoin="round" d="M21.001 5.783h-3.74a.957.957 0 0 1-.956-.957v-3.74A5.67 5.67 0 0 1 21 5.783M5.783 18.217v-5.739l1.434 2.87l1.435-2.87v5.74m4.783-4.305A1.435 1.435 0 0 1 12 15.348h-1.435v-2.87H12a1.435 1.435 0 0 1 1.435 1.435m-2.87 4.304v-2.87m4.783-1.721a1.066 1.066 0 0 1 .956-1.148h.724a1.33 1.33 0 0 1 1.19 1.435a1.33 1.33 0 0 1-1.194 1.435a1.33 1.33 0 0 1 1.193 1.435a1.33 1.33 0 0 1-1.189 1.434h-.724a1.066 1.066 0 0 1-.956-1.147"/></g></svg>`,
|
||||
video: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="#e75749" d="M4.5 2.375A2.56 2.56 0 0 1 5.861 2h20.366a2.545 2.545 0 0 1 2.423 1.951a3.4 3.4 0 0 1 .072.862v11.176h-1.573a2 2 0 0 0-.22.022a5 5 0 0 0-.581-.011c-.3.007-.61-.014-.914.014a2.3 2.3 0 0 0-.4-.02h-4.739c-.2 0-.392.008-.587-.01l.1-.065l-6.353-3.813v3.889c-2.213-.005-4.427 0-6.64 0a2 2 0 0 0-.251.021c-.212-.032-.427-.016-.642-.016c-.284.006-.57-.015-.853.015a2 2 0 0 0-.253-.022H3.275c.006-3.635 0-7.27 0-10.9a4.8 4.8 0 0 1 .071-1.131A2.54 2.54 0 0 1 4.5 2.375m.54 2.188a.64.64 0 0 0-.489.606v1.316a.64.64 0 0 0 .627.6h1.309a.64.64 0 0 0 .6-.608c.005-.426 0-.853 0-1.279a.64.64 0 0 0-.329-.575a.7.7 0 0 0-.358-.078H5.264a1 1 0 0 0-.224.018m20.341 0a.64.64 0 0 0-.474.607v1.306a.64.64 0 0 0 .6.608c.436.005.872 0 1.308 0a.64.64 0 0 0 .627-.606c.006-.438 0-.876 0-1.314a.64.64 0 0 0-.594-.621c-.348-.009-.7 0-1.045 0a2 2 0 0 0-.422.024ZM5.042 8.38a.64.64 0 0 0-.452.4a1.1 1.1 0 0 0-.041.386v1.135a.637.637 0 0 0 .6.6c.4.008.795 0 1.192 0a.8.8 0 0 0 .395-.065a.64.64 0 0 0 .36-.574V8.983a.64.64 0 0 0-.6-.624c-.338-.008-.677 0-1.016 0a2.4 2.4 0 0 0-.438.021m20.338 0a.64.64 0 0 0-.433.4a1.1 1.1 0 0 0-.041.387v1.131a.64.64 0 0 0 .608.607c.406.006.812 0 1.218 0a.74.74 0 0 0 .38-.078a.64.64 0 0 0 .335-.558V8.985a.637.637 0 0 0-.593-.622c-.349-.009-.7 0-1.047 0a2 2 0 0 0-.428.022ZM5.041 12.2a.64.64 0 0 0-.491.608c0 .438-.005.877 0 1.315a.64.64 0 0 0 .627.6h1.3a.64.64 0 0 0 .608-.607v-1.307a.64.64 0 0 0-.605-.626c-.348-.007-.7 0-1.045 0a2 2 0 0 0-.394.017m20.335.006a.64.64 0 0 0-.43.394a1.1 1.1 0 0 0-.041.386v1.131a.64.64 0 0 0 .607.608c.435.005.87 0 1.306 0a.64.64 0 0 0 .628-.605c.006-.438 0-.876 0-1.313a.637.637 0 0 0-.592-.622c-.349-.01-.7 0-1.046 0a2 2 0 0 0-.431.015Z"/><path fill="#fff" d="M13.458 12.1q3.176 1.908 6.353 3.813l-.1.065q-3.127 1.872-6.251 3.748V15.99q-.003-1.941-.002-3.89"/><path fill="#c0392b" d="M3.275 15.988h1.541a2 2 0 0 1 .253.022a.65.65 0 0 0-.409.273a.9.9 0 0 0-.111.518v1.045a.686.686 0 0 0 .685.689h1.192a.68.68 0 0 0 .657-.569c.008-.447 0-.9 0-1.343a.63.63 0 0 0-.521-.613a2 2 0 0 1 .251-.021h6.64v3.736q3.127-1.871 6.251-3.748c.2.018.391.007.587.01h4.741a2.3 2.3 0 0 1 .4.02a.64.64 0 0 0-.475.385a1 1 0 0 0-.045.407v1.014a.677.677 0 0 0 .691.719h1.16a.684.684 0 0 0 .686-.658v-.984a1.07 1.07 0 0 0-.1-.589a.64.64 0 0 0-.42-.292a2 2 0 0 1 .22-.022h1.573c.011 1.721 0 3.443 0 5.165v6.293a2.57 2.57 0 0 1-.612 1.651a2.54 2.54 0 0 1-1.563.868a8 8 0 0 1-.981.033H6.724a9 9 0 0 1-1.368-.048a2.56 2.56 0 0 1-2-1.846a2.8 2.8 0 0 1-.09-.746V16.891c.007-.3-.002-.602.009-.903m1.795 3.843a.6.6 0 0 0-.386.234a.76.76 0 0 0-.134.464v1.162a.685.685 0 0 0 .686.658h1.283a.687.687 0 0 0 .568-.716v-1.191a.62.62 0 0 0-.2-.458a.7.7 0 0 0-.487-.17H5.264a1 1 0 0 0-.194.017m20.366 0a.62.62 0 0 0-.522.58v1.222a.676.676 0 0 0 .69.718c.428 0 .857.005 1.285 0a.7.7 0 0 0 .562-.684v-1.013a.9.9 0 0 0-.123-.568a.66.66 0 0 0-.532-.267h-.954a2.3 2.3 0 0 0-.406.011ZM5.071 23.648a.6.6 0 0 0-.4.249a.77.77 0 0 0-.124.448v1.132a.7.7 0 0 0 .6.688h1.376a.687.687 0 0 0 .567-.717v-1.189a.62.62 0 0 0-.2-.459a.7.7 0 0 0-.484-.17H5.265a1 1 0 0 0-.194.018m20.362 0a.62.62 0 0 0-.492.427a1 1 0 0 0-.029.33V25.6a.68.68 0 0 0 .656.567h1.193a.69.69 0 0 0 .686-.719v-1.164a.66.66 0 0 0-.286-.545a1.46 1.46 0 0 0-.787-.11c-.312.01-.629-.02-.94.018Z"/></svg>`,
|
||||
txt: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 48 48"><!-- Icon from IconPark by ByteDance - https://github.com/bytedance/IconPark/blob/master/LICENSE --><g fill="none" stroke="#000" stroke-linecap="round" stroke-width="4"><path stroke-linejoin="round" d="M10 38V44H38V38"/><path stroke-linejoin="round" d="M38 20V14L30 4H10V20"/><path stroke-linejoin="round" d="M28 4V14H38"/><path d="M16 12H20"/><rect width="40" height="18" x="4" y="20" stroke-linejoin="round" rx="2"/><path stroke-linejoin="round" d="M21 25L27 33"/><path stroke-linejoin="round" d="M27 25L21 33"/><path stroke-linejoin="round" d="M13 25V33"/><path stroke-linejoin="round" d="M10 25H13H16"/><path stroke-linejoin="round" d="M35 25V33"/><path stroke-linejoin="round" d="M32 25H35H38"/></g></svg>`,
|
||||
pdf: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><path fill="#909090" d="m24.1 2.072l5.564 5.8v22.056H8.879V30h20.856V7.945z"/><path fill="#f4f4f4" d="M24.031 2H8.808v27.928h20.856V7.873z"/><path fill="#7a7b7c" d="M8.655 3.5h-6.39v6.827h20.1V3.5z"/><path fill="#dd2025" d="M22.472 10.211H2.395V3.379h20.077z"/><path fill="#464648" d="M9.052 4.534H7.745v4.8h1.028V7.715L9 7.728a2 2 0 0 0 .647-.117a1.4 1.4 0 0 0 .493-.291a1.2 1.2 0 0 0 .335-.454a2.1 2.1 0 0 0 .105-.908a2.2 2.2 0 0 0-.114-.644a1.17 1.17 0 0 0-.687-.65a2 2 0 0 0-.409-.104a2 2 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.193a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.94.94 0 0 1-.524.114m3.671-2.306c-.111 0-.219.008-.295.011L12 4.538h-.78v4.8h.918a2.7 2.7 0 0 0 1.028-.175a1.7 1.7 0 0 0 .68-.491a1.9 1.9 0 0 0 .373-.749a3.7 3.7 0 0 0 .114-.949a4.4 4.4 0 0 0-.087-1.127a1.8 1.8 0 0 0-.4-.733a1.6 1.6 0 0 0-.535-.4a2.4 2.4 0 0 0-.549-.178a1.3 1.3 0 0 0-.228-.017m-.182 3.937h-.1V5.392h.013a1.06 1.06 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a3 3 0 0 1-.033.513a1.8 1.8 0 0 1-.169.5a1.1 1.1 0 0 1-.363.36a.67.67 0 0 1-.416.106m5.08-3.915H15v4.8h1.028V7.434h1.3v-.892h-1.3V5.43h1.4v-.892"/><path fill="#dd2025" d="M21.781 20.255s3.188-.578 3.188.511s-1.975.646-3.188-.511m-2.357.083a7.5 7.5 0 0 0-1.473.489l.4-.9c.4-.9.815-2.127.815-2.127a14 14 0 0 0 1.658 2.252a13 13 0 0 0-1.4.288Zm-1.262-6.5c0-.949.307-1.208.546-1.208s.508.115.517.939a10.8 10.8 0 0 1-.517 2.434a4.4 4.4 0 0 1-.547-2.162Zm-4.649 10.516c-.978-.585 2.051-2.386 2.6-2.444c-.003.001-1.576 3.056-2.6 2.444M25.9 20.895c-.01-.1-.1-1.207-2.07-1.16a14 14 0 0 0-2.453.173a12.5 12.5 0 0 1-2.012-2.655a11.8 11.8 0 0 0 .623-3.1c-.029-1.2-.316-1.888-1.236-1.878s-1.054.815-.933 2.013a9.3 9.3 0 0 0 .665 2.338s-.425 1.323-.987 2.639s-.946 2.006-.946 2.006a9.6 9.6 0 0 0-2.725 1.4c-.824.767-1.159 1.356-.725 1.945c.374.508 1.683.623 2.853-.91a23 23 0 0 0 1.7-2.492s1.784-.489 2.339-.623s1.226-.24 1.226-.24s1.629 1.639 3.2 1.581s1.495-.939 1.485-1.035"/><path fill="#909090" d="M23.954 2.077V7.95h5.633z"/><path fill="#f4f4f4" d="M24.031 2v5.873h5.633z"/><path fill="#fff" d="M8.975 4.457H7.668v4.8H8.7V7.639l.228.013a2 2 0 0 0 .647-.117a1.4 1.4 0 0 0 .493-.291a1.2 1.2 0 0 0 .332-.454a2.1 2.1 0 0 0 .105-.908a2.2 2.2 0 0 0-.114-.644a1.17 1.17 0 0 0-.687-.65a2 2 0 0 0-.411-.105a2 2 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.194a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.94.94 0 0 1-.524.114m3.67-2.306c-.111 0-.219.008-.295.011l-.235.006h-.78v4.8h.918a2.7 2.7 0 0 0 1.028-.175a1.7 1.7 0 0 0 .68-.491a1.9 1.9 0 0 0 .373-.749a3.7 3.7 0 0 0 .114-.949a4.4 4.4 0 0 0-.087-1.127a1.8 1.8 0 0 0-.4-.733a1.6 1.6 0 0 0-.535-.4a2.4 2.4 0 0 0-.549-.178a1.3 1.3 0 0 0-.228-.017m-.182 3.937h-.1V5.315h.013a1.06 1.06 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a3 3 0 0 1-.033.513a1.8 1.8 0 0 1-.169.5a1.1 1.1 0 0 1-.363.36a.67.67 0 0 1-.416.106m5.077-3.915h-2.43v4.8h1.028V7.357h1.3v-.892h-1.3V5.353h1.4v-.892"/></svg>`,
|
||||
docs: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><!-- Icon from VSCode Icons by Roberto Huertas - https://github.com/vscode-icons/vscode-icons/blob/master/LICENSE --><defs><linearGradient id="SVGSuUii0pt" x1="4.494" x2="13.832" y1="-2092.086" y2="-2075.914" gradientTransform="translate(0 2100)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#18884f"/><stop offset=".5" stop-color="#117e43"/><stop offset="1" stop-color="#0b6631"/></linearGradient></defs><path fill="#185c37" d="M19.581 15.35L8.512 13.4v14.409A1.19 1.19 0 0 0 9.705 29h19.1A1.19 1.19 0 0 0 30 27.809V22.5Z"/><path fill="#21a366" d="M19.581 3H9.705a1.19 1.19 0 0 0-1.193 1.191V9.5L19.581 16l5.861 1.95L30 16V9.5Z"/><path fill="#107c41" d="M8.512 9.5h11.069V16H8.512Z"/><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2" opacity=".1"/><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191" opacity=".2"/><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191" opacity=".2"/><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191" opacity=".2"/><path fill="url(#SVGSuUii0pt)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.19 1.19 0 0 1 2 21.959V10.041A1.19 1.19 0 0 1 3.194 8.85"/><path fill="#fff" d="m5.7 19.873l2.511-3.884l-2.3-3.862h1.847L9.013 14.6c.116.234.2.408.238.524h.017q.123-.281.26-.546l1.342-2.447h1.7l-2.359 3.84l2.419 3.905h-1.809l-1.45-2.711A2.4 2.4 0 0 1 9.2 16.8h-.024a1.7 1.7 0 0 1-.168.351l-1.493 2.722Z"/><path fill="#33c481" d="M28.806 3h-9.225v6.5H30V4.191A1.19 1.19 0 0 0 28.806 3"/><path fill="#107c41" d="M19.581 16H30v6.5H19.581Z"/></svg>`,
|
||||
zip: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 14 14"><!-- Icon from Flex color icons by Streamline - https://creativecommons.org/licenses/by/4.0/ --><g fill="none"><path fill="#d7e0ff" d="M6.331 1.688a.99.99 0 0 0-.883-.648a27 27 0 0 0-3.456.033a1.004 1.004 0 0 0-.92.893C.735 4.903.623 7.85.975 10.793c.119.998.937 1.724 1.915 1.83c2.762.301 5.485.294 8.247-.007a2.09 2.09 0 0 0 1.845-1.823c.218-1.82.276-3.684.14-5.971a1.906 1.906 0 0 0-1.745-1.788c-1.344-.112-2.279-.118-3.931-.153a1 1 0 0 1-.915-.652z"/><path stroke="#4147d5" stroke-linecap="round" stroke-linejoin="round" d="M6.331 1.688a.99.99 0 0 0-.883-.648a27 27 0 0 0-3.456.033a1.004 1.004 0 0 0-.92.893C.735 4.903.623 7.85.975 10.793c.119.998.937 1.724 1.915 1.83c2.762.301 5.485.294 8.247-.007a2.09 2.09 0 0 0 1.845-1.823c.218-1.82.276-3.684.14-5.971a1.906 1.906 0 0 0-1.745-1.788c-1.344-.112-2.279-.118-3.931-.153a1 1 0 0 1-.915-.652zM8 5.981h2.5m-2.5 3h2.5M9.248 2.934V8.98"/></g></svg>`,
|
||||
},
|
||||
preview: {
|
||||
prev: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 19l-7-7 7-7"/><path d="M8 12h11"/></svg>',
|
||||
next: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 5l7 7-7 7"/><path d="M16 12H3"/></svg>',
|
||||
imgLoadError:`
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from TDesign Icons by TDesign - https://github.com/Tencent/tdesign-icons/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="square" stroke-width="2" d="M21 11V3H3v18h8m2-7l-4-4l-5.5 5.5m14.25-7.25a2 2 0 1 1-4 0a2 2 0 0 1 4 0Zm4.079 7.922L19 19m0 0l-2.828 2.829M19 19l-2.828-2.828M19 19l2.829 2.829"/></svg>
|
||||
prev: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 19l-7-7 7-7"/><path d="M8 12h11"/></svg>',
|
||||
next: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 5l7 7-7 7"/><path d="M16 12H3"/></svg>',
|
||||
imgLoadError: `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from TDesign Icons by Tencent - https://github.com/Tencent/tdesign-icons/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="square" stroke-width="2" d="M21 11V3H3v18h8m2-7l-4-4l-5.5 5.5m14.25-7.25a2 2 0 1 1-4 0a2 2 0 0 1 4 0Zm4.079 7.922L19 19m0 0l-2.828 2.829M19 19l-2.828-2.828M19 19l2.829 2.829"/></svg>
|
||||
`
|
||||
},
|
||||
modal: {
|
||||
minimize: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3m8 0v-3a2 2 0 0 1 2-2h3"/></svg>',
|
||||
maximize: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m8 0h3a2 2 0 0 0 2-2v-3"/></svg>',
|
||||
close: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"/></svg>'
|
||||
},
|
||||
toast: {
|
||||
success: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>',
|
||||
error: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
.g3-left-panel {
|
||||
width: 50%;
|
||||
width: 30%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-right: 1px solid #eef0f2;
|
||||
@@ -255,19 +255,23 @@
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
overflow: hidden;
|
||||
border-top: 1px solid #f0f2f5;
|
||||
padding: 4px;
|
||||
/* border-top: 1px solid #f0f2f5; */
|
||||
}
|
||||
|
||||
.g3-file-action {
|
||||
padding: 8px 2px;
|
||||
flex: 1;
|
||||
padding: 8px;
|
||||
/* flex: 1; */
|
||||
border: 1px solid #eee;
|
||||
margin-left: 6px;
|
||||
border-radius: 999px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
border-right: 1px solid #f0f2f5;
|
||||
/* border-right: 1px solid #f0f2f5; */
|
||||
}
|
||||
|
||||
.g3-file-action:hover {
|
||||
@@ -286,17 +290,17 @@
|
||||
}
|
||||
|
||||
.g3-file-action:first-child {
|
||||
border-radius: 0 0 0 8px;
|
||||
/* border-radius: 0 0 0 8px; */
|
||||
}
|
||||
|
||||
.g3-file-action:last-child {
|
||||
border-right: none;
|
||||
border-radius: 0 0 8px 0;
|
||||
/* border-right: none;
|
||||
border-radius: 0 0 8px 0; */
|
||||
}
|
||||
|
||||
.g3-file-action svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
@@ -386,8 +390,8 @@
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #ebebeb;
|
||||
color: #666;
|
||||
background: #ffebeb;
|
||||
color: #ff4d4f;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -421,7 +425,6 @@
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 16px;
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #eef0f2;
|
||||
@@ -480,10 +483,11 @@
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
max-width: 300px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-left: 12px;
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
.g3-preview-content {
|
||||
@@ -522,6 +526,24 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #ffffff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.g3-preview-content .g3-preview-iframe.current {
|
||||
opacity: 1;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.g3-preview-content .g3-preview-iframe.next {
|
||||
opacity: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.g3-preview-content {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.g3-preview-content .preview-file-info {
|
||||
@@ -884,3 +906,231 @@
|
||||
.g3-ui-lock.is-locked {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* ============================================================================
|
||||
Modal 样式
|
||||
============================================================================ */
|
||||
|
||||
.g3-modal-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: var(--g3-z-modal);
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.g3-modal-overlay.is-visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.g3-modal {
|
||||
width: 90%;
|
||||
height: 90%;
|
||||
background: #ffffff;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
transition:
|
||||
transform 0.3s ease,
|
||||
opacity 0.3s ease;
|
||||
transform: scale(0.95);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.g3-modal-overlay.is-visible .g3-modal {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.g3-modal.is-maximized {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.g3-modal-header {
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 16px;
|
||||
background: #fafbfc;
|
||||
border-bottom: 1px solid #eef0f2;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.g3-modal-title {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.g3-modal-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.g3-modal-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
transition: background-color 0.2s ease;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.g3-modal-btn:hover {
|
||||
background: #f0f2f5;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.g3-modal-btn-close:hover {
|
||||
background: #ff4d4f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.g3-modal-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.g3-modal-preview-toolbar {
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 16px;
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #eef0f2;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.g3-modal-preview-nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.g3-modal-preview-nav .g3-modal-preview-counter {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
font-weight: 500;
|
||||
min-width: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.g3-modal-preview-filename {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
margin-left: 16px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.g3-modal-preview-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
background: #ffffff;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.2s ease;
|
||||
padding: 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.g3-modal-preview-btn:hover:not(:disabled) {
|
||||
border-color: #165dff;
|
||||
background: rgba(22, 93, 255, 0.05);
|
||||
color: #165dff;
|
||||
}
|
||||
|
||||
.g3-modal-preview-btn:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.g3-modal-preview-content {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
padding: 20px;
|
||||
overflow: auto;
|
||||
background: #fafbfc;
|
||||
}
|
||||
|
||||
.g3-modal-preview-content .g3-modal-preview-placeholder {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.g3-modal-preview-content .g3-modal-preview-iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #ffffff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.g3-modal-preview-content .g3-modal-preview-iframe.current {
|
||||
opacity: 1;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.g3-modal-preview-content .g3-modal-preview-iframe.next {
|
||||
opacity: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.g3-modal-footer {
|
||||
display: none;
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 0 16px;
|
||||
background: #fafbfc;
|
||||
border-top: 1px solid #eef0f2;
|
||||
flex-shrink: 0;
|
||||
visibility: hidden;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.g3-modal-footer.has-content {
|
||||
display: flex;
|
||||
visibility: visible;
|
||||
height: 48px;
|
||||
padding: 0 16px;
|
||||
border-top: 1px solid #eef0f2;
|
||||
}
|
||||
@@ -88,14 +88,11 @@
|
||||
},
|
||||
// 全局权限(支持对象或函数)
|
||||
globalPermission: {
|
||||
select: true,
|
||||
upload: true,
|
||||
download: true,
|
||||
delete: true,
|
||||
view: true,
|
||||
},
|
||||
// 单文件权限解析函数(仅支持函数)
|
||||
filePermissionResolver: null,
|
||||
},
|
||||
|
||||
// ============================================================================
|
||||
@@ -268,7 +265,7 @@
|
||||
</button>
|
||||
<button class="g3-btn g3-btn-delete-all" disabled>
|
||||
${G3FileIcons.action.delete}
|
||||
${this.language.delete}
|
||||
${this.language.deleteBatch}
|
||||
</button>
|
||||
</div>
|
||||
<div class="g3-main" style="display: none;">main</div>
|
||||
@@ -316,6 +313,23 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="g3-global-menu"></div>
|
||||
<div class="g3-modal-overlay">
|
||||
<div class="g3-modal">
|
||||
<div class="g3-modal-header">
|
||||
<span class="g3-modal-title"></span>
|
||||
<div class="g3-modal-actions">
|
||||
<button class="g3-modal-btn g3-modal-btn-toggle" title="${this.language.modal.maximize}">
|
||||
${G3FileIcons.modal.maximize}
|
||||
</button>
|
||||
<button class="g3-modal-btn g3-modal-btn-close" title="${this.language.modal.close}">
|
||||
${G3FileIcons.modal.close}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="g3-modal-body"></div>
|
||||
<div class="g3-modal-footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -339,6 +353,14 @@
|
||||
this.$previewName = this.$container.find(".g3-preview-name");
|
||||
this.$previewCounter = this.$container.find(".g3-preview-counter");
|
||||
|
||||
this.$modalOverlay = this.$container.find(".g3-modal-overlay");
|
||||
this.$modal = this.$container.find(".g3-modal");
|
||||
this.$modalTitle = this.$container.find(".g3-modal-title");
|
||||
this.$modalBody = this.$container.find(".g3-modal-body");
|
||||
this.$modalBtnToggle = this.$container.find(".g3-modal-btn-toggle");
|
||||
this.$modalBtnClose = this.$container.find(".g3-modal-btn-close");
|
||||
this.$modalFooter = this.$container.find(".g3-modal-footer");
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
@@ -403,9 +425,13 @@
|
||||
|
||||
var $anchor = $(actionMenuState.anchorEl).closest(".g3-action-more");
|
||||
|
||||
if (!$anchor.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var rect = $anchor[0].getBoundingClientRect();
|
||||
var $mainContainer = this.$container.find(".main");
|
||||
var mainRect = $mainContainer[0].getBoundingClientRect();
|
||||
var mainRect = $mainContainer.length > 0 ? $mainContainer[0].getBoundingClientRect() : null;
|
||||
|
||||
var menuWidth = 160;
|
||||
var itemHeight = 36;
|
||||
@@ -414,29 +440,51 @@
|
||||
var top = rect.bottom;
|
||||
var left = rect.right - menuWidth;
|
||||
|
||||
var spaceBottom = mainRect.bottom - rect.bottom; // main 容器底部到锚点的距离
|
||||
var spaceTop = rect.top - mainRect.top; // 锚点到 main 容器顶部的距离
|
||||
if (mainRect) {
|
||||
var spaceBottom = mainRect.bottom - rect.bottom; // main 容器底部到锚点的距离
|
||||
var spaceTop = rect.top - mainRect.top; // 锚点到 main 容器顶部的距离
|
||||
|
||||
var openUp = spaceBottom < menuHeight && spaceTop > menuHeight;
|
||||
var openUp = spaceBottom < menuHeight && spaceTop > menuHeight;
|
||||
|
||||
if (openUp) {
|
||||
top = rect.top - menuHeight; // 在锚点上方显示
|
||||
}
|
||||
if (openUp) {
|
||||
top = rect.top - menuHeight; // 在锚点上方显示
|
||||
}
|
||||
|
||||
// 确保菜单不超出 main 容器左右边界
|
||||
if (left < mainRect.left) {
|
||||
left = mainRect.left;
|
||||
}
|
||||
if (left + menuWidth > mainRect.right) {
|
||||
left = mainRect.right - menuWidth;
|
||||
}
|
||||
// 确保菜单不超出 main 容器左右边界
|
||||
if (left < mainRect.left) {
|
||||
left = mainRect.left;
|
||||
}
|
||||
if (left + menuWidth > mainRect.right) {
|
||||
left = mainRect.right - menuWidth;
|
||||
}
|
||||
|
||||
// 确保菜单不超出 main 容器上下边界
|
||||
if (top < mainRect.top) {
|
||||
top = mainRect.top;
|
||||
}
|
||||
if (top + menuHeight > mainRect.bottom) {
|
||||
top = mainRect.bottom - menuHeight;
|
||||
// 确保菜单不超出 main 容器上下边界
|
||||
if (top < mainRect.top) {
|
||||
top = mainRect.top;
|
||||
}
|
||||
if (top + menuHeight > mainRect.bottom) {
|
||||
top = mainRect.bottom - menuHeight;
|
||||
}
|
||||
} else {
|
||||
// 如果没有找到 main 容器,使用视口边界
|
||||
var viewportWidth = window.innerWidth;
|
||||
var viewportHeight = window.innerHeight;
|
||||
|
||||
// 确保菜单不超出视口左右边界
|
||||
if (left < 0) {
|
||||
left = 0;
|
||||
}
|
||||
if (left + menuWidth > viewportWidth) {
|
||||
left = viewportWidth - menuWidth;
|
||||
}
|
||||
|
||||
// 确保菜单不超出视口上下边界
|
||||
if (top < 0) {
|
||||
top = 0;
|
||||
}
|
||||
if (top + menuHeight > viewportHeight) {
|
||||
top = viewportHeight - menuHeight;
|
||||
}
|
||||
}
|
||||
|
||||
actionMenu.css({
|
||||
@@ -499,6 +547,15 @@
|
||||
break;
|
||||
}
|
||||
|
||||
// <span>${G3FileUtils.formatDate(file.uploadDate)}</span>
|
||||
|
||||
var actionMenuItems = (this.options.getActionMenu && this.options.getActionMenu(file)) || [];
|
||||
var moreActionHtml = actionMenuItems && actionMenuItems.length > 0 ? `
|
||||
<div class="g3-file-action g3-action-more" title="${this.language.more}">
|
||||
${G3FileIcons.action.more}
|
||||
</div>
|
||||
` : "";
|
||||
|
||||
return `
|
||||
<div class="g3-file-item" data-id="${file._id}">
|
||||
<input type="checkbox" class="g3-file-checkbox" />
|
||||
@@ -511,7 +568,7 @@
|
||||
|
||||
<div class="g3-file-info">
|
||||
<span class="g3-file-name">${file.name}</span>
|
||||
<span>${typeof file.size === "string" ? file.size || "-" : G3FileUtils.formatFileSize(file.size)}</span>
|
||||
<span>${G3FileUtils.formatFileSize(file.size)}</span>
|
||||
<span>${G3FileUtils.formatDate(file.uploadDate)}</span>
|
||||
</div>
|
||||
|
||||
@@ -524,9 +581,7 @@
|
||||
${G3FileIcons.action.download}
|
||||
</div>
|
||||
|
||||
<div class="g3-file-action g3-action-more" title="${this.language.more}">
|
||||
${G3FileIcons.action.more}
|
||||
</div>
|
||||
${moreActionHtml}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -738,6 +793,7 @@
|
||||
this.$btnPrev.prop("disabled", true);
|
||||
this.$btnNext.prop("disabled", true);
|
||||
this.currentPreviewFileId = null;
|
||||
this.previewCache = null;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -769,20 +825,168 @@
|
||||
.replace("{total}", total);
|
||||
this.$previewCounter.text(counterText);
|
||||
|
||||
var previewContent = "";
|
||||
var self = this;
|
||||
|
||||
if (isUploaded && fileUrl && isPreviewable) {
|
||||
var previewUrl = this.options.previewUrl || "";
|
||||
var fullPreviewUrl = previewUrl
|
||||
? previewUrl + G3FileUtils.base64Encode(fileUrl)
|
||||
: fileUrl;
|
||||
previewContent = `
|
||||
|
||||
if (!this.previewCache) {
|
||||
this.previewCache = { currentUrl: null, nextUrl: null };
|
||||
}
|
||||
|
||||
if (this.previewCache.currentUrl === fullPreviewUrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $content = this.$previewContent;
|
||||
var $currentIframe = $content.find(".g3-preview-iframe.current");
|
||||
var $nextIframe = $content.find(".g3-preview-iframe.next");
|
||||
|
||||
if ($nextIframe.length && this.previewCache.nextUrl === fullPreviewUrl) {
|
||||
$currentIframe.removeClass("current").addClass("next").hide();
|
||||
$nextIframe.removeClass("next").addClass("current").show();
|
||||
this.previewCache.currentUrl = fullPreviewUrl;
|
||||
this.previewCache.nextUrl = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($nextIframe.length) {
|
||||
$nextIframe.remove();
|
||||
}
|
||||
|
||||
var newIframe = $(`
|
||||
<iframe
|
||||
src="${fullPreviewUrl}"
|
||||
class="g3-preview-iframe"
|
||||
class="g3-preview-iframe next"
|
||||
frameborder="0"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
`);
|
||||
|
||||
newIframe.on("load", function () {
|
||||
if ($currentIframe.length) {
|
||||
$currentIframe.css("opacity", "0");
|
||||
setTimeout(function () {
|
||||
$currentIframe.remove();
|
||||
}, 300);
|
||||
}
|
||||
newIframe.removeClass("next").addClass("current");
|
||||
self.previewCache.currentUrl = fullPreviewUrl;
|
||||
self.previewCache.nextUrl = null;
|
||||
});
|
||||
|
||||
newIframe.on("error", function () {
|
||||
newIframe.remove();
|
||||
self.showPlaceholder($content, `<p class="g3-url-error">${self.language.urlError}</p>`);
|
||||
});
|
||||
|
||||
$content.append(newIframe);
|
||||
this.previewCache.nextUrl = fullPreviewUrl;
|
||||
|
||||
} else {
|
||||
this.previewCache = null;
|
||||
var tipsHtml = "";
|
||||
if (!isUploaded) {
|
||||
tipsHtml = `<p class="g3-upload-tip">${this.language.uploadToPreview}</p>`;
|
||||
} else if (!isPreviewable) {
|
||||
tipsHtml = `<p class="g3-cannot-preview">${this.language.downloadToPreview}</p>`;
|
||||
} else if (!fileUrl) {
|
||||
tipsHtml = `<p class="g3-url-error">${this.language.urlError}</p>`;
|
||||
}
|
||||
|
||||
this.showPlaceholder(this.$previewContent, tipsHtml);
|
||||
}
|
||||
},
|
||||
|
||||
showPlaceholder: function ($container, tipsHtml) {
|
||||
$container.find(".g3-preview-iframe").remove();
|
||||
$container.html(`
|
||||
<div class="g3-preview-placeholder">
|
||||
${tipsHtml}
|
||||
</div>
|
||||
`);
|
||||
},
|
||||
|
||||
showModalPlaceholder: function ($container, tipsHtml) {
|
||||
$container.find(".g3-modal-preview-iframe").remove();
|
||||
$container.html(`
|
||||
<div class="g3-modal-preview-placeholder">
|
||||
${tipsHtml}
|
||||
</div>
|
||||
`);
|
||||
},
|
||||
|
||||
openModal: function (options) {
|
||||
var defaults = {
|
||||
title: "",
|
||||
content: "",
|
||||
width: "80%",
|
||||
height: "80%",
|
||||
showToggle: true,
|
||||
showClose: true
|
||||
};
|
||||
|
||||
var opts = $.extend({}, defaults, options);
|
||||
|
||||
this.$modalTitle.text(opts.title || "");
|
||||
this.$modalBody.html(opts.content || "");
|
||||
|
||||
this.$modal.css({
|
||||
width: opts.width,
|
||||
height: opts.height
|
||||
});
|
||||
|
||||
this.$modalBtnToggle.toggle(opts.showToggle);
|
||||
this.$modalBtnClose.toggle(opts.showClose);
|
||||
|
||||
this.$modalOverlay.addClass("is-visible");
|
||||
this.$modal.removeClass("is-maximized");
|
||||
this.$modalBtnToggle.html(G3FileIcons.modal.maximize);
|
||||
this.$modalBtnToggle.attr("title", this.language.modal.maximize);
|
||||
},
|
||||
|
||||
openPreviewModal: function (fileId) {
|
||||
var file = this.getFileById(fileId);
|
||||
if (!file) return;
|
||||
|
||||
var isUploaded = file.status === "uploaded";
|
||||
var isPreviewable = this.isPreviewableFile(file.name);
|
||||
var fileUrl = file.url && file.url !== "" ? file.url : null;
|
||||
|
||||
var toolbarHtml = `
|
||||
<div class="g3-modal-preview-toolbar">
|
||||
<div class="g3-modal-preview-nav">
|
||||
<button class="g3-modal-preview-btn g3-modal-preview-prev" disabled>
|
||||
${G3FileIcons.preview.prev}
|
||||
</button>
|
||||
<span class="g3-modal-preview-counter">0/0</span>
|
||||
<button class="g3-modal-preview-btn g3-modal-preview-next" disabled>
|
||||
${G3FileIcons.preview.next}
|
||||
</button>
|
||||
</div>
|
||||
<div class="g3-modal-preview-filename">${file.name}</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
var contentHtml = "";
|
||||
if (isUploaded && fileUrl && isPreviewable) {
|
||||
var previewUrl = this.options.previewUrl || "";
|
||||
var fullPreviewUrl = previewUrl
|
||||
? previewUrl + G3FileUtils.base64Encode(fileUrl)
|
||||
: fileUrl;
|
||||
|
||||
contentHtml = `
|
||||
<div class="g3-modal-preview-content">
|
||||
<iframe
|
||||
src="${fullPreviewUrl}"
|
||||
class="g3-modal-preview-iframe current"
|
||||
frameborder="0"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
var tipsHtml = "";
|
||||
@@ -794,14 +998,195 @@
|
||||
tipsHtml = `<p class="g3-url-error">${this.language.urlError}</p>`;
|
||||
}
|
||||
|
||||
previewContent = `
|
||||
<div class="g3-preview-placeholder">
|
||||
${tipsHtml}
|
||||
contentHtml = `
|
||||
<div class="g3-modal-preview-content">
|
||||
<div class="g3-modal-preview-placeholder">
|
||||
${tipsHtml}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
this.$previewContent.html(previewContent);
|
||||
var previewContent = toolbarHtml + contentHtml;
|
||||
|
||||
this.currentModalFileId = fileId;
|
||||
|
||||
this.openModal({
|
||||
title: this.language.filePreview,
|
||||
content: previewContent,
|
||||
width: "90%",
|
||||
height: "90%",
|
||||
});
|
||||
|
||||
var self = this;
|
||||
setTimeout(function () {
|
||||
self.$modal.find(".g3-modal-preview-prev").off("click").on("click", function () {
|
||||
self.modalPrev();
|
||||
});
|
||||
self.$modal.find(".g3-modal-preview-next").off("click").on("click", function () {
|
||||
self.modalNext();
|
||||
});
|
||||
self.updateModalPreviewCounter(fileId);
|
||||
}, 0);
|
||||
},
|
||||
|
||||
updateModalPreviewCounter: function (fileId) {
|
||||
var allFiles = this.getUploadedFiles();
|
||||
var currentIndex = allFiles.findIndex(function (f) { return f._id === fileId; });
|
||||
var total = allFiles.length;
|
||||
|
||||
var $counter = this.$modal.find(".g3-modal-preview-counter");
|
||||
var $prevBtn = this.$modal.find(".g3-modal-preview-prev");
|
||||
var $nextBtn = this.$modal.find(".g3-modal-preview-next");
|
||||
|
||||
if ($counter.length) {
|
||||
$counter.text((currentIndex + 1) + "/" + total);
|
||||
}
|
||||
if ($prevBtn.length) {
|
||||
$prevBtn.prop("disabled", currentIndex === 0);
|
||||
}
|
||||
if ($nextBtn.length) {
|
||||
$nextBtn.prop("disabled", currentIndex === total - 1);
|
||||
}
|
||||
},
|
||||
|
||||
modalPrev: function () {
|
||||
var uploadedFiles = this.getUploadedFiles();
|
||||
if (uploadedFiles.length === 0) return;
|
||||
|
||||
var currentIndex = this.getPreviewFileIndex(this.currentModalFileId);
|
||||
var newIndex = currentIndex > 0 ? currentIndex - 1 : uploadedFiles.length - 1;
|
||||
this.currentModalFileId = uploadedFiles[newIndex]._id;
|
||||
this.updateModalPreviewWithFile(uploadedFiles[newIndex]);
|
||||
},
|
||||
|
||||
modalNext: function () {
|
||||
var uploadedFiles = this.getUploadedFiles();
|
||||
if (uploadedFiles.length === 0) return;
|
||||
|
||||
var currentIndex = this.getPreviewFileIndex(this.currentModalFileId);
|
||||
var newIndex = currentIndex < uploadedFiles.length - 1 ? currentIndex + 1 : 0;
|
||||
this.currentModalFileId = uploadedFiles[newIndex]._id;
|
||||
this.updateModalPreviewWithFile(uploadedFiles[newIndex]);
|
||||
},
|
||||
|
||||
updateModalPreviewWithFile: function (file) {
|
||||
var $content = this.$modal.find(".g3-modal-preview-content");
|
||||
var $title = this.$modal.find(".g3-modal-title");
|
||||
var $filename = this.$modal.find(".g3-modal-preview-filename");
|
||||
|
||||
if (!file || !$content.length) return;
|
||||
|
||||
$title.text(this.language.filePreview);
|
||||
if ($filename.length) {
|
||||
$filename.text(file.name);
|
||||
}
|
||||
|
||||
var isUploaded = file.status === "uploaded";
|
||||
var isPreviewable = this.isPreviewableFile(file.name);
|
||||
var fileUrl = file.url && file.url !== "" ? file.url : null;
|
||||
|
||||
if (isUploaded && fileUrl && isPreviewable) {
|
||||
var previewUrl = this.options.previewUrl || "";
|
||||
var fullPreviewUrl = previewUrl
|
||||
? previewUrl + G3FileUtils.base64Encode(fileUrl)
|
||||
: fileUrl;
|
||||
|
||||
var newIframe = $(`
|
||||
<iframe
|
||||
src="${fullPreviewUrl}"
|
||||
class="g3-modal-preview-iframe"
|
||||
frameborder="0"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
`);
|
||||
|
||||
$content.html(newIframe);
|
||||
} else {
|
||||
var tipsHtml = "";
|
||||
if (!isUploaded) {
|
||||
tipsHtml = `<p class="g3-upload-tip">${this.language.uploadToPreview}</p>`;
|
||||
} else if (!isPreviewable) {
|
||||
tipsHtml = `<p class="g3-cannot-preview">${this.language.downloadToPreview}</p>`;
|
||||
} else if (!fileUrl) {
|
||||
tipsHtml = `<p class="g3-url-error">${this.language.urlError}</p>`;
|
||||
}
|
||||
|
||||
$content.html(`
|
||||
<div class="g3-modal-preview-placeholder">
|
||||
${tipsHtml}
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
|
||||
this.updateModalPreviewCounter(file._id);
|
||||
},
|
||||
|
||||
closeModal: function () {
|
||||
this.$modalOverlay.removeClass("is-visible");
|
||||
this.$modalBody.html("");
|
||||
this.$modalTitle.text("");
|
||||
this.setModalFooter("");
|
||||
this.currentModalFileId = null;
|
||||
},
|
||||
|
||||
toggleModalSize: function () {
|
||||
var isMaximized = this.$modal.hasClass("is-maximized");
|
||||
|
||||
if (isMaximized) {
|
||||
this.$modal.removeClass("is-maximized");
|
||||
this.$modal.css({
|
||||
width: "80%",
|
||||
height: "80%",
|
||||
maxWidth: "none",
|
||||
borderRadius: "8px"
|
||||
});
|
||||
this.$modalBtnToggle.html(G3FileIcons.modal.maximize);
|
||||
this.$modalBtnToggle.attr("title", this.language.modal.maximize);
|
||||
} else {
|
||||
this.$modal.addClass("is-maximized");
|
||||
this.$modal.css({
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
maxWidth: "none",
|
||||
borderRadius: "0"
|
||||
});
|
||||
this.$modalBtnToggle.html(G3FileIcons.modal.restore);
|
||||
this.$modalBtnToggle.attr("title", this.language.modal.restore);
|
||||
}
|
||||
},
|
||||
|
||||
setModalTitle: function (title) {
|
||||
if (this.$modalTitle) {
|
||||
this.$modalTitle.text(title || "");
|
||||
}
|
||||
},
|
||||
|
||||
setModalContent: function (content) {
|
||||
if (this.$modalBody) {
|
||||
this.$modalBody.html(content || "");
|
||||
}
|
||||
},
|
||||
|
||||
setModalSize: function (width, height) {
|
||||
if (!this.$modal) return;
|
||||
|
||||
this.$modal.css({
|
||||
width: width || "80%",
|
||||
height: height || "80%"
|
||||
});
|
||||
},
|
||||
|
||||
setModalFooter: function (content) {
|
||||
if (!this.$modalFooter) return;
|
||||
|
||||
if (content && content.trim()) {
|
||||
this.$modalFooter.html(content);
|
||||
this.$modalFooter.addClass("has-content");
|
||||
} else {
|
||||
this.$modalFooter.html("");
|
||||
this.$modalFooter.removeClass("has-content");
|
||||
}
|
||||
},
|
||||
|
||||
setPreviewFile: function (fileId) {
|
||||
@@ -1019,6 +1404,21 @@
|
||||
}
|
||||
self.setPreviewFile(id);
|
||||
})
|
||||
// 文件项双击打开 modal 预览
|
||||
.on("dblclick", ".g3-file-item", function (e) {
|
||||
if (
|
||||
$(e.target).closest(
|
||||
".g3-file-action, .g3-file-checkbox, .g3-file-delete-btn",
|
||||
).length
|
||||
) {
|
||||
return;
|
||||
}
|
||||
var id = $(this).data("id");
|
||||
var file = self.getFileById(id);
|
||||
if (!file) return;
|
||||
if (!self.hasPermission(file, "view")) return;
|
||||
self.openPreviewModal(id);
|
||||
})
|
||||
// 更多按钮
|
||||
.on("click", ".g3-action-more", function (e) {
|
||||
e.preventDefault();
|
||||
@@ -1037,6 +1437,23 @@
|
||||
self.openActionMenu($el, file);
|
||||
});
|
||||
|
||||
// Modal 事件绑定
|
||||
this.$modalBtnClose.off("click").on("click", function () {
|
||||
self.closeModal();
|
||||
});
|
||||
|
||||
this.$modalBtnToggle.off("click").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
self.toggleModalSize();
|
||||
});
|
||||
|
||||
this.$modalOverlay.off("click").on("click", function (e) {
|
||||
if (e.target === this) {
|
||||
self.closeModal();
|
||||
}
|
||||
});
|
||||
|
||||
// 任务关闭按钮事件委托
|
||||
this.$container.on("click", ".g3-task-close", function (e) {
|
||||
e.preventDefault();
|
||||
@@ -1884,19 +2301,12 @@
|
||||
|
||||
resolvePermission: function (file, action) {
|
||||
var globalPermission = this.options.globalPermission;
|
||||
var filePermissionResolver = this.options.filePermissionResolver;
|
||||
|
||||
if (typeof filePermissionResolver === "function") {
|
||||
var fileResult = filePermissionResolver({ file: file, action: action });
|
||||
if (fileResult !== undefined) {
|
||||
return !!fileResult;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof globalPermission === "function") {
|
||||
return !!globalPermission({ file: file, action: action });
|
||||
} else if (typeof globalPermission === "object") {
|
||||
return !!globalPermission[action];
|
||||
var permissionKey = action === "select" ? "upload" : action;
|
||||
return !!globalPermission[permissionKey];
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1904,19 +2314,12 @@
|
||||
|
||||
/**
|
||||
* 更新权限配置
|
||||
* @param {Object} config - 权限配置
|
||||
* @param {Object} permissions - 权限对象
|
||||
*/
|
||||
updatePermissions: function (config) {
|
||||
if (!config) return;
|
||||
|
||||
if (config.globalPermission !== undefined) {
|
||||
this.options.globalPermission = config.globalPermission;
|
||||
}
|
||||
|
||||
if (config.filePermissionResolver !== undefined) {
|
||||
this.options.filePermissionResolver = config.filePermissionResolver;
|
||||
}
|
||||
updatePermissions: function (permissions) {
|
||||
if (!permissions) return;
|
||||
|
||||
this.options.globalPermission = permissions;
|
||||
this.updateUI();
|
||||
},
|
||||
|
||||
@@ -2004,16 +2407,9 @@
|
||||
Object.prototype.hasOwnProperty.call(
|
||||
partialState,
|
||||
"globalPermission",
|
||||
) ||
|
||||
Object.prototype.hasOwnProperty.call(
|
||||
partialState,
|
||||
"filePermissionResolver",
|
||||
)
|
||||
) {
|
||||
this.updatePermissions({
|
||||
globalPermission: partialState.globalPermission,
|
||||
filePermissionResolver: partialState.filePermissionResolver,
|
||||
});
|
||||
this.updatePermissions(partialState.globalPermission);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
@@ -4,6 +4,7 @@ var G3FileLanguages = {
|
||||
download: "下载",
|
||||
downloadBatch: "批量下载",
|
||||
delete: "删除",
|
||||
deleteBatch: "批量删除",
|
||||
upload: "上传",
|
||||
select: "选择",
|
||||
more: "更多",
|
||||
@@ -56,12 +57,18 @@ var G3FileLanguages = {
|
||||
currentItem: "当前项",
|
||||
close: "关闭",
|
||||
},
|
||||
modal: {
|
||||
maximize: "全屏",
|
||||
restore: "恢复",
|
||||
close: "关闭",
|
||||
},
|
||||
},
|
||||
"en-US": {
|
||||
selectAll: "Select All",
|
||||
download: "Download",
|
||||
downloadBatch: "Batch Download",
|
||||
delete: "Delete",
|
||||
deleteBatch: "Batch Delete",
|
||||
upload: "Upload",
|
||||
select: "Select",
|
||||
more: "More",
|
||||
@@ -116,5 +123,74 @@ var G3FileLanguages = {
|
||||
currentItem: "Current",
|
||||
close: "Close",
|
||||
},
|
||||
modal: {
|
||||
maximize: "Maximize",
|
||||
restore: "Restore",
|
||||
close: "Close",
|
||||
},
|
||||
},
|
||||
"ru": {
|
||||
selectAll: "Выделить все",
|
||||
download: "Скачать",
|
||||
downloadBatch: "Пакетная загрузка",
|
||||
delete: "Удалить",
|
||||
deleteBatch: "Пакетное удаление",
|
||||
upload: "Загрузить",
|
||||
select: "Выбрать",
|
||||
more: "Дополнительно",
|
||||
confirmDelete: "Вы уверены, что хотите удалить {count} выбранный(ые) файл(ы)?",
|
||||
downloading: "Подготовка к загрузке {count} файла(ов)",
|
||||
deleting: "Удаление...",
|
||||
name: "Имя",
|
||||
size: "Размер",
|
||||
date: "Дата",
|
||||
pending: "Ожидает загрузки",
|
||||
selectFiles: "Выберите файлы",
|
||||
emptyTip1: "Перетащите файлы сюда ...",
|
||||
emptyTip2: "Поддерживается множественная загрузка/скачивание файлов",
|
||||
emptyTip3: "Поддерживается вставка изображений для загрузки",
|
||||
fileSizeError: "Размер файла превышает лимит",
|
||||
preview: "Предпросмотр",
|
||||
filePreview: "Предпросмотр файла",
|
||||
fileName: "Имя файла",
|
||||
fileSize: "Размер файла",
|
||||
uploadDate: "Дата загрузки",
|
||||
fileStatus: "Статус",
|
||||
notUploaded: "Не загружен",
|
||||
uploaded: "Загружен",
|
||||
cannotPreview: "Этот тип файла не поддерживает предпросмотр",
|
||||
previewCount: "{current}/{total}",
|
||||
uploadToPreview: "Пожалуйста, загрузите для предпросмотра",
|
||||
downloadToPreview: "Пожалуйста, загрузите для предпросмотра",
|
||||
urlError: "Неверный URL, пожалуйста, проверьте ссылку",
|
||||
uploading: "Загрузка",
|
||||
uploadFailed: "Загрузка не удалась",
|
||||
downloadingStatus: "Загрузка:",
|
||||
downloadingFile: "Загружается:",
|
||||
downloadComplete: "Загрузка завершена",
|
||||
downloadResult: "Всего {total} файлов, {success} успешно, {failed} не удалось",
|
||||
close: "Закрыть",
|
||||
batchDownload: "Пакетная загрузка",
|
||||
batchUpload: "Пакетная загрузка",
|
||||
error: "Ошибка",
|
||||
downloadError: "Загрузка не удалась, пожалуйста, проверьте, действителен ли файл",
|
||||
toast: {
|
||||
success: "Успех",
|
||||
error: "Ошибка",
|
||||
info: "Информация",
|
||||
warning: "Предупреждение",
|
||||
},
|
||||
task: {
|
||||
total: "Всего",
|
||||
success: "Успешно",
|
||||
failed: "Не удалось",
|
||||
currentItem: "Текущий",
|
||||
close: "Закрыть",
|
||||
},
|
||||
modal: {
|
||||
maximize: "На весь экран",
|
||||
restore: "Восстановить",
|
||||
close: "Закрыть",
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user