index.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="format-detection" content="telephone=no" />
  6. <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
  7. <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
  8. <link rel="stylesheet" type="text/css" href="css/index.css" />
  9. <meta name="msapplication-tap-highlight" content="no" />
  10. <title>Hello ActionSheet</title>
  11. </head>
  12. <body>
  13. <div class="app">
  14. <h1>ActionSheet demo</h1>
  15. <div id="deviceready" class="blink">
  16. <p class="event listening">Connecting to Device</p>
  17. <p class="event received">Device is Ready</p>
  18. <button onclick="testShareSheet()">Test Share</button><br/><br/>
  19. <button onclick="testDeleteSheet()">Test Delete</button><br/><br/>
  20. <button onclick="testLogoutSheet()">Test Logout</button>
  21. </div>
  22. </div>
  23. <script type="text/javascript" src="cordova.js"></script>
  24. <script type="text/javascript" src="js/index.js"></script>
  25. <script type="text/javascript">
  26. app.initialize();
  27. var callback = function(buttonIndex) {
  28. setTimeout(function() {
  29. alert('button index clicked: ' + buttonIndex);
  30. });
  31. };
  32. function testShareSheet() {
  33. var options = {
  34. 'androidTheme' : window.plugins.actionsheet.ANDROID_THEMES.THEME_HOLO_LIGHT,
  35. 'title': 'What do you want with this image?',
  36. 'buttonLabels': ['Share via Facebook', 'Share via Twitter'],
  37. 'addCancelButtonWithLabel': 'Cancel',
  38. 'androidEnableCancelButton' : true,
  39. 'winphoneEnableCancelButton' : true,
  40. 'addDestructiveButtonWithLabel' : 'Delete it'
  41. };
  42. window.plugins.actionsheet.show(options, callback);
  43. }
  44. function testDeleteSheet() {
  45. var options = {
  46. 'addCancelButtonWithLabel': 'Cancel',
  47. 'addDestructiveButtonWithLabel' : 'Delete note'
  48. };
  49. window.plugins.actionsheet.show(options, callback);
  50. }
  51. function testLogoutSheet() {
  52. var options = {
  53. 'buttonLabels': ['Log out'],
  54. 'androidEnableCancelButton' : true,
  55. 'winphoneEnableCancelButton' : true,
  56. 'addCancelButtonWithLabel': 'Cancel'
  57. };
  58. window.plugins.actionsheet.show(options, callback);
  59. }
  60. </script>
  61. </body>
  62. </html>