Plugin Directory

Changeset 194136


Ignore:
Timestamp:
01/15/2010 05:01:37 AM (16 years ago)
Author:
malcalevak
Message:

Modification of caption selection.
Proper, I think, addition of new variables.
Addition of gallery grouping selector.

Location:
wp-slimbox2/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-slimbox2/trunk/adminmenu.php

    r194044 r194136  
    1919        'imageFadeDuration' => get_option('wp_slimbox_imageFadeDuration'),
    2020        'captionAnimationDuration'   => get_option('wp_slimbox_captionAnimationDuration'),
    21         'caption' => array('a-title','img-alt','img-title','None'),
     21        'caption' => array('a-title','img-alt','img-title','href'),
    2222        'url' => 'on',
     23        'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body',
    2324        'counterText' => get_option('wp_slimbox_counterText'),
    2425        'closeKeys'   => get_option('wp_slimbox_closeKeys'),
     
    6364        'imageFadeDuration' => '400',
    6465        'captionAnimationDuration'   => '400',
    65         'caption' => array('a-title','img-alt','img-title','None'),
     66        'caption' => array('a-title','img-alt','img-title','href'),
    6667        'url' => 'on',
     68        'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body',
    6769        'counterText' => __('Image {x} of {y}', 'wp-slimbox2'),
    6870        'closeKeys'   => __('27,88,67', 'wp-slimbox2'),
     
    7880//THIS SECTION DOESN"T APPEAR TO WORK CORRECTLY!
    7981if (!$options->get_option('caption')){
    80     $options->init_option(array(
    81         'caption' => array('a-title','img-alt','img-title','None'),
     82    $options->update_option(array(
     83        'caption' => array('a-title','img-alt','img-title','href'),
    8284        'url' => 'on',
     85        'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body',
    8386        'mobile' => 'off'
    8487    ));
  • wp-slimbox2/trunk/adminpage.php

    r194044 r194136  
    33    $overlayOpacity = array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1);
    44    $msArray = array(1,100,200,300,400,500,600,700,800,900,1000);
    5     $captions = array('a-title','img-alt','img-title','None');
     5    $captions = array('a-title','img-alt','img-title','href','None');
    66    global $options;
    7     //add class selection for auto-select div
    8     //choose caption source
    97    //combine selection of lightbox and any non-lightboxed images into single selector
    10     /*http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/
    11     */
    128?>
    139<div class="wrap">
     
    2824                'imageFadeDuration' => $_POST['wp_slimbox_imageFadeDuration'],
    2925                'captionAnimationDuration'   => $_POST['wp_slimbox_captionAnimationDuration'],
     26                'caption' => array($_POST['wp_slimbox_caption1'],$_POST['wp_slimbox_caption2'],$_POST['wp_slimbox_caption3'],$_POST['wp_slimbox_caption4']),
     27                'url' => $_POST['wp_slimbox_url'],
     28                'selector' => $_POST['wp_slimbox_selector'],
    3029                'counterText' => $_POST['wp_slimbox_counterText'],
    3130                'closeKeys'   => $_POST['wp_slimbox_closeKeys'],
     
    3433                'picasaweb' => $_POST['wp_slimbox_picasaweb'],
    3534                'flickr'   => $_POST['wp_slimbox_flickr'],
    36                 'caption' => array($_POST['wp_slimbox_caption1'],$_POST['wp_slimbox_caption2'],$_POST['wp_slimbox_caption3'],$_POST['wp_slimbox_caption4']),
    37                 'url' => $_POST['wp_slimbox_url'],
    3835                'mobile' => $_POST['wp_slimbox_mobile'],
    3936                'maintenance' => $_POST['wp_slimbox_maintenance'],
     
    7673                </th>
    7774                <td class='desc'>
    78                     <p> <?php _e('This option allows the user to automatically activate Slimbox on all links pointing to ".jpg" or ".png" or ".gif". All image links contained in the same block or paragraph (having the same parent element) will automatically be grouped together in a gallery. If this isn\'t activated you will need to manually add \'rel="lightbox"\' for individual images or \'rel="lightbox-imagesetname"\' for groups on all links you wish to use Slimbox.', 'wp-slimbox2'); ?>
     75                    <p> <?php _e('This option allows the user to automatically activate Slimbox on all links pointing to ".jpg" or ".png" or ".gif". All image links will automatically be grouped together in a gallery according to the selector chosen below. If this isn\'t activated you will need to manually add \'rel="lightbox"\' for individual images or \'rel="lightbox-imagesetname"\' for groups on all links you wish to use Slimbox.', 'wp-slimbox2'); ?>
    7976                    </p>
    8077                </td>
     
    228225                </th>
    229226                <td class='desc'>
    230                     <p> <?php _e('This option allows the user to select the order in which to search for the caption text. The default is a-title, followed by img-alt, img-title, and None.', 'wp-slimbox2'); ?>
    231                     </p>
    232                 </td>
    233             </tr>
    234             <tr class='inactive'>
    235                 <td class='name'><?php _e('URL in Caption', 'wp-slimbox2'); ?></td>
     227                    <p> <?php _e('This option allows the user to select the order in which to search various locations for the caption text. If you\'d like no caption just select "None" in the first block. You can also leave out an option by replacing it with "None", but be sure to place any option you\'d like to search in front of it. If a caption can\'t be found, and "None" wasn\t selected, it will default to the URL ("href"). The default is "a-title", followed by "img-alt", "img-title", and "href".', 'wp-slimbox2'); ?>
     228                    </p>
     229                </td>
     230            </tr>
     231            <tr class='inactive'>
     232                <td class='name'><?php _e('Caption is URL', 'wp-slimbox2'); ?></td>
    236233                <th scope='row' class='check-column'>
    237234                    <input type="checkbox" name="wp_slimbox_url"<?php if ($options->get_option('url') == 'on') echo ' checked="yes"';?> />
    238235                </th>
    239236                <td class='desc'>
    240                     <p> <?php _e('This option will render the caption as a hyperlink to the image file. This is enabled by default.', 'wp-slimbox2'); ?>
    241                     </p>
     237                    <p> <?php _e('This option will render the caption as a hyperlink. This is enabled by default.', 'wp-slimbox2'); ?>
     238                    </p>
     239            </tr>
     240            <tr class='inactive'>
     241                <td class='name'><?php _e('Autoload Selector', 'wp-slimbox2'); ?></td>
     242                <th scope='row' class='check-column'>
     243                    <input type="text" name="wp_slimbox_selector" value="<?php echo $options->get_option('selector'); ?>" />
     244                </th>
     245                <td class='desc'>
     246                    <p> <?php _e('This option allows the user to change how images are grouped when autoload is enabled. It uses jQuery selectors, as described <a href="http://api.jquery.com/category/selectors/">here</a>. The default is "div.entry-content, div.gallery, div.entry, div.post, div#page, body", which works in most themes by searching for a common post, gallery, or page that contains the images.', 'wp-slimbox2'); ?>
     247                    </p>
     248                </td>
    242249            </tr>
    243250            <tr class='inactive'>
  • wp-slimbox2/trunk/index.php

    r194044 r194136  
    6565                    $caption .= 'el.firstChild.title';
    6666                    break;
     67                case 'href':
     68                    $caption .= 'el.href';
     69                    break;
    6770                default:
    68                     $caption .= 'el.href';
     71                    $caption .= "' '";
    6972            }
    7073            $caption .= ' || ';
     
    8588            'caption' => $caption,
    8689            'url' => (($options->get_option('url') == 'on')?true:false),
     90            'selector' => $options->get_option('selector'),
    8791            'counterText' => $options->get_option('counterText'),
    8892            'closeKeys' => $options->get_option('closeKeys'),
     
    97101            'mobile' => (($options->get_option('mobile') == 'on')?true:false)
    98102        ));
    99 
    100 
    101         }
     103    }
    102104}
    103105
  • wp-slimbox2/trunk/javascript/slimbox2_autoload.js

    r194044 r194136  
    5959                        return [el.href, (slimbox2_options['url'])?'<a href="' + el.href + '">'+eval(slimbox2_options['caption'])+'</a>':eval(slimbox2_options['caption'])];
    6060                    }, function(el) {
    61                         return (this == el) || ($(this).parents("div.post, div#page")[0] && ($(this).parents("div.post, div#page")[0] == $(el).parents("div.post, div#page")[0]));
     61                        return (this == el) || ($(this).parents(slimbox2_options['selector'])[0] && ($(this).parents(slimbox2_options['selector'])[0] == $(el).parents(slimbox2_options['selector'])[0]));
    6262                });
    6363        } else {
Note: See TracChangeset for help on using the changeset viewer.