move quill.js to src

This commit is contained in:
SvyatoslavArtymovych 2023-05-04 10:20:05 +03:00
parent 6c87a5bd0e
commit f6dad4360e
13 changed files with 17594 additions and 38 deletions

1
app/static/js/initQuill.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare function initQuill(): void;

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
export declare function initQuill(): void;
export declare function initQuillValueToTextArea(): void;

1
app/static/js/src/contributors.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare function initContributors(): void;

1
app/static/js/src/initQuill.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare function initQuill(): void;

1
app/static/js/src/main.d.ts vendored Normal file
View File

@ -0,0 +1 @@
import './styles.css';

1
app/static/js/src/quill.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare function initQuill(): void;

View File

@ -0,0 +1 @@
export declare function initQuillValueToTextArea(): void;

View File

@ -93,29 +93,6 @@
{% endblock %}
<!-- scripts -->
<!-- prettier-ignore -->
<script src="{{ url_for('static', filename='js/quill.js') }}"></script>
<script>
var toolbarOptions = [
['bold', 'italic', 'underline'],
[{list: 'ordered'}, {list: 'bullet'}],
[{header: [1, 2, 3, 4, 5, 6, false]}],
[{indent: '-1'}, {indent: '+1'}],
[{align: []}],
['clean'],
];
const editorElement = document.querySelector('#editor');
if (editorElement) {
var quill = new Quill('#editor', {
theme: 'snow',
modules: {
toolbar: toolbarOptions,
},
});
}
</script>
{% block scripts %} {% endblock %}
</body>
</html>

20
src/initQuill.ts Normal file
View File

@ -0,0 +1,20 @@
const Quill = require('./quill');
export function initQuill() {
var toolbarOptions = [
['bold', 'italic', 'underline'],
[{list: 'ordered'}, {list: 'bullet'}],
[{header: [1, 2, 3, 4, 5, 6, false]}],
[{indent: '-1'}, {indent: '+1'}],
['clean'],
];
const editorElement = document.querySelector('#editor');
if (editorElement) {
var quill = new Quill('#editor', {
theme: 'snow',
modules: {
toolbar: toolbarOptions,
},
});
}
}

View File

@ -1,10 +1,12 @@
import './styles.css';
import {initBooks} from './books';
import {initContributors} from './contributors';
import {initQuill} from './quill_value_to_textarea';
import {initQuill} from './initQuill';
import {initQuillValueToTextArea} from './quill_value_to_textarea';
document.addEventListener('DOMContentLoaded', () => {
initBooks();
initContributors();
initQuill();
initQuillValueToTextArea();
});

View File

@ -3,13 +3,10 @@ const quill_value_to_textarea = (): undefined => {
const qlEditor: HTMLButtonElement = document.querySelector('.ql-editor');
const editorContent = qlEditor.innerHTML;
aboutInput.value = editorContent;
console.log(editorContent);
return undefined;
};
export function initQuill() {
export function initQuillValueToTextArea() {
const qlEditor: HTMLButtonElement = document.querySelector('.ql-editor');
if (!qlEditor) {