Skip to content

Commit b646c6d

Browse files
committed
Change from UiApp to HtmlService.
1 parent 08cb0d7 commit b646c6d

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Code.gs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,20 @@ function makeButton(app, parent, name, callback) {
128128
return button;
129129
}
130130

131-
function makeTextBox(app, name) {
132-
var textArea = app.createTextArea().setWidth('100%').setHeight('100px').setId(name).setName(name);
131+
function makeTextBox(id, content) {
132+
var textArea = '<textarea rows="10" cols="80" id="' + id + '">' + content + '</textarea>';
133133
return textArea;
134134
}
135135

136136
function displayTexts_(texts) {
137137

138-
var app = UiApp.createApplication().setTitle('Export');
138+
var app = HtmlService.createHtmlOutput().setWidth(800).setHeight(600);
139139

140140
for (var i = 0; i < texts.length; i++) {
141-
app.add(makeTextBox(app, 'json' + i));
142-
app.getElementById('json' + i).setText(texts[i]);
141+
app.append(makeTextBox("export_" + i, texts[i]))
143142
}
144143

145-
var ss = SpreadsheetApp.getActiveSpreadsheet();
146-
ss.show(app);
144+
SpreadsheetApp.getUi().showModalDialog(app, "Translations");
147145

148146
return app;
149147
}

0 commit comments

Comments
 (0)