forked from EddyVerbruggen/cordova-plugin-actionsheet
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
70 lines (64 loc) · 2.43 KB
/
index.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<meta name="msapplication-tap-highlight" content="no" />
<title>Hello ActionSheet</title>
</head>
<body>
<div class="app">
<h1>ActionSheet demo</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
<button onclick="testShareSheet()">Test Share</button><br/><br/>
<button onclick="testDeleteSheet()">Test Delete</button><br/><br/>
<button onclick="testLogoutSheet()">Test Logout</button>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
var callback = function(buttonIndex) {
setTimeout(function() {
alert('button index clicked: ' + buttonIndex);
});
};
function testShareSheet() {
var options = {
androidTheme : window.plugins.actionsheet.ANDROID_THEMES.THEME_DEVICE_DEFAULT_LIGHT, // material
title: 'What do you want with this image?',
subtitle: 'Choose wisely, my friend', // supported on iOS only
buttonLabels: ['Share via Facebook', 'Share via Twitter'],
addCancelButtonWithLabel: 'Cancel',
androidEnableCancelButton : true,
winphoneEnableCancelButton : true,
addDestructiveButtonWithLabel : 'Delete it',
destructiveButtonLast: true // you can choose where the destructive button is shown
};
window.plugins.actionsheet.show(options, callback);
}
function testDeleteSheet() {
var options = {
'addCancelButtonWithLabel': 'Cancel',
'addDestructiveButtonWithLabel' : 'Delete note'
};
window.plugins.actionsheet.show(options, callback);
}
function testLogoutSheet() {
var options = {
'buttonLabels': ['Log out'],
'androidEnableCancelButton' : true,
'winphoneEnableCancelButton' : true,
'addCancelButtonWithLabel': 'Cancel'
};
window.plugins.actionsheet.show(options, callback);
}
</script>
</body>
</html>