Commit bfceae7b by Рамис

fix

parent 55536fcb
......@@ -20,6 +20,21 @@ const App = () => {
margin: '20px 20px 20px 100px',
}}
/>
<QEditor
value={'<p>Катарсис философски трансформирует конфликт. Надстройка иллюзорна. Можно&nbsp;предположить,&nbsp;что закон&nbsp;внешнего&nbsp;мира создает сложный позитивизм.</p><p>Вероятностная логика, следовательно, контролирует бабувизм. Вещь в себе, следовательно, транспонирует закон&nbsp;внешнего&nbsp;мира. Заблуждение, по определению, понимает&nbsp;под&nbsp;собой конфликт, tertium nоn datur. Ощущение&nbsp;мира подрывает гравитационный парадокс. Гештальтпсихология, конечно, реально рассматривается данный дуализм. Здравый смысл ясен&nbsp;не&nbsp;всем.</p><p><br></p><p>Отвечая на вопрос о взаимоотношении идеального ли и материального ци, Дай Чжень заявлял, что антропосоциология непредвзято создает принцип&nbsp;восприятия, отрицая&nbsp;очевидное. Апостериори, александрийская школа откровенна. Исчисление предикатов, как принято считать, рассматривается мир. Отсюда&nbsp;естественно&nbsp;следует,&nbsp;что надстройка рефлектирует естественный закон исключённого третьего. Любовь методологически рефлектирует смысл&nbsp;жизни.</p>'}
onChange={(value)=>{
console.log('sads', value);
}}
uploadOptions={{
url: 'https://cdn.atmaguru.online/upload/?sid=test&md5=YEUk8Mjmh2h9NnJrVO7Srg&expires=1653194293',
errorMessage: 'Загрузка временно невозможна'
}}
style={{
maxWidth: '830px',
margin: '20px 20px 20px 100px',
}}
/>
</div>
}
......
{
"name": "react-ag-qeditor",
"version": "0.0.7",
"version": "0.0.8",
"description": "WYSIWYG html editor",
"author": "atma",
"license": "MIT",
......
......@@ -27,18 +27,20 @@ export default class QEditor extends React.Component {
}
Quill.register('formats/video', VideoBlot)
Quill.register('formats/videoLocal', VideoLocalBlot)
// Quill.register('formats/videoLocal', VideoLocalBlot)
Quill.register('modules/blotFormatter', BlotFormatter)
Quill.register('formats/image', ImageBlot)
}
componentDidMount () {
this.setState({
init: true
})
});
// const quill = this.quillRef.getEditor();
//
// quill.update(Quill.sources.USER);
console.log();
}
modules = {
......@@ -53,7 +55,7 @@ export default class QEditor extends React.Component {
{indent: '+1'}
],
[{align: []}, {color: []}, {background: []}],
['link', 'image', 'video', 'videoLocal'],
['link', 'image', 'video'/* , 'videoLocal' */],
['formula'],
['clean']
],
......@@ -72,7 +74,7 @@ export default class QEditor extends React.Component {
() => this.editorModal.show({title: 'Видео по ссылке'})
)
},
videoLocal: (a) => {
/* videoLocal: (a) => {
const quill = this.quillRef.getEditor();
let range = quill.getSelection();
let index = range ? range.index : 0;
......@@ -82,7 +84,7 @@ export default class QEditor extends React.Component {
innerModalType: 'videoLocal',
focusedIndex: index
}, () => this.editorModal.show({title: 'Загрузить видео'}));
},
}, */
image: (a) => {
const quill = this.quillRef.getEditor();
let range = quill.getSelection();
......@@ -105,7 +107,7 @@ export default class QEditor extends React.Component {
'bold', 'italic', 'underline', 'strike', 'blockquote',
'list', 'bullet', 'indent',
'align',
'link', 'image', 'video', 'color', 'background', 'videoLocal',
'link', 'image', 'video', 'color', 'background', /* 'videoLocal', */
'formula'
]
......@@ -191,10 +193,6 @@ export default class QEditor extends React.Component {
let range = quill.getSelection();
let index = range ? range.index : 0;
// console.log(quill)
if(this.state.focusedIndex > 0){
index = this.state.focusedIndex;
}
......
......@@ -12,7 +12,7 @@ export default class VideoLocalBlot extends BlockEmbed {
let node = super.create(value);
node.setAttribute('class', 'ql-video');
node.setAttribute('autoplay', true);
// node.setAttribute('autoplay', true);
// node.setAttribute('loop', true);
node.setAttribute('src', value);
node.setAttribute('controls', true);
......
......@@ -278,11 +278,19 @@
.ql-tooltip{
z-index: 1000;
&[data-mode="formula"]{
input[type="text"]{
width: 280px;
}
}
&::before{
content: 'Ссылка';
}
&[data-mode=formula]::before{
content: 'Вставка формулы:'
content: 'Вставка формулы (TeX):'
}
&[data-mode=link]::before{
content: 'Вставка ссылки:'
......
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