From 5115824de8a7362b89ff540e7bce014c217565e2 Mon Sep 17 00:00:00 2001 From: WillDevv12 <93289932+WillDev12@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:25:11 -0500 Subject: [PATCH] Added new functions --- src/library.gs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/library.gs b/src/library.gs index b829c28..fbca71d 100644 --- a/src/library.gs +++ b/src/library.gs @@ -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 = '

'+ title + '

' + text + '


';var InputF = HtmlService.createHtmlOutput(code).setWidth(800).setHeight(250);ui.showModalDialog(InputF, "‎");} else if (doc != null && doc != undefined) {var dui = DocumentApp.getUi();var code = '

'+ title + '

' + text + '


';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));}}