Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
react-ag-qeditor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lib
react-ag-qeditor
Commits
ab53f5b3
Commit
ab53f5b3
authored
Aug 29, 2022
by
Рамис
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload video/*
cursor pointer to video upload block
parent
1df6a829
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
4 deletions
+45
-4
QEditor.jsx
src/QEditor.jsx
+11
-3
index.scss
src/index.scss
+34
-1
No files found.
src/QEditor.jsx
View file @
ab53f5b3
import
React
,
{
Fragment
,
useEffect
,
useState
,
useRef
}
from
'react'
import
'./index.scss'
// import "katex/dist/katex.min.css"
// import EditorModal from "./components/EditorModal"
// import Uploader from "./components/Uploader"
...
...
@@ -25,6 +24,7 @@ import Uploader from "./components/Uploader"
import
Video
from
'./extensions/Video'
import
Iframe
from
'./extensions/Iframe'
import
CustomLink
from
'./extensions/CustomLink'
//import Formula from './extensions/Formula'
const
initialBubbleItems
=
[
'bold'
,
'italic'
,
'underline'
,
'strike'
,
'|'
,
'colorText'
,
'highlight'
];
...
...
@@ -270,7 +270,15 @@ const QEditor = ({ value, onChange = ()=>{}, style, uploadOptions }) => {
title
:
'Цвет фона'
,
onClick
:
()
=>
setColorsSelected
(
'highlight'
)
},
// katex: {
// title: 'Вставить формулу',
// onClick: () => {
//
// console.log(katex.renderToString(String.raw`c = \pm\sqrt{a^2 + b^2}`));
//
// // editor.chain().focus().insertContent()
// }
// }
}
const
editor
=
useEditor
({
...
...
@@ -402,7 +410,7 @@ const QEditor = ({ value, onChange = ()=>{}, style, uploadOptions }) => {
)
case
'video'
:
return
(
<
Fragment
>
{
getUploader
({
accept
:
'video/
x-msvideo, video/quicktime, video/x-matroska, video/mp4, video/x-ms-wmv
'
})
}
</
Fragment
>
<
Fragment
>
{
getUploader
({
accept
:
'video/
*
'
})
}
</
Fragment
>
)
case
'image'
:
return
(
...
...
src/index.scss
View file @
ab53f5b3
...
...
@@ -75,7 +75,7 @@ body{
}
span
{
font-size
:
1
3px
;
font-size
:
1
em
;
white-space
:
nowrap
;
}
...
...
@@ -87,6 +87,33 @@ body{
opacity
:
0
.6
;
cursor
:
default
;
}
&
[
data-type
=
"h2"
]
{
span
{
font-size
:
1
.5em
;
}
}
&
[
data-type
=
"h3"
]
{
span
{
font-size
:
1
.17em
;
}
}
&
[
data-type
=
"h2"
],
&
[
data-type
=
"h3"
],
&
[
data-type
=
"h4"
]
{
font-weight
:
500
;
padding
:
8px
;
.qicon
{
display
:
none
;
}
}
&
[
data-type
=
"paragraph"
]
{
padding
:
8px
;
.qicon
{
display
:
none
;
}
}
}
}
...
...
@@ -101,6 +128,7 @@ body{
position
:
absolute
;
top
:
50%
;
right
:
0
;
margin-top
:
-2px
;
}
&
.show
{
...
...
@@ -343,6 +371,11 @@ body{
box-shadow
:
0
0
0
1px
#F5F7FA
;
justify-content
:
center
;
align-items
:
center
;
cursor
:
pointer
;
&
:hover
{
border-color
:
#adb0b6
;
}
}
&
-placeholder
{
display
:
inline-block
;
...
...
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