Changeset 193749
- Timestamp:
- 01/14/2010 03:50:29 AM (16 years ago)
- Location:
- wp-slimbox2/trunk
- Files:
-
- 3 edited
-
adminmenu.php (modified) (3 diffs)
-
adminpage.php (modified) (4 diffs)
-
javascript/slimbox2_autoload.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-slimbox2/trunk/adminmenu.php
r193719 r193749 19 19 'imageFadeDuration' => get_option('wp_slimbox_imageFadeDuration'), 20 20 'captionAnimationDuration' => get_option('wp_slimbox_captionAnimationDuration'), 21 'caption1' => 'a-title', 22 'caption2' => 'img-alt', 23 'caption3' => 'img-title', 24 'caption4' => 'None', 21 'caption' => array('a-title','img-alt','img-title','None'), 25 22 'url' => 'on', 26 23 'counterText' => get_option('wp_slimbox_counterText'), … … 66 63 'imageFadeDuration' => '400', 67 64 'captionAnimationDuration' => '400', 68 'caption1' => 'a-title', 69 'caption2' => 'img-alt', 70 'caption3' => 'img-title', 71 'caption4' => 'None', 65 'caption' => array('a-title','img-alt','img-title','None'), 72 66 'url' => 'on', 73 67 'counterText' => __('Image {x} of {y}', 'wp-slimbox2'), … … 82 76 )); 83 77 } 84 if (!$options->get_option('caption 1')){78 if (!$options->get_option('caption')){ 85 79 $options->init_option(array( 86 'caption1' => 'a-title', 87 'caption2' => 'img-alt', 88 'caption3' => 'img-title', 89 'caption4' => 'None', 80 'caption' => array('a-title','img-alt','img-title','None'), 90 81 'url' => 'on', 91 82 'mobile' => 'off' 92 83 )); 93 84 } 85 $options->init_option(array( 86 'caption' => array('a-title','img-alt','img-title','None'), 87 'url' => 'on', 88 'mobile' => 'off' 89 )); 90 print_r ($options->get_option('caption')); 94 91 ?> -
wp-slimbox2/trunk/adminpage.php
r193719 r193749 8 8 //choose caption source 9 9 //combine selection of lightbox and any non-lightboxed images into single selector 10 /*http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/ 11 $caption = ''; 12 for ($i = 0; $i<4; $i++) { 13 switch (slimbox2_options['caption'][$i]) { 14 case 'a-title': 15 $caption .= 'el.title'; 16 break; 17 case 'img-alt': 18 $caption .= 'el.firstChild.alt'; 19 break; 20 case 'img-title': 21 $caption .= 'el.firstChild.title'; 22 break; 23 default: 24 $caption .= ''; 25 } 26 if($i < 3) $caption .= ' || '; 27 } 28 */ 10 29 ?> 11 30 <div class="wrap"> … … 32 51 'picasaweb' => $_POST['wp_slimbox_picasaweb'], 33 52 'flickr' => $_POST['wp_slimbox_flickr'], 34 'caption1' => $_POST['wp_slimbox_caption1'], 35 'caption2' => $_POST['wp_slimbox_caption2'], 36 'caption3' => $_POST['wp_slimbox_caption3'], 37 'caption4' => $_POST['wp_slimbox_caption4'], 53 'caption' => array($_POST['wp_slimbox_caption1'],$_POST['wp_slimbox_caption2'],$_POST['wp_slimbox_caption3'],$_POST['wp_slimbox_caption4']), 38 54 'url' => $_POST['wp_slimbox_url'], 39 55 'mobile' => $_POST['wp_slimbox_mobile'], … … 59 75 <tr> 60 76 <th scope="col" colspan="2"><?php _e('Setting', 'wp-slimbox2'); ?></th> 61 <th scope="col"><?php _e(' caption', 'wp-slimbox2'); ?></th>77 <th scope="col"><?php _e('Description', 'wp-slimbox2'); ?></th> 62 78 </tr> 63 79 </thead> … … 216 232 <th scope='row' class='check-column'> 217 233 <select name="wp_slimbox_caption1"> 218 <?php selectionGen($options->get_option('caption1'),$caption); ?>234 <?php print_r($options->get_option('caption'));// selectionGen($options->get_option('caption')[0],$caption); ?> 219 235 </select> 220 236 <select name="wp_slimbox_caption2"> 221 <?php selectionGen($options->get_option('caption2'),$caption); ?>237 <?php// selectionGen($options->get_option('caption')[1],$caption); ?> 222 238 </select> 223 239 <select name="wp_slimbox_caption3"> 224 <?php selectionGen($options->get_option('caption3'),$caption); ?>240 <?php //selectionGen($options->get_option('caption')[2],$caption); ?> 225 241 </select> 226 242 <select name="wp_slimbox_caption4"> 227 <?php selectionGen($options->get_option('caption4'),$caption); ?>243 <?php// selectionGen($options->get_option('caption')[3],$caption); ?> 228 244 </select> 229 245 </th> -
wp-slimbox2/trunk/javascript/slimbox2_autoload.js
r193719 r193749 58 58 return /\.(jpeg|bmp|jpg|png|gif)(\?[\d\w=&]*)?$/i.test(this.href); 59 59 }).unbind("click").slimbox(options, function(el) { 60 return [el.href, (slimbox2_options['url'])?'<a href="' + el.href + '">'+el.title+'</a>':el.title]; 60 var caption = (slimbox2_options['caption1']=='a-title')?el.title:(slimbox2_options['caption1']=='img-alt')?el.firstChild.alt:(slimbox2_options['caption1']=='img-title')?:'' || 61 (slimbox2_options['caption2']=='a-title')?el.title:(slimbox2_options['caption2']=='img-alt')?el.firstChild.alt:(slimbox2_options['caption2']=='img-title')?:'' || 62 (slimbox2_options['caption3']=='a-title')?el.title:(slimbox2_options['caption3']=='img-alt')?el.firstChild.alt:(slimbox2_options['caption3']=='img-title')?:'' || 63 (slimbox2_options['caption4']=='a-title')?el.title:(slimbox2_options['caption4']=='img-alt')?el.firstChild.alt:(slimbox2_options['caption4']=='img-title')?:'' || '' 64 return [el.href, (slimbox2_options['url'])?'<a href="' + el.href + '">'+caption+'</a>':+caption]; 61 65 }, function(el) { 62 66 return (this == el) || ($(this).parents("div.post, div#page")[0] && ($(this).parents("div.post, div#page")[0] == $(el).parents("div.post, div#page")[0])); … … 64 68 } else { 65 69 $("a[rel^='lightbox']").unbind("click").slimbox(options, function(el) { 66 return [el.href, (slimbox2_options['url'])?'<a href="' + el.href + '">'+el.title+'</a>':el.title]; 70 var caption = (slimbox2_options['caption1']=='a-title')?el.title:(slimbox2_options['caption1']=='img-alt')?el.firstChild.alt:(slimbox2_options['caption1']=='img-title')?:'' || 71 (slimbox2_options['caption2']=='a-title')?el.title:(slimbox2_options['caption2']=='img-alt')?el.firstChild.alt:(slimbox2_options['caption2']=='img-title')?:'' || 72 (slimbox2_options['caption3']=='a-title')?el.title:(slimbox2_options['caption3']=='img-alt')?el.firstChild.alt:(slimbox2_options['caption3']=='img-title')?:'' || 73 (slimbox2_options['caption4']=='a-title')?el.title:(slimbox2_options['caption4']=='img-alt')?el.firstChild.alt:(slimbox2_options['caption4']=='img-title')?:'' || '') 74 return [el.href, (slimbox2_options['url'])?'<a href="' + el.href + '">'+caption+'</a>'+caption]; 67 75 }, function(el) { 68 76 return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
Note: See TracChangeset
for help on using the changeset viewer.