hurry 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (651) hide show
  1. data/Gemfile +55 -0
  2. data/Rakefile +69 -0
  3. data/app/assets/audios/twilight-hole.mp3 +0 -0
  4. data/app/assets/files/arvind resume (1).doc +0 -0
  5. data/app/assets/files/toma v 0 1.ppt +0 -0
  6. data/app/assets/images/0d0a413.png +0 -0
  7. data/app/assets/images/120.jpg +0 -0
  8. data/app/assets/images/51.jpg +0 -0
  9. data/app/assets/images/Untitled Document +97 -0
  10. data/app/assets/images/Untitled Document~ +97 -0
  11. data/app/assets/images/access.png +0 -0
  12. data/app/assets/images/adv.png +0 -0
  13. data/app/assets/images/article.png +0 -0
  14. data/app/assets/images/audio_icon.jpg +0 -0
  15. data/app/assets/images/background.gif +0 -0
  16. data/app/assets/images/banners/111.jpg +0 -0
  17. data/app/assets/images/banners/90.jpg +0 -0
  18. data/app/assets/images/banners/userimg.png +0 -0
  19. data/app/assets/images/blog.png +0 -0
  20. data/app/assets/images/body.png +0 -0
  21. data/app/assets/images/cancel.png +0 -0
  22. data/app/assets/images/cat.png +0 -0
  23. data/app/assets/images/contributions_userimg2.png +0 -0
  24. data/app/assets/images/delete.png +0 -0
  25. data/app/assets/images/edit.png +0 -0
  26. data/app/assets/images/excel.jpg +0 -0
  27. data/app/assets/images/file.gif +0 -0
  28. data/app/assets/images/file.jpeg +0 -0
  29. data/app/assets/images/folder-closed.gif +0 -0
  30. data/app/assets/images/folder.gif +0 -0
  31. data/app/assets/images/group.png +0 -0
  32. data/app/assets/images/header.png +0 -0
  33. data/app/assets/images/icons.gif +0 -0
  34. data/app/assets/images/loading.gif +0 -0
  35. data/app/assets/images/logo.png +0 -0
  36. data/app/assets/images/logout.png +0 -0
  37. data/app/assets/images/media.png +0 -0
  38. data/app/assets/images/minus.gif +0 -0
  39. data/app/assets/images/new.png +0 -0
  40. data/app/assets/images/page_manager.png +0 -0
  41. data/app/assets/images/pdf.png +0 -0
  42. data/app/assets/images/personal/ice glass.jpg +0 -0
  43. data/app/assets/images/plus.gif +0 -0
  44. data/app/assets/images/ppt.jpg +0 -0
  45. data/app/assets/images/profileimg.png +0 -0
  46. data/app/assets/images/rails.png +0 -0
  47. data/app/assets/images/setting.png +0 -0
  48. data/app/assets/images/status.png +0 -0
  49. data/app/assets/images/treeview-black-line.gif +0 -0
  50. data/app/assets/images/treeview-black.gif +0 -0
  51. data/app/assets/images/treeview-default-line.gif +0 -0
  52. data/app/assets/images/treeview-default.gif +0 -0
  53. data/app/assets/images/treeview-famfamfam-line.gif +0 -0
  54. data/app/assets/images/treeview-famfamfam.gif +0 -0
  55. data/app/assets/images/treeview-gray-line.gif +0 -0
  56. data/app/assets/images/treeview-gray.gif +0 -0
  57. data/app/assets/images/treeview-red-line.gif +0 -0
  58. data/app/assets/images/treeview-red.gif +0 -0
  59. data/app/assets/images/ui.dynatree.css +440 -0
  60. data/app/assets/images/user.png +0 -0
  61. data/app/assets/images/user1.png +0 -0
  62. data/app/assets/images/user_manager.png +0 -0
  63. data/app/assets/images/video_icon.jpg +0 -0
  64. data/app/assets/images/vline.gif +0 -0
  65. data/app/assets/images/word.png +0 -0
  66. data/app/assets/javascripts/application.js +9 -0
  67. data/app/assets/javascripts/bolt/articles.js.coffee +3 -0
  68. data/app/assets/javascripts/bolt/groups.js.coffee +3 -0
  69. data/app/assets/javascripts/bolt/user_groups.js.coffee +3 -0
  70. data/app/assets/javascripts/bolt/users_groups.js.coffee +3 -0
  71. data/app/assets/javascripts/imagebubble.js~ +68 -0
  72. data/app/assets/javascripts/javascript_functions.js +65 -0
  73. data/app/assets/javascripts/jquery.dynatree.js +3312 -0
  74. data/app/assets/javascripts/jquery.js +154 -0
  75. data/app/assets/javascripts/jquery.treeview.js +251 -0
  76. data/app/assets/javascripts/jquery_new.js +19 -0
  77. data/app/assets/javascripts/login.js +24 -0
  78. data/app/assets/javascripts/media.js +64 -0
  79. data/app/assets/javascripts/media.js.coffee +3 -0
  80. data/app/assets/javascripts/rails.js +132 -0
  81. data/app/assets/miscellaneous/1leader.flv +0 -0
  82. data/app/assets/miscellaneous/users_controller.1.rb +237 -0
  83. data/app/assets/stylesheets/application.css +8 -0
  84. data/app/assets/stylesheets/application.css~ +8 -0
  85. data/app/assets/stylesheets/bolt/articles.css.scss +3 -0
  86. data/app/assets/stylesheets/bolt/groups.css.scss +3 -0
  87. data/app/assets/stylesheets/bolt/user_groups.css.scss +3 -0
  88. data/app/assets/stylesheets/bolt/users_groups.css.scss +3 -0
  89. data/app/assets/stylesheets/bubble.css +28 -0
  90. data/app/assets/stylesheets/depot.css +26 -0
  91. data/app/assets/stylesheets/depot.css~ +34 -0
  92. data/app/assets/stylesheets/dropdown.css +49 -0
  93. data/app/assets/stylesheets/imagebubbles.css~ +32 -0
  94. data/app/assets/stylesheets/jquery.treeview.css +68 -0
  95. data/app/assets/stylesheets/media.css.scss +3 -0
  96. data/app/assets/stylesheets/mediamanager.css +10 -0
  97. data/app/assets/stylesheets/scaffolds.css +56 -0
  98. data/app/assets/stylesheets/scaffolds.css.scss +56 -0
  99. data/app/assets/stylesheets/ui.dynatree.css +440 -0
  100. data/app/assets/stylesheets/users_style.css +80 -0
  101. data/app/assets/videos/1leader.flv +0 -0
  102. data/app/controllers/application_controller.rb +7 -0
  103. data/app/controllers/application_controller.rb~ +3 -0
  104. data/app/controllers/articles_controller.rb~ +91 -0
  105. data/app/controllers/bolt/accesses_controller.rb +71 -0
  106. data/app/controllers/bolt/articles_categories_controller.rb +71 -0
  107. data/app/controllers/bolt/articles_controller.rb +97 -0
  108. data/app/controllers/bolt/articles_controller.rb~ +60 -0
  109. data/app/controllers/bolt/banners_controller.rb +58 -0
  110. data/app/controllers/bolt/blogs_controller.rb +82 -0
  111. data/app/controllers/bolt/bolt_controller.rb +234 -0
  112. data/app/controllers/bolt/bolt_controller.rb~ +201 -0
  113. data/app/controllers/bolt/categories_controller.rb +72 -0
  114. data/app/controllers/bolt/dashboard_controller.rb +14 -0
  115. data/app/controllers/bolt/dashboard_controller.rb~ +14 -0
  116. data/app/controllers/bolt/groups_controller.rb +100 -0
  117. data/app/controllers/bolt/groups_controller.rb~ +85 -0
  118. data/app/controllers/bolt/info_controller.rb +26 -0
  119. data/app/controllers/bolt/media_controller.rb +120 -0
  120. data/app/controllers/bolt/page_sections_controller.rb +58 -0
  121. data/app/controllers/bolt/pages_controller.rb +90 -0
  122. data/app/controllers/bolt/password_resets_controller.rb +66 -0
  123. data/app/controllers/bolt/settings_controller.rb +59 -0
  124. data/app/controllers/bolt/statuses_controller.rb +72 -0
  125. data/app/controllers/bolt/user_sessions_controller.rb +40 -0
  126. data/app/controllers/bolt/user_statuses_controller.rb +58 -0
  127. data/app/controllers/bolt/users_controller.rb +104 -0
  128. data/app/controllers/bolt/users_controller.rb~ +79 -0
  129. data/app/controllers/bolt/users_groups_controller.rb +99 -0
  130. data/app/controllers/bolt/users_groups_controller.rb~ +83 -0
  131. data/app/controllers/groups_controller.rb~ +83 -0
  132. data/app/controllers/users_groups_controller.rb~ +83 -0
  133. data/app/helpers/application_helper.rb +2 -0
  134. data/app/helpers/bolt/articles_helper.rb +2 -0
  135. data/app/helpers/bolt/bolt_helper.rb +208 -0
  136. data/app/helpers/bolt/bolt_helper.rb~ +208 -0
  137. data/app/helpers/bolt/config_helper.rb +46 -0
  138. data/app/helpers/bolt/config_helper.rb~ +46 -0
  139. data/app/helpers/bolt/groups_helper.rb +2 -0
  140. data/app/helpers/bolt/user_groups_helper.rb +2 -0
  141. data/app/helpers/bolt/users_groups_helper.rb +2 -0
  142. data/app/helpers/media_helper.rb +2 -0
  143. data/app/mailers/bolt/backbone_notification.rb~ +39 -0
  144. data/app/mailers/bolt/bolt_notification.rb +39 -0
  145. data/app/models/access.rb +5 -0
  146. data/app/models/article.rb +23 -0
  147. data/app/models/article.rb~ +3 -0
  148. data/app/models/articles_category.rb +12 -0
  149. data/app/models/blog.rb +5 -0
  150. data/app/models/bolt.rb +3 -0
  151. data/app/models/bolt.rb~ +5 -0
  152. data/app/models/bolt/group.rb~ +2 -0
  153. data/app/models/bolt/user.rb +56 -0
  154. data/app/models/bolt/user.rb~ +62 -0
  155. data/app/models/bolt/user_group.rb~ +3 -0
  156. data/app/models/bolt/user_session.rb +8 -0
  157. data/app/models/bolt/users_group.rb~ +2 -0
  158. data/app/models/category.rb +7 -0
  159. data/app/models/group.rb +8 -0
  160. data/app/models/group.rb~ +7 -0
  161. data/app/models/media_image.rb +19 -0
  162. data/app/models/media_images.rb +21 -0
  163. data/app/models/media_images.rb~ +21 -0
  164. data/app/models/medium.rb +8 -0
  165. data/app/models/page.rb +10 -0
  166. data/app/models/page_section.rb +3 -0
  167. data/app/models/setting.rb +3 -0
  168. data/app/models/status.rb +3 -0
  169. data/app/models/user_status.rb +3 -0
  170. data/app/models/users_group.rb +14 -0
  171. data/app/models/users_group.rb~ +6 -0
  172. data/app/views/bolt/accesses/_form.html.erb +13 -0
  173. data/app/views/bolt/accesses/_table.html.erb +17 -0
  174. data/app/views/bolt/accesses/_title.html.erb +9 -0
  175. data/app/views/bolt/accesses/index.html.erb +44 -0
  176. data/app/views/bolt/accesses/new.html.erb +18 -0
  177. data/app/views/bolt/accesses/show.html.erb +17 -0
  178. data/app/views/bolt/articles/_form.html.erb +113 -0
  179. data/app/views/bolt/articles/_form.html.erb~ +33 -0
  180. data/app/views/bolt/articles/_table.html.erb +29 -0
  181. data/app/views/bolt/articles/_table.html.erb~ +28 -0
  182. data/app/views/bolt/articles/_title.html.erb +9 -0
  183. data/app/views/bolt/articles/index.html.erb +37 -0
  184. data/app/views/bolt/articles/index.html.erb~ +10 -0
  185. data/app/views/bolt/articles/new.html.erb +16 -0
  186. data/app/views/bolt/articles/new.html.erb~ +18 -0
  187. data/app/views/bolt/articles/show.html.erb +17 -0
  188. data/app/views/bolt/articles/show.html.erb~ +17 -0
  189. data/app/views/bolt/articles_categories/_form.html.erb +13 -0
  190. data/app/views/bolt/articles_categories/_table.html.erb +18 -0
  191. data/app/views/bolt/articles_categories/index.html.erb +10 -0
  192. data/app/views/bolt/articles_categories/new.html.erb +18 -0
  193. data/app/views/bolt/articles_categories/show.html.erb +17 -0
  194. data/app/views/bolt/banners/_form.html.erb +13 -0
  195. data/app/views/bolt/banners/_table.html.erb +18 -0
  196. data/app/views/bolt/banners/index.html.erb +10 -0
  197. data/app/views/bolt/banners/new.html.erb +18 -0
  198. data/app/views/bolt/banners/show.html.erb +17 -0
  199. data/app/views/bolt/blogs/_form.html.erb +24 -0
  200. data/app/views/bolt/blogs/_table.html.erb +22 -0
  201. data/app/views/bolt/blogs/index.html.erb +33 -0
  202. data/app/views/bolt/blogs/new.html.erb +18 -0
  203. data/app/views/bolt/blogs/show.html.erb +17 -0
  204. data/app/views/bolt/bolt/index.html.erb +0 -0
  205. data/app/views/bolt/bolt/index.html.erb~ +3 -0
  206. data/app/views/bolt/bolt_notification/generate_new_password.erb +12 -0
  207. data/app/views/bolt/bolt_notification/new_user_information.erb +12 -0
  208. data/app/views/bolt/bolt_notification/password_reset_instructions.erb +11 -0
  209. data/app/views/bolt/categories/_form.html.erb +9 -0
  210. data/app/views/bolt/categories/_table.html.erb +17 -0
  211. data/app/views/bolt/categories/_title.html.erb +8 -0
  212. data/app/views/bolt/categories/index.html.erb +36 -0
  213. data/app/views/bolt/categories/new.html.erb +19 -0
  214. data/app/views/bolt/categories/show.html.erb +17 -0
  215. data/app/views/bolt/dashboard/index.html.erb +69 -0
  216. data/app/views/bolt/dashboard/index.html.erb~ +1 -0
  217. data/app/views/bolt/groups/_form.html.erb +18 -0
  218. data/app/views/bolt/groups/_form.html.erb~ +21 -0
  219. data/app/views/bolt/groups/_title.html.erb +5 -0
  220. data/app/views/bolt/groups/edit.html.erb +6 -0
  221. data/app/views/bolt/groups/index.html.erb +43 -0
  222. data/app/views/bolt/groups/index.html.erb~ +23 -0
  223. data/app/views/bolt/groups/new.html.erb +14 -0
  224. data/app/views/bolt/groups/new.html.erb~ +5 -0
  225. data/app/views/bolt/groups/show.html.erb +16 -0
  226. data/app/views/bolt/info/show.html.erb +43 -0
  227. data/app/views/bolt/info/show.html.erb~ +5 -0
  228. data/app/views/bolt/layouts/_left_navigation.html.erb +9 -0
  229. data/app/views/bolt/layouts/_left_navigation.html.erb~ +16 -0
  230. data/app/views/bolt/layouts/_right_navigation.html.erb +1 -0
  231. data/app/views/bolt/layouts/_right_navigation.html.erb~ +1 -0
  232. data/app/views/bolt/layouts/bolt_auth.html.erb +23 -0
  233. data/app/views/bolt/layouts/bolt_auth.html.erb~ +23 -0
  234. data/app/views/bolt/layouts/bolt_main.html.erb +86 -0
  235. data/app/views/bolt/layouts/bolt_main.html.erb~ +64 -0
  236. data/app/views/bolt/media/getfolderdatas.html.erb +31 -0
  237. data/app/views/bolt/media/index.html.erb +195 -0
  238. data/app/views/bolt/page_sections/_form.html.erb +21 -0
  239. data/app/views/bolt/page_sections/_table.html.erb +22 -0
  240. data/app/views/bolt/page_sections/index.html.erb +10 -0
  241. data/app/views/bolt/page_sections/new.html.erb +18 -0
  242. data/app/views/bolt/page_sections/show.html.erb +17 -0
  243. data/app/views/bolt/pages/_form.html.erb +166 -0
  244. data/app/views/bolt/pages/_form.html.erb~ +41 -0
  245. data/app/views/bolt/pages/_page_sections_form.html.erb +39 -0
  246. data/app/views/bolt/pages/_page_sections_form.html.erb~ +3 -0
  247. data/app/views/bolt/pages/_table.html.erb +29 -0
  248. data/app/views/bolt/pages/index.html.erb +34 -0
  249. data/app/views/bolt/pages/new.html.erb +18 -0
  250. data/app/views/bolt/pages/show.html.erb +18 -0
  251. data/app/views/bolt/password_resets/edit.html.erb +48 -0
  252. data/app/views/bolt/settings/_form.html.erb +25 -0
  253. data/app/views/bolt/settings/_table.html.erb +23 -0
  254. data/app/views/bolt/settings/index.html.erb +10 -0
  255. data/app/views/bolt/settings/new.html.erb +18 -0
  256. data/app/views/bolt/settings/show.html.erb +80 -0
  257. data/app/views/bolt/statuses/_form.html.erb +14 -0
  258. data/app/views/bolt/statuses/_table.html.erb +17 -0
  259. data/app/views/bolt/statuses/_title.html.erb +9 -0
  260. data/app/views/bolt/statuses/index.html.erb +37 -0
  261. data/app/views/bolt/statuses/new.html.erb +18 -0
  262. data/app/views/bolt/statuses/show.html.erb +17 -0
  263. data/app/views/bolt/user_sessions/new.html.erb +66 -0
  264. data/app/views/bolt/user_sessions_bk/new.html.erb +69 -0
  265. data/app/views/bolt/user_statuses/_form.html.erb +9 -0
  266. data/app/views/bolt/user_statuses/_table.html.erb +16 -0
  267. data/app/views/bolt/user_statuses/index.html.erb +10 -0
  268. data/app/views/bolt/user_statuses/new.html.erb +18 -0
  269. data/app/views/bolt/user_statuses/show.html.erb +17 -0
  270. data/app/views/bolt/users/_title.html.erb +8 -0
  271. data/app/views/bolt/users/index.html.erb +60 -0
  272. data/app/views/bolt/users/index.html.erb~ +35 -0
  273. data/app/views/bolt/users/new.html.erb +64 -0
  274. data/app/views/bolt/users/new.html.erb~ +46 -0
  275. data/app/views/bolt/users/response.json.builder~ +26 -0
  276. data/app/views/bolt/users/show.html.erb +130 -0
  277. data/app/views/bolt/users/show.html.erb~ +94 -0
  278. data/app/views/bolt/users_bk/_form.html.erb +77 -0
  279. data/app/views/bolt/users_bk/edit.html.erb +6 -0
  280. data/app/views/bolt/users_bk/index.html.erb +58 -0
  281. data/app/views/bolt/users_bk/index.html.erb~ +60 -0
  282. data/app/views/bolt/users_bk/new.html.erb +6 -0
  283. data/app/views/bolt/users_bk/show.html.erb +100 -0
  284. data/app/views/bolt/users_groups/_form.html.erb +25 -0
  285. data/app/views/bolt/users_groups/edit.html.erb +6 -0
  286. data/app/views/bolt/users_groups/index.html.erb +25 -0
  287. data/app/views/bolt/users_groups/new.html.erb +5 -0
  288. data/app/views/bolt/users_groups/show.html.erb +15 -0
  289. data/app/views/layouts/application.html.erb +18 -0
  290. data/app/views/layouts/application.html.erb~ +51 -0
  291. data/app/views/layouts/bolt_auth.html.erb +24 -0
  292. data/app/views/layouts/bolt_auth.html.erb~ +25 -0
  293. data/app/views/layouts/bolt_main.html.erb +142 -0
  294. data/app/views/layouts/bolt_main.html.erb~ +56 -0
  295. data/app/views/layouts/default_site.html.erb +81 -0
  296. data/app/views/user_groups/_form.html.erb +21 -0
  297. data/app/views/user_groups/edit.html.erb +6 -0
  298. data/app/views/user_groups/index.html.erb +32 -0
  299. data/app/views/user_groups/new.html.erb +5 -0
  300. data/app/views/user_groups/show.html.erb +10 -0
  301. data/config/application.rb +49 -0
  302. data/config/application.rb~ +48 -0
  303. data/config/boot.rb +6 -0
  304. data/config/database.yml +31 -0
  305. data/config/database.yml~ +25 -0
  306. data/config/environment.rb +5 -0
  307. data/config/environments/development.rb +30 -0
  308. data/config/environments/production.rb +60 -0
  309. data/config/environments/test.rb +39 -0
  310. data/config/initializers/backtrace_silencers.rb +7 -0
  311. data/config/initializers/inflections.rb +10 -0
  312. data/config/initializers/mime_types.rb +5 -0
  313. data/config/initializers/secret_token.rb +7 -0
  314. data/config/initializers/session_store.rb +8 -0
  315. data/config/initializers/wrap_parameters.rb +14 -0
  316. data/config/locales/en.yml +5 -0
  317. data/config/routes.rb +101 -0
  318. data/config/routes.rb~ +81 -0
  319. data/db/migrate/20111028162853_create_bolt_users.rb +49 -0
  320. data/db/migrate/20111028162853_create_bolt_users.rb~ +49 -0
  321. data/db/migrate/20120302083233_create_articles.rb~ +15 -0
  322. data/db/migrate/20120307133203_create_groups.rb +10 -0
  323. data/db/migrate/20120307133203_create_groups.rb~ +9 -0
  324. data/db/migrate/20120308113354_create_users_groups.rb +10 -0
  325. data/db/migrate/20120308113354_create_users_groups.rb~ +10 -0
  326. data/db/migrate/20120309070442_create_articles.rb +18 -0
  327. data/db/migrate/20120312063336_create_blogs.rb +15 -0
  328. data/db/migrate/20120312071401_create_categories.rb +13 -0
  329. data/db/migrate/20120313051136_create_accesses.rb +13 -0
  330. data/db/migrate/20120313051206_create_statuses.rb +13 -0
  331. data/db/migrate/20120313061322_create_media.rb +18 -0
  332. data/db/migrate/20120313061459_create_media_images.rb +10 -0
  333. data/db/migrate/20120313085220_create_user_statuses.rb +13 -0
  334. data/db/migrate/20120314060252_create_articles_categories.rb +14 -0
  335. data/db/migrate/20120314110540_create_pages.rb +24 -0
  336. data/db/migrate/20120314110540_create_pages.rb~ +24 -0
  337. data/db/migrate/20120314110602_create_page_sections.rb +20 -0
  338. data/db/migrate/20120314110602_create_page_sections.rb~ +20 -0
  339. data/db/migrate/20120314110922_add_ancestry_to_page.rb +9 -0
  340. data/db/migrate/20120315071805_change_mediaimages_column.rb +8 -0
  341. data/db/migrate/20120319132523_create_settings.rb +18 -0
  342. data/db/schema.rb +169 -0
  343. data/db/seeds.rb +7 -0
  344. data/doc/README_FOR_APP +2 -0
  345. data/lib/tasks/tasks.rake +31 -0
  346. data/public/404.html +26 -0
  347. data/public/422.html +26 -0
  348. data/public/500.html +26 -0
  349. data/public/bolt/images/backbone.png +0 -0
  350. data/public/bolt/images/header.png +0 -0
  351. data/public/bolt/images/icons/add.png +0 -0
  352. data/public/bolt/images/icons/ajax-spinner.gif +0 -0
  353. data/public/bolt/images/icons/delete.png +0 -0
  354. data/public/bolt/images/icons/icons.gif +0 -0
  355. data/public/bolt/images/icons/loading.gif +0 -0
  356. data/public/bolt/images/icons/spinner-sm.gif +0 -0
  357. data/public/bolt/images/icons/spinner.png +0 -0
  358. data/public/bolt/images/icons/table.png +0 -0
  359. data/public/bolt/images/icons/vline.gif +0 -0
  360. data/public/bolt/images/login/bottom.png +0 -0
  361. data/public/bolt/images/login/top.png +0 -0
  362. data/public/bolt/images/nav.png +0 -0
  363. data/public/bolt/images/rightNav.png +0 -0
  364. data/public/bolt/images/rightNavButton.png +0 -0
  365. data/public/bolt/images/visitSiteNav.png +0 -0
  366. data/public/bolt/imagesx/backbone.png +0 -0
  367. data/public/bolt/imagesx/header.png +0 -0
  368. data/public/bolt/imagesx/icons/add.png +0 -0
  369. data/public/bolt/imagesx/icons/ajax-spinner.gif +0 -0
  370. data/public/bolt/imagesx/icons/delete.png +0 -0
  371. data/public/bolt/imagesx/icons/icons.gif +0 -0
  372. data/public/bolt/imagesx/icons/loading.gif +0 -0
  373. data/public/bolt/imagesx/icons/spinner-sm.gif +0 -0
  374. data/public/bolt/imagesx/icons/spinner.png +0 -0
  375. data/public/bolt/imagesx/icons/table.png +0 -0
  376. data/public/bolt/imagesx/icons/vline.gif +0 -0
  377. data/public/bolt/imagesx/login/bottom.png +0 -0
  378. data/public/bolt/imagesx/login/top.png +0 -0
  379. data/public/bolt/imagesx/nav.png +0 -0
  380. data/public/bolt/imagesx/rightNav.png +0 -0
  381. data/public/bolt/imagesx/rightNavButton.png +0 -0
  382. data/public/bolt/imagesx/visitSiteNav.png +0 -0
  383. data/public/bolt/javascripts/backbone.js +25 -0
  384. data/public/bolt/javascripts/custom.js +2 -0
  385. data/public/bolt/javascripts/jquery.js +154 -0
  386. data/public/bolt/javascripts/login.js +24 -0
  387. data/public/bolt/javascripts/rails.js +132 -0
  388. data/public/bolt/stylesheets/custom.css +82 -0
  389. data/public/bolt/stylesheets/custom.css~ +82 -0
  390. data/public/bolt/stylesheets/elements.css +316 -0
  391. data/public/bolt/stylesheets/elements.css~ +307 -0
  392. data/public/bolt/stylesheets/login.css +137 -0
  393. data/public/bolt/stylesheets/login.css~ +137 -0
  394. data/public/bolt/stylesheets/screen.css +224 -0
  395. data/public/bolt/stylesheets/screen.css~ +224 -0
  396. data/public/favicon.ico +0 -0
  397. data/public/images/article.png +0 -0
  398. data/public/images/backbone.png +0 -0
  399. data/public/images/cancel.png +0 -0
  400. data/public/images/cat.png +0 -0
  401. data/public/images/delete.png +0 -0
  402. data/public/images/edit.png +0 -0
  403. data/public/images/file.gif +0 -0
  404. data/public/images/folder-closed.gif +0 -0
  405. data/public/images/folder.gif +0 -0
  406. data/public/images/header.png +0 -0
  407. data/public/images/icons.gif +0 -0
  408. data/public/images/icons/add.png +0 -0
  409. data/public/images/icons/ajax-spinner.gif +0 -0
  410. data/public/images/icons/delete.png +0 -0
  411. data/public/images/icons/icons.gif +0 -0
  412. data/public/images/icons/loading.gif +0 -0
  413. data/public/images/icons/spinner-sm.gif +0 -0
  414. data/public/images/icons/spinner.png +0 -0
  415. data/public/images/icons/table.png +0 -0
  416. data/public/images/icons/vline.gif +0 -0
  417. data/public/images/ii.jpg +0 -0
  418. data/public/images/loading.gif +0 -0
  419. data/public/images/login/bottom.png +0 -0
  420. data/public/images/login/top.png +0 -0
  421. data/public/images/logo.png +0 -0
  422. data/public/images/logout.png +0 -0
  423. data/public/images/media.png +0 -0
  424. data/public/images/minus.gif +0 -0
  425. data/public/images/nav.png +0 -0
  426. data/public/images/new.png +0 -0
  427. data/public/images/plus.gif +0 -0
  428. data/public/images/profileimg.png +0 -0
  429. data/public/images/rails.png +0 -0
  430. data/public/images/rightNav.png +0 -0
  431. data/public/images/rightNavButton.png +0 -0
  432. data/public/images/treeview-black-line.gif +0 -0
  433. data/public/images/treeview-black.gif +0 -0
  434. data/public/images/treeview-default-line.gif +0 -0
  435. data/public/images/treeview-default.gif +0 -0
  436. data/public/images/treeview-famfamfam-line.gif +0 -0
  437. data/public/images/treeview-famfamfam.gif +0 -0
  438. data/public/images/treeview-gray-line.gif +0 -0
  439. data/public/images/treeview-gray.gif +0 -0
  440. data/public/images/treeview-red-line.gif +0 -0
  441. data/public/images/treeview-red.gif +0 -0
  442. data/public/images/ui.dynatree.css +440 -0
  443. data/public/images/user.png +0 -0
  444. data/public/images/user1.png +0 -0
  445. data/public/images/visitSiteNav.png +0 -0
  446. data/public/images/vline.gif +0 -0
  447. data/public/javascripts/backbone.js +25 -0
  448. data/public/javascripts/custom.js +2 -0
  449. data/public/javascripts/jquery.js +154 -0
  450. data/public/javascripts/login.js +24 -0
  451. data/public/javascripts/rails.js +132 -0
  452. data/public/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  453. data/public/jqueryui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  454. data/public/jqueryui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  455. data/public/jqueryui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  456. data/public/jqueryui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  457. data/public/jqueryui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  458. data/public/jqueryui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  459. data/public/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  460. data/public/jqueryui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  461. data/public/jqueryui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  462. data/public/jqueryui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  463. data/public/jqueryui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  464. data/public/jqueryui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  465. data/public/jqueryui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  466. data/public/jqueryui/css/ui-lightness/jquery-ui-1.8.18.custom.css +336 -0
  467. data/public/jqueryui/development-bundle/AUTHORS.txt +30 -0
  468. data/public/jqueryui/development-bundle/GPL-LICENSE.txt +278 -0
  469. data/public/jqueryui/development-bundle/MIT-LICENSE.txt +25 -0
  470. data/public/jqueryui/development-bundle/demos/demos.css +334 -0
  471. data/public/jqueryui/development-bundle/demos/dialog/animated.html +56 -0
  472. data/public/jqueryui/development-bundle/demos/dialog/default.html +54 -0
  473. data/public/jqueryui/development-bundle/demos/dialog/index.html +23 -0
  474. data/public/jqueryui/development-bundle/demos/dialog/modal-confirmation.html +69 -0
  475. data/public/jqueryui/development-bundle/demos/dialog/modal-form.html +167 -0
  476. data/public/jqueryui/development-bundle/demos/dialog/modal-message.html +71 -0
  477. data/public/jqueryui/development-bundle/demos/dialog/modal.html +60 -0
  478. data/public/jqueryui/development-bundle/demos/draggable/constrain-movement.html +69 -0
  479. data/public/jqueryui/development-bundle/demos/draggable/cursor-style.html +49 -0
  480. data/public/jqueryui/development-bundle/demos/draggable/default.html +39 -0
  481. data/public/jqueryui/development-bundle/demos/draggable/delay-start.html +45 -0
  482. data/public/jqueryui/development-bundle/demos/draggable/events.html +77 -0
  483. data/public/jqueryui/development-bundle/demos/draggable/handle.html +50 -0
  484. data/public/jqueryui/development-bundle/demos/draggable/index.html +28 -0
  485. data/public/jqueryui/development-bundle/demos/draggable/revert.html +44 -0
  486. data/public/jqueryui/development-bundle/demos/draggable/scroll.html +51 -0
  487. data/public/jqueryui/development-bundle/demos/draggable/snap-to.html +68 -0
  488. data/public/jqueryui/development-bundle/demos/draggable/sortable.html +57 -0
  489. data/public/jqueryui/development-bundle/demos/draggable/visual-feedback.html +77 -0
  490. data/public/jqueryui/development-bundle/demos/droppable/accepted-elements.html +60 -0
  491. data/public/jqueryui/development-bundle/demos/droppable/default.html +53 -0
  492. data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras.jpg +0 -0
  493. data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras2.jpg +0 -0
  494. data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras2_min.jpg +0 -0
  495. data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras3.jpg +0 -0
  496. data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras3_min.jpg +0 -0
  497. data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras4.jpg +0 -0
  498. data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras4_min.jpg +0 -0
  499. data/public/jqueryui/development-bundle/demos/droppable/images/high_tatras_min.jpg +0 -0
  500. data/public/jqueryui/development-bundle/demos/droppable/index.html +24 -0
  501. data/public/jqueryui/development-bundle/demos/droppable/photo-manager.html +184 -0
  502. data/public/jqueryui/development-bundle/demos/droppable/propagation.html +80 -0
  503. data/public/jqueryui/development-bundle/demos/droppable/revert.html +61 -0
  504. data/public/jqueryui/development-bundle/demos/droppable/shopping-cart.html +101 -0
  505. data/public/jqueryui/development-bundle/demos/droppable/visual-feedback.html +78 -0
  506. data/public/jqueryui/development-bundle/demos/images/calendar.gif +0 -0
  507. data/public/jqueryui/development-bundle/demos/images/demo-config-on-tile.gif +0 -0
  508. data/public/jqueryui/development-bundle/demos/images/demo-config-on.gif +0 -0
  509. data/public/jqueryui/development-bundle/demos/images/demo-spindown-closed.gif +0 -0
  510. data/public/jqueryui/development-bundle/demos/images/demo-spindown-open.gif +0 -0
  511. data/public/jqueryui/development-bundle/demos/images/icon-docs-info.gif +0 -0
  512. data/public/jqueryui/development-bundle/demos/images/pbar-ani.gif +0 -0
  513. data/public/jqueryui/development-bundle/demos/index.html +328 -0
  514. data/public/jqueryui/development-bundle/demos/position/cycler.html +122 -0
  515. data/public/jqueryui/development-bundle/demos/position/default.html +153 -0
  516. data/public/jqueryui/development-bundle/demos/position/images/earth.jpg +0 -0
  517. data/public/jqueryui/development-bundle/demos/position/images/flight.jpg +0 -0
  518. data/public/jqueryui/development-bundle/demos/position/images/rocket.jpg +0 -0
  519. data/public/jqueryui/development-bundle/demos/position/index.html +19 -0
  520. data/public/jqueryui/development-bundle/demos/resizable/animate.html +43 -0
  521. data/public/jqueryui/development-bundle/demos/resizable/aspect-ratio.html +42 -0
  522. data/public/jqueryui/development-bundle/demos/resizable/constrain-area.html +47 -0
  523. data/public/jqueryui/development-bundle/demos/resizable/default.html +40 -0
  524. data/public/jqueryui/development-bundle/demos/resizable/delay-start.html +52 -0
  525. data/public/jqueryui/development-bundle/demos/resizable/helper.html +43 -0
  526. data/public/jqueryui/development-bundle/demos/resizable/index.html +28 -0
  527. data/public/jqueryui/development-bundle/demos/resizable/max-min.html +45 -0
  528. data/public/jqueryui/development-bundle/demos/resizable/snap-to-grid.html +42 -0
  529. data/public/jqueryui/development-bundle/demos/resizable/synchronous-resize.html +49 -0
  530. data/public/jqueryui/development-bundle/demos/resizable/textarea.html +41 -0
  531. data/public/jqueryui/development-bundle/demos/resizable/visual-feedback.html +43 -0
  532. data/public/jqueryui/development-bundle/demos/selectable/default.html +50 -0
  533. data/public/jqueryui/development-bundle/demos/selectable/display-grid.html +55 -0
  534. data/public/jqueryui/development-bundle/demos/selectable/index.html +20 -0
  535. data/public/jqueryui/development-bundle/demos/selectable/serialize.html +61 -0
  536. data/public/jqueryui/development-bundle/demos/sortable/connect-lists-through-tabs.html +78 -0
  537. data/public/jqueryui/development-bundle/demos/sortable/connect-lists.html +58 -0
  538. data/public/jqueryui/development-bundle/demos/sortable/default.html +51 -0
  539. data/public/jqueryui/development-bundle/demos/sortable/delay-start.html +67 -0
  540. data/public/jqueryui/development-bundle/demos/sortable/display-grid.html +54 -0
  541. data/public/jqueryui/development-bundle/demos/sortable/empty-lists.html +69 -0
  542. data/public/jqueryui/development-bundle/demos/sortable/index.html +26 -0
  543. data/public/jqueryui/development-bundle/demos/sortable/items.html +70 -0
  544. data/public/jqueryui/development-bundle/demos/sortable/placeholder.html +56 -0
  545. data/public/jqueryui/development-bundle/demos/sortable/portlets.html +96 -0
  546. data/public/jqueryui/development-bundle/docs/dialog.html +1698 -0
  547. data/public/jqueryui/development-bundle/docs/draggable.html +1577 -0
  548. data/public/jqueryui/development-bundle/docs/droppable.html +829 -0
  549. data/public/jqueryui/development-bundle/docs/position.html +245 -0
  550. data/public/jqueryui/development-bundle/docs/resizable.html +1201 -0
  551. data/public/jqueryui/development-bundle/docs/selectable.html +848 -0
  552. data/public/jqueryui/development-bundle/docs/sortable.html +1953 -0
  553. data/public/jqueryui/development-bundle/external/jquery.bgiframe-2.1.2.js +39 -0
  554. data/public/jqueryui/development-bundle/external/jquery.cookie.js +89 -0
  555. data/public/jqueryui/development-bundle/external/jquery.metadata.js +122 -0
  556. data/public/jqueryui/development-bundle/external/qunit.css +225 -0
  557. data/public/jqueryui/development-bundle/external/qunit.js +1448 -0
  558. data/public/jqueryui/development-bundle/jquery-1.7.1.js +9266 -0
  559. data/public/jqueryui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  560. data/public/jqueryui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  561. data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  562. data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  563. data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  564. data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  565. data/public/jqueryui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  566. data/public/jqueryui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  567. data/public/jqueryui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
  568. data/public/jqueryui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
  569. data/public/jqueryui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
  570. data/public/jqueryui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
  571. data/public/jqueryui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  572. data/public/jqueryui/development-bundle/themes/base/jquery.ui.all.css +11 -0
  573. data/public/jqueryui/development-bundle/themes/base/jquery.ui.base.css +4 -0
  574. data/public/jqueryui/development-bundle/themes/base/jquery.ui.core.css +38 -0
  575. data/public/jqueryui/development-bundle/themes/base/jquery.ui.dialog.css +21 -0
  576. data/public/jqueryui/development-bundle/themes/base/jquery.ui.resizable.css +20 -0
  577. data/public/jqueryui/development-bundle/themes/base/jquery.ui.selectable.css +10 -0
  578. data/public/jqueryui/development-bundle/themes/base/jquery.ui.theme.css +247 -0
  579. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  580. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  581. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  582. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  583. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  584. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  585. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  586. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  587. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  588. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  589. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  590. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  591. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  592. data/public/jqueryui/development-bundle/themes/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  593. data/public/jqueryui/development-bundle/themes/ui-lightness/jquery-ui-1.8.18.custom.css +336 -0
  594. data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.all.css +11 -0
  595. data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.base.css +4 -0
  596. data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.core.css +38 -0
  597. data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.dialog.css +21 -0
  598. data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.resizable.css +20 -0
  599. data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.selectable.css +10 -0
  600. data/public/jqueryui/development-bundle/themes/ui-lightness/jquery.ui.theme.css +249 -0
  601. data/public/jqueryui/development-bundle/ui/jquery-ui-1.8.18.custom.js +5206 -0
  602. data/public/jqueryui/development-bundle/ui/jquery.ui.core.js +319 -0
  603. data/public/jqueryui/development-bundle/ui/jquery.ui.dialog.js +878 -0
  604. data/public/jqueryui/development-bundle/ui/jquery.ui.draggable.js +825 -0
  605. data/public/jqueryui/development-bundle/ui/jquery.ui.droppable.js +296 -0
  606. data/public/jqueryui/development-bundle/ui/jquery.ui.mouse.js +162 -0
  607. data/public/jqueryui/development-bundle/ui/jquery.ui.position.js +298 -0
  608. data/public/jqueryui/development-bundle/ui/jquery.ui.resizable.js +808 -0
  609. data/public/jqueryui/development-bundle/ui/jquery.ui.selectable.js +267 -0
  610. data/public/jqueryui/development-bundle/ui/jquery.ui.sortable.js +1081 -0
  611. data/public/jqueryui/development-bundle/ui/jquery.ui.widget.js +272 -0
  612. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.core.min.js +9 -0
  613. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.dialog.min.js +18 -0
  614. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.draggable.min.js +14 -0
  615. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.droppable.min.js +15 -0
  616. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.mouse.min.js +12 -0
  617. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.position.min.js +9 -0
  618. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.resizable.min.js +14 -0
  619. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.selectable.min.js +14 -0
  620. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.sortable.min.js +14 -0
  621. data/public/jqueryui/development-bundle/ui/minified/jquery.ui.widget.min.js +9 -0
  622. data/public/jqueryui/development-bundle/version.txt +1 -0
  623. data/public/jqueryui/js/jquery-1.7.1.min.js +4 -0
  624. data/public/jqueryui/js/jquery-ui-1.8.18.custom.min.js +119 -0
  625. data/public/robots.txt +5 -0
  626. data/public/stylesheets/custom.css +91 -0
  627. data/public/stylesheets/custom.css~ +82 -0
  628. data/public/stylesheets/elements.css +315 -0
  629. data/public/stylesheets/elements.css~ +307 -0
  630. data/public/stylesheets/login.css +137 -0
  631. data/public/stylesheets/login.css~ +137 -0
  632. data/public/stylesheets/screen.css +224 -0
  633. data/public/stylesheets/screen.css~ +224 -0
  634. data/script/rails +6 -0
  635. data/test/fixtures/bolt/groups.yml +7 -0
  636. data/test/fixtures/bolt/users_groups.yml +9 -0
  637. data/test/fixtures/media.yml +13 -0
  638. data/test/fixtures/media_images.yml +9 -0
  639. data/test/functional/bolt/groups_controller_test.rb +49 -0
  640. data/test/functional/bolt/users_groups_controller_test.rb +49 -0
  641. data/test/functional/media_controller_test.rb +49 -0
  642. data/test/performance/browsing_test.rb +12 -0
  643. data/test/test_helper.rb +13 -0
  644. data/test/unit/bolt/group_test.rb +7 -0
  645. data/test/unit/bolt/users_group_test.rb +7 -0
  646. data/test/unit/helpers/bolt/groups_helper_test.rb +4 -0
  647. data/test/unit/helpers/bolt/users_groups_helper_test.rb +4 -0
  648. data/test/unit/helpers/media_helper_test.rb +4 -0
  649. data/test/unit/media_images_test.rb +7 -0
  650. data/test/unit/medium_test.rb +7 -0
  651. metadata +716 -0
