jquery_plugin.module in jQuery plugins 5
File
jquery_plugin.module
View source
<?php
function jquery_plugin_add($plugin) {
static $plugins = array();
if (!isset($plugins[$plugin])) {
drupal_add_js(drupal_get_path('module', 'jquery_plugin') . '/jquery.' . $plugin . '.min.js');
$plugins[$plugin] = TRUE;
}
}
function jquery_plugin_jq($op, $plugin = NULL) {
if ($op == 'info') {
$path = drupal_get_path('module', 'jquery_plugin');
return array(
'metadata' => array(
'name' => t('Metadata'),
'description' => t('This plugin is capable of extracting metadata from classes, random attributes, and child elements.'),
'version' => '1.0',
'url' => 'http://plugins.jquery.com/project/metadata',
'files' => array(
'js' => array(
$path . '/jquery.metadata.min.js',
),
),
),
'validate' => array(
'name' => t('Validate'),
'description' => t('Setup powerful client-side form validation. From a protoype in a few minutes to heavily customized validation rules, methods and messages.'),
'version' => '1.1.1',
'url' => 'http://plugins.jquery.com/project/validate',
'files' => array(
'js' => array(
$path . '/jquery.validate.min.js',
),
),
),
);
}
}