Display a editable Google Sheet on a web page - google-apps-script

I want to display an editable Google Sheet on a web page.
No problem for that.
The problem: I want to display this sheet without the menus, columns and lines. Is it possible ?
Or display the sheet in full screen mode, but I do not know the javascript function to execute when opening the sheet.
Ex.: https://docs.google.com/spreadsheets/d/1xwheykkZMb806JKNoPGcVl17TpIm4Z9LTLJb8HAhVVk/edit?usp=sharing
How to do ?
Thank you

Go to File > Publish to the Web.
And then, you will see this kind of pop up. You can publish it and also get the link. Google Slide and Docs also have this feature. As you can see it, you can also get embed tag for inserting it in HTML. You can stop publishing with the Stop publishing button whenever you want.
And as far as I know, there is no such thing that you can edit the file with that mode.

Related

Activating script via button press on embedded Google Sheet

I am trying to embed a Google Spreadsheet that has a script I'd like users to be able to activate. I don't want them to be able to edit anything on the page.
I thought I could do this by
Share sheet and set to edit permissions
Restrict editing on the one sheet I want to share (the images sit above the cells, so I thought this would prevent people from editing cells but allow them to click on the button
Publish to the web
Embed the sheet
Here is the iframe I used:
<iframe width="1250" height=1000 src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRRajy1TK9Y9YQg-Df3bwTy9ktxPECq6T5gS7UfkrYpV_osxwDwRuQClC168B8-o4KsCdFl4kfMYtau/pubhtml?gid=1796260078&single=true&widget=true&headers=false"></iframe>
For context the scripts hide or show different rows. Clicking "show game 2" hides a section of rows and "show game 1" unhides these rows.
The sheet embeds okay but isn't interactable. I have turned off the restricted editing to test (it's back on) and that didn't allow people to edit anything, so I am not sure what I am doing wrong here.
Any help would be greatly appreciated! Cheers!
Workaround:
Use a another button outside the embedded spreadsheet instead.
Publish a headless web-app from your sheet using doPost()
On Button click, use JavaScript to post from your website to apps script web-app
On receiving post request, hide/show the rows using your original script.
References:
Web-app

Serve HTML as a Google Docs, Sheets, Slides, or Forms user interface doesn't work

I'm trying the example presented by Google for adding a menu item that displays a dialog in a Google spreadsheet found here: https://developers.google.com/apps-script/guides/html/ Upon selecting 'Open' from the added menu, the dialog comes up but only displays the title. The 'Hello World' and button do not display. Is their code outdated or ???
Here's a link to a spreadsheet with the example code. Doesn't work for me. Dialog comes up with only the title. https://docs.google.com/spreadsheets/d/1hYMQIlvV39iXHXYkkHanu4bL5p9F0aF7Up-F7oRoHLE/edit?usp=sharing
Thank you Cooper. It turns out it was a browser extension causing the issue.

Google Chrome extension - integrate with Google Calendar

How can a Chrome extension alter the Google Calendar event editing UI?
I see that, for example, the Moxtra extension has managed to inject UI including a button just below the location. According to their YouTube video they added a button to fill out the event description although when I installed Moxtra this no longer seems to work.
Stepping back from this a bit, it occurs to me that editing the Google Calendar page seems like something that could easily get messed up by future changes to Google Calendar. Perhaps it is better to edit the event description from the extension's own UI? If so, how can that be done?
Thanks.
It can be done with content scripts and modification of the DOM.
They probably check Event edit page for specific selectors and try to insert their own elements in the page, if they found it.
So, if UI of Google Calendar will change, extensions like Moxtra will be probably also broken.
You are right about the edit of the description - it's safer. But you still need to get a description field and change a content of it. There is no 100% safe way to do it and don't break on the change of UI.

Adding Button in Gmail for web users

I am trying to figure out how can I add a button to the Gmail compose window.
Please see the image below for better idea..
Using Google App Script I have achieved some functionality where we can create almost anything, but How can We create a button in Gmail?
Even if not compose window as shown in image above, I will like to learn how to add button at any place in Gmail.com's window using gadget or any other way.
Note: I have tried many things and ended up nowhere, The Sidebar is deprecated by google so please don't highlight that..
I will be glad if any working code to add button in Gmail available,
Thanks in advance

Pop out Google Picker from IFRAME in Google Sites Apps Script Gadget?

So I made this google apps script to use the google picker on my google sites webpage. The apps script is inserted into the webpage via the google apps script gadget. This all functions as I intended, however, it does not behave the way I'd like it to or expected. Everything is rendered inside the requisite IFRAME. And from what I can find and tried, this has to be the case (please correct me if I'm wrong). This requires me to provide the screen real estate to show the picker even when it's not visible - which is pretty poor design. Does anyone know a way around this? That is, to make the picker modal to or pop out of the IFRAME instead stuck inside it?