Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change CDN files to package #125

Merged
merged 16 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/pages/model/[model].astro
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ if (deviceDetail.imagePath != null && deviceDetail.imagePath.length >= 1) {
<script type="text/javascript" src="/scripts/vendor/psd.min.js"></script>
<script type="text/javascript" src="/scripts/utils/images.js"></script>
<script type="text/javascript" src="/scripts/utils/scroll.js"></script>
<script type="text/javascript" src="/scripts/models/image-upload.js"></script>
<script src="./upload.js"></script>
<script src="./models/_image-upload.js"></script>
<script src="./_upload.js"></script>
<script src="https://cdn.jsdelivr.net/pyodide/v0.23.4/full/pyodide.js"
></script>
<div class="mockup-content">
Expand Down
9 changes: 4 additions & 5 deletions src/pages/model/upload.js → src/pages/model/_upload.js
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, nvm 😞

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Require: mobx,
*/
import { ulid } from "ulid";
import localforage from "localforage";
import { ImageUpload, ImageUploadState } from "./models/_image-upload";

let dragZoneCounter = 0; // https://stackoverflow.com/a/21002544/19287186
const MAX_FILE_SIZE_BYTE = 104857600;
Expand Down Expand Up @@ -725,11 +726,9 @@ function main() {
};

const onAllMockupGenerated = async (allGeneratedMockups) => {
localforage
.setItem("generatedMockups", allGeneratedMockups)
.then(() => {
navigateToDownloadPage();
});
localforage.setItem("generatedMockups", allGeneratedMockups).then(() => {
navigateToDownloadPage();
});
};

// observe fileListViewModel: isProcessing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Require: mobx, psd.js
*/

const ImageUploadState = {
export const ImageUploadState = {
ReadyForRead: "ReadyForRead",
Reading: "Reading",
ReadyForPreview: "ReadyForPreview",
Expand All @@ -14,7 +14,7 @@ const ImageUploadState = {
ErrPreview: "ErrPreview",
};

class ImageUpload {
export class ImageUpload {
maxFileSizeByte = null;
file = null;
width = null;
Expand Down