Approach to embedding excel using javascript

I would like my members to be able to add an embedded Excel spreadsheet to their posts. This can be accomplished with javascript, e.g.:

<div id="myExcelDiv" style="width: 402px; height: 346px"></div>
<script type="text/javascript" src="https://onedrive.live.com/embed?resid=6C685993F809A9F8%212757&authkey=%21AABR6KgqMF_ImYs&em=3&wdDivId=%22myExcelDiv%22&wdDownloadButton=1&wdAllowInteractivity=0&wdAllowTyping=1"></script>

But - understandably - this is removed from any post, what would be an approach to make something like this possible?

EDIT Bonus points for a solution that only allows javascript from e.g. https://onedrivelive.com/embed or

1 Like

Stupid question, but… why? Why would’t you want let people use what ever softwear they want and have?

I just wondering myself in the situation where an excel sheet size of 402x345px with all toolbars etc is served inside of a discourse topic and I have a mobile in use. That is… quite hard to use.

So, the main question is here what are you trying to achieve — because that dictates what the best solution is, embedding or something else.

2 Likes

Thank you, I appreciate that it is not perfect. I want people to “speak” Excel on my forum. Spreadsheets are a format that are neither code, nor screenshot-able.

If you are trying to understand an explanation of how something is done in Excel, you need to look at the sheet at the same time.

That size was just from example code, I’m not wedded to that.

You cannot have all the toolbars, I would actually like to keep the Formula Bar, but this is not possible (there is no argument for this).

It will be a challenge to do this well on mobile, but TBH spreadsheets and mobile just don’t go together (although discussion about spreadsheets should be possible).

Does that clarify a bit?

ps. I didn’t quite understand what you mean with

1 Like

Your could message s theme component that added a bbcode for those and have it check that the url was from the right place.

1 Like

If you take a look at Table builder theme-component there is a discussion there on adding excell like features. But requires the paid version? for the advanced features.

Here is I think the beginning of the discussion.

1 Like

Thank you, indeed, I wrote that post.

I think both are interesting for different use cases.

2 Likes

I’m using the basic editor plugin (forked to get it running again), it would be nice to find a solution that could work with this.

Perhaps members could simply post the public OneDrive URL and I could automatically replace it with the javascript.

Is this something that is common? (post-processing of posts)

1 Like

Reading more, this probably could be done with a modification (adding) to the post-cooking process

2 Likes

I found a (9 yo) plugin by @naveedahmada036 that does something like this for Google Sheets:

I tried it out, it more or less works (I need to whitelist google docs URLs). EDIT: I tried to whitelist option, but still not working well.

The plugin uses iframes (which are well supported in Discourse), This could be a solution for me, but I think it would be nicer to use javascripts.

This plugin also broke my WYSIWYG plugin basic editor, I wonder why.

EDIT 2: the plugin is actually by Daniel Fernández, I presume @Daniel_Fernandez_Pes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.