FEATURE renaming blocks labels
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
137b2981b3
commit
835cc717de
|
|
@ -40,7 +40,7 @@ return array(
|
|||
'apiVersion' => 3,
|
||||
'name' => 'dynamiques-blocks/interview-answer',
|
||||
'version' => '0.1.0',
|
||||
'title' => 'Interview Answer',
|
||||
'title' => 'Réponse',
|
||||
'category' => 'widgets',
|
||||
'icon' => 'smiley',
|
||||
'description' => 'Bloc de réponse d\'interview',
|
||||
|
|
@ -73,7 +73,7 @@ return array(
|
|||
'apiVersion' => 3,
|
||||
'name' => 'dynamiques-blocks/interview-question',
|
||||
'version' => '0.1.0',
|
||||
'title' => 'Interview Question',
|
||||
'title' => 'Question',
|
||||
'category' => 'widgets',
|
||||
'icon' => 'smiley',
|
||||
'description' => 'Bloc de question d\'interview',
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"apiVersion": 3,
|
||||
"name": "dynamiques-blocks/interview-answer",
|
||||
"version": "0.1.0",
|
||||
"title": "Interview Answer",
|
||||
"title": "Réponse",
|
||||
"category": "widgets",
|
||||
"icon": "smiley",
|
||||
"description": "Bloc de réponse d'interview",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'b5c1b5a3bba767748dc3');
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'fcf91d335464c6821eb8');
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
\*****************************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dynamiques-blocks/interview-answer","version":"0.1.0","title":"Interview Answer","category":"widgets","icon":"smiley","description":"Bloc de réponse d\'interview","example":{},"parent":["dynamiques-blocks/interview"],"supports":{"html":false},"textdomain":"interview-answer","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"content":{"type":"string","default":""}},"usesContext":["dynamiques-blocks/interviewedPersonName"]}');
|
||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dynamiques-blocks/interview-answer","version":"0.1.0","title":"Réponse","category":"widgets","icon":"smiley","description":"Bloc de réponse d\'interview","example":{},"parent":["dynamiques-blocks/interview"],"supports":{"html":false},"textdomain":"interview-answer","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"content":{"type":"string","default":""}},"usesContext":["dynamiques-blocks/interviewedPersonName"]}');
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -3,7 +3,7 @@
|
|||
"apiVersion": 3,
|
||||
"name": "dynamiques-blocks/interview-question",
|
||||
"version": "0.1.0",
|
||||
"title": "Interview Question",
|
||||
"title": "Question",
|
||||
"category": "widgets",
|
||||
"icon": "smiley",
|
||||
"description": "Bloc de question d'interview",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'c4227e1ffb4c4eec5f56');
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '7b20c574ebce2c3e0da2');
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
\*******************************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dynamiques-blocks/interview-question","version":"0.1.0","title":"Interview Question","category":"widgets","icon":"smiley","description":"Bloc de question d\'interview","example":{},"parent":["dynamiques-blocks/interview"],"supports":{"html":false},"textdomain":"interview-question","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"content":{"type":"string","default":""}}}');
|
||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dynamiques-blocks/interview-question","version":"0.1.0","title":"Question","category":"widgets","icon":"smiley","description":"Bloc de question d\'interview","example":{},"parent":["dynamiques-blocks/interview"],"supports":{"html":false},"textdomain":"interview-question","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"content":{"type":"string","default":""}}}');
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -3,7 +3,7 @@
|
|||
"apiVersion": 3,
|
||||
"name": "dynamiques-blocks/interview-answer",
|
||||
"version": "0.1.0",
|
||||
"title": "Interview Answer",
|
||||
"title": "Réponse",
|
||||
"category": "widgets",
|
||||
"icon": "smiley",
|
||||
"description": "Bloc de réponse d'interview",
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
/**
|
||||
* View script pour afficher dynamiquement le nom de la personne interviewée
|
||||
*/
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
// Trouver tous les blocs interview-answer
|
||||
const answerBlocks = document.querySelectorAll(
|
||||
".wp-block-dynamiques-blocks-interview-answer",
|
||||
);
|
||||
|
||||
answerBlocks.forEach((answerBlock) => {
|
||||
// Trouver le bloc parent interview
|
||||
const parentBlock = answerBlock.closest(
|
||||
".wp-block-dynamiques-blocks-interview",
|
||||
);
|
||||
|
||||
if (parentBlock) {
|
||||
// Récupérer le nom depuis l'attribut data du parent
|
||||
const interviewedPersonName =
|
||||
parentBlock.dataset.interviewedPersonName || "Invité";
|
||||
|
||||
// Trouver ou créer l'élément pour afficher le nom
|
||||
let nameElement = answerBlock.querySelector(".interviewed-person-name");
|
||||
if (!nameElement) {
|
||||
nameElement = document.createElement("p");
|
||||
nameElement.className = "interviewed-person-name";
|
||||
answerBlock.insertBefore(nameElement, answerBlock.firstChild);
|
||||
}
|
||||
|
||||
nameElement.innerHTML = `<strong>${interviewedPersonName} :</strong>`;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"apiVersion": 3,
|
||||
"name": "dynamiques-blocks/interview-question",
|
||||
"version": "0.1.0",
|
||||
"title": "Interview Question",
|
||||
"title": "Question",
|
||||
"category": "widgets",
|
||||
"icon": "smiley",
|
||||
"description": "Bloc de question d'interview",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user