4,090
edits
No edit summary |
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(); | ||
// Check if #submit button exists and add event listener if it does | |||
var submitButton = document.querySelector('#submit'); | |||
console.log("Submit button:", submitButton); | |||
if (submitButton) { | |||
console.log("#submit button found."); | |||
// Add click event listener | |||
submitButton.addEventListener('click', function(event) { | |||
console.log("Submit button clicked."); | |||
event.preventDefault(); // Prevent the default link behavior | |||
var email = 'submit@softwear.directory'; | |||
var subject = 'new entry to the softwear directory'; | |||
var body = '☺ the following content could be interesting for the directory:\n\n' + | |||
'[ author / creator ]\n\n' + | |||
'---\n\n' + | |||
'[ title ]\n\n' + | |||
'---\n\n' + | |||
'[ why should it be included? ]\n\n' + | |||
'---\n\n' + | |||
'[ link or pdf ]\n\n' + | |||
'---\n\n' + | |||
'[ your name / contact / social ]\n\n' + | |||
'---'; | |||
var mailtoLink = 'mailto:' + encodeURIComponent(email) + | |||
'?subject=' + encodeURIComponent(subject) + | |||
'&body=' + encodeURIComponent(body).replace(/%20/g, ' '); | |||
console.log("Generated mailto link:", mailtoLink); | |||
window.location.href = mailtoLink; | |||
}); | |||
} else { | |||
console.warn('#submit button not found on this page.'); | |||
} | |||
} | |||
}); | }); |