@@ -0,0 +1,267 @@
1
+ /*
2
+ * jQuery UI Selectable 1.8.18
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Selectables
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ * jquery.ui.mouse.js
13
+ * jquery.ui.widget.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ $.widget("ui.selectable", $.ui.mouse, {
18
+ options: {
19
+ appendTo: 'body',
20
+ autoRefresh: true,
21
+ distance: 0,
22
+ filter: '*',
23
+ tolerance: 'touch'
24
+ },
25
+ _create: function() {
26
+ var self = this;
27
+
28
+ this.element.addClass("ui-selectable");
29
+
30
+ this.dragged = false;
31
+
32
+ // cache selectee children based on filter
33
+ var selectees;
34
+ this.refresh = function() {
35
+ selectees = $(self.options.filter, self.element[0]);
36
+ selectees.addClass("ui-selectee");
37
+ selectees.each(function() {
38
+ var $this = $(this);
39
+ var pos = $this.offset();
40
+ $.data(this, "selectable-item", {
41
+ element: this,
42
+ $element: $this,
43
+ left: pos.left,
44
+ top: pos.top,
45
+ right: pos.left + $this.outerWidth(),
46
+ bottom: pos.top + $this.outerHeight(),
47
+ startselected: false,
48
+ selected: $this.hasClass('ui-selected'),
49
+ selecting: $this.hasClass('ui-selecting'),
50
+ unselecting: $this.hasClass('ui-unselecting')
51
+ });
52
+ });
53
+ };
54
+ this.refresh();
55
+
56
+ this.selectees = selectees.addClass("ui-selectee");
57
+
58
+ this._mouseInit();
59
+
60
+ this.helper = $("<div class='ui-selectable-helper'></div>");
61
+ },
62
+
63
+ destroy: function() {
64
+ this.selectees
65
+ .removeClass("ui-selectee")
66
+ .removeData("selectable-item");
67
+ this.element
68
+ .removeClass("ui-selectable ui-selectable-disabled")
69
+ .removeData("selectable")
70
+ .unbind(".selectable");
71
+ this._mouseDestroy();
72
+
73
+ return this;
74
+ },
75
+
76
+ _mouseStart: function(event) {
77
+ var self = this;
78
+
79
+ this.opos = [event.pageX, event.pageY];
80
+
81
+ if (this.options.disabled)
82
+ return;
83
+
84
+ var options = this.options;
85
+
86
+ this.selectees = $(options.filter, this.element[0]);
87
+
88
+ this._trigger("start", event);
89
+
90
+ $(options.appendTo).append(this.helper);
91
+ // position helper (lasso)
92
+ this.helper.css({
93
+ "left": event.clientX,
94
+ "top": event.clientY,
95
+ "width": 0,
96
+ "height": 0
97
+ });
98
+
99
+ if (options.autoRefresh) {
100
+ this.refresh();
101
+ }
102
+
103
+ this.selectees.filter('.ui-selected').each(function() {
104
+ var selectee = $.data(this, "selectable-item");
105
+ selectee.startselected = true;
106
+ if (!event.metaKey && !event.ctrlKey) {
107
+ selectee.$element.removeClass('ui-selected');
108
+ selectee.selected = false;
109
+ selectee.$element.addClass('ui-unselecting');
110
+ selectee.unselecting = true;
111
+ // selectable UNSELECTING callback
112
+ self._trigger("unselecting", event, {
113
+ unselecting: selectee.element
114
+ });
115
+ }
116
+ });
117
+
118
+ $(event.target).parents().andSelf().each(function() {
119
+ var selectee = $.data(this, "selectable-item");
120
+ if (selectee) {
121
+ var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');
122
+ selectee.$element
123
+ .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
124
+ .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
125
+ selectee.unselecting = !doSelect;
126
+ selectee.selecting = doSelect;
127
+ selectee.selected = doSelect;
128
+ // selectable (UN)SELECTING callback
129
+ if (doSelect) {
130
+ self._trigger("selecting", event, {
131
+ selecting: selectee.element
132
+ });
133
+ } else {
134
+ self._trigger("unselecting", event, {
135
+ unselecting: selectee.element
136
+ });
137
+ }
138
+ return false;
139
+ }
140
+ });
141
+
142
+ },
143
+
144
+ _mouseDrag: function(event) {
145
+ var self = this;
146
+ this.dragged = true;
147
+
148
+ if (this.options.disabled)
149
+ return;
150
+
151
+ var options = this.options;
152
+
153
+ var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
154
+ if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
155
+ if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
156
+ this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
157
+
158
+ this.selectees.each(function() {
159
+ var selectee = $.data(this, "selectable-item");
160
+ //prevent helper from being selected if appendTo: selectable
161
+ if (!selectee || selectee.element == self.element[0])
162
+ return;
163
+ var hit = false;
164
+ if (options.tolerance == 'touch') {
165
+ hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
166
+ } else if (options.tolerance == 'fit') {
167
+ hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
168
+ }
169
+
170
+ if (hit) {
171
+ // SELECT
172
+ if (selectee.selected) {
173
+ selectee.$element.removeClass('ui-selected');
174
+ selectee.selected = false;
175
+ }
176
+ if (selectee.unselecting) {
177
+ selectee.$element.removeClass('ui-unselecting');
178
+ selectee.unselecting = false;
179
+ }
180
+ if (!selectee.selecting) {
181
+ selectee.$element.addClass('ui-selecting');
182
+ selectee.selecting = true;
183
+ // selectable SELECTING callback
184
+ self._trigger("selecting", event, {
185
+ selecting: selectee.element
186
+ });
187
+ }
188
+ } else {
189
+ // UNSELECT
190
+ if (selectee.selecting) {
191
+ if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
192
+ selectee.$element.removeClass('ui-selecting');
193
+ selectee.selecting = false;
194
+ selectee.$element.addClass('ui-selected');
195
+ selectee.selected = true;
196
+ } else {
197
+ selectee.$element.removeClass('ui-selecting');
198
+ selectee.selecting = false;
199
+ if (selectee.startselected) {
200
+ selectee.$element.addClass('ui-unselecting');
201
+ selectee.unselecting = true;
202
+ }
203
+ // selectable UNSELECTING callback
204
+ self._trigger("unselecting", event, {
205
+ unselecting: selectee.element
206
+ });
207
+ }
208
+ }
209
+ if (selectee.selected) {
210
+ if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
211
+ selectee.$element.removeClass('ui-selected');
212
+ selectee.selected = false;
213
+
214
+ selectee.$element.addClass('ui-unselecting');
215
+ selectee.unselecting = true;
216
+ // selectable UNSELECTING callback
217
+ self._trigger("unselecting", event, {
218
+ unselecting: selectee.element
219
+ });
220
+ }
221
+ }
222
+ }
223
+ });
224
+
225
+ return false;
226
+ },
227
+
228
+ _mouseStop: function(event) {
229
+ var self = this;
230
+
231
+ this.dragged = false;
232
+
233
+ var options = this.options;
234
+
235
+ $('.ui-unselecting', this.element[0]).each(function() {
236
+ var selectee = $.data(this, "selectable-item");
237
+ selectee.$element.removeClass('ui-unselecting');
238
+ selectee.unselecting = false;
239
+ selectee.startselected = false;
240
+ self._trigger("unselected", event, {
241
+ unselected: selectee.element
242
+ });
243
+ });
244
+ $('.ui-selecting', this.element[0]).each(function() {
245
+ var selectee = $.data(this, "selectable-item");
246
+ selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
247
+ selectee.selecting = false;
248
+ selectee.selected = true;
249
+ selectee.startselected = true;
250
+ self._trigger("selected", event, {
251
+ selected: selectee.element
252
+ });
253
+ });
254
+ this._trigger("stop", event);
255
+
256
+ this.helper.remove();
257
+
258
+ return false;
259
+ }
260
+
261
+ });
262
+
263
+ $.extend($.ui.selectable, {
264
+ version: "1.8.18"
265
+ });
266
+
267
+ })(jQuery);
@@ -0,0 +1,1081 @@
1
+ /*
2
+ * jQuery UI Sortable 1.8.18
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Sortables
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ * jquery.ui.mouse.js
13
+ * jquery.ui.widget.js
14
+ */
15
+ (function( $, undefined ) {
16
+
17
+ $.widget("ui.sortable", $.ui.mouse, {
18
+ widgetEventPrefix: "sort",
19
+ ready: false,
20
+ options: {
21
+ appendTo: "parent",
22
+ axis: false,
23
+ connectWith: false,
24
+ containment: false,
25
+ cursor: 'auto',
26
+ cursorAt: false,
27
+ dropOnEmpty: true,
28
+ forcePlaceholderSize: false,
29
+ forceHelperSize: false,
30
+ grid: false,
31
+ handle: false,
32
+ helper: "original",
33
+ items: '> *',
34
+ opacity: false,
35
+ placeholder: false,
36
+ revert: false,
37
+ scroll: true,
38
+ scrollSensitivity: 20,
39
+ scrollSpeed: 20,
40
+ scope: "default",
41
+ tolerance: "intersect",
42
+ zIndex: 1000
43
+ },
44
+ _create: function() {
45
+
46
+ var o = this.options;
47
+ this.containerCache = {};
48
+ this.element.addClass("ui-sortable");
49
+
50
+ //Get the items
51
+ this.refresh();
52
+
53
+ //Let's determine if the items are being displayed horizontally
54
+ this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
55
+
56
+ //Let's determine the parent's offset
57
+ this.offset = this.element.offset();
58
+
59
+ //Initialize mouse events for interaction
60
+ this._mouseInit();
61
+
62
+ //We're ready to go
63
+ this.ready = true
64
+
65
+ },
66
+
67
+ destroy: function() {
68
+ $.Widget.prototype.destroy.call( this );
69
+ this.element
70
+ .removeClass("ui-sortable ui-sortable-disabled");
71
+ this._mouseDestroy();
72
+
73
+ for ( var i = this.items.length - 1; i >= 0; i-- )
74
+ this.items[i].item.removeData(this.widgetName + "-item");
75
+
76
+ return this;
77
+ },
78
+
79
+ _setOption: function(key, value){
80
+ if ( key === "disabled" ) {
81
+ this.options[ key ] = value;
82
+
83
+ this.widget()
84
+ [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
85
+ } else {
86
+ // Don't call widget base _setOption for disable as it adds ui-state-disabled class
87
+ $.Widget.prototype._setOption.apply(this, arguments);
88
+ }
89
+ },
90
+
91
+ _mouseCapture: function(event, overrideHandle) {
92
+ var that = this;
93
+
94
+ if (this.reverting) {
95
+ return false;
96
+ }
97
+
98
+ if(this.options.disabled || this.options.type == 'static') return false;
99
+
100
+ //We have to refresh the items data once first
101
+ this._refreshItems(event);
102
+
103
+ //Find out if the clicked node (or one of its parents) is a actual item in this.items
104
+ var currentItem = null, self = this, nodes = $(event.target).parents().each(function() {
105
+ if($.data(this, that.widgetName + '-item') == self) {
106
+ currentItem = $(this);
107
+ return false;
108
+ }
109
+ });
110
+ if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target);
111
+
112
+ if(!currentItem) return false;
113
+ if(this.options.handle && !overrideHandle) {
114
+ var validHandle = false;
115
+
116
+ $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
117
+ if(!validHandle) return false;
118
+ }
119
+
120
+ this.currentItem = currentItem;
121
+ this._removeCurrentsFromItems();
122
+ return true;
123
+
124
+ },
125
+
126
+ _mouseStart: function(event, overrideHandle, noActivation) {
127
+
128
+ var o = this.options, self = this;
129
+ this.currentContainer = this;
130
+
131
+ //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
132
+ this.refreshPositions();
133
+
134
+ //Create and append the visible helper
135
+ this.helper = this._createHelper(event);
136
+
137
+ //Cache the helper size
138
+ this._cacheHelperProportions();
139
+
140
+ /*
141
+ * - Position generation -
142
+ * This block generates everything position related - it's the core of draggables.
143
+ */
144
+
145
+ //Cache the margins of the original element
146
+ this._cacheMargins();
147
+
148
+ //Get the next scrolling parent
149
+ this.scrollParent = this.helper.scrollParent();
150
+
151
+ //The element's absolute position on the page minus margins
152
+ this.offset = this.currentItem.offset();
153
+ this.offset = {
154
+ top: this.offset.top - this.margins.top,
155
+ left: this.offset.left - this.margins.left
156
+ };
157
+
158
+ // Only after we got the offset, we can change the helper's position to absolute
159
+ // TODO: Still need to figure out a way to make relative sorting possible
160
+ this.helper.css("position", "absolute");
161
+ this.cssPosition = this.helper.css("position");
162
+
163
+ $.extend(this.offset, {
164
+ click: { //Where the click happened, relative to the element
165
+ left: event.pageX - this.offset.left,
166
+ top: event.pageY - this.offset.top
167
+ },
168
+ parent: this._getParentOffset(),
169
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
170
+ });
171
+
172
+ //Generate the original position
173
+ this.originalPosition = this._generatePosition(event);
174
+ this.originalPageX = event.pageX;
175
+ this.originalPageY = event.pageY;
176
+
177
+ //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
178
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
179
+
180
+ //Cache the former DOM position
181
+ this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
182
+
183
+ //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
184
+ if(this.helper[0] != this.currentItem[0]) {
185
+ this.currentItem.hide();
186
+ }
187
+
188
+ //Create the placeholder
189
+ this._createPlaceholder();
190
+
191
+ //Set a containment if given in the options
192
+ if(o.containment)
193
+ this._setContainment();
194
+
195
+ if(o.cursor) { // cursor option
196
+ if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
197
+ $('body').css("cursor", o.cursor);
198
+ }
199
+
200
+ if(o.opacity) { // opacity option
201
+ if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
202
+ this.helper.css("opacity", o.opacity);
203
+ }
204
+
205
+ if(o.zIndex) { // zIndex option
206
+ if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
207
+ this.helper.css("zIndex", o.zIndex);
208
+ }
209
+
210
+ //Prepare scrolling
211
+ if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
212
+ this.overflowOffset = this.scrollParent.offset();
213
+
214
+ //Call callbacks
215
+ this._trigger("start", event, this._uiHash());
216
+
217
+ //Recache the helper size
218
+ if(!this._preserveHelperProportions)
219
+ this._cacheHelperProportions();
220
+
221
+
222
+ //Post 'activate' events to possible containers
223
+ if(!noActivation) {
224
+ for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); }
225
+ }
226
+
227
+ //Prepare possible droppables
228
+ if($.ui.ddmanager)
229
+ $.ui.ddmanager.current = this;
230
+
231
+ if ($.ui.ddmanager && !o.dropBehaviour)
232
+ $.ui.ddmanager.prepareOffsets(this, event);
233
+
234
+ this.dragging = true;
235
+
236
+ this.helper.addClass("ui-sortable-helper");
237
+ this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
238
+ return true;
239
+
240
+ },
241
+
242
+ _mouseDrag: function(event) {
243
+
244
+ //Compute the helpers position
245
+ this.position = this._generatePosition(event);
246
+ this.positionAbs = this._convertPositionTo("absolute");
247
+
248
+ if (!this.lastPositionAbs) {
249
+ this.lastPositionAbs = this.positionAbs;
250
+ }
251
+
252
+ //Do scrolling
253
+ if(this.options.scroll) {
254
+ var o = this.options, scrolled = false;
255
+ if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
256
+
257
+ if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
258
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
259
+ else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
260
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
261
+
262
+ if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
263
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
264
+ else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
265
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
266
+
267
+ } else {
268
+
269
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
270
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
271
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
272
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
273
+
274
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
275
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
276
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
277
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
278
+
279
+ }
280
+
281
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
282
+ $.ui.ddmanager.prepareOffsets(this, event);
283
+ }
284
+
285
+ //Regenerate the absolute position used for position checks
286
+ this.positionAbs = this._convertPositionTo("absolute");
287
+
288
+ //Set the helper position
289
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
290
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
291
+
292
+ //Rearrange
293
+ for (var i = this.items.length - 1; i >= 0; i--) {
294
+
295
+ //Cache variables and intersection, continue if no intersection
296
+ var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
297
+ if (!intersection) continue;
298
+
299
+ if(itemElement != this.currentItem[0] //cannot intersect with itself
300
+ && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
301
+ && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
302
+ && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true)
303
+ //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
304
+ ) {
305
+
306
+ this.direction = intersection == 1 ? "down" : "up";
307
+
308
+ if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
309
+ this._rearrange(event, item);
310
+ } else {
311
+ break;
312
+ }
313
+
314
+ this._trigger("change", event, this._uiHash());
315
+ break;
316
+ }
317
+ }
318
+
319
+ //Post events to containers
320
+ this._contactContainers(event);
321
+
322
+ //Interconnect with droppables
323
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
324
+
325
+ //Call callbacks
326
+ this._trigger('sort', event, this._uiHash());
327
+
328
+ this.lastPositionAbs = this.positionAbs;
329
+ return false;
330
+
331
+ },
332
+
333
+ _mouseStop: function(event, noPropagation) {
334
+
335
+ if(!event) return;
336
+
337
+ //If we are using droppables, inform the manager about the drop
338
+ if ($.ui.ddmanager && !this.options.dropBehaviour)
339
+ $.ui.ddmanager.drop(this, event);
340
+
341
+ if(this.options.revert) {
342
+ var self = this;
343
+ var cur = self.placeholder.offset();
344
+
345
+ self.reverting = true;
346
+
347
+ $(this.helper).animate({
348
+ left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
349
+ top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
350
+ }, parseInt(this.options.revert, 10) || 500, function() {
351
+ self._clear(event);
352
+ });
353
+ } else {
354
+ this._clear(event, noPropagation);
355
+ }
356
+
357
+ return false;
358
+
359
+ },
360
+
361
+ cancel: function() {
362
+
363
+ var self = this;
364
+
365
+ if(this.dragging) {
366
+
367
+ this._mouseUp({ target: null });
368
+
369
+ if(this.options.helper == "original")
370
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
371
+ else
372
+ this.currentItem.show();
373
+
374
+ //Post deactivating events to containers
375
+ for (var i = this.containers.length - 1; i >= 0; i--){
376
+ this.containers[i]._trigger("deactivate", null, self._uiHash(this));
377
+ if(this.containers[i].containerCache.over) {
378
+ this.containers[i]._trigger("out", null, self._uiHash(this));
379
+ this.containers[i].containerCache.over = 0;
380
+ }
381
+ }
382
+
383
+ }
384
+
385
+ if (this.placeholder) {
386
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
387
+ if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
388
+ if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();
389
+
390
+ $.extend(this, {
391
+ helper: null,
392
+ dragging: false,
393
+ reverting: false,
394
+ _noFinalSort: null
395
+ });
396
+
397
+ if(this.domPosition.prev) {
398
+ $(this.domPosition.prev).after(this.currentItem);
399
+ } else {
400
+ $(this.domPosition.parent).prepend(this.currentItem);
401
+ }
402
+ }
403
+
404
+ return this;
405
+
406
+ },
407
+
408
+ serialize: function(o) {
409
+
410
+ var items = this._getItemsAsjQuery(o && o.connected);
411
+ var str = []; o = o || {};
412
+
413
+ $(items).each(function() {
414
+ var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
415
+ if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
416
+ });
417
+
418
+ if(!str.length && o.key) {
419
+ str.push(o.key + '=');
420
+ }
421
+
422
+ return str.join('&');
423
+
424
+ },
425
+
426
+ toArray: function(o) {
427
+
428
+ var items = this._getItemsAsjQuery(o && o.connected);
429
+ var ret = []; o = o || {};
430
+
431
+ items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
432
+ return ret;
433
+
434
+ },
435
+
436
+ /* Be careful with the following core functions */
437
+ _intersectsWith: function(item) {
438
+
439
+ var x1 = this.positionAbs.left,
440
+ x2 = x1 + this.helperProportions.width,
441
+ y1 = this.positionAbs.top,
442
+ y2 = y1 + this.helperProportions.height;
443
+
444
+ var l = item.left,
445
+ r = l + item.width,
446
+ t = item.top,
447
+ b = t + item.height;
448
+
449
+ var dyClick = this.offset.click.top,
450
+ dxClick = this.offset.click.left;
451
+
452
+ var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
453
+
454
+ if( this.options.tolerance == "pointer"
455
+ || this.options.forcePointerForContainers
456
+ || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
457
+ ) {
458
+ return isOverElement;
459
+ } else {
460
+
461
+ return (l < x1 + (this.helperProportions.width / 2) // Right Half
462
+ && x2 - (this.helperProportions.width / 2) < r // Left Half
463
+ && t < y1 + (this.helperProportions.height / 2) // Bottom Half
464
+ && y2 - (this.helperProportions.height / 2) < b ); // Top Half
465
+
466
+ }
467
+ },
468
+
469
+ _intersectsWithPointer: function(item) {
470
+
471
+ var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
472
+ isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
473
+ isOverElement = isOverElementHeight && isOverElementWidth,
474
+ verticalDirection = this._getDragVerticalDirection(),
475
+ horizontalDirection = this._getDragHorizontalDirection();
476
+
477
+ if (!isOverElement)
478
+ return false;
479
+
480
+ return this.floating ?
481
+ ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
482
+ : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );
483
+
484
+ },
485
+
486
+ _intersectsWithSides: function(item) {
487
+
488
+ var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
489
+ isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
490
+ verticalDirection = this._getDragVerticalDirection(),
491
+ horizontalDirection = this._getDragHorizontalDirection();
492
+
493
+ if (this.floating && horizontalDirection) {
494
+ return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
495
+ } else {
496
+ return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
497
+ }
498
+
499
+ },
500
+
501
+ _getDragVerticalDirection: function() {
502
+ var delta = this.positionAbs.top - this.lastPositionAbs.top;
503
+ return delta != 0 && (delta > 0 ? "down" : "up");
504
+ },
505
+
506
+ _getDragHorizontalDirection: function() {
507
+ var delta = this.positionAbs.left - this.lastPositionAbs.left;
508
+ return delta != 0 && (delta > 0 ? "right" : "left");
509
+ },
510
+
511
+ refresh: function(event) {
512
+ this._refreshItems(event);
513
+ this.refreshPositions();
514
+ return this;
515
+ },
516
+
517
+ _connectWith: function() {
518
+ var options = this.options;
519
+ return options.connectWith.constructor == String
520
+ ? [options.connectWith]
521
+ : options.connectWith;
522
+ },
523
+
524
+ _getItemsAsjQuery: function(connected) {
525
+
526
+ var self = this;
527
+ var items = [];
528
+ var queries = [];
529
+ var connectWith = this._connectWith();
530
+
531
+ if(connectWith && connected) {
532
+ for (var i = connectWith.length - 1; i >= 0; i--){
533
+ var cur = $(connectWith[i]);
534
+ for (var j = cur.length - 1; j >= 0; j--){
535
+ var inst = $.data(cur[j], this.widgetName);
536
+ if(inst && inst != this && !inst.options.disabled) {
537
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]);
538
+ }
539
+ };
540
+ };
541
+ }
542
+
543
+ queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]);
544
+
545
+ for (var i = queries.length - 1; i >= 0; i--){
546
+ queries[i][0].each(function() {
547
+ items.push(this);
548
+ });
549
+ };
550
+
551
+ return $(items);
552
+
553
+ },
554
+
555
+ _removeCurrentsFromItems: function() {
556
+
557
+ var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
558
+
559
+ for (var i=0; i < this.items.length; i++) {
560
+
561
+ for (var j=0; j < list.length; j++) {
562
+ if(list[j] == this.items[i].item[0])
563
+ this.items.splice(i,1);
564
+ };
565
+
566
+ };
567
+
568
+ },
569
+
570
+ _refreshItems: function(event) {
571
+
572
+ this.items = [];
573
+ this.containers = [this];
574
+ var items = this.items;
575
+ var self = this;
576
+ var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
577
+ var connectWith = this._connectWith();
578
+
579
+ if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
580
+ for (var i = connectWith.length - 1; i >= 0; i--){
581
+ var cur = $(connectWith[i]);
582
+ for (var j = cur.length - 1; j >= 0; j--){
583
+ var inst = $.data(cur[j], this.widgetName);
584
+ if(inst && inst != this && !inst.options.disabled) {
585
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
586
+ this.containers.push(inst);
587
+ }
588
+ };
589
+ };
590
+ }
591
+
592
+ for (var i = queries.length - 1; i >= 0; i--) {
593
+ var targetData = queries[i][1];
594
+ var _queries = queries[i][0];
595
+
596
+ for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
597
+ var item = $(_queries[j]);
598
+
599
+ item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)
600
+
601
+ items.push({
602
+ item: item,
603
+ instance: targetData,
604
+ width: 0, height: 0,
605
+ left: 0, top: 0
606
+ });
607
+ };
608
+ };
609
+
610
+ },
611
+
612
+ refreshPositions: function(fast) {
613
+
614
+ //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
615
+ if(this.offsetParent && this.helper) {
616
+ this.offset.parent = this._getParentOffset();
617
+ }
618
+
619
+ for (var i = this.items.length - 1; i >= 0; i--){
620
+ var item = this.items[i];
621
+
622
+ //We ignore calculating positions of all connected containers when we're not over them
623
+ if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
624
+ continue;
625
+
626
+ var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
627
+
628
+ if (!fast) {
629
+ item.width = t.outerWidth();
630
+ item.height = t.outerHeight();
631
+ }
632
+
633
+ var p = t.offset();
634
+ item.left = p.left;
635
+ item.top = p.top;
636
+ };
637
+
638
+ if(this.options.custom && this.options.custom.refreshContainers) {
639
+ this.options.custom.refreshContainers.call(this);
640
+ } else {
641
+ for (var i = this.containers.length - 1; i >= 0; i--){
642
+ var p = this.containers[i].element.offset();
643
+ this.containers[i].containerCache.left = p.left;
644
+ this.containers[i].containerCache.top = p.top;
645
+ this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
646
+ this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
647
+ };
648
+ }
649
+
650
+ return this;
651
+ },
652
+
653
+ _createPlaceholder: function(that) {
654
+
655
+ var self = that || this, o = self.options;
656
+
657
+ if(!o.placeholder || o.placeholder.constructor == String) {
658
+ var className = o.placeholder;
659
+ o.placeholder = {
660
+ element: function() {
661
+
662
+ var el = $(document.createElement(self.currentItem[0].nodeName))
663
+ .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder")
664
+ .removeClass("ui-sortable-helper")[0];
665
+
666
+ if(!className)
667
+ el.style.visibility = "hidden";
668
+
669
+ return el;
670
+ },
671
+ update: function(container, p) {
672
+
673
+ // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
674
+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
675
+ if(className && !o.forcePlaceholderSize) return;
676
+
677
+ //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
678
+ if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };
679
+ if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };
680
+ }
681
+ };
682
+ }
683
+
684
+ //Create the placeholder
685
+ self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));
686
+
687
+ //Append it after the actual current item
688
+ self.currentItem.after(self.placeholder);
689
+
690
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
691
+ o.placeholder.update(self, self.placeholder);
692
+
693
+ },
694
+
695
+ _contactContainers: function(event) {
696
+
697
+ // get innermost container that intersects with item
698
+ var innermostContainer = null, innermostIndex = null;
699
+
700
+
701
+ for (var i = this.containers.length - 1; i >= 0; i--){
702
+
703
+ // never consider a container that's located within the item itself
704
+ if($.ui.contains(this.currentItem[0], this.containers[i].element[0]))
705
+ continue;
706
+
707
+ if(this._intersectsWith(this.containers[i].containerCache)) {
708
+
709
+ // if we've already found a container and it's more "inner" than this, then continue
710
+ if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0]))
711
+ continue;
712
+
713
+ innermostContainer = this.containers[i];
714
+ innermostIndex = i;
715
+
716
+ } else {
717
+ // container doesn't intersect. trigger "out" event if necessary
718
+ if(this.containers[i].containerCache.over) {
719
+ this.containers[i]._trigger("out", event, this._uiHash(this));
720
+ this.containers[i].containerCache.over = 0;
721
+ }
722
+ }
723
+
724
+ }
725
+
726
+ // if no intersecting containers found, return
727
+ if(!innermostContainer) return;
728
+
729
+ // move the item into the container if it's not there already
730
+ if(this.containers.length === 1) {
731
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
732
+ this.containers[innermostIndex].containerCache.over = 1;
733
+ } else if(this.currentContainer != this.containers[innermostIndex]) {
734
+
735
+ //When entering a new container, we will find the item with the least distance and append our item near it
736
+ var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top'];
737
+ for (var j = this.items.length - 1; j >= 0; j--) {
738
+ if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
739
+ var cur = this.items[j][this.containers[innermostIndex].floating ? 'left' : 'top'];
740
+ if(Math.abs(cur - base) < dist) {
741
+ dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
742
+ }
743
+ }
744
+
745
+ if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
746
+ return;
747
+
748
+ this.currentContainer = this.containers[innermostIndex];
749
+ itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
750
+ this._trigger("change", event, this._uiHash());
751
+ this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
752
+
753
+ //Update the placeholder
754
+ this.options.placeholder.update(this.currentContainer, this.placeholder);
755
+
756
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
757
+ this.containers[innermostIndex].containerCache.over = 1;
758
+ }
759
+
760
+
761
+ },
762
+
763
+ _createHelper: function(event) {
764
+
765
+ var o = this.options;
766
+ var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);
767
+
768
+ if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
769
+ $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
770
+
771
+ if(helper[0] == this.currentItem[0])
772
+ this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
773
+
774
+ if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
775
+ if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
776
+
777
+ return helper;
778
+
779
+ },
780
+
781
+ _adjustOffsetFromHelper: function(obj) {
782
+ if (typeof obj == 'string') {
783
+ obj = obj.split(' ');
784
+ }
785
+ if ($.isArray(obj)) {
786
+ obj = {left: +obj[0], top: +obj[1] || 0};
787
+ }
788
+ if ('left' in obj) {
789
+ this.offset.click.left = obj.left + this.margins.left;
790
+ }
791
+ if ('right' in obj) {
792
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
793
+ }
794
+ if ('top' in obj) {
795
+ this.offset.click.top = obj.top + this.margins.top;
796
+ }
797
+ if ('bottom' in obj) {
798
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
799
+ }
800
+ },
801
+
802
+ _getParentOffset: function() {
803
+
804
+
805
+ //Get the offsetParent and cache its position
806
+ this.offsetParent = this.helper.offsetParent();
807
+ var po = this.offsetParent.offset();
808
+
809
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
810
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
811
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
812
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
813
+ if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
814
+ po.left += this.scrollParent.scrollLeft();
815
+ po.top += this.scrollParent.scrollTop();
816
+ }
817
+
818
+ if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
819
+ || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
820
+ po = { top: 0, left: 0 };
821
+
822
+ return {
823
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
824
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
825
+ };
826
+
827
+ },
828
+
829
+ _getRelativeOffset: function() {
830
+
831
+ if(this.cssPosition == "relative") {
832
+ var p = this.currentItem.position();
833
+ return {
834
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
835
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
836
+ };
837
+ } else {
838
+ return { top: 0, left: 0 };
839
+ }
840
+
841
+ },
842
+
843
+ _cacheMargins: function() {
844
+ this.margins = {
845
+ left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
846
+ top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
847
+ };
848
+ },
849
+
850
+ _cacheHelperProportions: function() {
851
+ this.helperProportions = {
852
+ width: this.helper.outerWidth(),
853
+ height: this.helper.outerHeight()
854
+ };
855
+ },
856
+
857
+ _setContainment: function() {
858
+
859
+ var o = this.options;
860
+ if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
861
+ if(o.containment == 'document' || o.containment == 'window') this.containment = [
862
+ 0 - this.offset.relative.left - this.offset.parent.left,
863
+ 0 - this.offset.relative.top - this.offset.parent.top,
864
+ $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
865
+ ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
866
+ ];
867
+
868
+ if(!(/^(document|window|parent)$/).test(o.containment)) {
869
+ var ce = $(o.containment)[0];
870
+ var co = $(o.containment).offset();
871
+ var over = ($(ce).css("overflow") != 'hidden');
872
+
873
+ this.containment = [
874
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
875
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
876
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
877
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
878
+ ];
879
+ }
880
+
881
+ },
882
+
883
+ _convertPositionTo: function(d, pos) {
884
+
885
+ if(!pos) pos = this.position;
886
+ var mod = d == "absolute" ? 1 : -1;
887
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
888
+
889
+ return {
890
+ top: (
891
+ pos.top // The absolute mouse position
892
+ + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
893
+ + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
894
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
895
+ ),
896
+ left: (
897
+ pos.left // The absolute mouse position
898
+ + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
899
+ + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
900
+ - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
901
+ )
902
+ };
903
+
904
+ },
905
+
906
+ _generatePosition: function(event) {
907
+
908
+ var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
909
+
910
+ // This is another very weird special case that only happens for relative elements:
911
+ // 1. If the css position is relative
912
+ // 2. and the scroll parent is the document or similar to the offset parent
913
+ // we have to refresh the relative offset during the scroll so there are no jumps
914
+ if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
915
+ this.offset.relative = this._getRelativeOffset();
916
+ }
917
+
918
+ var pageX = event.pageX;
919
+ var pageY = event.pageY;
920
+
921
+ /*
922
+ * - Position constraining -
923
+ * Constrain the position to a mix of grid, containment.
924
+ */
925
+
926
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
927
+
928
+ if(this.containment) {
929
+ if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
930
+ if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
931
+ if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
932
+ if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
933
+ }
934
+
935
+ if(o.grid) {
936
+ var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
937
+ pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
938
+
939
+ var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
940
+ pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
941
+ }
942
+
943
+ }
944
+
945
+ return {
946
+ top: (
947
+ pageY // The absolute mouse position
948
+ - this.offset.click.top // Click offset (relative to the element)
949
+ - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
950
+ - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
951
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
952
+ ),
953
+ left: (
954
+ pageX // The absolute mouse position
955
+ - this.offset.click.left // Click offset (relative to the element)
956
+ - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
957
+ - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
958
+ + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
959
+ )
960
+ };
961
+
962
+ },
963
+
964
+ _rearrange: function(event, i, a, hardRefresh) {
965
+
966
+ a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));
967
+
968
+ //Various things done here to improve the performance:
969
+ // 1. we create a setTimeout, that calls refreshPositions
970
+ // 2. on the instance, we have a counter variable, that get's higher after every append
971
+ // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
972
+ // 4. this lets only the last addition to the timeout stack through
973
+ this.counter = this.counter ? ++this.counter : 1;
974
+ var self = this, counter = this.counter;
975
+
976
+ window.setTimeout(function() {
977
+ if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
978
+ },0);
979
+
980
+ },
981
+
982
+ _clear: function(event, noPropagation) {
983
+
984
+ this.reverting = false;
985
+ // We delay all events that have to be triggered to after the point where the placeholder has been removed and
986
+ // everything else normalized again
987
+ var delayedTriggers = [], self = this;
988
+
989
+ // We first have to update the dom position of the actual currentItem
990
+ // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
991
+ if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
992
+ this._noFinalSort = null;
993
+
994
+ if(this.helper[0] == this.currentItem[0]) {
995
+ for(var i in this._storedCSS) {
996
+ if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
997
+ }
998
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
999
+ } else {
1000
+ this.currentItem.show();
1001
+ }
1002
+
1003
+ if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
1004
+ if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
1005
+ if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
1006
+ if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
1007
+ for (var i = this.containers.length - 1; i >= 0; i--){
1008
+ if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {
1009
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
1010
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
1011
+ }
1012
+ };
1013
+ };
1014
+
1015
+ //Post events to containers
1016
+ for (var i = this.containers.length - 1; i >= 0; i--){
1017
+ if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
1018
+ if(this.containers[i].containerCache.over) {
1019
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
1020
+ this.containers[i].containerCache.over = 0;
1021
+ }
1022
+ }
1023
+
1024
+ //Do what was originally in plugins
1025
+ if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
1026
+ if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity
1027
+ if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index
1028
+
1029
+ this.dragging = false;
1030
+ if(this.cancelHelperRemoval) {
1031
+ if(!noPropagation) {
1032
+ this._trigger("beforeStop", event, this._uiHash());
1033
+ for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
1034
+ this._trigger("stop", event, this._uiHash());
1035
+ }
1036
+ return false;
1037
+ }
1038
+
1039
+ if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());
1040
+
1041
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
1042
+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
1043
+
1044
+ if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;
1045
+
1046
+ if(!noPropagation) {
1047
+ for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
1048
+ this._trigger("stop", event, this._uiHash());
1049
+ }
1050
+
1051
+ this.fromOutside = false;
1052
+ return true;
1053
+
1054
+ },
1055
+
1056
+ _trigger: function() {
1057
+ if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
1058
+ this.cancel();
1059
+ }
1060
+ },
1061
+
1062
+ _uiHash: function(inst) {
1063
+ var self = inst || this;
1064
+ return {
1065
+ helper: self.helper,
1066
+ placeholder: self.placeholder || $([]),
1067
+ position: self.position,
1068
+ originalPosition: self.originalPosition,
1069
+ offset: self.positionAbs,
1070
+ item: self.currentItem,
1071
+ sender: inst ? inst.element : null
1072
+ };
1073
+ }
1074
+
1075
+ });
1076
+
1077
+ $.extend($.ui.sortable, {
1078
+ version: "1.8.18"
1079
+ });
1080
+
1081
+ })(jQuery);