Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
editorjs
Commits
21e54512040b
Commit
21e54512
authored
Jun 11, 2021
by
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
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
cubicweb_editorjs/__init__.py
View file @
21e54512
...
@@ -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
)
...
...
cubicweb_editorjs/data/cubes.editorjs.js
View file @
21e54512
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment