Only in fancybox-orig/fancybox: jquery-1.3.2.min.js Only in fancybox: fancybox.admin.inc diff -urp fancybox-orig/fancybox.info fancybox/fancybox.info --- fancybox-orig/fancybox.info 2009-04-10 15:30:46.000000000 -0400 +++ fancybox/fancybox.info 2009-04-21 16:13:33.000000000 -0400 @@ -1,10 +1,6 @@ -; $Id: fancybox.info,v 1.1.2.1 2009/04/08 14:11:34 fivepoints Exp $ name = jQuery Fancybox -description = Integrates Fancybox into drupal. -dependencies = jquery_update +description = Integrates Fancybox into Drupal. +core = 6.x package = User Interface -; Information added by drupal.org packaging script on 2009-04-10 -version = "5.x-1.1" -project = "fancybox" -datestamp = "1239391846" - +dependencies[] = jquery_update +version = "6.x-1.2" \ No newline at end of file Only in fancybox: fancybox.install diff -urp fancybox-orig/fancybox.module fancybox/fancybox.module --- fancybox-orig/fancybox.module 2009-04-08 10:10:30.000000000 -0400 +++ fancybox/fancybox.module 2009-04-21 16:15:10.000000000 -0400 @@ -1,57 +1,88 @@ variable_get('fancybox_class_id', ''), + 'padding' => variable_get('fancybox_padding', 0), + 'imageScale' => variable_get('fancybox_image_scale', TRUE), + 'zoomOpacity' => variable_get('fancybox_zoom_opacity', TRUE), + 'zoomSpeedIn' => 1000 * _fancybox_fix_zoom_speed('in'), + 'zoomSpeedOut' => 1000 * _fancybox_fix_zoom_speed('out'), + 'zoomSpeedChange' => 1000 * _fancybox_fix_zoom_speed('change'), + 'easingIn' => _fancybox_fix_easing('in'), + 'easingOut' => _fancybox_fix_easing('out'), + 'easingChange' => _fancybox_fix_easing('change'), + 'overlayShow' => variable_get('fancybox_overlay_show', FALSE), + 'overlayOpacity' => variable_get('fancybox_overlay_opacity', 0.8), + 'hideOnContentClick' => variable_get('fancybox_hide_on_content_click', TRUE), + 'centerOnScroll' => variable_get('fancybox_center_on_scroll', TRUE) + ); + + drupal_add_js(array('fancybox' => $js_settings), 'setting'); + drupal_add_js($path . '/js/fancybox.js'); +} /** * Implementation of hook_menu(). */ -function fancybox_menu($may_cache) { - $path = drupal_get_path('module', 'fancybox'); +function fancybox_menu() { $items = array(); - if (!$may_cache) { - if ((variable_get('fancybox_class_id', '')) != '') { - drupal_add_css($path .'/fancybox/jquery.fancybox.css'); - drupal_add_js($path . '/fancybox/jquery.easing.1.3.js'); - drupal_add_js($path . '/fancybox/jquery.fancybox-1.2.1.pack.js'); - drupal_add_js(' - $(document).ready( - function(){ - $("a'.variable_get('fancybox_class_id', '').'").fancybox({ - padding:' . variable_get('fancybox_padding', '0').', - zoomOpacity:' . variable_get('fancybox_zoomopacity', 'true').', - zoomSpeedIn:' . variable_get('fancybox_zoomspeedin', '300').', - zoomSpeedOut:' . variable_get('fancybox_zoomspeedout', '300').', - zoomSpeedChange:' . variable_get('fancybox_zoomspeedchange', '300').', - easingIn:"' . variable_get('fancybox_easingin', 'easeOutBack').'", - easingOut:"' . variable_get('fancybox_easingout', 'easeInBack').'", - overlayShow:' . variable_get('fancybox_overlayshow', 'true').', - overlayOpacity:' . variable_get('fancybox_overlayopacity', '10').', - hideOnContentClick:' . variable_get('fancybox_hideoncontentclick', 'true').' - }); - } - );', 'inline'); - /*drupal_add_js(' - $(document).ready( - function(){ - $("a'.variable_get('fancybox_class_id', '').'") - .fancybox(); - } - );', - 'inline');*/ - } - - $items[] = array( - 'path' => 'admin/settings/fancybox', - 'title' => t('Fancybox'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('fancybox_admin_settings'), - 'access' => user_access('administer fancybox'), - 'description' => t('Settings page fo fancybox.'), - ); - } + + $items['admin/settings/fancybox'] = array( + 'title' => 'Fancybox', + 'description' => 'Allows the user to configure the fancybox settings', + 'file' => 'fancybox.admin.inc', + 'page callback' => 'fancybox_settings_page', + 'access callback' => 'user_access', + 'access arguments' => array('administer fancybox'), + ); + return $items; } @@ -63,69 +94,10 @@ function fancybox_perm() { } /** - * The default fancybox settings page. + * Implementation of hook_init(). */ -function fancybox_admin_settings() { - $form['fancybox']['fancybox_class_id'] = array( - '#type' => 'textfield', - '#title' => t('Css classe or id'), - '#description' => t('The css class or ID to consider for fancybox. Fancybox will insert this value after the tag a.
Example: insert .myimageclass and fancybox will output a.image. Your markup has to be like this: <a ...><img class="myimageclass" ... >.'), - '#default_value' => variable_get('fancybox_class_id', ''), - ); - $form['fancybox']['fancybox_hideoncontentclick'] = array( - '#type' => 'textfield', - '#title' => t('Hide on content click'), - '#description' => t('Hides FancyBox when cliked on opened item (true or false).'), - '#default_value' => variable_get('fancybox_hideoncontentclick', 'true'), - ); - $form['fancybox']['fancybox_padding'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox padding'), - '#default_value' => variable_get('fancybox_padding', '0'), - ); - $form['fancybox']['fancybox_zoomopacity'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox zoom opacity'), - '#default_value' => variable_get('fancybox_zoomopacity', 'true'), - ); - $form['fancybox']['fancybox_zoomspeedin'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox zoom speed in'), - '#default_value' => variable_get('fancybox_zoomspeedin', '300'), - ); - $form['fancybox']['fancybox_zoomspeedout'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox zoom speed out'), - '#default_value' => variable_get('fancybox_zoomspeedout', '300'), - ); - $form['fancybox']['fancybox_zoomspeedchange'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox zoom speed change'), - '#description' => t('Speed in miliseconds of the animation when changing gallery items.'), - '#default_value' => variable_get('fancybox_zoomspeedchange', '300'), - ); - $form['fancybox']['fancybox_easingin'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox zoom speed change'), - '#description' => t('Easing used for animations. Insert easeOutBack or none.'), - '#default_value' => variable_get('fancybox_easingin', 'easeOutBack'), - ); - $form['fancybox']['fancybox_easingout'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox zoom speed change'), - '#description' => t('Easing used for animations. Insert easeInBack or none.'), - '#default_value' => variable_get('fancybox_easingout', 'easeInBack'), - ); - $form['fancybox']['fancybox_overlayshow'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox overlay show'), - '#default_value' => variable_get('fancybox_overlayshow', 'true'), - ); - $form['fancybox']['fancybox_overlayopacity'] = array( - '#type' => 'textfield', - '#title' => t('Fancybox overlay opacity'), - '#default_value' => variable_get('fancybox_overlayopacity', '10'), - ); - - return system_settings_form($form); +function fancybox_init() { + if ((variable_get('fancybox_class_id', '')) != '') { + fancybox_add_files(); + } } \ No newline at end of file Only in fancybox: js