Commit 21e54512 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

fix: rename html attribute cubicweb: to data-cubicweb: to conform to HTML spec

parent 7031f98be00c
Pipeline #61964 waiting for manual action with stages
in 1 minute and 35 seconds
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
if format == "text/plain": if format == "text/plain":
return "EditorJS content" return "EditorJS content"
self._cw.add_js("cubes.editorjs.js") self._cw.add_js("cubes.editorjs.js")
return f'<textarea cubicweb:type="editorjs" cubicweb:mode="read">{value}</textarea>' return f'<textarea data-cubicweb:type="editorjs" data-cubicweb:mode="read">{value}</textarea>' # noqa
return old_printable_value(self, attr, value, attrtype, format, displaytime) return old_printable_value(self, attr, value, attrtype, format, displaytime)
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
function initEditorjs() { function initEditorjs() {
Array.from(document.getElementsByTagName("textarea")).forEach((node, index) => { Array.from(document.getElementsByTagName("textarea")).forEach((node, index) => {
if (node.getAttribute("cubicweb:type") == "editorjs") { if (node.getAttribute("data-cubicweb:type") == "editorjs") {
const editor = document.createElement("div"); const editor = document.createElement("div");
node.style.display = "none"; node.style.display = "none";
node.parentNode.appendChild(editor); node.parentNode.appendChild(editor);
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
); );
} }
} }
if (node.getAttribute("cubicweb:mode") == "read") { if (node.getAttribute("data-cubicweb:mode") == "read") {
editorJsConfig.readOnly = true; editorJsConfig.readOnly = true;
} }
new EditorJS(editorJsConfig); new EditorJS(editorJsConfig);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment