Ticket #7732: press-this_9-27-08.patch
| File press-this_9-27-08.patch, 4.2 KB (added by , 18 years ago) |
|---|
-
wp-admin/press-this.php
117 117 case 'video': ?> 118 118 <script type="text/javascript" charset="utf-8"> 119 119 jQuery('.select').click(function() { 120 append_editor(jQuery('#embed-code'). html());120 append_editor(jQuery('#embed-code').val()); 121 121 }); 122 122 jQuery('.close').click(function() { 123 123 jQuery('#extra_fields').hide(); … … 125 125 </script> 126 126 <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2> 127 127 <div class="titlewrap" > 128 <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo format_to_edit($selection); ?></textarea>128 <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo $selection; ?></textarea> 129 129 130 130 </div> 131 131 <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p> … … 177 177 <?php break; 178 178 case 'photo_images': 179 179 function get_images_from_uri($uri) { 180 if( preg_match('/\.(jpg|jpe|jpeg|png|gif) /', $uri) && !strpos($uri,'blogger.com') )180 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') ) 181 181 return "'".$uri."'"; 182 182 183 183 $content = wp_remote_fopen($uri); 184 184 if ( false === $content ) return ''; 185 185 186 186 $host = parse_url($uri); 187 187 188 188 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is'; … … 192 192 193 193 $sources = array(); 194 194 foreach ($matches[3] as $src) { 195 error_log($src); 195 196 // if no http in url 196 197 if(strpos($src, 'http') === false) 197 198 // if it doesn't have a relative uri … … 257 258 if(length == 0) length = 1; 258 259 jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>'); 259 260 jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>'); 260 append_editor("\n\n" + '<p style="text-align: center;"><a href="<?php echo urlencode($url); ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>');261 insert_editor("\n\n" + '<p style="text-align: center;"><a href="<?php echo $url; ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>'); 261 262 } 262 tinyMCE.activeEditor.resizeToContent();263 /*tinyMCE.activeEditor.resizeToContent();*/ 263 264 return false; 264 265 } 265 266 … … 342 343 remove_linebreaks : true, 343 344 accessibility_focus : false, 344 345 tab_focus : ":next", 345 plugins : "safari, inlinepopups, media",346 plugins : "safari, inlinepopups, media", 346 347 entities : "38,amp,60,lt,62,gt", 347 348 force_p_newlines : true, 348 349 save_callback : 'switchEditors.saveCallback' … … 372 373 if ( '' == text || '<p></p>' == text ) text = '<p><br /></p>'; 373 374 if ( tinyMCE.activeEditor ) tinyMCE.execCommand('mceSetContent', false, text); 374 375 } 375 376 function insert_editor(text) { 377 if ( '' != text && tinyMCE.activeEditor ) tinyMCE.execCommand('mceInsertContent', false, '<p>' + tinymce.DOM.decode(text) + '</p>'); 378 } 376 379 function append_editor(text) { 377 if ( '' != text && tinyMCE.activeEditor ) tinyMCE.execCommand('mceSetContent', false, tinyMCE.activeEditor.getContent({format : 'raw'}) 378 + '<p>' + tinymce.DOM.decode(text) + '</p>'); 380 if ( '' != text && tinyMCE.activeEditor ) tinyMCE.execCommand('mceSetContent', false, tinyMCE.activeEditor.getContent({format : 'raw'}) + '<p>' + text + '</p>'); 379 381 tinyMCE.execCommand('mceCleanup'); 380 382 } 381 383 … … 532 534 <h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2> 533 535 534 536 <div class="editor-container"> 535 <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><?php if($selection) echo '.'; ?></textarea>537 <textarea name="content" id="content" style="width:100%;" class="mceEditor" rows="15"><?php if ($selection) { echo wp_richedit_pre($selection); } ?><p>via <a href="<?php echo $url ?>"><?php echo $title; ?></a></p><?php if($selection) echo '.'; ?></textarea> 536 538 </div> 537 539 </div> 538 540 </div>
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)