For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 11 replies, 3 voices, and was last updated 13 years, 5 months ago by
fbod383.
-
AuthorPosts
-
fbod383MemberOK, so I have a popup alert that notifies people of a legal disclaimer, there must be a way to change the JS to allow on click to go to another page instead of just closing the popup alert. I have tried a few different options, but I am just stabbing in the dark. I’ve found the action in my Main.JS just not sure where to go from there
February 26, 2013 at 12:27 pm #335983
BrandonMemberTry this:
var r=confirm("Press a button"); if (r==true) { x="You pressed OK!"; //or do something } else { x="You pressed Cancel!"; //or do something else } alert(x);February 26, 2013 at 1:39 pm #335987
fbod383MemberThanks Brandon, but the code I have is like this… or am I even in the right area?
‘action15’:function() { setTimeout(function() { phoneui.alert(‘Alert: You have activated GRL Lawβs Rights Reminder. If enabled, your phone voice recorder has also been activated to ensure any interaction between you and law enforcement is recorded to fully protect your rights. Keep your phone on your person if possible.’); }, 0);;}};
February 26, 2013 at 1:48 pm #335988
BrandonMemberSorry I misunderstood.
Try the phoneui gotopage function.
For some reason it wont let me type in the code…
February 26, 2013 at 1:50 pm #335989
fbod383MemberI did that, but I must be putting it in the wrong spot, because it doesnt work. I assumed the 0 at the end was a end command, so I placed the function there but it just killed the whole screen.
February 26, 2013 at 1:53 pm #335990
BrandonMemberTry right after this: possible.’); phoneui.goto page
February 26, 2013 at 2:03 pm #335992
fbod383Memberthat did the trick, thanks! Last question, and I saw something about this but didnt quite make sense of it.. how do I get the file location removed from the top of the popup box?
February 26, 2013 at 2:18 pm #335993
BrandonMemberIf I remember right I dont think its possible right now.
February 26, 2013 at 2:33 pm #335994
fbod383Memberthis is what I found earlier
@support-wayne wrote:
Hi Nigel,
Following are 2 phoneui.js api that can be used in apps and webapps. The app context using the phonegap notification api which does not include the app URL. When used in a webapp the implementation falls back to standard javascript alert() and confirm() dialogs with the app url. In the jsdoc ‘TC’ refers to Test Center.
/** * shows alert and calls fnContinue then. Note: works in different * ways in iOS and TC. For TC it returns immediately, while for iOS * it returns only when user pressed OK * * @param message Text message * @param fnContinue function that called when user selected button. * @param optionalTitle optional, title for dialog * @param optionalButtonLabel optional, button label */ phoneui.alert(message, fnContinue, optionalTitle, optionalButtonLabel) /** * shows confirmation dialog. result comes to fnContinue. Blocks in web app, doesn't block in * phonegap apps * * @param message Text message * @param fnContinue function that called when user selected button. Takes 1-based index of selected button * @param optionalTitle optional, title for dialog * @param optionalButtonLabel optional, string with comma-separated button labels */ phoneui.confirm(message, fnContinue, optionalTitle, optionalButtonLabel) {February 26, 2013 at 2:52 pm #335995
BrandonMemberOh, I do rember seeing that using the phoneui, but I havent done anything with that, so Im not the best one. Hopefully Support or one of the people who have done more native apps can shed some light on how to use it better.
February 27, 2013 at 1:19 am #336014
paulDMemberAnother way to do it would be use an image as the the alert pop up. You could have it hidden until you need it. So on user click, it shows the alert box image. On user clicking the alert image it would hide the alert image then fire a function to transit to another mobi page.
That would be pretty easy to to implement with a css.visible or maybe toggle for the image. Then just fire a function with a phoneui.gotoPage()
Thanks
Paul
February 27, 2013 at 11:29 am #336026
fbod383MemberGreat idea paul.. I am gonna play with that see which I like better
-
AuthorPosts
