theacodes / kicanvas

The KiCAD web viewer
https://kicanvas.org
Other
609 stars 29 forks source link

Add the inline source support. #56

Open XiangYyang opened 10 months ago

XiangYyang commented 10 months ago

I tried to add the inline source support by changing the FetchFileSystem.

I added a FetchFileSource class to help determine data sources, from URL or inline sources.

When the source is an inline source, the load_src method of KiCanvasEmbedElement will use two attributes. The filename will be obtained from the attribute originname and the type attribute describes the file type. When the originname attribute is empty, that will generate a default name for this file. Likewise, it will determine whether the inline source is sch or pcb by the first few characters when the type attribute is empty.

Finally, the file type and the origin name will be contacted, and it as the inline source file name.

theacodes commented 10 months ago

Thanks for doing this! I'll take a look when I have a chance - probably this weekend or early next week. :)

XiangYyang commented 8 months ago

Could you please review this pr? Thanks.

theacodes commented 8 months ago

I will once I have enough time to review it thoroughly.

On Thu, Jan 11, 2024 at 9:09 PM 向阳 @.***> wrote:

Could you please review this pr? Thanks.

— Reply to this email directly, view it on GitHub https://github.com/theacodes/kicanvas/pull/56#issuecomment-1888303322, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I42E7UANHFA2J74EOO3YOCLOXAVCNFSM6AAAAAA7F27GISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBYGMYDGMZSGI . You are receiving this because you commented.Message ID: @.***>