From 89a2e004b2a201433b9fefd556814a6a37bdff85 Sun, 17 Apr 2011 11:49:12 +0200 From: Bram Goffings Date: Sun, 17 Apr 2011 11:49:04 +0200 Subject: [PATCH] colorbox Signed-off-by: Bram Goffings diff --git a/fullcalendar.module b/fullcalendar.module index a0930d7..5efbcde 100644 --- a/fullcalendar.module +++ b/fullcalendar.module @@ -164,6 +164,9 @@ 'weekMode' => $options['display']['fc_weekmode'], 'theme' => $options['modules']['fc_theme'], 'colorbox' => $options['modules']['fc_url_colorbox'], + 'colorboxClass' => $options['modules']['fc_url_colorbox_class'], + 'colorboxWidth' => $options['modules']['fc_url_colorbox_width'], + 'colorboxHeight' => $options['modules']['fc_url_colorbox_height'], 'left' => $options['header']['fc_left'], 'center' => $options['header']['fc_center'], 'right' => $options['header']['fc_right'], diff --git a/fullcalendar.views.js b/fullcalendar.views.js index 8e6dd25..4c7052b 100644 --- a/fullcalendar.views.js +++ b/fullcalendar.views.js @@ -19,7 +19,15 @@ if (settings.colorbox) { // Open in colorbox if exists, else open in new window. if ($.colorbox) { - $.colorbox({href:calEvent.url, iframe:true, width:'80%', height:'80%'}); + var url = calEvent.url; + if(settings.colorboxClass !== '') { + url += ' ' + settings.colorboxClass; + } + $.colorbox({ + href: url, + width: settings.colorboxWidth, + height: settings.colorboxHeight + }); } else { window.open(calEvent.url); } diff --git a/views_plugin_style_fullcalendar.inc b/views_plugin_style_fullcalendar.inc index 2c5130a..7666cfb 100644 --- a/views_plugin_style_fullcalendar.inc +++ b/views_plugin_style_fullcalendar.inc @@ -19,6 +19,9 @@ 'contains' => array( 'fc_theme' => array('default' => FALSE), 'fc_url_colorbox' => array('default' => FALSE), + 'fc_url_colorbox_class' => array('default' => '#content'), + 'fc_url_colorbox_width' => array('default' => '80%'), + 'fc_url_colorbox_height' => array('default' => '80%') ), ); $options['header'] = array( @@ -170,6 +173,27 @@ '#title' => t('Open events in colorbox'), '#default_value' => $this->options['modules']['fc_url_colorbox'], ); + $form['modules']['fc_url_colorbox_class'] = array( + '#type' => 'textfield', + '#title' => t('Classname or ID selector'), + '#default_value' => $this->options['modules']['fc_url_colorbox_class'], + '#process' => array('views_process_dependency'), + '#dependency' => array('edit-style-options-modules-fc-url-colorbox' => array(1)), + ); + $form['modules']['fc_url_colorbox_width'] = array( + '#type' => 'textfield', + '#title' => t('Width'), + '#default_value' => $this->options['modules']['fc_url_colorbox_width'], + '#process' => array('views_process_dependency'), + '#dependency' => array('edit-style-options-modules-fc-url-colorbox' => array(1)), + ); + $form['modules']['fc_url_colorbox_height'] = array( + '#type' => 'textfield', + '#title' => t('Height'), + '#default_value' => $this->options['modules']['fc_url_colorbox_height'], + '#process' => array('views_process_dependency'), + '#dependency' => array('edit-style-options-modules-fc-url-colorbox' => array(1)), + ); } } }