mirror of
https://github.com/logos-co/open-law.git
synced 2025-02-18 09:46:48 +00:00
move quill.js to src
This commit is contained in:
parent
6c87a5bd0e
commit
f6dad4360e
1
app/static/js/initQuill.d.ts
vendored
Normal file
1
app/static/js/initQuill.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export declare function initQuill(): void;
|
17572
app/static/js/main.js
17572
app/static/js/main.js
File diff suppressed because one or more lines are too long
2
app/static/js/quill_value_to_textarea.d.ts
vendored
2
app/static/js/quill_value_to_textarea.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare function initQuill(): void;
|
export declare function initQuillValueToTextArea(): void;
|
||||||
|
1
app/static/js/src/contributors.d.ts
vendored
Normal file
1
app/static/js/src/contributors.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export declare function initContributors(): void;
|
1
app/static/js/src/initQuill.d.ts
vendored
Normal file
1
app/static/js/src/initQuill.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export declare function initQuill(): void;
|
1
app/static/js/src/main.d.ts
vendored
Normal file
1
app/static/js/src/main.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
import './styles.css';
|
1
app/static/js/src/quill.d.ts
vendored
Normal file
1
app/static/js/src/quill.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export declare function initQuill(): void;
|
1
app/static/js/src/quill_value_to_textarea.d.ts
vendored
Normal file
1
app/static/js/src/quill_value_to_textarea.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export declare function initQuillValueToTextArea(): void;
|
@ -93,29 +93,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
<!-- scripts -->
|
<!-- 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 %}
|
{% block scripts %} {% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
20
src/initQuill.ts
Normal file
20
src/initQuill.ts
Normal 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,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +1,12 @@
|
|||||||
import './styles.css';
|
import './styles.css';
|
||||||
import {initBooks} from './books';
|
import {initBooks} from './books';
|
||||||
import {initContributors} from './contributors';
|
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', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
initBooks();
|
initBooks();
|
||||||
initContributors();
|
initContributors();
|
||||||
initQuill();
|
initQuill();
|
||||||
|
initQuillValueToTextArea();
|
||||||
});
|
});
|
||||||
|
@ -3,13 +3,10 @@ const quill_value_to_textarea = (): undefined => {
|
|||||||
const qlEditor: HTMLButtonElement = document.querySelector('.ql-editor');
|
const qlEditor: HTMLButtonElement = document.querySelector('.ql-editor');
|
||||||
const editorContent = qlEditor.innerHTML;
|
const editorContent = qlEditor.innerHTML;
|
||||||
aboutInput.value = editorContent;
|
aboutInput.value = editorContent;
|
||||||
|
|
||||||
console.log(editorContent);
|
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function initQuill() {
|
export function initQuillValueToTextArea() {
|
||||||
const qlEditor: HTMLButtonElement = document.querySelector('.ql-editor');
|
const qlEditor: HTMLButtonElement = document.querySelector('.ql-editor');
|
||||||
|
|
||||||
if (!qlEditor) {
|
if (!qlEditor) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user