sample_custom.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" href="../themes/nokia/base/base.css" type="text/css" media="screen">
  5. <link rel="stylesheet" href="../themes/nokia/base/button.css" type="text/css" media="screen">
  6. <link rel="stylesheet" href="../themes/nokia/base/optiongroup.css" type="text/css" media="screen">
  7. <link rel="stylesheet" href="../themes/nokia/base/checkbox.css" type="text/css" media="screen">
  8. <style type="text/css" media="screen">
  9. body {
  10. font-size: 14px;
  11. padding: 15px;
  12. font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
  13. }
  14. p {
  15. margin: 30px 10px;
  16. }
  17. #optiongroup {
  18. clear: both;
  19. }
  20. #container {
  21. max-width: 640px;
  22. padding: 10px;
  23. }
  24. /*
  25. * Custom CSS
  26. */
  27. /* State Default */
  28. .nokia-button .ui-state-default, .nokia-optiongroup .ui-state-default {
  29. background: blue;
  30. color: white;
  31. }
  32. .nokia-button .nokia-border-state-default b, .nokia-optiongroup .nokia-border-state-default b {
  33. background: blue;
  34. }
  35. /* State Active */
  36. .nokia-button .ui-state-active, .nokia-optiongroup .ui-state-active {
  37. background: red;
  38. }
  39. .nokia-button .nokia-border-state-active b, .nokia-optiongroup .nokia-border-state-active b {
  40. background: red;
  41. }
  42. /* State Hover */
  43. .nokia-button .ui-state-hover {
  44. background: green;
  45. }
  46. .nokia-button .nokia-border-state-hover b {
  47. background: green;
  48. }
  49. /* State Disabled */
  50. .nokia-button .ui-state-disabled {
  51. opacity: .35;
  52. filter:Alpha(Opacity=35);
  53. background-image: none;
  54. }
  55. .nokia-button .nokia-border-state-disabled b {
  56. opacity: .35;
  57. filter:Alpha(Opacity=35);
  58. background-image: none;
  59. }
  60. /* State HighLight */
  61. .nokia-button .ui-state-highlight {
  62. background: yellow;
  63. color: black;
  64. }
  65. .nokia-button .nokia-border-state-highlight b {
  66. background: yellow;
  67. }
  68. </style>
  69. </head>
  70. <body>
  71. <div id="container">
  72. <span id="button01" class="btn"></span>
  73. <span id="button02" class="btn"></span>
  74. <span id="button03" class="btn"></span>
  75. <span id="button04" class="btn"></span>
  76. <div id="optiongroup"></div>
  77. <input type="checkbox" name="check1" value="" id="check1" />
  78. </div>
  79. <script src="../lib/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
  80. <script src="../src/core.js" type="text/javascript" charset="utf-8"></script>
  81. <script src="../src/dom.js" type="text/javascript" charset="utf-8"></script>
  82. <script src="../src/util.js" type="text/javascript" charset="utf-8"></script>
  83. <script src="../src/widget.js" type="text/javascript" charset="utf-8"></script>
  84. <script src="../src/button.js" type="text/javascript" charset="utf-8"></script>
  85. <script src="../src/optionbox.js" type="text/javascript" charset="utf-8"></script>
  86. <script src="../src/checkbox.js" type="text/javascript" charset="utf-8"></script>
  87. <script src="../src/optiongroup.js" type="text/javascript" charset="utf-8"></script>
  88. <script type="text/javascript" charset="utf-8">
  89. window.onload = function() {
  90. // creating a new instance of Nokia.SampleWidget that inherits from Nokia.Widget
  91. var btn1 = new Nokia.Button({
  92. element: '#button01',
  93. disabled: false,
  94. keeppressed: false,
  95. label: 'Button 01'
  96. });
  97. var btn2 = new Nokia.Button({
  98. element: '#button02',
  99. disabled: true,
  100. label: 'Disabled'
  101. });
  102. var btn3 = new Nokia.Button({
  103. element: '#button03',
  104. disabled: false,
  105. keeppressed: true,
  106. label: 'Button 03',
  107. pressed: true,
  108. width: 90,
  109. press: function() {
  110. this.setLabel('Pressed');
  111. btn1.disable();
  112. btn1.setLabel('Disabled');
  113. },
  114. unpress: function() {
  115. this.setLabel('Unpressed');
  116. btn1.enable();
  117. btn1.setLabel('Enabled');
  118. }
  119. });
  120. var btn4 = new Nokia.Button({
  121. element: '#button04',
  122. disabled: false,
  123. label: 'Unfocused',
  124. width: 90,
  125. focus: function() {
  126. this.setLabel('Focused');
  127. },
  128. unfocus: function() {
  129. this.setLabel('Unfocused');
  130. }
  131. });
  132. var check1 = new Nokia.CheckBox({
  133. element: '#check1',
  134. label: 'testing checkbox 1',
  135. wrapper: 'div'
  136. });
  137. var optionGroup = new Nokia.OptionGroup({
  138. element: '#optiongroup',
  139. title: 'Option Group'
  140. });
  141. optionGroup.addItem(check1);
  142. };
  143. </script>
  144. </body>
  145. </html>