The jQuery Alerts plugin provides a set of methods for an inline, customizable way to show JavaScript alerts, confirmations, and prompts. I recommend this plugin is added to jQuery plugins.

I have a new version of Contrib Toggle module that is ready to be released, which relies on jQuery Alerts. Rather than simply bundle it with my module, I am keen to do the right thing and include it here. I would be glad of an early commit, however, so that I can release the significantly improved version of that module.

Attached is two patches:

  • For jquery_plugin.jq.inc: to add the required information for a new plugin.
  • For jquery_plugin.module.diff: Although theoretically jQuery plugins already supported loading of CSS files for jQuery plugins (they could at least be reported to jQ in jquery_plugin.jq.inc) this had not previously been implemented in jquery_plugin_add. The attached patch corrects that.

Also attached is a tar.gz that contains the yuicompressor reduced version of jquery.alerts.js, the jquery.alerts.css file, and the images directory that is required by the jquery.alerts.css file. These files and the images directory need to be placed in the jquery_plugin folder to function correctly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

babbage’s picture

Note also jQuery Alerts has been released under the GPL.

babbage’s picture

Hmm—I am having second thoughts about this. There are namespace issues with the original module, which might make it inappropriate to include without at least some tweaking, and obviously that's not the point. I will bring that to the attention of the developer. In terms of my needs for my own module, I have now clarified on IRC that it is perfectly fine for me to re-tool the half of his code that would do what I need and include it in the Drupal CVS as it was released under the GPL, so that's what I plan to do at this stage so Contrib Toggle does not have to have any dependencies.

I'd still recommend the module patch I submitted is committed, since at some point a jQuery plugin that is included will have css files and presumably the module intends to support that.

mfb’s picture

Status: Needs review » Needs work

I don't think the CSS part of this patch will work, because it will try to include a nonexistent CSS file for plugins that don't have a CSS file.