Hodor Hodor

  •  ·  Premium
  • A

    37 friends
  • 46 followers
  • 11496 views
  • 2 votes
  • More
·
Added a discussion

So I've played a little with GPT5, Claude etc. to make some changes to make my app safer and reliable. the first thing that i found a big issue for me was the double click on button, some non tech users click twice on add account button or other forms which create errors and such, so you can add this code, it attached to any submit button and once clicked it display 🚫icon and prevent the next click, then after some time enable back by time (can change). Disclaimer! test it on you beta/test app before deploying, I've add it personally in Studio-Designer-Injection<BODY> injection

<script>
// Preventing Double Form Submission
function simpleDoubleSubmitPrevention() {
    document.addEventListener('click', function(e) {
        const target = e.target;
        
        // Check if this is a submit button (all possible cases)
        const isSubmitButton = (
            (target.tagName === 'BUTTON' && (target.type === 'submit' || !target.type)) ||
            (target.tagName === 'INPUT' && target.type === 'submit') ||
            target.name === 'do_submit' || // Specific match for your button
            target.classList.contains('bx-form-input-submit') // Match by class
        );
        
        if (isSubmitButton) {
            console.log('Submit button clicked:', target); // For debugging
            
            if (target.disabled) {
                e.preventDefault();
                return false;
            }
            
            // Save the original text
            const originalText = target.textContent || target.innerText || target.value;
            
            setTimeout(() => {
                target.disabled = true;
                target.style.opacity = '0.6'; // Add visual effect
                target.style.cursor = 'not-allowed';
                
                // Change the text
                if (target.textContent) {
                    target.textContent = 'Submitting...';
                } else if (target.value) {
                    target.value = 'Submitting...';
                }
                
                // Reset after 5 seconds
                setTimeout(() => {
                    target.disabled = false;
                    target.style.opacity = '';
                    target.style.cursor = '';
                    
                    if (target.textContent && target.textContent === 'Submitting...') {
                        target.textContent = originalText;
                    } else if (target.value && target.value === 'Submitting...') {
                        target.value = originalText;
                    }
                }, 5000);
            }, 10);
        }
    });
}


document.addEventListener('DOMContentLoaded', simpleDoubleSubmitPrevention);
</script>

 
  • 1942
  • 1
·
Added a discussion

Is it possible to display the remaining photos from the current album on the photo view page (in the album module)?

  • 3378
  • 1
·
Added a discussion

I'm having hard time setting up S3 storage, found out this manual https://github.com/unacms/UNA/wiki/Remote-Storage but it's not much, i will apricate if a step by step manual can be created to set S3 storage on UNA.

Thanks in advance

  • 3530
·
Added a discussion

I used the Photos module and noticed that hashtags (channels) can only be added in edit mode — not when uploading a photo. When I add a hashtag to a photo (in edit mode), it doesn’t show up in the channel page.

  • 3418
·
Added a discussion

I have some post categories that i want to use individually in menus and blocks. How i add item menu for a specific category or add blocks of a specific category?

  • 3394
·
Added a discussion

I've come visiting after a while i was not here. I've been in dolphin at first then moved to una at early stages. I had a great website that has been down because i did not had time maintaing it due to school tasks. BUT now that i see una i just love what i see. The design is amazing and very responsive plus dark mode!. New modules, security, performance etc.

Great work team una and Andrew.

  • 6533
·
Added a group

Group for the israelis of us. we will discuss, share knowledge and have fun.

  • 7424
  • 2
·
Added a discussion

I cant see the talk pane, anybody got this?

  • 8172
·
Added a discussion

I try to install unw on map for safe development purpose. Ive copied una files to localhost but i get error of not exist. Someone have experience this?

  • 8311