You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.8 KiB

  1. .. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
  3. :alt: License: LGPL-3
  4. ================================
  5. DarkroomJS Image Editing for Web
  6. ================================
  7. This module provides a `DarkroomJS`_ (v2.0.1) web widget for use with image
  8. fields. It also adds a Darkroom button to the normal image widget, which can
  9. be used to edit the image via Darkroom in a modal.
  10. .. _DarkroomJS: https://github.com/MattKetmo/darkroomjs
  11. The widget currently supports the following operations and can be extended to
  12. allow others:
  13. * Zoom and pan
  14. * Rotate
  15. * Crop
  16. * Step back in history client-side (before save)
  17. Usage
  18. =====
  19. After installing the module, you can use it in the following ways:
  20. * Specify the ``darkroom`` widget when adding an image field to a view.
  21. Configuration values can be provided using the ``options`` attribute::
  22. <field name="image" widget="darkroom" options="{'minWidth': 100}"/>
  23. The widget passes options directly through to DarkroomJS, which supports the
  24. following:
  25. * minWidth
  26. * minHeight
  27. * maxWidth
  28. * maxHeight
  29. * ratio (aspect ratio)
  30. * backgroundColor
  31. * Open a form view that contains an image in edit mode and hover over the
  32. image widget. You should see a Darkoom button that can be clicked to open
  33. the image in a Darkroom modal, where it can be edited and the changes can be
  34. saved.
  35. .. image:: /web_widget_darkroom/static/description/modal_screenshot_1.png
  36. :alt: Darkroom Modal Screenshot 1
  37. :class: img-thumbnail
  38. :height: 260
  39. .. image:: /web_widget_darkroom/static/description/modal_screenshot_2.png
  40. :alt: Darkroom Modal Screenshot 2
  41. :class: img-thumbnail col-xs-offset-1
  42. :height: 260
  43. Known Issues / Roadmap
  44. ======================
  45. * Darkroom modals are currently not supported during record creation
  46. Bug Tracker
  47. ===========
  48. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. In
  49. case of trouble, please check there if your issue has already been reported.
  50. If you spotted it first, help us smash it by providing detailed and welcome
  51. feedback.
  52. Credits
  53. =======
  54. Images
  55. ------
  56. * Odoo Community Association:
  57. `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  58. Contributors
  59. ------------
  60. * Dave Lasley <dave@laslabs.com>
  61. * Oleg Bulkin <obulkin@laslabs.com>
  62. Maintainer
  63. ----------
  64. .. image:: https://odoo-community.org/logo.png
  65. :alt: Odoo Community Association
  66. :target: https://odoo-community.org
  67. This module is maintained by the OCA.
  68. OCA, or the Odoo Community Association, is a nonprofit organization whose
  69. mission is to support the collaborative development of Odoo features and
  70. promote its widespread use.
  71. To contribute to this module, please visit https://odoo-community.org.