/apps/testapp/Resources/index.html

https://github.com/leongersing/titanium_desktop · HTML · 124 lines · 116 code · 8 blank · 0 comment · 0 complexity · 5a96c28b7731ce6c13da29683f1b05de MD5 · raw file

  1. <html>
  2. <head>
  3. <style>
  4. body { font-family: sans, sans-serif; padding: 0px; }
  5. #navbar {
  6. font-family: 'Lucida Grande', Georgia;
  7. background-color: #3e3e3e;
  8. color: #fff;
  9. margin: 0px;
  10. padding: 5px;
  11. }
  12. #title {
  13. font-weight: bold;
  14. color: #b5bdc9;
  15. margin-right: 50px;
  16. }
  17. #title img {
  18. margin-right: 5px;
  19. text-align: center;
  20. vertical-align: middle;
  21. }
  22. a.bye {
  23. margin-left: 20px;
  24. padding: 3px 10px 3px 10px;
  25. background-color: #e3e3e3;
  26. font-size: 7.5pt;
  27. color: #f33;
  28. text-decoration: none;
  29. }
  30. #tests {
  31. font-family: 'Lucida Grande', Georgia;
  32. background-color: #3e3e3e;
  33. color: #fff;
  34. }
  35. #testframe {
  36. border-width: 0px;
  37. width: 100%;
  38. height: 800px;
  39. padding: 5px;
  40. }
  41. </style>
  42. <script>
  43. function $(id) { return document.getElementById(id); }
  44. function openTest() {
  45. var test = $('tests').options[$('tests').selectedIndex].value;
  46. if(test.indexOf("http") == 0) {
  47. window.location = test;
  48. }
  49. else {
  50. $('testframe').src = test;
  51. }
  52. }
  53. function bye() { Titanium.App.exit(); }
  54. window.onunload = function()
  55. {
  56. Titanium.API.debug("bye bye from window.onunload from index.html");
  57. }
  58. </script>
  59. </head>
  60. <body>
  61. <div id="navbar">
  62. <span id="title"><img src="images/logo_small.png"/>Titanium Test App</span>
  63. Select a Test:
  64. <select id="tests" onchange="openTest();">
  65. <option selected="selected">test-newmenu.html</option>
  66. <option>test-app.html</option>
  67. <option>test-filesystem.html</option>
  68. <option>test-filesystem-filestream.html</option>
  69. <option>test-desktop.html</option>
  70. <option>test-notification.html</option>
  71. <option>test-media.html</option>
  72. <option>test-ui.html</option>
  73. <option>test-ui2.html</option>
  74. <option>test-dock.html</option>
  75. <option>test-network.html</option>
  76. <option>test-platform.html</option>
  77. <option>test-process.html</option>
  78. <option>test-scripts.html</option>
  79. <option>test-database.html</option>
  80. <option>test-ajax.html</option>
  81. <option>test-ajax-prototype.html</option>
  82. <option>test-ajax-local.html</option>
  83. <option>test-iframe.html</option>
  84. <option>test-userscript.html</option>
  85. <option>test-css.html</option>
  86. <option>test-known-webkit-issues.html</option>
  87. <option>fullscreen.html</option>
  88. <option>http://demos.mootools.net/</option>
  89. <option>http://cappuccino.org/learn/demos/</option>
  90. <option>http://www.google.com/</option>
  91. <option>http://mail.google.com/mail</option>
  92. <option>http://www.rai.tv/dl/RaiTV/homeTv.html</option>
  93. <option>http://twitter.com</option>
  94. <option>http://www.w3.org/People/mimasa/test/object/java/clock</option>
  95. <option>http://service.futuremark.com/peacekeeper/run.action</option>
  96. </select>
  97. <span><a class="bye" href="javascript:bye();">bye</a></span>
  98. </div>
  99. <iframe id="testframe"></iframe>
  100. <script>
  101. window.onload = function() {
  102. if (Titanium.App.arguments.length > 0) {
  103. test = Titanium.App.arguments[0];
  104. test = "test-"+test+".html";
  105. for (var i = 0; i < $('tests').options.length; i++) {
  106. if ($('tests').options[i].value == test) {
  107. $('tests').selectedIndex = i;
  108. break;
  109. }
  110. }
  111. }
  112. openTest();
  113. }
  114. </script>
  115. </body>
  116. </html>