Hi Ashley,
I'm working on a game using cocoonjs, and I had to use the CocoonJS.PromptKeyboard action.
It's all working well on the device, but when testing on the computer basically nothing happens. Which is the expected behavior. But I think it would be nice to emulate this part like this:
Acts.prototype.PromptKeyboard = function (title_, message_, initial_, type_, canceltext_, oktext_)
{
if(typeof cr_is_preview !== "undefined") {
var text = prompt(message_, initial_); // maybe something to allow the layout to refresh before calling the prompt since it's blocking whereas the cocoon prompt isn't
if(text !== null) {
input_text = text;
this.runtime.trigger(cr.plugins_.CJSAds.prototype.cnds.OnKeyboardOK, this);
} else {
this.runtime.trigger(cr.plugins_.CJSAds.prototype.cnds.OnKeyboardCancelled, this);
}
} else {
// original code
if (!this.runtime.isCocoonJs)
return;
var typestr = ["text", "num", "phone", "email", "url"][type_];
CocoonJS["App"]["showTextDialog"](title_, message_, initial_, typestr, canceltext_, oktext_);
}
};
[/code:2w354z8b]
What dya think?