Révision 91f42c9e
Ajouté par Assos Assos il y a presque 10 ans
drupal7/sites/all/modules/colorbox/colorbox.info | ||
---|---|---|
6 | 6 |
|
7 | 7 |
files[] = views/colorbox_handler_field_colorbox.inc |
8 | 8 |
|
9 |
; Information added by packaging script on 2013-11-30
|
|
10 |
version = "7.x-2.5"
|
|
9 |
; Information added by Drupal.org packaging script on 2014-05-28
|
|
10 |
version = "7.x-2.6"
|
|
11 | 11 |
core = "7.x" |
12 | 12 |
project = "colorbox" |
13 |
datestamp = "1385815706"
|
|
13 |
datestamp = "1401278628"
|
|
14 | 14 |
|
drupal7/sites/all/modules/colorbox/colorbox.make | ||
---|---|---|
1 | 1 |
core = 7.x |
2 | 2 |
api = 2 |
3 | 3 |
|
4 |
libraries[colorbox][type] = "libraries" |
|
4 | 5 |
libraries[colorbox][download][type] = "file" |
5 | 6 |
libraries[colorbox][download][url] = "https://github.com/jackmoore/colorbox/archive/1.x.zip" |
6 | 7 |
libraries[colorbox][directory_name] = "colorbox" |
drupal7/sites/all/modules/colorbox/colorbox.module | ||
---|---|---|
44 | 44 |
'node' => NULL, // Left for legacy support. |
45 | 45 |
'field' => array(), |
46 | 46 |
'display_settings' => array(), |
47 |
'delta' => null, |
|
47 | 48 |
), |
48 | 49 |
'file' => 'colorbox.theme.inc', |
49 | 50 |
), |
... | ... | |
256 | 257 |
'field types' => array('image'), |
257 | 258 |
'settings' => array( |
258 | 259 |
'colorbox_node_style' => '', |
260 |
'colorbox_node_style_first' => '', |
|
259 | 261 |
'colorbox_image_style' => '', |
260 | 262 |
'colorbox_gallery' => 'post', |
261 | 263 |
'colorbox_gallery_custom' => '', |
... | ... | |
285 | 287 |
'#options' => $image_styles_hide, |
286 | 288 |
'#description' => t('Image style to use in the content.'), |
287 | 289 |
); |
290 |
$element['colorbox_node_style_first'] = array( |
|
291 |
'#title' => t('Content image style for first image'), |
|
292 |
'#type' => 'select', |
|
293 |
'#default_value' => $settings['colorbox_node_style_first'], |
|
294 |
'#empty_option' => t('No special style.'), |
|
295 |
'#options' => $image_styles, |
|
296 |
'#description' => t('Image style to use in the content for the first image.'), |
|
297 |
); |
|
288 | 298 |
$element['colorbox_image_style'] = array( |
289 | 299 |
'#title' => t('Colorbox image style'), |
290 | 300 |
'#type' => 'select', |
... | ... | |
386 | 396 |
* Validate function for colorbox_gallery_custom. |
387 | 397 |
*/ |
388 | 398 |
function colorbox_gallery_custom_validate($element, &$form_state) { |
389 |
if ($element['#value'] != drupal_html_class($element['#value'])) {
|
|
399 |
if ($form_state['values']['fields']['field_image']['settings_edit_form']['settings']['colorbox_gallery'] == 'custom' && !preg_match('!^[a-z0-9_-]+$!', $element['#value'])) {
|
|
390 | 400 |
form_error($element, t('%name must only contain lowercase letters, numbers, hyphen and underscores.', array('%name' => $element['#title']))); |
391 | 401 |
} |
392 | 402 |
} |
... | ... | |
415 | 425 |
$summary[] = t('Content image style: Original image'); |
416 | 426 |
} |
417 | 427 |
|
428 |
if (isset($image_styles[$settings['colorbox_node_style_first']])) { |
|
429 |
$summary[] = t('Content image style of first image: @style', array('@style' => $image_styles[$settings['colorbox_node_style_first']])); |
|
430 |
} |
|
431 |
|
|
418 | 432 |
if (isset($image_styles[$settings['colorbox_image_style']])) { |
419 | 433 |
$summary[] = t('Colorbox image style: @style', array('@style' => $image_styles[$settings['colorbox_image_style']])); |
420 | 434 |
} |
... | ... | |
466 | 480 |
'#node' => $entity, // Left for legacy support. |
467 | 481 |
'#field' => $field, |
468 | 482 |
'#display_settings' => $display['settings'], |
483 |
'#delta' => $delta, |
|
469 | 484 |
); |
470 | 485 |
} |
471 | 486 |
} |
... | ... | |
479 | 494 |
function colorbox_insert_styles() { |
480 | 495 |
$insert_styles = array(); |
481 | 496 |
foreach (image_styles() as $key => $style) { |
482 |
$insert_styles['colorbox__' . $key] = array('label' => t('Colorbox @style', array('@style' => $style['name']))); |
|
497 |
$label = isset($style['label']) ? $style['label'] : $style['name']; |
|
498 |
$insert_styles['colorbox__' . $key] = array('label' => t('Colorbox @style', array('@style' => $label))); |
|
483 | 499 |
} |
484 | 500 |
|
485 | 501 |
return $insert_styles; |
drupal7/sites/all/modules/colorbox/colorbox.theme.inc | ||
---|---|---|
30 | 30 |
'style_name' => $settings['colorbox_node_style'], |
31 | 31 |
); |
32 | 32 |
|
33 |
if ($variables['delta'] == 0 && !empty($settings['colorbox_node_style_first'])) { |
|
34 |
$image['style_name'] = $settings['colorbox_node_style_first']; |
|
35 |
} |
|
36 |
|
|
33 | 37 |
if (isset($item['width']) && isset($item['height'])) { |
34 | 38 |
$image['width'] = $item['width']; |
35 | 39 |
$image['height'] = $item['height']; |
36 | 40 |
} |
37 | 41 |
|
42 |
if (isset($item['attributes'])) { |
|
43 |
$image['attributes'] = $item['attributes']; |
|
44 |
} |
|
45 |
|
|
38 | 46 |
$entity_title = entity_label($entity_type, $entity); |
39 | 47 |
|
40 | 48 |
switch ($settings['colorbox_caption']) { |
... | ... | |
153 | 161 |
* Preprocess variables for the colorbox-insert-image.tpl.php file. |
154 | 162 |
*/ |
155 | 163 |
function template_preprocess_colorbox_insert_image(&$variables) { |
156 |
$variables['file'] = file_load($variables['item']['fid']); |
|
157 |
$variables['style_name'] = $variables['item']['style_name']; |
|
158 |
$variables['width'] = $variables['item']['width']; |
|
159 |
$variables['height'] = $variables['item']['height']; |
|
164 |
$item = $variables['item']; |
|
165 |
$variables['file'] = file_load($item['fid']); |
|
166 |
$variables['style_name'] = $item['style_name']; |
|
167 |
$variables['width'] = isset($item['width']) ? $item['width'] : NULL; |
|
168 |
$variables['height'] = isset($item['height']) ? $item['height'] : NULL; |
|
160 | 169 |
|
161 | 170 |
// Determine dimensions of the image after the image style transformations. |
162 | 171 |
image_style_transform_dimensions($variables['style_name'], $variables); |
drupal7/sites/all/modules/colorbox/js/colorbox.js | ||
---|---|---|
8 | 8 |
|
9 | 9 |
if (settings.colorbox.mobiledetect && window.matchMedia) { |
10 | 10 |
// Disable Colorbox for small screens. |
11 |
mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); |
|
11 |
var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
|
|
12 | 12 |
if (mq.matches) { |
13 | 13 |
return; |
14 | 14 |
} |
... | ... | |
17 | 17 |
$('.colorbox', context) |
18 | 18 |
.once('init-colorbox') |
19 | 19 |
.colorbox(settings.colorbox); |
20 |
|
|
21 |
$(context).bind('cbox_complete', function () { |
|
22 |
Drupal.attachBehaviors('#cboxLoadedContent'); |
|
23 |
}); |
|
20 | 24 |
} |
21 | 25 |
}; |
22 | 26 |
|
23 |
{ |
|
24 |
$(document).bind('cbox_complete', function () { |
|
25 |
Drupal.attachBehaviors('#cboxLoadedContent'); |
|
26 |
}); |
|
27 |
} |
|
28 |
|
|
29 | 27 |
})(jQuery); |
drupal7/sites/all/modules/colorbox/styles/default/colorbox_style.js | ||
---|---|---|
2 | 2 |
|
3 | 3 |
Drupal.behaviors.initColorboxDefaultStyle = { |
4 | 4 |
attach: function (context, settings) { |
5 |
$(document).bind('cbox_complete', function () {
|
|
5 |
$(context).bind('cbox_complete', function () {
|
|
6 | 6 |
// Only run if there is a title. |
7 | 7 |
if ($('#cboxTitle:empty', context).length == false) { |
8 | 8 |
$('#cboxLoadedContent img', context).bind('mouseover', function () { |
drupal7/sites/all/modules/colorbox/styles/plain/colorbox_style.css | ||
---|---|---|
126 | 126 |
#cboxClose.cbox-close-plain { |
127 | 127 |
position: absolute; |
128 | 128 |
font-size: 20px; |
129 |
line-height: 18px;;
|
|
129 |
line-height: 18px; |
|
130 | 130 |
text-align: center; |
131 | 131 |
color: rgba(255, 255, 255, 0.7); |
132 | 132 |
background: rgba(0, 0, 0, 0.5); |
drupal7/sites/all/modules/colorbox/styles/plain/colorbox_style.js | ||
---|---|---|
2 | 2 |
|
3 | 3 |
Drupal.behaviors.initColorboxPlainStyle = { |
4 | 4 |
attach: function (context, settings) { |
5 |
$(document).bind('cbox_complete', function () {
|
|
5 |
$(context).bind('cbox_complete', function () {
|
|
6 | 6 |
// Make all the controls invisible. |
7 | 7 |
$('#cboxCurrent, #cboxSlideshow, #cboxPrevious, #cboxNext', context).addClass('element-invisible'); |
8 | 8 |
// Replace "Close" with "×" and show. |
... | ... | |
24 | 24 |
} |
25 | 25 |
}); |
26 | 26 |
}); |
27 |
$(document).bind('cbox_closed', function () {
|
|
27 |
$(context).bind('cbox_closed', function () {
|
|
28 | 28 |
$('#cboxClose', context).removeClass('cbox-close-plain'); |
29 | 29 |
}); |
30 | 30 |
} |
drupal7/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.js | ||
---|---|---|
2 | 2 |
|
3 | 3 |
Drupal.behaviors.initColorboxStockholmsyndromeStyle = { |
4 | 4 |
attach: function (context, settings) { |
5 |
$(document).bind('cbox_open', function () {
|
|
5 |
$(context).bind('cbox_open', function () {
|
|
6 | 6 |
// Hide close button initially. |
7 | 7 |
$('#cboxClose', context).css('opacity', 0); |
8 | 8 |
}); |
9 |
$(document).bind('cbox_load', function () {
|
|
9 |
$(context).bind('cbox_load', function () {
|
|
10 | 10 |
// Hide close button. (It doesn't handle the load animation well.) |
11 | 11 |
$('#cboxClose', context).css('opacity', 0); |
12 | 12 |
}); |
13 |
$(document).bind('cbox_complete', function () {
|
|
13 |
$(context).bind('cbox_complete', function () {
|
|
14 | 14 |
// Show close button with a delay. |
15 | 15 |
$('#cboxClose', context).fadeTo('fast', 0, function () {$(this).css('opacity', 1)}); |
16 | 16 |
}); |
Formats disponibles : Unified diff
Weekly update of contrib modules