spiderfw 0.5.19 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. data/CHANGELOG +7 -0
  2. data/VERSION +1 -1
  3. data/apps/core/auth/lib/rbac.rb +7 -2
  4. data/apps/core/auth/models/mixins/rbac_provider.rb +66 -4
  5. data/apps/core/components/assets.rb +63 -33
  6. data/apps/core/components/public/js/jquery/{jquery-1.4.3.js → jquery-1.5.2.js} +2617 -1126
  7. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/overlay/overlay.apple.js +155 -0
  8. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/overlay/overlay.js +293 -0
  9. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/scrollable/scrollable.js +335 -0
  10. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tabs/tabs.css +59 -0
  11. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tabs/tabs.js +283 -0
  12. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/toolbox/toolbox.expose.js +224 -0
  13. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.dynamic.js +150 -0
  14. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.js +343 -0
  15. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js +78 -0
  16. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/button_bg.png +0 -0
  17. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/datepicker.gif +0 -0
  18. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/icon_sprite.png +0 -0
  19. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/progress_bar.gif +0 -0
  20. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_h_bg.gif +0 -0
  21. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_handles.png +0 -0
  22. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_v_bg.gif +0 -0
  23. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/tab_bg.gif +0 -0
  24. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/the_gradient.gif +0 -0
  25. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-anim_basic_16x16.gif +0 -0
  26. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  27. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  28. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_flat_10_000000_40x100.png +0 -0
  29. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  30. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  31. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  32. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  33. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  34. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  35. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_222222_256x240.png +0 -0
  36. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_228ef1_256x240.png +0 -0
  37. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ef8c08_256x240.png +0 -0
  38. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ffd27a_256x240.png +0 -0
  39. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ffffff_256x240.png +0 -0
  40. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/jquery-ui.custom.css +0 -0
  41. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-af.js +0 -0
  42. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-ar-DZ.js +23 -0
  43. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ar.js +7 -8
  44. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-az.js +0 -0
  45. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-bg.js +0 -0
  46. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-bs.js +0 -0
  47. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ca.js +0 -0
  48. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-cs.js +0 -0
  49. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-da.js +0 -0
  50. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-de.js +0 -0
  51. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-el.js +0 -0
  52. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-en-AU.js +23 -0
  53. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-en-GB.js +0 -0
  54. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-en-NZ.js +23 -0
  55. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-eo.js +0 -0
  56. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-es.js +0 -0
  57. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-et.js +0 -0
  58. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-eu.js +0 -0
  59. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fa.js +0 -0
  60. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fi.js +0 -0
  61. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fo.js +0 -0
  62. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fr-CH.js +0 -0
  63. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fr.js +12 -10
  64. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-gl.js +23 -0
  65. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-he.js +0 -0
  66. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hr.js +0 -0
  67. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hu.js +1 -1
  68. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hy.js +0 -0
  69. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-id.js +0 -0
  70. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-is.js +0 -0
  71. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-it.js +0 -0
  72. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ja.js +0 -0
  73. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ko.js +0 -0
  74. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-kz.js +23 -0
  75. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-lt.js +0 -0
  76. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-lv.js +0 -0
  77. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-ml.js +23 -0
  78. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ms.js +0 -0
  79. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-nl.js +0 -0
  80. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-no.js +23 -0
  81. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-pl.js +0 -0
  82. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-pt-BR.js +0 -0
  83. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-pt.js +22 -0
  84. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-rm.js +21 -0
  85. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ro.js +0 -0
  86. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ru.js +1 -1
  87. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sk.js +0 -0
  88. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sl.js +0 -0
  89. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sq.js +0 -0
  90. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sr-SR.js +0 -0
  91. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sr.js +0 -0
  92. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sv.js +0 -0
  93. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ta.js +0 -0
  94. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-th.js +1 -1
  95. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-tj.js +23 -0
  96. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-tr.js +0 -0
  97. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-uk.js +0 -0
  98. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-vi.js +0 -0
  99. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-CN.js +0 -0
  100. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-HK.js +0 -0
  101. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-TW.js +0 -0
  102. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.blind.js +3 -3
  103. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.bounce.js +3 -3
  104. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.clip.js +3 -3
  105. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.core.js +48 -15
  106. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.drop.js +3 -3
  107. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.explode.js +2 -2
  108. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/jquery.effects.fade.js +32 -0
  109. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.fold.js +3 -3
  110. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.highlight.js +2 -2
  111. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.pulsate.js +2 -2
  112. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.scale.js +4 -4
  113. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.shake.js +3 -3
  114. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.slide.js +4 -4
  115. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.transfer.js +2 -2
  116. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.accordion.js +33 -20
  117. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.autocomplete.js +104 -42
  118. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.button.js +35 -13
  119. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.core.js +111 -84
  120. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.datepicker.js +87 -46
  121. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.dialog.js +105 -75
  122. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.draggable.js +17 -15
  123. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.droppable.js +5 -5
  124. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.mouse.js +16 -11
  125. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.position.js +51 -32
  126. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.progressbar.js +24 -10
  127. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.resizable.js +7 -7
  128. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.selectable.js +3 -3
  129. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.slider.js +9 -7
  130. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.sortable.js +22 -20
  131. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.tabs.js +15 -14
  132. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.widget.js +50 -25
  133. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → plugins/bsmselect}/GPL-LICENSE.txt +1 -1
  134. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → plugins/bsmselect}/MIT-LICENSE.txt +3 -7
  135. data/apps/core/components/public/js/jquery/plugins/bsmselect/README.md +185 -0
  136. data/apps/core/components/public/js/jquery/plugins/bsmselect/css/jquery.bsmselect.css +64 -0
  137. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.compatibility.js +60 -0
  138. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +381 -0
  139. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.sortable.js +49 -0
  140. data/apps/core/components/public/js/plugins/sortable.js +16 -7
  141. data/apps/core/components/public/js/spider.js +60 -41
  142. data/apps/core/components/widgets/admin/admin.shtml +1 -1
  143. data/apps/core/components/widgets/list/list.shtml +2 -2
  144. data/apps/core/components/widgets/month_calendar/month_calendar.shtml +23 -20
  145. data/apps/core/components/widgets/switcher/switcher.rb +77 -21
  146. data/apps/core/components/widgets/switcher/templates/default.shtml +8 -0
  147. data/apps/core/components/widgets/switcher/templates/table.shtml +15 -0
  148. data/apps/core/components/widgets/table/table.rb +4 -1
  149. data/apps/core/components/widgets/table/table.shtml +10 -8
  150. data/apps/core/forms/public/css/form.css +9 -1
  151. data/apps/core/forms/public/date_time.js +14 -2
  152. data/apps/core/forms/public/input.js +1 -1
  153. data/apps/core/forms/public/select.js +4 -3
  154. data/apps/core/forms/tags/element_row.erb +11 -2
  155. data/apps/core/forms/widgets/inputs/date_time/date_time.rb +9 -0
  156. data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +1 -1
  157. data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +2 -2
  158. data/apps/core/forms/widgets/inputs/input/input.rb +0 -3
  159. data/apps/core/forms/widgets/inputs/select/select.shtml +2 -2
  160. data/apps/messenger/backends/email/sendmail.rb +20 -0
  161. data/apps/messenger/backends/email/smtp.rb +12 -14
  162. data/apps/messenger/backends/email/test.rb +20 -0
  163. data/apps/messenger/config/options.rb +9 -9
  164. data/apps/messenger/config/test.config.yml +2 -0
  165. data/apps/messenger/controllers/mixins/messenger_helper.rb +41 -15
  166. data/apps/messenger/lib/email_backend.rb +10 -0
  167. data/apps/messenger/messenger.rb +45 -26
  168. data/apps/messenger/test/features/attachments.feature +26 -0
  169. data/apps/messenger/test/features/messenger_helper.feature +31 -0
  170. data/apps/messenger/test/features/sending_email.feature +10 -0
  171. data/apps/messenger/test/features/step_definitions/common_steps.rb +11 -0
  172. data/apps/messenger/test/features/step_definitions/email_steps.rb +98 -0
  173. data/apps/messenger/test/features/support/env.rb +11 -0
  174. data/apps/messenger/test/files/test_file1.txt +1 -0
  175. data/apps/messenger/test/lib/controllers/mail_test_controller.rb +34 -0
  176. data/apps/messenger/test/templates/email/multipart.html.erb +1 -0
  177. data/apps/messenger/test/templates/email/multipart.txt.erb +1 -0
  178. data/apps/messenger/test/templates/email/simple.erb +1 -0
  179. data/apps/messenger/test/templates/email/vars.erb +1 -0
  180. data/lib/spiderfw/cmd/cmd.rb +4 -0
  181. data/lib/spiderfw/cmd/commands/webserver.rb +12 -59
  182. data/lib/spiderfw/config/configuration.rb +4 -0
  183. data/lib/spiderfw/config/options/spider.rb +25 -8
  184. data/lib/spiderfw/controller/controller.rb +10 -4
  185. data/lib/spiderfw/controller/first_responder.rb +6 -20
  186. data/lib/spiderfw/controller/http_controller.rb +2 -1
  187. data/lib/spiderfw/controller/mixins/http_mixin.rb +12 -1
  188. data/lib/spiderfw/controller/mixins/visual.rb +3 -16
  189. data/lib/spiderfw/env.rb +1 -1
  190. data/lib/spiderfw/http/server.rb +178 -2
  191. data/lib/spiderfw/model/base_model.rb +142 -111
  192. data/lib/spiderfw/model/data_type.rb +15 -0
  193. data/lib/spiderfw/model/datatypes/decimal.rb +8 -0
  194. data/lib/spiderfw/model/datatypes/pk.rb +29 -0
  195. data/lib/spiderfw/model/datatypes.rb +1 -0
  196. data/lib/spiderfw/model/element.rb +5 -1
  197. data/lib/spiderfw/model/extended_models/managed.rb +1 -1
  198. data/lib/spiderfw/model/junction.rb +23 -0
  199. data/lib/spiderfw/model/mappers/db_mapper.rb +96 -80
  200. data/lib/spiderfw/model/mappers/document_mapper.rb +315 -0
  201. data/lib/spiderfw/model/mappers/mapper.rb +164 -75
  202. data/lib/spiderfw/model/mixins/list.rb +1 -0
  203. data/lib/spiderfw/model/mixins/versioned.rb +63 -27
  204. data/lib/spiderfw/model/model.rb +36 -9
  205. data/lib/spiderfw/model/query_funcs.rb +3 -0
  206. data/lib/spiderfw/model/query_set.rb +21 -1
  207. data/lib/spiderfw/model/storage/base_storage.rb +259 -6
  208. data/lib/spiderfw/model/storage/{db/db_connection_pool.rb → connection_pool.rb} +25 -21
  209. data/lib/spiderfw/model/storage/db/adapters/mysql.rb +25 -5
  210. data/lib/spiderfw/model/storage/db/adapters/oracle.rb +1 -1
  211. data/lib/spiderfw/model/storage/db/connectors/jdbc_oracle.rb +2 -2
  212. data/lib/spiderfw/model/storage/db/connectors/oci8.rb +3 -4
  213. data/lib/spiderfw/model/storage/db/db_storage.rb +18 -219
  214. data/lib/spiderfw/model/storage/document/adapters/mongodb.rb +307 -0
  215. data/lib/spiderfw/model/storage/document/document.rb +7 -0
  216. data/lib/spiderfw/model/storage/document/document_storage.rb +34 -0
  217. data/lib/spiderfw/model/storage.rb +23 -11
  218. data/lib/spiderfw/model/unit_of_work.rb +45 -22
  219. data/lib/spiderfw/spider.rb +660 -0
  220. data/lib/spiderfw/templates/blocks/html.rb +4 -2
  221. data/lib/spiderfw/templates/blocks/run.rb +1 -1
  222. data/lib/spiderfw/templates/blocks/tag_if.rb +1 -1
  223. data/lib/spiderfw/templates/blocks/widget.rb +1 -1
  224. data/lib/spiderfw/templates/layout.rb +29 -5
  225. data/lib/spiderfw/templates/template.rb +72 -7
  226. data/lib/spiderfw/templates/template_blocks.rb +1 -1
  227. data/lib/spiderfw/test/capybara.rb +7 -0
  228. data/lib/spiderfw/test/cucumber.rb +12 -0
  229. data/lib/spiderfw/test/page_object.rb +29 -0
  230. data/lib/spiderfw/test/spec.rb +20 -0
  231. data/lib/spiderfw/test/stubs/mapper_stub.rb +18 -0
  232. data/lib/spiderfw/test/stubs/storage_stub.rb +23 -0
  233. data/lib/spiderfw/test/unit.rb +23 -0
  234. data/lib/spiderfw/test.rb +89 -0
  235. data/lib/spiderfw/utils/json.rb +6 -0
  236. data/lib/spiderfw/utils/logger.rb +17 -4
  237. data/lib/spiderfw/utils/loggers/apache_commons_logger.rb +61 -0
  238. data/lib/spiderfw/utils/monkey/date_time.rb +2 -2
  239. data/lib/spiderfw/utils/monkey/module.rb +3 -1
  240. data/lib/spiderfw/utils/profiling.rb +2 -2
  241. data/lib/spiderfw/widget/widget.rb +31 -13
  242. data/lib/spiderfw.rb +1 -597
  243. data/spider.gemspec +9 -10
  244. metadata +193 -132
  245. data/apps/admin/_init.rb +0 -9
  246. data/apps/admin/controllers/admin_controller.rb +0 -12
  247. data/apps/admin/widgets/dashboard_widget/dashboard_widget.rb +0 -8
  248. data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/AUTHORS.txt +0 -30
  249. data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery-ui-i18n.js +0 -1176
  250. data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-no.js +0 -23
  251. data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/version.txt +0 -1
  252. data/apps/core/components/public/js/jquery/plugins/asmselect/jquery.asmselect.css +0 -64
  253. data/apps/core/components/public/js/jquery/plugins/asmselect/jquery.asmselect.js +0 -407
  254. data/apps/core/components/widgets/switcher/switcher.shtml +0 -17
  255. data/apps/master/po/master.pot +0 -400
