MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Manual revert
No edit summary
Line 1,176: Line 1,176:
     $(".oo-ui-actionFieldLayout-button .oo-ui-buttonInputWidget").remove();
     $(".oo-ui-actionFieldLayout-button .oo-ui-buttonInputWidget").remove();


     document.querySelector('#submit').addEventListener('click', function(event) {
     document.addEventListener("DOMContentLoaded", function() {
        event.preventDefault(); // Prevent the default link behavior
        var submitButton = document.querySelector('#submit');
 
   
        var email = 'submit@softwear.directory';
        if (submitButton) {
        var subject = 'new entry to the softwear directory';
            submitButton.addEventListener('click', function(event) {
        var body = '☺ the following content could be interesting for the directory:\n\n' +
                event.preventDefault(); // Prevent the default link behavior
                  '[ author / creator ]\n\n' +
   
                  '---\n\n' +
                var email = 'submit@softwear.directory';
                  '[ title ]\n\n' +
                var subject = 'new entry to the softwear directory';
                  '---\n\n' +
                var body = '☺ the following content could be interesting for the directory:\n\n' +
                  '[ why should it be included? ]\n\n' +
                          '[ author / creator ]\n\n' +
                  '---\n\n' +
                          '---\n\n' +
                  '[ link or pdf ]\n\n' +
                          '[ title ]\n\n' +
                  '---\n\n' +
                          '---\n\n' +
                  '[ your name / contact / social ]\n\n' +
                          '[ why should it be included? ]\n\n' +
                  '---';
                          '---\n\n' +
 
                          '[ link or pdf ]\n\n' +
        var mailtoLink = 'mailto:' + encodeURIComponent(email) +
                          '---\n\n' +
                        '?subject=' + encodeURIComponent(subject) +
                          '[ your name / contact / social ]\n\n' +
                        '&body=' + encodeURIComponent(body).replace(/%20/g, ' ');
                          '---';
 
   
        window.location.href = mailtoLink;
                var mailtoLink = 'mailto:' + encodeURIComponent(email) +
     });
                                '?subject=' + encodeURIComponent(subject) +
                                '&body=' + encodeURIComponent(body).replace(/%20/g, ' ');
   
                window.location.href = mailtoLink;
            });
        }
     });  
});
});

Navigation menu