You are here

README.txt in Simple Dialog 7

Same filename and directory in other branches
  1. 8 README.txt
# SIMPLE DIALOG #

This module provides a method to load pages via AJAX into a
modal dialog window that will be overlaid on the screen.

The module implements the jquery ui dialog plugin that is
provided with Drupal 7.

## CONFIGURATION ##

The configuration page is at admin/config/content/simple-dialog.

1) Add simple dialog javascript files to all pages.

By Default this option is selected. This option is here in case
you're trying to limit the amount of data loaded on each page load.
If you're not worried about that you can probably just leave this
enabled. A couple things to note if you disable this setting:

- You will need to add the javascript files to the page manually
if you want to implement the "simple-dialog" class method.
- If you are adding simple dialog links to the page using
theme('simple_dialog'...), the necessary
javascript is added within those functions so you should be okay.

2) Additional Classes

This option allows you to specify custom classes that will also be
used to launch a modal. This can be useful if you want to use a simple
class like 'popup' to launch the modal, or perhaps if you're upgrading
a site from d6 that used the automodal module and you just want to
continue using the automodal class instead of changing all your links.

A space-separated list of classes should be provided with no leading
or trailing spaces.

3) Default Dialog Settings

Provide some default settings for the dialog. Defaults should be
formatted the same way as you would in the "rel" tag of the
link (described below under HTML Implementation)

4) Default Target Selector

Provide a default html element id for the target page (the page that
will be pulled into the dialog). This value will be used if no "name"
attribute is provided in a simple dialog link.

5) Default Dialog Title

Provide a default dialog title. This value will be used if no "title"
attribute is provided in a simple dialog link.

## JAVASCRIPT ##

This module doesn't bring javascript files over from
the target page. If your target html needs javascript to work,
You will need to make sure your javascript is either inline in
the html that's being loaded, or in the head tag of the page
you are on.

Additionally, there is a custom javascript event available that gets
triggered after the dialog is loaded. example:

$('#simple-dialog-container').bind('simpleDialogLoaded', function (event) {
  ... do something ...
});

## HTML Implementation ##

Add the class 'simple-dialog' to open links in a dialog
You also need to specify 'name="{selector}"' where the {selector}
is the unique id of the container to load from the linked page,
as well as the title attribute which will act as the dialog title.
Any additional jquery ui dialog options can be passed through
the rel tag using the format:
   rel="{option-name1}:{value1};{option-name2}:{value2};"
NOTE: For the position option, if you want to pass in an array of
xy values, use the syntax [{x},{y}] with no quotes or spaces.

example:

<a href="path/to/target/page/to/load"
   class="id-of-element-on-target-page-to-load"
   rel="width:900;resizable:false;position:[center,60]"
   name="content-area" title="My Dialog Title">Link</a>

The available jquery ui dialog options can be found here:

  http://jqueryui.com/demos/dialog

## THEME Function Implementation ##

You can also implement a simple dialog link using the theme
function: theme('simple_dialog_link', $args) where $args contains
the following values:

$args = array(
  // required
  'text' => 'My Link Text',
  'path' => 'path/to/page/to/load',
  'selector' => 'id-of-container-on-target-page-to-load',
  'title' => 'My Dialog Title',
  // optional
  'options' => array(
    'optionName' => 'optionValue', // examples:
    'width' => 900,
    'resizable' => FALSE,
    'position' => 'center', // Position can be a string or:
    'position' => array(60, 'top') // can be an array of xy values
  ),
  'class' => array('class-name-1', 'class-name-2'),
);

For the 'position' option, the value can be a string or an
array of xy values. Per the jquery ui dialog documentation at
http://jqueryui.com/demos/dialog/#option-position:

Specifies where the dialog should be displayed. Possible values:
1) a single string representing position within viewport:
   'center', 'left', 'right', 'top', 'bottom'.
2) an array containing an x,y coordinate pair in pixel offset
   from left, top corner of viewport (e.g. array(350,100))
3) an array containing x,y position string values
   (e.g. array('right','top') for top right corner).

## EXAMPLES ##

Enable the accompanying module "Simple Dialog Example" to see
some examples. It can be found on the modules page in the
module group: Example Modules

## A NOTE ABOUT INPUT FORMATS ##

If you are adding a link that launches the modal window through
a textfield that uses an input format, the settings supplied in
the "rel" attribute might be stripped. This happens if the 'limit
allowed html tags' options is selected for that input format.

File

