Skip to content

Commit

Permalink
Added new functions
Browse files Browse the repository at this point in the history
  • Loading branch information
WillDev12 authored Feb 24, 2023
1 parent 2574239 commit 5115824
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/library.gs
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
function popUp(text, title) {var ss = SpreadsheetApp.getActiveSpreadsheet();var doc = DocumentApp.getActiveDocument();if (ss != null && ss != undefined) {var ui = SpreadsheetApp.getUi();var code = '<!DOCTYPE html><html><head><base target="_top"><link rel="stylesheet" type="text/css" href="https://www.w3schools.com/w3css/4/w3.css" /><script>function closeForm() {google.script.host.close();}</script></head><body><div class="w3-container"><div class="w3-container w3-green"><h2>'+ title + '</h2></div><form class="w3-container w3-light-grey" style="padding-bottom: 20px; padding-top: 20px"><H3>' + text + '</H3><br><button class="w3-button w3-blue" onclick="closeForm()" style="width: 150px; height: 40px; padding-bottom: 20"/>Ok</form></div></body></html>';var InputF = HtmlService.createHtmlOutput(code).setWidth(800).setHeight(250);ui.showModalDialog(InputF, "‎");} else if (doc != null && doc != undefined) {var dui = DocumentApp.getUi();var code = '<!DOCTYPE html><html><head><base target="_top"><link rel="stylesheet" type="text/css" href="https://www.w3schools.com/w3css/4/w3.css" /><script>function closeForm() {google.script.host.close();}</script></head><body><div class="w3-container"><div class="w3-container w3-green"><h2>'+ title + '</h2></div><form class="w3-container w3-light-grey" style="padding-bottom: 20px; padding-top: 20px"><H3>' + text + '</H3><br><button class="w3-button w3-blue" onclick="closeForm()" style="width: 150px; height: 40px; padding-bottom: 20"/>Ok</form></div></body></html>';var InputF = HtmlService.createHtmlOutput(code).setWidth(800).setHeight(250);dui.showModalDialog(InputF, "‎");}}

function showDialogFromHtml(html, title) {var ss=SpreadsheetApp.getActiveSpreadsheet(),doc = DocumentApp.getActiveDocument();if (ss != null && ss != undefined){SpreadsheetApp.getUi().showModalDialog(HtmlService.createHtmlOutput(html), title);} else if (doc != null && doc != undefined) {DocumentApp.getUi().showModalDialog(HtmlService.createHtmlOutput(html), title);}}
function showSidebarFromHtml(html, title) {var ss=SpreadsheetApp.getActiveSpreadsheet(),doc=DocumentApp.getActiveDocument();if (ss != null && ss != undefined){SpreadsheetApp.getUi().showSidebar(HtmlService.createHtmlOutput(html).setTitle(title));} else if (doc != null && doc != undefined) {DocumentApp.getUi().showSidebar(HtmlService.createHtmlOutput(html).setTitle(title));}}

0 comments on commit 5115824

Please sign in to comment.