showModalDialog | window.showModalDialog polyfill using a dialog | User Interface library

 by   niutech JavaScript Version: 1.0.0 License: Apache-2.0

kandi X-RAY | showModalDialog Summary

kandi X-RAY | showModalDialog Summary

showModalDialog is a JavaScript library typically used in User Interface applications. showModalDialog has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i showmodaldialog' or download it from GitHub, npm.

This is a window.showModalDialog() shim using a modal HTML5 element and ECMAScript 2015 Generators or ECMAScript 2017 Async/Await. It was tested in the latest Google Chrome and in the latest Mozilla Firefox with the dom.dialog_element.enabled preference set to true in about:config. Just include the following HTML code before using showModalDialog function:. Passing both window.dialogArguments and window.returnValue is supported, provided that the dialog document is on the same server as the host document. ShowModalDialog Polyfill is using Promises, Generators, yield, async, await and the [spawn function] by Jake Archibald. If they are unavailable, the polyfill is using eval and JSON as a fallback, provided that statements are separated by new lines, the showModalDialog function is not nested and runs only once in a function.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              showModalDialog has a low active ecosystem.
              It has 143 star(s) with 83 fork(s). There are 20 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 12 open issues and 32 have been closed. On average issues are closed in 133 days. There are 4 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of showModalDialog is 1.0.0

            kandi-Quality Quality

              showModalDialog has no bugs reported.

            kandi-Security Security

              showModalDialog has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              showModalDialog is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              showModalDialog releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of showModalDialog
            Get all kandi verified functions for this library.

            showModalDialog Key Features

            No Key Features are available at this moment for showModalDialog.

            showModalDialog Examples and Code Snippets

            No Code Snippets are available at this moment for showModalDialog.

            Community Discussions

            QUESTION

            html page not showing (only in debuging tho)
            Asked 2021-Jun-02 at 14:13

            I need to display a specific html output following a condition on a variable ("tvs" a boolean).

            I created the 2 html files in another spreadsheet and tested them OK. Then I copy&pasted the samples in my much bigger spreadsheet and it doesn't work. Well, it works when i debug each 'show' functions but not in the execution of the spreadsheet.

            My script goal is to detect change in a column (process info near the change occurred), then launch modal dialogs from html files (2 possible files).

            GS code:

            ...

            ANSWER

            Answered 2021-Jun-01 at 15:45

            I found something wrong with your style in PageTvs.html

            Source https://stackoverflow.com/questions/67791614

            QUESTION

            how to calculate the size of a folder google script with google picker api
            Asked 2021-May-25 at 12:58

            Yo, I would like to create a script where the user can choose a folder and then by getting the id of the folder I display the size of the folder. I manage to retrieve the ID but I don't know how from this id I can calculate the size and display it. here is the code to show the picker google drive :

            ...

            ANSWER

            Answered 2021-May-25 at 12:58

            You can use gapi to use the Drive API and use it to do the exact same logic as you did in Apps Script. You can read the official quickstart and modify it to query the size of files instead of simply listing the names.

            Note that you'll have to load auth, client, and picker. Also you'll have to integrate the picker with it.

            References

            Source https://stackoverflow.com/questions/67686128

            QUESTION

            Google apps json data from code.gs to html dropdown
            Asked 2021-May-24 at 09:45

            Im creating a google apps script and im trying to have json data from code.gs to the html files dropdown. I don't really know how this is done by not being so experienced with JS and google's own stuff. Heres the code:

            ...

            ANSWER

            Answered 2021-May-21 at 12:09

            QUESTION

            I manage to get attach and upload on google sheet, not working....i know its either the script or the onclick= but stuck any help will be appreicated
            Asked 2021-May-04 at 15:21

            I created a Google sheet for my team and we needed to attach files on it. I found a code which i thought worked well. I haven't coded for sometime nor used google script before. But from looking at it not working it must be the script or the onclick= on submit?

            The google drive ID is fine , and i checked for all the <> and ;.....but cant seem get to my head around it to upload the file and run the functions.....

            I am using the code from https://blackstormdesign.com/how-to-upload-a-file-to-google-drive-through-google-sheets/

            Script: Upload_files

            ...

            ANSWER

            Answered 2021-May-04 at 15:21

            Sorry I was having trouble understanding the issue because I was looking at a piece of old code that was still running under Rhino. I know... stupid but anyway I finally looked at the old editor and saw the error or my ways.

            This is what I ended up with after a lot of screwing around.

            HTML: (file: ah1.html)

            Source https://stackoverflow.com/questions/67375169

            QUESTION

            How to get data from html from back to serverside code in AppScript
            Asked 2021-May-03 at 16:35

            I have search for hours and cant find a solution to this. I have some appscript code that creates a menu and open a modal in google docs:

            ...

            ANSWER

            Answered 2021-May-03 at 16:35

            So i found the problem. I was singed into google with account A, the correct one. And prompts with input and everything worked. In chrome i was signed in with account B. It seems that when you use htmlservice it uses a sandbox, and it uses the user you are logged into chrome with, not the one you are logged into workspace with. So access denined. Use same users both places to solve this problem.

            Source https://stackoverflow.com/questions/67355831

            QUESTION

            Google Sheets Script | Global Variable Loses Its Value After html sidebar/modal window
            Asked 2021-Apr-28 at 17:26

            Good day all, I have a team vacation calendar. The user presses the letter "v" to set a vacation date, to which the date of the vacation is stored in an external worksheet (used for other purposes, so I can't simply have a separate worksheet in the same spreadsheet).

            The problem, a vacation date can either be "Paid" or "Banked" (for crediting later). I use a modal Html window to ask the user which of the two, the vacation is. However, global variables I set before opening the html modal window lose their value. I need these global variables to store the row and column of the original entry (since the user clicking off the cell after typing "v" changes the value of getActiveCell().

            What SHOULD happen:

            1. user types "v"
            2. html window pops up "which vacation type is this? banked or paid?
            3. code enters the date of the vacation into the external spreadsheet.
            4. code enters the "paid" or "Banked" value into the external spreadsheet.

            I can get it to go as far as step 3 above, however, global variables are losing their values and there's no way to determine which cell the user originally clicked.

            Step 1

            Step 2

            ...

            ANSWER

            Answered 2021-Apr-26 at 19:26

            The globals are lost because the google.script.run call executes the server-side script in a new instance that has no knowledge of the state of the original server-side instance.

            The usual workaround is to use the Properties service to share state between instances.

            Source https://stackoverflow.com/questions/67272563

            QUESTION

            Google Apps Script Popup Dialog, library issues
            Asked 2021-Apr-21 at 15:45

            So I have a library that is used by several dozen sheets, which call the individual functions like this:

            (from a menu)

            ...

            ANSWER

            Answered 2021-Apr-21 at 15:45

            It turned out that the pages running the library just needed wrapper functions.

            All I had to add to the local page was four functions like this

            Source https://stackoverflow.com/questions/67079922

            QUESTION

            How can I get it to wait until the user enters the date and then it closes the dialog box and writes the value to its destination?
            Asked 2021-Mar-23 at 03:21

            Here's the problem:

            I got these codes running without error, but altogether, they won't work as expected.

            The intent is once the user ticks a box in column A, the code running on onEdit basis is supposed to open a dialog box for the user to enter the date. Then the code changes a value in one of the row's column and the date is to be written right next to it. Once the user inputs the date and clicks on Add, the dialog box is supposed to close automatically.

            I am not sure about the order of the functions and how to have the onEdit function wait until the user enters the date so that the dialog box disappears and it continues writing the date to its destination.

            Thanks for your attention.

            ...

            ANSWER

            Answered 2021-Mar-23 at 03:21
            Modification points:
            • When showModalDialog is run, the process is released from the current function. I thought that this might be the reason of your issue.
            • And, when I saw your script, I thought that AddRecord() and "Yes", new Date() and Session.getEffectiveUser().getEmail() are put with setValues.
            • In this case, uncheck() can be used.
            • In order to send dbRow from onEdit to AddRecord executing by Javascript, I used PropertiesService.

            When above points are reflected to your script, it becomes as follows.

            Modified script: Google Apps Script side:

            Please modify onEdit and AddRecord as follows.

            Source https://stackoverflow.com/questions/66756289

            QUESTION

            Responsive ModalDialog/ModelessDialog Google Script
            Asked 2021-Mar-19 at 11:28

            Is it possible the create modaldialog/modelessdialog that is always x% of the screen? I know that I can set constat width and height like so, but I'd love to have it depending on the user screen

            ...

            ANSWER

            Answered 2021-Mar-19 at 11:28

            Unfortunately, what you want cannot be achieved from Apps Script as the available methods are only: setWidth() and setHeight().

            What you can do instead is to file a feature request on Google's Issue Tracker and provide all the necessary details here.

            Source https://stackoverflow.com/questions/66683041

            QUESTION

            How to Add 'Data List' in Google Sheet Apps Script that Populates Data from from Google Sheet with Bootstrap and HTML5
            Asked 2021-Mar-05 at 09:47

            First of all apologies if this is a silly question as I am a total newbie to coding and programming.

            I am trying to create a CRM Webapp using Google Apps Script for my company that stores all of its data in Google Sheet. The work is still in progress.

            This CRM Webapp will basically have a Home Tab (to Search and Edit Data), Sales Tab (to enter Sales Entry), Purchase Tab, (to enter Purchase Entry) and Contact Tab (to add Contact Details).

            The idea is that a user will first add the contact details of a New Customer/Supplier in the Contact Tab, and this data will be stored in the Google Sheet.

            Now to make a Sales or a Purchase Entry, the user will have to now First select the already entered Contact (Only Name, Phone Number and Email Id will be visible) within the respective Tab.

            For this I am trying to add a Data List from Bootstrap which will help the user to search and select the already stored Contact Details, and the depending contact fields need to fill automatically based on the Selected Name/Email/Phone.

            I tired a lot of methods and referred several posts, but I am not able to populate the Search data from within Google Sheet. I tried using the Dropdown Logic, but even that did not work.

            Following is my code. I am pasting only the parts that will look relevant to you guys as the entire thing is very unorganized. Any help will be highly appreciated.

            Loadform.gs:

            ...

            ANSWER

            Answered 2021-Mar-05 at 09:47

            From your question I understood that you want a search to be performed that if it matches one of the names you already have stored in your sheet then the select HTML element options should get populated with the information corresponding to that name and should get disabled.

            In order to do so firstly I followed this detailed and well explained example from Apps Script guides on how to deal with forms and pass form input information to your code.gs file. Then, once I checked the input data against the Spreadsheet column A that I obtained using getValues I returned the matching data in the selected row corresponding to the inputed name. Finally I simply used innerHtml and getElementById to modify the select fields.

            I have built a simple and abstracted example on how to achieve what you were aiming for so that other users with similar doubts can learn from it. Please adapt your code to include this example. Below I have inserted images of how the sheet data is structured and of the web app working:

            The code has self-explanatory comments but if you have any doubts please feel free to ask them:

            HTML file, Code file

            Source https://stackoverflow.com/questions/66474303

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install showModalDialog

            You can install using 'npm i showmodaldialog' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i showmodaldialog

          • CLONE
          • HTTPS

            https://github.com/niutech/showModalDialog.git

          • CLI

            gh repo clone niutech/showModalDialog

          • sshUrl

            git@github.com:niutech/showModalDialog.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link