summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--feeds_ui/feeds_ui.admin.inc3
-rw-r--r--feeds_ui/feeds_ui.js17
-rw-r--r--plugins/FeedsHTTPFetcher.inc4
3 files changed, 6 insertions, 18 deletions
diff --git a/feeds_ui/feeds_ui.admin.inc b/feeds_ui/feeds_ui.admin.inc
index c9c5f2d..93ea385 100644
--- a/feeds_ui/feeds_ui.admin.inc
+++ b/feeds_ui/feeds_ui.admin.inc
@@ -296,7 +296,8 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
$active_container['body'] = drupal_get_form('feeds_ui_plugin_form', $importer, $active);
break;
case 'settings':
- drupal_add_js(drupal_get_path('module', 'feeds_ui') .'/feeds_ui.js');
+ drupal_add_js(drupal_get_path('module', 'ctools') .'/js/dependent.js');
+ ctools_include('dependent');
if (empty($plugin_key)) {
$active_container['title'] = t('Basic settings');
$active_container['body'] = feeds_get_config_form($importer);
diff --git a/feeds_ui/feeds_ui.js b/feeds_ui/feeds_ui.js
index 650b650..9908320 100644
--- a/feeds_ui/feeds_ui.js
+++ b/feeds_ui/feeds_ui.js
@@ -87,21 +87,4 @@ Drupal.behaviors.feeds = function() {
$('#' + $(this).attr('id')).attr('checked', 1);
$('input.form-submit.feeds-ui-hidden-submit').click();
});
-
- // Show pubsub settings conditionally.
- // @todo Generalize dependencies between form elements.
- if ($('#edit-use-pubsubhubbub').attr('checked')) {
- $('#edit-designated-hub-wrapper').show();
- }
- else {
- $('#edit-designated-hub-wrapper').hide();
- }
- $('#edit-use-pubsubhubbub').click(function() {
- if ($(this).attr('checked')) {
- $('#edit-designated-hub-wrapper').show(100);
- }
- else {
- $('#edit-designated-hub-wrapper').hide(100);
- }
- });
};
diff --git a/plugins/FeedsHTTPFetcher.inc b/plugins/FeedsHTTPFetcher.inc
index d55d2b8..2cccc9b 100644
--- a/plugins/FeedsHTTPFetcher.inc
+++ b/plugins/FeedsHTTPFetcher.inc
@@ -122,6 +122,10 @@ class FeedsHTTPFetcher extends FeedsFetcher {
'#title' => t('Designated hub'),
'#description' => t('Enter the URL of a designated PubSubHubbub hub (e. g. superfeedr.com). If given, this hub will be used instead of the hub specified in the actual feed.'),
'#default_value' => $this->config['designated_hub'],
+ '#process' => array('ctools_dependent_process'),
+ '#dependency' => array(
+ 'edit-use-pubsubhubbub' => array(1),
+ ),
);
return $form;
}