Changeset 8552
- Timestamp:
- 08/05/2008 05:14:18 PM (17 years ago)
- Location:
- branches/2.6/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/wp-admin/css/press-this.css
r8316 r8552 5 5 padding: 0px; 6 6 } 7 8 img { border: 0; } 7 9 /* Tabs */ 8 10 @media projection , screen { -
branches/2.6/wp-admin/press-this.php
r8477 r8552 185 185 $host = parse_url($uri); 186 186 187 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif) [^<>\'\"]*)(\2)([^>\/]*)\/*>/is';187 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is'; 188 188 preg_match_all($pattern, $content, $matches); 189 189 190 190 if ( empty($matches[1]) ) return ''; 191 191 192 192 $sources = array(); 193 193 foreach ($matches[3] as $src) { 194 // if no http in url 194 195 if(strpos($src, 'http') === false) 195 if(strpos($src, '../') === false && strpos($src, './') === false) 196 // if it doesn't have a relative uri 197 if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === true) 196 198 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); 197 199 else 198 $src = 'http://'.str_replace('//','/', $host['host'].'/'. $host['path'].'/'.$src);199 200 $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); 201 200 202 $sources[] = clean_url($src); 201 203 } … … 248 250 249 251 function pick(img, desc) { 250 if (img) { 251 length = jQuery('.photolist input').length;252 if (img) { 253 if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length; 252 254 if(length == 0) length = 1; 253 255 jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>'); 254 256 jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>'); 255 append_editor("\n\n" + '<p><img src="' + img +'" alt="' + desc + '" /></p>');257 append_editor("\n\n" + '<p><img src="' + img +'" alt="' + desc + '" class="aligncenter"/></p>'); 256 258 } 257 259 tinyMCE.activeEditor.resizeToContent(); … … 268 270 269 271 jQuery(document).ready(function() { 272 jQuery('#extra_fields').html('<div class="photolist"></div><small id="photo_directions"><?php _e("Click images to select:") ?> <span><a href="#" id="photo_add_url" class="thickbox"><?php _e("Add from URL") ?> +</a></span></small><div class="titlewrap"><div id="img_container"></div></div>'); 270 273 jQuery('#img_container').html(strtoappend); 271 274 jQuery('#photo_add_url').attr('href', '?ajax=thickbox_url&height=200&width=500'); … … 277 280 278 281 if($_REQUEST['ajax'] == 'photo') { ?> 279 <div class="photolist"></div> 280 281 <small id="photo_directions"><?php _e('Click images to select:') ?> <span><a href="#" id="photo_add_url" class="thickbox"><?php _e('Add from URL') ?> +</a></span></small> 282 283 <div class="titlewrap"> 284 <div id="img_container"></div> 285 </div> 282 286 283 <?php die; 287 284 } … … 324 321 language : "<?php echo $language; ?>", 325 322 width: "100%", 323 height: "300", 326 324 theme : "advanced", 327 325 theme_advanced_buttons1 : "bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink", … … 447 445 jQuery('#extra_fields').show(); 448 446 jQuery('#extra_fields').before('<h2 id="waiting"><img src="images/loading.gif" alt="" /><?php echo js_escape( __( 'Loading...' ) ); ?></h2>'); 449 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'?ajax=photo&u='.attribute_escape($url); ?>');450 447 jQuery.ajax({ 451 448 type: "GET", … … 474 471 <?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { ?> 475 472 show('video'); 476 473 <?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?> 477 474 show('photo'); 478 475 <?php } ?> … … 507 504 <h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2> 508 505 <div class="editor-container"> 509 <textarea name="content" id="content" style="width:100%;" class="mceEditor" ><?php if ($selection) { echo wp_richedit_pre($selection); } ?><a href="<?php echo $url ?>"><?php echo $title; ?></a>.</textarea>506 <textarea name="content" id="content" style="width:100%;" class="mceEditor" rows="15"><?php if ($selection) { echo wp_richedit_pre($selection); } ?><a href="<?php echo $url ?>"><?php echo $title; ?></a>.</textarea> 510 507 </div> 511 508 </div>
Note: See TracChangeset
for help on using the changeset viewer.