sample_transitionlist.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" href="../../../themes/themeroller/maemo5-theme/ui.all.css" type="text/css" media="screen" />
  5. <link rel="stylesheet" href="../../../themes/nokia/ext-theme/maemo5/800x480/custom.css" type="text/css" media="screen" />
  6. <script src="../../../lib/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
  7. <script src="../../../src/defaults.js" type="text/javascript" charset="utf-8"></script>
  8. <script src="../../../src/core.js" type="text/javascript" charset="utf-8"></script>
  9. <style type="text/css" media="screen">
  10. body {
  11. font-size: 14px;
  12. padding: 15px;
  13. font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
  14. }
  15. p {
  16. margin: 30px 10px;
  17. }
  18. #library, #entertainment, #health, #romance {
  19. width: 330px;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <h1>Nokia.TransitionList - Sample</h1>
  25. <br/><br/>
  26. <div id="library"></div>
  27. <div id="entertainment"></div>
  28. <div id="health"></div>
  29. <div id="romance"></div>
  30. <div id="professional"></div>
  31. <div id="politics"></div>
  32. <script type="text/javascript" charset="utf-8">
  33. var init = function() {
  34. window.bookStore = new Nokia.TransitionList({
  35. element: '#library',
  36. title: 'Book Store',
  37. visible: true,
  38. create: function() {
  39. console.log("create");
  40. },
  41. show: function(openerTransitionList) {
  42. console.log("show", openerTransitionList);
  43. },
  44. hide: function() {
  45. console.log("hide list1.");
  46. },
  47. addItem: function(event, item) {
  48. console.log("addItem", item);
  49. },
  50. removeItem: function(event, item) {
  51. console.log("removeItem", item);
  52. }
  53. });
  54. window.entertainment = new Nokia.TransitionList({
  55. title: 'Entertainment',
  56. element: '#entertainment'
  57. });
  58. window.health = new Nokia.TransitionList({
  59. title: 'Health',
  60. element: '#health'
  61. });
  62. window.romance = new Nokia.TransitionList({
  63. title: 'Romance',
  64. element: '#romance'
  65. });
  66. window.professional = new Nokia.TransitionList({
  67. title: 'Professional & Technical',
  68. element: '#professional'
  69. });
  70. window.politics = new Nokia.TransitionList({
  71. title: 'Politics',
  72. element: '#politics'
  73. });
  74. bookStore.addItem(
  75. new Nokia.TransitionListItem({
  76. label: 'Entertainment',
  77. linkedList: window.entertainment,
  78. click: function() {}
  79. })
  80. );
  81. bookStore.addItem(
  82. new Nokia.TransitionListItem({
  83. label: 'Romance',
  84. linkedList: window.romance,
  85. click: function() {}
  86. })
  87. );
  88. bookStore.addItem(
  89. new Nokia.TransitionListItem({
  90. label: 'Health, Mind & Body',
  91. linkedList: window.health,
  92. click: function() {}
  93. })
  94. );
  95. var createLibrarySection = function(transitionList, linkedListMain) {
  96. transitionList.addItem(
  97. new Nokia.TransitionListItem({
  98. label: 'Back to list',
  99. icon: 'ui-icon-triangle-1-w',
  100. linkedList: linkedListMain,
  101. click: function() {}
  102. })
  103. );
  104. transitionList.addItem(
  105. new Nokia.TransitionListItem({
  106. label: 'Book 1',
  107. click: function() {
  108. alert('Book 1');
  109. }
  110. })
  111. );
  112. transitionList.addItem(
  113. new Nokia.TransitionListItem({
  114. label: 'Book 2',
  115. click: function() {
  116. alert('Book 2');
  117. }
  118. })
  119. );
  120. transitionList.addItem(
  121. new Nokia.TransitionListItem({
  122. label: 'Book 3',
  123. click: function() {
  124. alert('Book 3');
  125. }
  126. })
  127. );
  128. transitionList.addItem(
  129. new Nokia.TransitionListItem({
  130. label: 'Book 4',
  131. click: function() {
  132. alert('Book 4');
  133. }
  134. })
  135. );
  136. transitionList.addItem(
  137. new Nokia.TransitionListItem({
  138. label: 'Book 5',
  139. click: function() {
  140. alert('Book 5');
  141. }
  142. })
  143. );
  144. };
  145. createLibrarySection(window.entertainment, window.bookStore);
  146. createLibrarySection(window.health, window.bookStore);
  147. createLibrarySection(window.romance, window.bookStore);
  148. createLibrarySection(window.professional, window.bookStore);
  149. createLibrarySection(window.politics, window.bookStore);
  150. /*
  151. * Hide splash when its all done.
  152. */
  153. Nokia.hideSplash();
  154. };
  155. /*
  156. * Show splash while loading components.
  157. */
  158. Nokia.showSplash('<span>loading</span>');
  159. Nokia.use('transitionlist', init);
  160. </script>
  161. </body>
  162. </html>