User:DR/common.js: Difference between revisions
< User:DR
Content deleted Content added
No edit summary Tags: Mobile edit Mobile web edit |
Installing User:DR/test.js (script-installer) Tags: Mobile edit Mobile web edit |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
importScript('User:DR/UserInfoEN.js'); // Backlink: [[User:DR/UserInfoEN.js]] |
importScript('User:DR/UserInfoEN.js'); // Backlink: [[User:DR/UserInfoEN.js]] |
||
// <nowiki> |
|||
(function() { |
|||
'use strict'; |
|||
const config = window.clearDeleteReasonConfig || { applyOnlyOnMobile: true }; |
|||
if (window.location.search.includes('action=delete') && (!config.applyOnlyOnMobile || /Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent))) { |
|||
// window.addEventListener('load', function() { |
|||
// const reasonInput = document.querySelector('input[name="wpReason"]'); |
|||
// if (reasonInput) { |
|||
// reasonInput.value = ''; |
|||
// } |
|||
// }); |
|||
const observer = new MutationObserver(function(mutations) { |
|||
mutations.forEach(function(mutation) { |
|||
if (mutation.addedNodes.length) { |
|||
const reasonInput = document.querySelector('input[name="wpReason"]'); |
|||
if (reasonInput) { |
|||
reasonInput.value = ''; |
|||
observer.disconnect(); |
|||
} |
|||
} |
|||
}); |
|||
}); |
|||
observer.observe(document.body, { childList: true, subtree: true }); |
|||
} |
|||
})(); |
|||
// </nowiki> |
|||
window.clearDeleteReasonConfig = { |
window.clearDeleteReasonConfig = { |
||
applyOnlyOnMobile: false |
applyOnlyOnMobile: false |
||
}; |
}; |
||
importScript('User:DR/test.js'); // Backlink: [[User:DR/test.js]] |
Latest revision as of 11:07, 14 March 2025
importScript('User:DR/UserInfoEN.js'); // Backlink: [[User:DR/UserInfoEN.js]]
window.clearDeleteReasonConfig = {
applyOnlyOnMobile: false
};
importScript('User:DR/test.js'); // Backlink: [[User:DR/test.js]]