mantix / livewire-jodit-text-editor Goto Github PK
View Code? Open in Web Editor NEWA powerful Livewire rich text editor (WYSIWYG) component built top of Jodit Editor.
Home Page: https://mantix.nl
License: MIT License
A powerful Livewire rich text editor (WYSIWYG) component built top of Jodit Editor.
Home Page: https://mantix.nl
License: MIT License
Hi,
Could you add the possibility to add button dynamicaly ?
There is the code to modify
<livewire:jodit-text-editor wire:model.live="description" :buttons="['bold', 'italic', 'underline', 'strikeThrough', '|', 'left', 'center', 'right', '|', 'link', 'image']" />
in livewire classe:
public array $buttons = [
"bold",
"italic",
"underline",
];
public function mount(array $buttons = []): void {
$this->joditId = 'jodit-editor-' . Str::uuid()->toString();
if (!empty($buttons)) {
$this->buttons = $buttons;
}
}
In view:
<script>
const buttons = @json($buttons);
const editor = Jodit.make('#' + @js($joditId), {
"autofocus": true,
"toolbarSticky": true,
"uploader": {
"insertImageAsBase64URI": true
},
"toolbarButtonSize": "large",
"showCharsCounter": false,
"showWordsCounter": false,
"showXPathInStatusbar": false,
"defaultActionOnPaste": "insert_clear_html",
"buttons": buttons,
});
document.getElementById(@js($joditId)).addEventListener('change', function() {
@this.set('value', this.value);
});
window.addEventListener('update-jodit-content', (event) => {
editor.value = event.detail[0];
});
</script>
@endscript
Have a nice day ;-)
Thanks for this great package - it was just what I needed. I thought you might like to know that that cloudflare.com are no longer providing Jodit. Instead I used these with your package and it worked fine:
<script src="https://unpkg.com/[email protected]/es2021/jodit.min.js"></script>A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.