MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / promptCreateSelect

Function promptCreateSelect

external_resource/prompt/page/prompt.js:249–269  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

247
248//create multiple select
249function promptCreateSelect(options) {
250 const dataElement = document.createElement("select");
251 let optionElement;
252
253 for (const k in options.selectOptions) {
254 if (!Object.prototype.hasOwnProperty.call(options.selectOptions, k)) {
255 continue;
256 }
257
258 optionElement = document.createElement("option");
259 optionElement.setAttribute("value", k);
260 optionElement.textContent = options.selectOptions[k];
261 if (k === options.value) {
262 optionElement.setAttribute("selected", "selected");
263 }
264
265 dataElement.append(optionElement);
266 }
267
268 return dataElement;
269}
270
271function promptCreateCounter(parentElement) {
272 if (promptOptions.counterOptions?.multiFire) {

Callers 2

promptRegisterFunction · 0.85
promptCreateMultiInputFunction · 0.85

Calls 2

callMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected