User:Euphoria/common.js: Difference between revisions
From Test Wiki
Content deleted Content added
fix |
fix |
||
| Line 65: | Line 65: | ||
}); |
}); |
||
} |
} |
||
}); |
}); |
||
}); |
}); |
||
| Line 77: | Line 78: | ||
if (categories.includes('VfD archive entries')) return; |
if (categories.includes('VfD archive entries')) return; |
||
// Get target page from heading text |
|||
const headingText = $(heading).text().trim(); |
|||
| ⚫ | |||
const targetPage = |
const targetPage = headingText; |
||
| ⚫ | |||
// Container for buttons |
|||
const container = document.createElement('span'); |
const container = document.createElement('span'); |
||
container.style.marginLeft = '6px'; |
container.style.marginLeft = '6px'; |
||
| Line 116: | Line 117: | ||
}); |
}); |
||
btn.addEventListener('mouseenter', () => { |
btn.addEventListener('mouseenter', () => { |
||
btn.style.filter = 'brightness(1.3)'; |
|||
| ⚫ | |||
}); |
|||
btn.addEventListener('mouseleave', () => { |
|||
btn.style.filter = 'brightness(1)'; |
|||
btn.style.transform = 'scale(1)'; |
|||
}); |
|||
btn.addEventListener('click', e => { |
btn.addEventListener('click', e => { |
||
e.preventDefault(); |
e.preventDefault(); |
||
if (!confirm(`Are you sure you want to close as ${actionObj.name}?`)) return; |
if (!confirm(`Are you sure you want to close as ${actionObj.name}?`)) return; |
||
| ⚫ | |||
// Disable all buttons in this heading |
|||
$(heading).find('.vfd-action-link').each((i, b) => { |
|||
b.style.opacity = '0.5'; |
|||
b.style.cursor = 'not-allowed'; |
|||
}); |
|||
handleAction(targetPage, actionObj.name); |
handleAction(targetPage, actionObj.name); |
||
}); |
}); |
||
| Line 133: | Line 145: | ||
}); |
}); |
||
}); |
}); |
||
}); |
}); |
||
//</nowiki> |
//</nowiki> |
||