compass-jquery-plugin 0.3.0.0 → 0.3.1.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. data/README.textile +69 -13
  2. data/Rakefile +1 -1
  3. data/VERSION.yml +2 -2
  4. data/gem_tasks/jqgrid.rake +119 -0
  5. data/gem_tasks/jrails.rake +78 -77
  6. data/gem_tasks/mobile.rake +156 -0
  7. data/gem_tasks/rubygems.rake +5 -1
  8. data/gem_tasks/secret_sauce.rake +64 -0
  9. data/lib/jquery/gridify.rb +42 -0
  10. data/lib/jquery/gridify/assertions.rb +37 -0
  11. data/lib/jquery/gridify/grid.rb +210 -0
  12. data/lib/jquery/gridify/grid_column.rb +134 -0
  13. data/lib/jquery/gridify/grid_finder.rb +223 -0
  14. data/lib/jquery/gridify/grid_options.rb +279 -0
  15. data/lib/jquery/gridify/grid_view.rb +435 -0
  16. data/lib/jquery/jqgrid.rb +5 -0
  17. data/lib/jquery/jqgrid/jqgrid.rb +438 -0
  18. data/lib/jquery/mobile.rb +3 -0
  19. data/lib/jquery/secret_sauce.rb +9 -0
  20. data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +14 -0
  21. data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +18 -0
  22. data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +6 -0
  23. data/lib/jquery/secret_sauce/helpers/ui_form_helper.rb +118 -0
  24. data/lib/jquery/secret_sauce/helpers/ui_grid_helper.rb +226 -0
  25. data/lib/jquery/secret_sauce/model/find_for_grid.rb +42 -0
  26. data/templates/dynatree/jquery.dynatree.js +258 -147
  27. data/templates/dynatree/jquery.dynatree.min.js +81 -79
  28. data/templates/dynatree/jquery/dynatree/aero.scss +35 -18
  29. data/templates/dynatree/jquery/dynatree/aero/drop_sibling_here.png +0 -0
  30. data/templates/dynatree/jquery/dynatree/aqua.scss +36 -19
  31. data/templates/dynatree/jquery/dynatree/aqua/drop_sibling_here.png +0 -0
  32. data/templates/dynatree/jquery/dynatree/crystal.scss +38 -21
  33. data/templates/dynatree/jquery/dynatree/crystal/drop_sibling_here.png +0 -0
  34. data/templates/dynatree/jquery/dynatree/xp.scss +59 -42
  35. data/templates/dynatree/jquery/dynatree/xp/drop_sibling_here.png +0 -0
  36. data/templates/dynatree/manifest.rb +4 -0
  37. data/templates/jqgrid/config/initializers/jqgrid.rb +4 -0
  38. data/templates/jqgrid/config/locales/jquery/jqgrid/de.yml +7 -0
  39. data/templates/jqgrid/config/locales/jquery/jqgrid/en.yml +7 -0
  40. data/templates/jqgrid/i18n/jqgrid/locale-bg.js +132 -0
  41. data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +6 -0
  42. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +132 -0
  43. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +6 -0
  44. data/templates/jqgrid/i18n/jqgrid/locale-cat.js +128 -0
  45. data/templates/jqgrid/i18n/jqgrid/locale-cat.min.js +6 -0
  46. data/templates/jqgrid/i18n/jqgrid/locale-cn.js +132 -0
  47. data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +5 -0
  48. data/templates/jqgrid/i18n/jqgrid/locale-cs.js +128 -0
  49. data/templates/jqgrid/i18n/jqgrid/locale-cs.min.js +6 -0
  50. data/templates/jqgrid/i18n/jqgrid/locale-da.js +128 -0
  51. data/templates/jqgrid/i18n/jqgrid/locale-da.min.js +6 -0
  52. data/templates/jqgrid/i18n/jqgrid/locale-de.js +133 -0
  53. data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +7 -0
  54. data/templates/jqgrid/i18n/jqgrid/locale-el.js +126 -0
  55. data/templates/jqgrid/i18n/jqgrid/locale-el.min.js +7 -0
  56. data/templates/jqgrid/i18n/jqgrid/locale-en.js +128 -0
  57. data/templates/jqgrid/i18n/jqgrid/locale-en.min.js +6 -0
  58. data/templates/jqgrid/i18n/jqgrid/locale-es.js +128 -0
  59. data/templates/jqgrid/i18n/jqgrid/locale-es.min.js +7 -0
  60. data/templates/jqgrid/i18n/jqgrid/locale-fa.js +125 -0
  61. data/templates/jqgrid/i18n/jqgrid/locale-fa.min.js +6 -0
  62. data/templates/jqgrid/i18n/jqgrid/locale-fi.js +130 -0
  63. data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +6 -0
  64. data/templates/jqgrid/i18n/jqgrid/locale-fr.js +126 -0
  65. data/templates/jqgrid/i18n/jqgrid/locale-fr.min.js +7 -0
  66. data/templates/jqgrid/i18n/jqgrid/locale-gl.js +126 -0
  67. data/templates/jqgrid/i18n/jqgrid/locale-gl.min.js +7 -0
  68. data/templates/jqgrid/i18n/jqgrid/locale-he.js +127 -0
  69. data/templates/jqgrid/i18n/jqgrid/locale-he.min.js +6 -0
  70. data/templates/jqgrid/i18n/jqgrid/locale-hu.js +129 -0
  71. data/templates/jqgrid/i18n/jqgrid/locale-hu.min.js +6 -0
  72. data/templates/jqgrid/i18n/jqgrid/locale-is.js +126 -0
  73. data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +6 -0
  74. data/templates/jqgrid/i18n/jqgrid/locale-it.js +1 -0
  75. data/templates/jqgrid/i18n/jqgrid/locale-it.min.js +7 -0
  76. data/templates/jqgrid/i18n/jqgrid/locale-ja.js +155 -0
  77. data/templates/jqgrid/i18n/jqgrid/locale-ja.min.js +5 -0
  78. data/templates/jqgrid/i18n/jqgrid/locale-nl.js +149 -0
  79. data/templates/jqgrid/i18n/jqgrid/locale-nl.min.js +6 -0
  80. data/templates/jqgrid/i18n/jqgrid/locale-no.js +1 -0
  81. data/templates/jqgrid/i18n/jqgrid/locale-no.min.js +6 -0
  82. data/templates/jqgrid/i18n/jqgrid/locale-pl.js +127 -0
  83. data/templates/jqgrid/i18n/jqgrid/locale-pl.min.js +6 -0
  84. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +127 -0
  85. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +6 -0
  86. data/templates/jqgrid/i18n/jqgrid/locale-pt.js +125 -0
  87. data/templates/jqgrid/i18n/jqgrid/locale-pt.min.js +6 -0
  88. data/templates/jqgrid/i18n/jqgrid/locale-ro.js +139 -0
  89. data/templates/jqgrid/i18n/jqgrid/locale-ro.min.js +7 -0
  90. data/templates/jqgrid/i18n/jqgrid/locale-ru.js +127 -0
  91. data/templates/jqgrid/i18n/jqgrid/locale-ru.min.js +7 -0
  92. data/templates/jqgrid/i18n/jqgrid/locale-sk.js +127 -0
  93. data/templates/jqgrid/i18n/jqgrid/locale-sk.min.js +6 -0
  94. data/templates/jqgrid/i18n/jqgrid/locale-sr.js +128 -0
  95. data/templates/jqgrid/i18n/jqgrid/locale-sr.min.js +6 -0
  96. data/templates/jqgrid/i18n/jqgrid/locale-sv.js +127 -0
  97. data/templates/jqgrid/i18n/jqgrid/locale-sv.min.js +6 -0
  98. data/templates/jqgrid/i18n/jqgrid/locale-tr.js +126 -0
  99. data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +6 -0
  100. data/templates/jqgrid/i18n/jqgrid/locale-ua.js +127 -0
  101. data/templates/jqgrid/i18n/jqgrid/locale-ua.min.js +7 -0
  102. data/templates/jqgrid/jquery.jqGrid.js +11604 -0
  103. data/templates/jqgrid/jquery.jqGrid.min.js +472 -0
  104. data/templates/jqgrid/jquery/jqGrid.scss +692 -0
  105. data/templates/jqgrid/manifest.rb +72 -0
  106. data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +13 -0
  107. data/templates/jqtouch/jquery/touch/apple.scss +5 -5
  108. data/templates/jqtouch/jquery/touch/default.scss +5 -5
  109. data/templates/jqtouch/jquery/touch/jqt.scss +5 -5
  110. data/templates/jrails/config/initializers/jrails.rb +3 -0
  111. data/templates/jrails/jquery-ui.js +45 -62
  112. data/templates/jrails/jquery-ui.min.js +22 -22
  113. data/templates/jrails/jquery.js +340 -206
  114. data/templates/jrails/jquery.min.js +152 -151
  115. data/templates/jrails/jquery.tmpl.js +489 -0
  116. data/templates/jrails/jquery.tmpl.min.js +12 -0
  117. data/templates/jrails/jquery.tmplPlus.js +98 -0
  118. data/templates/jrails/jquery.tmplPlus.min.js +3 -0
  119. data/templates/jrails/jquery/ui/_theme.scss +3 -1
  120. data/templates/jrails/manifest.rb +4 -0
  121. data/templates/jstree/jquery.jstree.js +4479 -4468
  122. data/templates/jstree/jquery.jstree.min.js +4 -3
  123. data/templates/mobile/config/initializers/mobile.rb +6 -0
  124. data/templates/mobile/glyphish/Read me first - license.txt +14 -0
  125. data/templates/mobile/glyphish/icons-black/01-refresh.png +0 -0
  126. data/templates/mobile/glyphish/icons-black/02-redo.png +0 -0
  127. data/templates/mobile/glyphish/icons-black/03-loopback.png +0 -0
  128. data/templates/mobile/glyphish/icons-black/04-squiggle.png +0 -0
  129. data/templates/mobile/glyphish/icons-black/05-shuffle.png +0 -0
  130. data/templates/mobile/glyphish/icons-black/06-magnifying-glass.png +0 -0
  131. data/templates/mobile/glyphish/icons-black/07-map-marker.png +0 -0
  132. data/templates/mobile/glyphish/icons-black/08-chat.png +0 -0
  133. data/templates/mobile/glyphish/icons-black/09-chat2.png +0 -0
  134. data/templates/mobile/glyphish/icons-black/10-medical.png +0 -0
  135. data/templates/mobile/glyphish/icons-black/100-coffee.png +0 -0
  136. data/templates/mobile/glyphish/icons-black/101-gameplan.png +0 -0
  137. data/templates/mobile/glyphish/icons-black/102-walk.png +0 -0
  138. data/templates/mobile/glyphish/icons-black/103-map.png +0 -0
  139. data/templates/mobile/glyphish/icons-black/104-index-cards.png +0 -0
  140. data/templates/mobile/glyphish/icons-black/105-piano.png +0 -0
  141. data/templates/mobile/glyphish/icons-black/106-sliders.png +0 -0
  142. data/templates/mobile/glyphish/icons-black/107-widescreen.png +0 -0
  143. data/templates/mobile/glyphish/icons-black/108-badge.png +0 -0
  144. data/templates/mobile/glyphish/icons-black/109-chicken.png +0 -0
  145. data/templates/mobile/glyphish/icons-black/11-clock.png +0 -0
  146. data/templates/mobile/glyphish/icons-black/110-bug.png +0 -0
  147. data/templates/mobile/glyphish/icons-black/111-user.png +0 -0
  148. data/templates/mobile/glyphish/icons-black/112-group.png +0 -0
  149. data/templates/mobile/glyphish/icons-black/113-navigation.png +0 -0
  150. data/templates/mobile/glyphish/icons-black/114-balloon.png +0 -0
  151. data/templates/mobile/glyphish/icons-black/115-bow-and-arrow.png +0 -0
  152. data/templates/mobile/glyphish/icons-black/116-controller.png +0 -0
  153. data/templates/mobile/glyphish/icons-black/117-todo.png +0 -0
  154. data/templates/mobile/glyphish/icons-black/118-coathanger.png +0 -0
  155. data/templates/mobile/glyphish/icons-black/119-piggybank.png +0 -0
  156. data/templates/mobile/glyphish/icons-black/12-eye.png +0 -0
  157. data/templates/mobile/glyphish/icons-black/120-headphones.png +0 -0
  158. data/templates/mobile/glyphish/icons-black/121-lanscape.png +0 -0
  159. data/templates/mobile/glyphish/icons-black/122-stats.png +0 -0
  160. data/templates/mobile/glyphish/icons-black/123-id-card.png +0 -0
  161. data/templates/mobile/glyphish/icons-black/124-bullhorn.png +0 -0
  162. data/templates/mobile/glyphish/icons-black/125-food.png +0 -0
  163. data/templates/mobile/glyphish/icons-black/126-moon.png +0 -0
  164. data/templates/mobile/glyphish/icons-black/127-sock.png +0 -0
  165. data/templates/mobile/glyphish/icons-black/128-bone.png +0 -0
  166. data/templates/mobile/glyphish/icons-black/129-golf.png +0 -0
  167. data/templates/mobile/glyphish/icons-black/13-target.png +0 -0
  168. data/templates/mobile/glyphish/icons-black/130-dice.png +0 -0
  169. data/templates/mobile/glyphish/icons-black/14-tag.png +0 -0
  170. data/templates/mobile/glyphish/icons-black/15-tags.png +0 -0
  171. data/templates/mobile/glyphish/icons-black/16-line-chart.png +0 -0
  172. data/templates/mobile/glyphish/icons-black/17-bar-chart.png +0 -0
  173. data/templates/mobile/glyphish/icons-black/18-envelope.png +0 -0
  174. data/templates/mobile/glyphish/icons-black/19-gear.png +0 -0
  175. data/templates/mobile/glyphish/icons-black/20-gear2.png +0 -0
  176. data/templates/mobile/glyphish/icons-black/21-skull.png +0 -0
  177. data/templates/mobile/glyphish/icons-black/22-skull-n-crossbones.png +0 -0
  178. data/templates/mobile/glyphish/icons-black/23-bird.png +0 -0
  179. data/templates/mobile/glyphish/icons-black/24-gift.png +0 -0
  180. data/templates/mobile/glyphish/icons-black/25-weather.png +0 -0
  181. data/templates/mobile/glyphish/icons-black/26-bandaid.png +0 -0
  182. data/templates/mobile/glyphish/icons-black/27-planet.png +0 -0
  183. data/templates/mobile/glyphish/icons-black/28-star.png +0 -0
  184. data/templates/mobile/glyphish/icons-black/29-heart.png +0 -0
  185. data/templates/mobile/glyphish/icons-black/30-key.png +0 -0
  186. data/templates/mobile/glyphish/icons-black/31-ipod.png +0 -0
  187. data/templates/mobile/glyphish/icons-black/32-iphone.png +0 -0
  188. data/templates/mobile/glyphish/icons-black/33-cabinet.png +0 -0
  189. data/templates/mobile/glyphish/icons-black/34-coffee.png +0 -0
  190. data/templates/mobile/glyphish/icons-black/35-shopping-bag.png +0 -0
  191. data/templates/mobile/glyphish/icons-black/36-toolbox.png +0 -0
  192. data/templates/mobile/glyphish/icons-black/37-suitcase.png +0 -0
  193. data/templates/mobile/glyphish/icons-black/38-airplane.png +0 -0
  194. data/templates/mobile/glyphish/icons-black/39-spraycan.png +0 -0
  195. data/templates/mobile/glyphish/icons-black/40-inbox.png +0 -0
  196. data/templates/mobile/glyphish/icons-black/41-picture-frame.png +0 -0
  197. data/templates/mobile/glyphish/icons-black/42-photos.png +0 -0
  198. data/templates/mobile/glyphish/icons-black/43-film-roll.png +0 -0
  199. data/templates/mobile/glyphish/icons-black/44-shoebox.png +0 -0
  200. data/templates/mobile/glyphish/icons-black/45-movie1.png +0 -0
  201. data/templates/mobile/glyphish/icons-black/46-movie2.png +0 -0
  202. data/templates/mobile/glyphish/icons-black/47-fuel.png +0 -0
  203. data/templates/mobile/glyphish/icons-black/48-fork-and-knife.png +0 -0
  204. data/templates/mobile/glyphish/icons-black/49-battery.png +0 -0
  205. data/templates/mobile/glyphish/icons-black/50-beaker.png +0 -0
  206. data/templates/mobile/glyphish/icons-black/51-outlet.png +0 -0
  207. data/templates/mobile/glyphish/icons-black/52-pinetree.png +0 -0
  208. data/templates/mobile/glyphish/icons-black/53-house.png +0 -0
  209. data/templates/mobile/glyphish/icons-black/54-lock.png +0 -0
  210. data/templates/mobile/glyphish/icons-black/55-network.png +0 -0
  211. data/templates/mobile/glyphish/icons-black/56-cloud.png +0 -0
  212. data/templates/mobile/glyphish/icons-black/57-download.png +0 -0
  213. data/templates/mobile/glyphish/icons-black/58-bookmark.png +0 -0
  214. data/templates/mobile/glyphish/icons-black/59-flag.png +0 -0
  215. data/templates/mobile/glyphish/icons-black/60-signpost.png +0 -0
  216. data/templates/mobile/glyphish/icons-black/61-brightness.png +0 -0
  217. data/templates/mobile/glyphish/icons-black/62-contrast.png +0 -0
  218. data/templates/mobile/glyphish/icons-black/63-runner.png +0 -0
  219. data/templates/mobile/glyphish/icons-black/64-zap.png +0 -0
  220. data/templates/mobile/glyphish/icons-black/65-note.png +0 -0
  221. data/templates/mobile/glyphish/icons-black/66-microphone.png +0 -0
  222. data/templates/mobile/glyphish/icons-black/67-tshirt.png +0 -0
  223. data/templates/mobile/glyphish/icons-black/68-paperclip.png +0 -0
  224. data/templates/mobile/glyphish/icons-black/69-display.png +0 -0
  225. data/templates/mobile/glyphish/icons-black/70-tv.png +0 -0
  226. data/templates/mobile/glyphish/icons-black/71-compass.png +0 -0
  227. data/templates/mobile/glyphish/icons-black/72-pin.png +0 -0
  228. data/templates/mobile/glyphish/icons-black/73-radar.png +0 -0
  229. data/templates/mobile/glyphish/icons-black/74-location.png +0 -0
  230. data/templates/mobile/glyphish/icons-black/75-phone.png +0 -0
  231. data/templates/mobile/glyphish/icons-black/76-baby.png +0 -0
  232. data/templates/mobile/glyphish/icons-black/77-ekg.png +0 -0
  233. data/templates/mobile/glyphish/icons-black/78-stopwatch.png +0 -0
  234. data/templates/mobile/glyphish/icons-black/79-medical-bag.png +0 -0
  235. data/templates/mobile/glyphish/icons-black/80-shopping-cart.png +0 -0
  236. data/templates/mobile/glyphish/icons-black/81-dashboard.png +0 -0
  237. data/templates/mobile/glyphish/icons-black/82-dogpaw.png +0 -0
  238. data/templates/mobile/glyphish/icons-black/83-calendar.png +0 -0
  239. data/templates/mobile/glyphish/icons-black/84-lightbulb.png +0 -0
  240. data/templates/mobile/glyphish/icons-black/85-trophy.png +0 -0
  241. data/templates/mobile/glyphish/icons-black/86-camera.png +0 -0
  242. data/templates/mobile/glyphish/icons-black/87-wineglass.png +0 -0
  243. data/templates/mobile/glyphish/icons-black/88-beermug.png +0 -0
  244. data/templates/mobile/glyphish/icons-black/89-dumbbell.png +0 -0
  245. data/templates/mobile/glyphish/icons-black/90-lifebuoy.png +0 -0
  246. data/templates/mobile/glyphish/icons-black/91-beaker2.png +0 -0
  247. data/templates/mobile/glyphish/icons-black/92-testtube.png +0 -0
  248. data/templates/mobile/glyphish/icons-black/93-thermometer.png +0 -0
  249. data/templates/mobile/glyphish/icons-black/94-pill.png +0 -0
  250. data/templates/mobile/glyphish/icons-black/95-equalizer.png +0 -0
  251. data/templates/mobile/glyphish/icons-black/96-book.png +0 -0
  252. data/templates/mobile/glyphish/icons-black/97-puzzle.png +0 -0
  253. data/templates/mobile/glyphish/icons-black/98-palette.png +0 -0
  254. data/templates/mobile/glyphish/icons-black/99-umbrella.png +0 -0
  255. data/templates/mobile/glyphish/icons-white/09-chat2.png +0 -0
  256. data/templates/mobile/glyphish/icons-white/100-coffee.png +0 -0
  257. data/templates/mobile/glyphish/icons-white/18-envelope.png +0 -0
  258. data/templates/mobile/glyphish/icons-white/19-gear.png +0 -0
  259. data/templates/mobile/glyphish/icons-white/21-skull.png +0 -0
  260. data/templates/mobile/glyphish/icons-white/30-key.png +0 -0
  261. data/templates/mobile/glyphish/icons-white/34-coffee.png +0 -0
  262. data/templates/mobile/glyphish/icons-white/88-beermug.png +0 -0
  263. data/templates/mobile/glyphish/mini-icons-black/band-aid.png +0 -0
  264. data/templates/mobile/glyphish/mini-icons-black/chat.png +0 -0
  265. data/templates/mobile/glyphish/mini-icons-black/clock.png +0 -0
  266. data/templates/mobile/glyphish/mini-icons-black/eye.png +0 -0
  267. data/templates/mobile/glyphish/mini-icons-black/flag.png +0 -0
  268. data/templates/mobile/glyphish/mini-icons-black/fork-and-knife.png +0 -0
  269. data/templates/mobile/glyphish/mini-icons-black/gear.png +0 -0
  270. data/templates/mobile/glyphish/mini-icons-black/heart.png +0 -0
  271. data/templates/mobile/glyphish/mini-icons-black/lightning-bolt.png +0 -0
  272. data/templates/mobile/glyphish/mini-icons-black/magnifying-glass.png +0 -0
  273. data/templates/mobile/glyphish/mini-icons-black/map-marker.png +0 -0
  274. data/templates/mobile/glyphish/mini-icons-black/map-pin.png +0 -0
  275. data/templates/mobile/glyphish/mini-icons-black/microphone.png +0 -0
  276. data/templates/mobile/glyphish/mini-icons-black/music-note.png +0 -0
  277. data/templates/mobile/glyphish/mini-icons-black/paw.png +0 -0
  278. data/templates/mobile/glyphish/mini-icons-black/plus.png +0 -0
  279. data/templates/mobile/glyphish/mini-icons-black/puzzle.png +0 -0
  280. data/templates/mobile/glyphish/mini-icons-black/star.png +0 -0
  281. data/templates/mobile/glyphish/mini-icons-black/tag.png +0 -0
  282. data/templates/mobile/glyphish/mini-icons-black/tshirt.png +0 -0
  283. data/templates/mobile/jquery.mobile.js +3995 -0
  284. data/templates/mobile/jquery.mobile.min.js +28 -0
  285. data/templates/mobile/jquery/mobile/_base.scss +1344 -0
  286. data/templates/mobile/jquery/mobile/default.scss +745 -0
  287. data/templates/mobile/jquery/mobile/default/ajax-loader.png +0 -0
  288. data/templates/mobile/jquery/mobile/default/form-check-off.png +0 -0
  289. data/templates/mobile/jquery/mobile/default/form-check-on.png +0 -0
  290. data/templates/mobile/jquery/mobile/default/form-radio-off.png +0 -0
  291. data/templates/mobile/jquery/mobile/default/form-radio-on.png +0 -0
  292. data/templates/mobile/jquery/mobile/default/icon-search-black.png +0 -0
  293. data/templates/mobile/jquery/mobile/default/icons-18-black.png +0 -0
  294. data/templates/mobile/jquery/mobile/default/icons-18-white.png +0 -0
  295. data/templates/mobile/jquery/mobile/default/icons-36-black.png +0 -0
  296. data/templates/mobile/jquery/mobile/default/icons-36-white.png +0 -0
  297. data/templates/mobile/jquery/mobile/valencia.scss +807 -0
  298. data/templates/mobile/jquery/mobile/valencia/ajax-loader.png +0 -0
  299. data/templates/mobile/jquery/mobile/valencia/form-check-off.png +0 -0
  300. data/templates/mobile/jquery/mobile/valencia/form-check-on.png +0 -0
  301. data/templates/mobile/jquery/mobile/valencia/form-radio-off.png +0 -0
  302. data/templates/mobile/jquery/mobile/valencia/form-radio-on.png +0 -0
  303. data/templates/mobile/jquery/mobile/valencia/icon-search-black.png +0 -0
  304. data/templates/mobile/jquery/mobile/valencia/icons-18-black.png +0 -0
  305. data/templates/mobile/jquery/mobile/valencia/icons-18-white.png +0 -0
  306. data/templates/mobile/jquery/mobile/valencia/icons-36-black.png +0 -0
  307. data/templates/mobile/jquery/mobile/valencia/icons-36-white.png +0 -0
  308. data/templates/mobile/jquery/mobile/valencia/texture_05.png +0 -0
  309. data/templates/mobile/jquery/mobile/valencia/texture_075.png +0 -0
  310. data/templates/mobile/lib/tasks/jquery.mobile.rake +106 -0
  311. data/templates/mobile/manifest.rb +191 -0
  312. data/templates/secret_sauce/app/views/shared/_ui_form_error_messages.html.haml +6 -0
  313. data/templates/secret_sauce/app/views/shared/_ui_grid_for_without_block.js.haml +144 -0
  314. data/templates/secret_sauce/app/views/shared/_ui_static_dialog.html.haml +6 -0
  315. data/templates/secret_sauce/config/initializers/secret_sauce.rb +8 -0
  316. data/templates/secret_sauce/jquery/secret_sauce.scss +33 -0
  317. data/templates/secret_sauce/manifest.rb +10 -0
  318. data/templates/secret_sauce/secret_sauce.js +12 -0
  319. data/templates/secret_sauce/secret_sauce.min.js +1 -0
  320. metadata +313 -17
  321. data/.gitignore +0 -22
  322. data/compass-jquery-plugin.gemspec +0 -1064
