From febae6c17c6a57814916d8148b28b6f2dd17cfb3 Mon Sep 17 00:00:00 2001 From: Marco Antonio Villegas Vega Date: Tue, 16 Feb 2010 23:45:54 -0500 Subject: [PATCH 2/2] popup for denied access --- vud.js | 15 +++++++++++++++ vud.theme.inc | 1 + 2 files changed, 16 insertions(+), 0 deletions(-) create mode 100644 vud.js diff --git a/vud.js b/vud.js new file mode 100644 index 0000000..25740a6 --- /dev/null +++ b/vud.js @@ -0,0 +1,15 @@ +// $Id$ +/** + * @file + * + * Various customizations for all widgets. + */ + +Drupal.behaviors.vudUpdownWidget = function () { + $('.vud-widget-updown .up-active,.vud-widget-updown .up-inactive,.vud-widget-updown .down-active,.vud-widget-updown .down-inactive').click(function () { + if ($(this).hasClass('denied')) { + alert(Drupal.settings.vud_node.widget_message); + return false; + } + }); +} diff --git a/vud.theme.inc b/vud.theme.inc index 1ca3776..94fe937 100644 --- a/vud.theme.inc +++ b/vud.theme.inc @@ -89,6 +89,7 @@ function vud_widget_proxy($cid, $type, $tag, $widget_theme, $readonly=NULL) { $uid = votingapi_current_user_identifier(); ctools_add_js('ajax-responder'); + drupal_add_js(drupal_get_path('module', 'vud') . '/vud.js'); vud_add_files('css', $plugin); // Search and add the CSS files. vud_add_files('js', $plugin); // Search and add the JS files. -- 1.6.6.1