Guest User

Untitled

a guest
Feb 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. !!! XML
  2. !!! 1.0
  3.  
  4. %html
  5. %head
  6. %title multiple selection demo
  7. %script{:type => 'text/javascript', :src => 'prototype.js'}
  8. %script{:type => 'text/javascript', :src => 'effects.js'}
  9. %script{:type => 'text/javascript', :src => 'controls.js'}
  10. %style{:type => 'text/css'}
  11. :sass
  12. dt
  13. :float left
  14. :clear left
  15. :width 3em
  16.  
  17. dd
  18. :margin-left 4em
  19.  
  20. ul
  21. :padding-left 0
  22. :min-height 1em
  23.  
  24. li
  25. :float left
  26. :list-style-type none
  27. :margin-right 1em
  28.  
  29. select
  30. :clear left
  31.  
  32. :javascript
  33. function edit(elem) {
  34. var show = $(elem).getElementsByClassName('show')[0];
  35. var edit = $(elem).getElementsByClassName('edit')[0];
  36.  
  37. show.hide();
  38. edit.show();
  39.  
  40. edit.getElementsByTagName('select')[0].focus();
  41. }
  42.  
  43. function _update(elem) {
  44. var show = $(elem).getElementsByClassName('show')[0];
  45. var edit = $(elem).getElementsByClassName('edit')[0];
  46.  
  47. show.innerHTML = $F(edit.getElementsByTagName('select')[0]).join(', ');
  48.  
  49. edit.hide();
  50. show.show();
  51. }
  52.  
  53. %body{:onload => "_update('os'); _update('db')"}
  54. %dl
  55. %dt
  56. %a{:href => '#', :onclick => "edit('os')"} OS
  57. %dd#os
  58. .show
  59. .edit
  60. %select{:multiple => true}
  61. %option Windows
  62. %option Linux
  63. %option Mac OS X
  64. %option Windows
  65. %option Linux
  66. %option Mac OS X
  67. %option Windows
  68. %option Linux
  69. %option Mac OS X
  70. %option Windows
  71. %option Linux
  72. %option Mac OS X
  73. %option Windows
  74. %option Linux
  75. %option Mac OS X
  76. %option Windows
  77. %option Linux
  78. %option Mac OS X
  79. %option Windows
  80. %option Linux
  81. %option Mac OS X
  82. %button{:onclick => "_update('os')"} OK
  83.  
  84. %dt
  85. %a{:href => '#', :onclick => "edit('db')"} DB
  86. %dd#db
  87. %ul.show
  88. .edit
  89. %select{:multiple => true}
  90. %option SQLite
  91. %option MySQL
  92. %option Postgres
  93. %option SQLite
  94. %option MySQL
  95. %option Postgres
  96. %option SQLite
  97. %option MySQL
  98. %option Postgres
  99. %option SQLite
  100. %option MySQL
  101. %option Postgres
  102. %option SQLite
  103. %option MySQL
  104. %option Postgres
  105. %option SQLite
  106. %option MySQL
  107. %option Postgres
  108. %option SQLite
  109. %option MySQL
  110. %option Postgres
  111. %button{:onclick => "_update('db')"} OK
Add Comment
Please, Sign In to add comment