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

Suggestions for the function of images_upload_handler #9481

Open
tanggd opened this issue Mar 12, 2024 · 0 comments
Open

Suggestions for the function of images_upload_handler #9481

tanggd opened this issue Mar 12, 2024 · 0 comments

Comments

@tanggd
Copy link

tanggd commented Mar 12, 2024

now,use:

// eg:
const example_image_upload_handler = (blobInfo, progress) => {
    if (myCondition) {
        reject({
            message: 'Image format does not meet the requirements',
            remove: true,
        });
    }
};

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  images_upload_handler: example_image_upload_handler
});
  1. I hope to add a parameter named 'timeout'. The notification automatically closes after the value set in the timeout property elapses in milliseconds.
// eg:
const example_image_upload_handler = (blobInfo, progress) => {
    if (myCondition) {
        reject({
            message: 'Image format does not meet the requirements',
            remove: true,
            timeout: 5000,
        });
    }
};
  1. When parameter 'message' is set to false, I want to customize the notification instead of using the default one. I only need the 'remove' parameter.
// eg:
const example_image_upload_handler = (blobInfo, progress) => {
    if (myCondition) {
        reject({
            message: false,
            remove: true,
        });
    }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant