kontur / fontsampler-wordpress-plugin

A Wordpress plugin that let's users interactively preview and test webfonts
http://fontsampler.johannesneumeier.com
GNU General Public License v3.0
38 stars 8 forks source link

TypeError on Chrome and Firefox #163

Closed eggplantPrince closed 4 years ago

eggplantPrince commented 4 years ago

Hi!

I'm using FontSampler with woocommerce . I call the do_shortcode through a php template of a product, and i can see font sampler creating it's elements, but nothing gets displayed. In the console i get the error:

`TypeError: m.dataset.fonts is undefined (fontsampler.js:117:106) p http://localhost/wp-content/plugins/fontsampler/js/fontsampler.js?ver=5.3.2:117

http://localhost/wp-content/plugins/fontsampler/js/fontsampler.js?ver=5.3.2:117 execCb http://localhost/wp-content/plugins/fontsampler/js/fontsampler.js?ver=5.3.2:109 check http://localhost/wp-content/plugins/fontsampler/js/fontsampler.js?ver=5.3.2:109 enable http://localhost/wp-content/plugins/fontsampler/js/fontsampler.js?ver=5.3.2:109 init http://localhost/wp-content/plugins/fontsampler/js/fontsampler.js?ver=5.3.2:109 a http://localhost/wp-content/plugins/fontsampler/js/fontsampler.js?ver=5.3.2:109` i added the filter `add_filter('fontsampler_enqueue_styles',true);` i also echoed the exact string of the shortcut and it's according to the docs. `echo('[fontsampler id='.$fs_id .']');` outputs `[fontsampler id=1]` EDIT: when using [fontsampler id=1] through the visual editor of a word press page it loads correctly.
kontur commented 4 years ago

What's the actual html output to the page a) when used with a shortcode b) when used with do_shortcode? It looks like it's not getting any font files passed in.

eggplantPrince commented 4 years ago

heres a test with the ubuntu font

fontsampler_htmloutput.txt

eggplantPrince commented 4 years ago

I figured it out. i had a div with the a fontsampler-wrapper class surrounding it.

kontur commented 4 years ago

Okay, great that you could solve it, thanks for keeping me in the loop 👍

On 24. Jan 2020, at 16.43, eggplantPrince notifications@github.com wrote:

 Closed #163.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.