1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- document.addEventListener('DOMContentLoaded', function() {
- setTimeout(() => {
- if (document.querySelector('.block-editor-writing-flow')) {
- setTimeout(() => {
- document.querySelector('.rvy-current-status').innerText = replaceText(document.querySelector('.rvy-current-status').innerText);
- document.querySelector('.revision-approve.revision-created').innerText = replaceText(document.querySelector('.revision-approve.revision-created').innerText);
- let sendButton = document.querySelector('a.revision-approve');
- sendButton.addEventListener('click', () => {
- setTimeout(() => {
- let elToDelete = document.querySelector('.components-panel__row.rvy-creation-ui.edit-post-revision-status')
- elToDelete.style.display = "none";
- }, 300);
- });
-
- }, 500);
- } else if (document.querySelector('.revision-q')) {
- document.querySelector('.wp-menu-name').innerText = replaceText(document.querySelector('.wp-menu-name').innerText);
- document.querySelector('h1').innerText = replaceText(document.querySelector('h1').innerText);
- let mine = document.querySelector('.mine a');
- if (mine !== null) {
- document.querySelector('.mine a').innerText = replaceText(document.querySelector('.mine a').innerText);
- }
- document.querySelector('#title a').innerText = replaceText(document.querySelector('#title a').innerText);
- document.querySelector('#date a').innerText = replaceText(document.querySelector('#date a').innerText);
-
- let sentStatus = document.querySelectorAll('.wp-list-table tbody tr td[data-colname="État"]');
- if (sentStatus) {
- for (let caseStatus of sentStatus) {
- if (caseStatus.firstElementChild.innerText === "Envoyé") {
- caseStatus.firstElementChild.innerText = "Envoyé, en attente de validation";
- }
- }
- }
- let revisionTitles = document.querySelectorAll('.row-title');
- if (revisionTitles) {
- for (let revisionTitle of revisionTitles) {
- revisionTitle.innerText = revisionTitle.innerText + " (afficher)";
- }
- }
- } else if (document.querySelector('.profile-php')) {
- document.querySelector('#toplevel_page_revisionary-q a .wp-menu-name').innerText = replaceText(document.querySelector('#toplevel_page_revisionary-q a .wp-menu-name').innerText);
- }
- }, 1000);
- })
- function replaceText(content) {
- content = content.replace(/Révision/g, 'Contribution');
- content = content.replace(/révision/g, 'contribution');
- content = content.replace(/Révisions/g, 'Contributions');
- content = content.replace(/révisions/g, 'contributions');
- return content;
- }
|