Changeset 194136
- Timestamp:
- 01/15/2010 05:01:37 AM (16 years ago)
- Location:
- wp-slimbox2/trunk
- Files:
-
- 4 edited
-
adminmenu.php (modified) (3 diffs)
-
adminpage.php (modified) (5 diffs)
-
index.php (modified) (3 diffs)
-
javascript/slimbox2_autoload.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-slimbox2/trunk/adminmenu.php
r194044 r194136 19 19 'imageFadeDuration' => get_option('wp_slimbox_imageFadeDuration'), 20 20 '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'), 22 22 'url' => 'on', 23 'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body', 23 24 'counterText' => get_option('wp_slimbox_counterText'), 24 25 'closeKeys' => get_option('wp_slimbox_closeKeys'), … … 63 64 'imageFadeDuration' => '400', 64 65 'captionAnimationDuration' => '400', 65 'caption' => array('a-title','img-alt','img-title',' None'),66 'caption' => array('a-title','img-alt','img-title','href'), 66 67 'url' => 'on', 68 'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body', 67 69 'counterText' => __('Image {x} of {y}', 'wp-slimbox2'), 68 70 'closeKeys' => __('27,88,67', 'wp-slimbox2'), … … 78 80 //THIS SECTION DOESN"T APPEAR TO WORK CORRECTLY! 79 81 if (!$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'), 82 84 'url' => 'on', 85 'selector' => 'div.entry-content, div.gallery, div.entry, div.post, div#page, body', 83 86 'mobile' => 'off' 84 87 )); -
wp-slimbox2/trunk/adminpage.php
r194044 r194136 3 3 $overlayOpacity = array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1); 4 4 $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'); 6 6 global $options; 7 //add class selection for auto-select div8 //choose caption source9 7 //combine selection of lightbox and any non-lightboxed images into single selector 10 /*http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/11 */12 8 ?> 13 9 <div class="wrap"> … … 28 24 'imageFadeDuration' => $_POST['wp_slimbox_imageFadeDuration'], 29 25 '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'], 30 29 'counterText' => $_POST['wp_slimbox_counterText'], 31 30 'closeKeys' => $_POST['wp_slimbox_closeKeys'], … … 34 33 'picasaweb' => $_POST['wp_slimbox_picasaweb'], 35 34 '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'],38 35 'mobile' => $_POST['wp_slimbox_mobile'], 39 36 'maintenance' => $_POST['wp_slimbox_maintenance'], … … 76 73 </th> 77 74 <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'); ?> 79 76 </p> 80 77 </td> … … 228 225 </th> 229 226 <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> 236 233 <th scope='row' class='check-column'> 237 234 <input type="checkbox" name="wp_slimbox_url"<?php if ($options->get_option('url') == 'on') echo ' checked="yes"';?> /> 238 235 </th> 239 236 <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> 242 249 </tr> 243 250 <tr class='inactive'> -
wp-slimbox2/trunk/index.php
r194044 r194136 65 65 $caption .= 'el.firstChild.title'; 66 66 break; 67 case 'href': 68 $caption .= 'el.href'; 69 break; 67 70 default: 68 $caption .= 'el.href';71 $caption .= "' '"; 69 72 } 70 73 $caption .= ' || '; … … 85 88 'caption' => $caption, 86 89 'url' => (($options->get_option('url') == 'on')?true:false), 90 'selector' => $options->get_option('selector'), 87 91 'counterText' => $options->get_option('counterText'), 88 92 'closeKeys' => $options->get_option('closeKeys'), … … 97 101 'mobile' => (($options->get_option('mobile') == 'on')?true:false) 98 102 )); 99 100 101 } 103 } 102 104 } 103 105 -
wp-slimbox2/trunk/javascript/slimbox2_autoload.js
r194044 r194136 59 59 return [el.href, (slimbox2_options['url'])?'<a href="' + el.href + '">'+eval(slimbox2_options['caption'])+'</a>':eval(slimbox2_options['caption'])]; 60 60 }, 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])); 62 62 }); 63 63 } else {
Note: See TracChangeset
for help on using the changeset viewer.