Customize editor
Closed this issue · 4 comments
Hi there,
First of all, thanks for making an Ember Pell library ! ^_^
I'm new at Ember so sorry if this seems like an obvious question. I'd like to know how can i personnalize the editor (i'm mostly thinking of being able to remove some icons from the bar like quotes and code that i do not need).
Also, about adding new custom actions... I've been looking at the other library as well (Pell) but i can't by the life of me figure this out....
If anyone can help, i'll be much obliged !
Thanks :)
Hi @jillpouchain.
First of all, thanks for your support in kind words 👍
Everything related to customization of pell is available via options
key described in the readme.
Then, you can check on pell website, what are the current options available for customizing pell: https://github.com/jaredreich/pell/
So for instance, if you want add a new custom action you can do something like that:
// wrapper component or controller
import Ember from 'ember';
export default Ember.Controller.extend({
value: '<h1>Some html</h1>',
pellOptions: {
actions: [
{
name: 'link',
result: () => {
const url = window.prompt('Enter the link URL')
if (url) exec('createLink', url)
}
}
]
}
});
// your view
{{pell-editor value=value onChange=(action (mut value)) pellOptions=pellOptions}}
Hope it helps. If you have any further questions, just let me know.
Hello @PoslinskiNet , sorry for the late reply, been busy. Thank you for your answer, will look into it in the next few days and will come back to you. But i at least wanted to thank you for your response :)
No problem @jillpouchain. Feel free to send as many questions as you need. Let's make this repo even more self-explanatory as possible.
Hello @PoslinskiNet ,
Tried this morning, and it worked perfectly ! Thanks again for your help, exactly what i needed to get started to personalise Pell-editor ! :D