-
Notifications
You must be signed in to change notification settings - Fork 3
/
prompt.html
47 lines (36 loc) · 1.78 KB
/
prompt.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html>
<head>
<meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
<link rel="stylesheet" href="style.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="NKit.js"></script>
<script language="javascript">
NKSetPageOpaque('prompt.html', 'NO');
var navController = new NKNavigationController();
navController.setTitle("Alert Prompt");
navController.setTintColor(0, 0, 0);
NKRegisterClass("AlertClass"); //Register the class
function showPrompt() {
//=========================
//Parameters
//=========================
//title: title of prompt
//message: message of prompt - add \n\n\n for it to be visible & change y-coordinates in yourClass.m
//cancel: cancel button label
//ok: ok button label
//placeholder: placeholder text displayed in text box
//jsFunction: javascript function to be called. See example below for proper format
//var action="showAlert?className=AlertClass&title=Prompt Alert&message=Prompt Message\n\n\n&cancel=Cancel&ok=Okay&placeholder=placeholder&jsFunction=buttonPressed('%@')"
var action="showAlert?className=AlertClass&promptPage=prompt.html&title=Prompt Alert&message=Prompt Message\n\n\n&cancel=Cancel&ok=Okay&placeholder=placeholder&jsFunction=buttonPressed('%@')"
CallNKitAction(action);
}
function buttonPressed(text) {
document.getElementById('results').innerHTML=text
}
</script>
</head>
<body>
<div class="greybutton" onClick="showPrompt()">Show Alert With Prompt</div>
<div id="results" class="infobox">Your Text Will Appear Here</div>
</body>
</html>