franck@0: As well as attaching popup behavior to links, franck@0: Popups API provides javascript function for creating in-window popup messages. franck@0: franck@0: Popups.message(title, message) franck@0: Produces a simple modal box with the title, message and "OK", "Cancel" buttons. franck@0: franck@0: Popups.open(title, body, buttons, width) franck@0: More powerful, allows you to specify what the buttons are and what they do. franck@0: buttons is a hash of hash, with button title and function. franck@0: * Example: franck@0: Drupal.popups.open( franck@0: Drupal.t('Warning: Please Confirm'), franck@0: Drupal.t("There are unsaved changes on this page, which you will lose if you continue."), franck@0: { franck@0: 'popup_save': { franck@0: title: Drupal.t('Save Changes'), franck@0: func: function(){Drupal.popups.savePage(element, options);} franck@0: }, franck@0: 'popup_submit': { franck@0: title: Drupal.t('Continue'), franck@0: func: function(){Drupal.popups.removePopup(); Drupal.popups.openPath(element, options);} franck@0: }, franck@0: 'popup_cancel': { franck@0: title: Drupal.t('Cancel'), func: Drupal.popups.close; franck@0: } franck@0: } franck@0: ); franck@0: franck@0: // TODO - make a more useful api function for opening a path. franck@0: Popups.openPath = function(element, options, parent) franck@0: * @param element franck@0: * Element that was clicked to open the popups. franck@0: * @param options franck@0: * Hash of options controlling how the popups interacts with the underlying page. franck@0: * @param parent franck@0: * If path is being opened from inside another popup, that popup is the parent. franck@0: