GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.96k stars 398 forks source link

Need to add another button #347

Closed sahanjith closed 7 years ago

sahanjith commented 8 years ago

@anthonyjb Is it possible to add another button like the pencil icon on top left. I'm making some editable webpages and i want user to preview their pages in desktop/mobile views. i've already implemented that part and now i need a place to call for that script. i thought of having two buttons in page one is pencil icon to edit the page and other one is to preview their pages for users. So can you please tell me a way of having another button in page ?

Thanks in advance for this cool library!

anthonyjb commented 8 years ago

Hi @sahanjith - it's pretty easy to implement your own set of buttons, there's some information on that here: https://github.com/GetmeUK/ContentTools/issues/307

If you wanted to use the existing ignition button and add a new item with it you'd need to modify the the IgnitionUI class, mounting a new button here: https://github.com/GetmeUK/ContentTools/blob/master/src/scripts/ui/ignition.coffee#L55

sahanjith commented 8 years ago

@anthonyjb - Thanks a lot! It worked and I've manage to mount a new button. Another issue i've faced is that to change the icon of a button. i tried editing the content tag in a button. but it works only for the icons that are already there in ignition.scss page. (Pencil icon, confirm icon, cancel icon and busy icon ). i tried using the codes in icomoon.json and build but its not working. I'm getting my icon like this. screenshot from 2016-10-26 17 11 04

anthonyjb commented 7 years ago

Hi @sahanjith - Sorry for the late reply I missed this follow up until now. So you need to add any other icons you want to use to the icon.woff file. If you haven't read it already this section of the Adding new tools tutorial should be helpful: http://getcontenttools.com/tutorials/adding-new-tools#now-the-fiddly-bit

sahanjith commented 7 years ago

Thank you @anthonyjb ! I have solved this already. Thank you for your support always! :+1: