Ticket #8785: press-this-6-9.patch
| File press-this-6-9.patch, 3.5 KB (added by noel, 4 years ago) |
|---|
-
press-this.php
99 99 } 100 100 $url = isset($_GET['u']) ? esc_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 if( ( typeof(my_src) == (undefined || 'undefined') ) 224 <?php if($refresh == true) echo "|| true == ".$refresh.""; ?>) { 222 225 var my_src = eval( 223 226 jQuery.ajax({ 224 227 type: "GET", … … 244 247 strtoappend = '<?php _e('Unable to retrieve images or no images on page.'); ?>'; 245 248 } 246 249 } 247 250 } 251 248 252 for (i = 0; i < my_src.length; i++) { 249 253 img = new Image(); 250 254 img.src = my_src[i]; … … 301 305 jQuery('#extra_fields').html(''); 302 306 }); 303 307 jQuery('.refresh').click(function() { 308 window.urladd = "&refresh=true"; 304 309 show('photo'); 310 window.urladd = ''; 305 311 }); 306 312 jQuery('#img_container').html(strtoappend); 307 313 jQuery('#photo_add_url').attr('href', '?ajax=photo_thickbox_url&height=200&width=500'); … … 319 325 <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> 320 326 <head> 321 327 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> 322 <title><?php _e('Press This') ?></title>328 <title><?php bloginfo('name'); ?> › <?php _e('Press This') ?></title> 323 329 324 330 <?php 325 331 add_thickbox(); … … 403 409 break; 404 410 case 'photo' : 405 411 jQuery('#extra_fields').before('<p id="waiting"><img src="images/wpspin_light.gif" alt="" /> <?php echo esc_js( __( 'Loading...' ) ); ?></p>'); 412 if(typeof(window.urladd) == ('undefined' || undefined)) 413 window.urladd = ""; 406 414 jQuery.ajax({ 407 415 type: "GET", 408 416 cache : false, 409 417 url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>", 410 data: "ajax=photo_js&u=<?php echo urlencode($url)?>" ,418 data: "ajax=photo_js&u=<?php echo urlencode($url)?>"+window.urladd, 411 419 dataType : "script", 412 420 success : function() { 413 421 jQuery('#waiting').remove(); … … 442 450 <div id="poststuff" class="metabox-holder"> 443 451 <div id="side-info-column"> 444 452 <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 447 453 <?php wp_nonce_field('press-this') ?> 448 454 <input type="hidden" name="post_type" id="post_type" value="text"/> 449 455 <input type="hidden" name="autosave" id="autosave" /> … … 518 524 519 525 <div id="titlediv"> 520 526 <div class="titlewrap"> 521 <input name="title" id="title" class="text" value="<?php echo esc_attr($title);?>"/>527 <input name="title" id="title" class="text" value="<?php echo trim(esc_attr($title));?>"/> 522 528 </div> 523 529 </div> 524 530 -
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
