super-sharp-tool 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. checksums.yaml +7 -0
  2. data/activeadmin-3.5.1/CHANGELOG.md +1153 -0
  3. data/activeadmin-3.5.1/CODE_OF_CONDUCT.md +74 -0
  4. data/activeadmin-3.5.1/CONTRIBUTING.md +187 -0
  5. data/activeadmin-3.5.1/LICENSE +20 -0
  6. data/activeadmin-3.5.1/README.md +117 -0
  7. data/activeadmin-3.5.1/app/assets/javascripts/active_admin/base.js +520 -0
  8. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/_base.scss +57 -0
  9. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/_forms.scss +315 -0
  10. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/_header.scss +188 -0
  11. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/_mixins.scss +1 -0
  12. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/_normalize.scss +349 -0
  13. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/_print.scss +287 -0
  14. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/_typography.scss +100 -0
  15. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_batch_actions.scss +6 -0
  16. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_blank_slates.scss +30 -0
  17. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_breadcrumbs.scss +20 -0
  18. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_buttons.scss +6 -0
  19. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_columns.scss +3 -0
  20. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_comments.scss +41 -0
  21. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_date_picker.scss +148 -0
  22. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +154 -0
  23. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_flash_messages.scss +37 -0
  24. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_grid.scss +9 -0
  25. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_index_list.scss +12 -0
  26. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_links.scss +5 -0
  27. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_modal_dialog.scss +34 -0
  28. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_pagination.scss +58 -0
  29. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_panels.scss +6 -0
  30. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_scopes.scss +13 -0
  31. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_status_tags.scss +12 -0
  32. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_table_tools.scss +70 -0
  33. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_tables.scss +112 -0
  34. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_tabs.scss +68 -0
  35. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/components/_unsupported_browser.scss +16 -0
  36. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_all.scss +8 -0
  37. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_buttons.scss +65 -0
  38. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_gradients.scss +28 -0
  39. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_rounded.scss +22 -0
  40. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_sections.scss +41 -0
  41. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_shadows.scss +15 -0
  42. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_typography.scss +3 -0
  43. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_utilities.scss +17 -0
  44. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/mixins/_variables.scss +51 -0
  45. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/pages/_logged_out.scss +44 -0
  46. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/structure/_footer.scss +19 -0
  47. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/structure/_main_structure.scss +29 -0
  48. data/activeadmin-3.5.1/app/assets/stylesheets/active_admin/structure/_title_bar.scss +43 -0
  49. data/activeadmin-3.5.1/app/javascript/active_admin/base.js +28 -0
  50. data/activeadmin-3.5.1/app/javascript/active_admin/ext/jquery-ui.js +7 -0
  51. data/activeadmin-3.5.1/app/javascript/active_admin/ext/jquery.js +9 -0
  52. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/batch-actions.js +61 -0
  53. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/checkbox-toggler.js +3 -0
  54. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/datepicker.js +19 -0
  55. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/dropdown-menu.js +9 -0
  56. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/filters.js +10 -0
  57. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/has-many.js +98 -0
  58. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/per-page.js +13 -0
  59. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/table-checkbox-toggler.js +3 -0
  60. data/activeadmin-3.5.1/app/javascript/active_admin/initializers/tabs.js +6 -0
  61. data/activeadmin-3.5.1/app/javascript/active_admin/lib/checkbox-toggler.js +49 -0
  62. data/activeadmin-3.5.1/app/javascript/active_admin/lib/dropdown-menu.js +116 -0
  63. data/activeadmin-3.5.1/app/javascript/active_admin/lib/filters.js +39 -0
  64. data/activeadmin-3.5.1/app/javascript/active_admin/lib/modal-dialog.js +63 -0
  65. data/activeadmin-3.5.1/app/javascript/active_admin/lib/per-page.js +38 -0
  66. data/activeadmin-3.5.1/app/javascript/active_admin/lib/table-checkbox-toggler.js +38 -0
  67. data/activeadmin-3.5.1/app/javascript/active_admin/lib/utils.js +40 -0
  68. data/activeadmin-3.5.1/app/views/active_admin/devise/confirmations/new.html.erb +15 -0
  69. data/activeadmin-3.5.1/app/views/active_admin/devise/mailer/reset_password_instructions.html.erb +8 -0
  70. data/activeadmin-3.5.1/app/views/active_admin/devise/mailer/unlock_instructions.html.erb +7 -0
  71. data/activeadmin-3.5.1/app/views/active_admin/devise/passwords/edit.html.erb +18 -0
  72. data/activeadmin-3.5.1/app/views/active_admin/devise/passwords/new.html.erb +15 -0
  73. data/activeadmin-3.5.1/app/views/active_admin/devise/registrations/new.html.erb +21 -0
  74. data/activeadmin-3.5.1/app/views/active_admin/devise/sessions/new.html.erb +20 -0
  75. data/activeadmin-3.5.1/app/views/active_admin/devise/shared/_error_messages.html.erb +15 -0
  76. data/activeadmin-3.5.1/app/views/active_admin/devise/shared/_links.erb +33 -0
  77. data/activeadmin-3.5.1/app/views/active_admin/devise/unlocks/new.html.erb +15 -0
  78. data/activeadmin-3.5.1/app/views/active_admin/page/index.html.arb +2 -0
  79. data/activeadmin-3.5.1/app/views/active_admin/resource/edit.html.arb +2 -0
  80. data/activeadmin-3.5.1/app/views/active_admin/resource/index.html.arb +2 -0
  81. data/activeadmin-3.5.1/app/views/active_admin/resource/new.html.arb +2 -0
  82. data/activeadmin-3.5.1/app/views/active_admin/resource/show.html.arb +2 -0
  83. data/activeadmin-3.5.1/app/views/kaminari/active_admin/_first_page.html.erb +11 -0
  84. data/activeadmin-3.5.1/app/views/kaminari/active_admin/_gap.html.erb +8 -0
  85. data/activeadmin-3.5.1/app/views/kaminari/active_admin/_last_page.html.erb +11 -0
  86. data/activeadmin-3.5.1/app/views/kaminari/active_admin/_next_page.html.erb +11 -0
  87. data/activeadmin-3.5.1/app/views/kaminari/active_admin/_page.html.erb +12 -0
  88. data/activeadmin-3.5.1/app/views/kaminari/active_admin/_paginator.html.erb +25 -0
  89. data/activeadmin-3.5.1/app/views/kaminari/active_admin/_prev_page.html.erb +11 -0
  90. data/activeadmin-3.5.1/app/views/kaminari/active_admin_countless/_first_page.html.erb +11 -0
  91. data/activeadmin-3.5.1/app/views/kaminari/active_admin_countless/_gap.html.erb +8 -0
  92. data/activeadmin-3.5.1/app/views/kaminari/active_admin_countless/_next_page.html.erb +11 -0
  93. data/activeadmin-3.5.1/app/views/kaminari/active_admin_countless/_page.html.erb +12 -0
  94. data/activeadmin-3.5.1/app/views/kaminari/active_admin_countless/_paginator.html.erb +24 -0
  95. data/activeadmin-3.5.1/app/views/kaminari/active_admin_countless/_prev_page.html.erb +11 -0
  96. data/activeadmin-3.5.1/app/views/layouts/active_admin.html.arb +2 -0
  97. data/activeadmin-3.5.1/app/views/layouts/active_admin_logged_out.html.erb +50 -0
  98. data/activeadmin-3.5.1/config/locales/ar.yml +128 -0
  99. data/activeadmin-3.5.1/config/locales/az.yml +131 -0
  100. data/activeadmin-3.5.1/config/locales/bg.yml +112 -0
  101. data/activeadmin-3.5.1/config/locales/bs.yml +114 -0
  102. data/activeadmin-3.5.1/config/locales/ca.yml +98 -0
  103. data/activeadmin-3.5.1/config/locales/cs.yml +102 -0
  104. data/activeadmin-3.5.1/config/locales/da.yml +130 -0
  105. data/activeadmin-3.5.1/config/locales/de-CH.yml +94 -0
  106. data/activeadmin-3.5.1/config/locales/de.yml +154 -0
  107. data/activeadmin-3.5.1/config/locales/el.yml +119 -0
  108. data/activeadmin-3.5.1/config/locales/en-CA.yml +132 -0
  109. data/activeadmin-3.5.1/config/locales/en-GB.yml +132 -0
  110. data/activeadmin-3.5.1/config/locales/en.yml +154 -0
  111. data/activeadmin-3.5.1/config/locales/eo.yml +137 -0
  112. data/activeadmin-3.5.1/config/locales/es-MX.yml +90 -0
  113. data/activeadmin-3.5.1/config/locales/es.yml +154 -0
  114. data/activeadmin-3.5.1/config/locales/fa.yml +112 -0
  115. data/activeadmin-3.5.1/config/locales/fi.yml +105 -0
  116. data/activeadmin-3.5.1/config/locales/fr.yml +133 -0
  117. data/activeadmin-3.5.1/config/locales/he.yml +132 -0
  118. data/activeadmin-3.5.1/config/locales/hr.yml +116 -0
  119. data/activeadmin-3.5.1/config/locales/hu.yml +94 -0
  120. data/activeadmin-3.5.1/config/locales/id.yml +128 -0
  121. data/activeadmin-3.5.1/config/locales/it.yml +154 -0
  122. data/activeadmin-3.5.1/config/locales/ja.yml +133 -0
  123. data/activeadmin-3.5.1/config/locales/ko.yml +113 -0
  124. data/activeadmin-3.5.1/config/locales/lt.yml +134 -0
  125. data/activeadmin-3.5.1/config/locales/lv.yml +85 -0
  126. data/activeadmin-3.5.1/config/locales/mk.yml +126 -0
  127. data/activeadmin-3.5.1/config/locales/nb.yml +122 -0
  128. data/activeadmin-3.5.1/config/locales/nl.yml +136 -0
  129. data/activeadmin-3.5.1/config/locales/pl.yml +160 -0
  130. data/activeadmin-3.5.1/config/locales/pt-BR.yml +135 -0
  131. data/activeadmin-3.5.1/config/locales/pt-PT.yml +85 -0
  132. data/activeadmin-3.5.1/config/locales/ro.yml +90 -0
  133. data/activeadmin-3.5.1/config/locales/ru.yml +135 -0
  134. data/activeadmin-3.5.1/config/locales/sk.yml +160 -0
  135. data/activeadmin-3.5.1/config/locales/sv-SE.yml +154 -0
  136. data/activeadmin-3.5.1/config/locales/tr.yml +133 -0
  137. data/activeadmin-3.5.1/config/locales/uk.yml +132 -0
  138. data/activeadmin-3.5.1/config/locales/vi.yml +154 -0
  139. data/activeadmin-3.5.1/config/locales/zh-CN.yml +154 -0
  140. data/activeadmin-3.5.1/config/locales/zh-TW.yml +128 -0
  141. data/activeadmin-3.5.1/lib/active_admin/abstract_view_factory.rb +48 -0
  142. data/activeadmin-3.5.1/lib/active_admin/application.rb +234 -0
  143. data/activeadmin-3.5.1/lib/active_admin/application_settings.rb +43 -0
  144. data/activeadmin-3.5.1/lib/active_admin/asset_registration.rb +30 -0
  145. data/activeadmin-3.5.1/lib/active_admin/authorization_adapter.rb +132 -0
  146. data/activeadmin-3.5.1/lib/active_admin/base_controller/authorization.rb +129 -0
  147. data/activeadmin-3.5.1/lib/active_admin/base_controller/menu.rb +35 -0
  148. data/activeadmin-3.5.1/lib/active_admin/base_controller.rb +82 -0
  149. data/activeadmin-3.5.1/lib/active_admin/batch_actions/controller.rb +41 -0
  150. data/activeadmin-3.5.1/lib/active_admin/batch_actions/resource_extension.rb +157 -0
  151. data/activeadmin-3.5.1/lib/active_admin/batch_actions/views/batch_action_form.rb +39 -0
  152. data/activeadmin-3.5.1/lib/active_admin/batch_actions/views/batch_action_selector.rb +59 -0
  153. data/activeadmin-3.5.1/lib/active_admin/batch_actions/views/selection_cells.rb +39 -0
  154. data/activeadmin-3.5.1/lib/active_admin/batch_actions.rb +17 -0
  155. data/activeadmin-3.5.1/lib/active_admin/callbacks.rb +89 -0
  156. data/activeadmin-3.5.1/lib/active_admin/cancan_adapter.rb +37 -0
  157. data/activeadmin-3.5.1/lib/active_admin/collection_decorator.rb +32 -0
  158. data/activeadmin-3.5.1/lib/active_admin/component.rb +6 -0
  159. data/activeadmin-3.5.1/lib/active_admin/controller_action.rb +14 -0
  160. data/activeadmin-3.5.1/lib/active_admin/csv_builder.rb +144 -0
  161. data/activeadmin-3.5.1/lib/active_admin/dependency.rb +97 -0
  162. data/activeadmin-3.5.1/lib/active_admin/devise.rb +91 -0
  163. data/activeadmin-3.5.1/lib/active_admin/dsl.rb +161 -0
  164. data/activeadmin-3.5.1/lib/active_admin/dynamic_setting.rb +39 -0
  165. data/activeadmin-3.5.1/lib/active_admin/dynamic_settings_node.rb +29 -0
  166. data/activeadmin-3.5.1/lib/active_admin/engine.rb +29 -0
  167. data/activeadmin-3.5.1/lib/active_admin/error.rb +63 -0
  168. data/activeadmin-3.5.1/lib/active_admin/filters/active.rb +30 -0
  169. data/activeadmin-3.5.1/lib/active_admin/filters/active_filter.rb +124 -0
  170. data/activeadmin-3.5.1/lib/active_admin/filters/active_sidebar.rb +28 -0
  171. data/activeadmin-3.5.1/lib/active_admin/filters/dsl.rb +22 -0
  172. data/activeadmin-3.5.1/lib/active_admin/filters/forms.rb +86 -0
  173. data/activeadmin-3.5.1/lib/active_admin/filters/formtastic_addons.rb +75 -0
  174. data/activeadmin-3.5.1/lib/active_admin/filters/resource_extension.rb +180 -0
  175. data/activeadmin-3.5.1/lib/active_admin/filters.rb +12 -0
  176. data/activeadmin-3.5.1/lib/active_admin/form_builder.rb +186 -0
  177. data/activeadmin-3.5.1/lib/active_admin/generators/boilerplate.rb +54 -0
  178. data/activeadmin-3.5.1/lib/active_admin/helpers/collection.rb +21 -0
  179. data/activeadmin-3.5.1/lib/active_admin/helpers/i18n.rb +8 -0
  180. data/activeadmin-3.5.1/lib/active_admin/helpers/optional_display.rb +39 -0
  181. data/activeadmin-3.5.1/lib/active_admin/helpers/routes/url_helpers.rb +16 -0
  182. data/activeadmin-3.5.1/lib/active_admin/helpers/scope_chain.rb +25 -0
  183. data/activeadmin-3.5.1/lib/active_admin/inputs/datepicker_input.rb +28 -0
  184. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/base/search_method_select.rb +76 -0
  185. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/base.rb +45 -0
  186. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/boolean_input.rb +25 -0
  187. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/check_boxes_input.rb +51 -0
  188. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/date_picker_input.rb +14 -0
  189. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/date_range_input.rb +53 -0
  190. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/numeric_input.rb +13 -0
  191. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/select_input.rb +59 -0
  192. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/string_input.rb +27 -0
  193. data/activeadmin-3.5.1/lib/active_admin/inputs/filters/text_input.rb +26 -0
  194. data/activeadmin-3.5.1/lib/active_admin/inputs.rb +22 -0
  195. data/activeadmin-3.5.1/lib/active_admin/localizers/resource_localizer.rb +36 -0
  196. data/activeadmin-3.5.1/lib/active_admin/localizers.rb +12 -0
  197. data/activeadmin-3.5.1/lib/active_admin/menu.rb +107 -0
  198. data/activeadmin-3.5.1/lib/active_admin/menu_collection.rb +92 -0
  199. data/activeadmin-3.5.1/lib/active_admin/menu_item.rb +70 -0
  200. data/activeadmin-3.5.1/lib/active_admin/namespace.rb +267 -0
  201. data/activeadmin-3.5.1/lib/active_admin/namespace_settings.rb +127 -0
  202. data/activeadmin-3.5.1/lib/active_admin/order_clause.rb +49 -0
  203. data/activeadmin-3.5.1/lib/active_admin/orm/active_record/comments/comment.rb +40 -0
  204. data/activeadmin-3.5.1/lib/active_admin/orm/active_record/comments/namespace_helper.rb +15 -0
  205. data/activeadmin-3.5.1/lib/active_admin/orm/active_record/comments/resource_helper.rb +18 -0
  206. data/activeadmin-3.5.1/lib/active_admin/orm/active_record/comments/show_page_helper.rb +24 -0
  207. data/activeadmin-3.5.1/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +101 -0
  208. data/activeadmin-3.5.1/lib/active_admin/orm/active_record/comments/views.rb +3 -0
  209. data/activeadmin-3.5.1/lib/active_admin/orm/active_record/comments.rb +102 -0
  210. data/activeadmin-3.5.1/lib/active_admin/orm/active_record.rb +6 -0
  211. data/activeadmin-3.5.1/lib/active_admin/orm/mongoid.rb +2 -0
  212. data/activeadmin-3.5.1/lib/active_admin/page.rb +112 -0
  213. data/activeadmin-3.5.1/lib/active_admin/page_controller.rb +30 -0
  214. data/activeadmin-3.5.1/lib/active_admin/page_dsl.rb +33 -0
  215. data/activeadmin-3.5.1/lib/active_admin/page_presenter.rb +34 -0
  216. data/activeadmin-3.5.1/lib/active_admin/pundit_adapter.rb +123 -0
  217. data/activeadmin-3.5.1/lib/active_admin/resource/action_items.rb +121 -0
  218. data/activeadmin-3.5.1/lib/active_admin/resource/attributes.rb +55 -0
  219. data/activeadmin-3.5.1/lib/active_admin/resource/belongs_to.rb +53 -0
  220. data/activeadmin-3.5.1/lib/active_admin/resource/controllers.rb +20 -0
  221. data/activeadmin-3.5.1/lib/active_admin/resource/includes.rb +13 -0
  222. data/activeadmin-3.5.1/lib/active_admin/resource/menu.rb +68 -0
  223. data/activeadmin-3.5.1/lib/active_admin/resource/model.rb +16 -0
  224. data/activeadmin-3.5.1/lib/active_admin/resource/naming.rb +63 -0
  225. data/activeadmin-3.5.1/lib/active_admin/resource/ordering.rb +12 -0
  226. data/activeadmin-3.5.1/lib/active_admin/resource/page_presenters.rb +83 -0
  227. data/activeadmin-3.5.1/lib/active_admin/resource/pagination.rb +24 -0
  228. data/activeadmin-3.5.1/lib/active_admin/resource/routes.rb +146 -0
  229. data/activeadmin-3.5.1/lib/active_admin/resource/scope_to.rb +75 -0
  230. data/activeadmin-3.5.1/lib/active_admin/resource/scopes.rb +53 -0
  231. data/activeadmin-3.5.1/lib/active_admin/resource/sidebars.rb +29 -0
  232. data/activeadmin-3.5.1/lib/active_admin/resource.rb +227 -0
  233. data/activeadmin-3.5.1/lib/active_admin/resource_collection.rb +73 -0
  234. data/activeadmin-3.5.1/lib/active_admin/resource_controller/action_builder.rb +32 -0
  235. data/activeadmin-3.5.1/lib/active_admin/resource_controller/data_access.rb +348 -0
  236. data/activeadmin-3.5.1/lib/active_admin/resource_controller/decorators.rb +81 -0
  237. data/activeadmin-3.5.1/lib/active_admin/resource_controller/polymorphic_routes.rb +38 -0
  238. data/activeadmin-3.5.1/lib/active_admin/resource_controller/resource_class_methods.rb +27 -0
  239. data/activeadmin-3.5.1/lib/active_admin/resource_controller/scoping.rb +32 -0
  240. data/activeadmin-3.5.1/lib/active_admin/resource_controller/sidebars.rb +19 -0
  241. data/activeadmin-3.5.1/lib/active_admin/resource_controller/streaming.rb +45 -0
  242. data/activeadmin-3.5.1/lib/active_admin/resource_controller.rb +68 -0
  243. data/activeadmin-3.5.1/lib/active_admin/resource_dsl.rb +210 -0
  244. data/activeadmin-3.5.1/lib/active_admin/router.rb +115 -0
  245. data/activeadmin-3.5.1/lib/active_admin/scope.rb +65 -0
  246. data/activeadmin-3.5.1/lib/active_admin/settings_node.rb +20 -0
  247. data/activeadmin-3.5.1/lib/active_admin/sidebar_section.rb +40 -0
  248. data/activeadmin-3.5.1/lib/active_admin/version.rb +4 -0
  249. data/activeadmin-3.5.1/lib/active_admin/view_factory.rb +28 -0
  250. data/activeadmin-3.5.1/lib/active_admin/view_helpers/active_admin_application_helper.rb +13 -0
  251. data/activeadmin-3.5.1/lib/active_admin/view_helpers/auto_link_helper.rb +46 -0
  252. data/activeadmin-3.5.1/lib/active_admin/view_helpers/breadcrumb_helper.rb +34 -0
  253. data/activeadmin-3.5.1/lib/active_admin/view_helpers/display_helper.rb +119 -0
  254. data/activeadmin-3.5.1/lib/active_admin/view_helpers/download_format_links_helper.rb +60 -0
  255. data/activeadmin-3.5.1/lib/active_admin/view_helpers/fields_for.rb +51 -0
  256. data/activeadmin-3.5.1/lib/active_admin/view_helpers/flash_helper.rb +15 -0
  257. data/activeadmin-3.5.1/lib/active_admin/view_helpers/form_helper.rb +21 -0
  258. data/activeadmin-3.5.1/lib/active_admin/view_helpers/method_or_proc_helper.rb +101 -0
  259. data/activeadmin-3.5.1/lib/active_admin/view_helpers/scope_name_helper.rb +17 -0
  260. data/activeadmin-3.5.1/lib/active_admin/view_helpers/sidebar_helper.rb +16 -0
  261. data/activeadmin-3.5.1/lib/active_admin/view_helpers/title_helper.rb +12 -0
  262. data/activeadmin-3.5.1/lib/active_admin/view_helpers/view_factory_helper.rb +12 -0
  263. data/activeadmin-3.5.1/lib/active_admin/view_helpers.rb +21 -0
  264. data/activeadmin-3.5.1/lib/active_admin/views/action_items.rb +18 -0
  265. data/activeadmin-3.5.1/lib/active_admin/views/components/active_admin_form.rb +164 -0
  266. data/activeadmin-3.5.1/lib/active_admin/views/components/active_filters_sidebar_content.rb +59 -0
  267. data/activeadmin-3.5.1/lib/active_admin/views/components/attributes_table.rb +95 -0
  268. data/activeadmin-3.5.1/lib/active_admin/views/components/blank_slate.rb +18 -0
  269. data/activeadmin-3.5.1/lib/active_admin/views/components/columns.rb +162 -0
  270. data/activeadmin-3.5.1/lib/active_admin/views/components/dropdown_menu.rb +69 -0
  271. data/activeadmin-3.5.1/lib/active_admin/views/components/index_list.rb +70 -0
  272. data/activeadmin-3.5.1/lib/active_admin/views/components/menu.rb +33 -0
  273. data/activeadmin-3.5.1/lib/active_admin/views/components/menu_item.rb +59 -0
  274. data/activeadmin-3.5.1/lib/active_admin/views/components/paginated_collection.rb +164 -0
  275. data/activeadmin-3.5.1/lib/active_admin/views/components/panel.rb +39 -0
  276. data/activeadmin-3.5.1/lib/active_admin/views/components/scopes.rb +75 -0
  277. data/activeadmin-3.5.1/lib/active_admin/views/components/sidebar.rb +14 -0
  278. data/activeadmin-3.5.1/lib/active_admin/views/components/sidebar_section.rb +35 -0
  279. data/activeadmin-3.5.1/lib/active_admin/views/components/site_title.rb +55 -0
  280. data/activeadmin-3.5.1/lib/active_admin/views/components/status_tag.rb +76 -0
  281. data/activeadmin-3.5.1/lib/active_admin/views/components/table_for.rb +211 -0
  282. data/activeadmin-3.5.1/lib/active_admin/views/components/tabs.rb +41 -0
  283. data/activeadmin-3.5.1/lib/active_admin/views/components/unsupported_browser.rb +12 -0
  284. data/activeadmin-3.5.1/lib/active_admin/views/footer.rb +32 -0
  285. data/activeadmin-3.5.1/lib/active_admin/views/header.rb +20 -0
  286. data/activeadmin-3.5.1/lib/active_admin/views/index_as_block.rb +37 -0
  287. data/activeadmin-3.5.1/lib/active_admin/views/index_as_blog.rb +156 -0
  288. data/activeadmin-3.5.1/lib/active_admin/views/index_as_grid.rb +81 -0
  289. data/activeadmin-3.5.1/lib/active_admin/views/index_as_table.rb +401 -0
  290. data/activeadmin-3.5.1/lib/active_admin/views/pages/base.rb +134 -0
  291. data/activeadmin-3.5.1/lib/active_admin/views/pages/form.rb +65 -0
  292. data/activeadmin-3.5.1/lib/active_admin/views/pages/index.rb +166 -0
  293. data/activeadmin-3.5.1/lib/active_admin/views/pages/layout.rb +27 -0
  294. data/activeadmin-3.5.1/lib/active_admin/views/pages/page.rb +31 -0
  295. data/activeadmin-3.5.1/lib/active_admin/views/pages/show.rb +60 -0
  296. data/activeadmin-3.5.1/lib/active_admin/views/tabbed_navigation.rb +12 -0
  297. data/activeadmin-3.5.1/lib/active_admin/views/title_bar.rb +56 -0
  298. data/activeadmin-3.5.1/lib/active_admin/views.rb +9 -0
  299. data/activeadmin-3.5.1/lib/active_admin.rb +135 -0
  300. data/activeadmin-3.5.1/lib/activeadmin.rb +2 -0
  301. data/activeadmin-3.5.1/lib/generators/active_admin/assets/assets_generator.rb +15 -0
  302. data/activeadmin-3.5.1/lib/generators/active_admin/assets/templates/active_admin.js +1 -0
  303. data/activeadmin-3.5.1/lib/generators/active_admin/assets/templates/active_admin.scss +17 -0
  304. data/activeadmin-3.5.1/lib/generators/active_admin/devise/devise_generator.rb +69 -0
  305. data/activeadmin-3.5.1/lib/generators/active_admin/install/install_generator.rb +56 -0
  306. data/activeadmin-3.5.1/lib/generators/active_admin/install/templates/active_admin.rb.erb +352 -0
  307. data/activeadmin-3.5.1/lib/generators/active_admin/install/templates/admin_users.rb.erb +28 -0
  308. data/activeadmin-3.5.1/lib/generators/active_admin/install/templates/dashboard.rb +33 -0
  309. data/activeadmin-3.5.1/lib/generators/active_admin/install/templates/migrations/create_active_admin_comments.rb.erb +16 -0
  310. data/activeadmin-3.5.1/lib/generators/active_admin/page/USAGE +8 -0
  311. data/activeadmin-3.5.1/lib/generators/active_admin/page/page_generator.rb +13 -0
  312. data/activeadmin-3.5.1/lib/generators/active_admin/page/templates/page.rb +6 -0
  313. data/activeadmin-3.5.1/lib/generators/active_admin/resource/resource_generator.rb +21 -0
  314. data/activeadmin-3.5.1/lib/generators/active_admin/resource/templates/admin.rb.erb +46 -0
  315. data/activeadmin-3.5.1/lib/generators/active_admin/webpacker/plugins/jquery.js +7 -0
  316. data/activeadmin-3.5.1/lib/generators/active_admin/webpacker/templates/active_admin.js +5 -0
  317. data/activeadmin-3.5.1/lib/generators/active_admin/webpacker/templates/active_admin.scss +17 -0
  318. data/activeadmin-3.5.1/lib/generators/active_admin/webpacker/templates/print.scss +2 -0
  319. data/activeadmin-3.5.1/lib/generators/active_admin/webpacker/webpacker_generator.rb +27 -0
  320. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/data.js +39 -0
  321. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/disable-selection.js +51 -0
  322. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/focusable.js +79 -0
  323. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +81 -0
  324. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/keycode.js +51 -0
  325. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/labels.js +70 -0
  326. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/plugin.js +49 -0
  327. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/position.js +513 -0
  328. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/scroll-parent.js +50 -0
  329. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/tabbable.js +41 -0
  330. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/unique-id.js +54 -0
  331. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/version.js +20 -0
  332. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widget.js +761 -0
  333. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/button.js +454 -0
  334. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +294 -0
  335. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +304 -0
  336. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +2240 -0
  337. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +957 -0
  338. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +1264 -0
  339. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +226 -0
  340. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +1281 -0
  341. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +1614 -0
  342. data/activeadmin-3.5.1/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +918 -0
  343. data/super-sharp-tool.gemspec +12 -0
  344. metadata +383 -0
