Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISome icons missing in Typsetter CMS #1

Open
gtbu opened this issue Dec 14, 2023 · 4 comments
Open

ISome icons missing in Typsetter CMS #1

gtbu opened this issue Dec 14, 2023 · 4 comments

Comments

@gtbu
Copy link

gtbu commented Dec 14, 2023

I added the Plugin manually in https://github.com/gtbu/Typesetter-5.3-p8 (under Settings -> ckeditor ) and 30 % of the icons do not appear.
fa42grayed
Firefox debugger says about "synchronous XMLHttpRequests on the main thread " in fa42.js but i dont think thats the reason.
They are all fa-solid.

@jefs42
Copy link
Owner

jefs42 commented Dec 14, 2023

You mean the ones like "42 group", "500px", "airbnb", etc?

If so, those are all Brand icons. I tried to come up with a better way to handle them - like try to programmatically figure out if the icon is a "brand" ahead of time, but couldn't come up with a good 100% solution for the main icon list. That's why I instead added that checkbox "Brand icon?"

So if you select one of those, check the box which will add the .fab class to the icon class list. Which then in FontAwesome's css switches to "font-family: Font Awesome 6 Brands"

Screenshot 2023-12-14 at 10-01-14 fortyTwo IT – Web Develpment eCommerce Payment and Shipping Solutions

I maybe can try again - perhaps after a break, something new might come to me :) Maybe if nothing else add a manual list of brand icons instead of trying to determine them from the CSS. Perhaps with config options to override and/or add to the preset list for if FA adds new brands or otherwise changes the list.

@jefs42
Copy link
Owner

jefs42 commented Dec 14, 2023

I have a start, if you'd like an advanced proof :) I have it hooked in on my website if you want to check it - fortyTwo IT

It defaults to pulling the Brands CSS file from the same 6.4.0 location of the main CSS - https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/brands.min.css but like the other settings, it can be overridden to point to another location and/or version:

config.fa42 = { fa42BrandsCSS: '/css/fa/brands.css' }
So far, all it does is change the class in the main icon list so they will display correctly. You'd still have to check/uncheck the "Brand icon?" box for it to apply (or not) correctly to the icon to be inserted. It will at first, but if you click then on other icons - brand, not brand, not brand, brand - it loses track and a non-brand will display in preview as F3X2 sort of thing.

So not ready for an actual update/version here yet. Haven't tried it on FontAwesome 5 yet, then code to at least auto-check/uncheck that box or better, be able to skip and remove the checkbox at all.

fa42.zip

@gtbu
Copy link
Author

gtbu commented Dec 15, 2023

Yes - fa42.zip has now the brand-icons. (Just the popup of cloudflare is a bitsuperflouus.) You could replace the brand - button with a choice between i and span and publish a new version with the newest cloudflare-icons-css.

@jefs42
Copy link
Owner

jefs42 commented Dec 23, 2023

Oh... I left in an alert showing me where it was pulling the brands CSS file from, to test default vs configuration settings if you want to use a different version, free or non-free, remote or local.

fa42.zip

alert() removed

It's not ready for a new release. You still have to check or uncheck the Brand checkbox right now. You're getting a preview version that right now only tries to display both non-brand and brand icons in the main view list.

The Brand button can only go away once I can setup the actual preview box (which is what gets inserted into the editor at the end) to automatically add or remove the relevant class names.

As per documentation, your choice of i vs span can be overriden in your ckeditor configuration.

And then what if someone sets their FA to say 5.3 all.min.css - but don't set a brands css? It will either just not display correctly, or I at least would have to code trying to find a cdn brands css relevant to the main css the user chooses to use.

I've tried to make it as exact and useful as possible, while keeping it flexible and customizable. I could drop FA4. I could drop FA5. But also CKE4 is past EOL as well. Other than some minor adjustments - because some is coded based on FA's "coming soon" v6 stuff that, at the time at least, was not actually available yet - probably not much until there's an FAv7 to deal with...

At which point I may just leave this as historic, perhaps someone can use it to recode for a CKEditor 5 plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants