Changeset 193719
- Timestamp:
- 01/13/2010 10:13:17 PM (16 years ago)
- Location:
- wp-slimbox2/trunk
- Files:
-
- 4 edited
-
adminmenu.php (modified) (4 diffs)
-
adminpage.php (modified) (7 diffs)
-
index.php (modified) (3 diffs)
-
javascript/slimbox2_autoload.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-slimbox2/trunk/adminmenu.php
r192448 r193719 4 4 add_action( "admin_print_styles-$page", 'slimbox_admin_styles' ); 5 5 6 if((get_option('wp_slimbox_autoload')=='')?true:false) { 7 $options = new WPlize('wp_slimbox',array( 8 'autoload' => 'off', 9 'loop' => 'off', 10 'overlayOpacity' => '0.8', 11 'overlayColor' => '#000000', 12 'overlayFadeDuration' => '400', 13 'resizeDuration' => '400', 14 'resizeEasing' => 'swing', 15 'initialWidth' => '250', 16 'initialHeight' => '250', 17 'imageFadeDuration' => '400', 18 'captionAnimationDuration' => '400', 19 'counterText' => __('Image {x} of {y}', 'wp-slimbox2'), 20 'closeKeys' => __('27,88,67', 'wp-slimbox2'), 21 'previousKeys' => __('37,80', 'wp-slimbox2'), 22 'nextKeys' => __('39,78', 'wp-slimbox2'), 23 'picasaweb' => 'off', 24 'flickr' => 'off', 25 'maintenance' => 'off', 26 'cache' => time(), 27 'disable_css' => 'off' 28 )); 29 } else { 30 $options = new WPlize('wp_slimbox',array( 6 global $options; 7 8 if(get_option('wp_slimbox_autoload')) {//if we're using a really old version of the plugin, transfer the settings, then delete them 9 $options->init_option(array( 31 10 'autoload' => get_option('wp_slimbox_autoload'), 32 11 'loop' => get_option('wp_slimbox_loop'), … … 40 19 'imageFadeDuration' => get_option('wp_slimbox_imageFadeDuration'), 41 20 'captionAnimationDuration' => get_option('wp_slimbox_captionAnimationDuration'), 21 'caption1' => 'a-title', 22 'caption2' => 'img-alt', 23 'caption3' => 'img-title', 24 'caption4' => 'None', 25 'url' => 'on', 42 26 'counterText' => get_option('wp_slimbox_counterText'), 43 27 'closeKeys' => get_option('wp_slimbox_closeKeys'), … … 46 30 'picasaweb' => get_option('wp_slimbox_picasaweb'), 47 31 'flickr' => get_option('wp_slimbox_flickr'), 32 'mobile' => 'off', 48 33 'maintenance' => get_option('wp_slimbox_maintenance'), 49 'cache' => get_option('wp_slimbox_cache'), 50 'disable_css' => 'off' 34 'cache' => get_option('wp_slimbox_cache') 51 35 )); 52 36 delete_option('wp_slimbox_autoload'); … … 69 53 delete_option('wp_slimbox_maintenance'); 70 54 delete_option('wp_slimbox_cache'); 55 } else if (!$options->get_option('autoload')){ 56 $options->init_option(array( 57 'autoload' => 'off', 58 'loop' => 'off', 59 'overlayOpacity' => '0.8', 60 'overlayColor' => '#000000', 61 'overlayFadeDuration' => '400', 62 'resizeDuration' => '400', 63 'resizeEasing' => 'swing', 64 'initialWidth' => '250', 65 'initialHeight' => '250', 66 'imageFadeDuration' => '400', 67 'captionAnimationDuration' => '400', 68 'caption1' => 'a-title', 69 'caption2' => 'img-alt', 70 'caption3' => 'img-title', 71 'caption4' => 'None', 72 'url' => 'on', 73 'counterText' => __('Image {x} of {y}', 'wp-slimbox2'), 74 'closeKeys' => __('27,88,67', 'wp-slimbox2'), 75 'previousKeys' => __('37,80', 'wp-slimbox2'), 76 'nextKeys' => __('39,78', 'wp-slimbox2'), 77 'picasaweb' => 'off', 78 'flickr' => 'off', 79 'maintenance' => 'off', 80 'mobile' => 'off', 81 'cache' => time() 82 )); 83 } 84 if (!$options->get_option('caption1')){ 85 $options->init_option(array( 86 'caption1' => 'a-title', 87 'caption2' => 'img-alt', 88 'caption3' => 'img-title', 89 'caption4' => 'None', 90 'url' => 'on', 91 'mobile' => 'off' 92 )); 71 93 } 72 94 ?> -
wp-slimbox2/trunk/adminpage.php
r193382 r193719 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 $ options = new WPlize('wp_slimbox');6 //add donate link5 $caption = array('a-title','img-alt','img-title','None'); 6 global $options; 7 7 //add class selection for auto-select div 8 8 //choose caption source … … 32 32 'picasaweb' => $_POST['wp_slimbox_picasaweb'], 33 33 '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'], 38 'url' => $_POST['wp_slimbox_url'], 39 'mobile' => $_POST['wp_slimbox_mobile'], 34 40 'maintenance' => $_POST['wp_slimbox_maintenance'], 35 41 'cache' => $_POST['wp_slimbox_cache'] … … 48 54 ?> 49 55 <div style="clear:both;padding-top:5px;"></div> 50 <h2><?php _e('Settings', 'wp-slimbox2'); ?></h2>56 <h2><?php _e('Settings', 'wp-slimbox2');?></h2> 51 57 <table class="widefat" cellspacing="0" id="inactive-plugins-table"> 52 58 <thead> 53 59 <tr> 54 60 <th scope="col" colspan="2"><?php _e('Setting', 'wp-slimbox2'); ?></th> 55 <th scope="col"><?php _e(' Description', 'wp-slimbox2'); ?></th>61 <th scope="col"><?php _e('caption', 'wp-slimbox2'); ?></th> 56 62 </tr> 57 63 </thead> … … 160 166 </th> 161 167 <td class='desc'> 162 <p> <?php _e('This option allows the user to adjust the name of the easing effect that you want to use for the resize animation (jQuery Easing Plugin required). Many easings require a longer execution time to look good, so you should adjust the resizeDuration option above as well.', 'wp-slimbox2'); ?>168 <p> <?php _e('This option allows the user to adjust the easing effect that you want to use for the resize animation (this loads an additional jQuery Easing Plugin). Many easings require a longer execution time to look good, so you should adjust the resizeDuration option above as well.', 'wp-slimbox2'); ?> 163 169 </p> 164 170 </td> … … 204 210 <td class='desc'> 205 211 <p> <?php _e('This option allows the user to adjust the duration of the caption animation, in milliseconds. Disabling this effect will make the caption appear instantly.', 'wp-slimbox2'); ?> 212 </p> 213 </tr> 214 <tr class='inactive'> 215 <td class='name'><?php _e('Image Caption Source Order', 'wp-slimbox2'); ?></td> 216 <th scope='row' class='check-column'> 217 <select name="wp_slimbox_caption1"> 218 <?php selectionGen($options->get_option('caption1'),$caption); ?> 219 </select> 220 <select name="wp_slimbox_caption2"> 221 <?php selectionGen($options->get_option('caption2'),$caption); ?> 222 </select> 223 <select name="wp_slimbox_caption3"> 224 <?php selectionGen($options->get_option('caption3'),$caption); ?> 225 </select> 226 <select name="wp_slimbox_caption4"> 227 <?php selectionGen($options->get_option('caption4'),$caption); ?> 228 </select> 229 </th> 230 <td class='desc'> 231 <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'); ?> 232 </p> 233 </td> 234 </tr> 235 <tr class='inactive'> 236 <td class='name'><?php _e('URL in Caption', 'wp-slimbox2'); ?></td> 237 <th scope='row' class='check-column'> 238 <input type="checkbox" name="wp_slimbox_url"<?php if ($options->get_option('url') == 'on') echo ' checked="yes"';?> /> 239 </th> 240 <td class='desc'> 241 <p> <?php _e('This option will render the caption as a hyperlink to the image file. This is enabled by default.', 'wp-slimbox2'); ?> 206 242 </p> 207 243 </tr> … … 236 272 <input type="text" name="wp_slimbox_nextKeys" class="keys" value="<?php echo $options->get_option('nextKeys'); ?>"/> 237 273 </th> 274 </tr> 275 <tr class='inactive'> 276 <td class='name'><?php _e('Enable on mobiles?', 'wp-slimbox2'); ?></td> 277 <th scope='row' class='check-column'> 278 <input type="checkbox" name="wp_slimbox_mobile"<?php if ($options->get_option('mobile') == 'on') echo ' checked="yes"';?> /> 279 </th> 280 <td class='desc'> 281 <p> <?php _e('This option enables Slimbox on mobile phones. By default this feature is disabled.', 'wp-slimbox2'); ?> 282 </p> 238 283 </tr> 239 284 <tr class='inactive'> … … 254 299 <div style="clear:both;padding-top:20px;"></div> 255 300 </form> 301 <div align="center"> 302 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 303 <input type="hidden" name="cmd" value="_s-xclick"> 304 <input type="hidden" name="hosted_button_id" value="<?php _e('11145898"> 305 <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 306 <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 307 </form> 308 <p><b style="font-size:11px;">Support this plugin!','wp-slimbox2'); ?></b></p> 309 </div> 256 310 </div> -
wp-slimbox2/trunk/index.php
r193382 r193719 52 52 wp_enqueue_script('slimbox2_autoload'); 53 53 wp_localize_script( 'slimbox2_autoload', 'slimbox2_options', array( 54 'autoload' => $options->get_option('autoload'),54 'autoload' => (($options->get_option('autoload') == 'on')?true:false), 55 55 'overlayColor' => $options->get_option('overlayColor'), 56 56 'loop' => (($options->get_option('loop') == 'on')?true:false), … … 63 63 'imageFadeDuration' => $options->get_option('imageFadeDuration'), 64 64 'captionAnimationDuration' => $options->get_option('captionAnimationDuration'), 65 'caption1' => $options->get_option('caption1'), 66 'caption2' => $options->get_option('caption2'), 67 'caption3' => $options->get_option('caption3'), 68 'caption4' => $options->get_option('caption4'), 69 'url' => (($options->get_option('url') == 'on')?true:false), 65 70 'counterText' => $options->get_option('counterText'), 66 71 'closeKeys' => $options->get_option('closeKeys'), … … 71 76 'close' => WP_PLUGIN_URL.'/wp-slimbox2/images/'.__('default/closelabel.gif', 'wp-slimbox2'), 72 77 'LTR' => __('LTR', 'wp-slimbox2'), 73 'picasaweb' => $options->get_option('picasaweb'),74 'flickr' => $options->get_option('flickr'),75 'mobile' => false78 'picasaweb' => (($options->get_option('picasaweb') == 'on')?true:false), 79 'flickr' => (($options->get_option('flickr') == 'on')?true:false), 80 'mobile' => (($options->get_option('mobile') == 'on')?true:false) 76 81 )); 77 82 -
wp-slimbox2/trunk/javascript/slimbox2_autoload.js
r193382 r193719 1 //accomodate infinite scroll...clear and reset slimbox function 2 //add support to trigger on links? 1 //pack for final release 3 2 jQuery(document).ready(function($) { 4 3 if(slimbox2_options['mobile'] || !/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)){ … … 6 5 load_slimbox(); 7 6 } 8 7 }); 9 8 function slimbox_CSS() { 10 $("#lbOverlay").css("background-color",String(slimbox2_options['overlayColor'])); 9 jQuery(function($) { 10 $("#lbOverlay").css("background-color",slimbox2_options['overlayColor']); 11 11 12 12 if(slimbox2_options['LTR']=="RTL") { … … 34 34 ); 35 35 $("#lbCloseLink").css("background","transparent url("+slimbox2_options["close"]+") no-repeat center"); 36 } 36 })}; 37 37 38 38 function load_slimbox() { 39 jQuery(function($) { 39 40 var options = { 40 41 loop: slimbox2_options['loop'], … … 42 43 overlayFadeDuration: parseInt(slimbox2_options['overlayFadeDuration']), 43 44 resizeDuration: parseInt(slimbox2_options['resizeDuration']), 44 resizeEasing: String(slimbox2_options['resizeEasing']),45 resizeEasing: slimbox2_options['resizeEasing'], 45 46 initialWidth: parseInt(slimbox2_options['initialWidth']), 46 47 initialHeight: parseInt(slimbox2_options['initialHeight']), 47 48 imageFadeDuration: parseInt(slimbox2_options['imageFadeDuration']), 48 49 captionAnimationDuration: parseInt(slimbox2_options['captionAnimationDuration']), 49 counterText: String(slimbox2_options['counterText']),50 counterText: slimbox2_options['counterText'], 50 51 closeKeys: slimbox2_options['closeKeys'].split(',').map(Number), 51 52 previousKeys: slimbox2_options['previousKeys'].split(',').map(Number), … … 53 54 } 54 55 55 if(slimbox2_options['autoload'] =="on") {56 if(slimbox2_options['autoload']) { 56 57 $("a[href]").filter(function() { 57 58 return /\.(jpeg|bmp|jpg|png|gif)(\?[\d\w=&]*)?$/i.test(this.href); 58 }).slimbox(options, null, function(el) { 59 return (this == el) || ($(this).parents("div.post, div#page")[0] && ($(this).parents("div.post, div#page")[0] == $(el).parents("div.post, div#page")[0])); 59 }).unbind("click").slimbox(options, function(el) { 60 return [el.href, (slimbox2_options['url'])?'<a href="' + el.href + '">'+el.title+'</a>':el.title]; 61 }, function(el) { 62 return (this == el) || ($(this).parents("div.post, div#page")[0] && ($(this).parents("div.post, div#page")[0] == $(el).parents("div.post, div#page")[0])); 60 63 }); 61 64 } else { 62 $("a[rel^='lightbox']").slimbox(options, null, function(el) { 65 $("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]; 67 }, function(el) { 63 68 return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel)); 64 69 }); 65 70 } 66 if(slimbox2_options['picasaweb'] =="on") {67 $("a[href^='http://picasaweb.google.'] > img:first-child[src]").parent(). slimbox(options, function(el) {71 if(slimbox2_options['picasaweb']) { 72 $("a[href^='http://picasaweb.google.'] > img:first-child[src]").parent().unbind("click").slimbox(options, function(el) { 68 73 return [el.firstChild.src.replace(/\/s\d+(?:\-c)?\/([^\/]+)$/, "/s640/$2"), 69 74 (el.title || el.firstChild.alt) + '<br /><a href="' + el.href + '">Picasa Web Albums page</a>']; 70 75 }); 71 76 } 72 if(slimbox2_options['flickr'] =="on") {73 $("a[href^='http://www.flickr.com/photos/'] > img:first-child[src]").parent(). slimbox(options, function(el) {77 if(slimbox2_options['flickr']) { 78 $("a[href^='http://www.flickr.com/photos/'] > img:first-child[src]").parent().unbind("click").slimbox(options, function(el) { 74 79 return [el.firstChild.src.replace(/_[mts]\.(\w+)$/, ".$1"), 75 80 (el.title || el.firstChild.alt) + '<br /><a href="' + el.href + '">Flickr page</a>']; 76 81 }); 77 82 } 78 } 79 }); 83 })};
Note: See TracChangeset
for help on using the changeset viewer.