@@ -2,7 +2,7 @@
2
2
  jquery.dynatree.js
3
3
  Dynamic tree view control, with support for lazy loading of branches.
4
4
 
5
- Copyright (c) 2008-2010, Martin Wendt (http://wwWendt.de)
5
+ Copyright (c) 2008-2010, Martin Wendt (http://wwWendt.de)
6
6
  Dual licensed under the MIT or GPL Version 2 licenses.
7
7
  http://code.google.com/p/dynatree/wiki/LicenseInfo
8
8
 
@@ -17,6 +17,7 @@
17
17
  @depends: jquery.cookie.js
18
18
  *************************************************************************/
19
19
 
20
+ /*jslint laxbreak: true */
20
21
 
21
22
  /*************************************************************************
22
23
  * Debug functions
@@ -64,7 +65,7 @@ function logMsg(msg) {
64
65
 
65
66
 
66
67
  // Forward declaration
67
- var getDynaTreePersistData = undefined;
68
+ var getDynaTreePersistData = null;
68
69
 
69
70
 
70
71
 
@@ -127,6 +128,9 @@ DynaTreeNode.prototype = {
127
128
  this.childList = null; // no subnodes yet
128
129
  this.isLoading = false; // Lazy content is being loaded
129
130
  this.hasSubSel = false;
131
+ this.bExpanded = false;
132
+ this.bSelected = false;
133
+
130
134
  },
131
135
 
132
136
  toString: function() {
@@ -155,7 +159,7 @@ DynaTreeNode.prototype = {
155
159
 
156
160
  fromDict: function(dict) {
157
161
  /**
158
- * Update node data. If dict contains 'children', then also replace
162
+ * Update node data. If dict contains 'children', then also replace
159
163
  * the hole sub tree.
160
164
  */
161
165
  var children = dict.children;
@@ -170,7 +174,7 @@ DynaTreeNode.prototype = {
170
174
  this.removeChildren();
171
175
  this.addChild(children);
172
176
  },
173
-
177
+
174
178
  _getInnerHtml: function() {
175
179
  var opts = this.tree.options;
176
180
  var cache = this.tree.cache;
@@ -479,22 +483,27 @@ DynaTreeNode.prototype = {
479
483
  // Create, modify or remove the status child node (pass 'null', to remove it).
480
484
  var firstChild = ( this.childList ? this.childList[0] : null );
481
485
  if( !data ) {
482
- if ( firstChild ) {
486
+ if ( firstChild && firstChild.isStatusNode()) {
483
487
  try{
484
- this.ul.removeChild(firstChild.li);
488
+ // I've seen exceptions here with loadKeyPath...
489
+ if(this.ul){
490
+ this.ul.removeChild(firstChild.li);
491
+ }
485
492
  }catch(e){};
486
493
  if( this.childList.length === 1 ){
487
- this.childList = null;
494
+ this.childList = [];
488
495
  }else{
489
496
  this.childList.shift();
490
497
  }
491
498
  }
492
499
  } else if ( firstChild ) {
493
500
  data.isStatusNode = true;
501
+ data.key = "_statusNode";
494
502
  firstChild.data = data;
495
503
  firstChild.render();
496
504
  } else {
497
505
  data.isStatusNode = true;
506
+ data.key = "_statusNode";
498
507
  firstChild = this.addChild(data);
499
508
  }
500
509
  },
@@ -505,12 +514,11 @@ DynaTreeNode.prototype = {
505
514
  switch( lts ) {
506
515
  case DTNodeStatus_Ok:
507
516
  this._setStatusNode(null);
508
- // this.isRead = true;
517
+ $(this.span).removeClass(this.tree.options.classNames.nodeLoading);
509
518
  this.isLoading = false;
510
519
  this.render();
511
520
  if( this.tree.options.autoFocus ) {
512
- // if( this === this.tree.tnRoot && !this.tree.options.rootVisible && this.childList ) {
513
- if( this === this.tree.tnRoot && this.childList ) {
521
+ if( this === this.tree.tnRoot && this.childList && this.childList.length > 0) {
514
522
  // special case: using ajaxInit
515
523
  this.childList[0].focus();
516
524
  } else {
@@ -520,14 +528,19 @@ DynaTreeNode.prototype = {
520
528
  break;
521
529
  case DTNodeStatus_Loading:
522
530
  this.isLoading = true;
523
- this._setStatusNode({
524
- title: this.tree.options.strings.loading + info,
525
- tooltip: tooltip,
526
- addClass: this.tree.options.classNames.nodeWait
527
- });
531
+ $(this.span).addClass(this.tree.options.classNames.nodeLoading);
532
+ // The root is hidden, so we set a temporary status child
533
+ if(!this.parent){
534
+ this._setStatusNode({
535
+ title: this.tree.options.strings.loading + info,
536
+ tooltip: tooltip,
537
+ addClass: this.tree.options.classNames.nodeWait
538
+ });
539
+ }
528
540
  break;
529
541
  case DTNodeStatus_Error:
530
542
  this.isLoading = false;
543
+ // $(this.span).addClass(this.tree.options.classNames.nodeError);
531
544
  this._setStatusNode({
532
545
  title: this.tree.options.strings.loadError + info,
533
546
  tooltip: tooltip,
@@ -651,6 +664,10 @@ DynaTreeNode.prototype = {
651
664
  } catch(e) { }
652
665
  },
653
666
 
667
+ isFocused: function() {
668
+ return (this.tree.tnFocused === this);
669
+ },
670
+
654
671
  _activate: function(flag, fireEvents) {
655
672
  // (De)Activate - but not focus - this node.
656
673
  this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o", flag, fireEvents, this);
@@ -679,7 +696,7 @@ DynaTreeNode.prototype = {
679
696
  }
680
697
  this.tree.persistence.activeKey = this.data.key;
681
698
  $(this.span).addClass(opts.classNames.active);
682
- if ( fireEvents && opts.onActivate ){ // Pass element as 'this' (jQuery convention)
699
+ if ( fireEvents && opts.onActivate ){
683
700
  opts.onActivate.call(this.tree, this);
684
701
  }
685
702
  } else {
@@ -710,6 +727,10 @@ DynaTreeNode.prototype = {
710
727
  this._activate(true, true);
711
728
  },
712
729
 
730
+ activateSilently: function() {
731
+ this._activate(true, false);
732
+ },
733
+
713
734
  deactivate: function() {
714
735
  // this.tree.logDebug("dtnode.deactivate(): %o", this);
715
736
  this._activate(false, true);
@@ -899,7 +920,7 @@ DynaTreeNode.prototype = {
899
920
  }
900
921
  },
901
922
 
902
- _expand: function(bExpand) {
923
+ _expand: function(bExpand, forceSync) {
903
924
  if( this.bExpanded === bExpand ) {
904
925
  this.tree.logDebug("dtnode._expand(%o) IGNORED - %o", bExpand, this);
905
926
  return;
@@ -924,7 +945,9 @@ DynaTreeNode.prototype = {
924
945
  }
925
946
  }
926
947
  // Do not apply animations in init phase, or before lazy-loading
927
- var allowEffects = !(this.data.isLazy && this.childList === null) && !this.isLoading;
948
+ var allowEffects = !(this.data.isLazy && this.childList === null)
949
+ && !this.isLoading
950
+ && !forceSync;
928
951
  this.render(allowEffects);
929
952
 
930
953
  // Auto-collapse mode: collapse all siblings
@@ -949,6 +972,7 @@ DynaTreeNode.prototype = {
949
972
  },
950
973
 
951
974
  expand: function(flag) {
975
+ flag = (flag !== false);
952
976
  if( !this.childList && !this.data.isLazy && flag ){
953
977
  return; // Prevent expanding empty nodes
954
978
  } else if( this.parent === null && !flag ){
@@ -963,7 +987,7 @@ DynaTreeNode.prototype = {
963
987
  */
964
988
  if( this.tree.timer ) {
965
989
  clearTimeout(this.tree.timer);
966
- logMsg("clearTimeout(%o)", this.tree.timer);
990
+ this.tree.logDebug("clearTimeout(%o)", this.tree.timer);
967
991
  }
968
992
  var self = this; // required for closures
969
993
  switch (mode) {
@@ -972,19 +996,20 @@ DynaTreeNode.prototype = {
972
996
  break;
973
997
  case "expand":
974
998
  this.tree.timer = setTimeout(function(){
975
- logMsg("setTimeout: trigger");
999
+ self.tree.logDebug("setTimeout: trigger expand");
976
1000
  self.expand(true);
977
1001
  }, ms);
978
1002
  break;
979
1003
  case "activate":
980
1004
  this.tree.timer = setTimeout(function(){
1005
+ self.tree.logDebug("setTimeout: trigger activate");
981
1006
  self.activate();
982
1007
  }, ms);
983
1008
  break;
984
1009
  default:
985
1010
  throw "Invalid mode " + mode;
986
1011
  }
987
- logMsg("setTimeout(%s, %s): %s", mode, ms, this.tree.timer);
1012
+ this.tree.logDebug("setTimeout(%s, %s): %s", mode, ms, this.tree.timer);
988
1013
  },
989
1014
 
990
1015
  toggleExpand: function() {
@@ -1003,7 +1028,7 @@ DynaTreeNode.prototype = {
1003
1028
  }
1004
1029
  },
1005
1030
 
1006
- onClick: function(event) {
1031
+ _onClick: function(event) {
1007
1032
  // this.tree.logDebug("dtnode.onClick(" + event.type + "): dtnode:" + this + ", button:" + event.button + ", which: " + event.which);
1008
1033
  var targetType = this.getEventTargetType(event);
1009
1034
  if( targetType === "expander" ) {
@@ -1017,11 +1042,11 @@ DynaTreeNode.prototype = {
1017
1042
  } else {
1018
1043
  this._userActivate();
1019
1044
  var aTag = this.span.getElementsByTagName("a");
1020
- if(aTag[0]){
1045
+ if(aTag[0]){
1021
1046
  // issue 154
1022
1047
  // TODO: check if still required on IE 9:
1023
- // Chrome and Safari don't focus the a-tag on click,
1024
- // but calling focus() seem to have problems on IE:
1048
+ // Chrome and Safari don't focus the a-tag on click,
1049
+ // but calling focus() seem to have problems on IE:
1025
1050
  // http://code.google.com/p/dynatree/issues/detail?id=154
1026
1051
  if(!$.browser.msie){
1027
1052
  aTag[0].focus();
@@ -1035,11 +1060,11 @@ DynaTreeNode.prototype = {
1035
1060
  return false;
1036
1061
  },
1037
1062
 
1038
- onDblClick: function(event) {
1063
+ _onDblClick: function(event) {
1039
1064
  // this.tree.logDebug("dtnode.onDblClick(" + event.type + "): dtnode:" + this + ", button:" + event.button + ", which: " + event.which);
1040
1065
  },
1041
1066
 
1042
- onKeydown: function(event) {
1067
+ _onKeydown: function(event) {
1043
1068
  // this.tree.logDebug("dtnode.onKeydown(" + event.type + "): dtnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which);
1044
1069
  var handled = true;
1045
1070
  // alert("keyDown" + event.which);
@@ -1124,13 +1149,13 @@ DynaTreeNode.prototype = {
1124
1149
  return !handled;
1125
1150
  },
1126
1151
 
1127
- onKeypress: function(event) {
1152
+ _onKeypress: function(event) {
1128
1153
  // onKeypress is only hooked to allow user callbacks.
1129
1154
  // We don't process it, because IE and Safari don't fire keypress for cursor keys.
1130
1155
  // this.tree.logDebug("dtnode.onKeypress(" + event.type + "): dtnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which);
1131
1156
  },
1132
1157
 
1133
- onFocus: function(event) {
1158
+ _onFocus: function(event) {
1134
1159
  // Handles blur and focus events.
1135
1160
  // this.tree.logDebug("dtnode.onFocus(%o): %o", event, this);
1136
1161
  var opts = this.tree.options;
@@ -1152,7 +1177,7 @@ DynaTreeNode.prototype = {
1152
1177
  $(this.tree.tnFocused.span).removeClass(opts.classNames.focused);
1153
1178
  }
1154
1179
  this.tree.tnFocused = this;
1155
- if ( opts.onFocus ){ // Pass element as 'this' (jQuery convention)
1180
+ if ( opts.onFocus ){
1156
1181
  opts.onFocus.call(this.tree, this);
1157
1182
  }
1158
1183
  $(this.tree.tnFocused.span).addClass(opts.classNames.focused);
@@ -1242,7 +1267,7 @@ DynaTreeNode.prototype = {
1242
1267
 
1243
1268
  removeChildren: function(isRecursiveCall, retainPersistence) {
1244
1269
  // Remove all child nodes (more efficiently than recursive remove())
1245
- this.tree.logDebug ("%s.removeChildren(%o)", this, isRecursiveCall);
1270
+ this.tree.logDebug("%s.removeChildren(%o)", this, isRecursiveCall);
1246
1271
  var tree = this.tree;
1247
1272
  var ac = this.childList;
1248
1273
  if( ac ) {
@@ -1261,14 +1286,20 @@ DynaTreeNode.prototype = {
1261
1286
  }
1262
1287
  }
1263
1288
  tn.removeChildren(true, retainPersistence);
1264
- // this.div.removeChild(tn.div);
1289
+ if(this.ul){
1290
+ this.ul.removeChild(tn.li);
1291
+ }
1292
+ /*
1265
1293
  try{
1266
1294
  this.ul.removeChild(tn.li);
1267
1295
  }catch(e){
1268
- this.tree.logDebug ("%s.removeChildren: couldnt remove LI", this, e);
1296
+ this.tree.logDebug("%s.removeChildren: couldnt remove LI", this, e);
1269
1297
  }
1298
+ */
1270
1299
  delete tn;
1271
1300
  }
1301
+ // Set to 'null' which is interpreted as 'not yet loaded' for lazy
1302
+ // nodes
1272
1303
  this.childList = null;
1273
1304
  }
1274
1305
  if( ! isRecursiveCall ) {
@@ -1298,7 +1329,7 @@ DynaTreeNode.prototype = {
1298
1329
  // We listen to this, if a callback was passed to reloadChildren
1299
1330
  if(callback){
1300
1331
  var self = this;
1301
- var eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id")
1332
+ var eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id")
1302
1333
  + "." + this.data.key;
1303
1334
  this.tree.$tree.bind(eventType, function(e, node, isOk){
1304
1335
  self.tree.$tree.unbind(eventType);
@@ -1310,58 +1341,67 @@ DynaTreeNode.prototype = {
1310
1341
  });
1311
1342
  }
1312
1343
  // The expansion state is maintained
1313
- if( this.bExpanded ) {
1314
- // Remove children first, to prevent effects being applied
1315
- this.removeChildren();
1316
- // then force re-expand to trigger lazy loading
1317
- // this.expand(false);
1318
- // this.expand(true);
1319
- this._loadContent();
1320
- } else {
1321
- this.removeChildren();
1322
- this._loadContent();
1323
- }
1344
+ this.removeChildren();
1345
+ this._loadContent();
1346
+ // if( this.bExpanded ) {
1347
+ // // Remove children first, to prevent effects being applied
1348
+ // this.removeChildren();
1349
+ // // then force re-expand to trigger lazy loading
1350
+ //// this.expand(false);
1351
+ //// this.expand(true);
1352
+ // this._loadContent();
1353
+ // } else {
1354
+ // this.removeChildren();
1355
+ // this._loadContent();
1356
+ // }
1324
1357
  },
1325
1358
 
1326
- loadKeyPath: function(keyPath, expand, callback) {
1327
- this.tree.logDebug("%s.loadKeyPath(%s, %s)", this, keyPath, expand);
1359
+ /**
1360
+ * Make sure the node with a given key path is available in the tree.
1361
+ */
1362
+ _loadKeyPath: function(keyPath, callback) {
1363
+ var tree = this.tree;
1364
+ tree.logDebug("%s._loadKeyPath(%s)", this, keyPath);
1328
1365
  if(keyPath === ""){
1329
- this.tree.logDebug("%s.loadKeyPath(%s, %s): end node!", this, keyPath, expand);
1330
- if( expand ){
1331
- this.makeVisible();
1332
- }
1333
- return;
1366
+ throw "Key path must not be empty";
1334
1367
  }
1335
- var segList = keyPath.split(this.tree.options.keyPathSeparator);
1336
- if(segList[0] == ""){
1368
+ var segList = keyPath.split(tree.options.keyPathSeparator);
1369
+ if(segList[0] === ""){
1337
1370
  throw "Key path must be relative (don't start with '/')";
1338
1371
  }
1339
1372
  var seg = segList.shift();
1340
-
1373
+
1341
1374
  for(var i = 0; i < this.childList.length; i++){
1342
1375
  var child = this.childList[i];
1343
1376
  if( child.data.key === seg ){
1344
- if(child.data.isLazy && (child.childlist === null || child.childlist === undefined)){
1345
- this.tree.logDebug("%s.loadKeyPath(%s, %s) -> reloading %s...", this, keyPath, expand, child);
1377
+ if(segList.length === 0) {
1378
+ // Found the end node
1379
+ callback.call(tree, child, "ok");
1380
+
1381
+ }else if(child.data.isLazy && (child.childList === null || child.childList === undefined)){
1382
+ tree.logDebug("%s._loadKeyPath(%s) -> reloading %s...", this, keyPath, child);
1346
1383
  var self = this;
1347
1384
  child.reloadChildren(function(node, isOk){
1348
1385
  // After loading, look for direct child with that key
1349
1386
  if(isOk){
1350
- self.tree.logDebug("%s.loadKeyPath(%s, %s) -> reloaded %s.", node, keyPath, expand, node);
1351
- node.loadKeyPath(segList.join(self.tree.options.keyPathSeparator), expand, callback);
1387
+ tree.logDebug("%s._loadKeyPath(%s) -> reloaded %s.", node, keyPath, node);
1388
+ callback.call(tree, child, "loaded");
1389
+ node._loadKeyPath(segList.join(tree.options.keyPathSeparator), callback);
1352
1390
  }else{
1353
- this.tree.logWarning("%s.loadKeyPath(%s, %s) -> reloadChildren() failed.", self, keyPath, expand);
1391
+ tree.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.", self, keyPath);
1392
+ callback.call(tree, child, "error");
1354
1393
  }
1355
1394
  });
1356
1395
  } else {
1396
+ callback.call(tree, child, "loaded");
1357
1397
  // Look for direct child with that key
1358
- child.loadKeyPath(segList.join(this.tree.options.keyPathSeparator), expand, callback);
1398
+ child._loadKeyPath(segList.join(tree.options.keyPathSeparator), callback);
1359
1399
  }
1360
1400
  return;
1361
- }
1401
+ }
1362
1402
  }
1363
1403
  // Could not find key
1364
- this.tree.logWarning("Node not found: " + seg);
1404
+ tree.logWarning("Node not found: " + seg);
1365
1405
  return;
1366
1406
  },
1367
1407
 
@@ -1514,12 +1554,14 @@ DynaTreeNode.prototype = {
1514
1554
  *
1515
1555
  */
1516
1556
  // this.tree.logDebug("%s.addChild(%o, %o)", this, obj, beforeNode);
1517
- if( !obj || obj.length === 0 ){ // Passed null or undefined or empty array
1557
+ if(typeof(obj) == "string"){
1558
+ throw "Invalid data type for " + obj;
1559
+ }else if( !obj || obj.length === 0 ){ // Passed null or undefined or empty array
1518
1560
  return;
1519
- }
1520
- if( obj instanceof DynaTreeNode ){
1561
+ }else if( obj instanceof DynaTreeNode ){
1521
1562
  return this._addChildNode(obj, beforeNode);
1522
1563
  }
1564
+
1523
1565
  if( !obj.length ){ // Passed a single data object
1524
1566
  obj = [ obj ];
1525
1567
  }
@@ -1549,43 +1591,56 @@ DynaTreeNode.prototype = {
1549
1591
  appendAjax: function(ajaxOptions) {
1550
1592
  this.removeChildren(false, true);
1551
1593
  this.setLazyNodeStatus(DTNodeStatus_Loading);
1594
+ // Debug feature: force a delay, to simulate slow loading...
1595
+ if(ajaxOptions.debugLazyDelay){
1596
+ var ms = ajaxOptions.debugLazyDelay;
1597
+ var self = this;
1598
+ ajaxOptions.debugLazyDelay = 0;
1599
+ this.tree.logInfo("appendAjax: waiting for debugLazyDelay " + ms);
1600
+ setTimeout(function(){self.appendAjax(ajaxOptions);}, ms);
1601
+ return;
1602
+ }
1552
1603
  // Ajax option inheritance: $.ajaxSetup < $.ui.dynatree.prototype.options.ajaxDefaults < tree.options.ajaxDefaults < ajaxOptions
1553
1604
  var self = this;
1554
1605
  var orgSuccess = ajaxOptions.success;
1555
1606
  var orgError = ajaxOptions.error;
1556
- var eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id")
1607
+ var eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id")
1557
1608
  + "." + this.data.key;
1558
1609
  var options = $.extend({}, this.tree.options.ajaxDefaults, ajaxOptions, {
1559
- /*
1560
- complete: function(req, textStatus){
1561
- alert("ajax complete");
1562
- },
1563
- timeout: 5000, // 5 sec
1564
- */
1565
1610
  success: function(data, textStatus){
1566
1611
  // <this> is the request options
1567
1612
  // self.tree.logDebug("appendAjax().success");
1568
1613
  var prevPhase = self.tree.phase;
1569
1614
  self.tree.phase = "init";
1570
- // self.append(data);
1571
- self.addChild(data, null);
1615
+
1616
+ if(!$.isArray(data) || data.length !== 0){
1617
+ self.addChild(data, null);
1618
+ }
1572
1619
  self.tree.phase = "postInit";
1573
- self.setLazyNodeStatus(DTNodeStatus_Ok);
1574
1620
  if( orgSuccess ){
1575
1621
  orgSuccess.call(options, self);
1576
1622
  }
1577
- self.tree.logInfo("trigger "+ eventType);
1623
+ self.tree.logInfo("trigger " + eventType);
1578
1624
  self.tree.$tree.trigger(eventType, [self, true]);
1579
1625
  self.tree.phase = prevPhase;
1626
+ // This should be the last command, so node.isLoading is true
1627
+ // while the callbacks run
1628
+ self.setLazyNodeStatus(DTNodeStatus_Ok);
1629
+ if($.isArray(data) && data.length === 0){
1630
+ // Set to [] which is interpreted as 'no children' for lazy
1631
+ // nodes
1632
+ self.childList = [];
1633
+ self.render();
1634
+ }
1580
1635
  },
1581
1636
  error: function(XMLHttpRequest, textStatus, errorThrown){
1582
1637
  // <this> is the request options
1583
1638
  self.tree.logWarning("appendAjax failed:", textStatus, ":\n", XMLHttpRequest, "\n", errorThrown);
1584
- self.setLazyNodeStatus(DTNodeStatus_Error, {info: textStatus, tooltip: ""+errorThrown});
1585
1639
  if( orgError ){
1586
1640
  orgError.call(options, self, XMLHttpRequest, textStatus, errorThrown);
1587
1641
  }
1588
1642
  self.tree.$tree.trigger(eventType, [self, false]);
1643
+ self.setLazyNodeStatus(DTNodeStatus_Error, {info: textStatus, tooltip: ""+errorThrown});
1589
1644
  }
1590
1645
  });
1591
1646
  $.ajax(options);
@@ -1736,7 +1791,7 @@ DynaTreeStatus._getTreePersistData = function(cookieId, cookieOpts) {
1736
1791
  var ts = new DynaTreeStatus(cookieId, cookieOpts);
1737
1792
  ts.read();
1738
1793
  return ts.toDict();
1739
- }
1794
+ };
1740
1795
  // Make available in global scope
1741
1796
  getDynaTreePersistData = DynaTreeStatus._getTreePersistData;
1742
1797
 
@@ -1874,13 +1929,17 @@ DynaTree.prototype = {
1874
1929
  this.timer = null;
1875
1930
  // find container element
1876
1931
  this.divTree = this.$tree.get(0);
1877
- //
1932
+
1933
+ // var parentPos = $(this.divTree).parent().offset();
1934
+ // this.parentTop = parentPos.top;
1935
+ // this.parentLeft = parentPos.left;
1936
+
1878
1937
  _initDragAndDrop(this);
1879
1938
  },
1880
1939
 
1881
1940
  // member functions
1882
1941
 
1883
- _load: function() {
1942
+ _load: function(callback) {
1884
1943
  var $widget = this.$widget;
1885
1944
  var opts = this.options;
1886
1945
  this.bEnableUpdate = true;
@@ -1899,12 +1958,19 @@ DynaTree.prototype = {
1899
1958
  _log("warn", "Option 'minExpandLevel' must be >= 1.");
1900
1959
  opts.minExpandLevel = 1;
1901
1960
  }
1961
+ // _log("warn", "jQuery.support.boxModel " + jQuery.support.boxModel);
1902
1962
 
1903
1963
  // If a 'options.classNames' dictionary was passed, still use defaults
1904
1964
  // for undefined classes:
1905
1965
  if( opts.classNames !== $.ui.dynatree.prototype.options.classNames ) {
1906
1966
  opts.classNames = $.extend({}, $.ui.dynatree.prototype.options.classNames, opts.classNames);
1907
1967
  }
1968
+ if( opts.ajaxDefaults !== $.ui.dynatree.prototype.options.ajaxDefaults ) {
1969
+ opts.ajaxDefaults = $.extend({}, $.ui.dynatree.prototype.options.ajaxDefaults, opts.ajaxDefaults);
1970
+ }
1971
+ if( opts.dnd !== $.ui.dynatree.prototype.options.dnd ) {
1972
+ opts.dnd = $.extend({}, $.ui.dynatree.prototype.options.dnd, opts.dnd);
1973
+ }
1908
1974
  // Guess skin path, if not specified
1909
1975
  if(!opts.imagePath) {
1910
1976
  $("script").each( function () {
@@ -1915,7 +1981,7 @@ DynaTree.prototype = {
1915
1981
  }else{
1916
1982
  opts.imagePath = "skin/";
1917
1983
  }
1918
- logMsg("Guessing imagePath from '%s': '%s'", this.src, opts.imagePath);
1984
+ logMsg("Guessing imagePath from '%s': '%s'", this.src, opts.imagePath);
1919
1985
  return false; // first match
1920
1986
  }
1921
1987
  });
@@ -1963,6 +2029,7 @@ DynaTree.prototype = {
1963
2029
  */
1964
2030
  // Create the root element
1965
2031
  this.tnRoot = new DynaTreeNode(null, this, {});
2032
+ this.tnRoot.bExpanded = true;
1966
2033
  this.tnRoot.render();
1967
2034
  this.divTree.appendChild(this.tnRoot.ul);
1968
2035
 
@@ -1982,7 +2049,7 @@ DynaTree.prototype = {
1982
2049
  // Init tree from AJAX request
1983
2050
  isLazy = true;
1984
2051
  root.data.isLazy = true;
1985
- this._reloadAjax();
2052
+ this._reloadAjax(callback);
1986
2053
 
1987
2054
  } else if( opts.initId ) {
1988
2055
  // Init tree from another UL element
@@ -2023,26 +2090,26 @@ DynaTree.prototype = {
2023
2090
  this.phase = "idle";
2024
2091
  },
2025
2092
 
2026
- _setNoUpdate: function(silent) {
2027
- // TODO: set options to disable and re-enable updates while loading
2028
- var opts = this.options;
2029
- var prev = {
2030
- fx: opts.fx,
2031
- autoFocus: opts.autoFocus,
2032
- autoCollapse: opts.autoCollapse };
2033
- if(silent === true){
2034
- opts.autoFocus = false;
2035
- opts.fx = null;
2036
- opts.autoCollapse = false;
2037
- } else {
2038
- opts.autoFocus = silent.autoFocus;
2039
- opts.fx = silent.fx;
2040
- opts.autoCollapse = silent.autoCollapse;
2041
- }
2042
- return prev;
2043
- },
2044
-
2045
- _reloadAjax: function() {
2093
+ // _setNoUpdate: function(silent) {
2094
+ // // TODO: set options to disable and re-enable updates while loading
2095
+ // var opts = this.options;
2096
+ // var prev = {
2097
+ // fx: opts.fx,
2098
+ // autoFocus: opts.autoFocus,
2099
+ // autoCollapse: opts.autoCollapse };
2100
+ // if(silent === true){
2101
+ // opts.autoFocus = false;
2102
+ // opts.fx = null;
2103
+ // opts.autoCollapse = false;
2104
+ // } else {
2105
+ // opts.autoFocus = silent.autoFocus;
2106
+ // opts.fx = silent.fx;
2107
+ // opts.autoCollapse = silent.autoCollapse;
2108
+ // }
2109
+ // return prev;
2110
+ // },
2111
+
2112
+ _reloadAjax: function(callback) {
2046
2113
  // Reload
2047
2114
  var opts = this.options;
2048
2115
  if( ! opts.initAjax || ! opts.initAjax.url ){
@@ -2073,8 +2140,18 @@ DynaTree.prototype = {
2073
2140
  this.logWarning("initAjax: error callback is ignored when onPostInit was specified.");
2074
2141
  }
2075
2142
  var isReloading = pers.isReloading();
2076
- ajaxOpts["success"] = function(dtnode) { opts.onPostInit.call(dtnode.tree, isReloading, false); };
2077
- ajaxOpts["error"] = function(dtnode) { opts.onPostInit.call(dtnode.tree, isReloading, true); };
2143
+ ajaxOpts["success"] = function(dtnode) {
2144
+ opts.onPostInit.call(dtnode.tree, isReloading, false);
2145
+ if(callback){
2146
+ callback.call(dtnode.tree, "ok");
2147
+ }
2148
+ };
2149
+ ajaxOpts["error"] = function(dtnode) {
2150
+ opts.onPostInit.call(dtnode.tree, isReloading, true);
2151
+ if(callback){
2152
+ callback.call(dtnode.tree, "error");
2153
+ }
2154
+ };
2078
2155
  }
2079
2156
  this.logDebug("Dynatree._init(): send Ajax request...");
2080
2157
  this.tnRoot.appendAjax(ajaxOpts);
@@ -2089,6 +2166,18 @@ DynaTree.prototype = {
2089
2166
  return this.tnRoot.toDict(true);
2090
2167
  },
2091
2168
 
2169
+ serializeArray: function(stopOnParents) {
2170
+ // Return a JavaScript array of objects, ready to be encoded as a JSON
2171
+ // string for selected nodes
2172
+ var nodeList = this.getSelectedNodes(stopOnParents),
2173
+ name = this.$tree.attr("name") || this.$tree.attr("id"),
2174
+ arr = [];
2175
+ for(var i=0, l=nodeList.length; i<l; i++){
2176
+ arr.push({name: name, value: nodeList[i].data.key});
2177
+ }
2178
+ return arr;
2179
+ },
2180
+
2092
2181
  getPersistData: function() {
2093
2182
  return this.persistence.toDict();
2094
2183
  },
@@ -2124,12 +2213,12 @@ DynaTree.prototype = {
2124
2213
 
2125
2214
  redraw: function() {
2126
2215
  this.logDebug("dynatree.redraw()...");
2127
- this.tnRoot.render();
2216
+ this.tnRoot.render(false);
2128
2217
  this.logDebug("dynatree.redraw() done.");
2129
2218
  },
2130
2219
 
2131
- reload: function() {
2132
- this._load();
2220
+ reload: function(callback) {
2221
+ this._load(callback);
2133
2222
  },
2134
2223
 
2135
2224
  getRoot: function() {
@@ -2207,10 +2296,10 @@ DynaTree.prototype = {
2207
2296
  return dtnode;
2208
2297
  },
2209
2298
 
2210
- loadKeyPath: function(keyPath, expand, callback) {
2299
+ loadKeyPath: function(keyPath, callback) {
2211
2300
  var segList = keyPath.split(this.options.keyPathSeparator);
2212
2301
  // Remove leading '/'
2213
- if(segList[0] == ""){
2302
+ if(segList[0] === ""){
2214
2303
  segList.shift();
2215
2304
  }
2216
2305
  // Remove leading system root key
@@ -2219,9 +2308,9 @@ DynaTree.prototype = {
2219
2308
  segList.shift();
2220
2309
  }
2221
2310
  keyPath = segList.join(this.options.keyPathSeparator);
2222
- return this.tnRoot.loadKeyPath(keyPath, expand, callback);
2311
+ return this.tnRoot._loadKeyPath(keyPath, callback);
2223
2312
  },
2224
-
2313
+
2225
2314
  selectKey: function(key, select) {
2226
2315
  var dtnode = this.getNodeByKey(key);
2227
2316
  if( !dtnode ){
@@ -2294,7 +2383,7 @@ TODO: better?
2294
2383
  var dataAttr = $.trim($li.attr("data"));
2295
2384
  if( dataAttr ) {
2296
2385
  if( dataAttr.charAt(0) != "{" ){
2297
- dataAttr = "{" + dataAttr + "}"
2386
+ dataAttr = "{" + dataAttr + "}";
2298
2387
  }
2299
2388
  try {
2300
2389
  $.extend(data, eval("(" + dataAttr + ")"));
@@ -2323,7 +2412,8 @@ TODO: better?
2323
2412
  if( !this.$dndMarker ) {
2324
2413
  this.$dndMarker = $("<div id='dynatree-drop-marker'></div>")
2325
2414
  .hide()
2326
- .prependTo("body");
2415
+ .prependTo($(this.divTree).parent());
2416
+ // .prependTo("body");
2327
2417
  logMsg("Creating marker: %o", this.$dndMarker);
2328
2418
  }
2329
2419
  if(hitMode === "start"){
@@ -2424,14 +2514,14 @@ TODO: better?
2424
2514
  .append($(event.target).closest('a').clone());
2425
2515
  // Attach node reference to helper object
2426
2516
  helper.data("dtSourceNode", node);
2427
- logMsg("helper.sourceNode=%o", helper.data("dtSourceNode"));
2517
+ this.logDebug("helper.sourceNode=%o", helper.data("dtSourceNode"));
2428
2518
  res = helper;
2429
2519
  break;
2430
2520
  case "start":
2431
2521
  if(node.isStatusNode()) {
2432
2522
  res = false;
2433
2523
  } else if(dnd.onDragStart) {
2434
- res = dnd.onDragStart(node)
2524
+ res = dnd.onDragStart(node);
2435
2525
  }
2436
2526
  if(res === false) {
2437
2527
  this.logDebug("tree.onDragStart() cancelled");
@@ -2464,11 +2554,21 @@ TODO: better?
2464
2554
  hitMode = enterResponse;
2465
2555
  } else {
2466
2556
  // Calculate hitMode from relative cursor position.
2467
- var nodeOfs = nodeTag.position();
2468
- var relPos = { x: event.clientX - nodeOfs.left,
2469
- y: event.clientY - nodeOfs.top };
2557
+ var nodeOfs = nodeTag.offset();
2558
+ // var relPos = { x: event.clientX - nodeOfs.left,
2559
+ // y: event.clientY - nodeOfs.top };
2560
+ // nodeOfs.top += this.parentTop;
2561
+ // nodeOfs.left += this.parentLeft;
2562
+ var relPos = { x: event.pageX - nodeOfs.left,
2563
+ y: event.pageY - nodeOfs.top };
2470
2564
  var relPos2 = { x: relPos.x / nodeTag.width(),
2471
- y: relPos.y / nodeTag.height() };
2565
+ y: relPos.y / nodeTag.height() };
2566
+ // this.logDebug("event.page: %s/%s", event.pageX, event.pageY);
2567
+ // this.logDebug("event.client: %s/%s", event.clientX, event.clientY);
2568
+ // this.logDebug("nodeOfs: %s/%s", nodeOfs.left, nodeOfs.top);
2569
+ //// this.logDebug("parent: %s/%s", this.parentLeft, this.parentTop);
2570
+ // this.logDebug("relPos: %s/%s", relPos.x, relPos.y);
2571
+ // this.logDebug("relPos2: %s/%s", relPos2.x, relPos2.y);
2472
2572
  if( enterResponse.after && relPos2.y > 0.75 ){
2473
2573
  hitMode = "after";
2474
2574
  } else if(!enterResponse.over && enterResponse.after && relPos2.y > 0.5 ){
@@ -2484,23 +2584,24 @@ TODO: better?
2484
2584
  // TODO: these are no-ops when moving nodes, but not in copy mode
2485
2585
  if( dnd.preventVoidMoves ){
2486
2586
  if(node === otherNode){
2487
- logMsg(" drop over source node prevented");
2587
+ this.logDebug(" drop over source node prevented");
2488
2588
  hitMode = null;
2489
2589
  }else if(hitMode === "before" && otherNode && node === otherNode.getNextSibling()){
2490
- logMsg(" drop after source node prevented");
2590
+ this.logDebug(" drop after source node prevented");
2491
2591
  hitMode = null;
2492
2592
  }else if(hitMode === "after" && otherNode && node === otherNode.getPrevSibling()){
2493
- logMsg(" drop before source node prevented");
2593
+ this.logDebug(" drop before source node prevented");
2494
2594
  hitMode = null;
2495
2595
  }else if(hitMode === "over" && otherNode
2496
2596
  && otherNode.parent === node && otherNode.isLastSibling() ){
2497
- logMsg(" drop last child over own parent prevented");
2597
+ this.logDebug(" drop last child over own parent prevented");
2498
2598
  hitMode = null;
2499
2599
  }
2500
2600
  }
2501
- logMsg("hitMode: %s - %s - %s", hitMode, (node.parent === otherNode), node.isLastSibling());
2601
+ this.logDebug("hitMode: %s - %s - %s", hitMode, (node.parent === otherNode), node.isLastSibling());
2502
2602
  ui.helper.data("hitMode", hitMode);
2503
2603
  // logMsg(" clientPos: %s/%s", event.clientX, event.clientY);
2604
+ // logMsg(" clientPos: %s/%s", event.pageX, event.pageY);
2504
2605
  // logMsg(" nodeOfs: %s/%s", nodeOfs.left, nodeOfs.top);
2505
2606
  // logMsg(" relPos: %s/%s", relPos.x, relPos.y);
2506
2607
  // logMsg(" relPos2: %s/%s: %s", relPos2.x, relPos2.y, hitMode);
@@ -2557,6 +2658,13 @@ TODO: better?
2557
2658
  return res;
2558
2659
  },
2559
2660
 
2661
+ cancelDrag: function() {
2662
+ var dd = $.ui.ddmanager.current;
2663
+ if(dd){
2664
+ dd.cancel();
2665
+ }
2666
+ },
2667
+
2560
2668
  // --- end of class
2561
2669
  lastentry: undefined
2562
2670
  };
@@ -2603,42 +2711,40 @@ $.widget("ui.dynatree", {
2603
2711
  },
2604
2712
 
2605
2713
  bind: function() {
2606
- var $this = this.element;
2607
- var o = this.options;
2608
-
2609
2714
  // Prevent duplicate binding
2610
2715
  this.unbind();
2611
2716
 
2612
2717
  var eventNames = "click.dynatree dblclick.dynatree";
2613
- if( o.keyboard ){
2718
+ if( this.options.keyboard ){
2614
2719
  // Note: leading ' '!
2615
2720
  eventNames += " keypress.dynatree keydown.dynatree";
2616
2721
  }
2617
- $this.bind(eventNames, function(event){
2722
+ this.element.bind(eventNames, function(event){
2618
2723
  var dtnode = getDtNodeFromElement(event.target);
2619
2724
  if( !dtnode ){
2620
2725
  return true; // Allow bubbling of other events
2621
2726
  }
2622
- var prevPhase = dtnode.tree.phase;
2623
- dtnode.tree.phase = "userEvent";
2727
+ var tree = dtnode.tree;
2728
+ var o = tree.options;
2729
+ tree.logDebug("event(%s): dtnode: %s", event.type, dtnode);
2730
+ var prevPhase = tree.phase;
2731
+ tree.phase = "userEvent";
2624
2732
  try {
2625
- dtnode.tree.logDebug("bind(%o): dtnode: %o", event, dtnode);
2626
-
2627
2733
  switch(event.type) {
2628
2734
  case "click":
2629
- return ( o.onClick && o.onClick(dtnode, event)===false ) ? false : dtnode.onClick(event);
2735
+ return ( o.onClick && o.onClick.call(tree, dtnode, event)===false ) ? false : dtnode._onClick(event);
2630
2736
  case "dblclick":
2631
- return ( o.onDblClick && o.onDblClick(dtnode, event)===false ) ? false : dtnode.onDblClick(event);
2737
+ return ( o.onDblClick && o.onDblClick.call(tree, dtnode, event)===false ) ? false : dtnode._onDblClick(event);
2632
2738
  case "keydown":
2633
- return ( o.onKeydown && o.onKeydown(dtnode, event)===false ) ? false : dtnode.onKeydown(event);
2739
+ return ( o.onKeydown && o.onKeydown.call(tree, dtnode, event)===false ) ? false : dtnode._onKeydown(event);
2634
2740
  case "keypress":
2635
- return ( o.onKeypress && o.onKeypress(dtnode, event)===false ) ? false : dtnode.onKeypress(event);
2741
+ return ( o.onKeypress && o.onKeypress.call(tree, dtnode, event)===false ) ? false : dtnode._onKeypress(event);
2636
2742
  }
2637
2743
  } catch(e) {
2638
2744
  var _ = null; // issue 117
2639
- dtnode.tree.logWarning("bind(%o): dtnode: %o, error: %o", event, dtnode, e);
2745
+ tree.logWarning("bind(%o): dtnode: %o, error: %o", event, dtnode, e);
2640
2746
  } finally {
2641
- dtnode.tree.phase = prevPhase;
2747
+ tree.phase = prevPhase;
2642
2748
  }
2643
2749
  });
2644
2750
 
@@ -2650,7 +2756,7 @@ $.widget("ui.dynatree", {
2650
2756
  // Fix event for IE:
2651
2757
  event = arguments[0] = $.event.fix( event || window.event );
2652
2758
  var dtnode = getDtNodeFromElement(event.target);
2653
- return dtnode ? dtnode.onFocus(event) : false;
2759
+ return dtnode ? dtnode._onFocus(event) : false;
2654
2760
  }
2655
2761
  var div = this.tree.divTree;
2656
2762
  if( div.addEventListener ) {
@@ -2710,15 +2816,14 @@ $.widget("ui.dynatree", {
2710
2816
 
2711
2817
 
2712
2818
  // The following methods return a value (thus breaking the jQuery call chain):
2713
-
2714
- // @@ 1.8
2715
- //$.ui.dynatree.getter = "getTree getRoot getActiveNode getSelectedNodes";
2819
+ if( parseFloat($.ui.version) < 1.8 ) {
2820
+ $.ui.dynatree.getter = "getTree getRoot getActiveNode getSelectedNodes";
2821
+ }
2716
2822
 
2717
2823
 
2718
2824
  /*******************************************************************************
2719
2825
  * Plugin default options:
2720
2826
  */
2721
- //$.ui.dynatree.defaults = { @@ 1.8
2722
2827
  $.ui.dynatree.prototype.options = {
2723
2828
  title: "Dynatree", // Tree's name (only used for debug outpu)
2724
2829
  minExpandLevel: 1, // 1: root node is not collapsible
@@ -2781,7 +2886,7 @@ $.ui.dynatree.prototype.options = {
2781
2886
  },
2782
2887
  generateIds: false, // Generate id attributes like <span id='dynatree-id-KEY'>
2783
2888
  idPrefix: "dynatree-id-", // Used to generate node id's like <span id="dynatree-id-<key>">.
2784
- keyPathSeparator: "/", // Used by node.getKeyPath() and tree.loadKeyPath().
2889
+ keyPathSeparator: "/", // Used by node.getKeyPath() and tree.loadKeyPath().
2785
2890
  // cookieId: "dynatree-cookie", // Choose a more unique name, to allow multiple trees.
2786
2891
  cookieId: "dynatree", // Choose a more unique name, to allow multiple trees.
2787
2892
  cookie: {
@@ -2813,6 +2918,7 @@ $.ui.dynatree.prototype.options = {
2813
2918
  hidden: "dynatree-hidden",
2814
2919
  combinedExpanderPrefix: "dynatree-exp-",
2815
2920
  combinedIconPrefix: "dynatree-ico-",
2921
+ nodeLoading: "dynatree-loading",
2816
2922
  // disabled: "dynatree-disabled",
2817
2923
  hasChildren: "dynatree-has-children",
2818
2924
  active: "dynatree-active",
@@ -2828,6 +2934,10 @@ $.ui.dynatree.prototype.options = {
2828
2934
  // ------------------------------------------------------------------------
2829
2935
  lastentry: undefined
2830
2936
  };
2937
+ //
2938
+ if( parseFloat($.ui.version) < 1.8 ) {
2939
+ $.ui.dynatree.defaults = $.ui.dynatree.prototype.options;
2940
+ }
2831
2941
 
2832
2942
  /*******************************************************************************
2833
2943
  * Reserved data attributes for a tree node.
@@ -2926,7 +3036,7 @@ var _registerDnd = function() {
2926
3036
  // draggable.offset.click.left -= event.target.offsetLeft;
2927
3037
  draggable.offset.click.top = -2;
2928
3038
  draggable.offset.click.left = + 16;
2929
- logMsg(" draggable.offset.click FIXED: %s/%s", draggable.offset.click.left, draggable.offset.click.top);
3039
+ // logMsg(" draggable.offset.click FIXED: %s/%s", draggable.offset.click.left, draggable.offset.click.top);
2930
3040
  // Trigger onDragStart event
2931
3041
  // TODO: when called as connectTo..., the return value is ignored(?)
2932
3042
  return sourceNode.tree._onDragEvent("start", sourceNode, null, event, ui, draggable);
@@ -2937,6 +3047,7 @@ var _registerDnd = function() {
2937
3047
  var sourceNode = ui.helper.data("dtSourceNode") || null;
2938
3048
  var prevTargetNode = ui.helper.data("dtTargetNode") || null;
2939
3049
  var targetNode = getDtNodeFromElement(event.target);
3050
+ // logMsg("getDtNodeFromElement(%o): %s", event.target, targetNode);
2940
3051
  if(event.target && !targetNode){
2941
3052
  // We got a drag event, but the targetNode could not be found
2942
3053
  // at the event location. This may happen, if the mouse