samclarke / SCEditor

A lightweight HTML and BBCode WYSIWYG editor
http://www.sceditor.com/
Other
659 stars 188 forks source link

Icons are loaded relative in sceditor.min.js #944

Closed martijnhiemstra closed 1 year ago

martijnhiemstra commented 1 year ago

Version 3.2.0 using the cdn files

I want to implement the editor in my website and so I have included the 4 lines (1 css, 3 Javascripts) to my page as explained on the https://www.sceditor.com/ website. I use the css and js files from cdn.jsdelivr.net. I have added these to the bottom of my page so that all the elements are loaded before I initialize the editor. The editor works so that is great however there is a bug in the code that the sceditor.min.js file has a relative path to a couple of icons like blink.png. When I load the page I see in my console quiet a few 404 errors. For example the blink.png.

Since the icons link is relative the browser loads the icons relative to my page and that is the huge problem because I have a path variable in my url which means I have paths like test/1 or test/34. So this is impossible since I would need icons for every possible combination.

Is there an option to set the base url for the icons?

live627 commented 1 year ago

The optionn that will ix this is emoticonsroot

https://www.sceditor.com/documentation/options/#emoticonsroot-a-id-emoticonsroot-a

On Sat, Jul 15, 2023 at 12:01 AM Martijn Hiemstra @.***> wrote:

Version 3.2.0 using the cdn files

I want to implement the editor in my website and so I have included the 4 lines (1 css, 3 Javascripts) to my page as explained on the https://www.sceditor.com/ website. I use the css and js files from cdn.jsdelivr.net. I have added these to the bottom of my page so that all the elements are loaded before I initialize the editor. The editor works so that is great however there is a bug in the code that the sceditor.min.js file has a relative path to a couple of icons like blink.png. When I load the page I see in my console quiet a few 404 errors. For example the blink.png.

Since the icons link is relative the browser loads the icons relative to my page and that is the huge problem because I have a path variable in my url which means I have paths like test/1 or test/34. So this is impossible since I would need icons for every possible combination.

Is there an option to set the base url for the icons?

— Reply to this email directly, view it on GitHub https://github.com/samclarke/SCEditor/issues/944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJNN35FRPMBRWPKDMSF2DXQI55HANCNFSM6AAAAAA2LDVVAM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

martijnhiemstra commented 1 year ago

Awesome, thx. For some reason I completely missed the documents section.