Commit 0dff053a authored by frjo's avatar frjo
Browse files

#955868: #921206: Porting over the new style by zoo33 / Sthlmconnection.se and...

#955868: #921206: Porting over the new style by zoo33 / Sthlmconnection.se and the inline feature from 6-dev.
parent 5c678c5e
......@@ -97,18 +97,22 @@ function colorbox_admin_settings() {
'#description' => t('Select which form to use for login.'),
);
$form['colorbox_load_settings'] = array(
$form['colorbox_extra_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Load in Colorbox'),
'#collapsible' => TRUE,
'#collapsed' => TRUE
'#title' => t('Extra settings'),
);
$form['colorbox_load_settings']['colorbox_load'] = array(
$form['colorbox_extra_settings']['colorbox_load'] = array(
'#type' => 'checkbox',
'#title' => t('Enable Colorbox load'),
'#default_value' => variable_get('colorbox_load', 0),
'#description' => t('This enables custom links that can open forms and paths in a Colorbox. Add the class "colorbox-load" to the link and build the url like this for forms "/colorbox/form/[form_id]?width=500&height=500" and like this for paths "[path]?width=500&height=500&iframe=true". If you do not want the box to persist set iframe to false. Other modules may activate this for easy Colorbox integration.'),
);
$form['colorbox_extra_settings']['colorbox_inline'] = array(
'#type' => 'checkbox',
'#title' => t('Enable Colorbox inline'),
'#default_value' => variable_get('colorbox_inline', 0),
'#description' => t('This enables custom links that can open inline content in a Colorbox. Add the class "colorbox-inline" to the link and build the url like this "?width=500&height=500&inline=true#id-of-content". Other modules may activate this for easy Colorbox integration.'),
);
$form['colorbox_custom_settings'] = array(
'#type' => 'fieldset',
......@@ -118,6 +122,7 @@ function colorbox_admin_settings() {
);
$colorbox_styles = array(
'default' => t('Default'),
'stockholmsyndrome' => t('Stockholm Syndrome'),
$colorbox_path . '/example1' => t('Example 1'),
$colorbox_path . '/example2' => t('Example 2'),
$colorbox_path . '/example3' => t('Example 3'),
......
......@@ -216,17 +216,6 @@ function _colorbox_doheader() {
$data['__drupal_alter_by_ref'] = array(&$style);
drupal_alter('colorbox_settings', $data);
// Add CSS based on selected style.
switch ($style) {
case 'none':
break;
case 'default':
drupal_add_css($path .'/styles/default/colorbox_default_style.css');
break;
default:
drupal_add_css($style .'/colorbox.css');
}
drupal_add_js(array('colorbox' => $js_settings), array('type' => 'setting', 'scope' => JS_DEFAULT));
if (module_exists('image') && variable_get('colorbox_auto_image_nodes', 0)) {
......@@ -239,17 +228,34 @@ function _colorbox_doheader() {
}
}
// Add and initialise the Colorbox plugin.
drupal_add_js(colorbox_get_path());
drupal_add_js($path . '/js/colorbox.js');
if ($style == 'default') {
drupal_add_js($path . '/styles/default/colorbox_default_style.js');
// Add JS and CSS based on selected style.
switch ($style) {
case 'none':
break;
case 'default':
drupal_add_css($path . '/styles/default/colorbox_default_style.css');
drupal_add_js($path . '/styles/default/colorbox_default_style.js');
break;
case 'stockholmsyndrome':
drupal_add_css($path . '/styles/stockholmsyndrome/colorbox_stockholmsyndrome.css');
drupal_add_js($path . '/styles/stockholmsyndrome/colorbox_stockholmsyndrome.js');
break;
default:
drupal_add_css($style . '/colorbox.css');
}
if (variable_get('colorbox_load', 0)) {
drupal_add_js($path . '/js/colorbox_load.js');
}
if (variable_get('colorbox_inline', 0)) {
drupal_add_js($path . '/js/colorbox_inline.js');
}
if ($GLOBALS['user']->uid == 0 && variable_get('colorbox_login', 0)) {
drupal_add_js($path . '/js/colorbox_login.js');
}
......
/* $Id$ */
/*
ColorBox Core Style
The following rules are the styles that are consistant between themes.
Avoid changing this area to maintain compatability with future versions of ColorBox.
*/
#colorbox, #cboxOverlay, #cboxWrapper {
position: absolute;
top: 0;
left: 0;
z-index: 9999;
overflow: hidden;
}
#colorbox {
background: url(images/bg_tab.png) -49px -50px repeat-x #000;
}
#colorbox, #colorbox div {
overflow: visible; /* Required by the close button. */
}
#cboxOverlay {
position: fixed;
width: 100%;
height: 100%;
}
#cboxMiddleLeft, #cboxBottomLeft {
clear: left;
}
#cboxContent {
position: relative;
overflow: hidden;
}
#cboxLoadedContent {
overflow: auto;
}
#cboxLoadedContent iframe {
display: block;
border: 0;
}
#cboxTitle {
margin: 0;
}
#cboxLoadingOverlay, #cboxLoadingGraphic {
position: absolute;
top: 0;
left: 0;
width: 100%;
}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow {
cursor: pointer;
}
/*
ColorBox example user style
The following rules are ordered and tabbed in a way that represents the
order/nesting of the generated HTML, so that the structure easier to understand.
*/
#cboxOverlay {
background: #000;
opacity: 0.4 !important;
}
#colorbox {
background: #fff url(images/bg_tab.png) center bottom repeat-x;
box-shadow: 3px 3px 16px #333;
-moz-box-shadow: 3px 3px 16px #333;
-webkit-box-shadow: 3px 3px 16px #333;
border-bottom-left-radius: 9px;
border-bottom-right-radius: 9px;
-moz-border-radius-bottomleft: 9px;
-moz-border-radius-bottomright: 9px;
-webkit-border-bottom-left-radius: 9px;
-webkit-border-bottom-right-radius: 9px;
}
#cboxWrapper {
border-bottom-left-radius: 9px;
border-bottom-right-radius: 9px;
-moz-border-radius-bottomleft: 9px;
-moz-border-radius-bottomright: 9px;
-webkit-border-bottom-left-radius: 9px;
-webkit-border-bottom-right-radius: 9px;
}
#cboxTopLeft {
width: 0px;
height: 0px;
}
#cboxTopCenter {
height: 0px;
}
#cboxTopRight {
width: 0px;
height: 0px;
}
#cboxBottomLeft {
width: 15px;
height: 10px;
}
#cboxBottomCenter {
height: 10px;
}
#cboxBottomRight {
width: 15px;
height: 10px;
}
#cboxMiddleLeft {
width: 0px;
}
#cboxMiddleRight {
width: 0px;
}
#cboxContent {
background: #fff;
font: 11px Arial, sans-serif;
margin-bottom: 28px;
}
#cboxLoadedContent {
}
#cboxTitle {
left: 0;
height: 38px;
color: #313131;
padding: 0 140px 0 15px;
display: table-cell;
vertical-align: middle;
}
#cboxCurrent {
position: absolute;
bottom: -26px;
right: 80px;
color: #313131;
border-left:1px solid #313131;
padding:0 0 0 15px;
}
/* Slideshow not implemented. */
.cboxSlideshow_on #cboxSlideshow {
display: none;
}
.cboxSlideshow_on #cboxSlideshow.hover {
}
.cboxSlideshow_off #cboxSlideshow {
display: none;
}
.cboxSlideshow_off #cboxSlideshow.hover {
}
#cboxPrevious {
position: absolute;
bottom: -26px;
right: 45px;
background: url(images/controls.png) 0 -48px no-repeat;
width: 21px;
height: 15px;
text-indent: -9999px;
}
#cboxPrevious.hover {
background-position: 0 -111px;
}
#cboxNext {
position: absolute;
bottom: -26px;
right: 15px;
background: url(images/controls.png) 0 -29px no-repeat;
width: 21px;
height: 15px;
text-indent: -9999px;
}
#cboxNext.hover {
background-position: 0 -92px;
}
#cboxLoadingOverlay {
background: #E6E6E6;
}
#cboxLoadingGraphic {
background: url(images/loading_animation.gif) center center no-repeat;
}
#cboxClose {
position: absolute;
bottom: 0;
right: -10px;
top: -10px;
background: url(images/controls.png) 0px 0px no-repeat;
width: 25px;
height: 25px;
text-indent: -9999px;
opacity: 0;
}
#cboxClose.hover {
background-position: 0 -63px;
}
/* The following are fixes for IE. */
.cboxIE #cboxTitle {
background: #fff;
}
// $Id$
(function ($) {
Drupal.behaviors.initColorboxDefaultStyle = function (context) {
$(document).bind('cbox_open', function() {
// Hide close button initially.
$('#cboxClose').css('opacity', 0);
});
$(document).bind('cbox_load', function() {
// Hide close button. (It doesn't handle the load animation well.)
$('#cboxClose').css('opacity', 0);
});
$(document).bind('cbox_complete', function() {
// Show close button with a delay.
$('#cboxClose').fadeTo('fast', 0, function() {$(this).css('opacity', 1)});
});
};
})(jQuery);
......@@ -120,7 +120,7 @@ class colorbox_handler_field_colorbox extends views_handler_field {
*/
function render($values) {
// Load the necessary js file for Colorbox activation.
if (_colorbox_active()) {
if (_colorbox_active() && !variable_get('colorbox_inline', 0)) {
drupal_add_js(drupal_get_path('module', 'colorbox') . '/js/colorbox_inline.js');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment