MCPcopy
hub / github.com/dcloudio/mui / createPrompt

Function createPrompt

js/mui.popup.js:165–190  ·  view source on GitHub ↗
(message, placeholder, title, btnArray, callback, type)

Source from the content-addressed store, hash-verified

163 return plus.nativeUI.confirm(message, callback, title, btnArray || ['取消', '确认']);
164 };
165 var createPrompt = function(message, placeholder, title, btnArray, callback, type) {
166 if (typeof message === 'undefined') {
167 return;
168 } else {
169 if (typeof placeholder === 'function') {
170 callback = placeholder;
171 type = title;
172 placeholder = null;
173 title = null;
174 btnArray = null;
175 } else if (typeof title === 'function') {
176 callback = title;
177 type = btnArray;
178 title = null;
179 btnArray = null;
180 } else if (typeof btnArray === 'function') {
181 type = callback;
182 callback = btnArray;
183 btnArray = null;
184 }
185 }
186 if (!$.os.plus || type === 'div') {
187 return createPopup(createInner(message, title || '提示', createInput(placeholder)) + createButtons(btnArray || ['取消', '确认']), callback);
188 }
189 return plus.nativeUI.prompt(message, callback, title || '提示', placeholder, btnArray || ['取消', '确认']);
190 };
191 var closePopup = function() {
192 if (popupStack.length) {
193 popupStack[popupStack.length - 1]['close']();

Callers

nothing calls this directly

Calls 4

createPopupFunction · 0.70
createInnerFunction · 0.70
createInputFunction · 0.70
createButtonsFunction · 0.70

Tested by

no test coverage detected