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

Added custom Markdown checkbox design. #9

Merged
merged 13 commits into from
Oct 29, 2023

Conversation

kamilatte
Copy link
Contributor

No description provided.

@kamilatte
Copy link
Contributor Author

kamilatte commented Oct 29, 2023

Blows up pancakes with mind
MA FUCKIN PANCAKES

@yamiOnEstrogen
Copy link
Member

This looks good. However please place the javascript in the folder /public/js/@include.

It needs to be one file, like so:

CheckBox.js

function replaceCheckboxesWithImages() {
        const checkboxes = document.querySelectorAll('input[type="checkbox"]');

        checkboxes.forEach(checkbox => {
            if (checkbox.hasAttribute('checked') && checkbox.hasAttribute('disabled')) {
              checkbox.outerHTML = '<img src="/design/yes.jpg" width="25" height="25">';
            } else if (checkbox.hasAttribute('disabled')) {
                checkbox.outerHTML = '<img src="/design/no.jpg" width="25" height="25">';
            }
        });

        // Remove the script element
        const scriptElement = document.currentScript;
        if (scriptElement) {
            scriptElement.parentElement.removeChild(scriptElement);
        }
    }
    replaceCheckboxesWithImages();

@yamiOnEstrogen yamiOnEstrogen added the Npm Scripts related to npm or npm packaging label Oct 29, 2023
@kamilatte
Copy link
Contributor Author

Wtf

@kamilatte
Copy link
Contributor Author

FFS

@kamilatte
Copy link
Contributor Author

WAAA YESSS

@yamiOnEstrogen yamiOnEstrogen merged commit 0322aa2 into vtuberwiki:main Oct 29, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Npm Scripts related to npm or npm packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants