« MediaWiki:Common.js » : différence entre les versions
Page de l’interface de MediaWiki
Autres actions
mAucun résumé des modifications Balise : Révoqué |
Annulation des modifications 5346 de Hiob (discussion) Balise : Annulation |
||
| Ligne 194 : | Ligne 194 : | ||
if (navigator.clipboard && window.isSecureContext) { | if (navigator.clipboard && window.isSecureContext) { | ||
navigator.clipboard.writeText(url) | navigator.clipboard.writeText(url) | ||
.then(function () { showToast('Lien copié !'); }) | .then(function () { showToast('🔗 Lien copié !'); }) | ||
.catch(function () { showToast('❌ Copie impossible'); }); | .catch(function () { showToast('❌ Copie impossible'); }); | ||
} else { | } else { | ||
| Ligne 214 : | Ligne 214 : | ||
}); | }); | ||
/* === Modèle:Règle — injection CSS du toast === */ | |||
(function () { | |||
if (document.getElementById('regle-toast-style')) return; | |||
var style = document.createElement('style'); | |||
style.id = 'regle-toast-style'; | |||
style.textContent = [ | |||
'.regle-toast {', | |||
' position: fixed;', | |||
' bottom: 2rem;', | |||
' left: 50%;', | |||
' transform: translateX(-50%) translateY(1rem);', | |||
' background: #2c2c2c;', | |||
' color: #f0f0f0;', | |||
' padding: 0.5rem 1.2rem;', | |||
' border-radius: 2rem;', | |||
' font-size: 0.9rem;', | |||
' opacity: 0;', | |||
' pointer-events: none;', | |||
' transition: opacity 0.3s ease, transform 0.3s ease;', | |||
' z-index: 200000;', | |||
' white-space: nowrap;', | |||
' box-shadow: 0 4px 12px rgba(0,0,0,0.5);', | |||
'}', | |||
'.regle-toast.regle-toast--visible {', | |||
' opacity: 1;', | |||
' transform: translateX(-50%) translateY(0);', | |||
'}' | |||
].join('\n'); | |||
document.head.appendChild(style); | |||
}()); | |||
/* === fin injection CSS === */ | |||
/* === fin Modèle:Règle === */ | /* === fin Modèle:Règle === */ | ||