Changeset 8996
- Timestamp:
- 09/27/2008 06:21:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/press-this.php
r8959 r8996 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() { … … 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> … … 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 … … 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) … … 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 } … … 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, … … 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 } … … 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>
Note: See TracChangeset
for help on using the changeset viewer.