@@ -0,0 +1,1264 @@
1
+ //= require jquery-ui/widgets/mouse
2
+ //= require jquery-ui/data
3
+ //= require jquery-ui/plugin
4
+ //= require jquery-ui/scroll-parent
5
+ //= require jquery-ui/version
6
+ //= require jquery-ui/widget
7
+
8
+ /*!
9
+ * jQuery UI Draggable 1.14.2
10
+ * https://jqueryui.com
11
+ *
12
+ * Copyright OpenJS Foundation and other contributors
13
+ * Released under the MIT license.
14
+ * https://jquery.org/license
15
+ */
16
+
17
+ //>>label: Draggable
18
+ //>>group: Interactions
19
+ //>>description: Enables dragging functionality for any element.
20
+ //>>docs: https://api.jqueryui.com/draggable/
21
+ //>>demos: https://jqueryui.com/draggable/
22
+ //>>css.structure: ../../themes/base/draggable.css
23
+
24
+ ( function( factory ) {
25
+ "use strict";
26
+
27
+ if ( typeof define === "function" && define.amd ) {
28
+
29
+ // AMD. Register as an anonymous module.
30
+ define( [
31
+ "jquery",
32
+ "./mouse",
33
+ "../data",
34
+ "../plugin",
35
+ "../scroll-parent",
36
+ "../version",
37
+ "../widget"
38
+ ], factory );
39
+ } else {
40
+
41
+ // Browser globals
42
+ factory( jQuery );
43
+ }
44
+ } )( function( $ ) {
45
+ "use strict";
46
+
47
+ $.widget( "ui.draggable", $.ui.mouse, {
48
+ version: "1.14.2",
49
+ widgetEventPrefix: "drag",
50
+ options: {
51
+ addClasses: true,
52
+ appendTo: "parent",
53
+ axis: false,
54
+ connectToSortable: false,
55
+ containment: false,
56
+ cursor: "auto",
57
+ cursorAt: false,
58
+ grid: false,
59
+ handle: false,
60
+ helper: "original",
61
+ iframeFix: false,
62
+ opacity: false,
63
+ refreshPositions: false,
64
+ revert: false,
65
+ revertDuration: 500,
66
+ scope: "default",
67
+ scroll: true,
68
+ scrollSensitivity: 20,
69
+ scrollSpeed: 20,
70
+ snap: false,
71
+ snapMode: "both",
72
+ snapTolerance: 20,
73
+ stack: false,
74
+ zIndex: false,
75
+
76
+ // Callbacks
77
+ drag: null,
78
+ start: null,
79
+ stop: null
80
+ },
81
+ _create: function() {
82
+
83
+ if ( this.options.helper === "original" ) {
84
+ this._setPositionRelative();
85
+ }
86
+ if ( this.options.addClasses ) {
87
+ this._addClass( "ui-draggable" );
88
+ }
89
+ this._setHandleClassName();
90
+
91
+ this._mouseInit();
92
+ },
93
+
94
+ _setOption: function( key, value ) {
95
+ this._super( key, value );
96
+ if ( key === "handle" ) {
97
+ this._removeHandleClassName();
98
+ this._setHandleClassName();
99
+ }
100
+ },
101
+
102
+ _destroy: function() {
103
+ if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
104
+ this.destroyOnClear = true;
105
+ return;
106
+ }
107
+ this._removeHandleClassName();
108
+ this._mouseDestroy();
109
+ },
110
+
111
+ _mouseCapture: function( event ) {
112
+ var o = this.options;
113
+
114
+ // Among others, prevent a drag on a resizable-handle
115
+ if ( this.helper || o.disabled ||
116
+ $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
117
+ return false;
118
+ }
119
+
120
+ //Quit if we're not on a valid handle
121
+ this.handle = this._getHandle( event );
122
+ if ( !this.handle ) {
123
+ return false;
124
+ }
125
+
126
+ this._blurActiveElement( event );
127
+
128
+ this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
129
+
130
+ return true;
131
+
132
+ },
133
+
134
+ _blockFrames: function( selector ) {
135
+ this.iframeBlocks = this.document.find( selector ).map( function() {
136
+ var iframe = $( this );
137
+
138
+ return $( "<div>" )
139
+ .css( "position", "absolute" )
140
+ .appendTo( iframe.parent() )
141
+ .outerWidth( iframe.outerWidth() )
142
+ .outerHeight( iframe.outerHeight() )
143
+ .offset( iframe.offset() )[ 0 ];
144
+ } );
145
+ },
146
+
147
+ _unblockFrames: function() {
148
+ if ( this.iframeBlocks ) {
149
+ this.iframeBlocks.remove();
150
+ delete this.iframeBlocks;
151
+ }
152
+ },
153
+
154
+ _blurActiveElement: function( event ) {
155
+ var activeElement = this.document[ 0 ].activeElement,
156
+ target = $( event.target );
157
+
158
+ // Don't blur if the event occurred on an element that is within
159
+ // the currently focused element
160
+ // See #10527, #12472
161
+ if ( target.closest( activeElement ).length ) {
162
+ return;
163
+ }
164
+
165
+ // Blur any element that currently has focus, see #4261
166
+ $( activeElement ).trigger( "blur" );
167
+ },
168
+
169
+ _mouseStart: function( event ) {
170
+
171
+ var o = this.options;
172
+
173
+ //Create and append the visible helper
174
+ this.helper = this._createHelper( event );
175
+
176
+ this._addClass( this.helper, "ui-draggable-dragging" );
177
+
178
+ //Cache the helper size
179
+ this._cacheHelperProportions();
180
+
181
+ //If ddmanager is used for droppables, set the global draggable
182
+ if ( $.ui.ddmanager ) {
183
+ $.ui.ddmanager.current = this;
184
+ }
185
+
186
+ /*
187
+ * - Position generation -
188
+ * This block generates everything position related - it's the core of draggables.
189
+ */
190
+
191
+ //Cache the margins of the original element
192
+ this._cacheMargins();
193
+
194
+ //Store the helper's css position
195
+ this.cssPosition = this.helper.css( "position" );
196
+ this.scrollParent = this.helper.scrollParent( true );
197
+ this.offsetParent = this.helper.offsetParent();
198
+ this.hasFixedAncestor = this.helper.parents().filter( function() {
199
+ return $( this ).css( "position" ) === "fixed";
200
+ } ).length > 0;
201
+
202
+ //The element's absolute position on the page minus margins
203
+ this.positionAbs = this.element.offset();
204
+ this._refreshOffsets( event );
205
+
206
+ //Generate the original position
207
+ this.originalPosition = this.position = this._generatePosition( event, false );
208
+ this.originalPageX = event.pageX;
209
+ this.originalPageY = event.pageY;
210
+
211
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
212
+ if ( o.cursorAt ) {
213
+ this._adjustOffsetFromHelper( o.cursorAt );
214
+ }
215
+
216
+ //Set a containment if given in the options
217
+ this._setContainment();
218
+
219
+ //Trigger event + callbacks
220
+ if ( this._trigger( "start", event ) === false ) {
221
+ this._clear();
222
+ return false;
223
+ }
224
+
225
+ //Recache the helper size
226
+ this._cacheHelperProportions();
227
+
228
+ //Prepare the droppable offsets
229
+ if ( $.ui.ddmanager && !o.dropBehaviour ) {
230
+ $.ui.ddmanager.prepareOffsets( this, event );
231
+ }
232
+
233
+ // Execute the drag once - this causes the helper not to be visible before getting its
234
+ // correct position
235
+ this._mouseDrag( event, true );
236
+
237
+ // If the ddmanager is used for droppables, inform the manager that dragging has started
238
+ // (see #5003)
239
+ if ( $.ui.ddmanager ) {
240
+ $.ui.ddmanager.dragStart( this, event );
241
+ }
242
+
243
+ return true;
244
+ },
245
+
246
+ _refreshOffsets: function( event ) {
247
+ this.offset = {
248
+ top: this.positionAbs.top - this.margins.top,
249
+ left: this.positionAbs.left - this.margins.left,
250
+ scroll: false,
251
+ parent: this._getParentOffset(),
252
+ relative: this._getRelativeOffset()
253
+ };
254
+
255
+ this.offset.click = {
256
+ left: event.pageX - this.offset.left,
257
+ top: event.pageY - this.offset.top
258
+ };
259
+ },
260
+
261
+ _mouseDrag: function( event, noPropagation ) {
262
+
263
+ // reset any necessary cached properties (see #5009)
264
+ if ( this.hasFixedAncestor ) {
265
+ this.offset.parent = this._getParentOffset();
266
+ }
267
+
268
+ //Compute the helpers position
269
+ this.position = this._generatePosition( event, true );
270
+ this.positionAbs = this._convertPositionTo( "absolute" );
271
+
272
+ //Call plugins and callbacks and use the resulting position if something is returned
273
+ if ( !noPropagation ) {
274
+ var ui = this._uiHash();
275
+ if ( this._trigger( "drag", event, ui ) === false ) {
276
+ this._mouseUp( new $.Event( "mouseup", event ) );
277
+ return false;
278
+ }
279
+ this.position = ui.position;
280
+ }
281
+
282
+ this.helper[ 0 ].style.left = this.position.left + "px";
283
+ this.helper[ 0 ].style.top = this.position.top + "px";
284
+
285
+ if ( $.ui.ddmanager ) {
286
+ $.ui.ddmanager.drag( this, event );
287
+ }
288
+
289
+ return false;
290
+ },
291
+
292
+ _mouseStop: function( event ) {
293
+
294
+ //If we are using droppables, inform the manager about the drop
295
+ var that = this,
296
+ dropped = false;
297
+ if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
298
+ dropped = $.ui.ddmanager.drop( this, event );
299
+ }
300
+
301
+ //if a drop comes from outside (a sortable)
302
+ if ( this.dropped ) {
303
+ dropped = this.dropped;
304
+ this.dropped = false;
305
+ }
306
+
307
+ if ( ( this.options.revert === "invalid" && !dropped ) ||
308
+ ( this.options.revert === "valid" && dropped ) ||
309
+ this.options.revert === true || ( typeof this.options.revert === "function" &&
310
+ this.options.revert.call( this.element, dropped ) )
311
+ ) {
312
+ $( this.helper ).animate(
313
+ this.originalPosition,
314
+ parseInt( this.options.revertDuration, 10 ),
315
+ function() {
316
+ if ( that._trigger( "stop", event ) !== false ) {
317
+ that._clear();
318
+ }
319
+ }
320
+ );
321
+ } else {
322
+ if ( this._trigger( "stop", event ) !== false ) {
323
+ this._clear();
324
+ }
325
+ }
326
+
327
+ return false;
328
+ },
329
+
330
+ _mouseUp: function( event ) {
331
+ this._unblockFrames();
332
+
333
+ // If the ddmanager is used for droppables, inform the manager that dragging has stopped
334
+ // (see #5003)
335
+ if ( $.ui.ddmanager ) {
336
+ $.ui.ddmanager.dragStop( this, event );
337
+ }
338
+
339
+ // Only need to focus if the event occurred on the draggable itself, see #10527
340
+ if ( this.handleElement.is( event.target ) ) {
341
+
342
+ // The interaction is over; whether or not the click resulted in a drag,
343
+ // focus the element
344
+ this.element.trigger( "focus" );
345
+ }
346
+
347
+ return $.ui.mouse.prototype._mouseUp.call( this, event );
348
+ },
349
+
350
+ cancel: function() {
351
+
352
+ if ( this.helper.is( ".ui-draggable-dragging" ) ) {
353
+ this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
354
+ } else {
355
+ this._clear();
356
+ }
357
+
358
+ return this;
359
+
360
+ },
361
+
362
+ _getHandle: function( event ) {
363
+ return this.options.handle ?
364
+ !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
365
+ true;
366
+ },
367
+
368
+ _setHandleClassName: function() {
369
+ this.handleElement = this.options.handle ?
370
+ this.element.find( this.options.handle ) : this.element;
371
+ this._addClass( this.handleElement, "ui-draggable-handle" );
372
+ },
373
+
374
+ _removeHandleClassName: function() {
375
+ this._removeClass( this.handleElement, "ui-draggable-handle" );
376
+ },
377
+
378
+ _createHelper: function( event ) {
379
+
380
+ var o = this.options,
381
+ helperIsFunction = typeof o.helper === "function",
382
+ helper = helperIsFunction ?
383
+ $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
384
+ ( o.helper === "clone" ?
385
+ this.element.clone().removeAttr( "id" ) :
386
+ this.element );
387
+
388
+ if ( !helper.parents( "body" ).length ) {
389
+ helper.appendTo( ( o.appendTo === "parent" ?
390
+ this.element[ 0 ].parentNode :
391
+ o.appendTo ) );
392
+ }
393
+
394
+ // https://bugs.jqueryui.com/ticket/9446
395
+ // a helper function can return the original element
396
+ // which wouldn't have been set to relative in _create
397
+ if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
398
+ this._setPositionRelative();
399
+ }
400
+
401
+ if ( helper[ 0 ] !== this.element[ 0 ] &&
402
+ !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
403
+ helper.css( "position", "absolute" );
404
+ }
405
+
406
+ return helper;
407
+
408
+ },
409
+
410
+ _setPositionRelative: function() {
411
+ if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
412
+ this.element[ 0 ].style.position = "relative";
413
+ }
414
+ },
415
+
416
+ _adjustOffsetFromHelper: function( obj ) {
417
+ if ( typeof obj === "string" ) {
418
+ obj = obj.split( " " );
419
+ }
420
+ if ( Array.isArray( obj ) ) {
421
+ obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
422
+ }
423
+ if ( "left" in obj ) {
424
+ this.offset.click.left = obj.left + this.margins.left;
425
+ }
426
+ if ( "right" in obj ) {
427
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
428
+ }
429
+ if ( "top" in obj ) {
430
+ this.offset.click.top = obj.top + this.margins.top;
431
+ }
432
+ if ( "bottom" in obj ) {
433
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
434
+ }
435
+ },
436
+
437
+ _isRootNode: function( element ) {
438
+ return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
439
+ },
440
+
441
+ _getParentOffset: function() {
442
+
443
+ //Get the offsetParent and cache its position
444
+ var po = this.offsetParent.offset(),
445
+ document = this.document[ 0 ];
446
+
447
+ // This is a special case where we need to modify a offset calculated on start, since the
448
+ // following happened:
449
+ // 1. The position of the helper is absolute, so it's position is calculated based on the
450
+ // next positioned parent
451
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
452
+ // the document, which means that the scroll is included in the initial calculation of the
453
+ // offset of the parent, and never recalculated upon drag
454
+ if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
455
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
456
+ po.left += this.scrollParent.scrollLeft();
457
+ po.top += this.scrollParent.scrollTop();
458
+ }
459
+
460
+ if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
461
+ po = { top: 0, left: 0 };
462
+ }
463
+
464
+ return {
465
+ top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
466
+ left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
467
+ };
468
+
469
+ },
470
+
471
+ _getRelativeOffset: function() {
472
+ if ( this.cssPosition !== "relative" ) {
473
+ return { top: 0, left: 0 };
474
+ }
475
+
476
+ var p = this.element.position(),
477
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
478
+
479
+ return {
480
+ top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
481
+ ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
482
+ left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
483
+ ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
484
+ };
485
+
486
+ },
487
+
488
+ _cacheMargins: function() {
489
+ this.margins = {
490
+ left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
491
+ top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
492
+ right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
493
+ bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
494
+ };
495
+ },
496
+
497
+ _cacheHelperProportions: function() {
498
+ this.helperProportions = {
499
+ width: this.helper.outerWidth(),
500
+ height: this.helper.outerHeight()
501
+ };
502
+ },
503
+
504
+ _setContainment: function() {
505
+
506
+ var isUserScrollable, c, ce,
507
+ o = this.options,
508
+ document = this.document[ 0 ];
509
+
510
+ this.relativeContainer = null;
511
+
512
+ if ( !o.containment ) {
513
+ this.containment = null;
514
+ return;
515
+ }
516
+
517
+ if ( o.containment === "window" ) {
518
+ this.containment = [
519
+ $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
520
+ $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
521
+ $( window ).scrollLeft() + $( window ).width() -
522
+ this.helperProportions.width - this.margins.left,
523
+ $( window ).scrollTop() +
524
+ ( $( window ).height() || document.body.parentNode.scrollHeight ) -
525
+ this.helperProportions.height - this.margins.top
526
+ ];
527
+ return;
528
+ }
529
+
530
+ if ( o.containment === "document" ) {
531
+ this.containment = [
532
+ 0,
533
+ 0,
534
+ $( document ).width() - this.helperProportions.width - this.margins.left,
535
+ ( $( document ).height() || document.body.parentNode.scrollHeight ) -
536
+ this.helperProportions.height - this.margins.top
537
+ ];
538
+ return;
539
+ }
540
+
541
+ if ( o.containment.constructor === Array ) {
542
+ this.containment = o.containment;
543
+ return;
544
+ }
545
+
546
+ if ( o.containment === "parent" ) {
547
+ o.containment = this.helper[ 0 ].parentNode;
548
+ }
549
+
550
+ c = $( o.containment );
551
+ ce = c[ 0 ];
552
+
553
+ if ( !ce ) {
554
+ return;
555
+ }
556
+
557
+ isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
558
+
559
+ this.containment = [
560
+ ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
561
+ ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
562
+ ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
563
+ ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
564
+ ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
565
+ ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
566
+ ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
567
+ this.helperProportions.width -
568
+ this.margins.left -
569
+ this.margins.right,
570
+ ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
571
+ ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
572
+ ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
573
+ this.helperProportions.height -
574
+ this.margins.top -
575
+ this.margins.bottom
576
+ ];
577
+ this.relativeContainer = c;
578
+ },
579
+
580
+ _convertPositionTo: function( d, pos ) {
581
+
582
+ if ( !pos ) {
583
+ pos = this.position;
584
+ }
585
+
586
+ var mod = d === "absolute" ? 1 : -1,
587
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
588
+
589
+ return {
590
+ top: (
591
+
592
+ // The absolute mouse position
593
+ pos.top +
594
+
595
+ // Only for relative positioned nodes: Relative offset from element to offset parent
596
+ this.offset.relative.top * mod +
597
+
598
+ // The offsetParent's offset without borders (offset + border)
599
+ this.offset.parent.top * mod -
600
+ ( ( this.cssPosition === "fixed" ?
601
+ -this.offset.scroll.top :
602
+ ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
603
+ ),
604
+ left: (
605
+
606
+ // The absolute mouse position
607
+ pos.left +
608
+
609
+ // Only for relative positioned nodes: Relative offset from element to offset parent
610
+ this.offset.relative.left * mod +
611
+
612
+ // The offsetParent's offset without borders (offset + border)
613
+ this.offset.parent.left * mod -
614
+ ( ( this.cssPosition === "fixed" ?
615
+ -this.offset.scroll.left :
616
+ ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
617
+ )
618
+ };
619
+
620
+ },
621
+
622
+ _generatePosition: function( event, constrainPosition ) {
623
+
624
+ var containment, co, top, left,
625
+ o = this.options,
626
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
627
+ pageX = event.pageX,
628
+ pageY = event.pageY;
629
+
630
+ // Cache the scroll
631
+ if ( !scrollIsRootNode || !this.offset.scroll ) {
632
+ this.offset.scroll = {
633
+ top: this.scrollParent.scrollTop(),
634
+ left: this.scrollParent.scrollLeft()
635
+ };
636
+ }
637
+
638
+ /*
639
+ * - Position constraining -
640
+ * Constrain the position to a mix of grid, containment.
641
+ */
642
+
643
+ // If we are not dragging yet, we won't check for options
644
+ if ( constrainPosition ) {
645
+ if ( this.containment ) {
646
+ if ( this.relativeContainer ) {
647
+ co = this.relativeContainer.offset();
648
+ containment = [
649
+ this.containment[ 0 ] + co.left,
650
+ this.containment[ 1 ] + co.top,
651
+ this.containment[ 2 ] + co.left,
652
+ this.containment[ 3 ] + co.top
653
+ ];
654
+ } else {
655
+ containment = this.containment;
656
+ }
657
+
658
+ if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
659
+ pageX = containment[ 0 ] + this.offset.click.left;
660
+ }
661
+ if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
662
+ pageY = containment[ 1 ] + this.offset.click.top;
663
+ }
664
+ if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
665
+ pageX = containment[ 2 ] + this.offset.click.left;
666
+ }
667
+ if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
668
+ pageY = containment[ 3 ] + this.offset.click.top;
669
+ }
670
+ }
671
+
672
+ if ( o.grid ) {
673
+
674
+ //Check for grid elements set to 0 to prevent divide by 0 error causing invalid
675
+ // argument errors in IE (see ticket #6950)
676
+ top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
677
+ this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
678
+ pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
679
+ top - this.offset.click.top > containment[ 3 ] ) ?
680
+ top :
681
+ ( ( top - this.offset.click.top >= containment[ 1 ] ) ?
682
+ top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
683
+
684
+ left = o.grid[ 0 ] ? this.originalPageX +
685
+ Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
686
+ this.originalPageX;
687
+ pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
688
+ left - this.offset.click.left > containment[ 2 ] ) ?
689
+ left :
690
+ ( ( left - this.offset.click.left >= containment[ 0 ] ) ?
691
+ left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
692
+ }
693
+
694
+ if ( o.axis === "y" ) {
695
+ pageX = this.originalPageX;
696
+ }
697
+
698
+ if ( o.axis === "x" ) {
699
+ pageY = this.originalPageY;
700
+ }
701
+ }
702
+
703
+ return {
704
+ top: (
705
+
706
+ // The absolute mouse position
707
+ pageY -
708
+
709
+ // Click offset (relative to the element)
710
+ this.offset.click.top -
711
+
712
+ // Only for relative positioned nodes: Relative offset from element to offset parent
713
+ this.offset.relative.top -
714
+
715
+ // The offsetParent's offset without borders (offset + border)
716
+ this.offset.parent.top +
717
+ ( this.cssPosition === "fixed" ?
718
+ -this.offset.scroll.top :
719
+ ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
720
+ ),
721
+ left: (
722
+
723
+ // The absolute mouse position
724
+ pageX -
725
+
726
+ // Click offset (relative to the element)
727
+ this.offset.click.left -
728
+
729
+ // Only for relative positioned nodes: Relative offset from element to offset parent
730
+ this.offset.relative.left -
731
+
732
+ // The offsetParent's offset without borders (offset + border)
733
+ this.offset.parent.left +
734
+ ( this.cssPosition === "fixed" ?
735
+ -this.offset.scroll.left :
736
+ ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
737
+ )
738
+ };
739
+
740
+ },
741
+
742
+ _clear: function() {
743
+ this._removeClass( this.helper, "ui-draggable-dragging" );
744
+ if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
745
+ this.helper.remove();
746
+ }
747
+ this.helper = null;
748
+ this.cancelHelperRemoval = false;
749
+ if ( this.destroyOnClear ) {
750
+ this.destroy();
751
+ }
752
+ },
753
+
754
+ // From now on bulk stuff - mainly helpers
755
+
756
+ _trigger: function( type, event, ui ) {
757
+ ui = ui || this._uiHash();
758
+ $.ui.plugin.call( this, type, [ event, ui, this ], true );
759
+
760
+ // Absolute position and offset (see #6884 ) have to be recalculated after plugins
761
+ if ( /^(drag|start|stop)/.test( type ) ) {
762
+ this.positionAbs = this._convertPositionTo( "absolute" );
763
+ ui.offset = this.positionAbs;
764
+ }
765
+ return $.Widget.prototype._trigger.call( this, type, event, ui );
766
+ },
767
+
768
+ plugins: {},
769
+
770
+ _uiHash: function() {
771
+ return {
772
+ helper: this.helper,
773
+ position: this.position,
774
+ originalPosition: this.originalPosition,
775
+ offset: this.positionAbs
776
+ };
777
+ }
778
+
779
+ } );
780
+
781
+ $.ui.plugin.add( "draggable", "connectToSortable", {
782
+ start: function( event, ui, draggable ) {
783
+ var uiSortable = $.extend( {}, ui, {
784
+ item: draggable.element
785
+ } );
786
+
787
+ draggable.sortables = [];
788
+ $( draggable.options.connectToSortable ).each( function() {
789
+ var sortable = $( this ).sortable( "instance" );
790
+
791
+ if ( sortable && !sortable.options.disabled ) {
792
+ draggable.sortables.push( sortable );
793
+
794
+ // RefreshPositions is called at drag start to refresh the containerCache
795
+ // which is used in drag. This ensures it's initialized and synchronized
796
+ // with any changes that might have happened on the page since initialization.
797
+ sortable.refreshPositions();
798
+ sortable._trigger( "activate", event, uiSortable );
799
+ }
800
+ } );
801
+ },
802
+ stop: function( event, ui, draggable ) {
803
+ var uiSortable = $.extend( {}, ui, {
804
+ item: draggable.element
805
+ } );
806
+
807
+ draggable.cancelHelperRemoval = false;
808
+
809
+ $.each( draggable.sortables, function() {
810
+ var sortable = this;
811
+
812
+ if ( sortable.isOver ) {
813
+ sortable.isOver = 0;
814
+
815
+ // Allow this sortable to handle removing the helper
816
+ draggable.cancelHelperRemoval = true;
817
+ sortable.cancelHelperRemoval = false;
818
+
819
+ // Use _storedCSS To restore properties in the sortable,
820
+ // as this also handles revert (#9675) since the draggable
821
+ // may have modified them in unexpected ways (#8809)
822
+ sortable._storedCSS = {
823
+ position: sortable.placeholder.css( "position" ),
824
+ top: sortable.placeholder.css( "top" ),
825
+ left: sortable.placeholder.css( "left" )
826
+ };
827
+
828
+ sortable._mouseStop( event );
829
+
830
+ // Once drag has ended, the sortable should return to using
831
+ // its original helper, not the shared helper from draggable
832
+ sortable.options.helper = sortable.options._helper;
833
+ } else {
834
+
835
+ // Prevent this Sortable from removing the helper.
836
+ // However, don't set the draggable to remove the helper
837
+ // either as another connected Sortable may yet handle the removal.
838
+ sortable.cancelHelperRemoval = true;
839
+
840
+ sortable._trigger( "deactivate", event, uiSortable );
841
+ }
842
+ } );
843
+ },
844
+ drag: function( event, ui, draggable ) {
845
+ $.each( draggable.sortables, function() {
846
+ var innermostIntersecting = false,
847
+ sortable = this;
848
+
849
+ // Copy over variables that sortable's _intersectsWith uses
850
+ sortable.positionAbs = draggable.positionAbs;
851
+ sortable.helperProportions = draggable.helperProportions;
852
+ sortable.offset.click = draggable.offset.click;
853
+
854
+ if ( sortable._intersectsWith( sortable.containerCache ) ) {
855
+ innermostIntersecting = true;
856
+
857
+ $.each( draggable.sortables, function() {
858
+
859
+ // Copy over variables that sortable's _intersectsWith uses
860
+ this.positionAbs = draggable.positionAbs;
861
+ this.helperProportions = draggable.helperProportions;
862
+ this.offset.click = draggable.offset.click;
863
+
864
+ if ( this !== sortable &&
865
+ this._intersectsWith( this.containerCache ) &&
866
+ $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
867
+ innermostIntersecting = false;
868
+ }
869
+
870
+ return innermostIntersecting;
871
+ } );
872
+ }
873
+
874
+ if ( innermostIntersecting ) {
875
+
876
+ // If it intersects, we use a little isOver variable and set it once,
877
+ // so that the move-in stuff gets fired only once.
878
+ if ( !sortable.isOver ) {
879
+ sortable.isOver = 1;
880
+
881
+ // Store draggable's parent in case we need to reappend to it later.
882
+ draggable._parent = ui.helper.parent();
883
+
884
+ sortable.currentItem = ui.helper
885
+ .appendTo( sortable.element )
886
+ .data( "ui-sortable-item", true );
887
+
888
+ // Store helper option to later restore it
889
+ sortable.options._helper = sortable.options.helper;
890
+
891
+ sortable.options.helper = function() {
892
+ return ui.helper[ 0 ];
893
+ };
894
+
895
+ // Fire the start events of the sortable with our passed browser event,
896
+ // and our own helper (so it doesn't create a new one)
897
+ event.target = sortable.currentItem[ 0 ];
898
+ sortable._mouseCapture( event, true );
899
+ sortable._mouseStart( event, true, true );
900
+
901
+ // Because the browser event is way off the new appended portlet,
902
+ // modify necessary variables to reflect the changes
903
+ sortable.offset.click.top = draggable.offset.click.top;
904
+ sortable.offset.click.left = draggable.offset.click.left;
905
+ sortable.offset.parent.left -= draggable.offset.parent.left -
906
+ sortable.offset.parent.left;
907
+ sortable.offset.parent.top -= draggable.offset.parent.top -
908
+ sortable.offset.parent.top;
909
+
910
+ draggable._trigger( "toSortable", event );
911
+
912
+ // Inform draggable that the helper is in a valid drop zone,
913
+ // used solely in the revert option to handle "valid/invalid".
914
+ draggable.dropped = sortable.element;
915
+
916
+ // Need to refreshPositions of all sortables in the case that
917
+ // adding to one sortable changes the location of the other sortables (#9675)
918
+ $.each( draggable.sortables, function() {
919
+ this.refreshPositions();
920
+ } );
921
+
922
+ // Hack so receive/update callbacks work (mostly)
923
+ draggable.currentItem = draggable.element;
924
+ sortable.fromOutside = draggable;
925
+ }
926
+
927
+ if ( sortable.currentItem ) {
928
+ sortable._mouseDrag( event );
929
+
930
+ // Copy the sortable's position because the draggable's can potentially reflect
931
+ // a relative position, while sortable is always absolute, which the dragged
932
+ // element has now become. (#8809)
933
+ ui.position = sortable.position;
934
+ }
935
+ } else {
936
+
937
+ // If it doesn't intersect with the sortable, and it intersected before,
938
+ // we fake the drag stop of the sortable, but make sure it doesn't remove
939
+ // the helper by using cancelHelperRemoval.
940
+ if ( sortable.isOver ) {
941
+
942
+ sortable.isOver = 0;
943
+ sortable.cancelHelperRemoval = true;
944
+
945
+ // Calling sortable's mouseStop would trigger a revert,
946
+ // so revert must be temporarily false until after mouseStop is called.
947
+ sortable.options._revert = sortable.options.revert;
948
+ sortable.options.revert = false;
949
+
950
+ sortable._trigger( "out", event, sortable._uiHash( sortable ) );
951
+ sortable._mouseStop( event, true );
952
+
953
+ // Restore sortable behaviors that were modfied
954
+ // when the draggable entered the sortable area (#9481)
955
+ sortable.options.revert = sortable.options._revert;
956
+ sortable.options.helper = sortable.options._helper;
957
+
958
+ if ( sortable.placeholder ) {
959
+ sortable.placeholder.remove();
960
+ }
961
+
962
+ // Restore and recalculate the draggable's offset considering the sortable
963
+ // may have modified them in unexpected ways. (#8809, #10669)
964
+ ui.helper.appendTo( draggable._parent );
965
+ draggable._refreshOffsets( event );
966
+ ui.position = draggable._generatePosition( event, true );
967
+
968
+ draggable._trigger( "fromSortable", event );
969
+
970
+ // Inform draggable that the helper is no longer in a valid drop zone
971
+ draggable.dropped = false;
972
+
973
+ // Need to refreshPositions of all sortables just in case removing
974
+ // from one sortable changes the location of other sortables (#9675)
975
+ $.each( draggable.sortables, function() {
976
+ this.refreshPositions();
977
+ } );
978
+ }
979
+ }
980
+ } );
981
+ }
982
+ } );
983
+
984
+ $.ui.plugin.add( "draggable", "cursor", {
985
+ start: function( event, ui, instance ) {
986
+ var t = $( "body" ),
987
+ o = instance.options;
988
+
989
+ if ( t.css( "cursor" ) ) {
990
+ o._cursor = t.css( "cursor" );
991
+ }
992
+ t.css( "cursor", o.cursor );
993
+ },
994
+ stop: function( event, ui, instance ) {
995
+ var o = instance.options;
996
+ if ( o._cursor ) {
997
+ $( "body" ).css( "cursor", o._cursor );
998
+ }
999
+ }
1000
+ } );
1001
+
1002
+ $.ui.plugin.add( "draggable", "opacity", {
1003
+ start: function( event, ui, instance ) {
1004
+ var t = $( ui.helper ),
1005
+ o = instance.options;
1006
+ if ( t.css( "opacity" ) ) {
1007
+ o._opacity = t.css( "opacity" );
1008
+ }
1009
+ t.css( "opacity", o.opacity );
1010
+ },
1011
+ stop: function( event, ui, instance ) {
1012
+ var o = instance.options;
1013
+ if ( o._opacity ) {
1014
+ $( ui.helper ).css( "opacity", o._opacity );
1015
+ }
1016
+ }
1017
+ } );
1018
+
1019
+ $.ui.plugin.add( "draggable", "scroll", {
1020
+ start: function( event, ui, i ) {
1021
+ if ( !i.scrollParentNotHidden ) {
1022
+ i.scrollParentNotHidden = i.helper.scrollParent( false );
1023
+ }
1024
+
1025
+ if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
1026
+ i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
1027
+ i.overflowOffset = i.scrollParentNotHidden.offset();
1028
+ }
1029
+ },
1030
+ drag: function( event, ui, i ) {
1031
+
1032
+ var o = i.options,
1033
+ scrolled = false,
1034
+ scrollParent = i.scrollParentNotHidden[ 0 ],
1035
+ document = i.document[ 0 ];
1036
+
1037
+ if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
1038
+ if ( !o.axis || o.axis !== "x" ) {
1039
+ if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
1040
+ o.scrollSensitivity ) {
1041
+ scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
1042
+ } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
1043
+ scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
1044
+ }
1045
+ }
1046
+
1047
+ if ( !o.axis || o.axis !== "y" ) {
1048
+ if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
1049
+ o.scrollSensitivity ) {
1050
+ scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
1051
+ } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
1052
+ scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
1053
+ }
1054
+ }
1055
+
1056
+ } else {
1057
+
1058
+ if ( !o.axis || o.axis !== "x" ) {
1059
+ if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
1060
+ scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
1061
+ } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
1062
+ o.scrollSensitivity ) {
1063
+ scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
1064
+ }
1065
+ }
1066
+
1067
+ if ( !o.axis || o.axis !== "y" ) {
1068
+ if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
1069
+ scrolled = $( document ).scrollLeft(
1070
+ $( document ).scrollLeft() - o.scrollSpeed
1071
+ );
1072
+ } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
1073
+ o.scrollSensitivity ) {
1074
+ scrolled = $( document ).scrollLeft(
1075
+ $( document ).scrollLeft() + o.scrollSpeed
1076
+ );
1077
+ }
1078
+ }
1079
+
1080
+ }
1081
+
1082
+ if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
1083
+ $.ui.ddmanager.prepareOffsets( i, event );
1084
+ }
1085
+
1086
+ }
1087
+ } );
1088
+
1089
+ $.ui.plugin.add( "draggable", "snap", {
1090
+ start: function( event, ui, i ) {
1091
+
1092
+ var o = i.options;
1093
+
1094
+ i.snapElements = [];
1095
+
1096
+ $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
1097
+ .each( function() {
1098
+ var $t = $( this ),
1099
+ $o = $t.offset();
1100
+ if ( this !== i.element[ 0 ] ) {
1101
+ i.snapElements.push( {
1102
+ item: this,
1103
+ width: $t.outerWidth(), height: $t.outerHeight(),
1104
+ top: $o.top, left: $o.left
1105
+ } );
1106
+ }
1107
+ } );
1108
+
1109
+ },
1110
+ drag: function( event, ui, inst ) {
1111
+
1112
+ var ts, bs, ls, rs, l, r, t, b, i, first,
1113
+ o = inst.options,
1114
+ d = o.snapTolerance,
1115
+ x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
1116
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
1117
+
1118
+ for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
1119
+
1120
+ l = inst.snapElements[ i ].left - inst.margins.left;
1121
+ r = l + inst.snapElements[ i ].width;
1122
+ t = inst.snapElements[ i ].top - inst.margins.top;
1123
+ b = t + inst.snapElements[ i ].height;
1124
+
1125
+ if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
1126
+ !$.contains( inst.snapElements[ i ].item.ownerDocument,
1127
+ inst.snapElements[ i ].item ) ) {
1128
+ if ( inst.snapElements[ i ].snapping ) {
1129
+ if ( inst.options.snap.release ) {
1130
+ inst.options.snap.release.call(
1131
+ inst.element,
1132
+ event,
1133
+ $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
1134
+ );
1135
+ }
1136
+ }
1137
+ inst.snapElements[ i ].snapping = false;
1138
+ continue;
1139
+ }
1140
+
1141
+ if ( o.snapMode !== "inner" ) {
1142
+ ts = Math.abs( t - y2 ) <= d;
1143
+ bs = Math.abs( b - y1 ) <= d;
1144
+ ls = Math.abs( l - x2 ) <= d;
1145
+ rs = Math.abs( r - x1 ) <= d;
1146
+ if ( ts ) {
1147
+ ui.position.top = inst._convertPositionTo( "relative", {
1148
+ top: t - inst.helperProportions.height,
1149
+ left: 0
1150
+ } ).top;
1151
+ }
1152
+ if ( bs ) {
1153
+ ui.position.top = inst._convertPositionTo( "relative", {
1154
+ top: b,
1155
+ left: 0
1156
+ } ).top;
1157
+ }
1158
+ if ( ls ) {
1159
+ ui.position.left = inst._convertPositionTo( "relative", {
1160
+ top: 0,
1161
+ left: l - inst.helperProportions.width
1162
+ } ).left;
1163
+ }
1164
+ if ( rs ) {
1165
+ ui.position.left = inst._convertPositionTo( "relative", {
1166
+ top: 0,
1167
+ left: r
1168
+ } ).left;
1169
+ }
1170
+ }
1171
+
1172
+ first = ( ts || bs || ls || rs );
1173
+
1174
+ if ( o.snapMode !== "outer" ) {
1175
+ ts = Math.abs( t - y1 ) <= d;
1176
+ bs = Math.abs( b - y2 ) <= d;
1177
+ ls = Math.abs( l - x1 ) <= d;
1178
+ rs = Math.abs( r - x2 ) <= d;
1179
+ if ( ts ) {
1180
+ ui.position.top = inst._convertPositionTo( "relative", {
1181
+ top: t,
1182
+ left: 0
1183
+ } ).top;
1184
+ }
1185
+ if ( bs ) {
1186
+ ui.position.top = inst._convertPositionTo( "relative", {
1187
+ top: b - inst.helperProportions.height,
1188
+ left: 0
1189
+ } ).top;
1190
+ }
1191
+ if ( ls ) {
1192
+ ui.position.left = inst._convertPositionTo( "relative", {
1193
+ top: 0,
1194
+ left: l
1195
+ } ).left;
1196
+ }
1197
+ if ( rs ) {
1198
+ ui.position.left = inst._convertPositionTo( "relative", {
1199
+ top: 0,
1200
+ left: r - inst.helperProportions.width
1201
+ } ).left;
1202
+ }
1203
+ }
1204
+
1205
+ if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
1206
+ if ( inst.options.snap.snap ) {
1207
+ inst.options.snap.snap.call(
1208
+ inst.element,
1209
+ event,
1210
+ $.extend( inst._uiHash(), {
1211
+ snapItem: inst.snapElements[ i ].item
1212
+ } ) );
1213
+ }
1214
+ }
1215
+ inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
1216
+
1217
+ }
1218
+
1219
+ }
1220
+ } );
1221
+
1222
+ $.ui.plugin.add( "draggable", "stack", {
1223
+ start: function( event, ui, instance ) {
1224
+ var min,
1225
+ o = instance.options,
1226
+ group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
1227
+ return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
1228
+ ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
1229
+ } );
1230
+
1231
+ if ( !group.length ) {
1232
+ return;
1233
+ }
1234
+
1235
+ min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
1236
+ $( group ).each( function( i ) {
1237
+ $( this ).css( "zIndex", min + i );
1238
+ } );
1239
+ this.css( "zIndex", ( min + group.length ) );
1240
+ }
1241
+ } );
1242
+
1243
+ $.ui.plugin.add( "draggable", "zIndex", {
1244
+ start: function( event, ui, instance ) {
1245
+ var t = $( ui.helper ),
1246
+ o = instance.options;
1247
+
1248
+ if ( t.css( "zIndex" ) ) {
1249
+ o._zIndex = t.css( "zIndex" );
1250
+ }
1251
+ t.css( "zIndex", o.zIndex );
1252
+ },
1253
+ stop: function( event, ui, instance ) {
1254
+ var o = instance.options;
1255
+
1256
+ if ( o._zIndex ) {
1257
+ $( ui.helper ).css( "zIndex", o._zIndex );
1258
+ }
1259
+ }
1260
+ } );
1261
+
1262
+ return $.ui.draggable;
1263
+
1264
+ } );