Ticket #8785: press-this-5-12-7pm.patch
| File press-this-5-12-7pm.patch, 3.9 KB (added by noel, 4 years ago) |
|---|
-
wp-admin/press-this.php
99 99 } 100 100 $url = isset($_GET['u']) ? clean_url($_GET['u']) : ''; 101 101 $image = isset($_GET['i']) ? $_GET['i'] : ''; 102 $refresh = isset($_GET['refresh']) ? $_GET['refresh'] : ''; 102 103 103 104 if ( !empty($_REQUEST['ajax']) ) { 104 105 switch ($_REQUEST['ajax']) { … … 219 220 // gather images and load some default JS 220 221 var last = null 221 222 var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; 223 224 if( ( typeof(my_src) == (undefined || 'undefined') ) 225 <?php if($refresh == true) echo "|| true == ".$refresh.""; ?>) { 222 226 var my_src = eval( 223 227 jQuery.ajax({ 224 228 type: "GET", … … 229 233 dataType : "script" 230 234 }).responseText 231 235 ); 232 if(my_src.length == 0) { 233 var my_src = eval( 234 jQuery.ajax({ 235 type: "GET", 236 url: "<?php echo clean_url($_SERVER['PHP_SELF']); ?>", 237 cache : false, 238 async : false, 239 data: "ajax=photo_images&u=<?php echo urlencode($url); ?>", 240 dataType : "script" 241 }).responseText 242 ); 243 if(my_src.length == 0) { 244 strtoappend = '<?php _e('Unable to retrieve images or no images on page.'); ?>'; 245 } 246 } 236 } 247 237 248 238 for (i = 0; i < my_src.length; i++) { 249 239 img = new Image(); … … 289 279 desc = jQuery('#this_photo_description').val(); 290 280 src = jQuery('#this_photo').val(); 291 281 pick(src, desc); 292 jQuery('#extra_fields').hide();293 jQuery('#extra_fields').html('');294 282 return false; 295 283 } 296 284 … … 301 289 jQuery('#extra_fields').html(''); 302 290 }); 303 291 jQuery('.refresh').click(function() { 304 show('photo'); 305 }); 292 window.urladd = "&refresh=true"; 293 show('photo'); 294 window.urladd = ''; 295 }); 306 296 jQuery('#img_container').html(strtoappend); 307 297 jQuery('#photo_add_url').attr('href', '?ajax=photo_thickbox_url&height=200&width=500'); 308 298 tb_init('#extra_fields .thickbox'); … … 319 309 <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> 320 310 <head> 321 311 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> 322 <title><?php _e('Press This') ?></title>312 <title><?php bloginfo('name'); ?> › <?php _e('Press This') ?></title> 323 313 324 314 <?php 325 315 add_thickbox(); … … 401 391 }); 402 392 return false; 403 393 break; 394 404 395 case 'photo' : 405 396 jQuery('#extra_fields').before('<p id="waiting"><img src="images/wpspin_light.gif" alt="" /> <?php echo esc_js( __( 'Loading...' ) ); ?></p>'); 397 398 if(typeof(window.urladd) == ('undefined' || undefined)) 399 window.urladd = ""; 400 406 401 jQuery.ajax({ 407 402 type: "GET", 408 403 cache : false, 409 404 url: "<?php echo clean_url($_SERVER['PHP_SELF']); ?>", 410 data: "ajax=photo_js&u=<?php echo urlencode($url)?>" ,405 data: "ajax=photo_js&u=<?php echo urlencode($url)?>"+window.urladd, 411 406 dataType : "script", 412 407 success : function() { 413 408 jQuery('#waiting').remove(); … … 442 437 <div id="poststuff" class="metabox-holder"> 443 438 <div id="side-info-column"> 444 439 <div class="sleeve"> 445 <h1 id="viewsite"><a class="button" href="<?php echo get_option('home'); ?>/" target="_blank"><?php bloginfo('name'); ?> › <?php _e('Press This') ?></a></span></h1>446 440 447 441 <?php wp_nonce_field('press-this') ?> 448 442 <input type="hidden" name="post_type" id="post_type" value="text"/> -
wp-admin/css/press-this.css
99 99 } 100 100 101 101 #side-info-column .sleeve { 102 padding-top: 10px; 102 103 padding-left: 10px; 103 104 } 104 105 … … 189 190 #extra_fields #actions { 190 191 clear: both; 191 192 position: absolute; 192 right: 4px;193 top: 6px;193 right: 0px; 194 top: 8px; 194 195 margin: 0; 195 196 } 196 197
