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,1281 @@
1
+ //= require jquery-ui/widgets/mouse
2
+ //= require jquery-ui/disable-selection
3
+ //= require jquery-ui/plugin
4
+ //= require jquery-ui/version
5
+ //= require jquery-ui/widget
6
+
7
+ /*!
8
+ * jQuery UI Resizable 1.14.2
9
+ * https://jqueryui.com
10
+ *
11
+ * Copyright OpenJS Foundation and other contributors
12
+ * Released under the MIT license.
13
+ * https://jquery.org/license
14
+ */
15
+
16
+ //>>label: Resizable
17
+ //>>group: Interactions
18
+ //>>description: Enables resize functionality for any element.
19
+ //>>docs: https://api.jqueryui.com/resizable/
20
+ //>>demos: https://jqueryui.com/resizable/
21
+ //>>css.structure: ../../themes/base/core.css
22
+ //>>css.structure: ../../themes/base/resizable.css
23
+ //>>css.theme: ../../themes/base/theme.css
24
+
25
+ ( function( factory ) {
26
+ "use strict";
27
+
28
+ if ( typeof define === "function" && define.amd ) {
29
+
30
+ // AMD. Register as an anonymous module.
31
+ define( [
32
+ "jquery",
33
+ "./mouse",
34
+ "../disable-selection",
35
+ "../plugin",
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.resizable", $.ui.mouse, {
48
+ version: "1.14.2",
49
+ widgetEventPrefix: "resize",
50
+ options: {
51
+ alsoResize: false,
52
+ animate: false,
53
+ animateDuration: "slow",
54
+ animateEasing: "swing",
55
+ aspectRatio: false,
56
+ autoHide: false,
57
+ classes: {
58
+ "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
59
+ },
60
+ containment: false,
61
+ ghost: false,
62
+ grid: false,
63
+ handles: "e,s,se",
64
+ helper: false,
65
+ maxHeight: null,
66
+ maxWidth: null,
67
+ minHeight: 10,
68
+ minWidth: 10,
69
+
70
+ // See #7960
71
+ zIndex: 90,
72
+
73
+ // Callbacks
74
+ resize: null,
75
+ start: null,
76
+ stop: null
77
+ },
78
+
79
+ _num: function( value ) {
80
+ return parseFloat( value ) || 0;
81
+ },
82
+
83
+ _isNumber: function( value ) {
84
+ return !isNaN( parseFloat( value ) );
85
+ },
86
+
87
+ _hasScroll: function( el, a ) {
88
+
89
+ var scroll,
90
+ has = false,
91
+ overflow = $( el ).css( "overflow" );
92
+
93
+ if ( overflow === "hidden" ) {
94
+ return false;
95
+ }
96
+ if ( overflow === "scroll" ) {
97
+ return true;
98
+ }
99
+
100
+ scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop";
101
+
102
+ if ( el[ scroll ] > 0 ) {
103
+ return true;
104
+ }
105
+
106
+ // TODO: determine which cases actually cause this to happen
107
+ // if the element doesn't have the scroll set, see if it's possible to
108
+ // set the scroll
109
+ try {
110
+ el[ scroll ] = 1;
111
+ has = ( el[ scroll ] > 0 );
112
+ el[ scroll ] = 0;
113
+ } catch ( _e ) {
114
+
115
+ // `el` might be a string, then setting `scroll` will throw
116
+ // an error in strict mode; ignore it.
117
+ }
118
+ return has;
119
+ },
120
+
121
+ _create: function() {
122
+
123
+ var margins,
124
+ o = this.options,
125
+ that = this;
126
+ this._addClass( "ui-resizable" );
127
+
128
+ $.extend( this, {
129
+ _aspectRatio: !!( o.aspectRatio ),
130
+ aspectRatio: o.aspectRatio,
131
+ originalElement: this.element,
132
+ _proportionallyResizeElements: [],
133
+ _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
134
+ } );
135
+
136
+ // Wrap the element if it cannot hold child nodes
137
+ if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
138
+
139
+ this.element.wrap(
140
+ $( "<div class='ui-wrapper'></div>" ).css( {
141
+ overflow: "hidden",
142
+ position: this.element.css( "position" ),
143
+ width: this.element.outerWidth(),
144
+ height: this.element.outerHeight(),
145
+ top: this.element.css( "top" ),
146
+ left: this.element.css( "left" )
147
+ } )
148
+ );
149
+
150
+ this.element = this.element.parent().data(
151
+ "ui-resizable", this.element.resizable( "instance" )
152
+ );
153
+
154
+ this.elementIsWrapper = true;
155
+
156
+ margins = {
157
+ marginTop: this.originalElement.css( "marginTop" ),
158
+ marginRight: this.originalElement.css( "marginRight" ),
159
+ marginBottom: this.originalElement.css( "marginBottom" ),
160
+ marginLeft: this.originalElement.css( "marginLeft" )
161
+ };
162
+
163
+ this.element.css( margins );
164
+
165
+ // Support: Safari
166
+ // Prevent Safari textarea resize
167
+ this.originalResizeStyle = this.originalElement.css( "resize" );
168
+ this.originalElement.css( "resize", "none" );
169
+
170
+ this._proportionallyResizeElements.push( this.originalElement.css( {
171
+ position: "static",
172
+ zoom: 1,
173
+ display: "block"
174
+ } ) );
175
+
176
+ this._proportionallyResize();
177
+ }
178
+
179
+ this._setupHandles();
180
+
181
+ if ( o.autoHide ) {
182
+ $( this.element )
183
+ .on( "mouseenter", function() {
184
+ if ( o.disabled ) {
185
+ return;
186
+ }
187
+ that._removeClass( "ui-resizable-autohide" );
188
+ that._handles.show();
189
+ } )
190
+ .on( "mouseleave", function() {
191
+ if ( o.disabled ) {
192
+ return;
193
+ }
194
+ if ( !that.resizing ) {
195
+ that._addClass( "ui-resizable-autohide" );
196
+ that._handles.hide();
197
+ }
198
+ } );
199
+ }
200
+
201
+ this._mouseInit();
202
+ },
203
+
204
+ _destroy: function() {
205
+
206
+ this._mouseDestroy();
207
+ this._addedHandles.remove();
208
+
209
+ var wrapper,
210
+ _destroy = function( exp ) {
211
+ $( exp )
212
+ .removeData( "resizable" )
213
+ .removeData( "ui-resizable" )
214
+ .off( ".resizable" );
215
+ };
216
+
217
+ // TODO: Unwrap at same DOM position
218
+ if ( this.elementIsWrapper ) {
219
+ _destroy( this.element );
220
+ wrapper = this.element;
221
+ this.originalElement.css( {
222
+ position: wrapper.css( "position" ),
223
+ width: wrapper.outerWidth(),
224
+ height: wrapper.outerHeight(),
225
+ top: wrapper.css( "top" ),
226
+ left: wrapper.css( "left" )
227
+ } ).insertAfter( wrapper );
228
+ wrapper.remove();
229
+ }
230
+
231
+ this.originalElement.css( "resize", this.originalResizeStyle );
232
+ _destroy( this.originalElement );
233
+
234
+ return this;
235
+ },
236
+
237
+ _setOption: function( key, value ) {
238
+ this._super( key, value );
239
+
240
+ switch ( key ) {
241
+ case "handles":
242
+ this._removeHandles();
243
+ this._setupHandles();
244
+ break;
245
+ case "aspectRatio":
246
+ this._aspectRatio = !!value;
247
+ break;
248
+ default:
249
+ break;
250
+ }
251
+ },
252
+
253
+ _setupHandles: function() {
254
+ var o = this.options, handle, i, n, hname, axis, that = this;
255
+ this.handles = o.handles ||
256
+ ( !$( ".ui-resizable-handle", this.element ).length ?
257
+ "e,s,se" : {
258
+ n: ".ui-resizable-n",
259
+ e: ".ui-resizable-e",
260
+ s: ".ui-resizable-s",
261
+ w: ".ui-resizable-w",
262
+ se: ".ui-resizable-se",
263
+ sw: ".ui-resizable-sw",
264
+ ne: ".ui-resizable-ne",
265
+ nw: ".ui-resizable-nw"
266
+ } );
267
+
268
+ this._handles = $();
269
+ this._addedHandles = $();
270
+ if ( this.handles.constructor === String ) {
271
+
272
+ if ( this.handles === "all" ) {
273
+ this.handles = "n,e,s,w,se,sw,ne,nw";
274
+ }
275
+
276
+ n = this.handles.split( "," );
277
+ this.handles = {};
278
+
279
+ for ( i = 0; i < n.length; i++ ) {
280
+
281
+ handle = String.prototype.trim.call( n[ i ] );
282
+ hname = "ui-resizable-" + handle;
283
+ axis = $( "<div>" );
284
+ this._addClass( axis, "ui-resizable-handle " + hname );
285
+
286
+ axis.css( { zIndex: o.zIndex } );
287
+
288
+ this.handles[ handle ] = ".ui-resizable-" + handle;
289
+ if ( !this.element.children( this.handles[ handle ] ).length ) {
290
+ this.element.append( axis );
291
+ this._addedHandles = this._addedHandles.add( axis );
292
+ }
293
+ }
294
+
295
+ }
296
+
297
+ this._renderAxis = function( target ) {
298
+
299
+ var i, axis, padPos, padWrapper;
300
+
301
+ target = target || this.element;
302
+
303
+ for ( i in this.handles ) {
304
+
305
+ if ( this.handles[ i ].constructor === String ) {
306
+ this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
307
+ } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
308
+ this.handles[ i ] = $( this.handles[ i ] );
309
+ this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
310
+ }
311
+
312
+ if ( this.elementIsWrapper &&
313
+ this.originalElement[ 0 ]
314
+ .nodeName
315
+ .match( /^(textarea|input|select|button)$/i ) ) {
316
+ axis = $( this.handles[ i ], this.element );
317
+
318
+ padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
319
+ axis.outerHeight() :
320
+ axis.outerWidth();
321
+
322
+ padPos = [ "padding",
323
+ /ne|nw|n/.test( i ) ? "Top" :
324
+ /se|sw|s/.test( i ) ? "Bottom" :
325
+ /^e$/.test( i ) ? "Right" : "Left" ].join( "" );
326
+
327
+ target.css( padPos, padWrapper );
328
+
329
+ this._proportionallyResize();
330
+ }
331
+
332
+ this._handles = this._handles.add( this.handles[ i ] );
333
+ }
334
+ };
335
+
336
+ // TODO: make renderAxis a prototype function
337
+ this._renderAxis( this.element );
338
+
339
+ this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
340
+ this._handles.disableSelection();
341
+
342
+ this._handles.on( "mouseover", function() {
343
+ if ( !that.resizing ) {
344
+ if ( this.className ) {
345
+ axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
346
+ }
347
+ that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
348
+ }
349
+ } );
350
+
351
+ if ( o.autoHide ) {
352
+ this._handles.hide();
353
+ this._addClass( "ui-resizable-autohide" );
354
+ }
355
+ },
356
+
357
+ _removeHandles: function() {
358
+ this._addedHandles.remove();
359
+ },
360
+
361
+ _mouseCapture: function( event ) {
362
+ var i, handle,
363
+ capture = false;
364
+
365
+ for ( i in this.handles ) {
366
+ handle = $( this.handles[ i ] )[ 0 ];
367
+ if ( handle === event.target || $.contains( handle, event.target ) ) {
368
+ capture = true;
369
+ }
370
+ }
371
+
372
+ return !this.options.disabled && capture;
373
+ },
374
+
375
+ _mouseStart: function( event ) {
376
+
377
+ var curleft, curtop, cursor, calculatedSize,
378
+ o = this.options,
379
+ el = this.element;
380
+
381
+ this.resizing = true;
382
+
383
+ this._renderProxy();
384
+
385
+ curleft = this._num( this.helper.css( "left" ) );
386
+ curtop = this._num( this.helper.css( "top" ) );
387
+
388
+ if ( o.containment ) {
389
+ curleft += $( o.containment ).scrollLeft() || 0;
390
+ curtop += $( o.containment ).scrollTop() || 0;
391
+ }
392
+
393
+ this.offset = this.helper.offset();
394
+ this.position = { left: curleft, top: curtop };
395
+
396
+ if ( !this._helper ) {
397
+ calculatedSize = this._calculateAdjustedElementDimensions( el );
398
+ }
399
+
400
+ this.size = this._helper ? {
401
+ width: this.helper.width(),
402
+ height: this.helper.height()
403
+ } : {
404
+ width: calculatedSize.width,
405
+ height: calculatedSize.height
406
+ };
407
+
408
+ this.originalSize = this._helper ? {
409
+ width: el.outerWidth(),
410
+ height: el.outerHeight()
411
+ } : {
412
+ width: calculatedSize.width,
413
+ height: calculatedSize.height
414
+ };
415
+
416
+ this.sizeDiff = {
417
+ width: el.outerWidth() - el.width(),
418
+ height: el.outerHeight() - el.height()
419
+ };
420
+
421
+ this.originalPosition = { left: curleft, top: curtop };
422
+ this.originalMousePosition = { left: event.pageX, top: event.pageY };
423
+
424
+ this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
425
+ o.aspectRatio :
426
+ ( ( this.originalSize.width / this.originalSize.height ) || 1 );
427
+
428
+ cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
429
+ $( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
430
+
431
+ this._addClass( "ui-resizable-resizing" );
432
+ this._propagate( "start", event );
433
+ return true;
434
+ },
435
+
436
+ _mouseDrag: function( event ) {
437
+
438
+ var data, props,
439
+ smp = this.originalMousePosition,
440
+ a = this.axis,
441
+ dx = ( event.pageX - smp.left ) || 0,
442
+ dy = ( event.pageY - smp.top ) || 0,
443
+ trigger = this._change[ a ];
444
+
445
+ this._updatePrevProperties();
446
+
447
+ if ( !trigger ) {
448
+ return false;
449
+ }
450
+
451
+ data = trigger.apply( this, [ event, dx, dy ] );
452
+
453
+ this._updateVirtualBoundaries( event.shiftKey );
454
+ if ( this._aspectRatio || event.shiftKey ) {
455
+ data = this._updateRatio( data, event );
456
+ }
457
+
458
+ data = this._respectSize( data, event );
459
+
460
+ this._updateCache( data );
461
+
462
+ this._propagate( "resize", event );
463
+
464
+ props = this._applyChanges();
465
+
466
+ if ( !this._helper && this._proportionallyResizeElements.length ) {
467
+ this._proportionallyResize();
468
+ }
469
+
470
+ if ( !$.isEmptyObject( props ) ) {
471
+ this._updatePrevProperties();
472
+ this._trigger( "resize", event, this.ui() );
473
+ this._applyChanges();
474
+ }
475
+
476
+ return false;
477
+ },
478
+
479
+ _mouseStop: function( event ) {
480
+
481
+ this.resizing = false;
482
+ var pr, ista, soffseth, soffsetw, s, left, top,
483
+ o = this.options, that = this;
484
+
485
+ if ( this._helper ) {
486
+
487
+ pr = this._proportionallyResizeElements;
488
+ ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
489
+ soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
490
+ soffsetw = ista ? 0 : that.sizeDiff.width;
491
+
492
+ s = {
493
+ width: ( that.helper.width() - soffsetw ),
494
+ height: ( that.helper.height() - soffseth )
495
+ };
496
+ left = ( parseFloat( that.element.css( "left" ) ) +
497
+ ( that.position.left - that.originalPosition.left ) ) || null;
498
+ top = ( parseFloat( that.element.css( "top" ) ) +
499
+ ( that.position.top - that.originalPosition.top ) ) || null;
500
+
501
+ if ( !o.animate ) {
502
+ this.element.css( $.extend( s, { top: top, left: left } ) );
503
+ }
504
+
505
+ that.helper.height( that.size.height );
506
+ that.helper.width( that.size.width );
507
+
508
+ if ( this._helper && !o.animate ) {
509
+ this._proportionallyResize();
510
+ }
511
+ }
512
+
513
+ $( "body" ).css( "cursor", "auto" );
514
+
515
+ this._removeClass( "ui-resizable-resizing" );
516
+
517
+ this._propagate( "stop", event );
518
+
519
+ if ( this._helper ) {
520
+ this.helper.remove();
521
+ }
522
+
523
+ return false;
524
+
525
+ },
526
+
527
+ _updatePrevProperties: function() {
528
+ this.prevPosition = {
529
+ top: this.position.top,
530
+ left: this.position.left
531
+ };
532
+ this.prevSize = {
533
+ width: this.size.width,
534
+ height: this.size.height
535
+ };
536
+ },
537
+
538
+ _applyChanges: function() {
539
+ var props = {};
540
+
541
+ if ( this.position.top !== this.prevPosition.top ) {
542
+ props.top = this.position.top + "px";
543
+ }
544
+ if ( this.position.left !== this.prevPosition.left ) {
545
+ props.left = this.position.left + "px";
546
+ }
547
+
548
+ this.helper.css( props );
549
+
550
+ if ( this.size.width !== this.prevSize.width ) {
551
+ props.width = this.size.width + "px";
552
+ this.helper.width( props.width );
553
+ }
554
+ if ( this.size.height !== this.prevSize.height ) {
555
+ props.height = this.size.height + "px";
556
+ this.helper.height( props.height );
557
+ }
558
+
559
+ return props;
560
+ },
561
+
562
+ _updateVirtualBoundaries: function( forceAspectRatio ) {
563
+ var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
564
+ o = this.options;
565
+
566
+ b = {
567
+ minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
568
+ maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
569
+ minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
570
+ maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
571
+ };
572
+
573
+ if ( this._aspectRatio || forceAspectRatio ) {
574
+ pMinWidth = b.minHeight * this.aspectRatio;
575
+ pMinHeight = b.minWidth / this.aspectRatio;
576
+ pMaxWidth = b.maxHeight * this.aspectRatio;
577
+ pMaxHeight = b.maxWidth / this.aspectRatio;
578
+
579
+ if ( pMinWidth > b.minWidth ) {
580
+ b.minWidth = pMinWidth;
581
+ }
582
+ if ( pMinHeight > b.minHeight ) {
583
+ b.minHeight = pMinHeight;
584
+ }
585
+ if ( pMaxWidth < b.maxWidth ) {
586
+ b.maxWidth = pMaxWidth;
587
+ }
588
+ if ( pMaxHeight < b.maxHeight ) {
589
+ b.maxHeight = pMaxHeight;
590
+ }
591
+ }
592
+ this._vBoundaries = b;
593
+ },
594
+
595
+ _updateCache: function( data ) {
596
+ this.offset = this.helper.offset();
597
+ if ( this._isNumber( data.left ) ) {
598
+ this.position.left = data.left;
599
+ }
600
+ if ( this._isNumber( data.top ) ) {
601
+ this.position.top = data.top;
602
+ }
603
+ if ( this._isNumber( data.height ) ) {
604
+ this.size.height = data.height;
605
+ }
606
+ if ( this._isNumber( data.width ) ) {
607
+ this.size.width = data.width;
608
+ }
609
+ },
610
+
611
+ _updateRatio: function( data ) {
612
+
613
+ var cpos = this.position,
614
+ csize = this.size,
615
+ a = this.axis;
616
+
617
+ if ( this._isNumber( data.height ) ) {
618
+ data.width = ( data.height * this.aspectRatio );
619
+ } else if ( this._isNumber( data.width ) ) {
620
+ data.height = ( data.width / this.aspectRatio );
621
+ }
622
+
623
+ if ( a === "sw" ) {
624
+ data.left = cpos.left + ( csize.width - data.width );
625
+ data.top = null;
626
+ }
627
+ if ( a === "nw" ) {
628
+ data.top = cpos.top + ( csize.height - data.height );
629
+ data.left = cpos.left + ( csize.width - data.width );
630
+ }
631
+
632
+ return data;
633
+ },
634
+
635
+ _respectSize: function( data ) {
636
+
637
+ var o = this._vBoundaries,
638
+ a = this.axis,
639
+ ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
640
+ ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
641
+ isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
642
+ isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
643
+ dw = this.originalPosition.left + this.originalSize.width,
644
+ dh = this.originalPosition.top + this.originalSize.height,
645
+ cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
646
+ if ( isminw ) {
647
+ data.width = o.minWidth;
648
+ }
649
+ if ( isminh ) {
650
+ data.height = o.minHeight;
651
+ }
652
+ if ( ismaxw ) {
653
+ data.width = o.maxWidth;
654
+ }
655
+ if ( ismaxh ) {
656
+ data.height = o.maxHeight;
657
+ }
658
+
659
+ if ( isminw && cw ) {
660
+ data.left = dw - o.minWidth;
661
+ }
662
+ if ( ismaxw && cw ) {
663
+ data.left = dw - o.maxWidth;
664
+ }
665
+ if ( isminh && ch ) {
666
+ data.top = dh - o.minHeight;
667
+ }
668
+ if ( ismaxh && ch ) {
669
+ data.top = dh - o.maxHeight;
670
+ }
671
+
672
+ // Fixing jump error on top/left - bug #2330
673
+ if ( !data.width && !data.height && !data.left && data.top ) {
674
+ data.top = null;
675
+ } else if ( !data.width && !data.height && !data.top && data.left ) {
676
+ data.left = null;
677
+ }
678
+
679
+ return data;
680
+ },
681
+
682
+ _getPaddingPlusBorderDimensions: function( element ) {
683
+ var i = 0,
684
+ widths = [],
685
+ borders = [
686
+ element.css( "borderTopWidth" ),
687
+ element.css( "borderRightWidth" ),
688
+ element.css( "borderBottomWidth" ),
689
+ element.css( "borderLeftWidth" )
690
+ ],
691
+ paddings = [
692
+ element.css( "paddingTop" ),
693
+ element.css( "paddingRight" ),
694
+ element.css( "paddingBottom" ),
695
+ element.css( "paddingLeft" )
696
+ ];
697
+
698
+ for ( ; i < 4; i++ ) {
699
+ widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
700
+ widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
701
+ }
702
+
703
+ return {
704
+ height: widths[ 0 ] + widths[ 2 ],
705
+ width: widths[ 1 ] + widths[ 3 ]
706
+ };
707
+ },
708
+
709
+ _calculateAdjustedElementDimensions: function( element ) {
710
+ var elWidth, elHeight, paddingBorder,
711
+ ce = element.get( 0 );
712
+
713
+ if ( element.css( "box-sizing" ) !== "content-box" ||
714
+ ( !this._hasScroll( ce ) && !this._hasScroll( ce, "left" ) ) ) {
715
+ return {
716
+ height: parseFloat( element.css( "height" ) ),
717
+ width: parseFloat( element.css( "width" ) )
718
+ };
719
+ }
720
+
721
+ // Check if CSS inline styles are set and use those (usually from previous resizes)
722
+ elWidth = parseFloat( ce.style.width );
723
+ elHeight = parseFloat( ce.style.height );
724
+
725
+ paddingBorder = this._getPaddingPlusBorderDimensions( element );
726
+ elWidth = isNaN( elWidth ) ?
727
+ this._getElementTheoreticalSize( element, paddingBorder, "width" ) :
728
+ elWidth;
729
+ elHeight = isNaN( elHeight ) ?
730
+ this._getElementTheoreticalSize( element, paddingBorder, "height" ) :
731
+ elHeight;
732
+
733
+ return {
734
+ height: elHeight,
735
+ width: elWidth
736
+ };
737
+ },
738
+
739
+ _getElementTheoreticalSize: function( element, extraSize, dimension ) {
740
+
741
+ // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
742
+ var size = Math.max( 0, Math.ceil(
743
+ element.get( 0 )[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
744
+ extraSize[ dimension ] -
745
+ 0.5
746
+
747
+ // If offsetWidth/offsetHeight is unknown, then we can't determine theoretical size.
748
+ // Use an explicit zero to avoid NaN.
749
+ // See https://github.com/jquery/jquery/issues/3964
750
+ ) ) || 0;
751
+
752
+ return size;
753
+ },
754
+
755
+ _proportionallyResize: function() {
756
+
757
+ if ( !this._proportionallyResizeElements.length ) {
758
+ return;
759
+ }
760
+
761
+ var prel,
762
+ i = 0,
763
+ element = this.helper || this.element;
764
+
765
+ for ( ; i < this._proportionallyResizeElements.length; i++ ) {
766
+
767
+ prel = this._proportionallyResizeElements[ i ];
768
+
769
+ // TODO: Seems like a bug to cache this.outerDimensions
770
+ // considering that we are in a loop.
771
+ if ( !this.outerDimensions ) {
772
+ this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
773
+ }
774
+
775
+ prel.css( {
776
+ height: ( element.height() - this.outerDimensions.height ) || 0,
777
+ width: ( element.width() - this.outerDimensions.width ) || 0
778
+ } );
779
+
780
+ }
781
+
782
+ },
783
+
784
+ _renderProxy: function() {
785
+
786
+ var el = this.element, o = this.options;
787
+ this.elementOffset = el.offset();
788
+
789
+ if ( this._helper ) {
790
+
791
+ this.helper = this.helper || $( "<div></div>" ).css( { overflow: "hidden" } );
792
+
793
+ this._addClass( this.helper, this._helper );
794
+ this.helper.css( {
795
+ width: this.element.outerWidth(),
796
+ height: this.element.outerHeight(),
797
+ position: "absolute",
798
+ left: this.elementOffset.left + "px",
799
+ top: this.elementOffset.top + "px",
800
+ zIndex: ++o.zIndex //TODO: Don't modify option
801
+ } );
802
+
803
+ this.helper
804
+ .appendTo( "body" )
805
+ .disableSelection();
806
+
807
+ } else {
808
+ this.helper = this.element;
809
+ }
810
+
811
+ },
812
+
813
+ _change: {
814
+ e: function( event, dx ) {
815
+ return { width: this.originalSize.width + dx };
816
+ },
817
+ w: function( event, dx ) {
818
+ var cs = this.originalSize, sp = this.originalPosition;
819
+ return { left: sp.left + dx, width: cs.width - dx };
820
+ },
821
+ n: function( event, dx, dy ) {
822
+ var cs = this.originalSize, sp = this.originalPosition;
823
+ return { top: sp.top + dy, height: cs.height - dy };
824
+ },
825
+ s: function( event, dx, dy ) {
826
+ return { height: this.originalSize.height + dy };
827
+ },
828
+ se: function( event, dx, dy ) {
829
+ return $.extend( this._change.s.apply( this, arguments ),
830
+ this._change.e.apply( this, [ event, dx, dy ] ) );
831
+ },
832
+ sw: function( event, dx, dy ) {
833
+ return $.extend( this._change.s.apply( this, arguments ),
834
+ this._change.w.apply( this, [ event, dx, dy ] ) );
835
+ },
836
+ ne: function( event, dx, dy ) {
837
+ return $.extend( this._change.n.apply( this, arguments ),
838
+ this._change.e.apply( this, [ event, dx, dy ] ) );
839
+ },
840
+ nw: function( event, dx, dy ) {
841
+ return $.extend( this._change.n.apply( this, arguments ),
842
+ this._change.w.apply( this, [ event, dx, dy ] ) );
843
+ }
844
+ },
845
+
846
+ _propagate: function( n, event ) {
847
+ $.ui.plugin.call( this, n, [ event, this.ui() ] );
848
+ if ( n !== "resize" ) {
849
+ this._trigger( n, event, this.ui() );
850
+ }
851
+ },
852
+
853
+ plugins: {},
854
+
855
+ ui: function() {
856
+ return {
857
+ originalElement: this.originalElement,
858
+ element: this.element,
859
+ helper: this.helper,
860
+ position: this.position,
861
+ size: this.size,
862
+ originalSize: this.originalSize,
863
+ originalPosition: this.originalPosition
864
+ };
865
+ }
866
+
867
+ } );
868
+
869
+ /*
870
+ * Resizable Extensions
871
+ */
872
+
873
+ $.ui.plugin.add( "resizable", "animate", {
874
+
875
+ stop: function( event ) {
876
+ var that = $( this ).resizable( "instance" ),
877
+ o = that.options,
878
+ pr = that._proportionallyResizeElements,
879
+ ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
880
+ soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
881
+ soffsetw = ista ? 0 : that.sizeDiff.width,
882
+ style = {
883
+ width: ( that.size.width - soffsetw ),
884
+ height: ( that.size.height - soffseth )
885
+ },
886
+ left = ( parseFloat( that.element.css( "left" ) ) +
887
+ ( that.position.left - that.originalPosition.left ) ) || null,
888
+ top = ( parseFloat( that.element.css( "top" ) ) +
889
+ ( that.position.top - that.originalPosition.top ) ) || null;
890
+
891
+ that.element.animate(
892
+ $.extend( style, top && left ? { top: top, left: left } : {} ), {
893
+ duration: o.animateDuration,
894
+ easing: o.animateEasing,
895
+ step: function() {
896
+
897
+ var data = {
898
+ width: parseFloat( that.element.css( "width" ) ),
899
+ height: parseFloat( that.element.css( "height" ) ),
900
+ top: parseFloat( that.element.css( "top" ) ),
901
+ left: parseFloat( that.element.css( "left" ) )
902
+ };
903
+
904
+ if ( pr && pr.length ) {
905
+ $( pr[ 0 ] ).css( { width: data.width, height: data.height } );
906
+ }
907
+
908
+ // Propagating resize, and updating values for each animation step
909
+ that._updateCache( data );
910
+ that._propagate( "resize", event );
911
+
912
+ }
913
+ }
914
+ );
915
+ }
916
+
917
+ } );
918
+
919
+ $.ui.plugin.add( "resizable", "containment", {
920
+
921
+ start: function() {
922
+ var element, p, co, ch, cw, width, height,
923
+ that = $( this ).resizable( "instance" ),
924
+ o = that.options,
925
+ el = that.element,
926
+ oc = o.containment,
927
+ ce = ( oc instanceof $ ) ?
928
+ oc.get( 0 ) :
929
+ ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
930
+
931
+ if ( !ce ) {
932
+ return;
933
+ }
934
+
935
+ that.containerElement = $( ce );
936
+
937
+ if ( /document/.test( oc ) || oc === document ) {
938
+ that.containerOffset = {
939
+ left: 0,
940
+ top: 0
941
+ };
942
+ that.containerPosition = {
943
+ left: 0,
944
+ top: 0
945
+ };
946
+
947
+ that.parentData = {
948
+ element: $( document ),
949
+ left: 0,
950
+ top: 0,
951
+ width: $( document ).width(),
952
+ height: $( document ).height() || document.body.parentNode.scrollHeight
953
+ };
954
+ } else {
955
+ element = $( ce );
956
+ p = [];
957
+ $( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
958
+ p[ i ] = that._num( element.css( "padding" + name ) );
959
+ } );
960
+
961
+ that.containerOffset = element.offset();
962
+ that.containerPosition = element.position();
963
+ that.containerSize = {
964
+ height: ( element.innerHeight() - p[ 3 ] ),
965
+ width: ( element.innerWidth() - p[ 1 ] )
966
+ };
967
+
968
+ co = that.containerOffset;
969
+ ch = that.containerSize.height;
970
+ cw = that.containerSize.width;
971
+ width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw );
972
+ height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch );
973
+
974
+ that.parentData = {
975
+ element: ce,
976
+ left: co.left,
977
+ top: co.top,
978
+ width: width,
979
+ height: height
980
+ };
981
+ }
982
+ },
983
+
984
+ resize: function( event ) {
985
+ var woset, hoset, isParent, isOffsetRelative,
986
+ that = $( this ).resizable( "instance" ),
987
+ o = that.options,
988
+ co = that.containerOffset,
989
+ cp = that.position,
990
+ pRatio = that._aspectRatio || event.shiftKey,
991
+ cop = {
992
+ top: 0,
993
+ left: 0
994
+ },
995
+ ce = that.containerElement,
996
+ continueResize = true;
997
+
998
+ if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
999
+ cop = co;
1000
+ }
1001
+
1002
+ if ( cp.left < ( that._helper ? co.left : 0 ) ) {
1003
+ that.size.width = that.size.width +
1004
+ ( that._helper ?
1005
+ ( that.position.left - co.left ) :
1006
+ ( that.position.left - cop.left ) );
1007
+
1008
+ if ( pRatio ) {
1009
+ that.size.height = that.size.width / that.aspectRatio;
1010
+ continueResize = false;
1011
+ }
1012
+ that.position.left = o.helper ? co.left : 0;
1013
+ }
1014
+
1015
+ if ( cp.top < ( that._helper ? co.top : 0 ) ) {
1016
+ that.size.height = that.size.height +
1017
+ ( that._helper ?
1018
+ ( that.position.top - co.top ) :
1019
+ that.position.top );
1020
+
1021
+ if ( pRatio ) {
1022
+ that.size.width = that.size.height * that.aspectRatio;
1023
+ continueResize = false;
1024
+ }
1025
+ that.position.top = that._helper ? co.top : 0;
1026
+ }
1027
+
1028
+ isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
1029
+ isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
1030
+
1031
+ if ( isParent && isOffsetRelative ) {
1032
+ that.offset.left = that.parentData.left + that.position.left;
1033
+ that.offset.top = that.parentData.top + that.position.top;
1034
+ } else {
1035
+ that.offset.left = that.element.offset().left;
1036
+ that.offset.top = that.element.offset().top;
1037
+ }
1038
+
1039
+ woset = Math.abs( that.sizeDiff.width +
1040
+ ( that._helper ?
1041
+ that.offset.left - cop.left :
1042
+ ( that.offset.left - co.left ) ) );
1043
+
1044
+ hoset = Math.abs( that.sizeDiff.height +
1045
+ ( that._helper ?
1046
+ that.offset.top - cop.top :
1047
+ ( that.offset.top - co.top ) ) );
1048
+
1049
+ if ( woset + that.size.width >= that.parentData.width ) {
1050
+ that.size.width = that.parentData.width - woset;
1051
+ if ( pRatio ) {
1052
+ that.size.height = that.size.width / that.aspectRatio;
1053
+ continueResize = false;
1054
+ }
1055
+ }
1056
+
1057
+ if ( hoset + that.size.height >= that.parentData.height ) {
1058
+ that.size.height = that.parentData.height - hoset;
1059
+ if ( pRatio ) {
1060
+ that.size.width = that.size.height * that.aspectRatio;
1061
+ continueResize = false;
1062
+ }
1063
+ }
1064
+
1065
+ if ( !continueResize ) {
1066
+ that.position.left = that.prevPosition.left;
1067
+ that.position.top = that.prevPosition.top;
1068
+ that.size.width = that.prevSize.width;
1069
+ that.size.height = that.prevSize.height;
1070
+ }
1071
+ },
1072
+
1073
+ stop: function() {
1074
+ var that = $( this ).resizable( "instance" ),
1075
+ o = that.options,
1076
+ co = that.containerOffset,
1077
+ cop = that.containerPosition,
1078
+ ce = that.containerElement,
1079
+ helper = $( that.helper ),
1080
+ ho = helper.offset(),
1081
+ w = helper.outerWidth() - that.sizeDiff.width,
1082
+ h = helper.outerHeight() - that.sizeDiff.height;
1083
+
1084
+ if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
1085
+ $( this ).css( {
1086
+ left: ho.left - cop.left - co.left,
1087
+ width: w,
1088
+ height: h
1089
+ } );
1090
+ }
1091
+
1092
+ if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
1093
+ $( this ).css( {
1094
+ left: ho.left - cop.left - co.left,
1095
+ width: w,
1096
+ height: h
1097
+ } );
1098
+ }
1099
+ }
1100
+ } );
1101
+
1102
+ $.ui.plugin.add( "resizable", "alsoResize", {
1103
+
1104
+ start: function() {
1105
+ var that = $( this ).resizable( "instance" ),
1106
+ o = that.options;
1107
+
1108
+ $( o.alsoResize ).each( function() {
1109
+ var el = $( this ),
1110
+ elSize = that._calculateAdjustedElementDimensions( el );
1111
+
1112
+ el.data( "ui-resizable-alsoresize", {
1113
+ width: elSize.width, height: elSize.height,
1114
+ left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
1115
+ } );
1116
+ } );
1117
+ },
1118
+
1119
+ resize: function( event, ui ) {
1120
+ var that = $( this ).resizable( "instance" ),
1121
+ o = that.options,
1122
+ os = that.originalSize,
1123
+ op = that.originalPosition,
1124
+ delta = {
1125
+ height: ( that.size.height - os.height ) || 0,
1126
+ width: ( that.size.width - os.width ) || 0,
1127
+ top: ( that.position.top - op.top ) || 0,
1128
+ left: ( that.position.left - op.left ) || 0
1129
+ };
1130
+
1131
+ $( o.alsoResize ).each( function() {
1132
+ var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
1133
+ css = el.parents( ui.originalElement[ 0 ] ).length ?
1134
+ [ "width", "height" ] :
1135
+ [ "width", "height", "top", "left" ];
1136
+
1137
+ $.each( css, function( i, prop ) {
1138
+ var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
1139
+ if ( sum && sum >= 0 ) {
1140
+ style[ prop ] = sum || null;
1141
+ }
1142
+ } );
1143
+
1144
+ el.css( style );
1145
+ } );
1146
+ },
1147
+
1148
+ stop: function() {
1149
+ $( this ).removeData( "ui-resizable-alsoresize" );
1150
+ }
1151
+ } );
1152
+
1153
+ $.ui.plugin.add( "resizable", "ghost", {
1154
+
1155
+ start: function() {
1156
+
1157
+ var that = $( this ).resizable( "instance" ), cs = that.size;
1158
+
1159
+ that.ghost = that.originalElement.clone();
1160
+ that.ghost.css( {
1161
+ opacity: 0.25,
1162
+ display: "block",
1163
+ position: "relative",
1164
+ height: cs.height,
1165
+ width: cs.width,
1166
+ margin: 0,
1167
+ left: 0,
1168
+ top: 0
1169
+ } );
1170
+
1171
+ that._addClass( that.ghost, "ui-resizable-ghost" );
1172
+
1173
+ // DEPRECATED
1174
+ // TODO: remove after 1.12
1175
+ if ( $.uiBackCompat === true && typeof that.options.ghost === "string" ) {
1176
+
1177
+ // Ghost option
1178
+ that.ghost.addClass( this.options.ghost );
1179
+ }
1180
+
1181
+ that.ghost.appendTo( that.helper );
1182
+
1183
+ },
1184
+
1185
+ resize: function() {
1186
+ var that = $( this ).resizable( "instance" );
1187
+ if ( that.ghost ) {
1188
+ that.ghost.css( {
1189
+ position: "relative",
1190
+ height: that.size.height,
1191
+ width: that.size.width
1192
+ } );
1193
+ }
1194
+ },
1195
+
1196
+ stop: function() {
1197
+ var that = $( this ).resizable( "instance" );
1198
+ if ( that.ghost && that.helper ) {
1199
+ that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
1200
+ }
1201
+ }
1202
+
1203
+ } );
1204
+
1205
+ $.ui.plugin.add( "resizable", "grid", {
1206
+
1207
+ resize: function() {
1208
+ var outerDimensions,
1209
+ that = $( this ).resizable( "instance" ),
1210
+ o = that.options,
1211
+ cs = that.size,
1212
+ os = that.originalSize,
1213
+ op = that.originalPosition,
1214
+ a = that.axis,
1215
+ grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
1216
+ gridX = ( grid[ 0 ] || 1 ),
1217
+ gridY = ( grid[ 1 ] || 1 ),
1218
+ ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
1219
+ oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
1220
+ newWidth = os.width + ox,
1221
+ newHeight = os.height + oy,
1222
+ isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
1223
+ isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
1224
+ isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
1225
+ isMinHeight = o.minHeight && ( o.minHeight > newHeight );
1226
+
1227
+ o.grid = grid;
1228
+
1229
+ if ( isMinWidth ) {
1230
+ newWidth += gridX;
1231
+ }
1232
+ if ( isMinHeight ) {
1233
+ newHeight += gridY;
1234
+ }
1235
+ if ( isMaxWidth ) {
1236
+ newWidth -= gridX;
1237
+ }
1238
+ if ( isMaxHeight ) {
1239
+ newHeight -= gridY;
1240
+ }
1241
+
1242
+ if ( /^(se|s|e)$/.test( a ) ) {
1243
+ that.size.width = newWidth;
1244
+ that.size.height = newHeight;
1245
+ } else if ( /^(ne)$/.test( a ) ) {
1246
+ that.size.width = newWidth;
1247
+ that.size.height = newHeight;
1248
+ that.position.top = op.top - oy;
1249
+ } else if ( /^(sw)$/.test( a ) ) {
1250
+ that.size.width = newWidth;
1251
+ that.size.height = newHeight;
1252
+ that.position.left = op.left - ox;
1253
+ } else {
1254
+ if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
1255
+ outerDimensions = that._getPaddingPlusBorderDimensions( this );
1256
+ }
1257
+
1258
+ if ( newHeight - gridY > 0 ) {
1259
+ that.size.height = newHeight;
1260
+ that.position.top = op.top - oy;
1261
+ } else {
1262
+ newHeight = gridY - outerDimensions.height;
1263
+ that.size.height = newHeight;
1264
+ that.position.top = op.top + os.height - newHeight;
1265
+ }
1266
+ if ( newWidth - gridX > 0 ) {
1267
+ that.size.width = newWidth;
1268
+ that.position.left = op.left - ox;
1269
+ } else {
1270
+ newWidth = gridX - outerDimensions.width;
1271
+ that.size.width = newWidth;
1272
+ that.position.left = op.left + os.width - newWidth;
1273
+ }
1274
+ }
1275
+ }
1276
+
1277
+ } );
1278
+
1279
+ return $.ui.resizable;
1280
+
1281
+ } );