User:DR/common.js: Difference between revisions

From Test Wiki
Content deleted Content added
DR (talk | contribs)
No edit summary
DR (talk | contribs)
No edit summary
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() {
(function() {
'use strict';
'use strict';
const config = window.clearDeleteReasonConfig || { applyOnlyOnMobile: true };
if (window.location.search.includes('action=delete')) {

var observer = new MutationObserver(function(mutations) {
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) {
mutations.forEach(function(mutation) {
if (mutation.addedNodes.length) {
if (mutation.addedNodes.length) {
var reasonInput = document.querySelector('input[name="wpReason"]');
const reasonInput = document.querySelector('input[name="wpReason"]');
if (reasonInput) {
if (reasonInput) {
reasonInput.value = '';
reasonInput.value = '';
Line 18: Line 27:
}
}
})();
})();
// </nowiki>