Commit e54724ee authored by frjo's avatar frjo
Browse files

Adding a new plain style.

parent 1616b210
......@@ -75,6 +75,7 @@ function colorbox_admin_settings() {
);
$colorbox_styles = array(
'default' => t('Default'),
'plain' => t('Plain'),
'stockholmsyndrome' => t('Stockholm Syndrome'),
$library['library path'] . '/example1' => t('Example 1'),
$library['library path'] . '/example2' => t('Example 2'),
......@@ -163,14 +164,14 @@ function colorbox_admin_settings() {
$form['colorbox_custom_settings']['colorbox_maxwidth'] = array(
'#type' => 'textfield',
'#title' => t('Max width'),
'#default_value' => variable_get('colorbox_maxwidth', '100%'),
'#default_value' => variable_get('colorbox_maxwidth', '98%'),
'#size' => 30,
'#description' => t('Set a maximum width for loaded content. Example: "100%", 500, "500px".'),
);
$form['colorbox_custom_settings']['colorbox_maxheight'] = array(
'#type' => 'textfield',
'#title' => t('Max height'),
'#default_value' => variable_get('colorbox_maxheight', '100%'),
'#default_value' => variable_get('colorbox_maxheight', '98%'),
'#size' => 30,
'#description' => t('Set a maximum height for loaded content. Example: "100%", 500, "500px".'),
);
......@@ -184,7 +185,7 @@ function colorbox_admin_settings() {
$form['colorbox_custom_settings']['colorbox_initialheight'] = array(
'#type' => 'textfield',
'#title' => t('Initial height'),
'#default_value' => variable_get('colorbox_initialheight', '100'),
'#default_value' => variable_get('colorbox_initialheight', '250'),
'#size' => 30,
'#description' => t('Set the initial height, prior to any content being loaded. Example: "100%", 500, "500px".'),
);
......
......@@ -183,10 +183,10 @@ function _colorbox_doheader() {
'next' => variable_get('colorbox_text_next', 'Next »'),
'close' => variable_get('colorbox_text_close', 'Close'),
'overlayClose' => variable_get('colorbox_overlayclose', 1) ? TRUE : FALSE,
'maxWidth' => variable_get('colorbox_maxwidth', '100%'),
'maxHeight' => variable_get('colorbox_maxheight', '100%'),
'maxWidth' => variable_get('colorbox_maxwidth', '98%'),
'maxHeight' => variable_get('colorbox_maxheight', '98%'),
'initialWidth' => variable_get('colorbox_initialwidth', '300'),
'initialHeight' => variable_get('colorbox_initialheight', '100'),
'initialHeight' => variable_get('colorbox_initialheight', '250'),
'fixed' => variable_get('colorbox_fixed', 1) ? TRUE : FALSE,
'scrolling' => variable_get('colorbox_scrolling', 1) ? TRUE : FALSE,
);
......@@ -198,8 +198,8 @@ function _colorbox_doheader() {
'previous' => t('« Prev'),
'next' => t('Next »'),
'close' => t('Close'),
'maxWidth' => '100%',
'maxHeight' => '100%',
'maxWidth' => '98%',
'maxHeight' => '98%',
'fixed' => TRUE,
);
}
......@@ -223,12 +223,10 @@ function _colorbox_doheader() {
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 'plain':
case 'stockholmsyndrome':
drupal_add_css($path . '/styles/stockholmsyndrome/colorbox_stockholmsyndrome.css');
drupal_add_js($path . '/styles/stockholmsyndrome/colorbox_stockholmsyndrome.js');
drupal_add_css($path . '/styles/' . $style . '/colorbox_style.css');
drupal_add_js($path . '/styles/' . $style . '/colorbox_style.js');
break;
default:
drupal_add_css($style . '/colorbox.css');
......
/**
* ColorBox Core Style:
* The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper {
position: absolute;
top: 0;
left: 0;
z-index: 9999;
overflow: hidden;
}
#cboxOverlay {
position: fixed;
width: 100%;
height: 100%;
}
#cboxMiddleLeft, #cboxBottomLeft {
clear: left;
}
#cboxContent {
position: relative;
}
#cboxLoadedContent {
overflow: auto;
}
#cboxTitle {
margin: 0;
}
#cboxLoadingOverlay, #cboxLoadingGraphic {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow {
cursor: pointer;
}
.cboxPhoto {
float: left;
margin: auto;
border: 0;
display: block;
max-width: none;
}
.cboxIframe {
width: 100%;
height: 100%;
display: block;
border: 0;
}
#colorbox, #cboxContent, #cboxLoadedContent {
box-sizing: content-box;
}
/**
* Colorbox module plain style:
* The styles are ordered & tabbed in a way that represents
* the nesting of the generated HTML.
*/
#cboxOverlay {
background: #000;
}
#colorBox {}
#cboxWrapper {}
#cboxContent {
overflow: hidden;
font: 12px "Lucida Grande", Verdana, Arial, sans-serif;
}
.cboxPhoto {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#cboxError {
padding: 50px;
border: 1px solid #ccc;
}
#cboxTitle {
position: absolute;
background: rgba(255, 255, 255, 0.7);
bottom: 0;
left: 0;
color: #535353;
width: 100%;
padding: 4px 6px;
box-sizing: border-box;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
#cboxLoadingOverlay {
background: #fff;
}
#cboxLoadingGraphic {
background: url(images/loading_animation.gif) center center no-repeat;
}
(function ($) {
Drupal.behaviors.initColorboxPlainStyle = {
attach: function (context, settings) {
$(document).bind('cbox_complete', function () {
// Make all the controls invisible.
$('#cboxCurrent, #cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose', context).addClass('element-invisible');
// Only run if there is a title.
if ($('#cboxTitle:empty', context).length == false) {
setTimeout(function () { $('#cboxTitle', context).slideUp() }, 1500);
$('#cboxLoadedContent img', context).bind('mouseover', function () {
$('#cboxTitle', context).slideDown();
});
$('#cboxOverlay', context).bind('mouseover', function () {
$('#cboxTitle', context).slideUp();
});
}
else {
$('#cboxTitle', context).hide();
}
});
}
};
})(jQuery);
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