You are here

README.txt in Javascript Tools 5

Drupal activeedit.module README.txt
==============================================================================

Provides Ajax-based in place editing and content creation.

Activeedit includes three distinct behaviours:

1. in place editing.

Editable elements get a clickable button next to them. Clicking brings up an in
place form for editing the single field. Submit, and the updated data are
rendered back in place.

Technical details: Implemented through hook_activeedit_elements(), which returns
an array of elements to attach behaviors to. Elements are identified by their
jQuery selectors, which can be specified by theme (see files in the /themes
directory). 

2. load forms from links

Links, e.g., the "Add new comment" link for nodes, are clickable to load a form (in
this case, the comment add form). Submit and the new item is rendered.

Technical details: Implemented through hook_activeedit_links(), which returns
an array of links to attach behaviors to. Elements are identified by their
text and path elements (e.g., 'comment/reply' for comments).

3. autocomplete add new record

When there are no matches found for an autocomplete, the user is given the option of
adding a new record. We load a form in place to add a new record. The new record
is assigned the value that was entered but not found in the autocomplete.

There is also a fourth behaviour that's been sketched in but is not ready yet:

4. edit buttons panel

When hovering over an editable item (e.g., a node), a panel appears with 
buttons/elements for accomplishing common tasks, e.g., promote/unpromote,
make sticky, etc.


Requirements
------------------------------------------------------------------------------
This module is written for Drupal 5.0+ and requires the jstools and formfilter
modules o be enabled.

Implementation details
------------------------------------------------------------------------------
The approach is different from most in place editing implementations. Activeedit
uses a helper module, Formfilter, to fetch altered versions of the original
forms. That is, when we want to change a setting (e.g., the site name), we fetch
the appropriate settings form via--but alter it so it has only the field we
need. Then we submit that form via AJAX to its normal path.

The key advantage is that we can don't need to reinvent. Permissions/access
issues are already handled. We can use the original forms so we don't need to
replicate them.

Developer Usage
-----------------------------------------------------------------------------

New activeedit behaviours can be easily attached to page elements through
implementations of three activeedit hooks: hook_activeedit_elements() (for
page elements to make editable); hook_activeedit_links() (for links to bring
up forms for adding items); and hook_activeedit_autocompletes() (for 
autocomplete elements to enable new item adding for.

See the include files in the 'modules' directory of the activeedit module
for sample implementations.

Theme support for in place editing
----------------------------------

Activeedit is theme-dependent in that the Javascript needs to be able to
identify which elements to attach to.

Elements are identified by jQuery selectors, see

http://www.jquery.com/DOM/Traversing/Selectors

Each element is given a default selector, but individual themes may or may not
have the same HTML structure as the default.

To add support for a theme, you need to write a themename.inc file and put it
in the module's theme directory (where themename is the name of the theme). 
See existing theme include files for examples.

The items in a theme .inc file represent those elements that have a different
selector in the theme than the default.

The helper module activeedit_theme_assist is available for generating a stub
theme include file. This module is not included in the stable release of
jstools but is in CVS in the activeedit directory. Install the module and 
visit admin/settings/activeedit_theme_assist to get a stub include file
plus some basic instructions.


File

activeedit/README.txt
View source
  1. Drupal activeedit.module README.txt
  2. ==============================================================================
  3. Provides Ajax-based in place editing and content creation.
  4. Activeedit includes three distinct behaviours:
  5. 1. in place editing.
  6. Editable elements get a clickable button next to them. Clicking brings up an in
  7. place form for editing the single field. Submit, and the updated data are
  8. rendered back in place.
  9. Technical details: Implemented through hook_activeedit_elements(), which returns
  10. an array of elements to attach behaviors to. Elements are identified by their
  11. jQuery selectors, which can be specified by theme (see files in the /themes
  12. directory).
  13. 2. load forms from links
  14. Links, e.g., the "Add new comment" link for nodes, are clickable to load a form (in
  15. this case, the comment add form). Submit and the new item is rendered.
  16. Technical details: Implemented through hook_activeedit_links(), which returns
  17. an array of links to attach behaviors to. Elements are identified by their
  18. text and path elements (e.g., 'comment/reply' for comments).
  19. 3. autocomplete add new record
  20. When there are no matches found for an autocomplete, the user is given the option of
  21. adding a new record. We load a form in place to add a new record. The new record
  22. is assigned the value that was entered but not found in the autocomplete.
  23. There is also a fourth behaviour that's been sketched in but is not ready yet:
  24. 4. edit buttons panel
  25. When hovering over an editable item (e.g., a node), a panel appears with
  26. buttons/elements for accomplishing common tasks, e.g., promote/unpromote,
  27. make sticky, etc.
  28. Requirements
  29. ------------------------------------------------------------------------------
  30. This module is written for Drupal 5.0+ and requires the jstools and formfilter
  31. modules o be enabled.
  32. Implementation details
  33. ------------------------------------------------------------------------------
  34. The approach is different from most in place editing implementations. Activeedit
  35. uses a helper module, Formfilter, to fetch altered versions of the original
  36. forms. That is, when we want to change a setting (e.g., the site name), we fetch
  37. the appropriate settings form via--but alter it so it has only the field we
  38. need. Then we submit that form via AJAX to its normal path.
  39. The key advantage is that we can don't need to reinvent. Permissions/access
  40. issues are already handled. We can use the original forms so we don't need to
  41. replicate them.
  42. Developer Usage
  43. -----------------------------------------------------------------------------
  44. New activeedit behaviours can be easily attached to page elements through
  45. implementations of three activeedit hooks: hook_activeedit_elements() (for
  46. page elements to make editable); hook_activeedit_links() (for links to bring
  47. up forms for adding items); and hook_activeedit_autocompletes() (for
  48. autocomplete elements to enable new item adding for.
  49. See the include files in the 'modules' directory of the activeedit module
  50. for sample implementations.
  51. Theme support for in place editing
  52. ----------------------------------
  53. Activeedit is theme-dependent in that the Javascript needs to be able to
  54. identify which elements to attach to.
  55. Elements are identified by jQuery selectors, see
  56. http://www.jquery.com/DOM/Traversing/Selectors
  57. Each element is given a default selector, but individual themes may or may not
  58. have the same HTML structure as the default.
  59. To add support for a theme, you need to write a themename.inc file and put it
  60. in the module's theme directory (where themename is the name of the theme).
  61. See existing theme include files for examples.
  62. The items in a theme .inc file represent those elements that have a different
  63. selector in the theme than the default.
  64. The helper module activeedit_theme_assist is available for generating a stub
  65. theme include file. This module is not included in the stable release of
  66. jstools but is in CVS in the activeedit directory. Install the module and
  67. visit admin/settings/activeedit_theme_assist to get a stub include file
  68. plus some basic instructions.