README.txt
View source
  1. # SIMPLE DIALOG #
  2. This module provides a method to load pages via AJAX into a
  3. modal dialog window that will be overlaid on the screen.
  4. The module implements the jquery ui dialog plugin that is
  5. provided with Drupal 7.
  6. ## CONFIGURATION ##
  7. The configuration page is at admin/config/content/simple-dialog.
  8. 1) Add simple dialog javascript files to all pages.
  9. By Default this option is selected. This option is here in case
  10. you're trying to limit the amount of data loaded on each page load.
  11. If you're not worried about that you can probably just leave this
  12. enabled. A couple things to note if you disable this setting:
  13. - You will need to add the javascript files to the page manually
  14. if you want to implement the "simple-dialog" class method.
  15. - If you are adding simple dialog links to the page using
  16. theme('simple_dialog'...), the necessary
  17. javascript is added within those functions so you should be okay.
  18. 2) Additional Classes
  19. This option allows you to specify custom classes that will also be
  20. used to launch a modal. This can be useful if you want to use a simple
  21. class like 'popup' to launch the modal, or perhaps if you're upgrading
  22. a site from d6 that used the automodal module and you just want to
  23. continue using the automodal class instead of changing all your links.
  24. A space-separated list of classes should be provided with no leading
  25. or trailing spaces.
  26. 3) Default Dialog Settings
  27. Provide some default settings for the dialog. Defaults should be
  28. formatted the same way as you would in the "rel" tag of the
  29. link (described below under HTML Implementation)
  30. 4) Default Target Selector
  31. Provide a default html element id for the target page (the page that
  32. will be pulled into the dialog). This value will be used if no "name"
  33. attribute is provided in a simple dialog link.
  34. 5) Default Dialog Title
  35. Provide a default dialog title. This value will be used if no "title"
  36. attribute is provided in a simple dialog link.
  37. ## JAVASCRIPT ##
  38. This module doesn't bring javascript files over from
  39. the target page. If your target html needs javascript to work,
  40. You will need to make sure your javascript is either inline in
  41. the html that's being loaded, or in the head tag of the page
  42. you are on.
  43. Additionally, there is a custom javascript event available that gets
  44. triggered after the dialog is loaded. example:
  45. $('#simple-dialog-container').bind('simpleDialogLoaded', function (event) {
  46. ... do something ...
  47. });
  48. ## HTML Implementation ##
  49. Add the class 'simple-dialog' to open links in a dialog
  50. You also need to specify 'name="{selector}"' where the {selector}
  51. is the unique id of the container to load from the linked page,
  52. as well as the title attribute which will act as the dialog title.
  53. Any additional jquery ui dialog options can be passed through
  54. the rel tag using the format:
  55. rel="{option-name1}:{value1};{option-name2}:{value2};"
  56. NOTE: For the position option, if you want to pass in an array of
  57. xy values, use the syntax [{x},{y}] with no quotes or spaces.
  58. example:
  59. class="id-of-element-on-target-page-to-load"
  60. rel="width:900;resizable:false;position:[center,60]"
  61. name="content-area" title="My Dialog Title">Link
  62. The available jquery ui dialog options can be found here:
  63. http://jqueryui.com/demos/dialog
  64. ## THEME Function Implementation ##
  65. You can also implement a simple dialog link using the theme
  66. function: theme('simple_dialog_link', $args) where $args contains
  67. the following values:
  68. $args = array(
  69. // required
  70. 'text' => 'My Link Text',
  71. 'path' => 'path/to/page/to/load',
  72. 'selector' => 'id-of-container-on-target-page-to-load',
  73. 'title' => 'My Dialog Title',
  74. // optional
  75. 'options' => array(
  76. 'optionName' => 'optionValue', // examples:
  77. 'width' => 900,
  78. 'resizable' => FALSE,
  79. 'position' => 'center', // Position can be a string or:
  80. 'position' => array(60, 'top') // can be an array of xy values
  81. ),
  82. 'class' => array('class-name-1', 'class-name-2'),
  83. );
  84. For the 'position' option, the value can be a string or an
  85. array of xy values. Per the jquery ui dialog documentation at
  86. http://jqueryui.com/demos/dialog/#option-position:
  87. Specifies where the dialog should be displayed. Possible values:
  88. 1) a single string representing position within viewport:
  89. 'center', 'left', 'right', 'top', 'bottom'.
  90. 2) an array containing an x,y coordinate pair in pixel offset
  91. from left, top corner of viewport (e.g. array(350,100))
  92. 3) an array containing x,y position string values
  93. (e.g. array('right','top') for top right corner).
  94. ## EXAMPLES ##
  95. Enable the accompanying module "Simple Dialog Example" to see
  96. some examples. It can be found on the modules page in the
  97. module group: Example Modules
  98. ## A NOTE ABOUT INPUT FORMATS ##
  99. If you are adding a link that launches the modal window through
  100. a textfield that uses an input format, the settings supplied in
  101. the "rel" attribute might be stripped. This happens if the 'limit
  102. allowed html tags' options is selected for that input format.