easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Add option to specify icons set

Open njourdane opened this issue 6 years ago • 9 comments

This PR adds a new option iconsSet, to let the developper specify which icons set to use.

Currently, font-awesome (fa) or material (material) are supported, but others can be easily added.

Usage:

var easymde = new EasyMDE({
    element: $('#articleContent')[0],
    iconsSet: 'material'
});

The following will produce this toolbar:

screenshot_20190211_163631

Note that font-awesome is kept by default, in order to don't introduce changes to current version.

So this:

var easymde = new EasyMDE({
    element: $('#articleContent')[0],
    iconsSet: 'fa'
});

or this

var easymde = new EasyMDE({
    element: $('#articleContent')[0]
});

produces this, as usual:

screenshot_20190211_163708

njourdane avatar Feb 11 '19 15:02 njourdane

Please don't merge, this introduces some breaks on icons I didn't check.

njourdane avatar Feb 12 '19 13:02 njourdane

I think it's okay. The problems was mainly with header icons, I did not check H+, H-, H1, H2 and H3.

It was buggy both for fa-4, fa-5 and Material.

Note that this was not specially a regression bug: these icons are also buggy on current master and dev branches.

So the rendering of all icons is now:

for Font-awesome 4 :

screenshot_20190212_182352

for Font-awesome 5 :

screenshot_20190212_182518

for Material icons :

screenshot_20190212_185343

Ready to merge for me.

njourdane avatar Feb 12 '19 18:02 njourdane

PR is based on master, this should be development.

EDIT: actually, ignore that. I am dropping the development branch.

Could you merge development into master then? In this way I can fix conflicts in readme on this PR.

njourdane avatar Feb 20 '19 09:02 njourdane

Could you merge development into master then? In this way I can fix conflicts in readme on this PR.

Done!

Ionaru avatar Feb 20 '19 09:02 Ionaru

Done!

Thank you! With ed96d18 this branch is up to date with master and can be merged safely. :)

You should be able to use rebase and merge option to avoid creating an other merge commit. ;)

njourdane avatar Feb 20 '19 10:02 njourdane

Is there anyway I can help adding this feature? Material Icons is already added to one of my applications. With this feature I could avoid including an extra icon set and make the icons consistent overall.

nerg4l avatar Dec 10 '20 10:12 nerg4l

It would be nice to add support for bootstrap-icons on that note too. They're licensed under MIT License and could include with their SVGs.

Chaostheorie avatar Apr 28 '21 19:04 Chaostheorie

Another approach would be a dictionary/map with key-values to define the class names to use. #448

vanillajonathan avatar May 17 '22 21:05 vanillajonathan

Hi everyone, I don't use easyMde currently so I'm probably not going to continue to work on this PR. If anyone interested, please fork my fork and create a new PR.

njourdane avatar Jun 11 '22 07:06 njourdane