@@ -0,0 +1,381 @@
1
+ /*
2
+ * Better Select Multiple - jQuery Plugin
3
+ *
4
+ * based on Alternate Select Multiple (asmSelect) 1.0.4a beta (http://www.ryancramer.com/projects/asmselect/)
5
+ *
6
+ * Copyright (c) 2009 by Ryan Cramer - http://www.ryancramer.com
7
+ * Copyright (c) 2010 by Victor Berchet - http://www.github.com/vicb
8
+ *
9
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
10
+ *
11
+ * bsmSelect version: v1.4.2 - 2011-02-22
12
+ */
13
+
14
+ (function($) {
15
+
16
+ function BsmSelect(target, options)
17
+ {
18
+ this.$original = $(target); // the original select multiple
19
+ this.buildingSelect = false; // is the new select being constructed right now?
20
+ this.ieClick = false; // in IE, has a click event occurred? ignore if not
21
+ this.ignoreOriginalChangeEvent = false; // originalChangeEvent bypassed when this is true
22
+ this.options = options;
23
+ this.buildDom();
24
+ }
25
+
26
+ BsmSelect.prototype = {
27
+ /**
28
+ * Generate an UID
29
+ */
30
+ generateUid: function(index) {
31
+ return (this.uid = this.options.containerClass + index);
32
+ },
33
+
34
+ /**
35
+ * Build the DOM for bsmSelect
36
+ */
37
+ buildDom: function() {
38
+ var self = this, o = this.options;
39
+
40
+ if (o.addItemTarget === 'original') {
41
+ $('option', this.$original).each(function(i, o) {
42
+ if ($(o).data('bsm-order') === null) { $(o).data('bsm-order', i); }
43
+ });
44
+ }
45
+
46
+ for (var index = 0; $('#' + this.generateUid(index)).size(); index++) {}
47
+
48
+ this.$select = $('<select>', {
49
+ 'class': o.selectClass,
50
+ name: o.selectClass + this.uid,
51
+ id: o.selectClass + this.uid,
52
+ change: $.proxy(this.selectChangeEvent, this),
53
+ click: $.proxy(this.selectClickEvent, this)
54
+ });
55
+
56
+ this.$list = $.isFunction(o.listType)
57
+ ? o.listType(this.$original)
58
+ : $('<' + o.listType + '>', { id: o.listClass + this.uid });
59
+
60
+ this.$list.addClass(o.listClass);
61
+
62
+ this.$container = $('<div>', { 'class': o.containerClass, id: this.uid });
63
+
64
+ this.buildSelect();
65
+
66
+ this.$original.change($.proxy(this.originalChangeEvent, this)).wrap(this.$container).before(this.$select);
67
+
68
+ // if the list isn't already in the document, add it (it might be inserted by a custom callback)
69
+ if (!this.$list.parent().length) { this.$original.before(this.$list); }
70
+
71
+ if (this.$original.attr('id')) {
72
+ $('label[for=' + this.$original.attr('id') + ']').attr('for', this.$select.attr('id'));
73
+ }
74
+
75
+ // set up remove event (may be a link, or the list item itself)
76
+ this.$list.delegate('.' + o.removeClass, 'click', function() {
77
+ self.dropListItem($(this).closest('li'));
78
+ return false;
79
+ });
80
+
81
+ $.each(o.plugins, function() { this.init(self); });
82
+ },
83
+
84
+ /**
85
+ * Triggered when an item has been selected
86
+ * Check to make sure it's not an IE screwup, and add it to the list
87
+ */
88
+ selectChangeEvent: function() {
89
+ if ($.browser.msie && $.browser.version < 7 && !this.ieClick) { return; }
90
+ var bsmOpt = $('option:selected:eq(0)', this.$select);
91
+ if (bsmOpt.data('orig-option')) {
92
+ this.addListItem(bsmOpt);
93
+ this.triggerOriginalChange(bsmOpt.data('orig-option'), 'add');
94
+ }
95
+ this.ieClick = false;
96
+ },
97
+
98
+ /**
99
+ * IE6 lets you scroll around in a select without it being pulled down
100
+ * making sure a click preceded the change() event reduces the chance
101
+ * if unintended items being added. there may be a better solution?
102
+ */
103
+ selectClickEvent: function() {
104
+ this.ieClick = true;
105
+ },
106
+
107
+ /**
108
+ * Rebuild bsmSelect when the 'change' event is triggered on the original select
109
+ */
110
+ originalChangeEvent: function() {
111
+ if (this.ignoreOriginalChangeEvent) {
112
+ // We don't want to rebuild everything when an item is added / droped
113
+ this.ignoreOriginalChangeEvent = false;
114
+ } else {
115
+ this.buildSelect();
116
+ // opera has an issue where it needs a force redraw, otherwise
117
+ // the items won't appear until something else forces a redraw
118
+ if ($.browser.opera) { this.$list.hide().show(); }
119
+ }
120
+ },
121
+
122
+ /**
123
+ * Build the DOM for the new select
124
+ */
125
+ buildSelect: function() {
126
+ var self = this;
127
+
128
+ this.buildingSelect = true;
129
+
130
+ // add a first option to be the home option / default selectLabel
131
+ this.$select.empty().prepend($('<option value=""></option>').text(this.$original.attr('title') || this.options.title));
132
+ this.$list.empty();
133
+
134
+ this.$original.children().each(function() {
135
+ if ($(this).is('option')) {
136
+ self.addSelectOption(self.$select, $(this));
137
+ } else if ($(this).is('optgroup')) {
138
+ self.addSelectOptionGroup(self.$select, $(this));
139
+ }
140
+ });
141
+
142
+ if (!this.options.debugMode) { this.$original.hide(); }
143
+ this.selectFirstItem();
144
+ this.buildingSelect = false;
145
+ },
146
+
147
+ /**
148
+ * Append an option to the new select
149
+ *
150
+ * @param {jQuery} $parent Where to append the option
151
+ * @param {jQuery} $origOpt Option from the original select
152
+ */
153
+ addSelectOption: function ($parent, $origOpt) {
154
+ var $bsmOpt = $('<option>', {
155
+ text: $origOpt.text(),
156
+ val: $origOpt.val() }).appendTo($parent).data('orig-option', $origOpt),
157
+ isSelected = $origOpt.is(':selected'),
158
+ isDisabled = $origOpt.is(':disabled');
159
+ $origOpt.data('bsm-option', $bsmOpt);
160
+ if (isSelected && !isDisabled) {
161
+ this.addListItem($bsmOpt);
162
+ this.disableSelectOption($bsmOpt);
163
+ } else if (!isSelected && isDisabled) {
164
+ this.disableSelectOption($bsmOpt);
165
+ }
166
+ },
167
+
168
+ /**
169
+ * Append an option group to the new select
170
+ *
171
+ * @param {jQuery} $parent Where to append the group
172
+ * @param {jQuery} $group Model group from the original select
173
+ */
174
+ addSelectOptionGroup: function($parent, $group)
175
+ {
176
+ var self = this,
177
+ $G = $('<optgroup>', { label: $group.attr('label')} ).appendTo($parent);
178
+ if ($group.is(':disabled')) { $G.attr('disabled', 'disabled'); }
179
+ $('option', $group).each(function() { self.addSelectOption($G, $(this)); });
180
+ },
181
+
182
+ /**
183
+ * Select the first item of the new select
184
+ */
185
+ selectFirstItem: function() {
186
+ $('option:eq(0)', this.$select).attr('selected', 'selected');
187
+ },
188
+
189
+ /**
190
+ * Make an option disabled, indicating that it's already been selected
191
+ * because safari is the only browser that makes disabled items look 'disabled'
192
+ * we apply a class that reproduces the disabled look in other browsers
193
+ *
194
+ * @param {jQuery} $bsmOpt Option from the new select
195
+ */
196
+ disableSelectOption: function($bsmOpt) {
197
+ $bsmOpt.addClass(this.options.optionDisabledClass)
198
+ .removeAttr('selected')
199
+ .attr('disabled', 'disabled')
200
+ .toggle(!this.options.hideWhenAdded);
201
+ if ($.browser.msie && $.browser.version < 8) { this.$select.hide().show(); } // this forces IE to update display
202
+ },
203
+
204
+ /**
205
+ * Enable a select option
206
+ *
207
+ * @param {jQuery} $bsmOpt Option from the new select
208
+ */
209
+ enableSelectOption: function($bsmOpt) {
210
+ $bsmOpt.removeClass(this.options.optionDisabledClass)
211
+ .removeAttr('disabled')
212
+ .toggle(!this.options.hideWhenAdded);
213
+ if ($.browser.msie && $.browser.version < 8) { this.$select.hide().show(); } // this forces IE to update display
214
+ },
215
+
216
+ /**
217
+ * Append an item corresponding to the option to the list
218
+ *
219
+ * @param {jQuery} $bsmOpt Option from the new select
220
+ */
221
+ addListItem: function($bsmOpt) {
222
+ var $item,
223
+ $origOpt = $bsmOpt.data('orig-option'),
224
+ o = this.options;
225
+
226
+ if (!$origOpt) { return; } // this is the first item, selectLabel
227
+
228
+ if (!this.buildingSelect) {
229
+ if ($origOpt.is(':selected')) { return; } // already have it
230
+ $origOpt.attr('selected', 'selected');
231
+ }
232
+
233
+ $item = $('<li>', { 'class': o.listItemClass })
234
+ .append($('<span>', { 'class': o.listItemLabelClass, html: o.extractLabel($bsmOpt, o)}))
235
+ .append($('<a>', { href: '#', 'class': o.removeClass, html: o.removeLabel }))
236
+ .data('bsm-option', $bsmOpt);
237
+
238
+ this.disableSelectOption($bsmOpt.data('item', $item));
239
+
240
+ switch (o.addItemTarget) {
241
+ case 'top':
242
+ this.$list.append($item.hide());
243
+ break;
244
+ case 'original':
245
+ var order = $origOpt.data('bsm-order'), inserted = false;
246
+ $('.' + o.listItemClass, this.$list).each(function() {
247
+ if (order < $(this).data('bsm-option').data('orig-option').data('bsm-order')) {
248
+ $item.hide().insertBefore(this);
249
+ inserted = true;
250
+ return false;
251
+ }
252
+ });
253
+ if (!inserted) { this.$list.append($item.hide()); }
254
+ break;
255
+ default:
256
+ this.$list.prepend($item.hide());
257
+ }
258
+
259
+ if (this.buildingSelect) {
260
+ $.bsmSelect.effects.show($item);
261
+ } else {
262
+ o.showEffect($item);
263
+ o.highlightEffect(this.$select, $item, o.highlightAddedLabel, this.options);
264
+ this.selectFirstItem();
265
+ }
266
+ },
267
+
268
+ /**
269
+ * Remove an item from the list of selection
270
+ *
271
+ * @param {jQuey} $item A list item
272
+ */
273
+ dropListItem: function($item) {
274
+ var $bsmOpt = $item.data('bsm-option'), o = this.options;
275
+ $bsmOpt.removeData('item').data('orig-option').removeAttr('selected');
276
+ (this.buildingSelect ? $.bsmSelect.effects.remove : o.hideEffect)($item);
277
+ this.enableSelectOption($bsmOpt);
278
+ o.highlightEffect(this.$select, $item, o.highlightRemovedLabel, o);
279
+ this.triggerOriginalChange($bsmOpt.data('orig-option'), 'drop');
280
+ },
281
+
282
+ /**
283
+ * Trigger a change event on the original select multiple
284
+ * so that other scripts can pick them up
285
+ *
286
+ * @param {jQuery} $origOpt The option from the original select
287
+ * @param {String} type Event type
288
+ */
289
+ triggerOriginalChange: function($origOpt, type) {
290
+ this.ignoreOriginalChangeEvent = true;
291
+ this.$original.trigger('change', [{
292
+ option: $origOpt,
293
+ value: $origOpt.val(),
294
+ item: $origOpt.data('bsm-option').data('item'),
295
+ type: type
296
+ }]);
297
+ }
298
+ };
299
+
300
+ $.fn.bsmSelect = function(customOptions) {
301
+ var options = $.extend({}, $.bsmSelect.conf, customOptions);
302
+ return this.each(function() {
303
+ var bsm = $(this).data("bsmSelect");
304
+ if (!bsm) {
305
+ bsm = new BsmSelect($(this), options);
306
+ $(this).data("bsmSelect", bsm);
307
+ }
308
+ });
309
+ };
310
+
311
+ $.bsmSelect = {};
312
+ $.extend($.bsmSelect, {
313
+ effects: {
314
+ show: function($el) { $el.show(); },
315
+
316
+ remove: function($el) { $el.remove(); },
317
+
318
+ highlight: function ($select, $item, label, conf) {
319
+ var $highlight,
320
+ id = $select.attr('id') + conf.highlightClass;
321
+ $('#' + id).remove();
322
+ $highlight = $('<span>', {
323
+ 'class': conf.highlightClass,
324
+ id: id,
325
+ html: label + $item.children('.' + conf.listItemLabelClass).first().text()
326
+ }).hide();
327
+ $select.after($highlight.fadeIn('fast').delay(50).fadeOut('slow', function() { $(this).remove(); }));
328
+ },
329
+
330
+ verticalListAdd: function ($el) {
331
+ $el.animate({ opacity: 'show', height: 'show' }, 100, function() {
332
+ $(this).animate({ height: '+=2px' }, 100, function() {
333
+ $(this).animate({ height: '-=2px' }, 100);
334
+ });
335
+ });
336
+ },
337
+
338
+ verticalListRemove: function($el) {
339
+ $el.animate({ opacity: 'hide', height: 'hide' }, 100, function() {
340
+ $(this).prev('li').animate({ height: '-=2px' }, 100, function() {
341
+ $(this).animate({ height: '+=2px' }, 100);
342
+ });
343
+ $(this).remove();
344
+ });
345
+ }
346
+ },
347
+ plugins: {
348
+ }
349
+ });
350
+
351
+ // Default configuration
352
+ $.bsmSelect.conf = {
353
+ listType: 'ol', // Ordered list 'ol', or unordered list 'ul'
354
+
355
+ showEffect: $.bsmSelect.effects.show,
356
+ hideEffect: $.bsmSelect.effects.remove,
357
+ highlightEffect: $.noop,
358
+
359
+ addItemTarget: 'bottom', // Where to place new selected items in list: top or bottom
360
+ hideWhenAdded: false, // Hide the option when added to the list? works only in FF
361
+ debugMode: false, // Debug mode keeps original select visible
362
+
363
+ title: 'Select...', // Text used for the default select label
364
+ removeLabel: 'remove', // HTML used for the 'remove' link
365
+ highlightAddedLabel: 'Added: ', // Text that precedes highlight of added item
366
+ highlightRemovedLabel: 'Removed: ', // Text that precedes highlight of removed item
367
+ extractLabel: function($o) { return $o.html(); },
368
+
369
+ plugins: [], // An array of plugin objects to enable
370
+
371
+ containerClass: 'bsmContainer', // Class for container that wraps this widget
372
+ selectClass: 'bsmSelect', // Class for the newly created <select>
373
+ optionDisabledClass: 'bsmOptionDisabled', // Class for items that are already selected / disabled
374
+ listClass: 'bsmList', // Class for the list ($list)
375
+ listItemClass: 'bsmListItem', // Class for the <li> list items
376
+ listItemLabelClass: 'bsmListItemLabel', // Class for the label text that appears in list items
377
+ removeClass: 'bsmListItemRemove', // Class given to the 'remove' link
378
+ highlightClass: 'bsmHighlight' // Class given to the highlight <span>
379
+ };
380
+
381
+ })(jQuery);
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Better Select Multiple Sortable Plugin
3
+ *
4
+ * Copyright (c) 2010 by Victor Berchet - http://www.github.com/vicb
5
+ *
6
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * version: v1.1.1 - 2010-11-17
9
+ */
10
+ (function($) {
11
+ $.bsmSelect.plugins.sortable = function(sortConfig, options)
12
+ {
13
+ if (!(this instanceof arguments.callee)) {
14
+ return new arguments.callee(sortConfig, options);
15
+ }
16
+ this.sortConfig = sortConfig;
17
+ this.options = $.extend({}, this.defaultOpt, options || {});
18
+ }
19
+
20
+ $.extend($.bsmSelect.plugins.sortable.prototype, {
21
+ defaultOpt: {
22
+ listSortableClass: 'bsmListSortable'
23
+ },
24
+
25
+ init: function(bsm) {
26
+ var o = $.extend({}, this.options, bsm.options),
27
+ config = $.extend({}, this.sortConfig, { items: '.' + o.listItemClass }),
28
+ self = this;
29
+ bsm.$list.addClass(o.listSortableClass).sortable(config);
30
+ bsm.$original.bind('change', function(e, info) { self.onChange.call(self, bsm, e, info); } );
31
+ bsm.$list.bind('sortupdate', function(e, ui) { self.onSort.call(self, bsm, e, ui); } );
32
+ },
33
+
34
+ onChange: function(bsm, e, info) {
35
+ if (info && info.type == 'add' && !bsm.buildingSelect) {
36
+ info.option.detach()[bsm.options.addItemTarget == 'top' ? 'prependTo' : 'appendTo'](bsm.$original);
37
+ bsm.$list.sortable('refresh');
38
+ }
39
+ },
40
+
41
+ onSort: function(bsm, e, ui) {
42
+ $('.' + bsm.options.listItemClass, bsm.$list).each(function() {
43
+ $(this).data('bsm-option').data('orig-option').detach().appendTo(bsm.$original);
44
+ });
45
+ bsm.triggerOriginalChange($(ui.item).data('bsm-option').data('orig-option'), 'sort');
46
+ }
47
+ });
48
+ })(jQuery);
49
+
@@ -1,13 +1,14 @@
1
- Spider.Sortable = Spider.Plugin.extend({
2
-
3
-
1
+ Spider.Sortable = Spider.Plugin.extend({
4
2
  makeSortable: function(options){
5
3
  var options = $.extend({
6
4
  listSelector: '>ul',
7
5
  items: '>li',
8
6
  update: this.handleSort.bind(this),
9
7
  receive: this.handleReceive.bind(this),
10
- onSort: function(){}
8
+ onSort: function(){},
9
+ // if true, an element with class sort-pos inside the li is used to determine the li position in the storage.
10
+ // This is useful if the displayed items are a subset (with holes) of the sorted items in the storage
11
+ useSortPos: false
11
12
  }, options);
12
13
  this.listEl = options.listEl;
13
14
  if (!this.listEl) this.listEl = $(options.listSelector, this.el);
@@ -130,12 +131,20 @@ Spider.Sortable = Spider.Plugin.extend({
130
131
 
131
132
  findLiPosition: function(item){
132
133
  var cnt = 1;
133
- var li = $(this.sortableOptions.items, this.listEl);
134
- li.each(function(){
134
+ var lis = $(this.sortableOptions.items, this.listEl);
135
+ lis.each(function(){
135
136
  if (this == item.get(0)) return false;
136
137
  cnt++;
137
138
  });
138
- if (cnt > li.length) return -1; // the row was dropped outside
139
+ if (cnt > lis.length) return -1; // the row was dropped outside
140
+ if (this.sortableOptions.useSortPos && lis.length > 1){
141
+ var realPos = -1;
142
+ if (cnt == 1){
143
+ realPos = parseInt(item.next().find('> .sort-pos').text(), 10) - 1;
144
+ }
145
+ else realPos = parseInt(item.prev().find('> .sort-pos').text(), 10) + 1;
146
+ return realPos;
147
+ }
139
148
  return cnt;
140
149
  },
141
150
 
@@ -40,9 +40,11 @@ Spider.Widget = Class.extend({
40
40
  this.ready();
41
41
  this.applyReady();
42
42
  this.plugins = [];
43
- if (this.includePlugins) for (var i=0; i<this.includePlugins.length; i++){
44
- this.plugin(this.includePlugins[i]);
45
- }
43
+ if (this.includePlugins){
44
+ for (var i=0; i<this.includePlugins.length; i++){
45
+ this.plugin(this.includePlugins[i]);
46
+ }
47
+ }
46
48
  },
47
49
 
48
50
  remote: function(){
@@ -129,7 +131,8 @@ Spider.Widget = Class.extend({
129
131
  for (var i=0; i<pathParts.length; i++){
130
132
  param += "["+pathParts[i]+"]";
131
133
  }
132
- if (matches = key.match(/(.+)(\[.*\])/)){
134
+ var matches = key.match(/(.+)(\[.*\])/);
135
+ if (matches){
133
136
  param += "["+matches[1]+"]"+matches[2];
134
137
  }
135
138
  else param += "["+key+"]";
@@ -219,12 +222,7 @@ Spider.Widget = Class.extend({
219
222
  }
220
223
  e.preventDefault();
221
224
  var a = $(e.target);
222
- var url = $(this).attr('href');
223
- var parts = url.split('?');
224
- url = parts[0]; //+'.json';
225
- url += '?';
226
- if (parts[1]) url += parts[1]+'&';
227
- url += '_wt='+w.path;
225
+ var url = w.urlToAction($(this).attr('href'));
228
226
  if (options.before) options.before();
229
227
  w.setLoading();
230
228
  $.ajax({
@@ -239,9 +237,19 @@ Spider.Widget = Class.extend({
239
237
  w.trigger('ajaxifyLoad', a);
240
238
  }
241
239
  });
240
+ return true;
242
241
  });
243
242
  },
244
243
 
244
+ urlToAction: function(url){
245
+ var parts = url.split('?');
246
+ url = parts[0]; //+'.json';
247
+ url += '?';
248
+ if (parts[1]) url += parts[1]+'&';
249
+ url += '_wt='+this.path;
250
+ return url;
251
+ },
252
+
245
253
  setLoading: function(){
246
254
  if (this.el.is(':empty') || this.el.children().hasClass('empty-placeholder')){
247
255
  this.el.addClass('loading-empty');
@@ -322,6 +330,7 @@ Spider.Widget = Class.extend({
322
330
  if (!this.onWidgetCallbacks[id]) this.onWidgetCallbacks[id] = [];
323
331
  this.onWidgetCallbacks[id].push(callback);
324
332
  }
333
+ return true;
325
334
  },
326
335
 
327
336
  removeOnWidget: function(id, callback){
@@ -343,7 +352,7 @@ Spider.Widget = Class.extend({
343
352
  });
344
353
 
345
354
  Spider.Widget.initFromEl = function(el){
346
- if (!el || !el.attr('id')) return;
355
+ if (!el || !el.attr('id')) return null;
347
356
  var path = Spider.Widget.pathFromId(el.attr('id'));
348
357
  if (Spider.widgets[path]){
349
358
  var widget = Spider.widgets[path];
@@ -354,7 +363,8 @@ Spider.Widget.initFromEl = function(el){
354
363
  var cl_parts = cl.split(' ');
355
364
  var w_cl = null;
356
365
  var config = {};
357
- for (var i=0; i < cl_parts.length; i++){
366
+ var i;
367
+ for (i=0; i < cl_parts.length; i++){
358
368
  if (cl_parts[i].substr(0, 5) == 'wdgt-'){
359
369
  w_cl = cl_parts[i].substr(5);
360
370
  }
@@ -365,7 +375,7 @@ Spider.Widget.initFromEl = function(el){
365
375
  if (w_cl){
366
376
  var w_cl_parts = w_cl.split('-');
367
377
  var target = Widgets;
368
- for (var i=0; i < w_cl_parts.length; i++){
378
+ for (i=0; i < w_cl_parts.length; i++){
369
379
  target = target[w_cl_parts[i]];
370
380
  if (!target) break;
371
381
  }
@@ -398,6 +408,8 @@ Spider.WidgetBackend = Class.extend({
398
408
  return this.wUrl + '&_we='+method;
399
409
  },
400
410
 
411
+ // Note: args must be plain values (no arrays or objects). If you need to pass
412
+ // an array or an object, you should encode it to a string (and decode it in the controller)
401
413
  send: function(method, args, options){
402
414
  if (!options) options = {};
403
415
  var defaults = {
@@ -443,7 +455,9 @@ Spider.defineWidget = function(name, parent, w){
443
455
  if (parent) parent = Spider.widgetClasses[parent];
444
456
  else parent = Spider.Widget;
445
457
  var widget = parent.extend(w);
446
- curr[parts[parts.length-1]] = widget;
458
+ var last = parts[parts.length-1];
459
+ if (curr[last]) widget = curr[last].extend(widget);
460
+ curr[last] = widget;
447
461
  Spider.widgetClasses[name] = widget;
448
462
  if (w.autoInit){
449
463
  var initSelector = null;
@@ -521,30 +535,7 @@ Spider.Controller = Class.extend({
521
535
  },
522
536
 
523
537
  paramToQuery: function(value, prefix){
524
- var res = null;
525
- if (!prefix) prefix = '';
526
- if (!value){
527
- return '=null';
528
- }
529
- else if (value.push){ // array
530
- for (var i=0; i < value.length; i++){
531
- if (!res) res = "";
532
- else res += '&';
533
- res += this.paramToQuery(value[i], prefix+'[]');
534
- }
535
- return res;
536
- }
537
- else if (typeof (value) == 'object'){
538
- for (var name in value){
539
- if (!res) res = "";
540
- else res += '&';
541
- res += this.paramToQuery(value[name], prefix+'['+name+']');
542
- }
543
- return res;
544
- }
545
- else{
546
- return prefix+"="+value;
547
- }
538
+ return Spider.paramToQuery(value, prefix);
548
539
  }
549
540
 
550
541
  });
@@ -572,7 +563,7 @@ $(document).ready(function(){
572
563
  });
573
564
 
574
565
  $.fn.spiderWidget = function(){
575
- if (!this.attr('id')) return;
566
+ if (!this.attr('id')) return null;
576
567
  var path = Spider.Widget.pathFromId(this.attr('id'));
577
568
  if (Spider.widgets[path]) return Spider.widgets[path];
578
569
  return Spider.Widget.initFromEl(this);
@@ -608,9 +599,10 @@ $.fn.getDataModel = function(){
608
599
  var cl_parts = cl.split(' ');
609
600
  for (var i=0; i < cl_parts.length; i++){
610
601
  if (cl_parts[i].substr(0, 6) == 'model-'){
611
- return cl_parts[i].substr(6).replace(/-/g, '::');;
602
+ return cl_parts[i].substr(6).replace(/-/g, '::');
612
603
  }
613
604
  }
605
+ return null;
614
606
  };
615
607
 
616
608
  Spider.htmlFunctions = [];
@@ -631,6 +623,33 @@ Spider.modelToCSS = function(name){
631
623
  return name.split('::').join('-');
632
624
  };
633
625
 
626
+ Spider.paramToQuery = function(value, prefix){
627
+ var res = null;
628
+ if (!prefix) prefix = '';
629
+ if (!value){
630
+ return '=null';
631
+ }
632
+ else if (value.push){ // array
633
+ for (var i=0; i < value.length; i++){
634
+ if (!res) res = "";
635
+ else res += '&';
636
+ res += this.paramToQuery(value[i], prefix+'[]');
637
+ }
638
+ return res;
639
+ }
640
+ else if (typeof (value) == 'object'){
641
+ for (var name in value){
642
+ if (!res) res = "";
643
+ else res += '&';
644
+ res += this.paramToQuery(value[name], prefix+'['+name+']');
645
+ }
646
+ return res;
647
+ }
648
+ else{
649
+ return prefix+"="+value;
650
+ }
651
+ };
652
+
634
653
  jQuery.parseISODate = function(iso){
635
654
  var d = new Date();
636
655
  var r = /(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2}))?/.exec(iso);
@@ -727,4 +746,4 @@ if(!window.console) {
727
746
  this.log = function(str) {};
728
747
  this.dir = function(str) {};
729
748
  };
730
- }
749
+ }
@@ -13,5 +13,5 @@
13
13
  <div class="current_section">
14
14
  <span id="label">{ @current }</span>
15
15
  </div>
16
- <core:switcher id="switcher" />
16
+ <core:switcher id="switcher" use_template="table" />
17
17
  </div>
@@ -32,8 +32,8 @@
32
32
  { @close_list_tag }
33
33
  </sp:pass>
34
34
  <div class="paginator" sp:if="(@page && @page > 1) || @has_more">
35
- <a sp:if="@page > 1" href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @page-1 }">Indietro</a>
35
+ <a sp:if="@page > 1" href="{ @request[:path] }?_w{ @widget[:param] }%5Bpage%5D={ @page-1 }">Indietro</a>
36
36
  Pagina { @page } di { @pages }
37
- <a sp:if="@has_more" href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @page+1 }">Avanti</a>
37
+ <a sp:if="@has_more" href="{ @request[:path] }?_w{ @widget[:param] }%5Bpage%5D={ @page+1 }">Avanti</a>
38
38
  </div>
39
39
  </div>